Skip to content

feat(mobile): add iOS Live Activity and widgets - #5553

Open
iscekic wants to merge 12 commits into
audit-w8b-live-activities-3cf8from
audit-w8b-live-activities-3cf8-s2
Open

feat(mobile): add iOS Live Activity and widgets#5553
iscekic wants to merge 12 commits into
audit-w8b-live-activities-3cf8from
audit-w8b-live-activities-3cf8-s2

Conversation

@iscekic

@iscekic iscekic commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The iOS app now offers an "Active Agents" widget on the Home Screen and Lock Screen. It shows the count of agents that need input, that are reconnecting, and that are running. It adds an "Open agents" button when counts show.
  • The iOS app now shows an Active Agents Live Activity in the Dynamic Island and on the Lock Screen. It shows the top count first — needs input, then reconnecting, then running — in compact, expanded, and minimal layouts.
  • The widget and Live Activity show one clear status message for each other state: no work, stale count, expired snapshot, signed out, and privacy mode.

The new iosSink implements the GlanceableSink contract for the iOS surfaces. publish writes a widget snapshot plus a two-frame timeline whose second frame, at expiresAt, carries the zeroed expired snapshot; startOrUpdate starts or adopts a single Live Activity, ignores a revision at or below the last applied one, and treats only ERR_LIVE_ACTIVITIES_NOT_SUPPORTED as permanent denial. endImmediate adopts a leftover activity after a process restart and ends it with the last published content date, then unregisters delivery tokens.

Files
  • apps/mobile/src/glanceable-ios/ios-sink.ts (added, +191) — the sink: publish/startOrUpdate/endImmediate, ActivityKit adoption and denial handling, revision guard, content-date tracking, getActivityKitDenied, and _resetIosSinkForTests.
  • apps/mobile/src/glanceable-ios/register.ts (added, +10) — registers iosSink at import time, with no React dependency.

The GlanceableViewProps type is the single payload that crosses into the widget extension, and buildGlanceableViewProps is its only producer. It maps the snapshot and surface flags to translated status copy, ranked count lines, a compact primary count, an elapsed anchor, and a spoken accessibility label. It excludes every identifier, title, and revision, so the out-of-process widget holds only counts and translated strings.

Files
  • apps/mobile/src/glanceable-ios/view-props.ts (added, +64) — defines GlanceableViewProps, GlanceableCount, and the builder that translates snapshot state into the surface payload.

ActiveAgentsLiveActivity declares the banner, compact leading/trailing, minimal, and expanded leading/trailing/bottom Dynamic Island regions. It renders translated count lines, a muted status line, and a relative-date elapsed anchor, and its 'widget' body references only widget globals and PlatformColor, so Babel can stringify and re-evaluate the layout in the widget extension. Only stringified GlanceableViewProps reach it; translation happens before the boundary.

Files
  • apps/mobile/src/glanceable-ios/active-agents-live-activity.tsx (added, +112) — the createLiveActivity layout function with the five Dynamic Island regions and the inline English fallbacks for the gallery placeholder.

ActiveAgentsWidget renders the small, medium, large, and accessory widget families. Compact families collapse to one headline with the primary count and label, and non-compact layouts add the translated "Open agents" affordance for happy and stale snapshots. Every family deep-links to the agents tab via widgetURL.

Files
  • apps/mobile/src/glanceable-ios/active-agents-widget.tsx (added, +105) — the createWidget layout function, its compact/non-compact branches, and the widgetURL deep link.

The Expo config registers the expo-widgets plugin for one ActiveAgentsWidget target with bundle id com.kilocode.kiloapp.ExpoWidgetsTarget, push enabled, and six supported families, and it reuses the existing app group group.com.kilocode.kiloapp instead of creating a second one. Two local plugins follow it: withActiveAgentsLiveUpdate verifies the local module's expo-module.config.json exists, and withActiveAgentsAndroidWidget stays a no-op until level 3 writes the Android widget config, so a level 2 prebuild is unchanged.

Files
  • apps/mobile/app.config.ts (modified, +31) — adds the expo-widgets plugin block and registers the two local config plugins.
  • apps/mobile/plugins/withActiveAgentsLiveUpdate.js (added, +19) — resolves the local module directory and throws if its config file is missing.
  • apps/mobile/plugins/withActiveAgentsAndroidWidget.js (added, +27) — loads react-native-android-widget/app.plugin.js only when the level-3 widget config file exists and lists widgets.

A local active-agents-live-update Expo module is added as a file: dependency with empty native module lists and no-op start/update/end plus isLiveUpdateCapable() returning false; level 3 fills in the Android side. The root layout imports it and the iOS sink registration, so the sink subscribes to the publisher for the whole process on both platforms. @expo/ui is added and pinned to 57.0.12 through a workspace override so expo-widgets and expo-router share one native-module copy, and react-native-android-widget is added for the level 3 widget.

Files
  • apps/mobile/modules/active-agents-live-update/package.json (added, +12) — module manifest with the TypeScript entry and peer dependencies.
  • apps/mobile/modules/active-agents-live-update/expo-module.config.json (added, +9) — empty apple/android native module lists.
  • apps/mobile/modules/active-agents-live-update/src/index.ts (added, +32) — no-op native functions and the try/catch require of the future Android register.
  • apps/mobile/package.json (modified, +4) — adds @expo/ui, expo-widgets, react-native-android-widget, and the active-agents-live-update file dependency.
  • apps/mobile/src/app/_layout.tsx (modified, +6) — imports the local module and @/glanceable-ios/register at bootstrap.
  • pnpm-workspace.yaml (modified, +3) — adds the @expo/ui 57.0.12 override.

The pure vitest project now includes the glanceable-ios test directory, so the sink suite runs under the node environment with no React mounting and stays out of the mounted-test harness.

Files
  • apps/mobile/vitest.pure.config.ts (modified, +1) — adds src/glanceable-ios/**/*.test.ts to the include list.

Test: 1 new suite added, apps/mobile/src/glanceable-ios/ios-sink.test.ts (+399).
Generated: 1 lockfile updated, pnpm-lock.yaml (~239 lines changed).


Verification

  • No E2E report was attached to this handoff. No manual test paths were recorded for this section; it ships the unit suite above.

Visual Changes

Visual Changes: N/A

Reviewer Notes

  • Human steps: none. No manual step is required before or after merge.
  • Notes: none.

Stacked PRs — merge bottom to top. Each level shows only its own diff.

Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.

  1. audit-w8b-live-activities-3cf8feat(mobile): add glanceable agents snapshot contract #5535
  2. audit-w8b-live-activities-3cf8-s2feat(mobile): add iOS Live Activity and widgets #5553 ← this PR
  3. audit-w8b-live-activities-3cf8-s3feat(mobile): add Android agents widget and live update #5585
  4. audit-w8b-live-activities-3cf8-s4feat(mobile): deliver glanceable snapshot updates #5620 (tip)

Comment thread apps/mobile/modules/active-agents-live-update/src/index.ts
Comment thread apps/mobile/src/glanceable-ios/active-agents-widget.tsx Outdated
Comment thread apps/mobile/src/glanceable-ios/ios-sink.ts Outdated
Comment thread apps/mobile/src/glanceable-ios/ios-sink.ts
@kilo-code-bot

kilo-code-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • apps/mobile/src/glanceable-ios/ios-sink.ts
  • apps/mobile/src/glanceable-ios/ios-sink.test.ts
Previous Review Summaries (3 snapshots, latest commit 5043f7a)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 5043f7a)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • apps/mobile/knip.json

Previous review (commit 119f2a2)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • apps/mobile/src/glanceable-ios/active-agents-widget.tsx
  • apps/mobile/src/glanceable-ios/ios-sink.test.ts
  • apps/mobile/src/glanceable-ios/ios-sink.ts
  • apps/mobile/src/glanceable-ios/view-props.ts

Previous review (commit b49e6b3)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
apps/mobile/modules/active-agents-live-update/src/index.ts 29 Metro statically resolves missing @/glanceable-android/register; try/catch cannot save the bundle

WARNING

File Line Issue
apps/mobile/src/glanceable-ios/active-agents-widget.tsx 64 widgetURL uses an Expo Router href that incoming-link handling will not map
apps/mobile/src/glanceable-ios/ios-sink.ts 15 Live Activity start URL is the same unmapped Expo Router href
apps/mobile/src/glanceable-ios/ios-sink.ts 118 publish adopts leftover Live Activities after restart but never ends them
Files Reviewed (16 files)
  • apps/mobile/app.config.ts
  • apps/mobile/modules/active-agents-live-update/expo-module.config.json
  • apps/mobile/modules/active-agents-live-update/package.json
  • apps/mobile/modules/active-agents-live-update/src/index.ts - 1 issue
  • apps/mobile/package.json
  • apps/mobile/plugins/withActiveAgentsAndroidWidget.js
  • apps/mobile/plugins/withActiveAgentsLiveUpdate.js
  • apps/mobile/src/app/_layout.tsx
  • apps/mobile/src/glanceable-ios/active-agents-live-activity.tsx
  • apps/mobile/src/glanceable-ios/active-agents-widget.tsx - 1 issue
  • apps/mobile/src/glanceable-ios/ios-sink.test.ts
  • apps/mobile/src/glanceable-ios/ios-sink.ts - 2 issues
  • apps/mobile/src/glanceable-ios/register.ts
  • apps/mobile/src/glanceable-ios/view-props.ts
  • apps/mobile/vitest.pure.config.ts
  • pnpm-workspace.yaml

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 154.7K · Output: 9.1K · Cached: 513.3K

Review guidance: REVIEW.md from base branch audit-w8b-live-activities-3cf8

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