Skip to content

Know today's layout shifts by test and region - #1460

Merged
max-sixty merged 12 commits into
mainfrom
draft-label-no-shift
Sep 30, 2026
Merged

max-sixty merged 12 commits into
mainfrom
draft-label-no-shift

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

The shift watch from #1432 now knows the shifts pages make today by test and region. Before, EXPECTED in tests/shift_watch.js held one set of region patterns for every page. Chrome names only the five nodes a frame moved most, which differ between runs and between macOS and Linux, so each run turned up names the patterns missed. The only patterns broad enough to catch them would have masked the runtime's own pieces, such as margin entries and the comment box, on every page.

  • tests/known_shifts.py names each test whose page still shifts without input, by file and function, with a pattern for the region its known shift moves. clean_browser keeps a report from that test only when the node it names is in that region. Any other shift fails, as does typing that carries its field. Four watched tests are listed today. Fixing a defect deletes its entry.
  • The upgrade before presentation is known by when it happens. Widgets upgrade after the authored HTML has painted, and the frame that presents the page carries every box their upgrade reshaped. This defect is every page's, so shift_watch.js doesn't report a shift before a page with the runtime is presented, or in the frame that presents it. The rule is deleted when the upgrade is fixed, however that is done.
  • The nightly-marked tests stay off the watch, as Keep the nightly tests off the shift watch, and give their hand-written claim a turn #1451 left them. That decision now sits with the list (known_shifts.watches_shifts). Their pages make hundreds of shifts, mostly that same upgrade: 781 reports across 321 test runs locally, and a nightly run on Linux CI (36659812215) found 58 tests the local run had not. They watch again, with the entries a fresh survey finds, once the upgrade is fixed.

The sensor also changed in three places:

  • Presses: every recent press is kept, and a trusted press in a same-origin page holding a frame counts as input to it. A later key had un-credited an earlier one's frame, and Keep news from moving the bottom bar, the status chevron and the chrome's root #1446 has already carried this fix to main.
  • Resize: a keystroke's rendering ends at a window resize. A test that resized right after typing had read as a carry.
  • Self-test: test_render_shift_watch.py gains a press in the page holding a frame, which fails without the change.

The everyday selection passes locally.

This was written by Claude Code on behalf of max-sixty

🤖 Generated with Claude Code

max-sixty and others added 11 commits September 29, 2026 17:35
# Conflicts:
#	tests/shift_watch.js
# Conflicts:
#	tests/conftest.py
#	tests/render_harness.py
#1451 took the nightly-marked tests off the shift watch because `EXPECTED`'s region
patterns could not hold what their pages do: hundreds of distinct moved elements,
and Chrome names only the five a frame moved most, differently between runs and
machines. A region broad enough to hold them would mask the runtime's own pieces on
every page.

`tests/known_shifts.py` now names the tests whose pages still shift without input
(`KNOWN_UNASKED`, 287 tests by file and function, each with what a survey saw move)
and whose typing carries its field (`KNOWN_CARRIES`, 2), and `clean_browser` keeps
exactly those reports for exactly those tests. Every test watches shifts again, so a
new test, or a known test's typing, still fails on any shift. The lists come from a
complete `--run-nightly` run with them empty.

One defect is every page's, so `shift_watch.js` knows it by when it happens instead:
a shift before a page with the runtime is presented, or in the frame that presents
it, which carries every box the widgets' upgrade reshaped.

A keystroke's rendering also ends at a window resize, which lays the field out anew:
a test that resized right after typing read as typing's carry.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The nested-frame input window kept only the last press, so a key that arrived before
the observer judged an earlier key's frame un-credited it: in the clipped-sample
test, Enter opened the child's panel, the frame at 400ms moved its status, and `u`
at 404ms left that frame without input. Every recent press is kept now. A trusted key
or press in a same-origin page holding the frame counts too, as when the page around a
sample drives it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	tests/shift_watch.js
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A nightly run on Linux CI (36659812215) found 58 tests the local survey had not, most
of them a margin cluster placed after presentation. So the nightly-marked tests stay
off the watch, as #1451 had them, now decided beside the lists
(`known_shifts.watches_shifts`); the lists hold what the surveys and that run saw, for
whoever takes up each defect, and the reports #1446 and #1444 fixed are out of them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The per-test allowance hides new layout shifts in tests already listed for a known one; see the inline finding. The PR description also leaves the startup cover decision open with the user, so I am withholding approval pending that decision.

Comment thread tests/known_shifts.py Resolved
…hed tests

The review on #1460 showed the per-test allowance keeping any report "moved without
input" from a listed test, so a new shift anywhere in it went unseen. Each entry now
holds a pattern for the region its known shift moves, and a report naming a node
outside it fails the test. The nightly-marked tests do not watch shifts, so their
entries were inert, and a fresh survey will find what they do once the upgrade that
causes most of it is fixed: only the four watched tests the surveys found remain.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty max-sixty changed the title Know today's layout shifts by test, not by region Know today's layout shifts by test and region Sep 30, 2026
@max-sixty
max-sixty merged commit acd4d97 into main Sep 30, 2026
8 checks passed
@max-sixty
max-sixty deleted the draft-label-no-shift branch September 30, 2026 05:27
max-sixty added a commit that referenced this pull request Sep 30, 2026
…omment box in place (#1453)

Typing into a comment box that stands left of its passage (`left-start`)
carried the box sideways, which the shift watch reported on two nightly
tests (`test_the_catalog_sidenote_can_be_aimed_whole` and
`test_a_side_comment_grows_down_from_the_line_it_was_opened_on[250-left-start]`).

**Cause, measured frame by frame.** `floatingPlacement`
(`runtime/floating.js`) wrote every box's spot as `left` and `top`
insets. A `left-start` box is held by its right edge, so when a
keystroke widened it, the browser grew it rightward, past the passage,
in the frame the key painted. The placement that follows the resize ran
a frame later and moved it back left. In the side-comment test the box
painted at x=348 with its right edge at 667, then at x=285 with its
right edge at 604, where it belonged: the whole box moved 63px under the
user's keys. With this change the right edge stays at 604 in every frame
and only the left edge moves.

**Fix.** A floating box now stands by the edges that hold it, one per
axis (`held` middleware in `floating.js`): on the axis its placement
stands it beside something, the edge facing it; on the other axis, the
edge its alignment names; and on an axis where the boundary shifted it
in, the edge against that boundary. `stand` writes those insets
(`right`, `bottom`, or `left`, `top`), in the page's plane as offsets
from the anchor and in the window's plane from the containing block, so
content growth moves only the free edges in the same layout pass, and
the next placement finds the same insets and writes nothing. The inline
thread card places itself with its own middleware under the default
`bottom` placement, so it still stands by `left` and `top`.

The comment box's placements above and below a passage were named
`top-end` and `bottom-end`, although its offset kept the box's start
edge fixed. They are now `top-start` and `bottom-start`, with the same
offset expressed from the start, so the placement names the edge that
holds the box and `held` can read it from there. The tests that read
`data-lf-placement` follow the rename.

**Evidence.** Before #1460, `tests/test_render_aim.py` with
`--run-nightly` watched shifts: against the merge base, the side-comment
carry error was the only change, and the 27 remaining errors were the
same "moved without input" reports main had, none from typing. Since
#1460 the nightly-marked tests no longer watch shifts, so that run is
the carry evidence. `npm run test:runtime` and `uv run pytest tests`
pass on the merged tree.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[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.

2 participants