Skip to content

Find declared shadow roots from the stage registry, and row direction without style - #3266

Merged
max-sixty merged 2 commits into
mainfrom
agent-a45a53ae926c47daf
Oct 20, 2026
Merged

max-sixty merged 2 commits into
mainfrom
agent-a45a53ae926c47daf

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The corpus page's comment painted in 238 ms against the 100 ms budget (paired leaf-dev bench-latency --page corpus --transition comment, five runs, load 8–10 on 18 cores), and the server's reading reached the screen in 539 ms. leaf-dev profile corpus comment put most of that in script, not in the theme's :has() rules, which notes/browser-reactivity.md had blamed:

  • An obligation whose widget stands in an unopened thread message has no node in the document, so each elementById of its id fell through to shadowRootsIn, which queried the whole document for every x-shadow tag. Each atlas worker's goal and each read of where the user stands asks for every obligation's source, so one comment ran hundreds of those queries. shadowRootsIn now filters the stages' registry (liveStages, arrivals.js), keeping roots whose host is root or in root's own tree, as the query found them.
  • rowArrows read the computed direction, so each diff file's key availability recalculated style for whatever the frame's pass had written before it, up to 5,700 elements at a time. It reads :dir(rtl) now, which the dir attributes decide, as the theme's direction rules already do.

A declared root is now exactly a stage: declaredRoot also requires the root to be one (isStage), so the page reading, elementById and the composed-range capture agree about a root a module attached itself against module-authoring.md, and read its host by its own children. The drift test widget and three runtime tests built their roots that way and now stage them through shadowStage. arrivals.js imports under from shadow-tree.js, and the keyboard dispatcher's dependency-cruiser closure admits arrivals.js, which reaches only modules already in it.

Behavior change: a page that sets direction: rtl in CSS without a dir attribute now gets left-to-right arrows on its rows, matching how the theme already draws such a page.

After both, the same paired run reads painted 91 ms [83–98] and Sent 179 ms [171–190]. Sent is still over 100 ms; the note records what holds it. leaf-dev stills on the catalogue showed no visual change beyond the layer fingerprint in share-link; four other states that differed once read unchanged when recaptured on the final commit.

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

max-sixty and others added 2 commits October 19, 2026 23:20
… without style

The corpus comment painted in 238 ms (paired bench-latency, five runs, load
8-10 on 18 cores) against the 100 ms budget, and the server's reading
reached the screen in 539 ms. `leaf-dev profile corpus comment` put most of
that in script, not in the theme's `:has()` rules:

- An obligation whose widget stands in an unopened thread message has no
  node in the document, so each `elementById` of its id fell through to
  `shadowRootsIn`, which queried the whole document for every x-shadow tag.
  Each atlas worker's goal and each read of where the user stands asks for
  every obligation's source, so one comment ran hundreds of those queries.
  `shadowRootsIn` now filters the stages' registry (`liveStages`), keeping
  roots whose host is `root` or in `root`'s own tree, as the query found
  them.
- `rowArrows` read the computed `direction`, so each diff file's key
  availability recalculated style for whatever the frame's pass had written
  before it, up to 5,700 elements at a time. It reads `:dir(rtl)` now, which
  the `dir` attributes decide, as the theme's direction rules already do.

A declared root is now exactly a stage: `declaredRoot` also requires the
root to be one (`isStage`), so the page reading, `elementById` and the
composed-range capture agree about a root a module attached itself, against
module-authoring.md, and read its host by its own children. The drift test
widget and three runtime tests built their roots that way, and now stage them
through `shadowStage`. `arrivals.js` imports `under` from `shadow-tree.js`,
and the keyboard dispatcher's closure admits `arrivals.js`, which reaches
only modules already in it.

Behavior change: a page that sets `direction: rtl` in CSS without a `dir`
attribute now gets left-to-right arrows on its rows, matching how the
theme already draws such a page.

After both, the same paired run reads painted 91 ms [83-98] and Sent
179 ms [171-190]. `notes/browser-reactivity.md` records the finding, the
commands and what still holds Sent over 100 ms.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 7e9b015 into main Oct 20, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-a45a53ae926c47daf branch October 20, 2026 06:34
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