feat: keyboard-first translation window (⌘1/⌘2/⌘3, ⌘R) - #32
Merged
Conversation
Round out the window's keyboard story so the mouse is optional: - ⌘1 / ⌘2 / ⌘3 switch to Translate / Polish / Summary via setMode, with hidden shortcut buttons (a segmented Picker can't host per-segment shortcuts) that fire even while the input field holds focus. - ⌘R regenerates the current mode, gated by the same disabled rule as the action button. - Each mode segment shows its ⌘-number hint, since the picker can't carry a per-segment tooltip. - The action button is now mode-agnostic "Run" instead of always "Translate", which was wrong in Polish and Summary modes. - Rename the "Summarize" mode to the shorter "Summary" so the wider picker still fits the window's 440pt minimum width; this also matches the result label, which already read "Summary". Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Closes #22.
Rounds out the floating translation window's keyboard story so the mouse is optional. The window already had ⌘↵ (run), Esc (close), and ⇥ (paste-and-translate); this adds mode switching and regenerate, and fixes a couple of labels that the new shortcuts exposed.
Changes
setMode(_:). Wired through hidden buttons (a segmentedPickercan't host per-segment.keyboardShortcut); they stay in the view tree so the shortcuts fire even while the input field holds focus.Translate ⌘1 | Polish ⌘2 | Summary ⌘3, since the picker can't carry a per-segment tooltip.Verification
Built (Debug) and driven in the running Dev app:
No automated tests in this repo. The
var idreformat inTranslationMode.swiftis the project's swift-format hook.🤖 Generated with Claude Code