Skip to content

Check pointer-returned focus in reaction and diff tests - #2437

Merged
leaf-agent merged 6 commits into
mainfrom
fix/ci-38159211604-target-focus
Oct 12, 2026
Merged

leaf-agent merged 6 commits into
mainfrom
fix/ci-38159211604-target-focus

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

After #2375 made Leaf's focus ring follow the logical input destination across pointer and keyboard arrivals, tests in main CI run 38159211604 still treated pointer-returned focus as absent. Sending a reaction returns focus to its target, releasing a held diff header leaves focus on that header, and a mouse drag leaves the focused resize handle in place. The tests check each focus-owned outline or path reveal while focus stands there, then verify what disappears when focus leaves. The handle case also checks that pointer input clears Chromium's native :focus-visible while Leaf's retained focus ring remains.

Verification: uv run pytest -q tests/test_render_gate.py::test_dragging_an_edge_preserves_user_state (3 passed); the reaction and diff-path cases passed locally after their assertion changes. The branch also includes the served-wait deadline test alignment in #2440, which is being checked separately.

A reaction returns focus to its target under the current focus contract, so the target keeps an outline while focused. Assert that the outline leaves with focus, preserving the check that the reaction paints no standing contour.
The logical focus destination keeps its path reveal after a touch ends, just as keyboard focus does. Check the reveal until focus leaves, then verify no standing tooltip remains.
@leaf-agent leaf-agent changed the title Check reacted target focus separately from its standing contour Check pointer-returned focus in reaction and diff tests Oct 11, 2026

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new focus assertions check Leaf’s marker and styling but do not establish that the browser actually focused the target. tests/AGENTS.md (“Put each assertion at the boundary that owns it”) requires :focus for focus-ring coverage. A stale marker could otherwise let both tests pass while keyboard focus remains elsewhere; assert focus on #prose and the diff header after each return.

@leaf-agent
leaf-agent merged commit ede95d8 into main Oct 12, 2026
2 of 3 checks passed
@leaf-agent
leaf-agent deleted the fix/ci-38159211604-target-focus branch October 12, 2026 01:18
leaf-agent added a commit that referenced this pull request Oct 12, 2026
The [main CI
run](https://github.com/max-sixty/leaf/actions/runs/38187553140) failed
because a widget test still expected `1` to open a needed draft. #2441
intentionally removed draft context digits and put the supported Ask
route in
`test_a_draft_in_an_ask_takes_no_digits_and_answers_from_its_controls`.
This removes the conflicting older test; the draft suite retains
coverage for Tab to Edit, Enter to open, and the save shortcut.

Verified locally: the old widget test failed on current main, while the
draft suite test passed. The file-row failure in the same run was
already addressed by #2437 and its current test also passed locally.

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.

1 participant