Repository navigation
Hold the chrome's scope and the focus rings as properties, not census lists - #1759
Merged
Merged
Conversation
test_a_coined_class_cannot_reach_the_chromes_rules now asserts only its contract: an element in the page wearing every class the chrome's private @scope rules name renders exactly as its unclassed twin, and an authored lf-msg-body keeps the document's selection behaviour. Dropped: the two exact lists of class names that some document-level rule also names (the runtime sheet's globals and the authored theme's faces). Every one of its ~45 edits since September followed a deliberate rename or restyle, and it failed on main as "the authored-theme class surface changed" without a user-facing defect behind it. Which names form the shared vocabulary is chrome.css's to say and review's to judge; the probe still excludes them, derived from the sheets rather than listed. What moved out of the suite: a private rule written outside the @scope block is no longer caught here, since its class joins the derived exclusion. Fault control: widening the scope root to `@scope (.lf-chrome, main)` fails the test with the leaked properties. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The three test_the_ring_reading_sees_* tests are fault controls for the ring reading (RINGS_DRAWN) that the ring samples and other focus tests rest on. Each asserts the reading's contract, not the product's shape: - a ring cast as a shadow is counted and measured, and a lift, an inset wash and a wider band are not; - a positioned neighbour held by a static box beside a control that names no z-index is reported over its ring; - a band over an inset ring is reported, because the reading's step in clears the ring's own band. What was brittle was the arrangement. The inset case found its carrier in whichever product control drew an inset ring (a thread, then a run heading, then a thread title), and the neighbour case needed an open thread card's button; each product change moved them. They and the shadow case now plant their control on RING_PROBE_PAGE, a page with one paragraph and one button, instead of release-notes or an opened Threads panel. The inset plant widens the band to 4px, since a one-pixel step from the middle of a 2px band lands on its inner edge, where hit testing decides by rounding. Fault controls, each planted in focus_rings.js and reverted: shadowBand returning 0 fails the shadow case; ranking a hoisted neighbour by its static holder fails the neighbour case; a step of `grow + 1` fails the inset case. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
test_every_base_corpus_tab_stop_has_a_visible_focus_indicator is kept: it is the property form of "the user can see where the keyboard is", asked of every stop in each sampled page's Tab order, with no list a new control has to join. The ring samples overlap it only on the ~25 page-scope stops whose visibility both read; the samples add ring geometry and keyed surfaces the walk cannot reach, and the walk adds every stop the samples skip. Its cost was the walk: ~590 stops, each a key press plus two evaluates (newStop, then seenStop). One evaluate now returns both, which drops one CDP round trip per new stop; measured under load, the second evaluate was ~13% of the walk. Fault control: `.lf-status-button`'s ring set to `outline: none` fails the walk on every page with the status button named. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… ring test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus is now test_each_sampled_focus_ring_is_shown_whole_in_its_surface. It still walks RING_CASES through each keyed surface and holds every ring drawn at each sample to being whole (not cut by a clipping box, not under a neighbour), the sample's focus to being visible, each surface to opening, and each sample to exhibiting its named ring. Dropped: the census closure that made every ring name declared anywhere in the composed stylesheets need a sample (`unlit`), the cross-check that painted names were declared, and the non-empty population assertion. That closure is a list each new ring had to join; RING_CASES' edits since September were mostly samples added or renamed to satisfy it. Kept as properties every ring rule must satisfy: a rule that draws the ring names it (--lf-focus-ring), read from the stylesheets and from the paint. The samples, and the readings that credit a ring an ancestor wears, rest on the name, and theme.css says the suite holds the layer to it. Also: wt-merge's pane body no longer scrolls at 1200x700 since the workspace's working density (#1697), so its sample timed out waiting for a tab stop on main and the test never reached its final assertions. It is now read at 1200x600, where the body scrolls and takes a stop. Fault control: the version row's inset ring moved to `outline-offset: 6px` fails the test with the ring cut 4px outside the versions menu. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
marked this pull request as draft
October 4, 2026 22:00
leaf-agent
reviewed
Oct 4, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The new shared set includes every unscoped selector in chrome.css. If a private rule such as .lf-live moves outside @scope, collect adds lf-live to shared, worn excludes it, and the twin comparison stays green while an authored element wearing that class can be clipped. That is the scope leak this test was meant to catch. Keep a guard on newly unscoped private rules, with the shared vocabulary declared by its owner so the test does not need another hand-maintained exception list.
max-sixty
marked this pull request as ready for review
October 5, 2026 03:07
…y other test_a_coined_class_cannot_reach_the_chromes_rules derived the probe's exclusions from every class an unscoped chrome.css rule names, so a private rule moved outside `@scope (.lf-chrome)` excluded its own class and the twin comparison stayed green while a page element wearing that class met it. runtime/stylesheets.js, which constructs the chrome sheet, now exports `chromeSharedClasses`: the classes with which that sheet may reach the page. The test reads it and requires the classes named outside the @scope block to equal it, so a leaked private rule fails, and widening the vocabulary is an edit to that declaration rather than to the test. The probe's exclusions are the declaration plus the faces other document sheets state, so a leaked class is also worn by the probe. The sheet's text and cascade are unchanged; chrome.css's header points at the declaration. Fault controls: `.lf-live` moved outside the @scope block fails with "name classes the sheet does not declare shared ... ['lf-live']"; the scope root widened to `(.lf-chrome, main)` still fails the twin comparison. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 5, 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.
Commits kept editing these tests to add a class or ring name to a list, or to follow a product control the test had borrowed. The coined-class test alone was edited 17 times since Sep 14 and failed on main in 5 runs with "widen the exception on purpose". Each test now asserts the property the list stood for.
Changes
test_a_coined_class_cannot_reach_the_chromes_rules: drops both hand-written class lists (~75 names). It still checks that an element wearing every class the chrome's@scoperules name renders exactly like its unclassed twin. The classes shared with document-level rules are now read from the stylesheets, not listed. Fault control: widening the scope root to(.lf-chrome, main)fails it. A private rule moved outside@scopestill fails it: the classes chrome rules may name outside the block are declared at their owner,chromeSharedClassesinruntime/stylesheets.js, and the test refuses any other class there, and any declared class no such rule names. Fault control: moving.lf-liveoutside@scopefails it.test_the_ring_reading_sees_*tests: each now plants its ring shape on a two-line page (RING_PROBE_PAGE). Before, each borrowed a product control (thread card → run heading → thread title), and every move broke it. The inset case widens the ring to 4px, because a one-pixel step into a 2px band comes down to rounding. A separate fault infocus_rings.jsfails each one.test_each_sampled_focus_ring_is_shown_whole_in_its_surface: drops the requirement that every declared ring name have a sample, the list every new ring had to join. It keeps the rule that every rule drawing the ring names it with--lf-focus-ring. It also fixes a sample that timed out on main every run since Give a workspace the window, with working density as a style #1697: the wt-merge pane no longer scrolls at 1200×700, so that sample is now read at 1200×600. Fault control: a 6pxoutline-offseton the version row fails with the ring cut outside the menu.test_every_base_corpus_tab_stop_has_a_visible_focus_indicator: kept, since it already states a property. It now makes one browser round trip per Tab stop instead of two (~590 stops). Fault control: removing.lf-status-button's ring fails the walk.theme.css,shadow.cssandthread-list.jsnow name the ring samples instead of the old "corpus floor".Timing
These local times were taken under heavy machine load (load average 170–310), so they only compare roughly: