Conversation
The minimap can navigate up and down a session, but there was no one-click way back to the live tail once the viewport was detached. Add a circular down-arrow button that floats just above the composer whenever the chat is scrolled away from the bottom, and hides again at the tail. Visibility is a pure `shouldShowScrollToLatest()` predicate over scrollTop/clientHeight/scrollHeight so it stays independent of the live-follow attachment heuristic, which has its own reattach semantics.
Keep the button mounted and toggle an `is-visible` class instead of mount/unmounting it, so the exit can animate too: a 160ms fade with a 4px rise and slight scale, plus a delayed `visibility` switch that takes it out of the tab order once faded. Reduced-motion keeps the fade but drops the transform.
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.
Add a jump-to-latest button to the chat
Problem: The right-side minimap can navigate around a session, but once you scroll up there is no quick way back to the live tail — you have to drag the minimap or scroll manually.
Change: A circular down-arrow button floats just above the composer whenever the chat viewport is detached from the bottom, and hides again once you are at the tail. Clicking it smooth-scrolls to the latest message.
Details
shouldShowScrollToLatest(scrollTop, clientHeight, scrollHeight)inlib/chat-lazy-load.ts. It is intentionally separate from the existing live-follow attachment heuristic, which has its own reattach tolerance semantics — reusing it would have made the button appear and disappear at slightly the wrong moments.right: CHAT_MINIMAP_WIDTH), so it never covers it.is-visibleclass rather than being conditionally rendered, so the exit animates too. A delayedvisibilityswitch removes it from the tab order once faded. Underprefers-reduced-motion: reduce, the fade is kept and the transform is dropped.Testing
lib/chat-lazy-load.test.mjs) and for the component wiring/CSS (components/ChatWindow.scroll-to-latest.test.mjs).tsc --noEmit,eslint ., and the full unit suite (1026 tests) all pass.No behavior change when the chat is already at the bottom, for empty new sessions, or on mobile.