Skip to content

fix: stand a margin marker's preview past the ring of the element it marks - #6887

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6872
Nov 23, 2026
Merged

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

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A margin marker's focus preview now stands 6px past the ring of the element the marker stands for, instead of flush on that ring. This repairs tests/journeys/test_render_controls.py::test_each_sampled_focus_ring_is_shown_whole_in_its_surface, which has failed on macOS since #6771.

Cause. #6771 made previews keep clear of the marks round their subject through markRoom (mark-room.js), which walks up the subject's tree ancestors. A margin marker sits in a margin seat, not inside the element it marks, so the walk never reached that element. On pr-walkthrough at 1200×900, the preview of the lf-group decision's marker stood above the marker and reached back over the decision. Its bottom edge was at y 434.8, exactly the outer edge of the decision's ring (top 442.8 − 6px offset − 2px band). The preview face's box-shadow then covered x 1058–1192 of the ring's top edge. Before #6771 the fixed 11px gap kept the preview clear of it.

Change. The walk now starts from the element a margin seat stands for ([data-lf-margin-for]'s lfTarget, the lookup margin-projection.js already uses). The element's ring counts wherever the seat sits in the tree, so the preview stands its gap past the decision's ring, like the previews #6771 placed beside a widget inside a padded decision. The thread card and the comment box use markRoom too, so they also clear that ring when they stand by a margin entry.

On screen. One state moves: the focus preview of a margin marker that reaches back over its marked element stands 6px further from that element. Where the preview stands beside the element, clear of it, nothing moves.

Verification.

#6872's other tests are unchanged: the intermittent lf-diff teardown shift in test_render_read_state.py, and three tests that passed every copy on macOS.

Refs #6872 — automated triage

markRoom walked the subject's tree ancestors for the marks a surface keeps clear
of. A margin marker sits in a seat outside the element it marks, so the walk never
met that element's ring: the preview of pr-walkthrough's decision marker reached
back over the decision and stood flush on its ring, and its face's shadow covered
the ring's top edge (test_each_sampled_focus_ring_is_shown_whole_in_its_surface,
on macOS since #6771). The walk now starts from the element a margin seat stands
for, so the preview stands its gap past that ring.

Refs #6872
@leaf-agent
leaf-agent merged commit f8baa47 into main Nov 23, 2026
11 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6872 branch November 23, 2026 18:54
leaf-agent added a commit that referenced this pull request Nov 24, 2026
…#6974)

`test_a_page_seat_the_open_panel_stands_over_is_not_read` failed on
macOS at teardown with `moved-without-input` on the diff's `leaf-text`
(−257 / −297 px). The test scrolled to the agent's answer as soon as the
answer entered the DOM. On a starved runner, the answer's layout (the
thread outlet growing 150 → 238 px) and the scroll then land in the same
frame. The shift watch sees the outlet grow without any input and
reports it, even though the answer was still below the window's foot
when it was drawn. The test's own docstring says the answer "arrives
below the window's foot, where it is drawn at once", so the test now
waits for `rendered(page)` after the answer appears and before it
scrolls. No runtime code changes.

On the macOS runner (`ci` dispatched with `leaf-dev suite flake
--workers 3 --load 2`):

- main at `bd26a80ca`, 27 copies of each parameter: 8 of 54 failed with
the same shift ([run
45342510720](https://github.com/max-sixty/leaf/actions/runs/45342510720))
- this branch, 54 copies of each parameter: 108 of 108 passed ([run
45342507421](https://github.com/max-sixty/leaf/actions/runs/45342507421))

This was the last test on #6872 still owned there. #6887 fixed the
pr-walkthrough ring and #6905 fixed the file editor test. The
align-current-item and motion-recording tests passed every copy on the
macOS runner, so they wait for a recurrence, and the next failed run's
report will bring them back.

Closes #6872 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 24, 2026
…ion frames (#7027)

`test_file_editor_status_controls_take_a_finger_on_a_phone` failed on
macOS in scheduled [run
45378690705](https://github.com/max-sixty/leaf/actions/runs/45378690705)
with `moved-without-input` on the editor's `.cm-gutterElement` rows by
(0, 4) and (0, 14). That is the shift #6905 traced to Playwright's fake
clock in the neighbouring `adopted_text` test, and this test installed
the same clock before the page loaded. The clock turns
`requestAnimationFrame` into a timer, so CodeMirror's measure after
`view.setState` can land after a real paint, and the watch sees the
gutter rows move from their 14px estimate to the editor's 24px lines
with no input.

The clock only advanced the 500 ms save delay and the retry's wait, and
`short_aims` already waits for each control to be visible before
measuring it. The test now runs on real time with every assertion
unchanged: Retry and the conflict menu still have to be finger-sized at
390px under touch.

**Evidence** (`leaf-dev suite flake --cpu-throttle 8` on Linux):

| | failed |
|---|---|
| main at `e80dd78be` | 11 of 12, same gutter finding as CI |
| this branch | 0 of 18 |

The other clocked test in this file installs its clock after the editor
has loaded and has shown no such failure, so it is left alone.

This was the last open item in #6872: the ring, the `adopted_text` save
test and the read-state shift were fixed in #6887, #6905 and #6974, and
the align and motion tests wait for a recurrence.

Closes #6872 — 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.

1 participant