Repository navigation
Measure page journeys, add defineSplit tiers, and cut boot and thread-page JavaScript - #4955
Merged
Merged
Conversation
The composer's voice button statically imported MicrophonePreferences, which put the preview UI on the SplitWorkspaceRoute closure and pushed it past its raw budget. Wrap it in defineSplit with intent preloading, which shrinks the closure from 1062.5 KiB to 1059.1 KiB, and revert the temporary 5% budget increase from #4933. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The SplitWorkspaceRoute closure moved whenever code shifted between the route chunk and a page's own lazy chunk, even when the bytes a page waits for did not change. Measure ThreadPage (route plus ThreadDetailView) and NewThreadPage (route plus RootComposeView) as unions of their entries' static closures, budget those, and point the split-boundary guards at both journeys. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Splits declared one of four download policies, and startup or idle did nothing unless a mounted owner also called useSplitPreload. Replace them with two tiers: preload splits queue themselves when defined and drain at idle once route content has painted; intent splits load on render or on their trigger's intent events. Download-only warming joins the same queue, mount gating (mountWhen, keepMounted, unmounted) replaces three hand-written gates, and the remaining React.lazy feature boundaries below the router move to defineSplit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
client-core, thread-view and core-ui had no sideEffects declaration, so Rolldown kept every module their index barrels re-export once boot imported a single helper. Mark the three packages side-effect free. Boot drops by about 94 KB to 1398.0 KB; the ThreadPage and NewThreadPage journeys grow with the code that now loads behind the route instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
SplitThreadArea imported RootComposeView statically, so every thread page waited for the new-thread composer, its pickers and setup dialogs. Load it through a preload-tier split, preload it immediately on the root route, and move the legacy project redirect out of the module so the route shell does not import it. Make the thread detail split preload-tier as well, so each page warms the other after first paint. ThreadPage drops from 1962.6 KB to 1807.3 KB. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ServerMoveOverlay's polling, redirect and arrival handling must run from boot, but its card, step list and recovery actions only render while a move is in progress. Keep the logic eager and move the view into a preload-tier split so it is downloaded shortly after first paint, before the old server can go away mid-move. Boot drops by 8.2 KB. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every page parsed sonner before first paint because appToast called it and main.tsx mounted its Toaster eagerly. appToast now assigns toast IDs itself and queues calls until the Toaster has mounted, which happens at idle after route content paints or on the first toast. Plugin frontends wait for the Toaster before running plugin code, since they call sonner directly. Boot drops by 31.9 KB and sonner joins forbiddenBootPackages. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Set ThreadPage and NewThreadPage limits 25% above their measured sizes after the audit's cuts, and record the boot and journey reductions. The boot limits stay where they were, which now leaves about 15% raw headroom. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The voice preferences popover used a single tall skeleton block while its code loaded. Show the same PickerLoadingRows skeleton the model picker uses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Route content was marked painted as soon as the route's loading skeleton rendered, so preload-tier splits and plugin frontend boot started downloading while the route and page chunks were still arriving and competed with them. Track the route import, the current page's split and every render-triggered split load as critical; drain the preload queue and mark route content painted only once none are pending. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every page imports SplitWorkspaceRoute, but the import starts only after the boot chunks have downloaded and run, so its files waited a full round trip behind boot. Emit modulepreload links for the route chunk and the static dependencies boot does not already load, so they download alongside boot. On a throttled 300 ms / 10 Mbps profile the new-thread page shows content about 340 ms sooner (4.40 s vs 4.74 s) with boot finishing at about the same time; on a 150 ms / 200 KB/s profile it is about 170 ms sooner, with boot finishing about 350 ms later because the two share bandwidth. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The banner stack above the new-thread composer hid itself with empty:hidden, but a bare plugin banner that renders nothing still mounts an empty display:contents root. That made the stack non-empty, so its 8px bottom margin pushed the composer down when plugin frontends booted after first paint. Hide the stack unless a direct child has content. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
added a commit
that referenced
this pull request
Oct 7, 2026
## Human comments ## What was wrong PR #4782 was squash-merged from pushed head `6df2deeffa`, leaving four subsequent local commits (`fdbbd8aea0`, `3f2def60ed`, `15648844c8`, and `5b8191baf8`) unpublished. Settings therefore lacked the intended Voice Input controls, and the microphone preview and warning feedback missed the follow-up improvements. ## What changed - Apply all four follow-ups onto current main (`452376e59e`): restore Voice Input settings, open the shared preview from Settings, put warning and hint on separate tooltip lines, show the active microphone in the preview header, and shorten status messages to keep the popover steady. - Resolve conflicts with #4955 by moving `MicrophonePreferencesSplit.tsx` alongside the preview and retaining its intent-based loading from both entry points. Keep the shared popover shell separate from the heavy preview implementation. - Preserve the microphone capture, reconnect, and late permission cleanup tests at the preview's new location. Add a bundle boundary guard for the implementation. - Update configuration docs, CLI guide, and bb-cli reference for the Settings entry point. No server/daemon wire, public SDK, or CLI command changes; the device preference remains browser-local. ## How you verified - `pnpm exec turbo run typecheck lint test --filter=@bb/app`: passed; 586 test files and 5,471 tests passed, with 2 files / 6 tests skipped. Lint reported existing warnings and no errors. - Focused preview, composer-button, and Settings tests after retaining lifecycle coverage: 3 files / 11 tests passed. Final Turbo lint and typecheck passed. - `pnpm exec turbo run build --filter=@bb/app` and `node apps/app/scripts/check-bundle-budget.mjs`: passed. Temporarily importing the preview eagerly made the new boundary guard fail for `MicrophonePreferences.tsx`; restoring the split and rebuilding passed. - Isolated source app, connected local daemon, and Chromium desktop/390px smoke checks: Settings opens the preview, device label appears in the header, selection persists, capture tracks stop on close, permission denial shows the compact hint, and the compact view uses the shared drawer without hiding the app root. MediaDevices capture/device scenarios used a browser-only synthetic audio stream; physical microphone recording/transcription and iOS Simulator Safari were not tested. - `git diff --check`: passed. The verification inventory check reports unrelated pre-existing drift: unmapped `browser` CLI family. > AGENT GENERATED --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
The workspace route's bundle budget sat within 0.1 KB of its limit, so ordinary feature work kept turning main red (#4933 temporarily raised it). The budget measured the
SplitWorkspaceRouteclosure, which moved whenever code shifted between the route chunk and a page's own lazy chunk, not the JavaScript a page actually waits for. Code-split preloading was opt-in per call site:startup/idlepolicies did nothing unless a mounted owner also calleduseSplitPreload. And the workspace route's import only started after boot downloaded and ran, a full round trip behind it.What changed
ThreadPage(route +ThreadDetailView) andNewThreadPage(route +RootComposeView) replace the route closure inbundle-budget.json; split-boundary guards check both journeys. Journey limits are 25% above measured size (20% headroom); boot limits are unchanged.defineSplittiers.tier: "preload" | "intent"replaces four policies. Preload splits queue themselves and drain at idle once no critical load (route import, current page split, any rendered split) is pending; intent splits load on render or trigger intent. Mount gating (mountWhen,keepMounted,unmounted) replaces three hand-written gates. RemainingReact.lazyfeature boundaries below the router move todefineSplit; router pages inApp.tsxstayReact.lazybecause they suspend into the boundary that marks route content painted."sideEffects": falseonclient-core,thread-view,core-ui; sonner loads after first paint (appToastqueues until the Toaster mounts; plugin frontends wait for it); the server-move overlay view loads after paint.RootComposeViewloads on demand; the legacy project redirect moves to its own module.PickerLoadingRows.display: contentsroot, which defeatedempty:hiddenand added an 8px margin when plugins booted after first paint, moving the composer down. Base shows the same shift on slower loads.index.htmlmodulepreloads the workspace route and its static dependencies so they download alongside boot.docs/ui-code-splitting.md,docs/ui-split-loading-audit.md. No wire, CLI, SDK, or data changes.How you verified
pnpm exec turbo run build typecheck lint test --filter='...[origin/main]': 230/232 tasks passed; the failure wasPluginSettings.test.tsx > autosaves the latest text value on blurunder parallel load, which passes 3/3 alone and touches no changed code.🤖 Generated with Claude Code