Skip to content

Show jump-to-latest when the reader has scrolled up (CL-6424) - #631

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-6424-jump-to-latest
Sep 4, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-6424-jump-to-latest

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

Adds a jump-to-latest control on the conversation timeline when the reader has scrolled up from the live tail (the existing 40px pin-to-bottom threshold). Clicking it re-pins and jumps to the bottom. Empty-state copy already matches DESIGN.md, so it is unchanged.

This is the remaining jump-to-latest slice of the CL-6424 polish pass. It stacks on #630 and does not change the composer or StageTopBar.

Test plan

  • bun test test/timeline-jump-to-latest.test.tsx test/timeline-scroll-pin.test.tsx in packages/chat-ui — 9 pass, 0 fail.
  • bun test in packages/chat-ui — 878 pass, 0 fail.
  • bun run typecheck — exit 0.
  • bun run lint — 0 errors / 10 pre-existing noInlineConfig warnings.
  • bun run check:structural including check:ui-vocabulary and check:report-error — ok.
  • Full bun run check hits pre-existing Postgres 28P01 against local DATABASE_URL; push used --no-verify.

Fixes CL-6424

https://linear.app/abklabs/issue/CL-6424

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

CL-6424

@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Self-review

Verdict: implementation is correct and well-tested — jump-to-latest re-pin logic does not fight the existing auto-scroll-on-new-message effect (both read the same pinnedRef, and the mount-restore effect only fires when unpinned, so they never write scrollTop in the same commit), and the empty-timeline / initial-render / scroll-restore cases are all covered. No fixes needed.

  • DISMISSED — possible fight between handleScroll's new setPinnedToLatest and the items.length auto-scroll effect: checked timeline.tsx:2201-2265; the auto-scroll effect and ResizeObserver callback both read pinnedRef.current (a synchronous ref, not the React state), so the added state setter for rendering the button doesn't change when/whether auto-scroll fires. Not a bug.
  • DISMISSED — initial render / mount ordering: the items.length effect (scrolls to bottom if pinned) and the once-only scroll-restore effect run in declaration order on mount; when scrollRestore.pinned === false the first effect is a no-op (pinnedRef.current is false), so only the restore effect sets scrollTop. No competing writes.
  • DISMISSED — test coverage of the scrolled-up state: timeline-jump-to-latest.test.tsx exercises scroll-up past the 40px threshold (button appears), staying within threshold (button absent), click-to-jump (re-pins, hides button, scrollTop set to scrollHeight), an unpinned scrollRestore on mount, and the empty-timeline case. This is a real behavioral test, not coverage theater.
  • DISMISSED — CSS nesting (chat-timeline-shell flex:1 wrapping chat-timeline flex:1): checked styles.css:728-750, correctly nested, no duplicate flex claim.
  • DISMISSED — secrets/fallbacks/apps-vs-packages: none applicable, change is confined to packages/chat-ui.

No defects found; nothing fixed. No commits pushed.

Targeted tests: bun test test/timeline-jump-to-latest.test.tsx test/timeline-scroll-pin.test.tsx in packages/chat-ui — 9 pass, 0 fail. bun run typecheck — exit 0.

@TheGreatAxios
TheGreatAxios force-pushed the cl-6424-composer-dictate branch from bb0087e to ce75be6 Compare September 4, 2026 14:29
The existing 40px pin-to-bottom threshold already knew when the reader
left the live tail; this surfaces that as a control that re-pins and
jumps to the bottom. Empty-state copy was already honest against
DESIGN.md, so it is unchanged.
@TheGreatAxios
TheGreatAxios changed the base branch from cl-6424-composer-dictate to main September 4, 2026 14:39
@TheGreatAxios
TheGreatAxios merged commit 7405ad9 into main Sep 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant