fix: tab rename never worked — window.prompt is a no-op in the webview#224
Open
PathGao wants to merge 1 commit into
Open
fix: tab rename never worked — window.prompt is a no-op in the webview#224PathGao wants to merge 1 commit into
PathGao wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 returnsnullimmediately and the whole flow falls through with no feedback.Fixes:
Modalcomponent 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-keyy/nconfirm/cancel shortcuts are suppressed (typing a filename containing "y" must not confirm the dialog);Enter/Escapestill work.window.prompt, reusing the existingmenu.renameFile/menu.renamestrings — no new translation keys.🤖 Generated with Claude Code