Skip to content

fix(web): the chat keeps the reader in place after a selection drag - #212

Merged
orbitingflea merged 2 commits into
mainfrom
fix/resize-scroll-jump
Nov 19, 2026
Merged

orbitingflea merged 2 commits into
mainfrom
fix/resize-scroll-jump

Conversation

@orbitingflea

Copy link
Copy Markdown
Owner

This pull request makes a text selection dragged to the top of the chat count as the reader scrolling away, so the chat no longer jumps to the newest message when the window gets narrower.

改了什么行为

Behaviour change: yes, a reader who drags a text selection to the top of the chat, so the browser scrolls it up, now stays on that text when the window narrows or a new message arrives, and the "Scroll to end" button shows. Before, the chat jumped back to the newest message. This holds in Chat mode and Normal mode, on web and desktop.

A reader at the end still stays at the end. Wheel, keys, touch and the scrollbar behave as before.

Why

While the chat follows the newest message, the list keeps the end in view on every layout change. A selection drag scrolls the chat with no wheel, key or touch event, so follow stayed on. Now an upward scroll counts while the primary press has moved into the browser's autoscroll band at the chat's top edge and holds a text selection there. A press held still while content briefly shrinks counts as nothing.

Checks

  • The new browser test drags a selection to the top edge with real mouse input. It fails on the test commit and passes on the fix.
  • In a dev server with real input, a selection drag and a narrower window moved the chat to the end in both modes on main; with the fix it stayed.

How to undo

Revert both commits. No stored data changes.

orbitingflea and others added 2 commits November 19, 2026 05:27
The browser autoscrolls the timeline while the reader drags a selection
at its top edge. The viewport sends no navigation for that scroll, so
the chat keeps following the end. A clamp during a press, or after the
press ends, must still send none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reader who drags a text selection to the top of the chat makes the
browser scroll it up, but follow stayed on. Narrowing the window or a
new message then scrolled the chat to the end.

An upward scroll now counts as the reader moving away while the primary
press has moved into the browser's autoscroll band at the top edge and
holds a text selection in the chat. A press held still during a content
clamp still counts as nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown

This PR changes the test suite by +1 test cases (browser +1, unit 0, server 0).

New browser test files: apps/web/src/fork/timelineSelectionDrag.browser.test.tsx.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

@orbitingflea
orbitingflea merged commit ce6aa35 into main Nov 19, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant