Skip to content

Take the timeline scroll body and composer handle off the boot path - #8507

Merged
ymichael merged 1 commit into
mainfrom
bb/bundle-budget-analysis-and-regression-thr_5rumd259jy
Dec 1, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/bundle-budget-analysis-and-regression-thr_5rumd259jy

Conversation

@ymichael

@ymichael ymichael commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Boot JavaScript grew from 393.2 KB to 418.9 KB brotli between #7744 (Nov 18) and main, leaving 0.2 KB under the 419.1 KB limit. Two of the largest steps were static edges from the boot path into page-only code:

#7962's boot growth (~1 KB brotli) is the exclusive-pick logic the sidebar thread list and navigation need before they paint, so it stays.

What changed

  • TimelineViewportScrollSource moved to apps/app/src/lib/timeline-viewport-scroll-source.tsx; timeline-viewport.tsx exports useTimelineViewportStore for it.
  • ActiveComposerCandidate gained handle(pluginId). composer-root registers a factory built by the new active-composer-handle.ts, and getActiveComposerHandle calls it, so active-composer.ts no longer imports the handle code. experimental_useActiveComposer uses the same builder.
  • initialPromptSeedFromComposer and mentionText moved to apps/app/src/lib/initial-prompt-seed.ts. It imports composerDraftFromInsertParts from a new SDK internal subpath, @get-bb/plugin-sdk/internal/composer-draft-transforms, where that function now lives. A re-export through internal/composer-handle still kept the whole module on boot.
  • Plugin SDK 0.6.216 for the new subpath.
  • bundle-budget.json: splitBoundaries boot guards for bottom-anchored-scroll-body.tsx, active-composer-handle.ts and plugin-composer-handle.ts, plus a dated $comment entry. Limits unchanged.

How you verified

Real builds of main (e0c49e2) and this branch, brotli bytes from the .br files check-bundle-budget.mjs counts:

Closure main branch Δ
boot 428,920 419,163 −9,757
ThreadPage 498,511 507,873 +9,362
NewThreadPage 268,226 277,858 +9,632
PluginFrontend 219,813 229,475 +9,662
boot + each page −95 to −395

Raw boot: 1,708,056 → 1,668,548. Every page shell uses the scroll body (page-shell.tsx) and every page loads the plugin runtime that needs the composer handle, so the code moved into the shared page chunks. The shell's critical path shrinks, the total before page content is unchanged, and boot is back to 2.3% headroom. I didn't measure paint timings.

  • Negative control: re-adding the timeline-viewport → scroll-body import and a plugin-navigation-hooks → plugin-composer-handle import fails the check with both new guards, and boot returns to 418.6 KB.
  • pnpm exec turbo run test --filter=@bb/app --filter=@get-bb/plugin-sdk: 709 + 47 test files pass.
  • pnpm exec turbo run typecheck lint --filter=@bb/app --filter=@get-bb/plugin-sdk, node apps/app/scripts/check-bundle-budget.mjs, oxfmt --check.
  • Live pnpm start:worktree with a real Claude Code thread, driven in headless Chrome: no console errors, scroll-to-latest works, the outline rail's active tick follows scrolling, and typing in the composer works.

AGENT GENERATED

🤖 Generated with Claude Code

#8089 and #7960 each left a static edge from the boot path into
page-only code:

- plugin-navigation-hooks reads the timeline pane's thread id from
  timeline-viewport, which also held TimelineViewportScrollSource. That
  put bottom-anchored-scroll-body and scroll-position-keeper on boot.
  The scroll source now lives in timeline-viewport-scroll-source.tsx.
- The action-context binder built the active composer's plugin handle
  inside active-composer.ts, and plugin navigation converted initial
  prompts through plugin-composer-handle.ts (#8050). Both put the
  composer handle, its draft actions and the composer host on boot.
  Each composer now registers a handle factory built by
  active-composer-handle.ts, and initial prompts convert in
  initial-prompt-seed.ts through a new SDK internal subpath,
  internal/composer-draft-transforms. SDK 0.6.216.

Boot: 428,920 -> 419,163 bytes brotli (-9,757), 1,708,056 -> 1,668,548
raw. Every page shell uses the scroll body and every page loads the
plugin runtime, so the code moved into the shared page chunks
(ThreadPage +9,362, NewThreadPage +9,632, PluginFrontend +9,662 brotli);
boot plus each page is within 0.4 KB of before. Limits unchanged.

splitBoundaries now keeps bottom-anchored-scroll-body,
active-composer-handle and plugin-composer-handle out of boot; a
negative control that re-adds each edge fails the check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit 4d7a9af into main Dec 1, 2026
52 checks passed
@ymichael
ymichael deleted the bb/bundle-budget-analysis-and-regression-thr_5rumd259jy branch December 1, 2026 23:22
@SawyerHood SawyerHood mentioned this pull request Dec 2, 2026
SawyerHood added a commit that referenced this pull request Dec 2, 2026
## Human comments

## What was wrong

`main` has 331 commits since `desktop-v0.50.1` with no release notes,
and `bb-app` and `@bb/desktop` are still at 0.50.1.

## What changed

- `packages/bb-app/package.json`, `apps/desktop/package.json`: 0.50.1 →
0.51.0 (`node scripts/bump-version.mjs --minor`). The release adds 14
database migrations (0159–0172), raises `HOST_DAEMON_PROTOCOL_VERSION`
from 268 to 286, moves `@get-bb/plugin-sdk` from 0.6.157 to 0.6.216,
replaces the Cursor agent with Grok Build, and turns six early-adopter
experiments on for everyone (#8068).
- `CHANGELOG.md`: the 0.51.0 section, covering `desktop-v0.50.1` through
#8507 (`4d7a9af609`). Same sections as 0.50.0: Reliability, Performance,
Usability, Experiments, Now on for everyone, Agents, Bug fixes, Plugins,
Security, Thanks (21 outside contributors). The telemetry rework (#8402)
is left out on purpose.
- `changelog-metadata.ts`: the 0.51.0 `RELEASE_META` entry (December 2,
2026, "Warm worktrees, multi-folder projects, and new agents").

## How you verified

- `node .github/workflows/check-version-lockstep.mjs`: `bb-app=0.51.0
@bb/desktop=0.51.0`.
- `pnpm exec turbo run typecheck test --filter=@bb/app
--filter=@bb/config --filter=@bb/server --filter=bb-app`: 17/17 tasks
(`@bb/app` 709 files, 7574 passed, 20 skipped).
- `pnpm exec turbo run smoke:tarball --filter=bb-app --force`: passed in
51 s.
- oxfmt on `CHANGELOG.md` and `changelog-metadata.ts`, and `git diff
--check`: clean.

> AGENT GENERATED
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