Repository navigation
fix: decide a thread card's scrollbar gutter from where layout stands its turns - #5380
Merged
Merged
Conversation
… 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
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.
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'sscrollHeight. The card's gutter decision inthread-preview.jscomparedscrollHeight > clientHeight, so on the frame the ride started it saw a card that fits as overflowing, and setdata-lf-overflows. That turned on the transcript'sscrollbar-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 readsscrollLimit, whichscrolling.jsalready 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-overflowswas set, the transcript readscrollHeight314 againstclientHeight240. Both messages were at their final heights (85 and 127), each wearingtranslate: 0px 80pxfrom the--lf-box-carryride. Once the ride ended,scrollHeightwas 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.pypasses (52 tests), including Keep a scrolling thread card's words clear of a scrollbar that takes room #4841'stest_a_card_that_fits_keeps_no_room_for_a_scrollbarandtest_a_card_that_scrolls_gives_its_scrollbar_room.pnpm run test:runtimeandpnpm run checkpass.thread-preview.jsalso reads the transcript's rawscrollHeightwhen it caps the card's height. That path isn't behind this failure, so this PR leaves it unchanged.Closes #5332 — automated triage