Skip to content

Restore three rules that native package scopes broke - #1785

Merged
max-sixty merged 12 commits into
mainfrom
fix-scope-broken-rules
Oct 5, 2026
Merged

max-sixty merged 12 commits into
mainfrom
fix-scope-broken-rules

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Three more rules that native package scopes (#1591) broke, each fixed where its owner's rule belongs and held by a test that fails with the fix reverted.

  • Quoted swipe queue (swipe/theme.css, 37839cd). The rule spacing a quoted deck's flat cards named the exhibit above the deck, which a scoped selector can no longer reach, so the cards touched (8px → 0px since Use native scopes for automatic package isolation #1591). It now scopes from the exhibit, as the package's other outside conditions do. New test: test_a_quoted_swipe_queue_spaces_its_flat_cards.
  • Playground presets band (playground/theme.css, 502b799). The rail-region header rule gained :scope's weight and out-ranked the presets band's own rule, dropping its 1px rule and 14px padding. Only a playground draws these regions, so the rule drops the scope prefix; a before/after style diff shows only that header changing.
  • Visual review captures (visual-review/theme.css, d6ae3da). .lf-vr-shot-host lf-shot { margin: 0 } now ties lf-shot's own margin and loses on scope proximity, so each capture sat 17px below the stage top instead of 1px. The rule names the review's scope root; its print override takes the same selector so it still wins by order. This is the review's stage, not the phone comment editor another session is repairing.

Found by diffing every element's computed style across the examples and fixtures before and after #1591 at desktop and phone widths, plus Chrome's matched-rules data for declarations that now win only by :scope weight or scope proximity. Three further weight flips have no visible effect today and are left alone. No static check is both clean and complete for this shape: whether a bare selector's ancestor matches depends on the DOM, and specificity flips on which elements two rules share.

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

max-sixty and others added 12 commits October 4, 2026 13:43
…has focus

Since native package scopes (#1591), a bare selector in a widget package's
sheet matches only descendants of a declared tag. The rule that sets
`--lf-ask-ring: none` on the decision around a focused `lf-options[choose]`
named the decision as `[data-lf-ask]`, so an `lf-ask` standing at the page's
top level, which is a widget root rather than a descendant of one, kept its
outer ring around a control that is already a frame: two rings for one fact.
The rule now matches the decision as a scope root or a descendant of one.

Behavior moved: with the keyboard inside a joined options control, only the
exact row draws the band, as before #1591. The three tests that pin it lose
their expected-failure markers.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The pane role's grammar (which row each child stands in, a body held to
the pane's width with no margin of its own) is meant to hold over what a
widget declares for itself. It relied on specificity for that. Since
native package scopes (#1591), a widget root rule is written
`:scope:is(lf-board)`, which ties the kernel's
`[data-lf-reading-role="pane"] > :not(header, footer)` on specificity and
then wins on scope proximity. So the board's `min-inline-size` beat the
body's `min-width: 0`: in the feature gallery at 1024px the Follow-ups
board stood 201px outside its pane and 177px past the root scrollport.

The four grammar rules move from the kernel's theme.css (lf-base) into
layouts.css's lf-layouts tier, which ranks above every package whatever
the selector. The look stays a `:where()` default in theme.css.

Behavior moved: a widget that is a pane's body is held to the pane's width
and block margin again; a board there scrolls its columns inside the pane.
The render-gate test that pins it loses its expected-failure marker.

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

Pressing Resolve on a page thread re-renders it without the button, so focus
falls back to the thread itself through `landInThread`. That landing reveals a
box that is not wholly in view with `scrollIntoView({block: "nearest"})`
(#1571), and a thread taller than the window is never wholly in view: nearest
aligns its head with the window's top, so a twelve-message thread jumped the
page 689px away from where the user had pressed.

A box longer than the window along an axis now counts as shown there when any
of it is in view, since no scroll could show it whole. A box that fits is
still revealed whole, so entering a reply at the window's foot still brings
its writing area up.

Behavior moved: resolving a long page thread by its button leaves the page
where it was; the two parametrized cases lose their expected-failure marker.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The marker recorded an intermittent stale style on main ef89dfd: the
accepted `lf-old` kept painting with `data-lf-retired` set. It no longer
reproduces: 3 of 3 serial runs and 18 of 18 `leaf-dev flake` copies pass
on 777bdb1, and Linux CI XPASSed it on f64b3e0. #1719 lifted the same
stale-style family's other quarantines on the same evidence.

Behavior moved: none; the test asserts the hidden slot again.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`presentPage` stamps `data-lf-presented`, which opens interaction, and then
dispatches PRESENTATION, the one event in which box-derived apparatus
replaces its provisional startup reading. Since #1605 awaited the arrival
landing between the two, the stamp's turn ended before PRESENTATION ran, so
whatever ran there (a `presented` waiter, an observer of the stamp, or a
frame where the landing waits on an editor) read the contents map's authored
spans: 203px for a section replay had grown to 611px.

PRESENTATION now runs after the landing's synchronous part, as it did
before #1605, and the landing is still awaited before the version notice.

Behavior moved: when the page reads as presented, the contents map already
spans the replayed sections. The test that pins it loses its
expected-failure marker.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The long and very-long page-mark arrivals were marked for cutting a glyph
under the pinned heading (main ef89dfd). That stopped with #1715, which
starts a long arrival at the latest turn's head. The test's list of block
boundaries held thread children and paragraphs but not turns, so a landing
on the latest message's head read as a cut through a content block, though
no text line straddles the heading (the `crossedLines` reading is empty).

The boundary list now includes each transcript turn and checkpoint. A
landing mid-paragraph still fails both readings.

Behavior moved: none in the product; both cases lose their
expected-failure marker.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Since native package scopes (#1591), a bare selector in a widget package's
sheet is implicitly relative to its scope root and reaches only that
root's descendants. The rule that gives a quoted (exhibited) deck's flat
queue its card gap named the exhibit, which stands outside the deck, and
the deck itself, which is the scope root, so it matched nothing: the
cards of a quoted queue touched. The rule now names the exhibit in a
nested scope around the deck, as the package's other outside conditions
do.

Behavior moved: a quoted queue's cards stand --sp-2 apart again, as
before #1591; a new test pins the gap.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Native package scopes (#1591) rewrote the rail regions' header, body and
footer rules from `lf-playground :is(...) > header` to
`:scope:is(lf-playground) :is(...) > header`, and `:scope` weighs a class.
The generic region header (now 0,2,2) began outranking the presets band's
own rule (`.lf-playground-controls-region > .lf-playground-presets`,
0,2,0), so the band heading the controls lost its bottom rule and 14px
padding, and the first control row butted against the preset buttons.

Only a playground draws these regions, so the three rules drop the scope
root and keep the weight their author gave them. A computed-style
comparison over the notification and code-comparison playgrounds shows
the presets header as the only element that changes, back to its
pre-#1591 box.

Behavior moved: the presets band is ruled off from the controls again;
the regions test now pins its bottom rule and padding.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The stage's rule for the lf-shot it holds (`.lf-vr-shot-host lf-shot`,
margin 0) used to outrank lf-shot's own root rule (`lf-shot`, margin
16px 0) by a class. Since native package scopes (#1591) that root rule
is `:scope:is(lf-shot)`, which ties the stage's rule, and a tie goes to
the nearer scope root, which is the lf-shot itself. So every capture
stood 16px below the stage's top edge with 16px more beneath it, inside
a stage of fixed size.

The stage's rule now names its own root, as the review's other stage
rules do, and outranks the capture's root rule again. Its print
override takes the same selector so it still wins by standing later.
A computed-style comparison over the visual-review gallery shows only
the three captures' block margins changing, back to 0.

Behavior moved: a capture opens at its stage's top edge again; the
gallery workspace test pins it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit c8e5ccb into main Oct 5, 2026
4 checks passed
@max-sixty
max-sixty deleted the fix-scope-broken-rules branch October 5, 2026 02:03
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