Repository navigation
Give Leaf's own controls their own names where they wore an author's - #5288
Merged
Merged
Conversation
Leaf drew four of its controls with names a page writes for its own: `data-room` on a thread's summary toggle and news notice, lf-diff's file count and a playground's Apply; `.choice` on the command reference's preference and a playground's or visual review's checkbox and radio labels; `.primary` on every commit face; and `.ok` on a tally's chip once nothing is left to answer. A page's CSS for those names restyled Leaf's controls. On the code-comparison example, a page style of `.choice { outline: … }` and `[data-room] > * { white-space: normal }` outlined the playground's own choice labels and Apply button, and stopped the button cutting its words. #5273's check let them through, since it allowed every name a registry declares for authors, and it couldn't see `primary`, which comes from the control faces table.
Leaf now has one rule, stated in browser/AGENTS.md ("Leaf's elements wear only Leaf's names"): a class or data attribute the runtime or a package module writes is `lf-` or `data-lf-`, and where a Leaf control looks like an idiom an author writes, it wears the idiom's `lf-` twin and one theme rule selects both, as `.lf-btn` and `.button` already did. A page restyles Leaf on purpose through the theme's tokens.
- `data-lf-room` beside `data-room`: controls.css lays out both, each `::before` reading its own attribute.
- `.lf-choice` beside `.choice`, with Web Awesome's radio and checkbox region scoped to both (build/styles.mjs).
- The commit face is `lf-btn lf-commit`, and the theme draws `:is(.lf-btn.lf-commit, .button.primary)`.
- A tally's done chip carries `data-lf-tone="ok"`, the attribute Leaf already gives its own tones; chip.css tints `.lf-chip[data-lf-tone]` and an author's `.tag.ok` in an option alike.
Each selector keeps its specificity, since `:is()` takes its heaviest argument's. What a page writes is unchanged.
`test_leaf_writes_its_own_marks_under_its_prefix` now allows only the four library names and reads the control faces table too; it fails on the old tally chip and commit face. `test_controls_are_built_by_role_and_never_by_face` drops its check for the words `button` and `primary`, which the marks check now owns. module-authoring.md tells a package author which names a module's own controls wear.
A thread's news notice also held the room of the count it first said, so "9 new" growing to "10 new" was cut. It now holds the widest count it says, `NEWS_ROOM` ("99 new" in figures of one width), so it stands one figure wider while its first count has one figure.
> _This was written by Claude Code on behalf of max-sixty_
# Conflicts: # dist/kernel/kernel.json
leaf-agent
previously approved these changes
Nov 4, 2026
The new paragraph pushed it to 30,232. It now names only data-lf-room and lf-choice; data-lf-scroll and a button's face by role already have their homes in module-scroll-and-motion.md and the same file's "Generated controls".
leaf-agent
previously approved these changes
Nov 4, 2026
# Conflicts: # dist/kernel/kernel.json # dist/kernel/leaf.js # dist/kernel/runtime/bundle-data.js # dist/kernel/runtime/bundle-portable.js
leaf-agent
approved these changes
Nov 4, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 5, 2026
…s its own (#5421) Core `reading.css` now lays out only Leaf's own `dl.lf-facts`; the reading theme's `defaults.css` gives `dl.facts` the same layout. A page initialized without a theme keeps the `class="facts"` layout its author wrote, as @max-sixty decided in #5089. Since #4889, the core rule `dl:is(.facts, .lf-facts)` reached every page, so the editorial plain-page fixture's three 244px cards became four 177px grid tracks with their `div`s shown as contents. `.facts` is already the reading package's registry idiom, so its layout now lives with it, the way #5288 gave Leaf's own controls `lf-` names. What changes on screen: nothing under the reading theme; a page with no theme, or another theme, no longer takes Leaf's facts grid. The worktree details in the diff package's example and an option's `.facts` rail keep their layout under the reading theme, as before. Verification: - `tests/journeys/test_plain_pages.py::test_an_ordinary_page_is_drawn_as_written`: `editorial` failed on main (#5089) and passes here. Its `class-vocabulary` pin and the `dl.facts` half of that obstacle are removed; `form` still xfails on the `.choice` half. - `leaf-dev stills` for `page-about`, `worktree-startup`, `ship-review`, `live-progress`, `alert-review`, `visual-review-inspection` and `plan-option-picked`: six unchanged. `page-about` differs only in the About dialog's version text, which reports a dirty tree; its `lf-facts` lists draw identically. - `tests/browser/test_render_options.py`: 47 pass. Two fail identically on unchanged main (`test_a_quoted_widget_exhibits_without_taking_input`, `test_a_thread_obligations_done_press_keeps_its_keys_and_one_workflow`). Closes #5089 Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 10, 2026
Tend's PR review now checks each change against the open backlog and gets the description to close what the change settles. Where the change leaves nothing of a `backlog` issue to do, by finishing what remains, removing its premise or recording a decision against what it asks, the description says `Closes #N`. Where it does part, the description says `Part of #N` and what is left, so the review of the last part can tell that part finishes the issue. On Tend's own pull request the review edits the description. On someone else's it asks in the review, and the ask goes in an approval rather than holding one back. The rule is a new section of `running-tend`, **Issues a change finishes**, after **Review threshold**. ## Why Leaf's backlog triage of 2026-11-04 found seven merged pull requests that did an open backlog issue's work without closing it. Four said `Part of #N`: #3879, #3902, #3856 and #3868. Three named no issue: #4487, #4124 and #5039. Nothing asked those three to look, since `/developing-leaf` asks for `Closes #N` only of a session that starts from a backlog item. Tend's nightly sweep reads a seventh of the open issues each night, long after the diff has left the reader's context, and, by the triage's count, it commented on none of them in ten nights. The review is the step every change passes with its diff in hand. The replay below sorts the seven more finely than the triage did. #4011, #4036 and #4013 were settled by #3879, #4124 and #5039. #3902 did half of #4023, whose five composition defects stayed open. #3856, #3868 and #4487 each did one item of #4027, which is still open. For those four the right description is `Part of #N` with what is left. A `Closes #N` would have been wrong. ## Replay Each case gets the rule as this branch ships it, together with `running-tend`'s **Review threshold** section, which it competes with. It also gets the PR's title, author, description and diff, capped at 80k characters with vendored files left out, and every `backlog` issue open when the PR merged, as it read then. That list is rebuilt from the issues' creation and close times, label events and body edit history, plus their comments up to the merge. Each case runs once through a headless `claude -p` on `claude-opus-5-5` (the review's model), with no tools, in a scratch home. The JSON verdict is graded against an expected answer fixed before the run. | PR | What it did | Expected | Result | | --- | --- | --- | --- | | #3879 | the play-through #4011 asked for | close #4011, or part with its open decision left | pass: part, the decision and the home-page test left | | #3902 | #4023's touch-target half | part of #4023 | pass (also part of #4027) | | #3856 | #4027's Android back item | part of #4027 | pass | | #3868 | #4027's Draw mode item | part of #4027 | pass | | #4487 | #4027's lf-draft back item | part of #4027 | pass | | #4124 | recorded the call that settled #4036 | close #4036 | **miss**: read #4036 and judged the call unrelated | | #5039 | one held-news count, #4013 | close #4013 | pass (also part of #4012) | | #5331 | removed #4060's premise | close #4060 | pass | | #4643, #4718, #4847, #5020, #5252 | nothing in the backlog | nothing | 5 pass | | #5441, #5446, #5454 | rightly a part of an open issue | that part | 3 pass | | #4212 | rightly said `Closes #4037` | close #4037 | pass | That is 6 of the 7 triage cases, the premise case, and 9 of 9 controls. No run closed or named an issue it shouldn't have. #5020 is a hard negative: it changes held-news notices, which #4013 is about, and the run left #4013 alone. #4124's miss held in all three wordings tried. The triage itself only inferred that the 2026-10-25 call in `reading-place.js` covers #4036's case. The clause for a removed premise or a recorded decision goes beyond the two cases Max named. It is there because the triage closed several issues as obsolete after a landed change removed their premise. Without the clause, the #5331 run read #4060 and declined: "It only makes one sentence of the issue's background out of date". With it, the run closed #4060. Two grades were corrected after the first run, each on evidence from the record. #5252 says `Part of #5194`, but #5194 was labelled `backlog` only on 2026-11-05, after #5252 merged. #5039 left a count that gains a digit outgrowing its room, as its own `thread-card.js` comment says, and #5288 fixed that on 2026-11-04, so `Part of #4013` naming that is also right at merge time. The final wording closed #4013 anyway. ```sh uv run python .tmp/replay/replay.py --jobs 4 uv run python .tmp/replay/replay.py --only 5331,4124 --rule-file .tmp/replay/arm-finishes-only.md --runs runs-finishes-only --results results-finishes-only.json ``` The final wording's 17 runs cost $6.75. All runs together cost $19.64, across three wordings and the two-run ablation. The script, cases, prompts, answers and results are in `.tmp/replay/` of the worktree that wrote this PR, not committed. The last run used this text before one sentence was split in two. ## Decisions Max may reverse - **Where the rule lives.** It lives in `running-tend`, which only Tend loads. `/developing-leaf`'s `Closes #N` under **Take a backlog item** stays as it is. That rule claims an item early: the closing keyword is what makes `TODO.md`'s `-linked:pr` query skip it. The review then corrects a claim the change only partly fulfils to `Part of #N`. Repeating the search in the author's skill would make every Leaf session pay for a check the review already makes on every PR. - **How it acts on others' pull requests.** The review asks and doesn't edit, since the author owns the description and Leaf sessions rewrite it whole from a file. The ask doesn't withhold approval. `tend-review` runs on `opened`, `synchronize`, `ready_for_review` and `reopened`, not on `edited`, so a held approval would wait for the next push. The review approves with the ask as its body. - **Scope.** Only issues labelled `backlog`. CI failure reports and cause issues close by their own routes. ## Not verified - **Use inside a full review.** The replay gives the section on its own, with the backlog inline. It shows that the rule, once applied, picks the right issue. It doesn't show whether a whole Tend review, with the bundled review skill in context, remembers to apply it. Tend's next reviews will show that. - **What-is-left lists.** The replay leaves out the earlier PRs that name each issue, which the rule tells the review to read. So its lists repeat items that earlier parts had done. #5454's ask lists #4027 items that #3856 and #3868 had finished. - **Repeat runs.** Each case ran once. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 12, 2026
…class a page coins (#5865) Leaf's kernel styled four generic classes on every page: `.button` (with `.button.primary`), `.field`, `.choice` and `.scroll`. A page that coined one of these names for its own design took Leaf's face or behaviour anyway: - The plain form fixture's own `<label class="choice">` took Leaf's aim floor and inline-flex layout, which grew the form. `test_plain_pages` pinned this as the `class-vocabulary` obstacle. - A page's own `.scroll` box turned `position: relative`, took a fade mask and joined the keyboard stops. - Bulma, Foundation and similar sheets use `.button` and `.field` throughout, so pages built on them hit the same collision. With this change a page takes a Leaf control's face by writing that control's own `lf-` name, and Leaf styles no class a page coins for itself. | Before | After | |---|---| | `class="button"` | `class="lf-btn"` | | `class="button primary"` | `class="lf-btn lf-commit"` | | `class="field"` | `class="lf-field"` | | `<label class="choice">` | `<label class="lf-choice">` | | `class="scroll"` | `class="lf-scroll"` | ### How it works - **One name per idiom.** `lf-btn`, `lf-commit` and `lf-choice` are the classes Leaf's own controls already wear. Each face rule now names one class where it named a twin pair: `:is(.lf-btn, .button)` is now `.lf-btn`, and `build/styles.mjs` maps Web Awesome's native styles the same way. `lf-field` and `lf-scroll` are new; Leaf's own fields keep `lf-ui` and its own scrollers `data-lf-scroll`. - **`page check` allows these classes and refuses every other `lf-` class.** `structure.AUTHORED_CLASSES` reads the classes named in the kernel registry's idiom keys. The registry entries are renamed, and `.lf-scroll` gains an entry of its own; page-authoring.md described it, but no registry entry declared it. Only the kernel registry can grant an `lf-` class. - **A test stops a generic class coming back.** `test_the_kernel_styles_no_class_a_page_coins` holds the kernel's sheets and DOM queries to Leaf's names: `lf-`, the Layouts' `layout-` and `density-`, and the libraries Leaf draws for. It fails on main. ### Calls you may reverse - **Merging the page's names with Leaf's own.** This reverses #5288's choice to give a page generic twins of Leaf's names. A page rule written for `.lf-choice` now reaches Leaf's own choice labels too, so page-layout.md tells authors to arrange their own controls by a class or id of their own. The alternative was a second author-facing name per idiom, such as `lf-button` beside `lf-btn`, with every rule still listing both. I chose one name per idiom. - **Left as they are:** - `data-room`, an attribute idiom, keeps its `data-lf-room` twin. - The Layout classes (`layout-*`, `density-working`) stay as they are. - The reading theme's idioms (`.tag`, `.callout`, `dl.facts`) stay generic. A page takes them with the theme, as decided in #5089. - **The portable sheet is unchanged.** It still nests the kernel's shared sheet under the widgets' tags, because the native-control font rule is page-wide. Its large-host style cost therefore stays. ### Verification - **Probed in Chromium.** On this branch, `lf-btn`, `lf-btn lf-commit`, `lf-field`, `lf-choice` and `lf-scroll` compute the same as `button`, `button primary`, `field`, `choice` and `scroll` on main. The probe compared font, ink, ground, frame, padding, floors, display, position, mask, gap, cursor, box size and the scroll mark. The old names on this branch now take the browser's defaults. - **The plain-pages form case** passes with its pin removed. `tests/smoke/test_plain_page.py` passes. - **Focused tests:** - model tests (layer, contracts, render gate, product): 593 passed; - `pnpm run test:runtime`: 935 passed; - the 17 browser tests whose pages use the renamed classes; - the choice, ring and theme tests in `tests/browser/controls`; - `build/browser/build.mjs --check`; - pre-commit. > _This was written by Claude Code on behalf of max-sixty_ https://claude.ai/code/session_01GQAnFBpRfi8Gh5cgPofNzs
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.
Leaf drew four of its controls with names a page writes for its own:
data-roomon a thread's summary toggle and news notice, lf-diff's file count and a playground's Apply;.choiceon the command reference's preference and a playground's or visual review's checkbox and radio labels;.primaryon every commit face; and.okon a tally's chip once nothing is left to answer. A page's CSS for those names restyled Leaf's controls. On the code-comparison example, a page style of.choice { outline: … }and[data-room] > * { white-space: normal }outlined the playground's own choice labels and Apply button, and stopped the button cutting its words. #5273's check let them through, since it allowed every name a registry declares for authors, and it couldn't seeprimary, which comes from the control faces table.Leaf now has one rule, stated in browser/AGENTS.md ("Leaf's elements wear only Leaf's names"): a class or data attribute the runtime or a package module writes is
lf-ordata-lf-, and where a Leaf control looks like an idiom an author writes, it wears the idiom'slf-twin and one theme rule selects both, as.lf-btnand.buttonalready did. A page restyles Leaf on purpose through the theme's tokens.data-lf-roombesidedata-room: controls.css lays out both, each::beforereading its own attribute..lf-choicebeside.choice, with Web Awesome's radio and checkbox region scoped to both (build/styles.mjs).lf-btn lf-commit, and the theme draws:is(.lf-btn.lf-commit, .button.primary).data-lf-tone="ok", the attribute Leaf already gives its own tones; chip.css tints.lf-chip[data-lf-tone]and an author's.tag.okin an option alike.Each selector keeps its specificity, since
:is()takes its heaviest argument's. What a page writes is unchanged.test_leaf_writes_its_own_marks_under_its_prefixnow allows only the four library names and reads the control faces table too; it fails on the old tally chip and commit face.test_controls_are_built_by_role_and_never_by_facedrops its check for the wordsbuttonandprimary, which the marks check now owns. module-authoring.md tells a package author which names a module's own controls wear.A thread's news notice also held the room of the count it first said, so "9 new" growing to "10 new" was cut. It now holds the widest count it says,
NEWS_ROOM("99 new" in figures of one width), so it stands one figure wider while its first count has one figure.