Repository navigation
Fix three more tests that fail only on macOS: a merge film cue, a wheel's box, a card's answer placement - #5989
Merged
Merged
Conversation
…icking Reply
The answer's arrival reveals the card's foot with a 300ms clip-path reveal,
and a press on the clipped part of the reply box hit-tests to the thread.
On a fast Mac the click landed inside the reveal; Playwright saw the thread
intercept it, and its retry scrolled the box into view with
scrollIntoView({block: 'end'}), moving the page 460px, so the card read 612px
where the test expected 152px. A user can't press what the clip hasn't drawn,
so the page is right; the test now waits for the card to rest
(restingIn), as it already does before its later reads.
Fails 2 of 2 locally on macOS before; 18 of 18 copies pass after.
…ing itself under CSS zoom A card that has stood keeps its width by pinning min-width and max-width to the client width it stood at, divided by its positioning scale and rounded to 1/64px by layoutPx. Under a CSS zoom, layout resolves the zoomed length, so rounding the local length at 1/64px lays the card out 1/64px off the width it was read from. Under html zoom 1.25 each pin shrank the card by 1/64px inside its own ResizeObserver delivery, and every fresh placement unpinned it again, so the page reported 'ResizeObserver loop completed with undelivered notifications' (test_a_zoomed_floating_draft_and_sent_comment_fit_a_narrow_window, macOS-only because macOS font metrics give a width that rounds wrong). layoutPx takes an optional zoom and rounds the zoomed length; the card passes its currentCSSZoom for both pins. Measured over 399 text widths at zoom 1.25, the old rounding missed the box's width for 41% in Chromium and 18% in Firefox, and the zoomed rounding for none in either. The zoomed-draft test fails 3 of 3 locally on macOS before; 18 of 18 copies pass after.
…it to its top Forty lines grow the comment field to its cap, and that resize queues one more reveal of the caret at the field's end, which CodeMirror runs at its next measure. The test scrolled the field to its top before that measure, so the scroll event ran it, the reveal scrolled the field back to its end, and the wheel that should scroll the field chained to the page instead. Traced: the test's scrollTop = 0, then setScroll(top 695) from text-field.js's size-observer measure, called from CodeMirror's onScroll. On this Mac the race hit about one serial run in three, and every nightly macOS run since Nov 11; rendered() after the write drains the queued reveal. 0 of 15 serial runs and 18 of 18 flake copies fail after.
…ontexts do Playwright's context emulates prefers-reduced-motion: no-preference for the page's media queries, but Firefox's own smooth scroll reads the host's setting. On a host asking for reduced motion, a smooth scroll lands in one step while the page reads no preference, so a test that needs a scroll under way never gets one. The nightly macOS runner failed three Firefox cases this way: smooth-reply-above-firefox and smooth-revision-above-firefox on every run since Nov 7, and test_a_landing_that_moves_nothing_stops_a_scroll_still_under_way[firefox_browser] on three of the last four. Launching Firefox with ui.prefersReducedMotion=1 on this Mac reproduces all three with the runner's exact readings ([300, 570], [300, 495], 7653). The suite's Firefox and leaf-dev's Firefox engine now launch with ui.prefersReducedMotion=0 (leaf_dev.browser.FIREFOX_PREFS).
…not two The glide runs for a fixed 140ms (scrolling.js, SCROLL_MS), so how many frames show it depends on the frame rate. The nightly macOS runner draws one frame inside it ([0, 2007, 2317, …] on Nov 14, [0, 1490, 2317, …] on Nov 13), which the three-position assertion read as a missing glide. A jump still fails: it shows the destination alone.
The search status says "1 of 1" as the search finds the match, and the marks over each piece's words follow a frame or two later as their boxes are placed: traced on this Mac, the status at 454ms, the first mark at 463ms and the second at 495ms. The test read the marks once, right after the status, so a slower runner read [1, 0] (nightly macOS, Nov 14). It now waits for rendered() first.
… its box test_an_edit_above_the_paragraph_read_holds_it_with_the_reply_box_scrolled_away failed on 3 of the last 4 nightly macOS runs with the reply box back in view, its precondition. CodeMirror reveals a typed edit's caret in its next measure, an animation frame later, through Leaf's reveal (editor-view.js). The test scrolled away by script in the next two driver calls, about 10 ms after typing, and on the macOS runner that frame came later still, so the reveal ran after the scroll and brought the box back to the band above the panel, 371 px down. A page-side trace with the frame held across the scroll shows that write (scrollIntoView from editor-view.js:163 inside CodeMirror's measure) and reproduces the CI screenshot pixel for pixel. The test now waits for the edit's rendering, as its sibling test did in #4977, before the scroll that stands in for the user's. No product behavior changes. A scroll made within one frame of a keystroke still loses to that keystroke's reveal; a person's scroll after typing comes later than that unless the machine's frames lag far behind its input.
test_new_rail_keeps_a_pin_reachable failed on 3 of the last 4 nightly macOS runs in its cleanup, after every assertion had passed: it pressed the close button of a card its own Escape had already closed. A closed card fades out for 120 ms, inert, before it hides (thread-preview.js, `close`), and Playwright counts it visible meanwhile, so `card.is_visible()` read the fading card as open; the card hid under the click, which then waited 120 s for a button that was gone. On the macOS runner the cleanup reached that check inside the fade; pausing the fade at its start reproduces the failure in both subtests. `put_card_away` now owns the step for this test and for test_a_card_is_one_press_to_leave_however_it_came_to_its_thread, which had the same check: it presses close only on a card that isn't inert, then waits for the card to be hidden. No product behavior changes.
…he walk reached
The thread walk (`t`, `T`) focuses the card it reaches, and box-motion.js can
carry the card's list from where the old thread's card was drawn to the new
one's place. Walking back from the figure's thread to the first, that old place
lies below the window once the page has scrolled up, so for the length of the
carry the focused thread and its reply box are drawn there. `focusPlace`
(user-place.js) counts a key pressed while a motion carries the user to their
stop as meant for the stop, but it recognised a motion only by keyframes naming
`transform` or `translate`, and box-motion moves a part through its registered
`--lf-box-carry`, which the part's `translate` reads. So the keyboard let go of
the card first, and the walk started from the card it had just left: `T` opened
thread 1 again instead of stepping back to thread 3.
box-motion.js now exports the property as `CARRY`, and `carried` counts an
animation of it as a motion carrying the node.
This is why `test_the_page_marks_the_comment_the_user_is_located_in` failed on
the nightly macOS job (Nov 7 and Nov 14). Page-side traces of its steps under
`taskpolicy -b` caught the failing `T` each time: the controller let go
(`focusPlace` null) with the page at rest, the card at 471-609 px and its reply
box at 1173-1203 px while the carry ran. The carry ran in the failing runs and
in none of the passing traces from an idle machine; box-motion takes a change as
the user's, and so carries it, while the key's rendering is still settling
("Whose change it is"), which is presumably why it shows on slow machines, where
a user pressing `T` soon after `t` meets the same misstep. A probe that holds a
carry mid-flight and presses `T` reopens thread 1 on main and reaches thread 3
here. `leaf-dev flake` under `taskpolicy -b`: 3 of 18 copies failed on main, 0
of 18 here.
…s back `test_any_focus_on_a_note_rings_its_block_and_follows_it_redrawn` focuses a block's comment note by script after a click, presses Tab, which takes focus out of the page, and focuses the note again, so that arrival is the keyboard's: the margin opens the note's card and traces its block. focus.js reads a departure for nowhere a task after its `focusout`, so a window losing focus is not taken for one, and a focus that comes back to the same node before that reading is no change, which `publish` drops. Under load the scripted focus came first, the margin heard no arrival, and the block never wore the trace: 3 of the last 4 nightly macOS runs, and 1 of 4 runs here under `taskpolicy -b`, where a page-side trace shows the note's `focusin` before the departure's reading and no margin reading after it. Blurring and refocusing the note in one task reproduces it every time. Only script or assistive technology can put focus back that fast, so the runtime's reading stands; the test now waits for the ring to come off the block, which that reading paints, before focusing the note again. The behavior the test protects is unchanged. `leaf-dev flake` under `taskpolicy -b`: 13 of 18 copies failed before, 0 of 18 now.
…e below it `test_marked_words_are_seen_and_told_apart` rests the pointer on one marked passage, captures its paint, and then presses the marked passage on the next line to open its thread. A pointer resting on a mark shows its preview after a 200 ms dwell (preview.js), standing below the line, over that next passage, and a press there lands on the preview, which puts it away and opens nothing. On Linux CI each capture's screenshot takes about 31 ms, so the press beat the dwell; on the macOS runner about 190 ms, so the preview stood first, and the test waited out its 120 s for a thread that never opened (Nov 14). Here under `taskpolicy -b`, 4 of 4 runs pressed `.lf-preview-detail`. The test now takes the pointer off the passage and waits for the preview to go before the press, as `preview_parts` does. The paint each state is checked for is unchanged. `leaf-dev flake` under `taskpolicy -b`: 16 of 18 copies failed before, 0 of 18 now.
…e source test_primary_arrival_records_a_return_place_only_when_travelling shrank the window with a bare set_viewport_size and scrolled to its source at once. The short window moves the package workspace's reading regions, and the page puts back the place it recorded before the move on the next frame (version.js, restoreShifted). Where that frame came after the test's scroll, the restore took the page back to 0: the contextual cases then found the thread's passage already shown, so the trip pushed no return stop (history.length 2 where 3 was expected), and the primary cases ended at scrollY 0. A page-side trace on efficiency cores shows the scrollTo(0) from restoreShifted after the test's scroll to 1000. A reader's own scroll is a choice restoreShifted keeps; the test's script scroll isn't. The test now resizes with resized() and waits for rendered() before it scrolls. On efficiency cores (taskpolicy -b) the [False-True-1000-False-True] case failed 2, 9 and 2 of 18 flake copies before, and it and [True-True-200-False-False] pass 18 of 18 after.
# Conflicts: # browser/runtime/annotation-overlay/thread-preview.js # browser/runtime/user-place.js # tests/browser/test_render_anchors.py
…ect drawing `test_drawing_preview_contains_page_content_and_freezes_it[light-False]` narrows the window from 1280px to 390px, focuses the composer's "Inspect drawing" button and presses Enter. `set_viewport_size` returns before the page has handled the resize: the `resize` event fires in the page's next rendering update, and the composer is placed for the new window in the updates after that. When the driver got there first, as on the macOS runner and on a Mac's efficiency cores, the focus landed on the button where the 1280px window had put it, outside the 390px window, and scrolled the root sideways to its end. The Enter then reached a focused control the user cannot see, which the keyboard controller lets go of (`focusPlace`, `letGo`), so the image viewer never opened. A page-side trace of two failing copies under `taskpolicy -b` shows the order: the Enter's keydown focuses `h1#title` and blurs the button, and the page's first `resize` event arrives 15 to 25 ms later. Holding the page's frame callbacks until after the Enter reproduces the failure on every run. The macOS failure screenshot shows the same sideways-scrolled layout. The product behaves as designed. Only a script can focus a control and press a key between a resize and the page's next rendering update, and a key pressed there acts from what the window shows. The test now waits for `rendered(page)` after the resize, as the other drawing tests do, so it presses the button where the narrow window places it. No product code changes. Under `taskpolicy -b uv run leaf-dev flake`, the old test failed 14 of 18 copies with the macOS message; with this change it passes all 18.
…ick's send `test_obligations_sharing_context_keep_their_source_identity` read the first obligation's status right after `round_trip`, and the nightly macOS job failed it on Nov 14 with `'open' == 'answered'`. Whether a pick answers an obligation is a fact of the server's reading (root AGENTS.md, "Responsiveness"). The outbox clears the pick's attempt as soon as the POST's answer arrives, and the page applies the reading that answer carries in later tasks: `applyState` first waits for the frame that paints the gesture (`afterOwedFrame`). `round_trip` waits only for the attempt to clear. A page-side trace of a run under `taskpolicy -b` shows the ledger reading heard-back at 6837 ms with the status still `open`, `round_trip` returning at 6849 ms, and the status turning `answered` at 6949 ms. The user sees the pick at once and the obligation answered when the reading lands, as designed; only the test read too early. The test now waits for that reading with `expect_obligations_answered`, after each pick. No product behavior changes.
…dering `test_an_input_owns_the_landing_of_a_widget_preparation_it_began` failed on the nightly macOS job on Nov 8, 9, 11 and 14. It opens a diff file, holds the markdown grammar, moves `#control` by script and expects a `moved-without-input` report; the watch reported nothing. The shift watch credits a press with every frame up to the first one whose tick reads the runtime's loop settled, since that frame's own callbacks may still answer the input. The test moved the control as soon as `rendered` had read `updatesSettled`, which can come before that frame paints. A page-side trace of a failing run under `taskpolicy -b`, where frames often came more than 100 ms apart: the ticks at 4326, 4400 and 4511 ms read the loop unsettled, the move came at 4562 ms, and the tick at 4628 ms was the first to read it settled. That tick extended the press's rendering through 4628 ms, so the shift painted in that frame was the press's. In passing runs the move came after the watch had closed the rendering. Holding the watch's frame ticks while the runtime settles reproduces the failure on every run. Leaf moved nothing here and the watch followed its own rule; the test's setup raced the watch's next frame. The trace shows the credit coming from the press's rendering, not from #5638's popover anchor credit. The watch now exposes `lfInputRenderingOpen()`, and the test waits for it to read false before each move it makes, so the move paints after the press's rendering has closed. The watch's header and tests/AGENTS.md say so for the next test that moves the page after an input. No product behavior changes.
The fix in df830ea (box-motion's --lf-box-carry counts as motion in user-place.js's slides()) was covered only by a test that hits a running carry on slow machines. This one sets the card's --lf-motion-box-resize to 600s, walks t, t down a long page and presses Shift+T while the card's list is still carried in from above the window: T steps back to the first thread. With the CARRY clause removed it fails (the key lets go of the card and the walk reopens the thread it left); with it, 18 of 18 flake copies pass.
…er failures taskpolicy -b runs a test, its server and every engine on the Mac's efficiency cores. It reproduced ten failures only the nightly test-macos job had shown (primary arrival, three comment-mark tests, the drawing preview, the framed page, the shift watch's preparation landing, the obligation walk, mark churn and the merge film's cue), where --cpu-throttle 8 reproduced none of the twenty it was tried on.
test_a_commented_block_says_so_to_a_screen_user watches #p1 for mutations right after pressing Enter on its note and expects a poll that changes nothing to write nothing. On efficiency cores the Enter's own repaint, which takes the margin's trace (data-lf-traced) off the block once focus has moved into the card, landed after the watch started: the one mutation the test counted was that removal. It now waits for rendered() first. On efficiency cores (taskpolicy -b) 12 of 18 flake copies failed before and 18 of 18 pass after.
…uts its place back A composition change, such as a tab set switching between the merge film's phone and desk layouts, re-registers each reading region inside it and puts the region's place back only when the change ends (reading-regions.js, preserveReadingRegions). The cue painted at the re-registration read the scroll before that restore: in one script the terminal's data-lf-more-below went on at scrollTop 8 of 38, the restore scrolled it to 38, and the cue came off again, a write that changed nothing (test_merge_film_terminal_seeks_to_the_result_it_reports[390], nightly macOS on Nov 13 and 14). reach.js now holds the cue of every body under an owner whose change is open, and paints them once the change has ended and its restore has run. On efficiency cores (taskpolicy -b) the test failed 6 of 18 flake copies before and passes 18 of 18 after; the cue and tab-switch reading-place tests pass.
…ved it first inputScroller picks the box a wheel scrolls as the first along its chain that can still move the wheel's way. On macOS, Chromium scrolls a precise wheel on the compositor before the page hears it (the event arrives non-cancelable), so the event that takes a box to its end finds it there, and the wheel fell back to the innermost box under the pointer. In test_visual_review_keeps_its_inline_comment_editor_in_view_after_phone_resize[760] a wheel took the page from 579 to 0 over the visual review's case list, version.js credited the wheel to the case list, recorded no new place for the page, and the resize that followed, before Chrome ended the wheel's gesture, restored the page to the reply box at 576. It failed on every local macOS run, on main before and after #5978, and passes in Linux CI. A box the sequence under way has carried the wheel's way since its last sequence ended (scrolling.js, carriedToward) now counts as the box the wheel moves. A wheel's sequence ends only when its gesture does, so this is the box the gesture is latched to. The test passes 4 of 4 locally after the change. Of the browser tests that send a wheel, all pass but two #5980 owns and a card's wheel test the next commit fixes, each of which fails without this change too.
… the wheel When the answer to the user's turn arrives past a card's foot, #fitAnswer reads whether the user stood at the transcript's end, and a frame later moves the box to keep their turn in sight above New reply, unless the reader's input has the box scrolling (readerScrolls). On macOS, Chromium applies a precise wheel's scroll on the compositor before the page hears either the wheel or the scroll, so in test_a_wheel_up_a_card_as_its_answer_arrives_goes_where_it_takes_the_reader[browser] the read found the box at its end (733), the wheel moved it to 433, and the delayed write, still hearing no reader, moved it to 771, taking away the reader's scroll. It failed 6 of 6 local macOS runs on HEAD and passes in Linux CI. The delayed write now also stands back when the box no longer stands where the read found it. The test passes 4 of 4 on both engines; every test that reads New reply passes but test_an_answer_the_user_waits_for_grows_the_view_up_to_its_cap, which fails the same way on HEAD on this machine and passes in Linux CI.
leaf-agent
approved these changes
Nov 14, 2026
This was referenced Nov 14, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 15, 2026
…e panel field's place from its words (#5993) Two follow-ups from #5989. - **A mark's preview covered the mark on the next line.** A preview picks a side clear of other controls by hit-testing the box it would draw, but another thread's passage mark is a range with no element of its own, so it was invisible to that test. The preview stood below its line, on top of the next mark, and a press aimed at that mark landed on the preview and only closed it. The range's owner now says where a mark lies under a point (`preview.js`, `declareRanges`; `anchor-paint.js` answers from `markHit`). A range's preview also now tests the other lines of its own paragraph. The preview now stands above the mark instead. A caret lookup per sampled point costs about 3 µs on `LONG_PAGE`, the same as `elementsFromPoint`. The new `test_a_mark_s_preview_stands_clear_of_the_mark_on_the_next_line` fails without either part, on both engines. - **`test_an_answer_the_user_waits_for_grows_the_view_up_to_its_cap`** is not a macOS-only failure, as #5989 said: #5963 broke it. While the panel field holds the caret, #5963 runs the field's slot out to the panel's edges, which moves the slot's top 6px without moving its words. The test read the slot's top. It now reads the words' top, which is what "the field stays where it is" protects. It passes with #5963's parent's styles and fails with #5963's. `pnpm run check` and `pnpm run test:runtime` pass, as do the preview placement, comment-mark and margin-entry tests and both tests that read the panel's growth probe. > _This was written by Claude Code on behalf of max-sixty_
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.
Three more tests fail on macOS and pass in Linux CI. Each one traces to the runtime. Two of them have the same cause: on macOS, Chromium applies a precise wheel's scroll before the page hears the wheel.
test_merge_film_terminal_seeks_to_the_result_it_reports[390], from the Nov 13 and 14 nightly macOS runs, Four tests fail only on macOS in the Nov 13 scheduled run: sample Tab exit, merge-film scroll mark, removal gap bar, contents spine glide #5942). A tab switch re-registers each reading region inside it, and only puts the region's place back once the switch ends. The continuation cue painted at re-registration read the scroll before that restore, so it went on and then came off in one script. The write watch flags that as a write that changed nothing.reach.jsnow holds the cue for every region under an owner whose composition change is still open, and paints it once the change has ended.test_visual_review_keeps_its_inline_comment_editor_in_view_after_phone_resize[760]). A wheel took the page from 579 to 0, but by the time the page heard the wheel the page was already at its top.inputScrollertherefore credited the wheel to the case list under the pointer. The page recorded no new place, and the resize that followed put the reader back at the reply box.inputScrollernow also counts a box that has moved the wheel's way since its last scroll ended (scrolling.js,carriedToward).test_a_wheel_up_a_card_as_its_answer_arrives_goes_where_it_takes_the_reader[browser]).#fitAnswerfound the transcript at its end and planned to keep the user's turn in sight a frame later. By then the wheel had already moved the box from 733 to 433, but the page had heard neither the wheel nor its scroll, so the delayed write moved the box to 771. It now stands back when the box no longer stands where it was read.Before and after on this Mac:
taskpolicy -b, 18 copies)Every browser test that sends a wheel passes except two that #5980 owns and that fail without this change too. The cue, tab and reading-place tests pass, as do
pnpm run checkandpnpm run test:runtime.test_an_answer_the_user_waits_for_grows_the_view_up_to_its_cap(842 vs 848) also fails on this Mac and passes in Linux CI. It fails the same way without this change and isn't addressed here.