Repository navigation
Conversation
…aces outrank it #830 moved the rules that refine `.lf-ui` into shadow.css, which the composition puts ahead of theme.css, so `.lf-ui` came after them and won at equal specificity: a composer's send glyph drew ink instead of the accent. `:where(.lf-ui)` ranks it below every component rule wherever the composition puts it, and keeps it out of declared shadow trees, where lf-diff's code lines wear `lf-ui` and take their face from the host. test_a_coined_class_cannot_reach_the_chromes_rules enumerates the class surface #830 changed on purpose: the aim floor's seven controls join it, and the chip, margin entry, reaction surface and trigger icon leave with the chrome rules #830 removed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…t one place #847 put `.lf-ui` at the head of shadow.css, which also carried it into lf-diff's shadow tree: the line numbers, hunk separators and toolbar labels wear `lf-ui` there and took the control's 14px sans ink instead of the widget's face. `:where(.lf-ui)` in theme.css ranks it below every component rule wherever the composition puts either, and keeps it out of declared trees. #847's ownership walk also admitted a container's move of a part that records its own position, which the browser folds into two maps. The door refuses that move now. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
:where() removes the face's rank against the page's own <style>, not only against the layer's component rules. The cascade has no way to say "lose to the layer, beat the page", so dropping to zero specificity hands every page-local element rule authority over widget-injected controls.
Measured on examples/corpus.html served with <style>button, a { font-family: cursive; color: rgb(255,0,0); }</style> added to its head — an ordinary page-local rule for the page's own links and buttons:
| tree | button.lf-ui / a.lf-ui taking the page's face |
|---|---|
a6c73f3d (this PR's merge base, #847) |
0 of 264 |
fba18ee3 (before #847) |
0 of 264 |
8b748a8b (this PR) |
131 of 264 |
A component's own class rule is no defence, because it holds only the properties it states: .lf-ref states color and font-size, so its font-family goes to the page's a rule, and .lf-btn, .lf-compose-submit, .lf-react and .lf-board-destination move the same way. This is the failure runtime/chrome.css already names from the other side — "the 💬 button shipped that way, at 17px" in the @layer lf-reset comment, and test_the_adopted_sheet_decides_nothing_by_standing_last's "what the runtime lays over the page has to beat page and widget alike". The PR reopens it through the page's <style> rather than through sheet order, and the same blind spot applies: nothing reads a rule that never applied, so no case in the suite serves page CSS that collides with the chrome face.
Everything else holds. The lf-diff correction and the new door clause are both sound, and the finding is only the specificity.
Two directions that keep #847's fix without the page-side cost, both more than a one-line change — which one the layer wants is your call rather than mine:
- Give the default a composition slot of its own. A per-root sheet that
composed_sheetslands at the head of/theme.cssand does not copy into declared trees is the fourth option the newtheme.csscomment doesn't consider. It restores rank by position — #847's correct instinct — while keepinglf-diff's tree clear and the page outranked. - Split the marker from the face.
lf-diffaddslf-uito Pierre's line numbers and separators as a marker — "useful chrome, but not source a comment can quote" — and the face follows only because one class answers both questions. A separate face class on whatoffer()builds lets.lf-uikeep class specificity and never reach vendored nodes.
How both readings were taken
Through the suite's own serve fixture, so the assets under test were each tree's own, with open_page waiting for presentation and upgrade. Worktrees at fba18ee3 and a6c73f3d ran the identical probe.
The page-CSS reading copied examples/ to a temp root, inserted the <style> above into corpus.html's head, then counted button.lf-ui, a.lf-ui whose computed font-family resolved to cursive. The 131 span 28 class combinations, the largest lf-board-destination (30), lf-compose-submit (16), lf-btn small (10), lf-ref (9), lf-request-press (9).
The second reading walked document and every shadowRoot under it for .lf-ui, recording computed family, size, line height and colour. Against fba18ee3 the readings are identical on corpus.html (1007 elements), pr-walkthrough.html (193) and command-hub.html (178) — so the lf-diff correction lands where the description says and nothing else moved. lf-diff is the only shipped widget declaring x-shadow, and no shipped registry declares a widget-unit position record, so the new door clause refuses nothing that ships; it reads correctly against projection/model.js, where a self-position folds into the shared positions map and a part position into the owner facet's own map.
`:where(.lf-ui)` dropped the face below the page's own element rules as well as the layer's: a page's `button, a` rule took the family and ink of 131 of corpus.html's 264 widget controls. The rule returns to #847's position at the head of shadow.css with a class's specificity, and `:where(:root) .lf-ui` keeps it out of declared trees, where lf-diff's line numbers and separators take their face from the host. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
One point left, on the door clause rather than the face.
The new ownership rule is not written where a package author reads it. $state.record in assets/registry.json is the contract for what a position record means, and scripts/leaf/layer-registry.md sends its reader there — "registry.json remains the source of truth for the current custom vocabulary and its explanations; this contract does not mirror that inventory." That description already carries the neighbouring rule: Within one tag and unit, body and position are each one physical slot; value slots are keyed by their host attr, and attribute-set slots by their descendant attr. Distinct facets cannot claim the same slot. An author reading it concludes a card's own placement facet and a board's move are distinct slots on distinct tags — which is exactly the arrangement the door now refuses.
Nothing earlier tells them otherwise. In the new test the self-positioning arrangement publishes clean — publish(page_dir) asserts activated.error is None — so the first word of the rule arrives as a 400 on a reader's press, in a message that names ownership (position record unit 'card' is not owned by action widget 'board') when the cause is the card's own contract. CLAUDE.md's Working on the repository asks that the implementation, tests, and the owning protocol or reference stay aligned, and its Repository map puts a landed design's contract beside the code or into the public reference whose reader acts on it. Right now the rule lives in the door's own comment and a test docstring.
Extending that slot paragraph by a sentence is the whole fix — a node has one place across tags, so a container's part position is refused where the node's own contract records its position. Happy to push it, with a distinct message for the self-positioning branch, if you want it here rather than in a follow-up.
Selection run against the merged tree
tests/test_interact_layer.py and tests/test_interact_contract.py whole: 449 passed, 3 skipped. The one failure, test_staged_writes_honor_umask_without_copying_a_replaced_symlink_mode, is this sandbox's umask and touches nothing in the diff. Then test_a_diff_is_colored_by_each_files_own_path and test_a_pages_own_element_rules_leave_the_layers_controls_alone under --run-nightly, both green.
One thing the face scoping does not cost, which I had expected it might: the layer's own conversation seated inside lf-diff's root keeps the chrome face. Reading a diff with a standing comment on app.py · new line 2, .lf-say.lf-ui, .lf-compose-submit and .lf-receipt.lf-ui all compute system-ui at 14px in rgb(28, 27, 24) — their shadow.css component rules state the face themselves, so scoping the default out of the tree changes none of them. :where(:root) holds in the export too: /shadow.css goes in verbatim as a <style> per root (shadow.js's readShadowRules into shadow-stage.js), and version export writes that same markup as a declarative shadow root, so no element under it descends from :root in either medium.
…aces itself `$state.record` in the kernel registry said body and position are each one slot within a tag and unit, which reads as leaving a card's own placement and a board's move of that card as separate slots. It now says a node has one place across tags as well. The door's refusal for that case names the cause, the part's own position record, rather than ownership. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
@leaf-agent Taken in 7ed8041, so there's nothing to push.
|
|
Confirmed on The sentence lands in the contract an author actually reads: Ran the position selection in |
#847 fixed the seven nightly failures on
main. Two of its choices have effects no test covered. Both are measured here, and both are corrected without reopening those failures.The control face reached
lf-diff's shadow tree#847 restored
.lf-ui's rank by moving it to the head ofshadow.css, the earliest part of the composed page sheet.shadow.cssis also copied into every declared shadow tree, and insidelf-diff's,offer()marks more than controls. The line numbers, hunk separators and toolbar labels wearlf-ui, and until #847 they took the widget's own face. Now they take the control's. Line numbers go from 12.5px monospace in the diff's added, removed and context colours to 14px sans ink. Rows grow from 19px to 20.3px, and the toolbar labels grow from 11.5px muted to 14px ink. In all, 76 of the 199.lf-uifaces inexamples/pr-walkthrough.htmlchange, and leaf.page has served this sincepublish-sitedeployed #847.The rule keeps #847's position and its class specificity, and its selector is now
:where(:root) .lf-ui. A declared tree copies the rule, but none of its elements descends from the document's root, so it matches nothing there. In the document it matches every element it did before, at the same rank. So the face still stands before every component rule, and Send keeps the accent. It still outranks the page's own element rules, andlf-diff's nodes keep their host's face.An earlier revision of this PR used
:where(.lf-ui)intheme.cssinstead. leaf-agent's review measured what that costs: with no specificity, a page's ownbutton, arule took the family and ink of 131 of corpus.html's 264 widget controls.Measured against the commit before #847, the computed family, size, line height and colour of every
.lf-uielement at rest are unchanged, in the document and in shadow trees, onexamples/corpus.html(1013 elements) andexamples/pr-walkthrough.html(199). With<style>button, a { font-family: cursive; color: red }</style>in corpus.html's head, 0 of its 264 widget controls take the page's family, the same as onmain.Three readings pin the three properties, and each fails only on the variant that breaks its own:
test_a_diff_is_colored_by_each_files_own_pathnow asserts that every line number wears its own file's code face. It fails on a plain.lf-ui.test_a_pages_own_element_rules_leave_the_layers_controls_aloneserves a page with that rule and reads a board's controls. It fails on:where(.lf-ui).test_the_injected_control_face_is_a_default_only_the_document_readsreplaces Put the control face back ahead of the rules that override it, and let a container move a part that records its own facets #847's position test. It requires this rule to be the layer's first face and the face's only statement, and fails on both variants.skills/leaf/assets/CLAUDE.mdsays the same beside its description ofshadow.css.A part could have two position authorities
#847 starts the ownership walk above the part, so a container can place a part that records a facet of its own, which is what the nightly case needed. The same change also admits a container's move of a part whose own contract records its position. The browser folds the two into different maps (
projection/model.js), so it would place one node twice. The door now refuses a container's move of a part that positions itself: a node has one place, and the widget that records it is the node itself when its contract records its position, otherwise the nearest recording widget above it.test_the_widget_that_records_a_parts_position_is_the_one_that_places_itposts a boardmovethrough/api/eventagainst three registries. A card that records a facet of its own is admitted. A column that records, standing between the board and the card, is refused, and so is a card that records its own position. Dropping the new clause admits the third. No shipped package declares any of these arrangements.The rule is stated where a package author reads it:
$state.recordinskills/leaf/assets/registry.jsonalready said that body and position are each one slot within a tag and unit, and now says that a node has one place across tags as well. The refusal names that cause rather than ownership:position record unit 'card' records its own position, so action widget 'board' cannot place it.Verification
test_render_options,_projection,_conversations,_drafts,_anchors,_options_addition,_gate,_widgets): 765 passed. Pre-commit is clean.--run-nightlyran on an earlier revision of this change, before Put the control face back ahead of the rules that override it, and let a container move a part that records its own facets #847 landed: 2789 passed. The only failures were the preview-server cases intest_render_export.py, whose failing set changed on every run; Put the control face back ahead of the rules that override it, and let a container move a part that records its own facets #847 reports the same.🤖 Generated with Claude Code