Skip to content

feat(app): recording Live Activity on the Lock Screen and Dynamic Island - #18887

Merged
Itaxh1 merged 48 commits into
BasedHardware:mainfrom
Itaxh1:feat/ios-capture-live-activity
Oct 5, 2026
Merged

Itaxh1 merged 48 commits into
BasedHardware:mainfrom
Itaxh1:feat/ios-capture-live-activity

Conversation

@Itaxh1

@Itaxh1 Itaxh1 commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR

Recording now shows up outside the app on iPhone. While Omi records, a Live Activity on the Lock Screen and in the Dynamic Island shows the recording state, a live timer and Omi's breathing waveform, with Stop / Start and End controls, so a recording can be checked and controlled without opening the app.

iPhone only: Android is unchanged and keeps its existing "Recording in progress" notification.

Lock Screen

Lock Screen recording card

Dynamic Island (Stop, then Start)

Dynamic Island recording card

Recorded on an iPhone 15 Pro Max (iOS 26), before Stop flattened the wave into a line. Full-quality clips: Lock Screen · Dynamic Island

What changed and why

Adds an iOS Live Activity for recording: the Lock Screen card plus the compact, minimal and expanded Dynamic Island, with Stop / Start and End on iOS 17+. It shows capture state the app already has, so the backend is unchanged. Layout follows the omi-ios-v2 design package (LockScreen / Island / HomeScreen geometry and tokens.json). Text and controls stay the same size on every iPhone. Only the pendant scales, using layout.KH.

  • Presentation: CaptureSystemSurface projects CaptureController state. iOS draws the timer, and Start appears only after a user stop. Card actions are tied to the recording id and conversation revision, so a tap on an old card cannot act on a newer recording.
  • Actions go through the capture coordinator: the card's Stop, Start and End call the same pauseCapture / resumeCapture / finishCapture as the live page, Home card and quick actions. The coordinator decides what each does for whichever source owns capture (SCA-561 single ownership). Each tap carries its recording and conversation, and the coordinator rejects it if they changed by the time it is applied, so a tap that waited behind a stop or handoff never acts on the recording that replaced it. Phone vs. pendant and batch state come from the committed read model.
  • Waveform: the strip plays the design's breathing wave (omi-liquid-dock2: bars breathe to 45% over 1.6 s with a 13-bar ripple) for as long as recording runs. iOS draws it on the system clock through WidgetKit's clock-hand rotation effect, so the app sends no animation updates. When capture stops, pauses or finishes, or the card goes stale, the bars lie flat in a line, and Start brings the moving wave back. The effect is not in the public SDK, so it is looked up at run time, and the card shows the still wave wherever it is unavailable. It plays on iOS 18 and later.
  • Start for a stopped phone mic: Stop turns the phone mic off, so Start from the Lock Screen has to start a recording while Omi is in the background. iOS refuses that to a plain Live Activity intent, the mic start failed, and the capture failed closed, ending the recording that Start was meant to resume. On iOS 18 and later, Start for a stopped phone mic is an AudioRecordingIntent, which iOS lets start recording in the background. iOS 17 has no such intent, so there a stopped phone mic shows no Start, and tapping the card opens Omi. Pendant Start is unchanged. A stopped card no longer goes stale, because iOS may suspend Omi while the mic is off and Start has to stay on the card.
  • Closing Omi closes the card: when the app terminates, for example swiped away while it records, the Live Activity and the Dynamic Island end at once. A card left behind by a crash or a system kill closes as soon as Omi launches again; recording ids are never reused, so nothing could continue it.
  • Build boundary: the card's Stop / Start / End App Intent compiles only with Xcode 27, like the Siri intents, because the required Xcode 26.6 iOS compile check fails on any App Intents metadata (contracts/siri/README.md). That CI build draws the card without buttons; releases are built with Xcode 27.
  • Unverified pendant audio: while the app cannot yet confirm that a pendant's audio is arriving, it shows no "Listening" and no timer (fix(app): verify pendant capture from arriving audio and recover a silent link #20378). The card does the same: it names the pendant, shows no time, keeps the wave flat and does not count the wait as recording time. Stop and End stay available.
  • Settings: new Show on Lock Screen toggle in Notifications settings.
  • Localization: every native Live Activity string (card and island text, recovery titles, App Intent titles) covers all 49 app locales.

Product invariants affected

none

How it was verified

  • iPhone 15 Pro Max (iOS 26.6.2, prod data, signed Profile-prod build): pendant recording shows the Lock Screen card, both locked and unlocked, and the Dynamic Island. The wave loops at the design's speed while recording, Stop stops it, Start resumes it, and End finishes the conversation (clips above).
  • Waveform on simulators (iOS 18.0 and 27.0): a throwaway harness ran the real widget file. Screen recordings measured per bar show about 21 frames a second, a 1.6 s period, bars breathing to 0.46 of full height (design: 0.45), and heights within 0.5 pt of the CSS formula. The card's archive stays inside the Live Activity size limit (1.41 MB at most).
  • Layout on simulators, one at a time: iPhone SE (375 pt), 16 (393), 16 Pro (402) and 16 Pro Max (440). Nothing is truncated or clipped, and the expanded island fits the ~160 pt cap.
  • Full TZ=UTC bash app/test.sh at this head: the spine suite (138) and the whole app suite (3,872) passed.
  • After merging current main: flutter test test/services/capture test/services/bridges test/providers/force_processing_placeholder_test.dart test/widgets/settings/live_activity_settings_test.dart: 216 passed. flutter test test/services test/providers test/widgets/settings test/widgets/home: 995 passed. TZ=UTC flutter test test/spine: 129 passed. flutter analyze on every changed Dart file: no issues.
  • A small Swift check decodes the exact snapshot Dart sends into ContentState, and also a payload from an older build that still carries the removed voice, batch and wave-time fields. Both decode.
  • python3 app/scripts/l10n.py check: ok (49 locales).
  • Stop and close on the iOS 27 simulator (harness running the real widget file): with Stop at 30 s and Start at 40 s, the bars lie flat while stopped and move again after Start. Swiping the app away with the termination handler removed the card and the island; the same run without it left both showing a recording.
  • Phone-mic Start before this fix (iPhone SE, iOS 26.7.1): the device log shows Stop stopping the audio engine and Omi suspended about 4 s later. On Start, AVAudioEngine failed kAUStartIO with error 2003329396, and audiomxd logged Client 'Runner(…)' is in the background and isn't allowed to start recording … hasEntitlementToStartRecordingInTheBackground=NO. The coordinator then failed closed, which ended the recording and closed the card.
  • After the fix: the signed Profile-prod build installed on the iPhone 15 Pro Max and the SE. The widget binary and the app's App Intents metadata both contain OmiCaptureRecordingIntent.
  • Xcode 26.6 path: only Xcode 27 is installed here, so the widget files were also typechecked with the compiler(>=6.4) gate forced off. Both paths compile, and nothing outside the gated code references the intent.
  • CI at this head (ci:full): iOS Compile Check passed on the pinned Xcode 26.6, including "Prove stable iOS compiler emits no Siri metadata". Dart Analyze & Tests, Generated Files, Seeded Journeys (hermetic), Formatting, Hygiene, the Desktop Swift contracts and the Siri Xcode 27 advisory also passed.
  • project.pbxproj: the 48 added lines pass plutil -lint; each of the 18 new object IDs is defined once and referenced. Runner and RunnerRayBanDat build the manager, attributes and intent, BatteryWidget builds the attributes, intent and card, and the watch app builds none of them. pod install leaves the file unchanged.
  • Action timeout: a throwaway Swift harness around CaptureIntentReply (not committed) covers reply before timeout, missing reply, error reply, and a late reply after the timeout; each resumes exactly once.
  • After merging main at 8c45d9f (2026-10-04): full bash app/test.sh: 4,654 passed, 14 skipped, 0 failed. Analyzer ratchet passed, CI's Dart and ARB format checks pass on every changed file, and scripts/l10n.py check is ok. Merging main needed two follow-ups. openHomeDeepLink now returns whether a destination opened, so the capture link returns false for a recording that has ended. The Process Now test double keeps both main's injectable phone sync and this branch's one gate per drain.
  • Not verified: Start resuming a phone-mic recording from the Lock Screen with this fix on a device, an 8-hour session hitting Apple's Live Activity limit, and iOS 16.1–17 on a device.

Tests

  • app/test/services/capture/capture_system_surface_test.dart: card actions (Stop/Start keeps elapsed time, stale actions rejected), phone and batch End, stall recovery vs. user stop, no activity updates for the wave during silence or speech, an update at each full hour so the timer runs past it, an Omi call shown as an interruption without Stop or Start, a Stop that queued behind a pendant-to-phone handoff rejected instead of pausing the new phone recording, a failed action kept on the card through health refreshes until the recording changes, and a tap still queued at shutdown reported as failed.
  • app/test/services/bridges/live_activity_bridge_test.dart: owner handoff, so an old controller cannot detach a newer one, and close completes without a native channel (iOS before 16.1) or after a native detach error.
  • app/test/services/capture/capture_coordinator_test.dart: a card's pause, resume and finish apply only while its recording and conversation are current; a stale one runs nothing.
  • app/test/widgets/settings/live_activity_settings_test.dart: the Show on Lock Screen switch is hidden while iOS has Live Activities off for Omi and returns after Settings, and a failed native update restores the switch and the saved preference. Both fail on the previous widget. A rejected preference write also keeps the old choice, which the next card update sends; this fails without the restore.
  • app/test/services/capture/capture_socket_generation_test.dart: with a real provider and a pendant whose audio is unverified, the card claims neither Listening nor a time, and keeps Pause. Once audio is verified, the claim returns. A lapse in verification hides it again and stops the clock until audio returns. This fails without the change.
  • app/test/widgets/home/home_navigation_test.dart: a card link for a recording that has ended shows Home, opens nothing, and reports that nothing opened.
  • app/test/providers/force_processing_placeholder_test.dart: if the conversation changes during the WAL drain, the processing skeleton is removed and the next conversation is not reset. A drain that goes stale keeps the skeleton a newer request is still showing; this fails without the ownership check.

Failure class (fixes)

Failure-Class: none

Scoped cleanups (optional)

None.

Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 3799 -> 3858 | The Live Activity's recording identity, read-model getters and action entry point (which delegates to pauseCapture/resumeCapture/finishCapture) belong to the capture owner
Line-Count-Exception: app/lib/services/capture/capture_coordinator.dart | 2828 -> 2869 | A Live Activity tap is checked when pause, resume or finish is applied, so its target type, event fields, environment fields and the stale-tap check live with the reducer

When iOS relaunches Omi with the pendant still connected (state restoration
after the process is killed), the native manager rediscovered services before
Flutter was listening, and connectPeripheral then returned early for the
already-connected peripheral. Flutter never received onDeviceReady, waited
60 s, and showed the pendant as disconnected until the app was reopened.

connectPeripheral now asks OmiBleConnectPolicy what to do: connect, replay
onDeviceReady when services are known, or rediscover them. NativeBleTransport
already treats a repeated ready event as a re-subscribe. The policy is proven
through its own seam by ios-ble-connect-policy
(FC-already-satisfied-request-as-noop, the iOS twin of Android's
BleConnectRouter).
Adds an iOS Live Activity for capture: the designed Lock Screen card and the
compact, minimal and expanded Dynamic Island, with Pause/Resume and End
Conversation (Stop for the phone mic) buttons on iOS 17+. Layout follows the
omi-ios-v2 design package: fixed type and controls, only the pendant scales
with the device (layout.KH), verified on 375/393/402/440 pt simulators.

- CaptureSystemSurface projects CaptureController state; the OS draws the
  timer, and Resume is offered only after a user pause.
- Actions run through CaptureController.performSystemSurfaceAction and are
  bound to the recording id and conversation revision, so old cards cannot act
  on a newer recording.
- CaptureVoiceMeter reads the audio capture already forwards (pendant Opus
  decoded, phone PCM16) with the voice-introduction RMS threshold; the strip
  moves about once a second while voice is heard and settles flat in silence.
  The tap is presentation-only and cannot drop audio.
- forceProcessingCurrentConversation no longer resets the next conversation,
  and removes its skeleton, when the conversation changes during the WAL drain.
- Show on Lock Screen toggle in Notifications settings.
@Itaxh1
Itaxh1 requested a review from mdmohsin7 as a code owner September 25, 2026 11:20

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature (iOS Live Activity/Dynamic Island), app area not desktop — approve-only per policy, no merge. No abuse signals in diff.

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for this — for a first contribution it's an unusually disciplined piece of iOS work, and the scope hangs together as one feature (the l10n churn is entirely mechanical showOnLockScreen additions). I reviewed the native and Dart sides at the current head; a few things genuinely stood out:

  • The widget extension stays render-only. OmiCaptureAttributes.swift compiles into both targets, but the intent handler is installed only in Runner (AppDelegate → LiveActivityManager on ready), so the extension never touches Flutter or the recorder. Clean trust boundary.
  • Fail-closed state handling. LiveActivityManager decodes Dart snapshots through JSONSerialization + JSONDecoder and rejects malformed payloads, guards publish/detach by owner id, reconciles exactly one activity per recording id, and remembers user dismissal (suppressedRecordingId) so the card doesn't resurrect after being swiped away. The LiveActivityBridge owner test pins the "old owner can't detach the new one" case, which is exactly the bug this kind of bridge usually has.
  • Stale-card safety. CaptureSystemSurface._act re-validates recording id + conversation revision before pause/resume/finish, and capture_controller.performSystemSurfaceAction re-checks against activeRecordingId — a tap on an old lock-screen card can't act on a newer recording.
  • The waveform can't hurt capture. CaptureVoiceMeter runs behind _tapAudio, which swallows all exceptions ("it must never drop audio"), and permanently degrades to an unmetered strip if Opus decoding ever fails. Only coarse 0–100 loudness bins leave the app process.
  • The BLE fix is correct and well-isolated. OmiBleConnectPolicy turning "already connected, return early" into connect / re-announce ready / rediscover matches how the Android side's BleConnectRouter behaves, and the ruby compile-and-precondition test plus the checks-manifest entry give it CI coverage.

Nothing below is blocking — the approved head stands; these are merge-time calls:

  1. app/ios/LiveActivity/Localizable.xcstrings — 6 of the 23 keys ship en-only (Transcribing live, Resumes automatically, Omi pendant, Phone microphone, Open Omi to reconnect/…continue, and the intent parameter titles). The other 17 have 49 languages. If the subtitle strings matter for the lock screen, they'll need a localization pass; if not, fine to land as-is.
  2. Update cadence — while voice is heard the surface publishes roughly once a second (_voiceTick in capture_system_surface.dart), and neither plist declares NSSupportsLiveActivitiesFrequentUpdates. That key isn't required, but if release builds throttle the waveform it's the knob to reach for; worth one device check on a release-profile build.
  3. LiveActivityManager.perform spawns a 20-second timeout Task per action (belt-and-braces around the continuation). Bounded and harmless, just noting it's per-tap rather than shared.
  4. The BLE reconnect fix is technically separable from the Live Activity, but at 31 + ~60 lines with its own test, splitting would cost more than it buys — no action needed.

This review was produced by an automated review agent on behalf of the Omi maintainers.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added ios positive-signal Automation verified a genuine fix/quality contribution labels Sep 25, 2026
Translates the eight native strings that shipped English-only in the Live
Activity catalog (the island and card subtitles, the "Open Omi to …" recovery
titles and the App Intent titles) into all 48 app locales, and reuses the
app's own translations for the intent's "Conversation" parameter. Every key
in Localizable.xcstrings now covers the same 49 locales as the Flutter app.
…lies

Each button tap armed a 20 s fallback task that kept sleeping after Flutter
had already answered. CaptureIntentReply now owns that timer and cancels it
when the reply arrives; whichever comes first resumes the continuation, the
other is a no-op, and a missing reply still fails the tap instead of leaving
it waiting.
Conflicts were limited to app/lib/l10n: main's ARB files and generated
localizations are taken as-is, and showOnLockScreen is re-added to all 49
locales with scripts/l10n.py.
SCA-561 made capture_coordinator the single ownership authority: public
CaptureController APIs dispatch events and nothing else mutates ownership.
The Live Activity still paused and resumed the phone through private mute and
mic-restart calls, and chose its own finish path per source.

Its buttons are now one more caller of the live page's controls:
pauseCapture, resumeCapture and finishCapture, so the coordinator decides
what each does for whichever source owns capture. Phone vs. pendant and batch
state come from the committed read model instead of private fields. Finish
before the first transcript now matches the live page and requests processing;
an empty result only clears the processing skeleton.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mobile feature (iOS Live Activity), not desktop -> approve-only per policy, no merge. Well-tested, no abuse signals, reconnect fix bundled in is minor.

@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up on the current head (c9299ff) — the three commits pushed after the earlier automated review resolve the notes it left:

  • Localization (0b927cc): all 23 keys in app/ios/LiveActivity/Localizable.xcstrings now carry all 49 languages, including Transcribing live, Resumes automatically, the source labels, and the intent parameter titles — the en-only gap is gone. The l10n churn across the arb files and regenerated accessors is a single mechanical showOnLockScreen addition per locale.
  • Action timeout (fd926d8): CaptureIntentReply in LiveActivityManager.swift now cancels the 20-second timeout task the moment Flutter replies, so a fast reply leaves no orphaned timer behind a tap.
  • Coordinator routing (c9299ff): card actions now go through CaptureController.performSystemSurfaceAction, which re-checks activeRecordingId and the conversation revision before calling the same pauseCapture / resumeCapture / finishCapture as the in-app controls — on top of the existing validation in CaptureSystemSurface._act. The revision counter bumps on batch cuts, finalization, and state resets, so a tap on an old card cannot steer a newer conversation.

Also re-checked at this head: the widget extension stays render-only (the action dispatcher handler is installed only in Runner; the BatteryWidget target compiles OmiCaptureLiveActivity.swift with the shared attributes/intents), AUTH_CALLBACK_SCHEME resolves from Base.xcconfig for the widgetURL scheme, capture_composition.dart builds the surface iOS-only with the Opus decoder destroyed on dispose, and no new dependencies were added. Thanks for the careful follow-through on the review notes.

This review was produced by an automated review agent on behalf of the Omi maintainers.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

… the card

Stop pauses and Start resumes. End saves the conversation when there is one and always closes
the Lock Screen and Dynamic Island card. A pendant keeps listening after its conversation ends,
so the card stays closed for the rest of that recording, as when it is swiped away. End is bold
and never waits for a transcript. Start and End reuse the app's own translations.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mobile feature (iOS Live Activity/Dynamic Island) + bundled BLE reconnect fix, area=app not desktop -> approve-only per policy, no merge. Re-reviewed at new commit d428a8a; no abuse signals, extensively tested per PR body (device + simulators + unit suites).

The pendant keeps picking up audio; Mute and Unmute say whether Omi uses it, so the card no
longer says Start/Stop. A user mute reads "Muted"; a system interruption keeps "Paused". The
labels reuse the app's own translations, and long ones shrink a little instead of cutting off.
…hoto

The Live Activity drew the pendant as a glossy orb from the v2 design. It now shows the app's
pendant photo, lit with a soft glow while audio is captured and its lights-off photo otherwise,
the same pictures the Battery widget uses.
@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up on the current head (d428a8a) — the two commits since the last automated review change how the card's buttons behave, and both changes check out:

  • Coordinator routing (63f8746): CaptureController.performSystemSurfaceAction now delegates to the same pauseCapture / resumeCapture / finishCapture the live page uses, reading phone/batch state from the committed read model (liveOwnerName, phoneBatchSession / pendantBatchSession) instead of parallel local flags — the surface can no longer disagree with the coordinator about who owns capture. The updated capture_system_surface_test.dart pins the new contract (finish always asks for processing; an empty result only clears the skeleton).
  • Start/Stop/End semantics (d428a8a): CaptureActions in OmiCaptureLiveActivity.swift now labels the pause/resume pair Stop/Start, and the primary button is always End. When canFinish is false (recovery or busy states), End falls back to the new "close" action rather than rendering a dead button, and LiveActivityManager.perform routes "close" to the new closeCard(for:) — it sets suppressedRecordingId and ends the activity immediately without touching the recording, matching swipe-away behavior. finish now closes the card on success too, so it can't linger on a stale state. The stale-card guards (recordingId + conversationRevision re-validation on both sides of the bridge) are unchanged and still in force.

One small non-blocking note: the renamed keys in Localizable.xcstrings dropped diacritics in a few locales — cs "Ukoncit" (Ukončit), pl "Zakoncz" (Zakończ), sk "Ukoncit" (Ukončiť), ro "Incheie" (Încheie), hu "Befejezes" (Befejezés), et "Lopeta" (Lõpeta) — and Thai "End" reads as "วางสาย" (hang up a call) where "จบ" would be the neutral choice. Purely cosmetic; easy to fix in one pass if the strings are touched again.

This head already carries maintainer approval; from the automation side nothing blocks merge.

This review was produced by an automated review agent on behalf of the Omi maintainers.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mobile feature (iOS Live Activity for recording), not a bug fix -> approve-only, re-confirmed per current policy. mergeStateStatus DIRTY, backend unchanged per PR description.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature (iOS Lock Screen / Dynamic Island Live Activity) — mobile/ios area, approve-only per policy. mergeStateStatus DIRTY, not merging.

Preserve main BLE readiness recovery, implicit Flutter engine registration and Home Screen widgets. Attach the Live Activity to the current engine, share the native widget catalog and route capture links over Home. Formatting and hygiene were checked locally; no web changes are introduced.
@Itaxh1

Itaxh1 commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

@Git-on-my-level thanks for the review. On the project.pbxproj note, I confirmed it locally: the 48 added lines pass plutil -lint, and each of the 18 new object IDs is defined once and referenced. Target membership is as intended (Runner and RunnerRayBanDat build the manager, attributes and intent; BatteryWidget builds the attributes, intent and card; the watch app builds none of them), and pod install leaves the file unchanged.

Three changes since 41fe4c4:

  • 1c1ebe9: when capture stops, pauses or finishes, the card's bars lie flat in a line instead of holding mid-wave, and waveTime, which nothing reads anymore, is removed.
  • 11ddecd: closing Omi closes the card. Termination ends the Live Activity and the Dynamic Island at once, and a card left by a crash or a system kill closes at the next launch.
  • 2a5538d: the card's Stop / Start / End App Intent now follows the Siri build boundary (compiler(>=6.4)). Otherwise the required Xcode 26.6 iOS compile check would fail on its App Intents metadata once it runs on this PR or on main.

Stop turns the phone microphone off, so Start from the Lock Screen has to start a
recording while Omi is in the background. iOS refuses that to a plain Live Activity
intent, the mic start failed, and the recording failed closed: the card's Start ended
the phone recording it was meant to resume.

- On iOS 18 and later, Start for a stopped phone mic is an audio recording intent,
  which iOS lets start recording in the background. Pendant Start is unchanged.
- iOS 17 has no such intent, so a stopped phone mic offers no Start on the card;
  tapping the card opens Omi.
- A stopped card no longer goes stale: iOS may suspend Omi while the mic is off,
  and Start has to stay on the card.
@Itaxh1 Itaxh1 added the ci:full Maintainer-granted: run full CI on this fork PR label Oct 2, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-confirmed after new commits: iOS Lock Screen/Dynamic Island Live Activity feature, files under app/ios + app/lib (Flutter mobile), mobile area, not a bug fix -> approve-only stands. No abuse signals, mergeStateStatus now CLEAN.

@Git-on-my-level

Copy link
Copy Markdown
Member

Reviewed the full diff on the current head. This is a well-built feature — some notes from a deep pass, nothing blocking:

Architecture (verified in code)

  • The two-layer staleness fence is the strongest part of this PR. CaptureController.performSystemSurfaceAction rejects a tap unless the recording id and _systemSurfaceConversationRevision still match, and the coordinator reducer (_rejectStaleTarget in capture_coordinator.dart) re-checks the card's SystemSurfaceTarget against the environment when the event is applied — so a tap queued behind a stop, handoff, or finish can never act on the recording that replaced its card. The Swift side re-validates the same pair in LiveActivityManager.perform before forwarding to Flutter.
  • Lifecycle handling in LiveActivityManager.swift is careful: orphan cards are closed at launch (ids never reused), endAllBeforeTermination closes cards on app termination, a user-swiped card is suppressed for the rest of its recording via suppressedRecordingId, and a paused card deliberately gets no staleDate so Start survives iOS suspending the app while the mic is off. CaptureIntentReply resumes exactly once (reply or 20 s timeout), so a missing Flutter reply can't hang the tapped button.
  • Start-from-Lock-Screen for a stopped phone mic via OmiCaptureRecordingIntent: AudioRecordingIntent is the documented iOS 18 mechanism for background mic start, and the iOS 17 degradation (no Start; tap opens the app) is handled explicitly.
  • Nice to see the tests exercise real seams: capture_system_surface_test.dart drives the actual CaptureController pipeline through the replay world, plus bridge ownership-cleanup and settings-toggle tests. The adjacent fixes (processing-placeholder owner check, settings rollback on failed save) are correct and appropriately scoped.

Two things worth keeping in mind post-merge (non-blocking)

  1. CaptureClockRotation in OmiCaptureLiveActivity.swift resolves the undeclared WidgetKit clock-hand effect at runtime (_typeByName("9WidgetKit24_ClockHandRotationEffectV") + JSON decode). It isn't a linked private symbol and fails safe to a still wave, but it depends on an undocumented internal type's mangled name and coding shape — any iOS release could change either. If waveform reports ever go quiet after an OS update, this lookup returning nil is the first place to look.
  2. endAllBeforeTermination blocks the main thread up to 2 s during termination. Bounded and on the exit path, so fine — just worth knowing if termination-time reports ever surface.

Docs (contracts/siri/README.md build-boundary paragraph, CAPTURE_ARCHITECTURE.md) match the code, and the l10n addition went through the standard tooling across all locales. iPhone-only scope with Android untouched is the right cut.

Thanks @Itaxh1 — the tap-staleness fencing in particular is a pattern worth reusing.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

Itaxh1 added 2 commits October 4, 2026 10:14
…ve-activity

Conflicts:
- app/lib/l10n: main's files, with showOnLockScreen re-added through
  scripts/l10n.py.
- app/test/providers/force_processing_placeholder_test.dart: the phone sync
  double keeps main's stampError and injectable instance, and this branch's
  one gate per drain.

main made openHomeDeepLink return whether the destination opened, so the
capture link returns false for a recording that has ended.
The capture link's stale path now reports that nothing opened; the
test fails if it claims the capture page was shown.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature (Lock Screen / Dynamic Island Live Activity, iOS) — approve-only per confidence gate; large diff, DIRTY, not mergeable regardless.

Itaxh1 added 3 commits October 4, 2026 10:44
…ant audio is verified

main now hides Listening and the timer while a pendant's audio is
unverified. The Lock Screen card and Dynamic Island do the same: they name
the pendant, show no time, keep the wave still, and keep Stop and End.
@Git-on-my-level

Copy link
Copy Markdown
Member

Reviewed this head (f1a5d18, the upstream-main merge) end to end. The engineering here is notably careful; a few things I verified against the code:

  • Stale-tap protection is real and two-layered. CaptureSystemSurface._act in app/lib/services/capture/capture_system_surface.dart checks recordingId + conversationRevision before dispatching, and the coordinator reducer in capture_coordinator.dart independently rejects a mismatched SystemSurfaceTarget with StaleSystemSurfaceTarget and no effects — so a tap queued behind a stop/handoff can't act on the next recording. capture_coordinator_test.dart covers all three actions against both stale axes.
  • The native side degrades safely. LiveActivityManager.swift serializes delivery through enqueue, closes orphan cards at launch and termination (endAllBeforeTermination with a bounded 2s wait), and CaptureIntentReply resumes the intent continuation exactly once with a 20s timeout, so a missing Flutter reply can't hang a tapped button. publish drops snapshots from a superseded owner id.
  • Presentation can't break capture. capture_composition.dart wires CaptureSystemSurface(...).start() with unawaited(...) on iOS only, so a Live Activity failure never stops recording. The capture deep link in home_deep_links.dart only opens the live page when the recording id still matches, and there's a widget test for the ended-recording case.
  • Docs are accurate and narrow. The CAPTURE_ARCHITECTURE.md tap-flow paragraph matches the implementation, and the contracts/siri/README.md sentence correctly documents that OmiCaptureIntent follows the existing Xcode 26.6/27 build boundary (consistent with the #if compiler(>=6.4) guards in OmiCaptureIntents.swift).

One surface worth a physical-device sanity check before release: OmiCaptureRecordingIntent (iOS 18+ AudioRecordingIntent) lets a Lock Screen Start re-arm the phone mic from the background. The owner/revision guards apply to it as well and I found no unguarded path, but background mic re-arm plus a cold engine warmup (the 10s dispatcher wait) is the kind of thing that behaves differently on real hardware.

The localization churn (~60 locales + generated files, one showOnLockScreen key) and the large Localizable.xcstrings look script-generated and consistent.

No blocking issues found from my side. Since the current head is a merge commit pushed after the last maintainer approval, it just needs a maintainer re-approval pass before merging — everything is green on CI here.

This review is AI-generated feedback on behalf of the maintainers.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Itaxh1

Itaxh1 commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

New since your last pass (41fe4c4):

  • the card's Start for a stopped phone mic uses an AudioRecordingIntent on iOS 18+; the buttons stay behind #if compiler(>=6.4) for the Xcode 26.6 CI build;
  • current main is merged in (head f1a5d18). The capture deep link now returns whether it opened anything.
  • Following main's pendant ingress verification, the card shows an unverified state (the pendant's name, no time, flat wave; Stop and End stay) while pendant audio is unverified.

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 5, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

New since your last pass (41fe4c4):

  • the card's Start for a stopped phone mic uses an AudioRecordingIntent on iOS 18+; the buttons stay behind #if compiler(>=6.4) for the Xcode 26.6 CI build;
  • current main is merged in (head f1a5d18). The capture deep link now returns whether it opened anything.
    ...

@Itaxh1 I can’t review only the new changes because the PR history changed. Comment @cubic review to run a full review.

@Itaxh1

Itaxh1 commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 5, 2026

Copy link
Copy Markdown

@cubic review

@Itaxh1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 131 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

Itaxh1 added 2 commits October 5, 2026 00:20
…d keep a rejected setting from reaching the card

- While pendant audio is unverified the card's clock stops, so waiting
  for audio is not counted as capture time.
- If the Show on Lock Screen write is rejected, the cached preference is
  restored before the error, so the next card update cannot send the
  rejected value.
- The lifetime listener guard is tested while a close is still in flight.
- The changelog note names the iOS versions the buttons and the moving
  wave need.
@Itaxh1

Itaxh1 commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

All 4 findings from the last pass are fixed in a6a4e1a (head d59c9da):

  • capture_system_surface.dart: the clock stops while pendant audio is unverified, so waiting for audio is not counted as capture time.
  • capture_lifetime_test.dart: a new test notifies while an owned cancellation holds close() open, and checks the listener is not called.
  • live_activity_settings.dart: a rejected write restores the previous preference before failing, so the next publish cannot send it. There is a test with storage that refuses writes.
  • The changelog names the iOS versions: buttons need 17+, phone-mic Start needs 18, the moving wave needs 18+.

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 5, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

All 4 findings from the last pass are fixed in a6a4e1a (head d59c9da):

  • capture_system_surface.dart: the clock stops while pendant audio is unverified, so waiting for audio is not counted as capture time.
  • capture_lifetime_test.dart: a new test notifies while an owned cancellation holds close() open, and checks the listener is not called.
    ...

@Itaxh1 I've dismissed this issue:

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 5, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

All 4 findings from the last pass are fixed in a6a4e1a (head d59c9da):

  • capture_system_surface.dart: the clock stops while pendant audio is unverified, so waiting for audio is not counted as capture time.
  • capture_lifetime_test.dart: a new test notifies while an owned cancellation holds close() open, and checks the listener is not called.
    ...

@Itaxh1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 131 files

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

… clock test

Without the wait, a card that counted the time before audio arrived would
still show zero and pass.
@Itaxh1

Itaxh1 commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review

The finding from the last pass is fixed in 88cd28e. The card clock test now waits 12 s before the pendant's audio is verified, and still expects zero elapsed after verification. With the clock fix removed it fails (expected 0, actual 12).

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 5, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

The finding from the last pass is fixed in 88cd28e. The card clock test now waits 12 s before the pendant's audio is verified, and still expects zero elapsed after verification. With the clock fix removed it fails (expected 0, actual 12).

@Itaxh1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 131 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

@Itaxh1
Itaxh1 merged commit 4bdcc56 into BasedHardware:main Oct 5, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Maintainer-granted: run full CI on this fork PR ios positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants