Skip to content

fix(web): the reader's line stays put when the chat changes width - #224

Merged
orbitingflea merged 2 commits into
mainfrom
fix/resize-reader-line
Nov 19, 2026
Merged

orbitingflea merged 2 commits into
mainfrom
fix/resize-reader-line

Conversation

@orbitingflea

@orbitingflea orbitingflea commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

This pull request keeps the line a reader is on at the same place on screen when the chat gets narrower or wider after they scroll up.

改了什么行为

Behaviour change: yes, a reader who has scrolled up in the chat keeps the line they see at the same place on screen when the chat gets narrower or wider (window, panel, sidebar, chat width), in Chat mode and Normal mode. Before, that line moved by up to about 70 px. At the end, and while following, nothing changes.

Why

The list keeps one row's top still, so text that rewraps in the row above it, or inside it, moves the reader's line. The timeline now remembers one character near its top and, when its row changes width, scrolls it back. It steps aside while the end is followed, while another scroll runs, and during find, citation jumps and restores. A disclosure reveal measured while it holds skips its scroll, because the layout is still settling.

Checks

  • A new browser test covers both causes and the edge cases. It fails on the test commit and passes on the fix, in CI's font (DejaVu Sans), Liberation Sans and Noto Sans.
  • In a dev server with real input, Chat mode wheel and selection drag moved the line 28 to 73 px on main and 0 to 1 px with the fix.

How to undo

Revert both commits. No stored data changes.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XL labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown

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

New browser test files: apps/web/src/fork/timelineReaderLine.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.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for c2e9c41.

This comment will update automatically after the next completed run.

@orbitingflea
orbitingflea force-pushed the fix/resize-reader-line branch from 9421c2f to c2e9c41 Compare November 19, 2026 15:00
orbitingflea and others added 2 commits November 19, 2026 15:35
Narrowing or widening the chat after a scroll moves the line the reader
sees: the partly visible top row grows upward, and text rewraps inside a
single tall row. The cases cover both, plus a selection drag, streaming
text, a press, a work group, a minimap glide, widening near the end,
and staying at the end while following.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LegendList keeps one row's top in place, so when the chat narrows or
widens, text that rewraps above or inside that row moves the line the
reader sees, by up to about 70 px in Chat mode.

The timeline now remembers one character near its top while the reader
reads, and when that row changes width it scrolls the character back to
where it was, after LegendList's own pass. It steps aside while the end
is followed, while another scroll is running, and during find, citation
jumps and restores, and its scrolls do not count as the reader's. A
disclosure reveal measured while it holds skips its scroll, because the
layout is still settling from the width change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@orbitingflea
orbitingflea force-pushed the fix/resize-reader-line branch from c2e9c41 to 15e3773 Compare November 19, 2026 15:42
@orbitingflea
orbitingflea merged commit 4e9e8fd into main Nov 19, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 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