Skip to content

Lift the feature gallery's margin quarantines - #1719

Merged
max-sixty merged 3 commits into
mainfrom
agent-aa0d9e5f16d7d5055
Oct 4, 2026
Merged

max-sixty merged 3 commits into
mainfrom
agent-aa0d9e5f16d7d5055

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Both quarantines from notes/margin-stuck-style.md now pass under load, so they assert again. The gallery actions journey (test_the_feature_gallery_keeps_its_real_actions_reachable) loses its non-strict xfail, and the pin round trip (test_a_decision_undone_leaves_every_suggestion_pin_where_it_stood) loses its conditional xfail, so a rejected insertion that stays painted fails the test outright.

Measured on 379cfea with load averages between 16 and 48 on 18 cores:

  • The actions journey passed 3 of 3 plain runs at every width with --runxfail, and 18 of 18 leaf-dev flake copies at both 1440 and 1200px. The note recorded 3-6 of 18 failing at 1440px.
  • The pin round trip passed 3 of 3 plain runs with --runxfail, and 18 of 18 flake copies, none of them reaching the retirement xfail. The note recorded 15 of 18 reaching it at 0859381.

The actions xfail was last verified failing at ef89dfd, which predates #1687. That change stopped hiding an emptied suggestion with display: none, which matches the 0x0 suggestion after Undo, so #1687 is the likely fix; this is inferred, not bisected. Which later commit cleared the stale style on the rejected insertion was not bisected either, and the note's stuck-style probe harness was not rerun.

The note is deleted with its TODO bullet, since nothing it describes still reproduces.

--nightly-changed-since, which both landing gates use to add the nightly tests a change edits, read a pure deletion as only the line before the gap. Deleting a test's decorators therefore selected nothing, and the first CI run of this PR left the gallery actions journey out. A deletion now counts the lines on both sides of it, so removing a test's decorators or its last lines both select the test.

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

max-sixty and others added 2 commits October 4, 2026 08:09
Both quarantines from notes/margin-stuck-style.md now pass under load, so
they assert again. The gallery actions journey
(`test_the_feature_gallery_keeps_its_real_actions_reachable`) loses its
non-strict xfail, and the pin round trip
(`test_a_decision_undone_leaves_every_suggestion_pin_where_it_stood`) loses
its conditional xfail, so a rejected insertion that stays painted fails
the test outright.

Measured on 379cfea with load averages between 16 and 48 on 18 cores:

- The actions journey passed 3 of 3 plain runs at every width with
  `--runxfail`, and 18 of 18 `leaf-dev flake` copies at both 1440 and
  1200px. The note recorded 3-6 of 18 failing at 1440px.
- The pin round trip passed 3 of 3 plain runs with `--runxfail`, and 18 of
  18 flake copies, none of them reaching the retirement xfail. The note
  recorded 15 of 18 reaching it at 0859381.

The actions xfail was last verified failing at ef89dfd, which predates
#1687; that change stopped hiding an emptied suggestion with
`display: none`, which matches the 0x0 suggestion after Undo. Which later
commit cleared the stale style on the rejected insertion was not
bisected. The note's stuck-style probe harness was not rerun.

The note is deleted with its TODO bullet, since nothing it describes still
reproduces.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 4, 2026
The landing gates' --nightly-changed-since read a pure deletion as the line
before the gap, so deleting a test's decorators selected nothing: this PR's
removal of the xfail on test_the_feature_gallery_keeps_its_real_actions_reachable
left the test out of CI's test job. A deletion now counts the lines on both
sides, which selects the test whether its decorators or its last lines went.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit b020599 into main Oct 4, 2026
4 checks passed
@max-sixty
max-sixty deleted the agent-aa0d9e5f16d7d5055 branch October 4, 2026 18:34
max-sixty added a commit that referenced this pull request Oct 6, 2026
…1901)

A decided suggestion could keep showing its retired words: the slot
carried `data-lf-retired`, the `state.css` rule applied, and Chromium
still computed `display: inline`. The style was stale. The operation
that left it stale was a forced style read inside a hidden tab panel,
made by `bounds.js` from a MutationObserver.

## Cause

On every content change of a bounded block (`data-lf-bound`),
`hold.sync` found the block's scroller by calling `getComputedStyle` on
every box inside it (`scrollerOf`). The feature gallery's "Page &
layout" tab holds bounded logs, and an inactive tab panel is
`hidden="until-found"`, which is `content-visibility: hidden`. Each read
forced Chromium to style that skipped subtree. A Chrome
invalidation-tracking trace of a failing run shows the sequence:

- a row is added to a log in the hidden panel, and `:has()` invalidation
marks `#bg-gallery-tabs` for a subtree restyle and `main` for a local
one;
- in the same task, `declaresBound` reads style inside the panel, which
forces a display-lock style update (1011 such reads in a failing run,
against 1 in a passing one);
- that update restyles neither `main` nor `#bg-gallery-tabs` and clears
the dirty bits above them, so `#bg-gallery-tabs` stays dirty with
nothing pointing at it;
- every later write under it is never restyled, including the reject's
`data-lf-retired` on `#bg-insert lf-new`. `#bg-gallery-tabs` is never
resolved again for the rest of the run.

The forced pass orphaning a dirty ancestor is a Chromium defect. I could
not reduce it to a page without Leaf.

## Fix

- `bounds.js`: `sync` asks `skipped(bounded)` first, as geometry.js's
other readers of skipped content do. A skipped block keeps the scroller
it had, or stands as its own, and renews its size observation. The first
delivery after the block is drawn syncs again, so an `end` log that grew
while hidden opens on its newest entry.
- `reach.js`: `paintReadingReach` and `paintSidewaysReach` check
`unpainted` themselves. Review found that a bounded block arriving in a
hidden panel registered as a reading region and had its downward cue
painted at once, reading `overflow-y` and scroll extents in skipped
content from the same MutationObserver.

## Evidence

- Issue journey
(`test_a_decision_undone_leaves_every_suggestion_pin_where_it_stood`),
on macOS Chromium 153: at 0e52b1b it failed 25 of 32 copies, and 0 of
20 with the `bounds.js` change applied there.
- Main stopped reproducing after #1880 removed a non-subject `:has()`
rule (bisected over the 18 commits from 0e52b1b). That rule supplied
the pending subtree invalidation. Adding a no-op rule of the same shape
back to `chrome.css` (`.lf-zz-a:has(> .lf-zz-b) * {}`) fails 8 of 10
copies on main, and 0 of 20 with this change.
- New test `test_logs_in_a_hidden_tab_open_on_their_newest_entries`
grows one bounded log in a hidden tab, adds a second, and checks that
neither has its style or scroll extents read while the tab is hidden,
then that both open at their newest entry, twice. It fails without the
`bounds.js` change, without the `reach.js` change, and without the
renewed size observation.
- The tests that exercise bounded blocks, reading regions, and reach
cues (71 cases) pass, as does `npm run test:runtime`.
`test_render_controls.py::test_each_sampled_focus_ring_is_shown_whole_in_its_surface`
fails on current main without this change too.

## A more underlying fix?

Unverified. Other runtime readers still force style or layout in hidden
panels: `shownParts` for target paint (deliberate, per geometry.js's
header), `readingPosture` in `recordRegions` and `scrollersSettled`,
`margin-layout.js`'s `scrollFollows`, and `user-view.js`'s `seenRect`.
With this change and the provoking `:has()` rule, the issue journey
stopped failing (0 of 20), so none of them was seen to leave style
stale. The run that would settle it is a journey that makes one of them
read a hidden panel while an ancestor holds a pending `:has()` subtree
invalidation. Its candidate fix is for those primitives to answer
skipped content themselves (a last-seen scroller, an empty shown set)
instead of each caller asking `skipped` first. History read:
`notes/margin-stuck-style.md` (#1506, #1695, #1719), #1834 and #1880.

Fixes #1868

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

---------

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