Skip to content

Name every widget by the markup it opens with, and retire x-name - #6088

Merged
max-sixty merged 22 commits into
mainfrom
grind/5595
Nov 16, 2026
Merged

max-sixty merged 22 commits into
mainfrom
grind/5595

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #5595

Every element Leaf names now takes its name from markup it opens with, as a section is named by its heading: a tab, a part, a board column, a sample, a pane, a text document, a worktree, a playground control, choice and preset, a timeline run, lane and event, and a trace with its bookmarks. The registry's x-name key is gone, with the label attributes it pointed at, the $attributes entry that kept label as a name on every widget (NAME_ATTRIBUTE), and the summary attribute of tabs and parts.

<lf-part id="part-readme">
  <header>
    <strong><code>README.md</code></strong>
    <p><span class="added">+120</span> <span class="removed">−45</span> lines</p>
  </header>
  <article class="layout-column">…</article>
</lf-part>

The list of parts shows README.md in code type over the coloured diffstat.

The rule and where it lives

An element's name is its leading title: a leading <summary>, heading or <strong>, looked for inside a leading <header> or <hgroup> too. The rule already named sections, disclosures and titled members, and now names widgets.

A widget that draws, moves or hides its name takes it only where it opens the widget: the title, or the <header> or <hgroup> holding it, is the widget's first element. A quoted sample whose heading follows its first paragraph keeps the heading where it stands, and a tab whose heading follows a paragraph is unnamed, which page check refuses. Where a name is only read, as a section's heading after an eyebrow or an option's title after its chips, it may follow those elements, as on main: requiring it to open them too would have unnamed 41 options, 66 sections and 39 list items in the corpus.

Each runtime states the rule once:

  • Browser: leading-title.js. Packages get one reader, openingTitle (portable-api.js, and through it widget-api.js), which returns the name an element opens with as {title, holder}, or null: the title naming it, and the holder, its first element, which is that title or the <header> or <hgroup> around it. The board, tabs, text document, worktree, playground, timeline and version diff read names through it, and a widget draws, moves or hides the holder. leadingTitle, which reads past an eyebrow or an option's chips, stays internal to the runtime. addressable-names.js reads the name's words as the author wrote them (addressableName) and copies a node's markup without ids or generated words for a surface that shows a name away from its element (echoCopy).
  • Python: gesture_words.leading_title_node, leading_title and leading_title_holder. tests/name_cases.json holds both runtimes to the same names and the same holders.
  • CSS: one selector, :first-child:is(summary, h1, h2, h3, h4, h5, h6, strong, header, hgroup), the holder openingTitle returns. CSS can't see text, so it also matches a title that loose text precedes, as strong:first-child did on main.

How each widget shows its name

  • Tab strip along a row shows only each panel's name, so the panel keeps its <strong> or <header> as the eyebrow over its first heading, in the reading theme's .eyebrow face, and the block under the eyebrow takes the panel's top edge as the first block would. The tab's copy is an echo (says: "echo"), so a comment on the name anchors in the panel. A panel named by a heading keeps the heading as it is.
  • Side list and a page's parts show the name with the summary under it, so on screen the panel hides its name and the list's copy is the page speaking (says: true): page search finds the name in the list and a comment on it anchors there. On paper the list is gone and each item prints under its name. A side list reserves a summary's line before upgrade from a panel's header, so a phone's row strip keeps its height when the module draws.
  • Column, sample, pane, text document, worktree: the authored name stands where the widget draws one. A text document's name heads its frame and names its figure. A worktree's <strong> stands in its row's room from first paint, before the module slots it into the row. A pane's region is named by its header's title unless its author gave it an aria-label.
  • Playground control, choice and preset: the name stays the element's first child, hidden once the playground draws, and the view draws a copy as the radio's label or on the preset's button. The playground refuses a name holding a link, a control or a widget, which the copy would nest inside that control. Its list of such tags and page check's are held together by tests/nested_name_cases.json, which both runtimes answer.
  • Code block, chart, draft, diagram, diff: a widget that draws its own content keeps the name it opens with over what it draws. The four light-DOM modules put the holder back first when they replace their children, and shadowStage, the runtime's helper for a shadow-DOM widget, keeps it in the light tree and slots it alone at the top of the stage, which covers the diff, the file tree and the file editor.
  • Places that take only text read addressableName: every tab's and pane's aria-label, a thread card's heading, the timeline's chart labels, the trace chooser and the board's announcements. Each panel is labelled by its tab.

Checks

  • Under x-content: members and data, a widget may open with the element its name stands in, a title or a <header> holding one, before its members or its <pre>. A <header> with no title names nothing and stays a stray member. Which widgets take a name is what their modules keep: page check --render reports a name a module drew over (dropped-name), so a package's module that drops one hears it, with no per-widget key.
  • A revision that renames a tab, a part or a pane replaces the widget, as one that changed its label did: a members-patched widget's shell holds its own opening name and each member's whole.
  • page check refuses a view whose name doesn't open it (unnamed-view), and a link, control or widget in a view's header, which its tab, a control, copies (interactive-name). Another widget's name is drawn in place or read as words, so a question's heading or an option's title may link a pull request.
  • x-says is a list of attribute names, each said after the element's words. Its before edge served only the column and sample labels this change retires.

Evidence

  • Corpus: all 57 pages under examples/, examples/developer/, docs/ and tests/fixtures/pages/ build and pass leaf page check.
  • Tests: pnpm run test:runtime 992 passed; pnpm run check:browser clean; the touched model tests (959) pass; 191 browser and journey tests across the tab, document, workspace, playground, sample and version-diff files, the worktree rows, the pane names, the anchors selections, and the four tests CI failed on the first head pass.
  • New tests: a comment on a side list's name anchors on the list's copy and survives a revision (fails on says: "echo"); an author's aria-label names a pane (fails when the header always wins); a quoted sample's heading after its first paragraph stays a heading (fails on the lenient selector); a tab whose heading follows a paragraph is refused; a playground refuses a link in a preset's name; a code block, a draft and a diff keep and show the name they open with; a revision that renames a tab reaches its strip and one that renames a pane its region (both failed before); the render gate reports a widget that draws over its name; a removal that empties a nameless box stands in it, the version diff's gapIn, which kept no test once a tab keeps its name.
  • A stale journey: test_render_shift_watch.py, which this branch edits and so CI runs, expected a message head to say "just now"; since Say when each message in a thread was said, on the card and to the agent #6097 a head says its clock time, so the journey now advances days ("Yesterday 22:10", "13 Nov 22:10") and still holds the thread in place.
  • Probes: a printed queue (alert-review) shows each item's header under its group, where main printed the group and label together; a named text document's figure reads as figure "Reviewed".
  • Page search on the root parts (root-parts): Workbench 4, Evidence 6, Plan 7, as on main.
  • Stills (leaf-dev stills --authored against main; Chromium and Firefox light, Chromium dark): the side list and the root parts are pixel-identical to main. Both text documents' caption bars match main in both schemes. A worktree's first paint differs only by its name standing in the row's room, which main leaves empty, with its body where main's is (Chromium only, since Firefox can't hold the runtime). The gallery's page of parts gains the README.md part, in code type over +120 −45. Each horizontal tab panel shows its name as the eyebrow over its first heading, in the face of a section's eyebrow under it: the root tabs, the gallery and a boxed set. A printed queue (printed-queue, new) prints each item's group, then its name and summary, where main printed the group and name on one line. A quoted sample whose heading follows its first paragraph keeps the heading where main does (leaf-dev probe pair).
  • Evals (Claude Code, paired base): every head sample (8) wrote each name as markup and passed page check; base wrote label attributes. Rubric results, head vs base: queue 1/1 vs 1/1; presets 2/3 vs 3/3; parts 0/4 vs 3/4, every head sample choosing a layout-sidebar with a contents outline, which the rubric then refused and accepts since Accept a reading part's sidebar outline and a budget beside its total in two playground eval rubrics #6111.

Calls Max may reverse

  • The eyebrow takes a <strong> or <header> name only; a heading that names a panel stays a heading.
  • x-says became a list rather than a map whose only value is after.
  • A text document's caption bar keeps the figure's ground: code's under a source capture, the page's under a preview's tabs. Dropping the ground made a source capture's caption paper where main's is white.
  • A widget draws only a name that opens it, and only where a widget draws its name; reading a name stays as lenient as main's, past an eyebrow or an option's chips.
  • Only a view's name is required (unnamed-view); columns, controls, choices and events may go unnamed.
  • lf-event and lf-trace-bookmark declare x-content: members with no members to hold only a name.

Adds

  • openingTitle in portable-api.js, returning {title, holder}; addressableName and echoCopy in widget-api.js, documented in module-reading.md.
  • tests/nested_name_cases.json, which the validator's nested_in and the playground's nestedIn both answer.
  • The findings unnamed-view and interactive-name; the content-model rule that admits a leading name; the playground's refusal of a name holding a control.
  • slot="lf-worktree-name" on a worktree's authored name, and slot="lf-name" on the name of a widget shadowStage stages; the parts-list and printed-queue stills states.
  • The render finding dropped-name (droppedNames, render-checks/words.js).

Not verified

  • Page search finds a worktree's name and its branch separately, but no query spanning both, which it did when both were the row's generated words.
  • Option labels, board card titles and the quiet word's seat still read :scope > strong, a lookup that predates x-name and agrees with the rule wherever no text precedes the title.
  • tests/journeys/margin/test_card_placement.py::test_the_shipped_long_thread_keeps_the_margin_and_its_height fails here with a 320 px card where it asks for 379: Keep the comment box and its card slim until a message stands taller than it is wide #5991, on main, made a card slim at 320 px until a message stands tall and left this assertion as it was. It fails without this branch's thread-card change too.

A tab, a part, a board column, a sample, a pane, a text document, a worktree, a
playground control, choice and preset, a timeline run, lane and event, and a trace
with its bookmarks are now named the way a section is named by its heading: by the
`<strong>` they open with, or by a leading `<header>` holding it. A part's or tab's
summary is what that header says after its title. So a list of files sets each name
in code type and colours its diffstat, which the `label` and `summary` attributes,
holding only text, could not. The registry's `x-name` key, those attributes, and the
pane role's required `label` are gone.

The rule lives in `browser/runtime/leading-title.js` (`leadingTitle`, portable, so the
timeline reads it on a plain page), with `addressable-names.js` caching it, reading
the name's words (`addressableName`) and copying its markup for a surface that shows
it elsewhere (`echoCopy`); `gesture_words.element_name` reads the same rule on the
server, and `tests/name_cases.json` holds both to the same cases.

A column's, sample's, pane's, text document's and worktree's name stands where the
widget draws its name, so page search finds it and a comment anchors on it. A tab
strip draws an echo copy of each panel's header, which stays at the panel's top; in a
live page of parts the list shows it and the part's header is hidden. The playground
keeps each name first and hidden, and draws a copy beside the field, in the radio's
label and on the preset's button; a native option, the timeline's chart, the trace
chooser and every aria-label take the name's words.

`page check` lets a widget open with its name before its members or `<pre>`, refuses
a tab or part without a name, and refuses a link, control or widget in a view's
header, which its tab copies. The version diff counts the name a view or a
member-holding widget opens with as a block, so a renamed tab marks and a tab emptied
of all but its name shows the gap after its name. A written Markdown document's
prepaint face now stands where its `<pre>` does, after the name.

A codemod moved every `label`/`summary` in examples, docs, notes, eval cases, registry
examples and test fixtures into markup; panes with a header heading lost the label to
it, and panes without one keep it as `aria-label`. The shipped references and registry
instructions say how to name each widget.
…ne rule

A strip along a row shows only each panel's name, so the panel keeps the
<strong> or <header> naming it as the eyebrow over its first heading, and
the tab's copy stays an echo. A side list or a page's parts shows the name
with its summary, so there the panel hides its name and the list's copy is
the page speaking: page search finds it in the list (root parts count
Workbench 4, Evidence 6, Plan 7, as on main) and a comment on it anchors.

One rule names every widget. `leadingTitle` is one function, exported by
portable-api.js and through it by widget-api.js; addressable-names.js keeps
its answer for `addressableName` alone. The version diff finds each
holder's name with it, `page check` treats a leading title holder as the
name (`leading_title_holder`) and checks every widget's name for
interactive content, and the theme matches names with one selector.
`gesture_words.element_name` is gone for `leading_title`.

`x-says` loses its `before` edge, which only the retired column and sample
labels used, and becomes a list of attribute names said after the
element's words. The test-local said-label widgets go with it; the fence
capture test reads a gloss's tip instead.

A worktree's name stands in its row's room from first paint, a pane's
author `aria-label` names it over its header, each tab panel is labelled by
its tab, and a removal that empties a nameless box keeps a test of its gap
standing in it.
The block after a panel's eyebrow takes the panel's top edge, as the first
block would, so the frame's trim follows it down: a section opening with its
own eyebrow paragraph sat 48px under the panel's, where the panel's first
block sits flush. The rule that zeroed any first-child heading below the
eyebrow, at any depth, reached headings inside questions further down.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interactive-name reaches every widget's leading title, not only the names Leaf copies into a control, so page check now refuses markup Leaf never draws away from its element. On this head both of these are errors:

<lf-card id="k1"><strong><a href="https://example.com/pr/1">PR #1</a></strong> fix it</lf-card>
<lf-ask id="q"><h2>Deploy a <lf-gloss tip="A thin path.">walking skeleton</lf-gloss>?</h2>…</lf-ask>

<lf-card> (line 3): its name holds <a>; Leaf draws a widget's name in controls such as a tab, a radio's label or a preset's button…
<lf-ask> (line 5): its name holds <lf-gloss>; …

A card titled by a link to its PR, or a question heading that uses a gloss, is ordinary page markup. The description says the check "covers a view's header only: a heading with a link that names an lf-ask stays allowed", but name_errors takes leading_title_node for every non-view widget too, and is_element_name counts any lf-* as interactive, so lf-gloss and other inline widgets trip it as well.

The hazard it guards against, a control nested inside the control drawing the copy, exists only where a module draws echoCopy into a tab, radio label or preset button. Scope the check to those widgets. The views are already found through x-views. The playground's controls, choices and presets have no declaration to find them by, so this needs either a registry key saying "my name is drawn in a control" or a playground-owned check. A list of playground tags in instances.py would break "Keep the layer open".

Comment thread src/leaf/validation/instances.py Resolved
…e check to views

A widget that draws, moves or hides its name takes it only where the title,
or the <header> or <hgroup> holding it, is the widget's first element
(`nameHolder` in leading-title.js, `gesture_words.leading_title_holder`).
The theme's selector for that element is `:first-child:is(summary, h1, h2,
h3, h4, h5, h6, strong, header, hgroup)` in every sheet. A quoted sample
whose heading follows its first paragraph keeps the heading where it stands
rather than lifting it into its note, and a tab whose heading follows a
paragraph is unnamed, which `page check` refuses (`unnamed-view`). Where a
name is only read, as a section's after its eyebrow or an option's after its
chips, `leadingTitle` still finds it, as on main: tightening it everywhere
would have unnamed 41 options, 62 sections and 39 list items in the corpus.

`interactive-name` refuses a link, control or widget in a view's header
only, which its tab copies; a question's heading or an option's title may
link a pull request again. The playground, which draws its names inside
controls, refuses one in its own module.

A named text document's figure is named by its name's words, as its
caption named it. A side list reserves a summary line before upgrade from a
panel's header, so a queue's row strip on a phone keeps its height when the
module draws. A side list's hidden names and the tab eyebrow sit under
`@media screen`, so a printed queue keeps each item's name. The eyebrow
takes the reading theme's `.eyebrow` face, so it reads as one with a
section's own eyebrow under it. A thread card heads a target by its name
(`addressableName`), a header-named tab's or part's too.
A preset's name is drawn on its button, so a link in it would stand inside
the button. The playground now fails on such a name, as page check no
longer refuses it statically outside a view's header; this holds it to that.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rule for which content a name drawn inside a control may not hold now exists in two places: NESTED in playground-view.js and INTERACTIVE in src/leaf/validation/instances.py. They list the same eleven tags and test for a widget differently (localName.includes("-") against is_element_name). Neither names the other and no test compares them, so if one list changes, a tab's header and a preset's name would quietly stop following the same rule. AGENTS.md, under "What it repeats", asks for the owner to be exported or generated rather than copied. Either give the rule one home both checks read, or add a test that holds the two lists to each other.

The eyebrow named its family and size itself, which the interface's font
check refuses; `--lf-font-status` is the same small medium-weight sans the
reading theme's `.eyebrow` sets.
# Conflicts:
#	browser/types/contract.d.ts
#	src/leaf/registry/widgets.py
#6097 made a message head say when it was said, its clock time and its day
unless today, rather than an age, and left this journey expecting "just
now" and "1m ago". It runs on this branch because the branch edits the
file. The head's words grow as days pass, from "22:10" to "Yesterday 22:10"
to "13 Nov 22:10", so the journey advances days and still holds the thread
and its controls in place while the metadata changes.
# Conflicts:
#	evals/parts-take-their-own-layouts/case.yaml
…ing title the runtime's

Every package that read a widget's name, the board, tabs, text document,
playground, timeline and worktree, touched only names that open their
element, which page check already holds a view to. So the public API gains
one reader rather than two: `openingTitle(element)` is the title naming an
element where it, or the <header> or <hgroup> holding it, is the element's
first element. A package that draws, moves or hides the name takes the
child holding that title. `leadingTitle`, which reads past an eyebrow or an
option's chips as a section's or an option's label does, stays internal to
the runtime (addressable-names.js, place-preview.js), and `nameHolder` is
gone. module-reading.md documents `openingTitle`; the name cases check the
holder through it.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping nameHolder from the package API moved the question "which child holds the name" into each caller. lf-text-document.js, worktree-view.js and playground-view.js each now compute title && [...el.children].find((child) => child.contains(title)), addressable-name.test.mjs does it a fourth time, and lf-tabs.js answers it two more ways: children[0].contains(title) and title?.closest("header") with a parentElement check. The leading-title.js header says what the answer is ("its child holding this title"), but no code owns it. Python still answers it in one place, leading_title_holder, whose docstring now says the browser's openingTitle "reads the same rule", although openingTitle returns the title, not the holder. If the rule for the holder changes, for example to skip chrome the way openingTitle's own uiInside filter does, those six copies would have to change in step, and nothing would catch one that didn't. AGENTS.md's "What it repeats" asks for the owner to be exported rather than copied. The narrower API could return both answers, {title, holder}, or export the holder again beside openingTitle. Either way, leading_title_holder's docstring would then name the browser function that matches it.

Comment thread packages/diff/widgets/worktree-view.js Resolved
…ame lists together

`openingTitle(element)` returns `{title, holder}`: the title naming the
element and its first element holding it, which a widget draws, moves or
hides. The tabs, text document, worktree, playground and the runtime test
each rebuilt the holder from the title in their own way; they now read it,
so the rule for which child holds a name has one home in each runtime
(`leading_title_holder` names the browser's `holder` as its match).

The playground's `NESTED` and page check's `INTERACTIVE` list the same
eleven tags and tested for a widget differently (any hyphenated name against
an `lf-` widget name). `tests/nested_name_cases.json` now holds both to the
same answers, the playground's `nestedIn` and the validator's `nested_in`,
and each runtime's list to the tags the cases name, so neither can drift; the
playground's widget test is now `lf-`, as the validator's is. One home both
read would have needed a new public export or layer fact for the playground,
which the package API is kept small enough to refuse.
# Conflicts:
#	browser/registry.json
#	browser/runtime/addressable-names.js
#	browser/runtime/version.js
#	browser/types/contract.d.ts
#	packages/default/registry.json
#	packages/default/widgets/lf-tabs.js
#	packages/default/widgets/lf-text-document.js
#	packages/diff/registry.json
#	packages/playground/registry.json
#	packages/playwright/registry.json
#	packages/playwright/widgets/lf-trace.js
#	packages/timeline/registry.json
#	skills/leaf/references/module-authoring.md
#	skills/leaf/references/module-reading.md
#	src/leaf/gesture_words.py
#	src/leaf/registry/widgets.py
#	src/leaf/schema.py
#	tests/browser/test_render_anchors.py
#	tests/model/interact_contract/test_vocabulary.py
#	tests/name_cases.json
#	tests/runtime/addressable-name.test.mjs

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

widget_errors now accepts a leading name on every members or data widget, including widgets that never draw one and then delete it. On this head, leaf page check passes <lf-code id="c1" language="python"><strong>main.py</strong><pre>print(1)</pre></lf-code>. On main the same markup fails with data-body ("its body is one

 …, found , 
"). After upgrade, lf-code's this.replaceChildren(pre, …) removes the <strong>, and lf-draft (replaceChildren(this.#body)) and lf-chart do the same. An agent that titles a code block like a column gets no finding, and the user never sees the title. x-name was the declaration of which widgets take a name, and removing it widened the exemption to every widget. A per-widget declaration, or a module that keeps whatever name it is given, would restore the error where the name is dropped. Either one keeps the layer open, which a tag list wouldn't.

Renaming a tab in a revision probably no longer reaches its tab strip. lf-tabs declares lfPatch = "members", and reachesMembers in version.js compares only shell(), the tab set plus a shallow clone of each member. On main, a rename changed the member's label attribute, so the tab set was replaced and its strip redrawn. Now <strong>Old</strong> → <strong>New</strong> sits inside the lf-tab, so the set is patched in place. The strip draws echoCopy(openingTitle(panel)?.title) and redraws only on its signals or on activation, so it most likely keeps "Old" until reload. The same applies to the aria-label that lf-pane sets in connectedCallback. I haven't seen this in a browser; a revision test that renames a tab would settle it. module-authoring.md says a module that draws from what its children hold must read them again when they change, and that paragraph still gives "a tab strip shows each tab's label" as its example of drawing from attributes. One fix in the owner would cover every lfPatch widget: have shell() include each member's opening name holder in full, so that a rename replaces the widget as a label change did.

The merge of main brought in tests/browser/threads/test_seated_threads.py, which (from #6105) still writes <lf-test-plan id="hub" label="Before the frost">. lf-test-plan no longer declares label, so that plan is unnamed. The test asserts nothing about its name, so it still passes.

Comment thread src/leaf/validation/instances.py Resolved
…ebuild a renamed set

`page check` lets any widget open with its name before its members or its
data, and a module that drew its own content by replacing its children took
that name with it: a code block, chart, draft, diagram or diff opened with a
`<strong>` passed the check, and the user never saw the title. Each now keeps
the name where it draws. The four light-DOM modules put `openingTitle`'s
holder back first when they replace their children, and `shadowStage`, the
runtime's helper for a shadow-DOM widget, keeps the holder in the light tree
and slots it alone at the top of the stage, so lf-diff, the file tree and
the file editor keep theirs with no change of their own. The draft and the
diagram place it over the reading and the drawing. For any module that still
drops one, a third-party package's included, `page check --render` reports
the name it drew over (`dropped-name`). No per-widget key: which widgets
take a name is what their modules keep, which the gate reads.

A tab renamed in a revision did not reach its strip. A members-patched
widget was replaced only when its own attributes or its members' changed, and
a rename now sits in the markup a member opens with, so the tab set was
patched in place and the strip kept the old name; a pane's region name, set
on connect, likewise. The patch shell now holds the widget's own opening name
and each member's whole, so a rename replaces the widget as a `label` change
did. The revision test renames a tab and a pane; both failed before.

The seated-threads fixture from #6105 names its plan by markup.
# Conflicts:
#	browser/runtime/version.js
#	browser/types/contract.d.ts
#	examples/developer/feature-gallery.html
#	examples/developer/versions/feature-gallery.v2.html
leaf-agent
leaf-agent previously approved these changes Nov 16, 2026
# Conflicts:
#	src/leaf/render_gate/readings.py
#	tests/journeys/test_render_gate.py
# Conflicts:
#	browser/registry.json
#	dev/leaf_dev/commands/bench.py
#	evals/usability/fixtures/reading.html
#	examples/developer/feature-gallery.html
#	examples/developer/versions/feature-gallery.v1.html
#	examples/developer/versions/feature-gallery.v2.html
#	examples/pr-walkthrough.html
#	packages/default/registry.json
#	packages/default/widgets/lf-text-document.js
#	src/leaf/registry/contract.py
#	src/leaf/revision_delivery.py
#	tests/browser/navigation/test_comment_marks.py
#	tests/browser/startup/test_projected_data.py
#	tests/browser/widgets/test_code_and_documents.py

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The push resolves all three earlier points. The renames now reach the tab strip and the pane's region, and the four light-DOM modules and shadowStage keep the name. But the new dropped-name check reports names that are still on the page. droppedNames asks whether the rendered widget still opens with its name. A module can draw generated chrome ahead of the name and leave the name in place, and the check treats that as a drop. On this head tests/journeys/test_render_gate.py::test_page_fixture_renders[command-hub] fails with a dropped-name for every lf-atlas-task ("Cut over the nightly", "Swap with the old path behind a flag", …). That example's module prepends a data-lf-gen status line (this.prepend(status)) before the authored <strong>, and it still shows the <strong> and labels the row by it. The other 46 corpus fixtures pass. The journey tier doesn't run on a pull request, so the first red would be the nightly. The finding's message would also send an agent to rename a page whose names already show.

The question the check means to ask is whether the module removed the name, not whether the name is still first. One fix is to look for the authored title anywhere in the rendered widget rather than only through openingTitle.

Comment thread src/leaf/render-checks/words.js Resolved
`droppedNames` asked whether the rendered widget still opened with its name,
and command-hub's task module sets a generated status line before the task's
title, so every task was reported though its name still stood and labelled
the row. The check now asks whether the name's words still stand anywhere in
the widget's tree, which a shadow stage keeps too, so it reports only a
module that removed them.

def _opening_names(markup: str) -> list[dict]:
"""Each widget with an id whose name opens it (`leading_title_holder`), and the
name's words, which the rendered widget must still open with (`droppedNames`)."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

droppedNames now looks for the name anywhere in the rendered widget, so this half of the docstring states the rule the push replaced.

Suggested change
name's words, which the rendered widget must still open with (`droppedNames`)."""
name's words, which the rendered widget must still show (`droppedNames`)."""

@max-sixty

Copy link
Copy Markdown
Owner Author

given this is intended as a simplification, how does it add LOC??

we're trying to strip out layers!

@max-sixty
max-sixty merged commit 1740bb5 into main Nov 16, 2026
5 checks passed
@max-sixty
max-sixty deleted the grind/5595 branch November 16, 2026 10:35
@leaf-agent

leaf-agent commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

It nets about +1,060 lines (+3,627 / −2,570 over 268 files). Removing x-name and label does take out a layer, but it adds a cost that is larger. A label attribute was invisible, so a widget could draw it wherever it wanted. A leading <strong>/<header> is content the page already shows. So every widget that draws its name somewhere else, like a tab strip, a side list, a pane or a playground control, now has to find the title in the markup, copy it, and then hide or restyle the original. And because the name is now markup, both checks have to police what it may contain and whether a module removed it.

Area Net Main sources
Tests +435 nested_name_cases.json (new, +75), test_playgrounds.py +59, nested-name.test.mjs (new, +30)
Browser and package JS +314 playground-view.js +78, leading-title.js (new, +58), lf-tabs.js +47, version.js +44, lf-text-document.js +26
CSS +229 tabs.css +103 (hiding the panel's own name, or restyling it as an eyebrow, once the strip shows a copy), text-document.css +61, worktrees.css +33
Python +131 validation/instances.py +73 (which names may hold interactive content), render-gate readings.py +20 (the dropped-name check)
Examples, evals, other −116

My earlier reviews are responsible for some of the growth. The shared nested-name cases, the dropped-name render check, the modules that now keep a name instead of replaceChildren-ing it away, and making a rename reach the tab strip were all fixes for findings I raised. I also approved the change without weighing what it added against what it removed, which Weigh what a change adds asks the reviewer to do. I tried to dismiss that approval, but GitHub accepted the request without changing it, so it still shows as approved. Please treat it as withdrawn.

If the goal is fewer layers, the parts that seem to buy the least are the copy-then-hide steps in lf-tabs, lf-parts and playground-view. One way to remove them is to have the control that shows the name use the authored element itself, through a <summary>-style disclosure or by referencing it with aria-labelledby, rather than copying it. I haven't prototyped that, so I can't say how much it would save.

leaf-agent added a commit that referenced this pull request Nov 16, 2026
… two tests for #6088 (#6167)

#6088 (name every widget by the markup it opens with) turned three
browser tests red on `main` in push run
[43850158443](https://github.com/max-sixty/leaf/actions/runs/43850158443).
Each one passes on #6088's parent `66ce9db8f` and fails from `1740bb536`
on, including current `main`. One of the three is a real performance
regression in `tabs.css`. The other two are tests whose premise #6088
changed on purpose. With this change, all three pass locally, along with
the 43 tests in `tests/browser/widgets/test_tabs.py` and
`tests/browser/navigation/test_tabs.py`.

- **`test_resolving_a_thread_restyles_what_focus_marks`.** Resolving a
thread restyled 264 elements on a page of 4 sections and 404 on a page
of 24, so the cost grew with the page. Reverting #6088's stylesheets one
at a time narrowed it to `tabs.css`. Within that file, the culprit is
the nested `& + *` rule that sets the top margin of the block after a
tab panel's name. Nesting expands `&` into an `:is()` that holds a
complex selector. Written out flat, the rule matches the same elements
and the test passes. On a row strip and on a side list, the following
block's computed `margin-block-start` and `--lf-frame-start` are the
same before and after the change, so nothing on screen changes.
- **`test_the_g_chord_selects_a_visible_tab_hint`.** #6088 gave each tab
an id (`lf-tab-<panel id>`) so that its panel can be `aria-labelledby`
the tab. A go-to hint's `data-lf-go-to-target` uses the member's own id
before `aria-controls`, so the hint now names `lf-tab-tab-bath` instead
of `tab-bath`. The hint still selects and focuses the tab. The test now
addresses the tab by its new id.
-
**`test_design_mode_reads_each_shape_of_control_into_the_anchor_its_routes_carry`.**
Its "generated words stay out of the anchor" subtest relied on the
queue's `summary="pages"` attribute being generated text. #6088 moved
the summary into authored markup in the panel's `<header>`, so "Backup
pages" is now the page's own words, and the subtest's premise no longer
holds. This change removes the subtest.

A fourth new failure in that run is not part of this PR:
`test_a_package_feed_keeps_a_rewrite_where_a_card_would` lost the end of
a typed rewrite across a reload. It passes unloaded, and it is tracked
separately from #3985.

Refs #3985 — automated triage

Co-authored-by: leaf-agent <[email protected]>
@max-sixty

Copy link
Copy Markdown
Owner Author

this seems like a bad economy: if we need some data on the name for other items, then it makes sense to have it structured.

what are a few examples of where something else needs the name?

let's revert this in the meantime

@leaf-agent

Copy link
Copy Markdown
Collaborator

The revert is #6172. It undoes #6088 and its follow-up #6167, and it keeps one unrelated test update from #6088 for #6097's clock-time message heads.

To answer your question, here is where code other than the widget itself uses the name. Each line links the restored label read:

  • A tab strip and a page's parts list. The strip draws each panel's name as its tab, and that name also becomes the panel's aria-label (lf-tabs.js). The parts list shows the name with summary under it.
  • Board columns. The name is the column's header and aria-label, and it is the target in the keyboard and screen-reader announcements: "Move X to Doing", "grabbed — To do, position 2", and the move's says text (lf-board.js).
  • Playground controls and presets. The name becomes a radio's label or a preset's button (playground-view.js).
  • Panes, text documents, samples and worktrees. The name becomes a region's aria-label, a document's caption bar, an iframe's title, or a worktree row's title.
  • What Leaf tells the agent. An obligation on a widget states its prompt as the widget's name. element_name reads it on the server (obligations.py, gesture_words.py), and the browser's work view titles a goal with the same name (work.js).

None of these shows the name where the author wrote it. Each one puts it in a control, in an accessible name, or in words sent to the agent. That is why moving the name into the content cost more than it saved: each consumer then had to find the title in the markup, copy it, and hide or restyle the original, and both checks had to police what the name may contain. As a structured attribute, the name is a string that each consumer reads directly.

max-sixty pushed a commit that referenced this pull request Nov 16, 2026
max-sixty added a commit that referenced this pull request Nov 16, 2026
…sion reach a template's markup (#6222)

A tab or part can now show markup in its list entry that text can't
hold, such as a file's name in code type over a coloured diffstat. The
part opens with a `<template>` holding that markup, and the list shows
it as written in place of the label and summary. `label` stays the name
that accessible names, On Me and the server's words read. Ref #5595,
which #6088 closed and #6172 reverted.

```html
<lf-part id="readme" label="README.md" summary="+120 −45 lines">
  <template><code>README.md</code><br><span class="added">+120</span> <span class="removed">−45</span> lines</template>
  <article class="layout-column">…</article>
</lf-part>
```

Max chose this on the x-keys-design page: keep the name structured and
let the agent write whatever the list shows, rather than deriving the
name from markup as #6088 did (about 1,060 lines more). Leaf derives
nothing from the template; a template is HTML's element for markup not
shown where it is written, so the open part needs nothing hidden or
restyled.

**What changes**

- `lf-tabs.js` (lists of tabs and parts): a member's leading template is
drawn, once copied, in its entry; the tab's accessible name still reads
`label`.
- `version.js`: a revision that changed only a template's markup never
reached the page, for any template. A template's markup is its content,
which `isEqualNode` leaves out, so the patch kept the old one.
`sameAuthoredMarkup` now compares template content, and a member list's
shell carries each member's face, so a rewritten face replaces the set
as a changed `label` does. The new test fails without either half.
- `page-layout.md`: one paragraph saying when to write a face, and to
keep links and controls out of it.

**Checked**: the new tab test (entry markup, accessible name, the open
part not showing the template, a revised face reaching the list); `page
check --render` on a page of parts with faces; Chromium and Firefox
stills; `pnpm run test:runtime` (995); `check:browser`; the
revision-patch and live-sample tests that revise pages holding
templates. The instruction paragraph, scored paired with base on
`parts-take-their-own-layouts` and `queue-is-a-side-list`, two runs
each: 4/4 on both arms, and no head page wrote a template where text
would do.

> _This was written by Claude Code on behalf of max-sixty_
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.

Let a part's or tab's name and summary hold markup

2 participants