Skip to content

fix: decide a thread card's scrollbar gutter from where layout stands its turns - #5380

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5332
Nov 4, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-5332

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A send's ride draws a thread card's turns below where layout stands them, so the new turn rises from the transcript's foot (box-motion.js, streamContent). Chromium counts that translation in the transcript's scrollHeight. The card's gutter decision in thread-preview.js compared scrollHeight > clientHeight, so on the frame the ride started it saw a card that fits as overflowing, and set data-lf-overflows. That turned on the transcript's scrollbar-gutter: stable (#4841). The gutter stays until the card's width or number of turns changes, so it outlived the ride. Under a classic scrollbar (a mouse, on Linux or Windows) that cost the turns 10px, and a sent reply wrapped one word earlier than its reply editor had. The decision now reads scrollLimit, which scrolling.js already computes from layout while content rides, for this exact case.

What changes on screen: after a send, under a mouse, the turns of a card that fits run the full width of the reply field, with no empty scrollbar gutter. A card whose turns really overflow still holds its gutter. Touch, and any platform with overlay scrollbars, never had a gutter and is unchanged.

Evidence

At the frame data-lf-overflows was set, the transcript read scrollHeight 314 against clientHeight 240. Both messages were at their final heights (85 and 127), each wearing translate: 0px 80px from the --lf-box-carry ride. Once the ride ended, scrollHeight was 240 = clientHeight, but the attribute stayed. The gutter narrowed the transcript from 578 to 568 (clientWidth), which puts the message's text column at 530px against the reply editor's 540px.

Verification on this branch:

  • tests/browser/test_render_send_placement.py::test_a_reply_written_in_a_card_keeps_its_line_breaks_once_sent: [mouse] fails on main and passes here, in 3 of 3 runs; [touch] passes in both.
  • tests/browser/margin/test_card_reply.py passes (52 tests), including Keep a scrolling thread card's words clear of a scrollbar that takes room #4841's test_a_card_that_fits_keeps_no_room_for_a_scrollbar and test_a_card_that_scrolls_gives_its_scrollbar_room.
  • pnpm run test:runtime and pnpm run check pass.

thread-preview.js also reads the transcript's raw scrollHeight when it caps the card's height. That path isn't behind this failure, so this PR leaves it unchanged.

Closes #5332 — automated triage

… its turns

A send's ride (box-motion.js) draws the transcript's turns below where
layout stands them, and Chromium counts that translation in the
transcript's scroll height. The card's gutter decision read
`scrollHeight > clientHeight`, so during the ride of a card that fits it
saw overflow, set `data-lf-overflows`, and its latch kept the gutter
after the ride ended. Under a classic scrollbar (a mouse) the sent reply
then wrapped one word earlier than its reply editor had. The decision now
reads `scrollLimit`, which scrolling.js already gives from layout while
content rides.

Behavior changed: a card whose turns fit keeps no scrollbar gutter after
a send; a card whose turns overflow still holds one.
`test_a_reply_written_in_a_card_keeps_its_line_breaks_once_sent[mouse]`
fails before and passes after.

Closes #5332
@leaf-agent
leaf-agent merged commit b1c7255 into main Nov 4, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5332 branch November 4, 2026 17:22
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.

Card reply's sent message wraps a word earlier than its reply editor under a mouse

1 participant