Smooth channel loading: single-surface timeline state machine#1099
Merged
Conversation
Drop the pending-render opacity transition from the main timeline and thread reply list while keeping the deferred render state marker for e2e synchronization. Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Keep timeline intro and empty affordances hidden while live messages are waiting for the deferred list commit, so channel entry shows the message skeleton until rows are ready instead of briefly flashing the channel intro. Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
The channel intro/empty state could flash on entry to a channel that has messages, then get replaced by the real timeline. `isTimelineLoading` keyed off `data !== undefined`, but the per-channel query cache is seeded early by a stale placeholder on revisit and by the live subscription's setQueryData, so the signal flipped to "loaded" while the authoritative history fetch was still in flight over an empty result. Derive the loading state from a pure `selectTimelineLoadingState` helper that stays loading while the fetch is in flight over a placeholder or empty result, and does not re-skeleton populated channels on background refetch. Combined with the deferred-list render-state gate, both flash windows are covered. Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
The robust loading signal ties loading to the in-flight history fetch, but isFetching/data can toggle during channel entry (the live subscription writes to the cache while the fetch runs), so the skeleton could flip up and down. Latch loaded per channel: once the timeline settles for a channel, a later background refetch no longer re-shows the skeleton. A channel switch resets the latch so the new channel loads fresh. Extracted as a pure resolveTimelineLoadingLatch helper with unit coverage. Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Both timeline ResizeObservers reacted to height changes regardless of load state, while the initial scroll-to-bottom was gated on !isLoading. On entry, as the deferred list streams in under the skeleton, the content observer kept firing scrollToBottom/syncScrollState, so the timeline shook continuously. Mirror isLoading into a ref and skip the observers' scroll reactions while loading; the init layout-effect still owns the single scroll-to-bottom once content settles. The timeline observer keeps tracking height so the first post-load comparison is fresh. Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
The full-pane ViewLoadingFallback data-loading branch was skeleton #1 of the two-skeleton topology behind the channel-switch shake. ChannelPane already always mounts and receives isTimelineLoading, so this branch only ever swapped a differently-laid-out skeleton in front of the timeline's own. Remove it; the timeline owns the single loading surface. Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Replace the timeline skeleton reveal path with an explicit surface state so loading, deferred catch-up, empty intro, and message rows are mutually exclusive. Deferred catch-up now holds the same static skeleton surface instead of restarting a reveal animation. Co-authored-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
0962c02 to
c6678ce
Compare
selectTimelineSurface collapsed intro and list into one mutually exclusive surface, so a channel with messages returned "list" and silently dropped the channel/DM intro header. Split into two independent axes: selectTimelineBodySurface (skeleton | empty | list, still single-surface so the loading frame can't tear) and selectTimelineIntroSurface (an overlay above the body, suppressed only during the skeleton). The intro now renders at the top of the list as the E2E contract requires. Co-authored-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
wpfleger96
approved these changes
Jun 17, 2026
tlongwell-block
pushed a commit
that referenced
this pull request
Jun 18, 2026
…te-response * origin/main: (194 commits) Fold agent core memory into the session system prompt (#1112) feat(cli): add patches and issues commands for NIP-34 git collaboration (#1073) fix(desktop): stop random timeline message loss + page reconnect replay (#1105) Update README.md fix(desktop): keep thread replies from scrolling channel (#1109) fix(buzz-acp): accept siblings under allowlist author gate (#1108) feat(deploy): add production Helm chart for Buzz (#990) fix(desktop): keep MembersSidebar input usable while an add is in flight (#1106) chore(release): release version 0.3.25 (#1102) fix(desktop): stop dimming deferred message lists (#1104) Smooth channel loading: single-surface timeline state machine (#1099) feat: surface base + persona system prompts in observer feed (#1103) ci: move reminder e2e to a dedicated backend-integration job (#1098) fix: give agent-observer sub a replay-capable limit (#1100) fix: make managed-agent spawn and teardown portable to Windows (#1097) fix(desktop): constrain message timeline width with min-w-0 (#1092) feat(desktop): reminders notifications, snooze, overlay, and inbox view mode (#1093) feat(prompt): add memory hygiene and hoist universal engineering discipline to base prompt (#1085) fix(desktop): correct thread-unread badge flicker, stale clear, phantom count, mention gate, and nested count (#1080) Fix mention chip alignment (#1094) ... # Conflicts: # crates/buzz-cli/src/commands/workflows.rs
tlongwell-block
pushed a commit
that referenced
this pull request
Jun 18, 2026
…te-response * origin/main: (194 commits) Fold agent core memory into the session system prompt (#1112) feat(cli): add patches and issues commands for NIP-34 git collaboration (#1073) fix(desktop): stop random timeline message loss + page reconnect replay (#1105) Update README.md fix(desktop): keep thread replies from scrolling channel (#1109) fix(buzz-acp): accept siblings under allowlist author gate (#1108) feat(deploy): add production Helm chart for Buzz (#990) fix(desktop): keep MembersSidebar input usable while an add is in flight (#1106) chore(release): release version 0.3.25 (#1102) fix(desktop): stop dimming deferred message lists (#1104) Smooth channel loading: single-surface timeline state machine (#1099) feat: surface base + persona system prompts in observer feed (#1103) ci: move reminder e2e to a dedicated backend-integration job (#1098) fix: give agent-observer sub a replay-capable limit (#1100) fix: make managed-agent spawn and teardown portable to Windows (#1097) fix(desktop): constrain message timeline width with min-w-0 (#1092) feat(desktop): reminders notifications, snooze, overlay, and inbox view mode (#1093) feat(prompt): add memory hygiene and hoist universal engineering discipline to base prompt (#1085) fix(desktop): correct thread-unread badge flicker, stale clear, phantom count, mention gate, and nested count (#1080) Fix mention chip alignment (#1094) ... Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com> # Conflicts: # crates/buzz-cli/src/commands/workflows.rs
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.
Problem
Switching channels showed the loading skeleton "multiple times" with a vertical shake, then the messages shook/faded when the skeleton cleared. Goal (from #weird-ui-flicker-and-loading): show loading, then show messages — one surface at a time, buttery smooth.
Root cause
Two thrash engines, both around the skeleton:
ViewLoadingFallbackdata branch inChannelScreencould swap a differently-laid-out skeleton in front ofMessageTimeline's own skeleton — overlapping skeleton regions on screen at once.MessageTimelineusedSkeletonRevealwithloading={isLoading || isDeferredListPending}.useDeferredValuere-defers on every newmessagesidentity while events stream in, soisDeferredListPendingblipped pending→list→pending across commits. Each blip re-firedSkeletonReveal'suseLayoutEffectreset + rAF crossfade + relative↔absolute layout swap → the skeleton re-appeared/re-pulsed (vertical shake) and content faded in on reveal.Fix — one timeline state machine, one visible surface
A strict, derived single-surface model. Exactly one of
skeleton | direct-message-intro | channel-intro | empty | listrenders at any time. No overlap, no crossfade, no animation on the skeleton.ChannelScreen: remove the dead full-pane channel-loading branch; always mountChannelPane(real header/composer/timeline) and passisTimelineLoadingdown. Keep the per-channel monotonic loading latch and the scroll-freeze.MessageTimeline: dropSkeletonRevealentirely; render plain conditional surfaces driven by a new pureselectTimelineSurface(...). Both hard-loading and the deferred catch-up window map toskeleton, so the sameTimelineSkeletonnode stays mounted across the hold — no remount flash, no reveal restart, zero gap before rows. Scroll/search/load-older are gated on the same skeleton state so rows don't shake during catch-up; skeleton row estimate ignores uncommitted messages so its height doesn't jump.Invariants (enforced by unit tests)
SkeletonReveal— no layout-effect reset, no rAF, no absolute↔relative swap.min-h-[18rem]).Tests
selectTimelineSurfacetable intimelineSnapshot.test.mjs(loading + pending both → skeleton; live rows win; empty picks exactly one intro/empty surface).timelineLoadingState.test.mjslatch cases retained.pnpm typecheck,pnpm check,pnpm buildall clean (pre-existing chunk warnings only).Note: the "buttery smooth" feel is best confirmed in a running build (fast A→B→A switching, empty channel, throttled relay) — the suite proves the logic/invariants.
Co-authored by Pinky (MessageTimeline state machine +
selectTimelineSurface) and Brain (ChannelScreen full-pane removal, loading latch, scroll-freeze, integration). Closes the channel-load flicker reported in #weird-ui-flicker-and-loading.