Skip to content

fix(looks): Save works in the desktop app — no more window.prompt - #147

Merged
pyramation merged 1 commit into
mainfrom
devin/1790293230-looks-save-electron
Sep 24, 2026
Merged

pyramation merged 1 commit into
mainfrom
devin/1790293230-looks-save-electron

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Looks didn't save when running locally in the Electron desktop app. Cause: LooksTab used window.prompt() to ask for a name; Electron does not implement prompt() (returns null), so if (name === null) return; aborted every Save silently. Rename had the same issue and Delete used window.confirm.

Changes in components/looks-tab.tsx, UI only:

  • Save saves immediately as Look N (no dialog).
  • Edit mode: tapping a tile shows an inline text input over the name (Enter/blur commits, Esc cancels); × deletes immediately.
  • No prompt/confirm left in the UI.

Server, protocol and receiver unchanged.

Link to Devin session: https://app.devin.ai/sessions/c4872c2982734093bdee80d04a7d5ceb
Open in Devin Desktop: https://app.devin.ai/desktop/session/c4872c2982734093bdee80d04a7d5ceb?variant=devin
Requested by: @pyramation

@luxor-code-review

luxor-code-review Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review complete. 🟡 1 medium

💬 Inline comments (1)


This change reworks the Looks tab to remove browser-native dialogs: saving a look now auto-names it Look <N> without prompting, and renaming happens inline in edit mode via a double-tap into a text input committed with Enter, Escape, or blur.

Files Change
packages/ui/src/components/looks-tab.tsx Swaps window.prompt save naming for automatic Look N names, replaces window.confirm deletion with an immediate delete, and adds inline edit-mode renaming with focus/escape/blur handling.

Reviewed commit: 8518344

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation
pyramation merged commit 50887f9 into main Sep 24, 2026
6 checks passed

@luxor-code-review luxor-code-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaces the native window.prompt/window.confirm look save/delete flow in the Looks tab with inline rename and immediate delete, suitable for Electron's embedded UI.

Key findings

onSave(name);
// No window.prompt/confirm: Electron's embedded UI has no prompt() at all, so
// Save names the look itself and renaming happens inline in Edit mode.
const save = () => onSave(`Look ${looks.length + 1}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 bug · medium

Auto-named Look N collides after a delete

save unconditionally sends Look ${looks.length + 1} (packages/ui/src/components/looks-tab.tsx:51), but the counter is list-length based and names are never renumbered on delete. After saving three looks and deleting any one, the next Save produces a name that already exists (e.g. a second "Look 3"); the server's cleanName fallback (packages/server/src/looks.ts:45) applies the same length-based scheme with no uniqueness check. Previously window.prompt defaulted to the same value but let the operator override a collision — that escape hatch is gone, and duplicate labels make Edit-mode rename/delete ambiguous across iPads since only look.id distinguishes tiles.

📋 Prompt for AI Agents

In packages/ui/src/components/looks-tab.tsx line 51, replace onSave(Look ${looks.length + 1}) with a helper that scans the existing looks array for names matching /^Look (\d+)$/, takes the maximum number found, and sends Look ${max + 1} (fall back to looks.length + 1 when no numbered names exist). This prevents a deleted look's number from being reused, so auto-generated names never collide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant