Skip to content

Replace the sidebar's update chips with one update button - #7213

Merged
SawyerHood merged 2 commits into
mainfrom
single-update-button
Nov 7, 2026
Merged

SawyerHood merged 2 commits into
mainfrom
single-update-button

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The sidebar footer had a separate update chip for each kind of update: bb, provider CLIs and plugins. All three linked to the same Settings › Updates page, so they took up footer space without telling you more than one button would. When all three were showing, they barely fit next to the footer icons.

What changed

  • One update button. SidebarUpdatesBadge now draws a single round download button at the end of the footer. It appears only when something has an update. Clicking it opens Settings › Updates. The amber machine warning chip stays separate because it goes to Settings › Machines.
  • Hover card (Radix HoverCard; inspired by T3 Code's update pill and Orca's update card):
    • bb: the pending version and current version. It says "Installs itself when you're idle" when bb's automatic update is on, or "Installs when bb restarts" when it isn't. Restart now applies the update now: for the server it uses the same running-threads confirmation as the Updates page; on desktop it relaunches into a downloaded update. While bb restarts, the card says "Restarting into the update…".
    • Provider CLIs and plugins: one row each, with its version change and a host name when the same CLI is stale on more than one machine. Update all starts every CLI and plugin update that can start. It never restarts bb; only bb's own idle update or Restart now does.
    • Failures: a failed update stays in the list, greyed out, as "Failed · try again". The rest of the updates still finish. When only failed updates are left, the button reads Try again. There is no red error state.
    • While updating: the button and each running row show a spinner.
  • Mobile: a hover card can't open on touch, so tapping the button goes straight to Settings › Updates, which already has the update actions.
  • Shared actions: starting a bb update (with its confirmation dialog) moves out of UpdatesSettingsSection into useStartAppUpdate, and starting plugin updates moves into useStartPluginUpdates. Both the Updates page and the sidebar card call them, so neither surface has its own copy of the logic. The card's rows come from a pure buildSidebarUpdateModel in sidebar-update-model.ts.
  • @bb/shared-ui/hover-card: content now renders in a portal with the portal scope props, the same way Tooltip does. Without the portal, the card drew under the sidebar content and couldn't be clicked. Nothing else used HoverCard yet.

There are no wire, CLI, or settings changes.

Screenshots

These come from the new Ladle stories (sidebar/Update button). They render the real AppLayoutSidebar with test data, and the update endpoints are stubbed so that clicking runs the real update flow. In One update fails, Claude Code's update fails and the other updates finish.

Every scenario, light

All scenarios, light

Every scenario, dark

All scenarios, dark

Hover: bb, CLIs, and plugins Update all in progress One failed: the rest finished
Restart now with running threads Restarting Mobile: tap goes to Updates

How you verified

  • SidebarUpdatesBadge.test.tsx was rewritten for the new behavior, with 15 tests. They cover:
    • one button and its label/count;
    • card contents and order, with blocked plugins and missing CLIs left out, and host names shown when a CLI is stale on several machines;
    • bb's idle and restart wording;
    • Restart now: the server path asks first when threads are running, and the desktop path relaunches into the downloaded update;
    • Update all starts only the CLIs and plugins that can start, and never bb;
    • spinners while updates run;
    • failed provider and plugin updates stay greyed out with Try again;
    • the restarting state;
    • the existing machine warning tests.
  • SidebarNavigationRail.test.tsx mocks were updated for the new hooks.
  • pnpm exec turbo run typecheck --filter=@bb/app --filter=@bb/shared-ui
  • apps/app full vitest run: 673 files, 6979 passed.
  • oxlint and oxfmt on the touched files.
  • Manual: Ladle at 1000×720 in light and dark themes, plus iPhone 13 emulation. The screenshots above show every scenario, including the live Update all flow with one failure, Restart now with running threads, and the Updates page after Details.

AGENT GENERATED

The sidebar footer showed a separate chip for bb, provider CLIs and plugins, all
linking to Settings › Updates. They are now one round button. Hovering it opens a
card: bb's pending version (it still installs itself when idle; Restart now applies
it early), then each provider CLI and plugin update with its versions, and Update
all, which starts the CLI and plugin updates without restarting bb. Failed updates
stay greyed out in the list with Try again. On touch the button goes straight to
Settings › Updates.

The card reuses the Updates page's actions: starting a bb update (with the running
threads confirmation) and starting plugin updates move into useStartAppUpdate and
useStartPluginUpdates, which both surfaces call.

The shared HoverCard now renders in a portal with the portal scope props, like
Tooltip; without it the card drew under the sidebar content.
@SawyerHood
SawyerHood merged commit 88c7868 into main Nov 7, 2026
50 checks passed
@SawyerHood
SawyerHood deleted the single-update-button branch November 7, 2026 00:42
ymichael added a commit that referenced this pull request Nov 7, 2026
…r icons (#7237)

## Human comments

## What was wrong

#7213 replaced the sidebar's update chips with one update button whose
details live in a Radix HoverCard wrapped around a link to Settings ›
Updates. Touch devices have no hover, so on a phone the card never
opened. Tapping the button navigated straight to Settings, and the tap
also focused the link. Focus is one of HoverCard's open triggers, so the
card could appear after the tap, away from the sidebar. #7213 also left
the offline-machine warning as an outlined pill from the old chip row,
and gave the update button its own 28px size with a 14px icon. Neither
matched the footer's icon buttons, and neither grew for touch like the
footer's other buttons.

## What changed

- **Touch opens the card in a drawer.** On devices without hover
(`useResponsiveOverlayBehavior().supportsHover` is false),
`SidebarUpdateButton` is a plain button. Tapping it opens the same card
through the responsive `Popover`: the shared bottom drawer on phones, a
floating card on tablets. **Details** closes the drawer and the mobile
sidebar, then goes to Settings › Updates. Update all and Restart now
work inside the drawer; Restart now's confirmation stacks as its own
drawer. Desktop is unchanged: hovering opens the HoverCard, and a click
goes to Updates. Both paths render one shared `SidebarUpdateCardBody`.
- **The footer controls match.** The machine warning and the update
button now render through `SidebarMenuButton` with
`SIDEBAR_FOOTER_ACTION_CLASS`. The warning looks like the existing
plugin attention glyph: a plain warning-coloured icon with a tooltip.
The update button keeps its filled circle but takes the footer size and
icon size: 28px with a 16px icon on fine pointers, 36px with a 20px icon
on coarse pointers. Each sits in its own `SidebarMenuItem`, so footer
spacing applies.
- **Cleanup.** The `SidebarUpdateButton` prop `defaultOpen` was never
passed, so it is removed. A new Ladle story, `sidebar/Update button ›
Updates with machine offline`, shows the warning next to pending
updates.

There are no wire, CLI, or settings changes.

## How you verified

- New test in `SidebarUpdatesBadge.test.tsx`: at a compact viewport, a
tap opens the card without navigating, Update all starts the CLI update,
and Details navigates, calls `onNavigate`, and closes the drawer.
`SidebarNavigationRail.test.tsx` used to reach Updates by tapping the
button at compact width; it now goes through the drawer's Details link.
The badge tests now render inside `SidebarProvider`, which
`SidebarMenuButton` requires.
- `pnpm exec turbo run test --filter=@bb/app --
src/components/sidebar/`: 15 files, 146 tests pass.
- `pnpm exec turbo run typecheck lint --filter=@bb/app`: clean, with no
new lint warnings.
- Ladle with dev-browser and CDP touch emulation:
- At 390px with a coarse pointer, a tap opens the drawer. Update all
shows each row updating. Details lands on Settings › Updates with the
drawer and the sidebar closed. Restart now with running threads shows
its confirmation drawer on top.
  - At 1024px with a coarse pointer, a tap opens the floating card.
- At 1280px with a fine pointer, hover opens the HoverCard and a click
goes to Updates.
- Measured the footer controls:

| Control | Fine pointer before | Fine pointer after | Coarse pointer
before | Coarse pointer after |
  | --- | --- | --- | --- | --- |
| Footer actions | 28px, 16px icon | unchanged | 36px, 20px icon |
unchanged |
| Machine warning | 30×24 pill, 12px icon | 28px, 16px icon | 30×24
pill, 12px icon | 36px, 20px icon |
| Update button | 28px, 14px icon | 28px, 16px icon | 28px, 14px icon |
36px, 20px icon |
- `pnpm start:worktree` on this branch with real provider CLI updates
and a fake offline host in the dev database: the footer shows the
warning and the update button at desktop and phone widths.

> AGENT GENERATED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
ymichael added a commit that referenced this pull request Nov 18, 2026
## Human comments

## What was wrong

Boot JavaScript grew from 349.6 KB to 419.8 KB brotli between #6076
(dae54bd) and f1c5304, measured per module with the same build.
Most of the growth came from features, but the largest piece was a leak.
#6579 had the sidebar updates badge (`useUpdateInventory`) import
`pluginHasUpdateSurfaces` from `PluginUpdatesCard.tsx`. That one helper
put the plugin-management UI, the shared-ui resource list and
`@radix-ui/react-scroll-area` on boot: 19.7 KB brotli. A second leak
came with #6756: `thread-action-registry` imports `useBbNavigate` from
`plugin-navigation-hooks.ts`, which also defined the plugin-only
file-open hook, so the local open-target hooks loaded before first
paint.

While splitting dialogs I also found a bug in `vite-journey-chunks.ts`.
Vite adds `\0vite/preload-helper.js` to `importedIds` for any module
with a dynamic `import()`, with no matching import declaration in the
code. The counts disagreed, so `moduleEdges` fell back to following
every name of every import. Once `ThreadActionsProvider` gained a split,
that pulled the `@bb/client-core` and `@bb/thread-view` timeline code
into the plugin runtime chunk (PluginFrontend +18.5 KB, NewThreadPage
+15 KB).

Boot brotli growth, #6076 → f1c5304 (per-module attribution, brotli
share of each boot chunk):

| Commit / module cluster | Brotli bytes |
|---|---|
| #6579 Settings → Updates: plugin management UI, shared-ui resource
list, `@radix-ui/react-scroll-area` via `pluginHasUpdateSurfaces` |
+19,727 |
| #7133 dependency update: `react-dom` 19.2.4 → 19.3.1 (+ `react`,
`scheduler`) | +7,329 |
| #6002 keyed thread store: `query-tags` keyed store,
`thread-entity-store`, `thread-panel-queries` | +5,824 |
| #6013 / #6519 core tab and message-metadata registrations through the
plugin collector (`plugin-app-registration-collector`, validators) |
+5,249 |
| #7213 single update button: `@radix-ui/react-hover-card`, badge model
| +3,148 |
| #6756 open-target hooks via `plugin-navigation-hooks` | +2,381 |
| #6763 shared rename path: `inline-rename`, rename dialogs | +1,830 |
| #7176 setup-guide telemetry: `onboarding-model` | +1,733 |
| Radix version bumps (`react-collection` and others, excluding
scroll-area and hover-card) | +~3,900 |
| React Compiler memo caches (Nov 15 budget entry) and other
app/shared-ui feature growth | remainder (~19,000) |
| **Total** | **+70,214** |

Shared packages: `@bb/shared-ui` +15.3 KB (mostly the resource list
above), `@get-bb/plugin-sdk` +5.2 KB (the collector),
`@bb/server-contract` +2.0 KB, `@bb/sdk` +1.2 KB, `@bb/domain` +0.1 KB.
Zod was already on boot at #6076 and is unchanged.

## What changed

- `pluginHasUpdateSurfaces` moved from `PluginUpdatesCard.tsx` to
`plugin-status.ts`. The plugin-management UI now loads with Settings and
Tools (−19.7 KB).
- `usePluginCanOpenFileExternally` moved from
`plugin-navigation-hooks.ts` to a new `plugin-file-open-hooks.ts`, still
re-exported by `plugin-sdk-hooks.ts`. The open-target hooks now load
with the thread and compose pages, which already use them (−2.4 KB).
- An earlier version also set `treeshake.manualPureFunctions: ["z"]` to
drop unused zod schemas (−3.6 KB). It is removed. Rolldown matches that
name in every module, minified dependencies included, and also inside
function bodies. In the built app it deleted sonner's
`setSwiping(true)`/`setSwiping(false)` calls (toasts no longer follow a
swipe on touch screens), cmdk's result-sort call, and two `push` calls
in d3-scale's log ticks.
- The project path, project rename and delete, and thread delete and
archive dialogs load behind `defineSplit` preload-tier wrappers that
mount when opened and stay mounted, following `ApplicationUrlDialog`
(−3.1 KB). Nothing in them is visible at first paint.
- `vite-journey-chunks.ts` ignores the preload helper id. The regression
test fails before the fix and passes after.
- `bundle-budget.json`: `splitBoundaries` boot guards for
`PluginUpdatesCard`, `UpdatePluginDialog`, `useLocalOpenTargets` and the
five dialogs. `@radix-ui/react-scroll-area` is added to
`forbiddenBootPackages`, plus a dated `$comment` entry. Against main's
build, the new budget reports all nine guards.
- Limits are unchanged. Boot now measures 402,655 bytes against 429,151,
which is 6.2% headroom. 10% over the new measurement (442,921) would be
a raise, so lowering the limit would leave less than 10%.

Not reached: 10% headroom needs about 12.3 KB more. The remaining boot
code that isn't first-paint UI is small and spread out. The
command-palette placeholder is kept on boot deliberately so Cmd+K opens
instantly. The updates hover-card body is ~2 KB and splitting it would
risk an empty card on an early hover. The plugin collector (5.2 KB) is
how core registers its own Info tab and message time, per the rule that
core uses the plugin API path. Each of these would cost something
visible or break that rule.

## How you verified

Bundle sizes from real builds of main (3678415, same sizes as
f1c5304) and this branch rebased on main (`.br` files, as
`check-bundle-budget.mjs` counts them):

| Closure | main raw / brotli | branch raw / brotli | brotli Δ |
|---|---|---|---|
| boot | 1,717,479 / 428,928 | 1,597,774 / 402,655 | −26,273 (−6.1%) |
| ThreadPage | 1,909,102 / 504,492 | 1,918,632 / 506,727 | +2,235 |
| NewThreadPage | 1,007,979 / 270,590 | 1,025,094 / 274,769 | +4,179 |
| PluginFrontend | 832,313 / 220,554 | 846,772 / 223,750 | +3,196 |
| boot + ThreadPage | 933,420 | 909,382 | −24,038 |
| boot + NewThreadPage | 699,518 | 677,424 | −22,094 |
| boot + PluginFrontend | 649,482 | 626,405 | −23,077 |

Journey growth is the open-target hooks (~3.9 KB) that those pages use,
plus small dialog dependencies.

First content on a real server (measured with the earlier version that
still had the `z` hint, so about 3.6 KB more JS was removed than now):
one `pnpm start:worktree` server with real data (a real agent thread
plus fixtures). Main's and this branch's builds were served by swapping
`index.html` in `apps/app/dist`, so server and data were identical. Each
run used headless Chrome on a fresh navigation with the HTTP cache
cleared and disabled, 4× CPU throttle, 1.6 Mbps / 150 ms RTT. Median of
6 alternating runs; ranges did not overlap for any metric:

| Page | Metric | main | branch | Δ |
|---|---|---|---|---|
| New thread `/` | FCP | 3,594 ms | 3,430 ms | −164 |
| | composer painted | 6,862 ms | 6,731 ms | −131 |
| Thread `/threads/<id>` | FCP | 3,606 ms | 3,432 ms | −174 |
| | timeline painted | 8,942 ms | 8,756 ms | −187 |
| Plugin page `/plugins/automations/automations` | FCP | 3,572 ms |
3,422 ms | −150 |
| | content painted | 7,496 ms | 7,353 ms | −144 |
| | JS downloaded before content (new / thread / plugin) | 745,687 /
979,589 / 732,738 B | 719,291 / 951,279 / 706,155 B | −26.4 / −28.3 /
−26.6 KB |

Manual checks on the branch build:
- Cold load, sidebar and composer: no console errors.
- Updates badge hover card: lists the provider CLI updates.
- Thread page renders its timeline.
- New thread submitted from the composer.
- Thread delete dialog: confirmed, thread deleted.
- Archive on a parent with a child: dialog shows the child count; both
threads archived.
- "New project" path-entry fallback dialog: path submitted, project
created.
- Settings → Updates and the Plugins page render.
- Project rename and delete dialogs opened through the real
`ProjectActionsProvider` in a throwaway test, because their only menu
sits in a header that the current routes don't render.
- A 409 on `GET /threads/<new>/thread-storage/location` right after
submit also happens on main.

Commands:
- `pnpm exec turbo run typecheck lint --filter=@bb/app`
- `pnpm exec turbo run test --filter=@bb/app -- <63 related test
files>`: 63 passed
- `src/vite-journey-chunks.test.ts`: fails before the fix, passes after
- `node scripts/check-bundle-budget.mjs`: OK
- `oxfmt --check`
- Rebased on main (includes #7736); `pnpm exec turbo run build typecheck
lint --filter=@bb/app` and `check-bundle-budget.mjs` pass, and the 40
app test files that touch the changed providers, dialogs, layout and
hooks pass on the merge.
- The built sonner and cmdk code again contains the swipe setter and
sort calls that the `z` hint had removed.

> AGENT GENERATED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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