Skip to content

fix: repair the four journeys tests #6682's seated thread cards broke - #6748

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-6741
Nov 22, 2026
Merged

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

Conversation

@leaf-agent

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

Copy link
Copy Markdown
Collaborator

This repairs the four journeys tests that have failed since #6682 seated thread cards. Each fails on main and passes here, in Chromium, and in Firefox where the test runs it. The tests have three separate causes. None of the repairs gives up anything #6682 meant to do.

  • test_margin_card_holds_its_top_while_read_and_its_reply_while_written (unchanged write on div.lf-box-moving-ring). Seat thread cards in their widget's box and ground, as the margin card #6682 deleted the quiet focus ground, and with it the rule that kept a page thread from wearing an outline while focus was within it. A send in a margin card moves focus from the reply field to the thread. For the rest of that task the thread matches :focus-visible but doesn't yet carry Leaf's data-lf-focus-visible, so it wears the browser's own auto ring. box-motion reads rings during that gap. It found two (the thread's black UA ring and the field's blue ring) and drew both on its one moving-ring layer, which left the layer's style where it started. .lf-ring-overlay:is([data-lf-focus-visible], :focus-visible) now drops the overlay's own outline. The thread's ring is still the ::after that Leaf's focus mark turns on, as Seat thread cards in their widget's box and ground, as the margin card #6682's surfaces.css header describes.
  • test_sends_from_a_page_threads_box_hold_its_foot_at_the_bands[diff-4-browser] (a scroll during Enter moved the box by (0, −22)px). Each Shift+Enter grows the reply box by a line, and keepInBand scrolls so the row's foot stays at the reading band's foot. It asked for scrollTo(1090.578), and the browser snaps scroll offsets to device pixels, so the page landed at 1091. The box's foot ended a pixel higher than before, which counts as carrying the box under the user's aim. Seat thread cards in their widget's box and ground, as the margin card #6682 only moved the row to a fractional offset that rounds up (the parent's offset rounded down). keepInBand now has land in landing-scroll.js travel only the whole device pixels of its move, which leaves the row's foot less than a pixel short of the band instead of up to a pixel past it. Every other landing reveals something and keeps the browser's own snapping, so a target a fraction past an inner scrollport's edge still comes fully into view.
  • test_the_page_holds_still_under_the_user[reading-reply-below-chromium|firefox] ("the thread doesn't end below the place"). The fixture needs the long thread's last message to start inside the window. The seated card's padding and message width pushed it 93px below the window, so the fixture has one fewer exchange. The behavior under test is unchanged.

On screen: the landing change moves a held reply row by under a pixel. The CSS change removes the browser's focus ring from a thread in the moment before Leaf's ring replaces it.

Checks run: the four tests by node id; all of tests/journeys/test_page_holds_still.py (124 passed, 34 xfailed); tests/journeys/threads/test_composing.py; the browser tests for composing, draft reading place, send placement, navigation reading place, anchors, seated threads and scroll writes (360 passed); pnpm run test:runtime, including runtime tests for the held reply row and a fractional reveal in an inner scrollport; pnpm run check.

Left as is: box-motion still has one moving-ring layer, so a reading in which two parts change size while both wear rings would draw only the last one. Nothing hits that once the thread no longer wears the UA ring.

Closes #6741 — automated triage

Three separate causes, each reproduced on main and passing after the change:

- A ring overlay (a page thread) wore the browser's own focus ring between
  focus reaching it and the focus paint marking it. #6682 deleted the rule
  that hid that ring while focus was within the thread, together with the
  quiet focus ground. A send in a margin card moves focus from the reply
  field to the thread, and box-motion reads rings during that gap. It found
  two rings, the thread's and the field's, and drew both on its one
  moving-ring layer, which left that layer's style unchanged
  (test_margin_card_holds_its_top_while_read_and_its_reply_while_written).
  `.lf-ring-overlay:focus-visible` now drops the outline too. Its ring is
  still the ::after that Leaf's focus mark turns on.
- An instant landing asked the browser to scroll by a fraction of a pixel,
  and the browser snaps scroll offsets to device pixels. When the fraction
  was above a half, a reply row held at the reading band's foot ended a
  pixel past where it was asked to stand, under the user's aim.
  #6682 moved the row by a fraction that rounds up. `land` now travels
  only the whole device pixels of its move
  (test_sends_from_a_page_threads_box_hold_its_foot_at_the_bands[diff-4]).
- The page_holds_still fixture needed the long thread's last message to
  start inside the window. The seated card's padding and message width
  pushed it 93px below the window, so the fixture now has one fewer
  exchange (test_the_page_holds_still_under_the_user[reading-reply-below-*]).

Closes #6741
@max-sixty

Copy link
Copy Markdown
Owner

@leaf-agent The new snappedToward rule can leave an inner-scrollport target clipped. At DPR 1, with scrollTop 100 and the target's bottom 0.75 CSS px below the scrollport, innerMoves passes 100.75 to land, but snappedToward(100, 100.75) returns 100. A retry makes no progress; the previous behavior could scroll to 101 and reveal the target. Please apply the no-overshoot rule where an existing box must hold position while preserving nearest-reveal behavior, and cover this fractional inner-scrollport case alongside the reply-row regression.

This was written by Codex on behalf of max-sixty

…anding

The previous commit made every instant landing travel only the whole device
pixels of its move. A reveal then stopped up to a pixel short. In an inner
scrollport, a target 1.75px past the edge moved 1px and stayed clipped by
0.75px, and setScroll drops any retry shorter than a pixel. Only keepInBand,
which holds a growing reply row's foot at the band, now passes `held` to
`land`. Every other landing passes its asked offset to the browser's snapping
as before.

Runtime tests cover both cases: a held box at a fractional foot travels only
whole pixels, and an inner-scrollport reveal travels its fraction.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Agreed. Pushed 8adb469, which applies the whole-pixel rule only to keepInBand. That call holds the growing reply row's foot at the band and now passes held through scrollIntoReadingBand to land. Every other landing, including innerMoves' reveals, passes its asked offset to the browser's snapping as it did before #6748.

One correction to the scenario: for exactly 0.75px, nothing changed. setScroll skips any write that moves less than a pixel (arrivals.js moves), so it left 100.75 at 100 before #6748 too. The regression you describe is real for a fractional move of a pixel or more. A target 1.75px past the edge moved 1px under the previous head and stayed clipped by 0.75px, and that 0.75px retry is the one setScroll skips. So the new test uses 1.75px.

Tests in tests/runtime/landing-scroll.test.mjs:

  • Inner scrollport: a reveal from 100 lands at 101.75. It failed at 101 on the previous head.
  • Reply row: a held box whose foot is 150.578px past the band travels 150px.

pnpm run test:runtime (1082 passed), pnpm run check:browser, and all six test_sends_from_a_page_threads_box_hold_its_foot_at_the_bands variants pass.

@leaf-agent
leaf-agent merged commit 701d0db into main Nov 22, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6741 branch November 22, 2026 12:48
leaf-agent added a commit that referenced this pull request Nov 22, 2026
…olds_still (#6768)

The `reading-*` cases of `test_the_page_holds_still_under_the_user` need
the `notes` thread's reply box below the window while the thread's last
message starts inside it. The only thing between those two edges was the
last reply's height, about two lines. On Linux (Chromium) the reply box
stood just 6px below the 900px window, and macOS's taller line metrics
brought it fully into view. That failed `put_reading`'s setup in all 12
cases (#6766) once #6748 dropped an exchange so the last message would
start inside the window under #6682's seated card.

The last reply now runs eight times as long. Only text below the last
message's top grew, so the message still starts where it did, 775px down
the window. The reply box now stands 300px below the window instead of
6px, far more than the two platforms' line heights differ by. What the
cases test is unchanged, and so is what #6748 intended.

**Verification**
- Linux: the 12 cases pass. Probing `put_reading` in Chromium
(`reading-reply-above`) before and after, the last message's top stays
at 774.7px in both, and the reply box's top moves from 905.7px to
1199.7px.
- macOS: two `test-macos` flake dispatches of the 12 cases are running,
one on this branch
([run](https://github.com/max-sixty/leaf/actions/runs/45071051936)) and
one on main's `75c3a82cb`
([run](https://github.com/max-sixty/leaf/actions/runs/45071054336)).
Their results will be added here.

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

Four journeys tests fail since #6682 seated thread cards: page_holds_still reading-reply-below, composing diff-4, margin card top

2 participants