Skip to content

Measure each tab's panel once in the phone aim sweep, and judge presses only in view - #4489

Merged
max-sixty merged 2 commits into
mainfrom
corpus-aim-sweep
Oct 27, 2026
Merged

max-sixty merged 2 commits into
mainfrom
corpus-aim-sweep

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

The phone-width aim sweep from #3902 re-measured the whole corpus after every tab it opened, and excused the tab strip's paging edge through an aria-hidden special case. This makes the sweep measure each control once and replaces the special case with the general rule it stood for.

Cost

short_aim_findings_in_every_tab read every control in the document and every shadow root after each of the corpus's 100 tab openings. flooredAims also ran aim() (three getComputedStyle calls and several point probes) on each control before it checked whether the control sat in a hidden panel. Now:

  • The sweep reads the whole page once, then after each opening reads only what that opening shows: the tab's panel and the runtime's chrome (body > .lf-chrome), which holds the margin entries for what the panel contains. flooredAims takes the roots to read.
  • flooredAims checks [hidden], visibility and pointer-events before it measures.
  • aim_selectors() is parsed once per sweep, not once per reading.

Measured locally, full corpus at 390x844 under touch, sweep only (shift watch off, as in the journey module):

whole sweep time in flooredAims
main 63.9 s 21.9 s
this branch 43.8 s 0.5 s

What's left is opening the tabs: rendered() after each one takes about 0.43 s, and this change doesn't touch it. CI's runner hasn't timed this yet.

Coverage. To check that coverage didn't change, I ran three variants with every reading reported, not only the short ones: main's loop with main's aims.js, main's loop with this aims.js, and this loop with this aims.js. All three gave the same 373 distinct readings (size, control, cover, owner). Reading only the panel misses the margin entries the chrome draws for a newly opened tab (10 readings), which is why the chrome is read too. One thing is no longer re-read: the outer tab strips in each scroll position later openings leave them in. The paging-edge rule below exempts those positions anyway.

The overlap rule

The tab strip's paging edge is an aria-hidden span inside the tablist ([data-lf-offer]), and it covers a tab scrolled beneath it. #3902 excused an aria-hidden box only when the control it belonged to contained the covered control. That condition describes exactly one widget.

The general rule is that a part of a control outside its scroller's view is reached by scrolling, just as a part outside the window is reached by scrolling the page. The checker already applied that rule to the window, through shown. viewOf(el) extends it to every scroller holding the control, the root included. A scroller's view is its scrollport minus its scroll-padding on each side it can still scroll toward. The scroll-padding is how Leaf already declares the band that sticky edges and headers cover: the strip's paging edge covers exactly its scroll-padding-inline, and the root's covers the head room and a page tab strip. The checker probes an edge of a face only where that side of the face lies wholly in view. In the corpus, #showTab lands the open tab 0.19 px into the edge's band, and the edge takes the press there.

Since a view is never larger than the window, the rule only removes probes. It can drop a finding but never add one, offeredAims included.

Checked on a synthetic page with both versions:

  • Tabs under a paging edge with aria-hidden: main and this branch both report nothing.
  • The same edge without aria-hidden: main reports 0x0 button under span twice; this branch reports nothing.
  • Two side-by-side buttons where one button's aria-hidden icon covers the other's edge (the review case from Hold every tab of the corpus to the finger floor at phone width #3902): both report 0x0 button under .icon.

Resize notices

The sweep had its own copy of navigate's rule for ResizeObserver notices: a first sighting is the platform's, and one that recurs on a confirming attempt is a fault. That rule is now render_harness.confirming_resize_notices(page, attempt, again=None), and both use it. One behaviour change: a recurring notice during the sweep is now reported through the browser fixture as a resize-loop finding with confirmation: recurred, as navigate reports one, not as a line in the sweep's own assertion. The test still fails.

test_file_editor_status_controls_take_a_finger_on_a_phone now reads only the file editor. With the editor's slot fix from #3902 reverted, it still fails with 44x32 lf-file-editor-retry.

Ran

  • The two test_page_navigation_*_resize_notice* tests, test_file_editor_status_controls_take_a_finger_on_a_phone and test_the_add_field_previews_the_option_it_will_make: passed.
  • The corpus sweep comparison above (a scratch test, not committed).
  • The journey's two aim readings (first tab at 1200px, then every tab at 390px) on the corpus, twice, with ResizeObserver notices left strict, in a scratch test: no findings and no stray notices, 43 s per sweep.
  • pre-commit on the changed files, pnpm run check.

Not run: tests/journeys/test_render_gate.py itself. The PR's test job doesn't select it, because --changed-since picks later-tier tests by edits to their own file, and this change leaves that file alone. The next daily run will run it.

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

…es only in view

The every-tab sweep read the whole corpus after each of its 100 tab
openings and measured controls before skipping hidden panels. It now
reads the page once, then each opening's panel and the chrome, and
checks hidden, visibility and pointer-events before measuring. Locally
the sweep went from 63.9 s to 43.8 s, with time in flooredAims down from
21.9 s to 0.5 s. All three variants give the same 373 readings.

The aria-hidden exemption for the tab strip's paging edge is replaced
by the rule it stood for: a part of a control outside a scroller's view
(its scrollport less its scroll-padding on sides it can scroll toward)
is reached by scrolling, as one outside the window is. A neighbouring
button covering another is still reported.

The sweep's copy of navigate's ResizeObserver notice rule is now
render_harness.confirming_resize_notices, shared by both. A recurring
notice in the sweep is reported through the browser fixture.
# Conflicts:
#	tests/browser/test_render_gate.py
@max-sixty
max-sixty merged commit b4202a2 into main Oct 27, 2026
4 checks passed
@max-sixty
max-sixty deleted the corpus-aim-sweep branch October 27, 2026 19:23
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