Skip to content

Badge the phone app icon with threads waiting for input - #6879

Merged
ymichael merged 1 commit into
mainfrom
bb/show-the-attention-count-on-the-phone-app-badge-thr_ymbvm9smmz
Nov 3, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/show-the-attention-count-on-the-phone-app-badge-thr_ymbvm9smmz

Conversation

@ymichael

@ymichael ymichael commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The phone app icon never showed a count. The mobile shell advertises the badge capability and, when the app goes to the background, writes the last count it received. But nothing in the web app has sent that message since shellSetBadge was removed in #3583, so the shell wrote its default of 0 and cleared any badge.

What changed

  • apps/app/src/lib/native-shell/native-shell.ts: adds shellSetBadge(count), which posts the existing { type: "badge", count } bridge message when the shell supports it.
  • apps/app/src/components/layout/AppLayout.tsx: posts the pending-thread count from desktopAttentionThreads whenever it changes. This is the number the desktop Dock badge shows.

There are no mobile, push-payload, plugin SDK or daemon protocol changes. The badge updates only while the WebView runs. Pushes do not carry a badge count, so a question that arrives while the app is suspended doesn't change the badge until the app is opened. A thread that is only unread gets a dot on the Dock but no number on the phone.

How you verified

  • New AppLayout.test.tsx case: it checks that the page posts 2 for two pending threads and one unread thread, then 0 once none are pending. It fails without the AppLayout change.
  • pnpm exec turbo run typecheck lint --filter=@bb/app passes, as do the AppLayout and native-shell tests.
  • iOS 26.5 simulator against pnpm start:worktree, with two threads waiting on a question:
    • Before the fix: a simulated push set the badge to 7, which shows the app has badge permission. Opening the app and going home then cleared it.
    • After the fix: the badge showed 2. When one question was resolved, it showed 1.

AGENT GENERATED

The mobile shell advertises the "badge" capability and writes the count
it last received when the app goes to the background, but nothing in the
web app has sent that message since shellSetBadge was removed in #3583.
The shell therefore wrote 0 and cleared any badge.

AppLayout now posts the pending-thread count, the number the desktop
Dock badge shows, to the native shell whenever it changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit 27384ae into main Nov 3, 2026
30 checks passed
@ymichael
ymichael deleted the bb/show-the-attention-count-on-the-phone-app-badge-thr_ymbvm9smmz branch November 3, 2026 19:00
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