Skip to content

feat(app): show the capture Live Activity only when capture needs you - #20957

Merged
Git-on-my-level merged 5 commits into
mainfrom
feat/live-activity-quiet
Oct 8, 2026
Merged

Git-on-my-level merged 5 commits into
mainfrom
feat/live-activity-quiet

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

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:

State Island (compact) Lock Screen / expanded island
Pendant capturing normally nothing nothing
Paused by the user pendant + mic-slash "Paused" · time paused · Start
Pendant still unheard 2 min after connecting pendant + waveform-slash "No audio from pendant" · time
Omi pendant battery ≤ 15%, connected, not charging pendant + battery "Omi pendant" · 12% · charge bar
Phone recording the user started unchanged recording card unchanged recording card
  • Policy: CapturePresentationPolicy (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.
  • Manager: LiveActivityManager sets 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.
  • Island: compact keeps the pendant, so the island still reads as Omi, and adds only a tinted status glyph, with no timer or number. Minimal is the pendant with a tinted dot. Values appear only in the expanded island and on the Lock Screen.
  • Landscape bug: turned sideways, the trailing compact slot is only about as wide as the island, so the reserved 2:16 clock clipped to 2:1. Notice cards show no text in compact, and the phone recording clock now sits in a ViewThatFits that falls back to a dot.
  • One new string, "No audio from pendant", is translated in all 49 catalog locales. Everything else reuses existing strings ("Paused", "Start", "Omi pendant").
  • Per design review, the cards carry a glyph, a title and a value, and no explanatory subtext.

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:

  • Major: tapping Start on the paused card could end that card before the intent got Flutter's reply. reconcile() now keeps the card while an action is in flight, and perform() reconciles once the reply arrives.
  • Major: the battery notice read any wearable's App Group battery as "Omi pendant", and with no stale date it could freeze on the Lock Screen. It now requires widget_device_type == "omi" (only Omi devices report charging) and goes stale after 90 s like the other cards.
  • Minor: only the last swiped-away card kind was remembered; dismissals are now a set per recording.
  • Minor: the pause/unheard timer range was 24 h; it is now 7 days.
  • Not taken: the compact-timer width finding, since compact no longer shows a timer.
  • Evidence descriptions now say these are ImageRenderer composites, not system screenshots.

Product invariants affected

  • INV-CAP-1: the only file touched under app/lib/services/capture/** is CAPTURE_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 existing resume action through CaptureSystemSurface's target checks.

How it was verified

  • Widget views, real render (iOS 27.0 simulator, iPhone 17 Pro, Xcode 27.0): a scratch harness app plus widget extension (xcodegen) compiles the production OmiCaptureLiveActivity.swift, OmiCaptureAttributes.swift, OmiCaptureIntents.swift, the asset catalog and the string catalog. xcodebuild … -sdk iphonesimulator build succeeded. Activity.request with each notice state started on the simulator (HARNESS started … enabled=1), and the widget extension logged Batch end … success. The images below are ImageRenderer renders of those same production views in the simulator, laid into frames sized like the iPhone 17 Pro island and Lock Screen. simctl screenshots 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.
  • Manager: swiftc -typecheck against the iOS 27 simulator SDK, with Flutter and app-helper stubs, passes for LiveActivityManager.swift plus OmiCaptureAttributes.swift.
  • Not verified: a full Runner build, and the card on a physical iPhone across a real pause, an unheard pendant and low battery. No Dart changed.

Tests

No automated test. The policy is a pure Swift function, and app/ios has 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

Paused
Pendant unheard
Pendant battery low
Phone recording

Failure class (fixes)

Failure-Class: none

🤖 Generated with Claude Code

Git-on-my-level and others added 2 commits October 8, 2026 17:47
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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T11:38:52.441349Z 2e08a28 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +184 to +186
} minimal: {
CaptureNoticeSymbol(notice: notice).font(.system(size: 14, weight: .semibold))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +219 to +221
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 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Git-on-my-level and others added 3 commits October 8, 2026 18:02
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]>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +224 to +227
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 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 3012ec5 into main Oct 8, 2026
57 of 59 checks passed
@Git-on-my-level
Git-on-my-level deleted the feat/live-activity-quiet branch October 8, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant