Repository navigation
feat(app): show the capture Live Activity only when capture needs you - #20957
Conversation
Healthy pendant capture is Omi's default, so the card and Dynamic Island no longer restate it with a pendant and a running clock. A card appears only when the user is paused, the pendant is still unheard two minutes after connecting, or its battery is at 15% or less; a phone recording the user started keeps the recording card. Compact trailing views fall back to a dot in landscape instead of clipping the clock to "2:1". Co-Authored-By: Claude Opus 5.5 <[email protected]>
main has failed the dead-code ratchet since #20946: SignVideo.tsx, signAssets.ts and signPoses.ts have no importer, so every push is rejected. Allowlist them with a reason so the owner can wire them up or delete them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d062205ab2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let activity { | ||
| await update(activity, state: state) | ||
| } else if suppressedRecordingId != id && UIApplication.shared.applicationState == .active { | ||
| } else if suppressedRecordingId != id && dismissedCard != card |
There was a problem hiding this comment.
Clear dismissed-card suppression when re-enabling
When a user swipes away a card and then turns Capture Live Activity off and back on during the same recording, this new condition continues to block that card because setEnabled(true) clears only suppressedRecordingId, while swipe dismissal is now stored in dismissedCard. This regresses the previous re-enable behavior, so clear dismissedCard alongside the existing suppression when enabling the feature.
Useful? React with 👍 / 👎.
| guard ready, let (id, published, active) = latest else { return } | ||
| if let current = activity, current.activityState == .dismissed { | ||
| suppressedRecordingId = current.attributes.recordingId | ||
| dismissedCard = Self.cardKey(current.attributes.recordingId, current.contentState.notice) |
There was a problem hiding this comment.
Track all dismissed card kinds
When more than one notice kind is dismissed during the same recording, assigning a single dismissedCard overwrites the earlier dismissal. For example, if the user dismisses a low-battery card, later dismisses an unheard card, and audio then recovers while the battery remains low, the low-battery card is created again even though the user already dismissed that kind. Store the dismissed card keys as a per-recording set so each dismissed kind stays suppressed as documented.
Useful? React with 👍 / 👎.
| } minimal: { | ||
| CaptureNoticeSymbol(notice: notice).font(.system(size: 14, weight: .semibold)) | ||
| } |
There was a problem hiding this comment.
Give the minimal notice an accessibility label
In the minimal Dynamic Island presentation, the notice symbol is the only content, but CaptureNoticeSymbol marks itself accessibility-hidden. VoiceOver therefore has no element that identifies whether capture is paused, the pendant is unheard, or its battery is low; the compact presentation similarly exposes the value without the condition name. Add an accessibility label for the notice wherever the symbol is the only semantic carrier.
Useful? React with 👍 / 👎.
| guard let defaults = UserDefaults(suiteName: "group.com.friend-app-with-wearable.ios12"), | ||
| defaults.bool(forKey: "widget_is_connected"), !defaults.bool(forKey: "widget_is_charging"), | ||
| let level = defaults.object(forKey: "widget_battery_level") as? Int, level >= 0 else { return nil } |
There was a problem hiding this comment.
Associate the battery notice with the capturing device
For captures from any supported non-phone device, this reads the single shared widget battery solely by connection and charge state, without checking the stored device type/name or matching it to the active capture source. DeviceProvider publishes these keys for device types such as Bee, Limitless, Apple Watch, and Omi Glass too, so their low battery—or another concurrently connected device's low battery—can produce a card labeled “Omi pendant” during the current capture. Carry or validate the capturing device identity before selecting the pendant-battery notice.
Useful? React with 👍 / 👎.
Compact notices show the pendant and a tinted status glyph, with values only in the expanded island and Lock Screen. A tapped Start no longer loses its card before the intent replies. The battery notice is limited to Omi pendants and goes stale like the other cards. Swiped-away notice kinds are remembered as a set. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…achable" #20958 fixed the dead code on main, so this PR no longer needs it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e08a28a72
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// wearables never show this card. Unknown readings are -1. | ||
| private static func pendantBattery() -> Int? { | ||
| guard let defaults = UserDefaults(suiteName: "group.com.friend-app-with-wearable.ios12"), | ||
| defaults.string(forKey: "widget_device_type") == "omi", |
There was a problem hiding this comment.
Validate the device model before labeling its battery
The new widget_device_type == "omi" guard still admits non-pendant hardware: DeviceUtils.isOmiCv1 documents that Glass, Neo, Friend, and DevKit variants all report DeviceType.omi, and DeviceConnectionFactory specifically handles Omi Glass devices advertised with that type. Fresh evidence after the earlier review is this repository-defined type aliasing, which means an Omi Glass capturing at ≤15% and not charging will still produce an “Omi pendant” warning. Publish and check the CV1/model identity (or match the active capture device) instead of treating the broad omi type as a pendant.
Useful? React with 👍 / 👎.
| guard let defaults = UserDefaults(suiteName: "group.com.friend-app-with-wearable.ios12"), | ||
| defaults.string(forKey: "widget_device_type") == "omi", | ||
| defaults.bool(forKey: "widget_is_connected"), !defaults.bool(forKey: "widget_is_charging"), | ||
| let level = defaults.object(forKey: "widget_battery_level") as? Int, level >= 0 else { return nil } |
There was a problem hiding this comment.
Reject stale persisted battery readings
When the app process exits without publishing a disconnect and the next battery read fails, these persisted keys can still say that an Omi is connected with its old low charge; AppDelegate records widget_last_updated, but this reader never checks it. If capture then resumes, every 30-second surface heartbeat treats that old percentage as current and continually refreshes a false low-battery Live Activity, so its 90-second ActivityKit stale date does not help. Require a recent widget_last_updated value, or publish the current capture device's battery state directly.
Useful? React with 👍 / 👎.
What changed and why
The capture Live Activity and Dynamic Island showed the pendant and a running clock for as long as Omi captured. But capture is Omi's normal state, so that card only told you Omi was doing what it always does, and it took the island for hours. Now it stays quiet while things are working and appears only when capture needs you:
12%· charge barCapturePresentationPolicy(app/ios/LiveActivity/OmiCaptureAttributes.swift) is one pure function shared by the app and the extension. A pause wins over an unheard pendant, which wins over low battery. Reconnecting transcription (audio is still saved) and holds during a call (they resume by themselves) stay quiet.LiveActivityManagersets the notice, when it began, and the pendant battery on the card state. It reads the battery from the App Group keys the Home Screen battery widget already writes, so Flutter does not change. It ends the card when nothing is wrong. A card of a different kind is a new card, so swiping one away hides only that kind for that recording.2:16clock clipped to2:1. Notice cards show no text in compact, and the phone recording clock now sits in aViewThatFitsthat falls back to a dot.Known limit (follow-up): iOS starts a Live Activity only while Omi is in the foreground, which the manager already enforces. A notice that begins while Omi is in the background therefore shows up the next time Omi is opened. The existing <20% battery notification still covers low battery in the background. Server-started notices and "moments" (pre-meeting brief, a promise coming due) need ActivityKit push-to-start and are the next PR.
Review (Cursor
grok-4.7-high, read-only): no blockers. Fixed in the second app commit:reconcile()now keeps the card while an action is in flight, andperform()reconciles once the reply arrives.widget_device_type == "omi"(only Omi devices report charging) and goes stale after 90 s like the other cards.Product invariants affected
app/lib/services/capture/**isCAPTURE_ARCHITECTURE.md, which gains a paragraph describing the presentation. Capture, pause authority, audio delivery and retention are unchanged. The card's Start still sends the existingresumeaction throughCaptureSystemSurface's target checks.How it was verified
OmiCaptureLiveActivity.swift,OmiCaptureAttributes.swift,OmiCaptureIntents.swift, the asset catalog and the string catalog.xcodebuild … -sdk iphonesimulator buildsucceeded.Activity.requestwith each notice state started on the simulator (HARNESS started … enabled=1), and the widget extension loggedBatch end … success. The images below areImageRendererrenders of those same production views in the simulator, laid into frames sized like the iPhone 17 Pro island and Lock Screen.simctlscreenshots do not composite the Dynamic Island, and this Xcode install ships no Simulator GUI. The island and Lock Screen frames are therefore the harness's approximation; the content inside them is production code.swiftc -typecheckagainst the iOS 27 simulator SDK, with Flutter and app-helper stubs, passes forLiveActivityManager.swiftplusOmiCaptureAttributes.swift.Tests
No automated test. The policy is a pure Swift function, and
app/ioshas no Swift unit-test target; its iOS tests are Ruby static checks and UI probes. The Dart surface (capture_system_surface_test.dart) is unchanged because the snapshot contract is unchanged.UI evidence
Failure class (fixes)
Failure-Class: none
🤖 Generated with Claude Code