Repository navigation
Avoid full-history layout during thread switches - #4537
Merged
Merged
Conversation
2 of 3 tasks
bborn
added a commit
to bborn/bb
that referenced
this pull request
Oct 12, 2026
Timeline responses over 200 rows were never cached, so long threads were rebuilt on every request while blocking the event loop. Raise the timeline cache cap under a total-row budget. The thread-switch layout changes this commit used to carry are dropped: upstream get-bb#4537 fixes the same problem in the same files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bborn
added a commit
to bborn/bb
that referenced
this pull request
Oct 12, 2026
Timeline responses over 200 rows were never cached, so long threads were rebuilt on every request while blocking the event loop. Raise the timeline cache cap under a total-row budget. The thread-switch layout changes this commit used to carry are dropped: upstream get-bb#4537 fixes the same problem in the same files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bborn
added a commit
to bborn/bb
that referenced
this pull request
Oct 13, 2026
Timeline responses over 200 rows were never cached, so long threads were rebuilt on every request while blocking the event loop. Raise the timeline cache cap under a total-row budget. The thread-switch layout changes this commit used to carry are dropped: upstream get-bb#4537 fixes the same problem in the same files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bborn
added a commit
to bborn/bb
that referenced
this pull request
Oct 14, 2026
Timeline responses over 200 rows were never cached, so long threads were rebuilt on every request while blocking the event loop. Raise the timeline cache cap under a total-row budget. The thread-switch layout changes this commit used to carry are dropped: upstream get-bb#4537 fixes the same problem in the same files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bborn
added a commit
to bborn/bb
that referenced
this pull request
Oct 22, 2026
Timeline responses over 200 rows were never cached, so long threads were rebuilt on every request while blocking the event loop. Raise the timeline cache cap under a total-row budget. The thread-switch layout changes this commit used to carry are dropped: upstream get-bb#4537 fixes the same problem in the same files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bborn
added a commit
to bborn/bb
that referenced
this pull request
Oct 22, 2026
Timeline responses over 200 rows were never cached, so long threads were rebuilt on every request while blocking the event loop. Raise the timeline cache cap under a total-row budget. The thread-switch layout changes this commit used to carry are dropped: upstream get-bb#4537 fixes the same problem in the same files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bborn
added a commit
to bborn/bb
that referenced
this pull request
Oct 23, 2026
Timeline responses over 200 rows were never cached, so long threads were rebuilt on every request while blocking the event loop. Raise the timeline cache cap under a total-row budget. The thread-switch layout changes this commit used to carry are dropped: upstream get-bb#4537 fixes the same problem in the same files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bborn
added a commit
to bborn/bb
that referenced
this pull request
Nov 3, 2026
Timeline responses over 200 rows were never cached, so long threads were rebuilt on every request while blocking the event loop. Raise the timeline cache cap under a total-row budget. The thread-switch layout changes this commit used to carry are dropped: upstream get-bb#4537 fixes the same problem in the same files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bborn
added a commit
to bborn/bb
that referenced
this pull request
Nov 4, 2026
Timeline responses over 200 rows were never cached, so long threads were rebuilt on every request while blocking the event loop. Raise the timeline cache cap under a total-row budget. The thread-switch layout changes this commit used to carry are dropped: upstream get-bb#4537 fixes the same problem in the same files. 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
Related to #4396. On a keyed thread remount, the timeline's scroll ref can still be pending when child layout effects run. The virtualizer then falls back to mounting the full loaded history. Expandable panels also synchronously read and write height on mount and on ordinary content rerenders, interleaving layout work across panels.
What changed
Seed the virtualizer with an estimated viewport, keep windowing enabled while the scroll ref is pending, and subscribe when it attaches. Keep the existing fallback for a measured zero-height scrollport. Use shared resize observation for panel mounting and content updates; retain synchronous sizing for expand/collapse transitions.
No SDK/CLI contract, persisted format, server/daemon wire, or protocol version changes. Four files, +129/-33 lines (production code +49/-31). Row-measurement caching and secondary-panel/markdown-preview layout work are outside this change.
How you verified
pnpm exec turbo run typecheck --filter=@bb/apppasses. App lint reports no errors (existing warnings remain).pnpm start:worktreeinstances: baseadbce963ae138ba077afbe011edb414ade4dcf26, exact head0e0ae963b1ac860611ab157d4e980fb65f7589b6. Served entry assets match their on-disk build hashes. Same deterministic four-thread fixture, 11,568 event rows after normal pruning, with identical event hashes; the measured threads contain 5,747 and 4,612 events.Blocking uses Long Animation Frame
blockingDuration; zero means no observed long-frame blocking, not zero CPU or layout work. Distinct row keys mounted across an entire switch were 105/114 on base and 35/35 on head. Both settle at 16 rows with the panel closed. Normal paginated loading remains in place: “full history” here refers to all loaded rows, not every persisted event.Panel Info/preview switching, tool expansion/collapse, wheel scrolling, and restoration passed on both builds, with approximately 17 ms largest frame gaps for those individual interactions. Restoration preserved the exact row key and viewport offset on each build. No sampled frame had an empty timeline on either build. Screenshots confirm equivalent rendered content and preview behavior, but do not demonstrate a blanking fix.
Control · Exact head (owner-authenticated live review instances).
Limits: synthetic fixture, warm revisits, shared host load, Chromium only; no matched cold-load, Safari/iOS, or reporter-machine measurement. The original 2–9 s delay is not claimed resolved. A browser-daemon restart interrupted one panel run; that run was discarded and rerun completely. Raw scripts, measurements, fixture hash, build/CI records, and screenshots are retained in the owning BB thread's storage with
HANDOFF.md.