Repository navigation
Conversation
Greptile SummaryThis PR adds a listening-state toggle for the desktop app: a
Confidence Score: 3/5The pause direction works correctly, but resuming listening leaves the transcription pipeline stopped while the UI reports Listening, so users silently lose recordings after every pause/resume cycle. The resume path in setListening sets the flag but never calls startTranscription(), meaning the device appears active to the user but captures nothing. Both audio-delivery closures also read a @MainActor-isolated property from background audio threads without actor hopping. The rest of the change — shortcut wiring, persistence, analytics, UI surfaces — is well-structured and follows existing patterns. AppState.swift — specifically setListening (resume branch) and the two audio-callback closures that bypass main-actor isolation. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
U([User action: UI / hotkey / sidebar]) --> TL[toggleListening]
TL --> SL[setListening on/off]
SL -->|on = false| ST[stopTranscription]
ST --> SAC[stopAudioCapture + clearTranscriptionState]
SAC --> FLAG_OFF[isConversationListening = false\npersisted to UserDefaults]
SL -->|on = true| FLAG_ON[isConversationListening = true\npersisted to UserDefaults]
FLAG_ON -. missing call .-> NOSTART[startTranscription NOT called - recording stays stopped]
FLAG_OFF --> MIC_GUARD[audioMixer callback - guard isConversationListening from background thread]
FLAG_OFF --> BLE_GUARD[conversationAudioHandler - guard isConversationListening from background thread]
MIC_GUARD -->|blocked| DROP1[audio dropped]
BLE_GUARD -->|blocked| DROP2[audio dropped]
GSM[GlobalShortcutManager Carbon hotkey] --> NC[NotificationCenter toggleListeningShortcutPressed]
NC --> TL
Reviews (1): Last reviewed commit: "fix(desktop): stop transcription on paus..." | Re-trigger Greptile |
| func setListening(_ on: Bool, source: String = "ui") { | ||
| let previous = isConversationListening | ||
| guard previous != on else { return } | ||
|
|
||
| if !on && isTranscribing { | ||
| stopTranscription() | ||
| } | ||
|
|
||
| isConversationListening = on | ||
| persistedConversationListening = on | ||
| UserDefaults.standard.set(on, forKey: Self.conversationListeningDefaultsKey) | ||
|
|
||
| AnalyticsManager.shared.listeningToggled(isListening: on, source: source) | ||
| log("listening: \(previous ? "on" : "off") -> \(on ? "on" : "off") (source=\(source))") | ||
| } |
There was a problem hiding this comment.
Resume doesn't restart transcription
setListening(false) calls stopTranscription(), which calls stopAudioCapture() and clearTranscriptionState() — fully tearing down the pipeline and setting isTranscribing = false. But setListening(true) only flips the flag; it never calls startTranscription(). After the user resumes, isConversationListening is true and the sidebar shows "Listening," yet no recording is happening. The user must manually press play to restart, which silently contradicts the visual affordance of the toggle.
| // Start the mixer — it sums mic + system into a mono stream and forwards it to | ||
| // the transcription WebSocket. | ||
| audioMixer?.start { [weak self] monoMixed in | ||
| guard self?.isConversationListening == true else { return } | ||
| self?.transcriptionService?.sendAudio(monoMixed) | ||
| } |
There was a problem hiding this comment.
Cross-actor read of
@MainActor-isolated property from audio thread
AppState is @MainActor-isolated, so isConversationListening must only be accessed from the main thread. The closure passed to audioMixer?.start runs on whichever background thread the audio subsystem uses, making self?.isConversationListening a cross-actor access. A matching problem exists in the conversationAudioHandler closure at the BLE path (line 1566). Under Swift 6 strict concurrency this is a compile error; under Swift 5.x it is a runtime data race that can yield stale reads. Dispatch the check to the main actor, or promote both closures to @MainActor to keep the isolation correct.
| isConversationListening = on | ||
| persistedConversationListening = on | ||
| UserDefaults.standard.set(on, forKey: Self.conversationListeningDefaultsKey) |
There was a problem hiding this comment.
Triple-write to the same UserDefaults key
@AppStorage already synchronises persistedConversationListening to UserDefaults automatically. The explicit UserDefaults.standard.set(on, forKey:) call on the line below is redundant and could mislead future readers into thinking @AppStorage doesn't update the store itself.
| isConversationListening = on | |
| persistedConversationListening = on | |
| UserDefaults.standard.set(on, forKey: Self.conversationListeningDefaultsKey) | |
| isConversationListening = on | |
| persistedConversationListening = on |
…or isolation, UserDefaults) - P1 (resume doesn't restart): setListening(true) now calls startTranscription() when not already transcribing. The existing startTranscription guards (isConversationListening + device/mic) keep the no-op cases safe. - P1 (cross-actor read on audio thread): added a nonisolated NSLock-guarded conversationListeningSnapshot, updated from setListening on the MainActor. Both the audio mixer closure (~line 1483) and the BLE conversationAudioHandler (~line 1582) now read snapshotIsConversationListening() instead of the @MainActor-isolated isConversationListening, removing the runtime data race under Swift 5 and the strict-concurrency error under Swift 6 without paying a main-actor hop per audio chunk. - P2 (triple-write to UserDefaults): dropped the explicit UserDefaults.standard.set call; @AppStorage already syncs persistedConversationListening, and the new helper updates the in-memory snapshot only.
|
Addressed in 7609650:
Verified locally: |
kodjima33
left a comment
There was a problem hiding this comment.
desktop feature but mergeStateStatus BLOCKED — approve only
|
Thanks for this, @mvanhorn — solid implementation of #6649. The feature fits the request well: one-click toggle, clear indicator across three surfaces, persistence, and a rebindable hotkey. Nice touch keeping Push-to-Talk independent. A few observations from reviewing the current head ( Note on the Greptile P1 comments above: those appear to be from an earlier revision. The current code already addresses both:
Merge conflict: GitHub reports this as Minor (optional): The explicit Once rebased, this looks good to me. Appreciate the included test for persistence across reloads. |
|
Independently verified the current head (
Feature fits #6649 well — clean implementation that follows the existing shortcut/analytics patterns. The only thing between this and merge is a rebase onto Thanks @mvanhorn! |
|
Thanks @mvanhorn — independently reviewed the current head (
Heads up on the rebase: this branch is ~3100 commits behind The |
7609650 to
6c7b738
Compare
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for this well-structured feature — the listening-pause toggle with persistence, a rebindable hotkey, and multiple UI surfaces is a cohesive answer to #6649. The NSLock-guarded snapshot for audio-callback access and the GlobalShortcutManager fix (passing the actual HotKeyID instead of hardcoding askOmi) are solid. Requesting changes for two concrete CI failures plus the rebase:
1. SwiftLint omi_inline_userdefaults_key violations (ShortcutSettings.swift:339, :650) — the new shortcut_toggleListeningEnabled and shortcut_toggleListeningKey UserDefaults accesses use inline string keys. The repo requires typed keys via DefaultsKey.swift. (Note: the existing askOmiEnabled follows the same pre-rule pattern, but new code must comply with the active rule.)
2. Line-count ratchet exceeded on 4 files (AppState+Transcription.swift 1608→1653, FloatingControlBarView.swift 2704→2745, FloatingControlBarWindow.swift 4934→4952, SidebarView.swift 1507→1545). Either split the new logic into extensions/subviews or raise each baseline with a one-line justification in the corresponding JSON under .github/scripts/product_file_line_count_ratchet_baseline/.
3. The needs-rebase label is present — please rebase onto main.
Per-file notes:
- AppState.swift —
@AppStorage+ inlineUserDefaults.standard.objectinitializer is reasonable. ThetoggleListeningShortcutObservercleanup in deinit is correct. - AppState+Transcription.swift — The guard in
startTranscription()correctly prevents auto-start while paused. TheconversationAudioHandlerclosure withsnapshotIsConversationListening()gating properly drops audio frames at the source when paused — good privacy posture. Minor:snapshotIsConversationListening()isprivatebutsetConversationListeningSnapshot()is not; consider consistent visibility. - BleAudioService.swift — Adding
conversationAudioHandleras a separate channel (withtranscriptionServicenow nil for BLE) is clean — it decouples audio delivery from transcription ownership and lets the listening gate control flow. - GlobalShortcutManager.swift — The
IdentifiedHotKeyRegistrarrefactor passinghotKeyIDRawValuethrough toregisterWithCarbonfixes a latent issue where all hotkeys sharedaskOmi.rawValueas their Carbon EventHotKeyID. - FloatingControlBarView.swift —
@ObservedObject var appState: AppState = AppState.current ?? AppState(): theAppState()fallback creates a throwaway instance ifAppState.currentis nil, which could diverge from the real app state. Consider making it optional or asserting. - FloatingControlBarWindow.swift — The designated
init(appState:)+ convenience fallback is a clean DI pattern. - ShortcutSettings.swift — Follows the existing askOmi shortcut structure faithfully; just needs
DefaultsKey.swiftmigration for the lint rule. - ShortcutsSettingsSection.swift — The toggle-listening key card mirrors the askOmi card pattern well.
- SidebarView.swift — The listening toggle button with ear.fill/ear.slash.fill and color states is clear UX.
- AnalyticsManager.swift —
listeningToggledemits standard Sentry breadcrumb + PostHog event — consistent with existing telemetry patterns. - AppStateListeningTests.swift — Good coverage of persistence/reload. Consider adding a test for the audio-gating behavior (paused state drops frames).
Leaving for human maintainer review for the listening-pause product/UX direction and the privacy implication of audio-capture gating.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
6c7b738 to
fff6b3e
Compare
|
Thanks for the detailed review. Pushed the changes:
I kept the snapshot setter internal because Tests: |
95fc863 to
d129149
Compare
|
Rebased onto current main (it was 427 commits behind) and pushed. The new shortcut keys go through |
4b369ea to
56ad805
Compare
|
@Git-on-my-level all three are addressed and CI is green on 56ad805. SwiftLint typed keys were already on the branch: Line-count ratchet: added the four Rebase: you were right to ask for it and I initially dismissed it because the PR reported mergeable. It was still needed. CI diffs against an older main than I had fetched, and that alone was failing Clearing those surfaced two more gates, both now satisfied: |
|
Maintainer note on 56ad805: the Aug 12 review items (typed DefaultsKey, line-count exceptions, path rebase onto desktop/macos) look addressed on this SHA. I am not approving it. This head is CONFLICTING/DIRTY again on DefaultsKey.swift and SidebarView.swift. Please rebase onto current main — do not resolve those in the web editor. The larger issue: main already has a listening control. CaptureListeningLogic.cycleListening is Off → Always On → Only Meetings from the dashboard and the top bar (#11520 / #12810). This PR adds a second persisted flag (isConversationListening) plus UI that can say “Listening” independently of that mode. #6649 is still real (pause without quitting, hotkey), but two sources of truth will drop recordings. After rebase, this pause needs to be the same state machine as audioRecordingMode (or an explicit overlay on it with tests), not a parallel @AppStorage. Also please state in the PR that pause keeps mic/BLE up and only gates transcription — that is the privacy behavior, and it is not the same as Off. |
56ad805 to
0a8dffb
Compare
|
Rebased onto current main and reworked the state handling. Thanks for the detailed note, the two-sources-of-truth concern was right. On the rebase: main had deleted On the design: pause is now an explicit overlay on
To state the privacy behavior explicitly, as you asked: pause keeps the mic and BLE capture up and gates only transcription forwarding. It is deliberately not equivalent to Off, which tears capture down. The mode control still reads Always On / Only Meetings while transcription is gated. Tests cover pause and resume across every Also fixed the three review-bot findings: the audio callbacks now read a lock-protected snapshot through a
|
|
Re-review on 0a8dffb. The overlay rewrite is the right shape: isTranscriptionPaused does not write audioRecordingMode, isConversationListening is computed from CaptureListeningLogic.shouldForwardTranscriptionAudio, and the tests pin pause/resume across every mode without tearing capture. The SidebarView resurrection is gone. That answers the two-sources-of-truth note on 56ad805. I am not approving this SHA. Hygiene is red on product-file-line-count-ratchet:
Also: the control-bar pill binds to isConversationListening, so mode Off renders as "Paused". Toggling then mutates the overlay and still shows Paused. Off and pause are not the same state — the pill needs a third label, or it should be disabled/hidden when mode is Off. kodjima APPROVE is on 7609650. Git-on-my-level CHANGES_REQUESTED is on 6c7b738. Neither is this tip. Honest gaps: no on-device smoke (mic/BLE stay up while transcription is gated). |
|
Both points addressed on a new SHA. The pill was the real bug. It bound straight to isConversationListening, so mode Off rendered as "Paused" and toggling mutated the overlay behind a label that never changed. Off now has its own state: CaptureListeningLogic.ConversationListeningPill derives listening / paused / off from (mode, isPaused), both control-bar surfaces render pill.title and are disabled when the mode is Off, and toggleConversationListening returns early in Off so the overlay is never written from a state the user cannot see. Tests pin that Off reads "Off" and not "Paused", and that toggling in Off leaves both the overlay and the mode alone. Ratchet declarations are rebuilt against current main (da2fe60) rather than patched:
Those four are every changed non-test Swift file over the 1500-line threshold; CaptureListeningLogic.swift is 172 -> 217 and stays under it. Honest gaps unchanged: still no on-device smoke, and I have not run the Swift suite locally on this SHA, so CI is the verification here. |
|
Re-review on da0408a. The two items from 0a8dffb are addressed on this SHA:
I am still not approving this SHA. Honest gaps unchanged: no on-device smoke that mic/BLE stay up while transcription is gated. That is the privacy behavior, and it is not the same as Off. kodjima APPROVE is on 7609650. Git-on-my-level CHANGES_REQUESTED is on 6c7b738. Neither is this tip — merge is still blocked by that review, not by the code on da0408a. I am not dismissing it. |
…key (BasedHardware#6649) Reimplemented on the restructured desktop tree after the original branch went stale and began conflicting. Behavior matches the reviewed revision: persisted listening state, NSLock-guarded snapshot reads from the audio callbacks, and startTranscription() on resume.
Addressed the maintainer feedback with a 9-file working-tree diff: - Migrated both listening shortcut defaults to typed `DefaultsKey` cases. - Removed the throwaway `AppState()` fallback from `FloatingControlBarView`; callers now inject canonical state. - Raised all four line-count baselines with focused justifications. - Added behavioral coverage proving paused listening drops audio frames. - Kept the snapshot setter internal because `desktop/macos/Desktop/Sources/AppState.swift` initializes it across a file boundary. - `PASS` — `AppStateListeningTests`: 2/2
Addresses the review: the PR previously carried a second persisted flag (isConversationListening) that could disagree with audioRecordingMode, which risked two sources of truth dropping recordings. Pause is now an overlay on the existing mode rather than a parallel policy: - isTranscriptionPaused is the only stored pause state, and it never writes audioRecordingMode - isConversationListening becomes a computed projection of (mode != .off && !paused) - CaptureListeningLogic.shouldForwardTranscriptionAudio is the single decision point, shared by the UI and the audio path Pause keeps mic/BLE capture up and gates only transcription forwarding; it is deliberately not equivalent to mode Off, which tears capture down. Also resolves the review-bot findings: the audio callbacks now read a lock-protected snapshot from a nonisolated helper instead of touching @mainactor state from the audio thread, and the duplicate @AppStorage write to the same UserDefaults key is gone. Tests cover pause/resume across every audioRecordingMode, asserting the mode is never mutated, capture stays up, and only forwarding is gated.
Re-review on 0a8dffb: the control-bar pill bound directly to isConversationListening, so audioRecordingMode == .off rendered as "Paused", and clicking it mutated the pause overlay while the label stayed "Paused". Off and pause are different states, so the pill now has three: - CaptureListeningLogic.ConversationListeningPill derives listening / paused / off from (mode, isPaused), so the label has one source - both control-bar surfaces render pill.title and are disabled when the mode is Off - toggleConversationListening returns early when the mode is Off, so the pause overlay is never written from a state the user cannot see Tests assert mode Off reads "Off" rather than "Paused", that toggling in Off writes no pause overlay and leaves the mode alone, and that the paused and listening labels are unchanged.
aryanorastar's remaining objection was that nothing proved the privacy behavior: that gating transcription leaves mic and BLE capture running, which is not the same as Off tearing them down. Cover it three ways. AppStateListeningTests asserts across a pause/resume cycle that the mic spy is never stopped or restarted, the BLE connection and its transport stay connected with no disconnect calls, the codec is unchanged, and BleAudioService.processingGeneration does not move, so a teardown followed by a fresh start cannot hide inside the window. It then asserts Off does tear both down. Add ListeningHardwareSmokeTests for the on-device case, gated on OMI_HARDWARE_SMOKE=1 so CI skips it. It has not been run on hardware. BleAudioService gains a weak processingConnection and makes the existing processingGeneration readable. SessionConnectionDouble can hold its audio stream open so startProcessing completes without the stream ending. Signed-off-by: Matt Van Horn <[email protected]>
da0408a to
f194324
Compare
|
Pushed f194324, rebased onto current main. On the mic/BLE gap: you are right that nothing proved it, and I am not going to claim I closed it on hardware. What I did do is pin the contract three ways.
Production change is small and is real state, not test scaffolding: a weak Locally: AppStateListeningTests 7/7, the start/stop race tests pass, hardware smoke skips as designed, SwiftLint clean on the changed files. Separately, you noted merge is blocked by Git-on-my-level's CHANGES_REQUESTED on 6c7b738 rather than by the code on this tip. That is still true and still not mine to dismiss. |
aryanorastar
left a comment
There was a problem hiding this comment.
Verified on f1943241b667.
The overlay rewrite still looks right: isTranscriptionPaused does not write audioRecordingMode, Off is a third pill state, and the hermetic BLE processingGeneration pin is the right contract for "pause does not tear capture down."
Hygiene and Desktop Swift tests are red on the same gate: desktop-test-quality wall-clock waits rose 16 → 17. The extra site is Task.sleep(for: .milliseconds(100)) in ListeningHardwareSmokeTests (the discovery loop). Annotate that line with // omi-test-quality: wall-clock-wait -- <reason> or wait on a deterministic signal. Do not raise the baseline for a skipped smoke.
OMI_HARDWARE_SMOKE=1 is still skipped here (no kit). That remains an honest gap, not a merge blocker by itself.
I am not approving or merging this SHA. kodjima APPROVE is 7609650. Git-on-my-level CHANGES_REQUESTED is 6c7b738. Neither is this tip; I am not dismissing that review.
The smoke test's discovery loop slept 100ms per iteration, which added a seventeenth wall-clock wait to the desktop-test-quality count for a test that is skipped without hardware. Wait on the signal that already exists instead: DeviceProvider publishes discoveredDevices, so the test awaits its first non-empty emission, bounded by awaitWithTimeout using the same timeout passed to startDiscovery. The XCTSkip path when no device is present is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Du315CaKLufAYPEdEwcocq Signed-off-by: Matt Van Horn <[email protected]>
|
Thanks for the precise read on the gate. Fixed in I took the deterministic-signal option rather than the annotation, since the signal already exists: Agreed on the rest: |
|
Re-review on The wall-clock item from I am still not approving this SHA. kodjima APPROVE is |
|
Thanks for the re-review. Agreed the hardware path is the open question, and I don't have an Omi kit to run |
Conflicts: - DefaultsKey.swift: keep transcriptionPaused/shortcut keys alongside main's callAppAudioDailyLedger. - CaptureListeningLogic.swift: take main's armed/active split in listeningStatus; keep the pause overlay and ConversationListeningPill. - ShellListeningCycleTests.swift: take main's deletion (BasedHardware#17286 replaced the cycle with a mode menu); port the pause-overlay test into ShellListeningModeMenuTests. Annotate the two AppStateListeningTests shared-defaults sites as an integration boundary so the test-quality gate stays at main's baseline. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01NKrCf3fm1rFrX2sQqS1gif
|
Merged current main into the branch (merge commit, no force-push), so it's ready whenever the hardware check happens. Three conflicts. DefaultsKey kept both sides. CaptureListeningLogic takes main's new armed/active split in listeningStatus and keeps the pause overlay and pill as they were. ShellListeningCycleTests was deleted on main when #17286 replaced the cycle with the mode menu, so I took the deletion and moved the pause-overlay test into ShellListeningModeMenuTests instead of bringing the file back. Main had lowered the shared-defaults baseline in the test-quality gate, which our AppStateListeningTests setUp/tearDown went over by two. AppState reads the pause flag from standard defaults at init with no seam, so I used the gate's integration annotation rather than widening AppState in this PR. Happy to add a seam instead if you'd prefer. The line-count exceptions still hold as declared; growth is unchanged and I refreshed the absolute baselines in the description to current main. The listening suites pass locally on Xcode 26.6 (59 tests, hardware smoke skipped). In the full desktop run, PipeProcessRunnerTests and TasksStoreOwnerBoundaryTests failed under load but pass in isolation; neither touches this change. OMI_HARDWARE_SMOKE=1 is still skipped here, so the pause case with mic/BLE still up needs someone with a kit. |
Main's desktop UX contract (INV-UI-2) rejects literal scaledFont sizes; micro is the same 10pt, so this is a no-op visually. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01NKrCf3fm1rFrX2sQqS1gif
|
Thanks for this contribution! Our review requested some changes (see above) and we haven't heard back in a while. If you're still working on it, just push a commit or leave a comment within the next 7 days. To keep the queue healthy we'll close this PR in 14 days if it stays inactive — and it can always be reopened once updates land. Happy to re-review! |
Conflict in AppState+Transcription.swift: main moved startMicrophoneAudioCapture and configureSharedCaptureWatchdog to AppState+MicrophoneCaptureArming.swift and wrapped local STT sinks in the armed-mic probe gate. Took main's layout and kept the listening-pause gate (forwardConversationAudio) inside the probe gate, including on the moved mixer path. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019wSaUMZrtm6XSzwEcxavkv
|
@Git-on-my-level merged current main into the branch (merge commit, no force push) to clear the conflict. The only real conflict was AppState+Transcription.swift: main moved the mic arming code into AppState+MicrophoneCaptureArming.swift, so I kept main's layout and put the pause gate inside the new probe gate there. The points from your Aug 12 review are addressed:
Later feedback from aryanorastar is in too: pause as an overlay on audioRecordingMode (f1e031d), Off vs paused in the pill (aeda59d), and the mic/BLE stay-up tests (f194324, d8fc92e). Ran swift build and the listening tests on the merged branch: 48 green, hardware smoke skipped. Could you take another look when you have a minute? |
Offscreen renders of the production FloatingControlBarView compact bar for listening, paused, and recording mode Off, captured through NSHostingView in a local XCTest harness.
|
Added UI evidence for the preflight check: three renders of the control bar under .agent-artifacts/ui-evidence/7199/ showing listening (green), paused (amber), and mode Off (grey), linked in the PR body. They're offscreen renders of the real FloatingControlBarView from a local test harness, not a live app capture, so the hardware check for the pause path is still open. |
|
Closing due to inactivity after requested changes — this is not a reflection on the idea. Feel free to reopen (or open a fresh PR referencing this one) whenever the updates are ready, and we'll gladly re-review. Thanks again for contributing! |
|
Hey @mvanhorn 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Summary
Adds a one-tap pause/resume toggle for conversation listening on the desktop app, persisted across restarts and bound to a rebindable global hotkey (default ⌘⇧L).
Why this matters
Issue #6649 asked for granular control over when the app is actively listening, with an obvious indicator and a hotkey. Today users have to power off the device or quit the app to stop conversation capture. This adds three discoverable surfaces (sidebar pill, floating control bar, hotkey) so a user can pause sensitive conversations without losing the device session.
Demo
Simulated demo (Remotion) of the toggle states. The actual desktop app build is gated by Apple Developer ID signing identity and SwiftPM dep clone failures in my workspace, so this is a programmatic mock against the real Omi color palette and layout, not a live capture.
Changes
AppState.isConversationListening(@Published+@AppStorage("omi.listening.enabled")),toggleListening(source:),setListening(_:source:). Default on first launch istrue(preserves existing behavior).stopTranscription()path. Microphone and BLE remain open. A guard instartTranscription()declines to start while paused, so auto-start triggers (BLE reconnect, user action) are no-ops until the user resumes.Toggle Listening(default⌘⇧L), rebindable via Shortcuts settings.GlobalShortcutManagerregisters the hotkey and postsNotification.Name.toggleListeningShortcutPressed;AppStatelistens and callstoggleListening(source: "hotkey").ear.fill/ear.slash.fill, success/warning colors), floating control bar status pill, and tap-to-toggle dot on the compact bar.AnalyticsManager.listeningToggledemits a Sentry breadcrumb (category: "listening") and a PostHoglistening_toggledevent withstateandsourceproperties.PushToTalkManager) is independent and continues to work while listening is paused.desktop/Desktop/Tests/AppStateListeningTests.swiftcovering toggle + persistence acrossAppStatereloads.Note
Touches
FloatingControlBarWindow.swift, which my open #6770 also modifies. The change here is additive (new init parameter); rebase from whichever lands first.Fixes #6649
Product invariants affected
Line-Count-Exception: desktop/macos/Desktop/Sources/AnalyticsManager.swift | 1771 -> 1788 | listeningToggled analytics event for the pause/resume surface
Line-Count-Exception: desktop/macos/Desktop/Sources/AppState/AppState+Transcription.swift | 1758 -> 1813 | listening-state plumbing: pause/resume gating on the transcription path
Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarView.swift | 3171 -> 3227 | listening toggle surface in the control bar, including the three-state pill
Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift | 6073 -> 6091 | window wiring for the new toggle parameter
Failure-Class: none
UI evidence
Offscreen renders of the production
FloatingControlBarViewcompact bar, captured throughNSHostingViewin a local XCTest harness (not a live app session):Green is listening, amber is paused (mic and BLE stay up), grey is recording mode Off with the toggle disabled.