Skip to content

feat(app): iOS Home Screen widgets: Battery for every wearable, Up next and Latest - #19252

Merged
Git-on-my-level merged 3 commits into
BasedHardware:mainfrom
Itaxh1:feat/ios-home-screen-widgets
Sep 27, 2026
Merged

Git-on-my-level merged 3 commits into
BasedHardware:mainfrom
Itaxh1:feat/ios-home-screen-widgets

Conversation

@Itaxh1

@Itaxh1 Itaxh1 commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

This adds iOS Home Screen widgets, and nothing else. It is based on main and separate from the v2
restyle (#19249) and the Live Activity (#18887). Closes #19251.

Widget Sizes Shows Tap opens
Battery (existing, extended) small (new), Lock Screen rectangular and circular (unchanged) Each paired wearable's photo (the one the app shows; an Omi pendant shows its lights-off photo while disconnected), charge and state ("Omi · charging"). Page dots switch wearables (iOS 17 AppIntent). Never the phone. Device settings
Up next (new) medium The next three open tasks with when they're due: today's first, then upcoming by due date. Also "N open", or "All caught up". To do
Latest (new) small The latest kept, finished conversation: title, time, tasks and length That conversation

App side. HomeWidgetsPayload builds three JSON documents as pure functions. HomeWidgetsService writes one
to the App Group only when it changed, through the existing com.omi.battery_widget channel. HomeWidgetsPublisher
follows the device, task and conversation providers. It debounces for 800 ms, writes at once when the app goes to
the background, and waits for the first task load before publishing Up next. Charging state is published, and
signing out clears the documents. Widget links (<scheme>://app/<route>) open through the existing
HomeNavigation.

Extension side. OmiHomeWidgets.swift holds Up next, Latest and the next-device intent. BatteryWidget.swift
gains the small size. SharedDefaults.swift gains the documents. Localizable.xcstrings holds the widget strings
in all 49 app languages, and the app's product photos, including the Omi pendant and its lights-off photo, are
added as device-* assets.

Refs #5080 (Up next shows upcoming tasks before their day). Related, not addressed: #7150 (Android widget) and
#6929 (Control Center toggle).

Overlap with #18887: both add the same OmiCaptureURLScheme Info.plist line and touch BatteryWidgetBundle.swift,
AppDelegate.swift and the project file. Whichever lands second needs a small rebase, and its Live Activity
strings then move into this target's Localizable.xcstrings (one Localizable table per target).

Screenshots

Battery, Latest and Up next on an iPhone 15 Pro Max, from a build of this branch:

Battery, Latest and Up next on an iPhone Home Screen

Product invariants affected

none

How it was verified

  • xcodebuild -target BatteryWidget -configuration Debug-dev -sdk iphonesimulator CODE_SIGNING_ALLOWED=NO SWIFT_OBJC_BRIDGING_HEADER=:
    BUILD SUCCEEDED. The .appex holds 49 .lproj string tables and the 12 device-* images. The bridging
    header override is needed only because the extension inherits the Runner's Flutter bridging header when built
    alone.
  • swiftc -parse on every changed Swift file: passed.
  • TZ=UTC bash app/test.sh: 138 + 3295 tests passed. Three backend-fixture tests need backend/ in a sparse
    checkout; with it they pass.
  • bash app/scripts/analyze_ratchet.sh: passed. dart format and git diff --check: clean.
  • make mobile-verify ARGS="fast --all": 23 of 23 hermetic journeys passed.
  • scripts/pr-preflight --pr-body-file against main at 8ee1e8c: all 29 selected manifest checks passed.
  • Built from this branch for an iPhone 15 Pro Max (flutter build ios --config-only --profile --flavor prod, then
    xcodebuild) and installed. It was signed under a personal preview bundle id and App Group, a build-only change
    that is not in this PR. The widgets update from the app, and the Battery widget shows the pendant's photo
    (screenshot above).
  • The pendant-photo change (608c062) was checked with the payload tests (8 passed), flutter analyze on its Dart
    files (no issues), a swiftc build of the widget views for the iOS 18 Simulator, and the iPhone build above. The
    Lock Screen removal and unfaded photos (89103d0) change only Swift and were checked with the same swiftc
    build. The full-suite runs in this list are from 5010892.

Tests

  • test/unit/home_widgets_payload_test.dart covers:
    • device order and pictures (an Omi pendant gets its photo, a DevKit its own), with battery only for the live
      device
    • Up next picking: today's tasks first, then upcoming by due date, undated last
    • the Up next and Latest documents
    • Latest skipping discarded and unfinished conversations
  • test/widgets/home/home_navigation_test.dart: /conversations selects its tab (the Latest widget's link when
    there is nothing yet).
  • The widget extension has no test target. Its views are covered by the builds and the iPhone run above.

Failure class (fixes)

Failure-Class: none

…xt and Latest (BasedHardware#19251)

- Battery gains a small Home Screen size: each paired wearable's picture,
  charge and state, with page dots to switch (iOS 17); never the phone.
- Up next (medium, Lock Screen rectangular and inline): the next three open
  tasks with when they are due, today's first and then upcoming ones, so a
  task shows ahead of its day (BasedHardware#5080), and how many are open.
- Latest (small): the latest kept conversation, its time, tasks and length.

The app publishes three JSON documents to the App Group only when one changes
(debounced; at once when leaving the app), publishes charging state, and clears
them on sign-out. Widget taps open To do, the conversation, the Conversations
tab or device settings through HomeNavigation. Widget strings in all 49 app
languages.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the full diff at 5010892. This is a genuinely well-built feature — clean separation between the pure payload builders (HomeWidgetsPayload) and the write path, and the extension side degrades gracefully everywhere. Notes by area:

App side (Flutter)

  • app/lib/services/home_widgets_service.dart — HomeWidgetsService.publish writes through the existing com.omi.battery_widget channel only when the JSON actually changed, and rolls back its dedup cache on failure so a retry can happen. Nice touch.
  • app/lib/pages/home/home_widgets_publisher.dart — the 800 ms debounce plus a flush on inactive/paused is the right shape for widget budget; publishNow correctly waits for tasks.hasLoaded so an unloaded list isn't shown as "All caught up". Publisher is disposed in HomePage.dispose (page.dart), so no listener leak.
  • app/lib/core/app_shell.dart — omi://app/<route> is confined to a 4-entry allowlist (action-items, conversation, conversations, settings) and unknown hosts/routes fall through to the pre-existing handling. Good containment.
  • app/lib/utils/auth/clear_user_state.dart — signing out clears all three widget documents, so no task titles or conversation titles linger on the Home Screen after logout. Thanks for thinking about that.
  • app/test/unit/home_widgets_payload_test.dart — good coverage of the ordering rules (connected-first, battery only where live, pendant fallback) and the up-next picking; the Latest-filtering tests (skip discarded/unfinished) are exactly the cases I'd want.

Extension side (Swift)

  • AppDelegate.swift — updateWidgetData validates the key against a strict three-key map and returns UNKNOWN_WIDGET_KEY otherwise; a missing json removes the key rather than writing garbage. Correct.
  • BatteryWidget/SharedDefaults.swift — SharedWidgetStore.read uses try? decoding, so malformed App Group data yields the "Open Omi to continue" state instead of a crash. The fallback to the legacy single-device battery keys keeps the widget working before the app ever publishes.
  • BatteryWidget/OmiHomeWidgets.swift — NextDeviceIntent cycles correctly with modulo; the Up next timeline scheduling entries at each shown task's due time plus midnight (so "5:00 PM" flips to "Overdue" without an app launch) is a thoughtful detail. Lock Screen task title is .privacySensitive() — good.
  • Localizable.xcstrings — 12 user-facing widget strings across 49 languages; product-surface localization, which is the accepted scope.
  • I verified AUTH_CALLBACK_SCHEME is defined in app/ios/Flutter/Base.xcconfig (project-wide), so the extension's $(AUTH_CALLBACK_SCHEME) resolves, and omiWidgetURL additionally falls back to "omi" — the deep links won't silently break.

For the maintainer (non-blocking):

  • This adds a new user-facing surface: conversation titles and open-task counts rendered on the Home Screen. The Lock Screen accessory redacts via .privacySensitive(), but the Latest widget is Home-Screen-only where that modifier has no effect — worth a product eye on whether titles should show there in all cases.
  • Documented overlap with #18887 (same OmiCaptureURLScheme plist entry, plus AppDelegate/bundle/pbxproj): whichever lands second needs the small rebase described in the PR body.
  • No iOS CI runs on this repo, so verification rests on the PR's documented simulator builds/tests and static review; the payload logic is the part covered by tests, which is the right split.

Leaving for human maintainer review before merge: product sign-off on the new widget surface (incl. conversation titles on the Home Screen) and the #18887 landing-order coordination. No blocking issues found in review.


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 needs-maintainer-review Needs a human maintainer to sign off before merge positive-signal Automation verified a genuine fix/quality contribution ios labels Sep 27, 2026
The widget drew the pendant as a glossy orb from the v2 design, which does not look like the
device or the photo the app shows. It now uses the app's pendant photo (omi-without-rope) and,
while disconnected, its lights-off photo, as the device page does. Other wearables keep their
photos, and the drawn orb is gone.
Itaxh1 added a commit to Itaxh1/omi that referenced this pull request Sep 27, 2026
@Itaxh1
Itaxh1 marked this pull request as draft September 27, 2026 08:11
… their photo

Up next is a Home Screen widget only; its Lock Screen sizes are removed. The Battery widget keeps
the Lock Screen sizes it already had. A disconnected device's photo is no longer faded, as on the
app's device page; the pendant still shows its lights-off photo.
@Itaxh1
Itaxh1 marked this pull request as ready for review September 27, 2026 08:32
@Itaxh1

Itaxh1 commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator Author

@Git-on-my-level could you take a look? Following up on your question about the pendant: the Battery widget now shows the pendant's real photo, the same one the app uses (and its lights-off photo while disconnected), instead of the drawn orb. I also dropped the Lock Screen version of Up next. The screenshot in the description is from my iPhone running this branch.

@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/iOS feature (Home Screen widgets) — approve only, not merging (feature; CI green).

@Git-on-my-level
Git-on-my-level merged commit 805aff7 into BasedHardware:main Sep 27, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ios needs-maintainer-review Needs a human maintainer to sign off before merge positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS Home Screen widgets: Battery for every wearable, Up next tasks, and Latest conversation

3 participants