Add native keyboard scrolling to the chat history - #9
Open
neo773 wants to merge 1 commit into
Open
Conversation
Arrow keys drive the transcript like a native macOS scroll view: - Tap Up/Down: one crisp line step (~50ms ease-out, Chrome-parity). Holding scrolls continuously from the first frame — a velocity-fed hold with a spin-up ramp, ended by key-up — instead of stuttering through OS key-repeat quanta. Key-repeats serve only as hold-liveness signals. - Option+Up/Down: glide between segments (user prompts, the rail's tick anchors), reusing the rail-click glide; past the last segment it hands off to the jump-to-bottom spring and re-engages autoscroll. - PageUp/PageDown work everywhere (Messages-style, even while typing); Home/End and Cmd+Up/Down go top/bottom when the chat holds focus. - Focus takes care of itself: click into the chat to scroll with bare arrows; empty-composer arrows fall through to the chat; typing a character while the chat is focused hops focus back to the composer with the keystroke; Escape returns to the composer. Cmd+C still copies the markdown selection when the chat has focus. Mechanics worth noting: - All keyboard animation is frame-driven from render via window.on_next_frame (vsync-locked, 120Hz on ProMotion), never timer loops; the rail-click glide moved onto the same driver. - The row glide gets an overtime landing: when its timeline expires short (tall unmeasured rows — 20-40 line prompts), it closes the remainder with an exponential tail instead of hard-snapping. - The stick-to-bottom spring gets a terminal phase (minimum closing velocity) so its asymptotic tail can't leave "at bottom" state lagging a visually finished scroll, and it lands in the glued representation the rest of the app keys off. - Re-pinning to the bottom is intent-based: only deliberate downward keyboard motion re-engages the pin; upward motion never does. Wheel input always cancels any keyboard/rail glide. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Keyboard control for the transcript, tuned to feel like a native macOS scroll view — no one should be able to tell this is a custom GPUI renderer.
How
renderviawindow.on_next_frame— vsync-locked, 120Hz on ProMotion — never wall-clock timer loops. The rail-click glide moved onto the same driver.Testing
cargo test -p comet-ui: 313 passed.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.