Repository navigation
fix: settle panel rendering before the Threads pointer route - #4408
Merged
Merged
Conversation
After Exit Draw mode clears the mode flag, the exit seat still reflects the old stance until the repaint frame. The Threads helper could count that stale exit, then wait for it after it became On me, or activate the retained button after it changed roles and open the queue before waiting for On me again. A controlled-clock browser probe reproduced the retained Exit button becoming On me and its subsequent activation opening the queue. Wait for queued rendering before choosing the pointer route, including inside embedded pages. Async preparation remains independent of this control reading. Closes #4229
This was referenced Oct 27, 2026
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.
The Threads pointer helper could act on the panel's previous stance after Exit Draw mode had already cleared the mode flag. The retained Exit button becomes On me in the repaint frame: selecting it before that frame and activating it afterward opens the queue, leaving the helper waiting for an On me mark that is now Close. If the frame lands before target selection instead, the helper waits for the vanished Exit. These match the two timeout boundaries recorded in #4229.
Wait for queued rendering before choosing the pointer route. The wait resolves the document containing the controls, including embedded pages, and leaves asynchronous preparation independent. This preserves #4144's single-seat interface and #4169's pointer navigation.
A controlled-clock browser probe confirmed the retained Exit → On me transition and the queue opened by activating that same node afterward. Six focused cases pass, covering both early-thread variants, Draw-mode chrome, drawing drafts, resolution undo and an embedded page; the two reported cases also pass with 6× CPU throttling. Ruff checks, formatting and Python compilation pass. The original tests passed in 18 concurrent copies before the change too, so those passes alone are not evidence of recovery; the controlled transition establishes the race.
Controlled reproduction
On a ready served page, install Playwright's clock before navigation, enter Draw mode and wait for rendering. Pause the clock, then click Exit Draw mode. The document's mode flag is absent, but
.lf-fp-exitstill exists. Keep its element handle, resume the clock and wait for rendering: that same node now has.lf-fp-on-user. Clicking the retained handle opensdata-open="queue"and removes.lf-fp-on-user. The helper previously chose its exit branch without waiting for this queued repaint.Closes #4229 — automated triage