Skip to content

feat(mobile): add New chat and Bestie lock screen widgets - #9373

Closed
brow wants to merge 2 commits into
mainfrom
mobile-lock-screen-widgets
Closed

brow wants to merge 2 commits into
mainfrom
mobile-lock-screen-widgets

Conversation

@brow

@brow brow commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #9360 Home Screen quick actions. Review that first; this PR's own change is the top commit.

Adds two circular iOS lock screen widgets:

  • New chat opens a new chat, like the app icon's New chat quick action.
  • Bestie shows the current community's Bestie, drawn from its avatar, and opens its DM. With no Bestie it shows the generic agent symbol and opens the agents list.

The widget follows whichever community was active when the app was last used and updates when you switch. There is no per-widget setting.

How it works

  • A new BuzzWidgets WidgetKit extension (iOS 16+) reads the Bestie's name and avatar PNG from the app group. The app writes them through the existing buzz/home_screen_shortcuts channel (setBestie) and reloads the widget's timeline.
  • Home's shortcut host renders the avatar on a transparent background whenever the Bestie or its profile changes. Each render is fenced by a generation, so a replaced Bestie's avatar never lands. Signing out clears it.
  • A tap opens buzz://home-shortcut/<type>. The scene delegate routes it into the same handling as the quick actions, both on cold launch and while running, and passes every other URL through to app links as before.
  • nativeAvatarImage gains a dimension parameter (default 72, unchanged for existing callers). The widget uses 228 px.

iOS draws lock screen widgets in monochrome, so the Bestie appears as a tinted silhouette of its avatar, not in full color.

Release signing

The extension's bundle identifier is $(BUNDLE_IDENTIFIER).BuzzWidgets and it uses the existing app group. Release builds signed with manual profiles need a provisioning profile for the new identifier; the release pipeline needs a matching change to sign it. A failed avatar save leaves the previous Bestie intact (image written before name) and is retried on the next Bestie reload.

What gets better, and what doesn't get worse

Lock screen access to the two most common starts, without opening the app first. The widgets stay confined to themselves: the extension only reads two keys and one file from the app group, and the app's only new work is one small avatar render and write when the Bestie or its profile changes (never on reconnect). Links other than buzz://home-shortcut/... take the same path as before.

Validation

  • flutter test (full suite) passes. The Home shortcut journey now also checks that the widget gets the Bestie's name and avatar, that reconnects don't republish it, that a Bestie replaced mid-render never reaches the widget, that a community without a Bestie shows the generic agent, and that signing out clears it. The replaced-Bestie case holds that render and waits for it to finish before asserting, and the other waits poll published state, so a slow runner can't pass it vacuously. Removing the generation fence fails it.
  • iOS simulator (iPhone 17 Pro, iOS 27), signed in to a Builderlab community: added both widgets from the lock screen gallery and confirmed the Bestie widget shows its avatar. Opened buzz://home-shortcut/new-chat cold (app killed), which landed on New chat. Opened buzz://home-shortcut/message-bestie with New chat open, which returned to Home and opened the Bestie DM.

Before merge

  • App IDs (with the app group) and provisioning profiles for the widget extension exist for both the internal and App Store builds.
  • The release pipeline change that signs the extension passes a proof run of both iOS lanes on an existing release candidate, then merges.

Before / after

Before After
Lock screen without widgets Lock screen with the New chat and Bestie widgets

🤖 Generated with Claude Code

brow pushed a commit that referenced this pull request Nov 11, 2026
@brow

brow commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T22:25:50.051110Z be99d59 Manual request
ℹ️ 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: be99d597b3

ℹ️ 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".

Base automatically changed from mobile-home-quick-actions to main November 12, 2026 04:20
square-tomb and others added 2 commits November 11, 2026 20:21
Two circular iOS lock screen widgets: New chat, and the current
community's Bestie drawn from its avatar. A tap opens
buzz://home-shortcut/<type>, which the scene delegate routes through the
Home Screen quick action handling, cold or warm. Home publishes the
Bestie's name and avatar to the app group whenever it changes, fenced so
a replaced Bestie's avatar never lands, and clears it on sign out. With
no Bestie the widget shows the generic agent and opens the agents list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Tom Brow <[email protected]>
…rministic

The Bestie widget test now holds a replaced Bestie's avatar render and
waits for it to finish before asserting it never lands, and waits on
published state instead of a fixed real-time budget. Removing the
generation fence fails it.

The native save writes the avatar before the name and reports a failed
write, so the widget never pairs one Bestie's name with another's image,
and Home forgets the snapshot so the next Bestie reload retries. The
README lists the .BuzzWidgets identifier to provision.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Tom Brow <[email protected]>
@brow
brow force-pushed the mobile-lock-screen-widgets branch from f589bd7 to 04db69a Compare November 12, 2026 04:21
brow added a commit that referenced this pull request Nov 12, 2026
…9388)

Follow-up to review notes on [#9360 Home Screen
shortcuts](#9360). These are fixes for
rare races, with no visible change.

- **The member picker can't wedge.** UIKit ignores a dismiss that
arrives mid-transition (the sheet still animating in, or during an
interactive swipe-down) and never runs its completion. The picker
coordinator queues every later present behind that completion, so New DM
and Add members then opened nothing for the rest of the session. Dismiss
now waits for the transition to finish, then dismisses whatever is still
presented.
- **A shortcut tap reaches Dart once.** The native bridge both buffered
a tap and sent it, so a tap during cold launch could arrive twice and
run again after Home had already handled it. Now a tap is buffered only
until Dart first takes the pending one, and after that it is sent
directly.
- **Signing out drops a waiting tap.** Removing Home clears a tap that
is still waiting (for example on a Bestie that is still loading), so it
can't run in the next account's Home.

Not included: carrying the Bestie's pubkey in the shortcut item, so a
stale "Message Alice" falls back to Agents rather than opening the
current Bestie. It's optional, and it would change the bridge's payload
shared with the lock screen widgets in [#9373 lock screen
widgets](#9373).

### Validation

- The Home shortcut journey gains a step: a tap waiting while the app is
inactive is cleared when Home goes away. The step fails with the
teardown guard removed.
- Automated simulator run (iPhone 17 Pro, iOS 27, signed in to a
Builderlab test community), driving the app icon's quick actions on the
Home Screen:
- New DM from a conversation opens the picker. New DM again, with the
picker already open, replaces it. New chat over the picker closes it and
opens a draft, and New DM after that opens the picker again (it doesn't
get stuck).
  - Message (Bestie) opens the Bestie conversation.
- Cold launch through New chat opens exactly one New chat screen. Back
returns to Messages.

buzz-review-completed

Signed-off-by: Tom Brow <[email protected]>
Co-authored-by: Tom Brow <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@brow brow closed this Nov 12, 2026
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.

2 participants