The three nav-beachball view transitions were dominated by main-thread
first-render work on mount, not chunk-load or data-stall. Each surface
had redundant or eagerly-executed work removable without deferral:
- Channel: buildVideoReviewCommentsByRootId walked the full message list
twice per mount (ChannelPane + TimelineMessageList), O(N^2) in the
ancestor walk and unconditional even in channels with no video.
TimelineMessageList now gates the whole-map build behind
messages.some(hasVideoAttachment); ChannelPane builds a single root's
comments on demand. resolvedAgentPubkeys and channelNames were rebuilt
per visible row (identical across rows) — hoisted to the list,
memoized for stable refs, and added to MessageRow's memo comparator so
the hoist doesn't defeat its memoization.
- Inbox: InboxMessageRow re-parsed markdown on every HomeView re-render.
Wrapped in React.memo with a field-level comparator — its callbacks
are recreated inline by HomeView, so a reference comparator would be
inert; it compares the render-affecting message fields instead.
- Agents: 14 invisible dialogs mounted unconditionally, executing their
queries and hooks while closed. Conditionally rendered on each
dialog's own open-state, removing closed-dialog work from the mount
path. Each dialog mounts already-open; Radix drives its enter
transition off data-state on first commit (covered by a tracked
behavioral test).
- Closed the AgentsView double-lazy preload gap: preloadAgentsScreen now
warms the inner AgentsView chunk too, so the first agents navigation
doesn't hit a cold chunk. The dynamic import keeps AgentsView its own
chunk rather than collapsing it into the index bundle.
Measured before/after (median of 3 runs, 4x CPU throttle): script
duration dropped on every surface (channel first -63ms, channel switch
-60ms, inbox -23ms, agents -32ms).
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Three eva-authored e2e assertions encoded the pre-virtualization layout and
break once the timeline windows rows out of the DOM and positions them with
absolute/translateY:
- relay-reconnect: the reconnect-backfill test expected both the newest and the
260-rows-old message mounted at once. A virtualized timeline windows the
oldest rows out while the user sits at the bottom, so assert the newest at the
bottom, then scroll to the top and poll until the oldest mounts -- the backfill
depth is now proven by reachability, not simultaneous mounting.
- channels (x2): expectIntroBalancedAroundDayDivider compared the intro->divider
gap against the divider->message gap for equality. The intro is a flex sibling
above the timeline while the divider and first row are virtualized items, so
the two gaps are measured across different layout regimes and no longer match
within a pixel. Assert the intended reading order instead: intro, divider,
then the first message, cleanly separated with no overlap.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Re-platforms the index-anchor scroll model onto eva's single-owner anchor
(useAnchoredScroll) so the virtualized timeline keeps one scroll writer
under windowing. Removes eva's older-history IntersectionObserver and makes
useLoadOlderOnScroll the sole top-sentinel/fetchOlder owner; eva's anchored
scrollBy cedes to the index path on a prepend via a front-id/tail-id
discriminator (new prevFirstMessageIdRef). Adds a minimal restoreScrollPosition
writer that re-derives the anchor after a programmatic scroll instead of
re-introducing a competing scroll-owner. Windowed-out jump targets converge
through the virtualizer (indexByMessageId + getOffsetForIndex) rather than a
querySelector that goes null off-screen. Load-older roles are gated on
fetchOlder/virtualizer presence so MessageThreadPanel degrades to the passive
anchor. Reserves a fixed-height spinner slot so the fetch indicator does not
shift the bottom row.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
biome check enforces line-wrapping that biome lint does not. The
load-older test 07 had two over-width statements that passed local lint
but failed the Desktop Core biome check gate. Format-only, no behavior
change.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Loading older messages under virtualization let three writers fight over
scrollTop on overlapping frames, so the anchored row jittered or collapsed
to the top (~33% of prepends) and the library's reconcile spun the full 5s
MAX_RECONCILE_MS valve. Establish a single owner of scroll position across
the whole fetch+restore window:
- useLoadOlderOnScroll restores by scrollTop ONLY (drop scrollToIndex), via
one getOffsetForIndex(anchorIndex + prepended, "start")[0] + intra-row gap
write. getOffsetForIndex is a pure measurement-cache read, so no library
scrollState is set and the reconcile loop has nothing to fight.
- The viewport ResizeObserver in useTimelineScrollManager no longer runs a
competing restore during a fetch: it skips while isFetchingOlder is true
(the spinner's clientHeight 720->590 mount-shift fires before the lock is
set) and otherwise defers to lockedScrollTopRef when the load-older restore
holds it. MessageTimeline threads isFetchingOlder into the manager.
The defect was invisible to unit tests (jsdom getBoundingClientRect -> 0) and
to static traces; the new load-older E2E drives a real prepend on six fresh
page loads and asserts the anchor holds every run, the scroller genuinely
grew, and the reconcile terminates. emitMockHistory now honors the relay
filter's until/limit so the mock relay paginates like a real one, which the
E2E needs to exercise a genuine older page.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Adds a build-time-configured transport reconnect hook so internal builds can recover the underlying transport (e.g. WARP VPN) before the relay reconnect, while OSS builds stay a pure no-op.
The generic "Reconnect to relay" button is transport-agnostic; internal users behind a VPN need the transport re-established first. A build-time env var `BUZZ_BUILD_RELAY_RECONNECT_CMD` (set only in `squareup/buzz-releases`) carries a JSON config validated into a typed Rust struct at compile time, so the OSS binary ships with zero VPN knowledge.
- New Tauri command `relay_reconnect_hook` runs structured fixed-argv steps plus a readiness probe, wrapped in `tokio::task::spawn_blocking`; non-fatal end-to-end so any failure falls through to `preconnect()`.
- `ReconnectHookConfig` lives in one dep-free source file `include!`'d by both `build.rs` and the runtime command, so the compile-time validation and runtime parse cannot drift.
- `useReconnectRelay.ts` invokes the hook before relay preconnect, guarded so a hook rejection cannot abort the reconnect.
- When `BUZZ_BUILD_RELAY_RECONNECT_CMD` is unset (OSS), the command compiles to an early-return no-op.
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>