Skip to content

fix: settle panel rendering before the Threads pointer route - #4408

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-4229
Oct 28, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

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-exit still 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 opens data-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

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
@leaf-agent
leaf-agent merged commit 69ece09 into main Oct 28, 2026
4 of 5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4229 branch October 28, 2026 08:58
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.

Drawing and early-thread tests wait for the missing On me control

1 participant