Skip to content

Name plain markup by its declared ARIA name before the heading it opens with - #6283

Closed
max-sixty wants to merge 3 commits into
mainfrom
structured-obligation-names
Closed

max-sixty wants to merge 3 commits into
mainfrom
structured-obligation-names

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

A name the author declares on plain markup now comes before Leaf's own reading of it, in both runtimes. aria-labelledby (the words of the elements it names, by id), then aria-label, then a fieldset's <legend> name a section, a div or a question's group before the heading a section opens with. A registered widget's name stays its label; an aria-label or aria-labelledby on one is only the chrome's fallback where it has none, as an aria-label was before. Root AGENTS.md's "Read what the page states" asks for this: a declaration is a fact, and the opening-heading rule (#6264) is the exception the maintainer agreed to.

Each runtime now has one ARIA reader. In Python, group_name becomes aria_name: element_name calls it for plain markup, page check still requires it of a question's group, and a widget's prompt is its group's element_name, which equals aria_name for every group the check accepts. In the browser, ariaNaming names plain markup in addressableNaming, and accessibleNaming reuses it, so a control's aria-labelledby now names it before its <label>, as ARIA orders them. labelledBy moves into addressable-names.js from preview.js. Authoring.by_id replaces the two id maps that obligations.py and the check each built.

What to weigh: a declared name can withdraw a heading's title but never give one. A section whose aria-labelledby names its opening heading is still that heading's. One whose aria-labelledby names a later heading, or whose aria-label names it, is no heading's. That keeps which heading heads which part in reading order. Letting aria-labelledby make a later heading the section's title made partOver cycle between the two headings, so counting a heading's conversations overflowed the stack; a test now covers that case. Two cases still differ between the runtimes. Python reads a name's words as raw text, so a referenced <br> reads "FirstSecond" where the browser reads "First Second", as heading names already do. Python also can't resolve an id inside an SVG.

Max asked for the declared-name clause when he picked #d2 on the design page for how Leaf takes names from markup. It waited for #6256, so that Python keeps one ARIA reader. tests/name_cases.json gains seven cases that both runtimes pass. Runtime suite, check:browser, and the obligation, interaction and delivery model tests pass. Codex reviewed it; its findings are fixed or listed above.

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

…ns with

A section, div or question group's aria-labelledby, then aria-label, then a
fieldset's legend now name it before Leaf's own opening-heading reading, in
both runtimes. Registered widgets keep `label` and take no ARIA name.

Python's group_name becomes aria_name, which element_name calls for plain
markup and page check still requires of a question's group; a widget's
prompt is its group's element_name. The browser gains ariaNaming, used by
addressableNaming and accessibleNaming, and labelledBy moves from preview.js
into addressable-names.js. Authoring.by_id replaces two hand-built id maps.

A declared name withdraws a heading's title but never gives one, so which
heading heads which part stays in reading order: letting aria-labelledby
title a section by a later heading made partOver cycle between the two
headings and overflowed the stack in conversationsAbout (Codex review).

Max asked for the declared-name clause when he picked #d2 on the
markup-meaning page; it waited for #6256 so Python keeps one ARIA reader.

@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.

A registered widget's aria-label no longer names it in the chrome. ariaNaming returns null for every registered element, and accessibleNaming now goes through it in place of reading aria-label itself, so the guard meant for addressableNaming (where label owns a widget's name) also removes the aria-label fallback in ownNaming. Bundled packages use this pattern (lf-timeline, lf-motion and lf-file-tree in their registry examples, lf-tabs, and lf-widget-builder in examples/dynamic-widgets.html). With <section><h2>Rollout</h2><lf-timeline id="it" aria-label="Deploy order">…</lf-timeline></section>, addressableLabel gives "Deploy order" on main and "Rollout" on this head. So an On Me row, thread anchor or feed row about that widget falls back to its section's name. Moving the guard to addressableNaming keeps the new rule and restores the fallback (suggestions below). The comment above ariaNaming would then say that addressableNaming skips ARIA for a registered widget, not that ARIA names none.

Comment thread browser/runtime/addressable-names.js Resolved
Comment thread browser/runtime/addressable-names.js Resolved
…preview.js

The leaf-agent review found that skipping ARIA for every registered element
dropped the aria-label that bundled widgets such as lf-timeline carry from
On Me rows and feed rows; only addressableNaming skips it now.
leaf-agent
leaf-agent previously approved these changes Nov 17, 2026
…-names

# Conflicts:
#	src/leaf/obligations.py
#	src/leaf/validation/instances.py
@max-sixty

Copy link
Copy Markdown
Owner Author

Closing: Max chose a Leaf element, lf-group, whose label names a group, so Leaf reads no ARIA to name anything. Plain markup keeps the name its opening heading gives it (#6264). #6289 moves onto main without this change, and the lf-group build follows it.

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

@max-sixty max-sixty closed this Nov 17, 2026
max-sixty added a commit that referenced this pull request Nov 17, 2026
… from an attribute (#6289)

An option's and a board card's title move from a leading `<strong>` to a
`label` attribute, which the widget draws as its heading (`words.says`),
as a tab's and a column's are. `recommended` becomes a boolean attribute
that draws the badge, in place of a `<small class="tag
ok">recommended</small>` chip whose words Leaf read. On Me's description
of an option is its sentence: its words up to the first element HTML
sets apart from a line of words, less `<small>` side comments such as
chips and any SVG drawn among them, where a walk read computed style.
`phrasing` joins the package API for that. A thread message's words,
which name its thread and its On Me row, hold its options' labels, as
the drawn message does. With titles moved, no widget takes a name from
its markup, so the walk that found a widget's leading heading, summary
or `<strong>` is deleted in both runtimes (`addressable-names.js`,
`gesture_words.py`); plain markup keeps its caption rule. Root
`AGENTS.md`'s "Read what the page states" asks for this.

A codemod moved about 470 options and 110 cards across examples, docs,
references, tests and evals. The 2 titles that held `<code>` became
plain text. `page check` gives advice where a widget that takes `label`
leads with a `<strong>`, the habit 3,076 options on real pages still
follow.

What to weigh:

- **One visual change, left to Max.** Chips that stood above a card's
title now follow it and lead the line its words start on. Where cards
are laid across with different chips, their sentences no longer align,
though their titles do. Keeping chips above the title needs a placement
rule in both runtimes that reads where chips stand. The markup-meaning
page puts this as #d5, with stills. Stills of 14 decision and board
states show no other pixel change.
- **Before the runtime dresses the page, or without script,** the theme
paints the title from the attribute, but a recommended card shows no
badge.
- **A labelled option or card is now a part** in previews and thread
trails, as a tab is. Before, an option's `<strong>` title named the
option alone, and the part went on to its question.
- **The title is written after the pick mark,** by `lf-options` where it
upgrades first, because the mark's float has to come first to stand on
the title's line. Labelled cards trim only their frame's end, so a
figure after the title keeps its margin.

Max picked `label` as #d3 on his design page for how Leaf reads markup.
It targets main: #6283, which it stood on, closed when Max chose an
`lf-group` element over reading ARIA names, so it reads no ARIA. The
runtime suite, `check:browser` and the model tests pass on this head,
and the option, board, On Me and obligation browser tests that read
titles or descriptions passed before main was merged in. Codex reviewed
it; its findings are fixed or listed above.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 17, 2026
`lf-group` is a named group of whatever it holds. Its `label` names it
wherever Leaf names it, such as On Me, a link to it or a thread on it,
and the group draws none of it: any heading the group shows is the
author's own HTML inside it, so the name is data apart from the title on
the page. A widget that asks inside a group takes the innermost one as
its question: the label is the question's words on On Me, and the group
is where `m` lands. It replaces the question group written in HTML
(`role="group"` named by `aria-labelledby` or `aria-label`, or a
`<fieldset>` named by its legend), so Leaf names no group from ARIA:
Leaf's own elements are named by `label`, and plain markup by HTML's
structure. Max chose this over #6283, which read ARIA names more widely,
as #d6 on his design page for how Leaf reads markup, and asked that the
group draw no title.

The kernel declares the role (`reading-role: group`), so the obligation
reader in both runtimes and the workspace's full-height rule read the
role, not the tag. Where a thread message draws without its widgets, a
group that asks nothing keeps what it holds. `group_name` and the
`question-group` finding go; `page check` still refuses a widget that
asks with no group round it. 465 groups moved across examples, docs,
evals and tests, each keeping the heading its author wrote.

What to weigh:

- **A question's words are written twice**, in the group's `label` and
in its heading, and nothing holds the two together.
- **A group is not a section**, so CSS written for `section` no longer
reaches a question. Stills of six question states against main change
only the feature gallery's "lf-group" eyebrow words.

It builds on #6289, which has merged. The runtime suite,
`check:browser`, the model and process tiers, page checks of the 21
changed examples and site pages, and the browser tests edited by hand
pass locally.

> _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.

2 participants