Conversation
- replace playback waveform behavior with logo-bar pause and play symbols - let the keyboard cancel and speak controls stop active TTS playback while the center control pauses and resumes - add paused playback state and pause/resume IPC publishing across the keyboard bridge - remove unused playback metering plumbing and update the iOS codemap and engineering docs
- publish copied-text playback progress through the shared keyboard IPC bridge - overlay an indigo transport arc on the keyboard logo bar during active playback - keep the keyboard playback ring in sync across pause, resume, finish, failure, and replay restore states - document the new shared playback progress key and keyboard transport ring behavior
…etary visuals - move keyboard logo transport state, accessibility, and playback presentation inputs into KeyboardTransportDisplayState - keep KeyboardLogoBarView focused on proprietary drawing, layout, and animation behavior only - update the iOS codemap and engineering notes to document the visual-only licensing boundary
- add a dedicated spring return animation for the keyboard microphone icon - trigger the transport-to-microphone spring when keyboard playback hands control back to idle
- group keyboard core files into Dictation, Feedback, Input, Text, and Transport folders - move KeyboardLayoutGeometry into Core and keep shared state, style, and layout primitives at the core root - update the Xcode project path exceptions plus the iOS codemap and engineering docs to match the new structure
📝 WalkthroughWalkthroughAdds TTS pause/resume and playback-progress sharing, introduces a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant KeyboardVC as KeyboardViewController
participant TTSCtrl as KeyboardTTSController
participant IPCMgr as KeyboardIPCManager
participant AppBridge as KeyVoxKeyboardBridge
participant TTSMgr as TTSManager
User->>KeyboardVC: Tap center icon (pause/resume)
KeyboardVC->>TTSCtrl: handlePlaybackControlTap()
alt was .speaking
TTSCtrl->>IPCMgr: sendPauseTTSCommand()
IPCMgr->>AppBridge: post pauseTTS notification
AppBridge->>TTSMgr: handlePauseTTS()
TTSMgr->>AppBridge: publishTTSPaused()
AppBridge->>IPCMgr: onTTSPaused callback
IPCMgr->>TTSCtrl: onTTSPaused -> handleTTSPaused()
TTSCtrl->>TTSCtrl: update state -> .pausedSpeaking
else was .pausedSpeaking
TTSCtrl->>IPCMgr: sendResumeTTSCommand()
IPCMgr->>AppBridge: post resumeTTS notification
AppBridge->>TTSMgr: handleResumeTTS()
TTSMgr->>AppBridge: publishTTSResumed()
AppBridge->>IPCMgr: onTTSResumed callback
IPCMgr->>TTSCtrl: onTTSResumed -> handleTTSResumed()
TTSCtrl->>TTSCtrl: update state -> .speaking
end
sequenceDiagram
participant TTS as TTSManager
participant Bridge as KeyVoxKeyboardBridge
participant IPC as KeyboardIPCManager
participant VC as KeyboardViewController
participant Logo as KeyboardLogoBarView
TTS->>Bridge: publishTTSPlaybackProgress(0.45)
Bridge->>IPC: update shared playback progress state
IPC->>VC: deliver progress (via currentTTSPlaybackProgress)
VC->>Logo: applyPlaybackProgress(0.45)
Logo->>Logo: update transportProgressLayer.strokeEnd & redraw
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
iOS/KeyVox Keyboard/Core/Transport/KeyboardIPCManager.swift (1)
161-170:⚠️ Potential issue | 🟠 MajorPaused transport gets evicted as stale too aggressively.
When
ttsStateis.playingandcurrentTTSIsPaused()istrue, this branch still clears shared TTS state after ~5 seconds without a warm session. Since pause/progress are now persisted inKeyVoxIPCBridge, reopening the keyboard after the app suspends will lose the paused transport and the resume path.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@iOS/KeyVox` Keyboard/Core/Transport/KeyboardIPCManager.swift around lines 161 - 170, The reconcileKeyboardStateIfNeeded() logic is incorrectly clearing persisted paused playback: when KeyVoxIPCBridge.currentTTSState() == .playing and KeyVoxIPCBridge.currentTTSIsPaused() == true you should not treat it as stale and evict it; update the stale-clear condition (which currently checks isSessionWarm() and KeyVoxIPCBridge.currentTTSStateAge() > 5) to first check KeyVoxIPCBridge.currentTTSIsPaused() and skip calling KeyVoxIPCBridge.clearTTSState() if paused, leaving the paused state to be returned as .pausedSpeaking; ensure you only clear when not paused and age > 5 and session is not warm so paused transports survive reopen/resume paths.iOS/KeyVox iOS/Core/TTS/TTSManager/TTSManager+State.swift (1)
19-20:⚠️ Potential issue | 🟠 MajorDon't clear the finished transport snapshot in the same task.
finishPlayback()publishes.finished/progress = 1, butclearActiveRequest()immediately publishesprogress = 0and callsKeyVoxIPCBridge.clearTTSState(). That makes the delayed cleanup inKeyVoxKeyboardBridge.publishTTSFinished()ineffective and turns the keyboard's end-of-playback ring update into a race.Also applies to: 78-92
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@iOS/Docs/ENGINEERING.md`:
- Around line 296-297: Documentation is inconsistent: add the new IPC keys
`pauseTTS`, `resumeTTS`, `ttsPaused`, and `ttsResumed` to the Darwin
notification list and ensure the documented runtime-structure no longer
references the removed file `TTSPlaybackCoordinator+Metering.swift`; instead
update it to reference the current TTS coordinator/meters file(s) and include
`ttsIsPaused` and `ttsPlaybackProgress` where appropriate (also apply the same
updates to the repeated section around lines 607-615) so the Darwin
notifications list and runtime-structure match the new IPC contract.
---
Outside diff comments:
In `@iOS/KeyVox` Keyboard/Core/Transport/KeyboardIPCManager.swift:
- Around line 161-170: The reconcileKeyboardStateIfNeeded() logic is incorrectly
clearing persisted paused playback: when KeyVoxIPCBridge.currentTTSState() ==
.playing and KeyVoxIPCBridge.currentTTSIsPaused() == true you should not treat
it as stale and evict it; update the stale-clear condition (which currently
checks isSessionWarm() and KeyVoxIPCBridge.currentTTSStateAge() > 5) to first
check KeyVoxIPCBridge.currentTTSIsPaused() and skip calling
KeyVoxIPCBridge.clearTTSState() if paused, leaving the paused state to be
returned as .pausedSpeaking; ensure you only clear when not paused and age > 5
and session is not warm so paused transports survive reopen/resume paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0a607a8a-6939-4306-a1a5-3cfae265a288
📒 Files selected for processing (34)
iOS/Docs/CODEMAP.mdiOS/Docs/ENGINEERING.mdiOS/KeyVox Keyboard/App/KeyboardViewController+PresentationLifecycle.swiftiOS/KeyVox Keyboard/App/KeyboardViewController.swiftiOS/KeyVox Keyboard/Core/Dictation/AudioIndicatorDriver.swiftiOS/KeyVox Keyboard/Core/Dictation/KeyboardCallObserver.swiftiOS/KeyVox Keyboard/Core/Dictation/KeyboardDictationController.swiftiOS/KeyVox Keyboard/Core/Feedback/KeyboardHapticsSettingsStore.swiftiOS/KeyVox Keyboard/Core/Feedback/KeyboardInteractionHaptics.swiftiOS/KeyVox Keyboard/Core/Feedback/KeyboardKeypressHaptics.swiftiOS/KeyVox Keyboard/Core/Input/KeyboardCursorTrackpadSupport.swiftiOS/KeyVox Keyboard/Core/Input/KeyboardSpecialKeyInteractionSupport.swiftiOS/KeyVox Keyboard/Core/Input/KeyboardTextInputController.swiftiOS/KeyVox Keyboard/Core/KeyboardLayoutGeometry.swiftiOS/KeyVox Keyboard/Core/KeyboardState.swiftiOS/KeyVox Keyboard/Core/Text/KeyboardCapsLockStateStore.swiftiOS/KeyVox Keyboard/Core/Text/KeyboardDictionaryCasingStore.swiftiOS/KeyVox Keyboard/Core/Text/KeyboardInsertionCapitalizationHeuristics.swiftiOS/KeyVox Keyboard/Core/Text/KeyboardInsertionSpacingHeuristics.swiftiOS/KeyVox Keyboard/Core/Transport/KeyboardIPCManager.swiftiOS/KeyVox Keyboard/Core/Transport/KeyboardTTSController.swiftiOS/KeyVox Keyboard/Core/Transport/KeyboardTransportDisplayState.swiftiOS/KeyVox Keyboard/Views/Components/KeyboardLogoBarView.swiftiOS/KeyVox Keyboard/Views/KeyboardRootView.swiftiOS/KeyVox iOS.xcodeproj/project.pbxprojiOS/KeyVox iOS/App/AppServiceRegistry.swiftiOS/KeyVox iOS/App/KeyVoxIPCBridge.swiftiOS/KeyVox iOS/App/KeyVoxKeyboardBridge.swiftiOS/KeyVox iOS/Core/TTS/TTSManager/TTSManager+State.swiftiOS/KeyVox iOS/Core/TTS/TTSManager/TTSManager.swiftiOS/KeyVox iOS/Core/TTS/TTSPlaybackCoordinator/TTSPlaybackCoordinator+Lifecycle.swiftiOS/KeyVox iOS/Core/TTS/TTSPlaybackCoordinator/TTSPlaybackCoordinator+Metering.swiftiOS/KeyVox iOS/Core/TTS/TTSPlaybackCoordinator/TTSPlaybackCoordinator+Scheduling.swiftiOS/KeyVox iOS/Core/TTS/TTSPlaybackCoordinator/TTSPlaybackCoordinator.swift
💤 Files with no reviewable changes (3)
- iOS/KeyVox iOS/Core/TTS/TTSPlaybackCoordinator/TTSPlaybackCoordinator+Metering.swift
- iOS/KeyVox iOS/Core/TTS/TTSPlaybackCoordinator/TTSPlaybackCoordinator.swift
- iOS/KeyVox iOS/Core/TTS/TTSPlaybackCoordinator/TTSPlaybackCoordinator+Lifecycle.swift
- keep paused TTS transport snapshots from being cleared during keyboard state reconciliation - preserve the finished playback progress snapshot until the bridge's delayed cleanup runs - update engineering docs for pause/resume transport notifications and the current TTS runtime structure
There was a problem hiding this comment.
🧹 Nitpick comments (1)
iOS/Docs/ENGINEERING.md (1)
608-609: Optional wording polish for repeated bullet openings.Both bullets starting with “
... owns ...” in sequence are correct, but rephrasing one can improve scan readability in this dense section.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@iOS/Docs/ENGINEERING.md` around lines 608 - 609, The two consecutive bullets both start with "owns", which is repetitive; revise one of them (either the TTSPlaybackCoordinator or TTSManager line) to use a different verb such as "manages", "is responsible for", or "handles" to improve scannability—e.g., change the TTSManager bullet to "TTSManager manages request lifecycle, playback-preparation progress, home-card replay state, replay cache persistence, paused replay restoration, App Group TTS state publishing, and the free-speak consumption point once a new generation has actually started."
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@iOS/Docs/ENGINEERING.md`:
- Around line 608-609: The two consecutive bullets both start with "owns", which
is repetitive; revise one of them (either the TTSPlaybackCoordinator or
TTSManager line) to use a different verb such as "manages", "is responsible
for", or "handles" to improve scannability—e.g., change the TTSManager bullet to
"TTSManager manages request lifecycle, playback-preparation progress, home-card
replay state, replay cache persistence, paused replay restoration, App Group TTS
state publishing, and the free-speak consumption point once a new generation has
actually started."
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f92c32ac-9995-4143-badf-773fdd39403f
📒 Files selected for processing (4)
iOS/Docs/ENGINEERING.mdiOS/KeyVox Keyboard/Core/KeyboardLayoutGeometry.swiftiOS/KeyVox Keyboard/Core/Transport/KeyboardIPCManager.swiftiOS/KeyVox iOS/Core/TTS/TTSManager/TTSManager+State.swift
✅ Files skipped from review due to trivial changes (1)
- iOS/KeyVox Keyboard/Core/KeyboardLayoutGeometry.swift
🚧 Files skipped from review as they are similar to previous changes (1)
- iOS/KeyVox Keyboard/Core/Transport/KeyboardIPCManager.swift
Summary
What Changed
CoreintoDictation,Feedback,Input,Text, andTransportgroupsKeyboardLayoutGeometryintoCoreand updated the Xcode project plus iOS architecture docs to matchWhy
Summary by CodeRabbit
New Features
Improvements
Documentation