Skip to content

fix: publish focus departures when component entry fails - #4406

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-4245
Oct 27, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A component can accept a focus transfer and then leave the document body active without emitting a matching focusin. The shared focus reader returned early whenever focusout.relatedTarget named a destination, leaving command hints attached to the previous widget. This caused the trace's Previous and Next controls to retain arrow shortcuts after the zoom step in the review-a-fix sweep.

Run the existing deferred departure reading for these transfers too. Successful arrivals still suppress it, and focus holds and drop classification retain their existing checks. This preserves the central focus publication model from #1967 instead of adding a trace-specific repaint.

The new runtime regression fails before the change and passes afterward. The reported review-a-fix sweep likewise fails before and passes after; the nested-surface Escape journey also passes. Generated kernel files are rebuilt.

Closes #4245 — automated triage

A non-null focusout relatedTarget does not guarantee a subsequent focusin: component focus forwarding can leave the body active instead. Run the existing end-of-task reading for those departures too, so shortcut projections and other current-location readers learn that focus left.

The new runtime regression fails before the change and passes after it. The review-a-fix stale-shortcut sweep also reproduces the reported zoom-step failure before this change and passes afterward.

Closes #4245
@leaf-agent
leaf-agent merged commit 9cbeb7a into main Oct 27, 2026
3 of 4 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4245 branch October 27, 2026 08:33
leaf-agent added a commit that referenced this pull request Oct 27, 2026
A native pointer focus transfer checkpoints microtasks between departure
and arrival. #4406's deferred departure check could read the body in
that gap and fold the margin options under a held press, excluding the
retained action from the accessibility tree despite its correct label.

Read the departure after the focus task finishes and discard it when a
newer location reading has superseded it. This preserves #4406's
failed-arrival cleanup while keeping the options open and the retained
action focused through the press and label update. The existing browser
regression now explicitly checks that intermediate focus and disclosure
state.

Validation: the reported test fails before the change and passes
afterward; all 682 runtime tests pass, including failed-arrival cleanup.
The review-a-fix stale-shortcut sweep, inline-margin retention case and
three focused focus cases pass. The kernel build/type check passes.
Local ESLint, Prettier and Ruff executables are unavailable; CI will run
lint.

A served review-a-plan startup comparison retains 31 code requests
through widget upgrade and first server-state presentation, with 148
more code bytes and no console errors or startup layout shifts. The
change adds no startup task or dependency.

Parallel triage sessions reproduced and verified the same correction for
suggestion presses, keyboard arrival and thread-preview opening in
#4423, #4424, #4425 and #4426; their exact cases and head-pinned results
are recorded in the PR comments.

Closes #4423, closes #4424, closes #4425, closes #4426, closes #4427 —
automated triage

Co-authored-by: leaf-agent <[email protected]>
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.

Trace transport shortcuts remain stale after zoom

1 participant