Skip to content

fix: finish a floating box's ride when Tab moves focus during it - #6437

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6425
Nov 18, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A Tab pressed while an arriving answer rides into the panel's thread view took New reply away before the next Tab could reach it. Since #6382 ("Carry what news moves in a growing thread view"), news rides in drawn translated from where it stood. Chromium scrolls the control a Tab focuses into view by where that control is drawn, and it does so before focusin fires: logging showed the view's scrollTop at 0 on the Tab keydown and already at 348 when focusin arrived. The thread card's #sawAnswer reads that scroll as the user going to the answer and removes New reply. #6382's author meant news to slide into place rather than jump, and that slide is kept.

A Tab keydown during a ride now finishes the box's motion (finishRide in browser/runtime/box-motion.js), as a user turning on reduced motion mid-tween already does. The browser then scrolls by layout, and in the failing case no scroll is needed. The issue suggested finishing on focus instead, but that runs after the browser's scroll, and I tried it: no change. Pointer presses keep the ride, since they aim where things are drawn and finishing would move the target out from under the pointer. The send's ride had the same exposure before #6382, and this covers it too.

Verification, with uv run leaf-dev suite flake --cpu-throttle 6 on test_render_floating_panel.py::test_the_thread_walk_stands_on_each_thread_it_opens:

tree passed failed
main at 667b6c76b, no change 2 16
this change, rebased on 4fbd34593 18 0

Also passing on this branch: the thread news, held-news and streaming-answer tests in test_render_floating_panel.py, tests/journeys/test_floating_box_motion.py, pnpm run test:runtime, the browser type check, and pre-commit on the file.

Closes #6425 — automated triage

Since #6382, news rides into the panel's thread view drawn translated from
where it stood. Chromium scrolls the control a Tab focuses into view by its
drawn box, before `focusin` fires, so a Tab during the ride scrolled the view
past the control's layout place. The thread card read that scroll as the user
going to the answer and took New reply away before the next Tab reached it.
A Tab keydown during a ride now finishes the motion, so the browser scrolls by
layout. A pointer press keeps the ride, since it aims where things are drawn.

Under 6x CPU throttle, test_the_thread_walk_stands_on_each_thread_it_opens
failed 16 of 18 copies before this change and passes 18 of 18 after it.

Closes #6425
@leaf-agent
leaf-agent merged commit 94f71e7 into main Nov 18, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6425 branch November 18, 2026 23:28
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.

test_the_thread_walk_stands_on_each_thread_it_opens: a Tab during news's ride scrolls to the drawn control and takes New reply away

1 participant