Repository navigation
Commit 4d7a9af
Take the timeline scroll body and composer handle off the boot path (#8507)
## 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:
- #8089: `plugin-navigation-hooks` imports `useTimelinePaneThreadId`
from `timeline-viewport.tsx`, which also defined
`TimelineViewportScrollSource`. That put `bottom-anchored-scroll-body`
and `scroll-position-keeper` on boot.
- #7960: `active-composer.ts` built the active composer's plugin handle
itself, so the action-context binder (on boot) pulled in
`plugin-composer-handle`, the SDK's `composer-handle` and
`composer-draft-actions`, `plugin-composer-host` and
`composer-editor-registry`. #8050 added a second path to the same
modules: plugin navigation converts `initialPrompt` parts through
`plugin-composer-handle.ts`.
#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](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 <[email protected]>1 parent e0c49e2 commit 4d7a9af
25 files changed
Lines changed: 189 additions & 152 deletions
File tree
- apps/app
- src
- components
- pickers
- plugin
- promptbox
- tools
- lib
- views
- thread-detail
- packages
- domain/src
- plugin-sdk
- src
- __tests__
- internal
- testing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
201 | 219 | | |
202 | 220 | | |
203 | 221 | | |
| |||
347 | 365 | | |
348 | 366 | | |
349 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
350 | 371 | | |
351 | 372 | | |
352 | 373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 35 | + | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
106 | | - | |
107 | 104 | | |
108 | 105 | | |
109 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| 193 | + | |
192 | 194 | | |
193 | 195 | | |
194 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 2 | | |
7 | 3 | | |
8 | 4 | | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
12 | | - | |
13 | 8 | | |
14 | 9 | | |
15 | 10 | | |
| |||
18 | 13 | | |
19 | 14 | | |
20 | 15 | | |
| 16 | + | |
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
| |||
159 | 155 | | |
160 | 156 | | |
161 | 157 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | 158 | | |
188 | 159 | | |
189 | 160 | | |
190 | | - | |
| 161 | + | |
191 | 162 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments