Skip to content

feat: ⌘Y / ⌘P shortcuts for history and pin on the translate window - #33

Merged
iuhoay merged 1 commit into
mainfrom
feat/translate-window-pin-history-shortcuts
Jun 14, 2026
Merged

feat: ⌘Y / ⌘P shortcuts for history and pin on the translate window#33
iuhoay merged 1 commit into
mainfrom
feat/translate-window-pin-history-shortcuts

Conversation

@iuhoay

@iuhoay iuhoay commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

Adds keyboard shortcuts for the translation window's last two mouse-only toolbar controls:

  • ⌘Y — toggle Translation History (the de-facto macOS history shortcut, à la Safari / Finder)
  • ⌘P — pin / unpin the window

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 the TextEditor holds focus, and binding inline keeps them self-documenting.

  • Each tooltip now shows its shortcut (e.g. Translation History (⌘Y)), matching the existing Close (Esc) / mode-segment hints.
  • The pin tooltip reflects state: Pin window (⌘P) / Unpin window (⌘P).
  • ⌘H was deliberately avoided — it's the system "Hide application" shortcut.

Localization

Localizable.xcstrings gains zh-Hans for the three new tooltip strings (翻译历史(⌘Y), 置顶窗口(⌘P), 取消置顶(⌘P)). The bare Pin window key is removed (replaced by the two stateful keys); Translation History stays because the window title, nav title, and menu item still use it.

Testing

  • Full universal Debug build via xcodebuild -target LumoBUILD SUCCEEDED.
  • Localizable.xcstrings validated as well-formed JSON with all new keys present.

🤖 Generated with Claude Code

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>
@iuhoay
iuhoay merged commit ec4576f into main Jun 14, 2026
1 check passed
@iuhoay
iuhoay deleted the feat/translate-window-pin-history-shortcuts branch June 14, 2026 08:44
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