Skip to content

Seat margin pins past a display: contents child by what it draws - #7487

Merged
max-sixty merged 1 commit into
mainfrom
margin-contents-span
Nov 28, 2026
Merged

max-sixty merged 1 commit into
mainfrom
margin-contents-span

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Requested by Maximilian · project thread

The margin's child index (childIndex, margin-layout.js) treated a child with no box as meeting every band. Every pin's seat walk (coverIn) then descended into each display: contents child it passed. Every light widget that defineWidget draws stands in such a box, so each Effect UI port made the walk read more of the page per pin.

The index now gives a boxless child the union of what it draws (drawnSpan): its words' line boxes and its boxed descendants, reached through any boxless ones. The child then meets only the bands that reach that, and a child that draws nothing meets none. The walk below the child doesn't ask skipped again: the child's own answer covers what it holds, and asking it of a boxless element climbs every ancestor.

shown-box.ts said no widget displays as contents, which the adapter's light box made untrue.

Bench

leaf-dev bench drafts cards --sizes 64,256 --read cpu --input key --rounds 5 --base origin/main, load CPU at 256, in ms:

page base min / median head min / median
drafts 3019 / 3198 2876 / 2930
cards 2170 / 2324 2173 / 2365

lf-card is still a plain element on main, so the cards page holds no such box and stays flat. On drafts, a V8 profile of an earlier cut of this change moved coverIn from 708 to 555 ms (profiled) and stuckShift from 218 to 108 ms. That cut also asked skipped of each descendant, and drawnSpan cost 137 ms, mostly those skipped calls; the final version drops them.

Checks

  • pnpm run check passes.
  • tests/runtime/margin-placement.test.mjs: 27 pass.
  • tests/browser/margin/: 302 pass. The 13 WebKit cases fail because no WebKit build is installed on this host. Three Chromium cases fail and one errors on origin/main too, with this change reverted:
    • test_a_growing_draft_under_its_words_holds_the_editor_s_top
    • test_threads_on_two_parts_of_a_picture_stand_an_entry_each_tracing_its_part
    • test_a_pin_keeps_clear_only_of_controls_the_user_can_see
    • the error: test_suggestion_actions_stay_reachable_through_a_decision_and_its_undo

🤖 Generated with Claude Code

https://claude.ai/code/session_01V22NWd3erndyoj2G9LEP7y

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


Generated by Claude Code

The margin's child index let a child with no box meet every band, so every
pin's seat walk descended into each `display: contents` child it passed.
Every light widget `defineWidget` draws stands in such a box, so each
Effect UI port made the walk read more of the page per pin. The index now
spans a boxless child by the union of what it draws (`drawnSpan`), and it
meets only the bands that reach that; one that draws nothing meets none.

shown-box.ts said no widget displays as contents, which the adapter's light
box made untrue.

Bench, load CPU at 256, 5 interleaved rounds, min / median, base main:
drafts 3019 / 3198 -> 2876 / 2930 ms; cards 2170 / 2324 -> 2173 / 2365 ms
(lf-card is still a plain element on main, so cards holds no such box).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V22NWd3erndyoj2G9LEP7y

Copy link
Copy Markdown
Owner Author

test failed in "Check website deployment": building the website image, uv sync couldn't download mdurl==0.1.2 after 3 retries. That's a network failure. This PR changes only margin-layout.js and a comment in shown-box.ts, and touches no dependency or deployment file. I can't re-run the job from here, because the token lacks Actions write access.

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


Generated by Claude Code

@leaf-agent

Copy link
Copy Markdown
Collaborator

Re-ran the failed jobs of that run (attempt 2); test is running again.

@max-sixty
max-sixty merged commit cd2495a into main Nov 28, 2026
11 of 12 checks passed
@max-sixty
max-sixty deleted the margin-contents-span branch November 28, 2026 06:09
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.

3 participants