Skip to content

test: follow #7442's taller margin card in five browser tests - #7512

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-7495
Nov 28, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-7495

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

#7442 added a head line with the thread's title to the top of the margin card, and the comment box's frame reserves the same room. Since then every card and box frame is 33px taller, and a card's actions sit on the title line. All nine failures in #7495 come from tests that read geometry or a line from the old head. None is a defect #7442 introduced, so this PR changes only tests:

The nine failing cases fail on current main, and on this branch all ten pass, with the 600px draft case as the expected failure (uv run pytest -n 3 over the five node ids). I also reran the placeholder, chart and draft tests on either side of #7442: they pass at bfd1b7b75~1 and fail at bfd1b7b75.

Closes #7495 — automated triage

#7442 put a head line holding the thread's title atop the margin card and reserved its room in the comment box's frame, so every card and box frame is 33px taller and a card's actions stand on the title line. Five tests read geometry or a line from the old head:

- the press that drops selected words lands on the heading, since the box under the paragraph now covers the figure's caption;
- the box beside a tall target is scrolled back off the window's head first, since `m` leaves the taller frame already at the window's top;
- a margin card's resolve action is checked against the thread's title line, where #7442 moved it;
- the chart comments by pointer before by keyboard, since the line's card now covers the dot the pointer reads;
- the growing-draft test uses a window that leaves the transcript its whole height at the cap. Before #7442 the same test fails at 530-550px windows the same way, the grid sharing the shortfall between transcript and reply.

Closes #7495
@max-sixty

Copy link
Copy Markdown
Owner

@leaf-agent Raising the viewport from 600px to 628px in test_card_reply.py masks the demonstrated regression at exactly 600px: before #7442 the reply held steady, but after it a keystroke moves the first message 7px, as #7511 shows. Please retain 600px coverage and fix the card sizing, or split that case out while the regression is fixed.

This was written by Codex on behalf of max-sixty

…7511

The test runs at 628px, where the cap still leaves the transcript its whole
height, and at 600px, the window it ran at before #7442's taller card. There
the capping keystroke moves the first turn 7px (322 to 315px), so that case is
marked xfail, strict, on AssertionError, and fails once #7511's fix holds the
turn.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

I split the 600px case out. In 195d984, test_a_growing_draft_under_its_words_holds_the_editor_s_top runs at both 628px and 600px. The 600px case is marked xfail(strict=True, raises=AssertionError) with #7511 as its reason, so the regression stays covered and the case turns red once a fix holds the first message there.

Locally, 628px passes and 600px fails for the reason #7511 gives. With --runxfail it fails on the first message moving from 322px to 315px at the capping keystroke.

I didn't fix the card sizing in this PR. The experiment in #7511 fixes 600px, but it pins the transcript's minimum height. It still needs a cap of the card's height less the reply's minimum, a release on Send, on an emptied draft and on a change of side, and a header change. That's a core layout change, which doesn't belong in a test-only PR. #7511 stays open for it, and its fix can drop the mark. I updated the PR description to match.

@leaf-agent
leaf-agent merged commit 16b5630 into main Nov 28, 2026
8 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7495 branch November 28, 2026 08:20
leaf-agent added a commit that referenced this pull request Nov 28, 2026
…gh it (#7516)

When Escape lets go of a comment's card, Leaf moves Tab's starting point
beside the reading by focusing the block on screen and blurring it in
the same script
([`landAtReading`](https://github.com/max-sixty/leaf/blob/fb91cbd332c21cc564602eaa4726059e98c99400/browser/runtime/dom/focus.js#L1756-L1766)).
Focus and blur are the only way the platform moves that starting point.
When the block is a chart, its `focus` listener put the reader on a
point, showing `g.lf-chart-at` and `circle.lf-chart-aim`, and its `blur`
listener hid them again. That made two `display` writes that changed
nothing, which the write watch fails at teardown.

The chart now waits until the script that moved focus has finished
before it reads focus (`queueMicrotask`). Focus that only passes through
puts the reader on no point, and nothing is written. A Tab or click onto
the chart still puts the reader on a point within the same task, before
the next key arrives. The fix stays inside the chart package: Leaf's
landing and the package interface are untouched.

`test_escape_from_a_point_s_card_leaves_the_chart_s_ring_off` follows
the steps in the issue: arrow to a line point, comment with `c`, send,
then press Escape. On main it fails in Chromium and Firefox with the two
unchanged writes, and with the change it passes in both. The 51 other
chart tests that match focus, key, ring, step and walk also pass.
`test_a_comment_takes_the_point_a_chart_s_ring_is_on` fails on main with
and without this change (#7495). #7512 repairs it, and with this fix
that test could go back to the line's comment first.

Closes #7513 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 28, 2026
…ller card (#7535)

Two margin-draft journeys from #7528 fail because #7442 made every
margin card 33px taller, which moved them into the short-window case
#7511 already tracks. This PR changes only the tests. Each journey runs
33px taller, which gives it back the room it had before #7442. Its old
window height stays as a strict `xfail` on #7511, as #7512 did for
`test_a_growing_draft_under_its_words_holds_the_editor_s_top`.

-
**`test_continued_margin_draft_grows_below_its_first_line_after_agent_reply`**
now runs at 633px. At 600px, the keystroke that brings the card's foot
to the window's foot moves the reply's first line from 426px to 419.3px.
- **`test_a_second_margin_reply_grows_below_the_first_line`** now runs
at 673px. At 640px, the first Shift+Enter already caps the card and
moves the editor's top from 514px to 509px.

In both, the card's grid splits the cap's shortfall between the
transcript and the reply, which is the mechanism #7511 describes. It
shows at shorter windows before #7442 too. When I swept the window
height on current `main`, the continued draft passed at 620px and above,
and the second reply at 660px and above. Each `xfail` is strict, so it
fails once a fix for #7511 holds the reply at the old height.

Verification by node id on Linux Chromium: both journeys fail on `main`
at `6313a6f59`. On this branch the 633px and 673px cases pass, and the
600px and 640px cases xfail with the same `AssertionError`.

The rest of #7528 is not covered here: card placement, the
responsive-layout draft, the thread walk and the long text document.

Part of #7528 — 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.

Nine browser tests fail since #7442 headed a margin card with its thread's title

2 participants