Skip to content

fix: tab rename never worked — window.prompt is a no-op in the webview#224

Open
PathGao wants to merge 1 commit into
alecdotdev:masterfrom
PathGao:codex/fix-rename-prompt
Open

fix: tab rename never worked — window.prompt is a no-op in the webview#224
PathGao wants to merge 1 commit into
alecdotdev:masterfrom
PathGao:codex/fix-rename-prompt

Conversation

@PathGao

@PathGao PathGao commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Tab rename has never worked: window.prompt() is a silent no-op inside the webview. wry does not implement the native JS dialogs (alert/confirm/prompt), so the rename handler's prompt returns null immediately and the whole flow falls through with no feedback.

Fixes:

  • The existing Modal component gains an optional input mode — same header/body/footer chrome and theme variables, with the text field focused and pre-selected on open. While the input has focus, the modal's single-key y/n confirm/cancel shortcuts are suppressed (typing a filename containing "y" must not confirm the dialog); Enter/Escape still work.
  • Rename goes through this modal instead of window.prompt, reusing the existing menu.renameFile / menu.rename strings — no new translation keys.
  • The context-menu item is disabled for tabs without a real file path (untitled/home): rename renames the file on disk, and those tabs previously no-oped silently as well.

🤖 Generated with Claude Code

wry does not implement the native JS dialogs, so window.prompt()
returns null immediately and the rename handler silently fell
through for every tab. Add an input mode to the existing Modal
(focused + preselected text; the y/n confirm/cancel key shortcuts
are suppressed while typing) and route rename through it. Also
disable the menu item for tabs without a real file path — renaming
renames the file on disk, and untitled/HOME tabs previously no-oped
with no feedback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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