feat: ⌘Y / ⌘P shortcuts for history and pin on the translate window - #33
Merged
Merged
Conversation
Round out the translation window's keyboard story: the toolbar's two
remaining mouse-only controls now have shortcuts.
- ⌘Y toggles the translation history (the de-facto macOS history
shortcut — Safari, Finder).
- ⌘P pins/unpins the window.
Both bind directly on the visible toolbar buttons (like the Run button's
⌘↵) rather than the hidden shortcut group, so they still fire while the
TextEditor holds focus and stay self-documenting. Each tooltip now shows
its shortcut, and the pin tooltip reflects state ("Pin"/"Unpin window").
⌘H is deliberately avoided — it's the system "Hide application" shortcut.
The bare "Pin window" string is replaced by the two stateful tooltip
keys; "Translation History" stays since the window title, nav title, and
menu item still use it.
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.
What
Adds keyboard shortcuts for the translation window's last two mouse-only toolbar controls:
This rounds out the keyboard-first window from #32 (⌘1/⌘2/⌘3 modes, ⌘R regenerate, ⌘↵ run, Esc close).
How
Both shortcuts bind directly on the visible toolbar buttons — the same approach as the Run button's
⌘↵— rather than the hidden shortcut group used for the segmented picker. Visible buttons' key equivalents still fire while theTextEditorholds focus, and binding inline keeps them self-documenting.Translation History (⌘Y)), matching the existingClose (Esc)/ mode-segment hints.⌘Hwas deliberately avoided — it's the system "Hide application" shortcut.Localization
Localizable.xcstringsgains zh-Hans for the three new tooltip strings (翻译历史(⌘Y),置顶窗口(⌘P),取消置顶(⌘P)). The barePin windowkey is removed (replaced by the two stateful keys);Translation Historystays because the window title, nav title, and menu item still use it.Testing
xcodebuild -target Lumo→ BUILD SUCCEEDED.Localizable.xcstringsvalidated as well-formed JSON with all new keys present.🤖 Generated with Claude Code