You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_seated_threads: a reply editor loses focus when its thread returns from the margin card to the diff (since #7563) #7580
tests/browser/threads/test_seated_threads.py has two tests that fail on every run from #7563 (6e7004dbd) through current main (3cce8ff2c), and pass on its parent b67c5abf7:
When the patch puts the thread back on its diff line, the margin card closes as the tests expect. But the reply editor on the diff line is not focused:
Expect "to_be_focused" locator("lf-diff .lf-page-thread[data-lf-thread=…]").locator(":scope > .lf-thread-reply leaf-text")
locator resolved to <leaf-text name="reply" …>
- unexpected value "inactive"
So the user's typing no longer follows the thread from its card back to its seat (records/thread/focus.js, carryingThreadPlace).
#7563 changed the render's handling of the selected card in margin-projection.js. It added followCardThread, whose seat branch calls closePreview() and returns true, and showNextAtTarget. Before that, the same render called closePreview() only when the card's entry had gone. The two orderings to check are where the default letGo() landing of closePreview now runs relative to the thread pass that carries focus to the seat, and whether openInlineThread(id, { card: true }) reopens the card for a thread that is on its way to a seat. This is a code reading I haven't confirmed.
Seen in run 46202905667 on 73e842a64. Reproduced locally on 3cce8ff2c with uv run pytest -n 3 -p no:randomly over the two node ids above. Bisected over 25f9d33f9..73e842a64 by running the tests at b67c5abf7 (pass) and 6e7004dbd (fail).
#7564 tracks the structural problem behind this class of focus bug: several pieces of code each move focus around one reading.
#7583 fixes this. I've confirmed the cause the body guessed at: openInlineThread(id, { card: true }) reopens the card for a thread that is on its way to a seat.
The first render after the patch still finds the thread in a margin row, because lf-diff hasn't seated it yet. followCardThread reopened the card there, which moved focus from the reply editor to the card's frame. That broke the thread pass's carry (carryingThreadPlace), so the next render's closePreview() sent the user to the page. With the fix, followCardThread only closes the card while the pass is carrying the user, and the pass lands them on the seat.
Both tests fail on main (9e2e64d34) and pass on the PR's branch. #7563's resolve and revision tests and test:runtime still pass. tend-land owns the PR's CI and landing.
Activity
leaf-agent commentedon Nov 29, 2026
#7583 fixes this. I've confirmed the cause the body guessed at:
openInlineThread(id, { card: true })reopens the card for a thread that is on its way to a seat.The first render after the patch still finds the thread in a margin row, because
lf-diffhasn't seated it yet.followCardThreadreopened the card there, which moved focus from the reply editor to the card's frame. That broke the thread pass's carry (carryingThreadPlace), so the next render'sclosePreview()sent the user to the page. With the fix,followCardThreadonly closes the card while the pass is carrying the user, and the pass lands them on the seat.Both tests fail on
main(9e2e64d34) and pass on the PR's branch. #7563's resolve and revision tests andtest:runtimestill pass. tend-land owns the PR's CI and landing.