diff --git a/CHANGELOG.md b/CHANGELOG.md index 98dd451..3fc8b34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Keyboard-first translation window: ⌘1 / ⌘2 / ⌘3 switch between Translate, Polish, and Summary, and ⌘R regenerates the current result. Each mode segment shows its shortcut hint. +- ⌘Y opens the translation history and ⌘P pins/unpins the window, matching the + toolbar buttons; both shortcuts are shown in the buttons' tooltips. - Markdown tables in results now render as a bordered grid instead of raw `| --- |` pipe-and-dash text. All other output stays as plain, selectable, copyable text. diff --git a/mac-app/Lumo/Localizable.xcstrings b/mac-app/Lumo/Localizable.xcstrings index 3a95a10..40f6ede 100644 --- a/mac-app/Lumo/Localizable.xcstrings +++ b/mac-app/Lumo/Localizable.xcstrings @@ -231,12 +231,12 @@ } } }, - "Pin window" : { + "Pin window (⌘P)" : { "localizations" : { "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "置顶窗口" + "value" : "置顶窗口(⌘P)" } } } @@ -511,6 +511,16 @@ } } }, + "Translation History (⌘Y)" : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "翻译历史(⌘Y)" + } + } + } + }, "Translation History…" : { "localizations" : { "zh-Hans" : { @@ -521,6 +531,16 @@ } } }, + "Unpin window (⌘P)" : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "取消置顶(⌘P)" + } + } + } + }, "View on GitHub" : { "localizations" : { "zh-Hans" : { diff --git a/mac-app/Lumo/Views/TranslationView.swift b/mac-app/Lumo/Views/TranslationView.swift index 358d1ba..438c79c 100644 --- a/mac-app/Lumo/Views/TranslationView.swift +++ b/mac-app/Lumo/Views/TranslationView.swift @@ -125,12 +125,17 @@ struct TranslationView: View { Button { HistoryWindowController.shared.toggle() } label: { Image(systemName: "clock.arrow.circlepath") } - .help("Translation History") + // ⌘Y is the de-facto macOS history shortcut (Safari, Finder). Like + // the Run button, this visible control carries its shortcut directly + // and still fires while the TextEditor holds focus. + .keyboardShortcut("y", modifiers: .command) + .help("Translation History (⌘Y)") Button { model.togglePin() } label: { Image(systemName: model.isPinned ? "pin.fill" : "pin") } - .help("Pin window") + .keyboardShortcut("p", modifiers: .command) + .help(model.isPinned ? "Unpin window (⌘P)" : "Pin window (⌘P)") Button { model.dismiss() } label: { Image(systemName: "xmark")