Skip to content

Show a tab's or part's face from its leading template, and let a revision reach a template's markup - #6222

Merged
max-sixty merged 3 commits into
mainfrom
x-keys-design
Nov 16, 2026
Merged

max-sixty merged 3 commits into
mainfrom
x-keys-design

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

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.

<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

…as its name

Prototype for the x-keys-design page: a member that opens with a <template> shows a
copy of it in the list in place of its label and summary, so a file part can show
its name in code over a coloured diffstat. label stays the name: the tab's
accessible name and every reader that takes only text. No test or instructions yet;
they follow if the face is kept.
…sion reach a template's markup

A list entry can now show markup text can't hold, such as a file's name in code
type over a coloured diffstat: the part or tab opens with a <template> holding it,
and the list shows that markup as written in place of the label and summary.
label stays the name every other reader takes.

A revision that changed only a template's markup never reached the page: a
template's markup is its content, which isEqualNode leaves out, so the patch kept
the old template. sameAuthoredMarkup now compares template content too, 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 tab test fails without either half.
@max-sixty
max-sixty merged commit 397534c into main Nov 16, 2026
5 checks passed
@max-sixty
max-sixty deleted the x-keys-design branch November 16, 2026 23:27
max-sixty pushed a commit that referenced this pull request Nov 27, 2026
…margin entries by the words they show (#7403)

axe-core 4.14 (brought in by #7289 through axe-playwright-python 0.1.9)
runs `label-content-name-mismatch` (WCAG 2.5.3, Label in Name) by
default. Leaf's controls whose accessible name leaves out words they
show now fail the nightly render gate and the chrome sweep. This PR
names each Leaf-owned control by the words it shows, so a voice-control
user who says what they see reaches it. The render gate now passes on 13
of the 15 pages the [scheduled
run](https://github.com/max-sixty/leaf/actions/runs/45985529285) failed.
The two left are the file-tree pages, whose rows a dependency draws
(below).

**What a screen reader hears differently** (nothing changes on screen):

| Control | Before | After |
|---|---|---|
| Floating panel tab | "Threads", described "2" | "Threads 2" |
| `lf-tabs` row (side list / parts) | its `label`; summary, answer and Δ
only in the description or hidden | label, summary, answer line and
change count, as shown; the description keeps the group and only the
state the name leaves out ("Answered", "1 of 3 answered"); a
template-faced row keeps its label as name and its full description |
| Diff line number, unchanged line | "Comment on a.rs · old line 258 ·
new line 256" | "Comment on a.rs · old and new line 258 256" |
| Trace image-scale button | "Image scale" | "Image scale, Fit" (or the
percentage) |
| Margin entry holding several threads | "Threads (2), …" | "Threads 2,
…" (axe drops parenthesised text) |
| rust-sort / wt-merge speed button | "Playback speed" | "Playback
speed, 2×" |
| github-discoveries avatar | a second link named after the repo |
hidden from assistive tech and the tab order; the repo link beside it
stays |

An `lf-tabs` tab showing an authored `<template>` face keeps `label` as
its name, as #6222 settled. The diff gutter gains a whitespace text node
between its two number cells. axe joins adjacent cells' text with no
space ("258256"), and the gutter's grid draws nothing for the space. The
rejected panel-tab naming and the new `lf-tabs` rule are recorded in
each module's header.

**Verification.** On `main`, a probe running only this rule reproduced
every finding the CI log lists. With the change,
`tests/journeys/test_render_gate.py::test_page_fixture_renders` passes
locally for alert-review, github-discoveries, pr-walkthrough,
review-parts, review-a-fix, rust-sort, wt-merge, diff-thread-gallery,
playwright-trace-gallery, worktree-diffs, thread-panel-gallery,
playwright-paired-results and sidebar-contents. The tab, floating-panel,
margin-status, code-review, anchors and trace browser tests that pinned
the old names pass with updated assertions. `pnpm run check` and
pre-commit pass.

**What this leaves on #7393:**

- `file-tree` and `file-tree-input`: `@pierre/trees` 1.0.0 (the latest
release) names a row by its path (`getFileTreeRowAriaLabel`) and draws
the git-status letter (M, A, D, R) beside it, outside that name. The fix
belongs upstream, or in a decision on how Leaf configures the tree.
- `test_the_chrome_a_key_opens_has_no_serious_violations`: once the
panel tabs pass, the sweep reaches the command reference. Each option
there is named by its title alone (`aria-labelledby`), while the row
also shows its key chips and description. Whether the key reference's
names should include its keys and descriptions is a separate call about
what every screen-reader user hears in that list.

Refs #7393 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
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