Skip to content

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

Closed

Description

@max-sixty

A part's label and summary, and a tab's, are attributes, so they hold only plain text. The tab strip copies them into the tab as text runs (.lf-tab-name and .lf-tab-summary in lf-tabs.js). A page of parts that lists files can't colour a diffstat in each row, or set each file name in code type:

README.md
+120 −45 lines

with +120 in the added colour and −45 in the removed colour, as git diff --stat and forge file lists show them. The .lf-tabdiff count beside a row's name looks like the place for it, but it counts the version diff's marked passages and isn't authorable.

Markup can't go into the attribute itself. An attribute value is a string, and parsing it as HTML would hide that markup from leaf page check, comment anchoring and the version diff, which all read the page's elements.

Being a name doesn't need plain text either. Leaf already names a section by its heading and a disclosure by its <summary>. addressableName in the browser and gesture_words.element_name on the server flatten that markup to words wherever a name must be text: the accessible name, the On me list, a thread's anchor, the activity feed. Fourteen elements, lf-part and lf-tab among them, instead declare a label attribute as their name with x-name.

Expected. A part or tab takes its name and summary as markup, the way a section and a disclosure do. One shape reuses the leading-title rule: a leading <header> whose <strong> or heading names the part and whose next element is its summary, beside the child carrying its Layout.

<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 strip draws the header's phrasing in the tab. The tab is a control, so the header holds phrasing only, with no links or buttons, and the tab's accessible name and description take its words. The other x-name elements could follow the same rule, leaving attributes for values such as ids, choices and references.

Seen on leaf 227ccc2, installed 2026-11-05T18:11:37-08:00.

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

Activity

  1. added
    enhancement
    on Nov 6, 2026
  2. leaf-agent commented on Nov 6, 2026

    @leaf-agent
    Collaborator

    This is a feature request with a settled direction. I haven't opened a PR, because two choices below decide how the strip relates to the authored header, and Leaf has no rule yet for one of them.

    The name half already works on both runtimes. gesture_words.leading_title_node and the browser's leadingTitle already look inside a leading <header> for its <strong> or heading (gesture_words.py, addressable-names.js). Once lf-part and lf-tab stop declaring "x-name": "label", element_name and addressableName name the part in your example README.md with no new code, and tests/name_cases.json can hold that case. Removing label from required and properties makes page check reject the old attribute, so an agent's next attempt sees the change.

    The summary half needs a new shared rule. No reader takes "the element after the title" as a description today. The tab's aria-description is built from panel.getAttribute("summary") (lf-tabs.js). A summary rule belongs next to leadingTitle, as one reading the strip, the accessible description and any server reader share, so the tab strip doesn't keep its own copy.

    Choices that are still open:

    1. Does the header stay in the panel, or does it live only in the tab? If it stays, the strip draws a copy marked generated({ says: "echo" }), which element-markers.js already supports for "a copy of words the page says elsewhere". Comments and the version diff then anchor on the authored header in the panel, and the copy in the tab adds nothing to them. If it lives only in the tab, the strip shows authored nodes, and anchoring and the diff have to reach into the tab strip. The first fits existing mechanisms. The second avoids showing the name twice on an open part.
    2. Does lf-part still hold "exactly one child"? Its x-instructions say so today. The header becomes a second child, so the content model and soleSubstantiveElement's reading of the Layout child would have to skip a leading <header>.
    3. Phrasing-only enforcement. "No links or buttons in the header" is a rule an agent breaks without noticing in the browser, since the tab then nests one control in another. page check is the place to refuse it.

    The other twelve x-name declarations (timeline, playground, playwright, diff and the rest of default) could move to the same rule afterwards. Doing that in the same change would turn x-name into a declaration nothing uses, and it could then be removed from schema.py and browser/registry.json.

    If you pick an answer to (1), the rest follows from the code: the registry change, the strip rendering the header's phrasing, the shared summary reading, the eight files under examples/, docs/, skills/ and packages/ that write <lf-part label=…> / <lf-tab label=…>, and the tests that read .lf-tab-name / .lf-tab-summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions