Repository navigation
Check pointer-returned focus in reaction and diff tests - #2437
Merged
Merged
Conversation
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
commented
Oct 11, 2026
leaf-agent
left a comment
Collaborator
Author
There was a problem hiding this comment.
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
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]>
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.
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-visiblewhile 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.