fix(mobile): iOS home screen widgets render instead of a containerBackground error - #6464
fix(mobile): iOS home screen widgets render instead of a containerBackground error#6464jakeleventhal wants to merge 8 commits into
Conversation
…kground error expo-widgets 56 stopped applying containerBackground for us, and the home-screen widget never got a createWidget layout. iOS 17 then showed "Please adopt containerBackground API" instead of agent activity. Adopt the modifier on the home-screen view, register the widget layout, and publish snapshots from the existing Live Activity refresh path. Made-with: Grok 4.6 (T3 Code)
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Use the compact banner for accessoryRectangular so lock-screen widgets are not clipped.
…ss/remoteRegistration.ts Publish the home-screen widget from the relay aggregate outside Live Activity priming.
The Check typecheck job failed because the snapshot fixture used a plain string threadId, which is not assignable to Brand<"ThreadId">. Made-with: Grok 4.6 (T3 Code)
Accessory circular/inline/rectangular layouts returned before widgetURL was applied, so taps on those families did not open the thread. Made-with: Grok 4.6 (T3 Code)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit eb696e5. Configure here.
| }); | ||
| }; | ||
| publishAgentActivityWidget(props); | ||
| const activity = AgentActivity.start(props); |
There was a problem hiding this comment.
Widget stuck on Connecting
Medium Severity
Local arming publishes a Connecting snapshot to the home-screen widget, but the authoritative relay aggregate is only published from refreshActiveLiveActivityRemoteRegistration, which runs on foreground, sign-in, or connection—not after arm. Live Activities keep advancing via push; the widget can remain on Connecting until the app becomes active again.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit eb696e5. Configure here.
| import AgentActivity, { | ||
| publishAgentActivityWidget, | ||
| type AgentActivityProps, | ||
| } from "../../widgets/AgentActivity"; |
There was a problem hiding this comment.
Sign-out leaves widget stale
Medium Severity
Cloud sign-out ends local Live Activities but never publishes an idle home-screen widget snapshot. After publishAgentActivityWidget was added, the widget can keep showing the previous session’s agent activity until a later signed-in refresh overwrites it.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit eb696e5. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces significant new capability for iOS home screen widgets with complex layout rendering across multiple widget sizes. The scope extends beyond a simple fix to add new user-facing functionality, and there are unresolved findings about widget staleness edge cases that warrant human review. You can customize Macroscope's approvability policy. Learn more. |


Before
After
What Changed
iOS home-screen Agent Activity widgets now render instead of Apple's "Please adopt containerBackground API" placeholder.
containerBackground("clear", "widget")on the home-screen view (small, medium, lock-screen rectangular).createWidget, not onlycreateLiveActivity.Live Activity / Dynamic Island layouts are unchanged.
Why
expo-widgets 56 stopped applying
containerBackgroundfor us, and the home-screen widget never received acreateWidgetlayout (that API writes a different App Group key than Live Activities). iOS 17+ then refused to render the widget.UI Changes
Before: adding the Agent Activity widget showed a white card with a stop icon and "Please adopt containerBackground API".
After: not captured on a device in this change (needs a native iOS rebuild and adding the widget). After opening the updated app once, the widget should show agent rows or "No active agents" on the system widget chrome.
Checklist
Made-with: Grok 4.6 (T3 Code)
Note
Fix iOS home screen AgentActivity widgets to render instead of throwing a
containerBackgrounderrorsystemSmall,systemMedium) and accessory widget layouts in addition to Live Activity layouts, with branded headers, status icons, and deep linking.publishAgentActivityWidgetwhich callscreateWidget(...).updateSnapshot(props)in a try/catch, silently ignoring failures on platforms without a widget extension.containerBackground('clear', 'widget')only for widget families, not Live Activities, which was the source of the original rendering error.refreshActiveLiveActivityRemoteRegistrationto always publish a home-screen widget snapshot (using the latest aggregate or idle props) regardless of Live Activity state.containerBackgroundexclusion for Live Activities, and idle rendering when props are missing.Macroscope summarized eb696e5.
Note
Low Risk
Scoped to mobile widget UI and snapshot publishing; Live Activity behavior is preserved and unsupported builds no-op safely.
Overview
Fixes iOS home-screen Agent Activity widgets that showed Apple’s “Please adopt containerBackground API” placeholder instead of content.
The shared
AgentActivityrenderer now branches on widget family: home-screen and lock-screen accessory sizes get dedicated layouts withcontainerBackground('clear', 'widget'), while Live Activity / Dynamic Island output is unchanged. The layout is registered withcreateWidget(not onlycreateLiveActivity), andpublishAgentActivityWidgetpushes snapshots viaupdateSnapshot, with errors swallowed on builds without a widget extension.Agent awareness registration now refreshes the home-screen widget from the relay activity snapshot on the same path as Live Activity reconciliation (including when a Live Activity is already armed or Live Activities are disabled), and publishes a placeholder when arming local work so the widget does not stay stuck on “Connecting”.
Reviewed by Cursor Bugbot for commit eb696e5. Bugbot is set up for automated code reviews on this repo. Configure here.