Repository navigation
Fix six faults in Leaf that package-author trials hit - #6781
Merged
Merged
Conversation
Every `page check --render` in installed Chrome carried a `devtools-issue` advice finding, FormEmptyIdAndNameAttributesForInputError at `<textarea>`, on pages that author no field. Two textareas of Leaf's raised it, and the finding's place collapsed them into one: - the served panel row's `lf-fp-served-field`, which a page shows at first paint and the panel replaces; - the empty line's place (`#rest`) inside every `leaf-text`'s closed shadow root: the page's comment box, each reply and edit box, and each text field a package widget builds with `offer(TEXT_FIELD, …)`. The host's `name` never reached it, so neither a name nor a label on the host cleared it. The served row's field now carries the page editor's name, `comment`, and `#rest` a fixed name of its own, `words`. Naming the markup fixes the cause the issue states. A filter in `issueNode` that skipped issues inside Leaf's own controls would also have hidden a real one Chrome raises there later. Leaf's generated fields were named in #434, and the render gate's `unnamedFormFields` probe guarded that until #1239 cut it as a duplicate of Chrome's own issue. The suite draws with the headless shell, which never raises autofill issues, so both fields since added without a name passed it. The installed-Chrome arm of `test_check_render_refuses_what_only_a_browser_can_see` now asserts that a clean page reports no DevTools issue; it fails on main with this finding. Observed with `bin/leaf page check --render` in Chrome on a page holding a heading and a paragraph: before, one `devtools-issue` at `<textarea>`; after, none. On a page also holding an unnamed `<textarea>` and `<input type=text>` of the author's and a package widget's offered text field, before: four findings; after: the author's two only.
`leaf package init PKG` wrote `registry.json`, an empty `overrides.css` and empty `instructions/`, `runtime/`, `vendor/` and `widgets/` directories, and no `defaults.css`, the sheet a theme's element rules and a CSS-only widget's rules belong in (package-themes.md, packages.md). An author writing a theme deleted the empty files and created the sheet. `overrides.css` was the old `theme.css`, renamed with the sheets in #4653 rather than chosen; the directories came with the layout in #274. Every part of the layout is optional, so nothing reads an absent directory. Now plain `package init` writes `registry.json` and `defaults.css`, the two files docs/extending.html's CSS-only widget uses, and `--widget TAG` writes its declaration in `registry.json`, `defaults.css` and `widgets/TAG.js`. An author adds any other part of the layout when it has something to hold. Both starters still pass `package check` and `package check --render`. Behaviour the tests protect that changed: a fresh package holds exactly `defaults.css` and `registry.json` (`test_package_is_the_unit_that_init_creates_checks_and_vendors`), and re-running init keeps an existing `defaults.css`. Tests that wrote into a directory init used to make now make it, and `add_test_widget` makes `widgets/` for an upgraded widget, as `package init --widget` does. The starter's declaration is unchanged: it still declares `verbatim` and describes a prose block, which #274 made it on purpose ("One useful upgraded prose block, ready for a package author to specialize").
leaf-agent
previously approved these changes
Nov 22, 2026
"Unknown Leaf action: drag" named no valid choice, so an author whose
module asked for `drag` had to guess `move`. The refusal now lists every
name, sorted, and the icon refusal does the same. A list of about fifty
short names reads in one look, where a pointer to `ACTIONS` in
`runtime/icon-paths.js` sends the author to a file they may not have.
The author reads it where the module failed: `package check --render` on
a widget offering `{action: "drag"}` now reports
unreadable-examples | widget examples could not be drawn: TypeError:
Unknown Leaf action: drag. Leaf's actions are accept, add, arrange,
back, … move, next, … zoom-in, zoom-out
The runtime test of a press naming no action now asserts the list.
A catalogue with `default = "reading"` was refused ("default 'reading'
must be in themes") unless it also listed `reading`, though every page
may take `reading` unlisted (`selected_theme`). The catalogue now accepts
Leaf's own theme as a default, and refuses any other unlisted default
with "default 'X' must be in themes, or be 'reading'".
With `themes = []` and `default = "reading"`, `leaf theme list` now marks
`reading` the default and `leaf page init` creates the page; before,
both refused. A model test covers both arms.
A position record's `within` names the element that holds the units it orders, which the browser finds among the widget's descendants (`initialState`, projection/authored.js). A record naming the widget's own tag passed `package check`, since the check asked only that the tag be declared, and the first drop then threw "Unknown position container" in the browser. The check now refuses it under `record-within`, whose words say what a container is, true of an undeclared tag as of the widget's own: <lf-stack> verb `move` (`verbs`) records a position within <lf-stack>, but a position's container is a declared element inside the widget, whose children are the units it orders Every bundled package still passes `package check`. Behaviour that changed in tests: the `recording-column-position` arm of `test_the_widget_that_records_a_parts_position_is_the_one_that_places_it` had `lf-column` record positions within `lf-column` to show a nearer recorder taking the slot from the board. That declaration is now refused and never worked in the browser, so the arm is gone; `test_nested_member_records_refuse_foreign_selection_and_position` covers a nearer recorder of the same slot with containers inside each widget. A model test covers the new refusal.
…ies its premise The advice said On Me "selects the widget without its premise", which is false where the widget holds its own premise, as one author's sign-off items each did, and who got the advice seven times. What the advice is for (authoring-on-me.md, "On the page") is that `m` selects only the widget, so a premise written outside it is out of view. It now says that, and asks for a group only where the premise stands outside: <lf-options id=sign-off-api> (line 1): asks the user, but no group holds its question, so On Me names it by the widget's label alone and selects only the widget; where its premise stands outside it, write that premise and this widget in <lf-group id="…" label="…">, its label asking the question The check still reads no meaning off the widget's words, so the advice fires on the same widgets as before; only its words changed. `question_errors`'s docstring says the same.
leaf-agent
approved these changes
Nov 23, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The description becomes main's commit message on squash. It covers the first two commits, but not the four pushed after them, and each of those changes what an author sees:
ada23b7makesleaf page checkrefuse a position record whosewithinnames the widget's own tag (record-within). It also drops therecording-column-positioncase fromtest_the_widget_that_records_a_parts_position_is_the_one_that_places_it, because that registry now fails at check time instead of at admission. Per rootAGENTS.md, "Stage", the commit should say which behavior the test change moved.cfaf584letsthemes.tomlnamereadingas its default without listing it.abbb57bmakes an unknown icon or action name list Leaf's choices in its error.6db1dedrewords theungrouped-questionadvice and therecord-withinmessage.
Could you add a line for each to the description?
max-sixty
added a commit
that referenced
this pull request
Nov 23, 2026
…tion's premise is left out #6781 lets `themes.toml` name `reading` as its default without listing it, and reworded the `ungrouped-question` advice: `m` leaves a premise out only where it stands outside the widget. Both sentences here said less than the code now does.
max-sixty
added a commit
that referenced
this pull request
Nov 23, 2026
Agents that wrote packages from the shipped references alone were left stuck or guessing in places where the references were silent, wrong or pointed nowhere. This corrects those places, from two rounds: six faults that two earlier trials found, and the documentation gaps from a trial in which six agents each wrote a different kind of package (a widget that asks, one bound to data, a reordered list, a drawing with parts, a theme, a widget that also runs off Leaf). What an author now finds: the shape of a target's `placement`, of `consumeAnnotations`' entries and items, and of the `placePageThreads` handle (`module-annotations.md`); `keeps-first-box` and how to reserve a first box, what `verbatim` says, how `--package` reads a path, and where the install keeps the files these references link to (`packages.md`); that a `value` record's attribute is a string, which keywords a verb's `detail` takes, what a position record's container is and what page state gives for it, and that a stamp records a `restated` retraction (`package-data.md`); where the user undoes, when a widget calls `defer()`, and what `this.state` does off Leaf (`module-state.md`); what a revision keeps in a widget that declares `lfPatch`, which the text overstated (`module-authoring.md`, "Revisions"); and how to try a theme while writing it and see its dark scheme (`package-themes.md`). Three statements in #6161's wording, which first carried four of these corrections, are false on `main` and are left out: that every thread with a place arrives as a target, that `update()` can be awaited, and that `reveal` is a callback passed at registration. To stay under the 30,000 characters the skill's size test allows a file, the last commit moves the `views` helpers from `module-authoring.md` to `module-state.md` word for word and cuts ten sentences that repeated a neighbour or described a helper's internals; its message quotes each. `module-input.md` is seven characters under. Three sentences follow fixes to Leaf's own code that have merged: a keyed control in a shadow root belongs to its widget (#6785), `themes.toml` may name `reading` as its default, and `m` leaves a question's premise out only where the premise stands outside the widget (both #6781). Other faults the trial found in Leaf's code are not fixed here. Max hasn't read this. A subagent wrote it and confirmed most added statements by running them with `leaf-dev probe` or the command concerned, and its commit messages say which it only read; a fresh agent then answered seventeen author questions from the skill alone, sixteen from the text. I read both diffs. Tests: the reference tests in `tests/model/test_interact_layer.py`, `tests/model/test_theme_tokens.py`, `tests/runtime/widget-api.test.mjs`, and pre-commit. > _This was written by Claude Code on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Nov 24, 2026
…ds two tags (#7007) A position record's `within` may now name the widget's own tag, so a list the user reorders needs two tags, the list and its item, instead of a container element between them. The maintainer chose to lift the refusal #6781 added. That refusal guarded a real crash: the browser looked for containers only among the widget's descendants, so the first drop threw in `rankAt`. The lookup now reads containers at or inside the widget, and in both runtimes a container belongs to the nearest element at or above it that records positions (`projection.container_owner`, and `closest` in `projection/authored.js`). That is the rule a unit's owner already follows, started one step earlier, so a container and its units always have one owner. The position-container advice counts the widget itself, and an Undo offer names such a move's list once ("moved “X” in the list"). A ranking that needed `lf-ranking` > `lf-rank-list` > `lf-rank-item` is now `lf-ranking` (`content: "members"`, `move` within `lf-ranking`) > `lf-rank-item` (`owners: ["lf-ranking"]`). Ran `pnpm run check`, pre-commit, the model contract tests (649), and browser tests by node id: a two-tag fixture (`tests/fixtures/packages/sortable`) records a drag and a key move, keeps them across a reload and undoes the last, in Chromium and Firefox; the board's three-tag moves still pass in both. `leaf-dev probe` reads the same state in both engines. > _This was written by Claude Code on behalf of max-sixty_
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.
Six agents each wrote a package from the shipped references, and six faults they hit were Leaf's own, not the references'. Each is small and has its own commit.
page check --renderreported a DevTools issue about an unnamed<textarea>on every page. The fields are Leaf's: the panel's first-paint field, and the textarea inside everyleaf-text, which is also what a package gets fromoffer(TEXT_FIELD, …), so an author could clear neither. Both now carry a name. I named the fields rather than filtering the finding, since a filter would also hide a real issue Chrome raises in Leaf's fields later.leaf package initwrote an emptyoverrides.cssand four empty directories, and nodefaults.css, where the references send a theme's and a widget's rules. It now writesregistry.jsonanddefaults.css, and--widgetadds the module. The starter's declaration is unchanged.draghad to guessmove.themes.tomlmay namereadingas itsdefaultwithout listing it, since every page can selectreadingunlisted.package checkrefuses a position record whosewithinnames the widget's own tag. It passed before, and the first drop threw in the browser, because a container is an element inside the widget. One journey case declared exactly that and is removed; it never worked in a browser.ungrouped-questionadvice said On Me selects the widget "without its premise", which is false of a widget that holds its own premise. It now says a premise standing outside the widget belongs in a group with it.Max hasn't read this. A subagent wrote it and ran each fix: the render check in Chrome before and after on a plain page and on one with an author's own unnamed fields, which are still reported;
package check --renderon a widget asking for an unknown action;theme listandpage initon a catalogue withdefault = "reading";package checkon every bundled package. I read the diff. Tests: the installed-Chrome render journey, which fails onmain; new model tests for the theme default and the container refusal; the runtime test of an unknown action;tests/model/test_interact_layer.pyandtests/model/interact_contract;pnpm run check.