Add menu actions and shortcuts for last transcription and history#141
Open
prateek wants to merge 3 commits into
Open
Add menu actions and shortcuts for last transcription and history#141prateek wants to merge 3 commits into
prateek wants to merge 3 commits into
Conversation
Add three local menu-bar affordances and make two of them user-configurable global hotkeys, reusing the existing ChordAction / HotkeyMonitor / ChordEngine / ShortcutRecorderView system: - Copy Last Transcription: AppState.lastTranscription captured once at the dictation-finalization funnel (cleaned-or-raw, dictation only); menu button disabled until the first dictation. - History: opens Settings -> History (.transcriptionLab). - Configurable shortcuts: new one-shot ChordAction cases .copyLastTranscription / .openHistory fire on the chord's key-down edge via a new ChordEngine .fireSimpleAction effect (latched against double-fire) and a HotkeyMonitor onSimpleAction callback that hops to @mainactor. Unset by default; two ShortcutRecorderView rows added to Settings -> General. Tests: ChordEngine one-shot fire/repeat-suppression/re-entry, AppState funnel capture, default-unset bindings, and pasteboard no-op. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the firedSimpleAction latch with previous-pressed-set edge detection: a simple action fires only when its chord is completed by adding a key, not when a larger held set collapses back onto it. This also closes the overlapping-chord case (one simple chord a strict superset of another), where releasing the extra key would re-fire the smaller chord. Stateless and uniform across the event and polling-sync paths. Also: keep the prior lastTranscription on an empty cleanup result; drop a dead assignment and trim redundant comments. Adds an overlapping-chord regression test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 #140.
What changed
Adds two menu bar actions:
Adds optional global shortcuts for both actions under Settings > General > Shortcuts. Both are unset by default.
Implementation notes
AppState.lastTranscriptionat the dictation finalization path inprocessRecordingResult. Empty final text does not erase the previous value.ChordActioncases for copy and history.ChordEnginefires them on the key-down edge only, so held keys, auto-repeat, and superset chord release do not double-fire.HotkeyMonitor.onSimpleActionback toAppState.ShortcutRecorderViewrender optional chords as "Record Shortcut".Testing
xcodebuild -project GhostPepper.xcodeproj -scheme GhostPepper -destination 'platform=macOS' buildsucceeds on macOS 14.