Skip to content

fix(mobile): iOS home screen widgets render instead of a containerBackground error - #6464

Open
jakeleventhal wants to merge 8 commits into
pingdotgg:mainfrom
jakeleventhal:t3code/fix-ios-home-widgets
Open

fix(mobile): iOS home screen widgets render instead of a containerBackground error#6464
jakeleventhal wants to merge 8 commits into
pingdotgg:mainfrom
jakeleventhal:t3code/fix-ios-home-widgets

Conversation

@jakeleventhal

@jakeleventhal jakeleventhal commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Before

image

After

Screenshot 2026-08-13 at 12 51 15 PM

What Changed

iOS home-screen Agent Activity widgets now render instead of Apple's "Please adopt containerBackground API" placeholder.

  • Apply containerBackground("clear", "widget") on the home-screen view (small, medium, lock-screen rectangular).
  • Register the same layout with createWidget, not only createLiveActivity.
  • Publish widget snapshots from the existing Live Activity refresh/arming path.
  • Treat missing first-paint props as idle so the widget JS runtime does not throw.

Live Activity / Dynamic Island layouts are unchanged.

Why

expo-widgets 56 stopped applying containerBackground for us, and the home-screen widget never received a createWidget layout (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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Made-with: Grok 4.6 (T3 Code)

Note

Fix iOS home screen AgentActivity widgets to render instead of throwing a containerBackground error

  • Extends AgentActivity.tsx to render home-screen (systemSmall, systemMedium) and accessory widget layouts in addition to Live Activity layouts, with branded headers, status icons, and deep linking.
  • Adds publishAgentActivityWidget which calls createWidget(...).updateSnapshot(props) in a try/catch, silently ignoring failures on platforms without a widget extension.
  • Applies containerBackground('clear', 'widget') only for widget families, not Live Activities, which was the source of the original rendering error.
  • Updates refreshActiveLiveActivityRemoteRegistration to always publish a home-screen widget snapshot (using the latest aggregate or idle props) regardless of Live Activity state.
  • Adds tests covering branded widget layouts, accessory deep linking, containerBackground exclusion 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 AgentActivity renderer now branches on widget family: home-screen and lock-screen accessory sizes get dedicated layouts with containerBackground('clear', 'widget'), while Live Activity / Dynamic Island output is unchanged. The layout is registered with createWidget (not only createLiveActivity), and publishAgentActivityWidget pushes snapshots via updateSnapshot, 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.

…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)
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eff0f97b-e389-4dd7-a36c-400fd2901c88

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 13, 2026
Comment thread apps/mobile/src/widgets/AgentActivity.tsx Outdated
Comment thread apps/mobile/src/features/agent-awareness/remoteRegistration.ts Outdated
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)
Comment thread apps/mobile/src/widgets/AgentActivity.tsx
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)
@jakeleventhal
jakeleventhal marked this pull request as ready for review August 13, 2026 16:52

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit eb696e5. Configure here.

import AgentActivity, {
publishAgentActivityWidget,
type AgentActivityProps,
} from "../../widgets/AgentActivity";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit eb696e5. Configure here.

@macroscopeapp

macroscopeapp Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant