Repository navigation
Measure each tab's panel once in the phone aim sweep, and judge presses only in view - #4489
Merged
Merged
Conversation
…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
leaf-agent
approved these changes
Oct 27, 2026
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.
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-hiddenspecial 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_tabread every control in the document and every shadow root after each of the corpus's 100 tab openings.flooredAimsalso ranaim()(threegetComputedStylecalls and several point probes) on each control before it checked whether the control sat in ahiddenpanel. Now:body > .lf-chrome), which holds the margin entries for what the panel contains.flooredAimstakes the roots to read.flooredAimschecks[hidden],visibilityandpointer-eventsbefore 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):
flooredAimsWhat'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 thisaims.js, and this loop with thisaims.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-hiddenspan inside the tablist ([data-lf-offer]), and it covers a tab scrolled beneath it. #3902 excused anaria-hiddenbox 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 itsscroll-paddingon each side it can still scroll toward. Thescroll-paddingis how Leaf already declares the band that sticky edges and headers cover: the strip's paging edge covers exactly itsscroll-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,#showTablands 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,
offeredAimsincluded.Checked on a synthetic page with both versions:
aria-hidden: main and this branch both report nothing.aria-hidden: main reports0x0 button under spantwice; this branch reports nothing.aria-hiddenicon covers the other's edge (the review case from Hold every tab of the corpus to the finger floor at phone width #3902): both report0x0 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 nowrender_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 aresize-loopfinding withconfirmation: recurred, asnavigatereports 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_phonenow reads only the file editor. With the editor's slot fix from #3902 reverted, it still fails with44x32 lf-file-editor-retry.Ran
test_page_navigation_*_resize_notice*tests,test_file_editor_status_controls_take_a_finger_on_a_phoneandtest_the_add_field_previews_the_option_it_will_make: passed.pre-commiton the changed files,pnpm run check.Not run:
tests/journeys/test_render_gate.pyitself. The PR'stestjob doesn't select it, because--changed-sincepicks later-tier tests by edits to their own file, and this change leaves that file alone. The next daily run will run it.