Repository navigation
Conversation
…n Core The router's decision (the grant, the sustained secure-input reading, the first observation's stand-in, a chord change with the last reading) moves out of the app into `HotkeyRouting`, which returns one `Change` carrying the source and the stand-in together. `HotkeyRouter` keeps the monitors and hands each change to the coordinator in one update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… output seam `TextOutput` gains `copy` as a requirement, which `PasteboardOutput` already served. `DictationCoordinator.copyLastTranscript` copies the last transcript through it, so the menu's copy is tested in Core against the fake output, and `AppModel` no longer keeps the output itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task
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.
Part of #73, point 1.
This is option (b) of the issue's point 1: the two app-target decisions that round two found bugs in move into Core as values and seams, where the existing tests reach them. There is no app test target.
What
HotkeyRouting(new,Sources/PladderCore/HotkeyRouting.swift). It does the deciding thatHotkeyRouterused to do: the grant, the sustained Secure Event Input reading, the stand-in at the first observation, and a chord change that uses the last reading.observe(accessibilityTrusted:secureInputEnabled:at:)returns oneChangethat carries both the new source and the stand-in, or nil when nothing changed.hotkeyChanged(to:)returns the new source, if there is one.HotkeyRouterkeeps the two monitors, the weak coordinator,systemShortcutsanddisplayName. Itsupdatenow makes a single coordinator call with both fields, so a grant flip still restarts the monitor once (4187a7e). The router writes its observableroutingonly when the value changed, so a poll with nothing new invalidates no view, the same as the oldif trusted != accessibilityTrustedguard. The tests are inHotkeyRoutingTests: grant flip, first observation, a quiet poll, secure input at 0/2/4 s, a modifier-only chord staying on the tap, a chord change using the last reading, and a few edge cases. One more test applies aChangeto a real coordinator with fake monitors and checks that the new monitor starts once, with the stand-in.TextOutput.copyis now a protocol requirement with no default.PasteboardOutput.copyalready had the right signature, so it keeps the nspasteboard.org markers and still ends a pending restore.DemoOutputand the tests'FakeOutputimplement it, and nothing else conforms (pladder-clihas noTextOutputof its own).DictationCoordinator.copyLastTranscript()copieslastTranscript?.textthrough it and does nothing when there is no transcript.AppModel.copyLastTranscriptdelegates to it, and AppModel's storedoutputis gone. The new tests arecopyingTheLastTranscriptGoesThroughTheOutputandcopyingWithNoLastTranscriptDoesNothing.The docs are updated: ARCHITECTURE "Tap and Carbon", "The app" and "Paste and clipboard", and the app-split line of CLAUDE.md. No section names changed.
Differences from the plan
HotkeyRouting.observealso returns aChangewhen the stand-in changes without a flip. This cannot happen today: with the chord fixed, a grant change that changes the stand-in also changes the source. It keeps theChangecomplete without depending on that. In every reachable case the behaviour is the same as before.Release path
Nothing here is on the release path, between
recordingStoppedandinserted.copyLastTranscriptis a separate method, and the router runs on the permission poll and on settings changes. No benchmark is needed.swift buildhas no warnings andswift testis green.🤖 Generated with Claude Code