Repository navigation
fix(looks): Save works in the desktop app — no more window.prompt - #147
Conversation
… Save silently did nothing
|
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
Reviewed commit: 8518344 |
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
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
- 🟡 Auto-named
Look Ncollides after a delete — looks-tab.tsx:51
| 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}`); |
There was a problem hiding this comment.
🟡 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.
Summary
Looks didn't save when running locally in the Electron desktop app. Cause:
LooksTabusedwindow.prompt()to ask for a name; Electron does not implementprompt()(returnsnull), soif (name === null) return;aborted every Save silently. Rename had the same issue and Delete usedwindow.confirm.Changes in
components/looks-tab.tsx, UI only:Look N(no dialog).×deletes immediately.prompt/confirmleft 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