Skip to content

Build every press by a role, and check that each one is - #5118

Merged
max-sixty merged 69 commits into
mainfrom
press-family-check
Nov 3, 2026
Merged

max-sixty merged 69 commits into
mainfrom
press-family-check

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Every button Leaf builds now wears one of the roles in control-faces.js, and a test fails on any button that doesn't. Before this, the only check refused code that spelled a role's classes. A <button class="lf-foo"> whose own rules drew a face passed unnoticed, so two controls of one kind could look different side by side. The floating panel's 26px symbols beside a thread's 28px ones were one case.

The check

test_every_press_is_built_by_role (tests/model/test_interact_layer.py) reads every press the runtime and bundled packages build, through presses in tests/js_facts.mjs. It parses templates, document.createElement("button"), offer/offerAction/offeredAction/roleElement, selectableOffer/selectableOffered with the button role, copyControl, and a template writing actionClass(...). A selectable offer of another role, such as lf-tabs' tab, chooses what shows, as a native radio does, and is not a press. A press passes only when a role builder dresses it, including through a const (or never-reassigned let) it was made into. There is no exemption list. dev/tests/test_js_facts.py holds fixtures for each shape, including controls that must still fail.

Presses moved onto existing roles

  • The floating panel's own word face, lf-fp-face, is deleted. Its tabs, Discuss, Reply, Compare, Dismiss and plan heads wear the word face.
  • A plan step's On me, New reply, the activity feed's links, the older-version notice's Latest and the file editor's conflict wear the inline face.
  • The leaf, the row ends' marks, the file editor's Retry, the board's grip (with a six-dot move symbol), and the composer's Send and Dictate wear the symbol face. Send and Dictate keep the accent disc they share with Resolve.
  • The Resolved heading is a row. Copy triggers are built through copyControl({role}) or copyControl({trigger}).
  • The command reference is a listbox of button role=option rows on the row role. Each option is described by its keys and explanation, whether or not it can run.

New roles

  • answer: On me's choices in the panel.
  • entry, reaction and response: a reaction wears the role of where it stands, so no press needs two. It is reaction in a message's strip, entry in the margin, and response in the response bar, which Comment and Suggest wear too. One rule owns a reaction's states in both the strip and the bar. Each role's face class is separate from the semantic hook the scripts query (lf-margin-entry, lf-react).
  • gutter: a diff's line number where it takes a comment. Where it takes none, it is a plain number.
  • picture: a picture that opens the viewer. A message's own picture is built by offerContentElement, which writes the face class without lf-ui/data-lf-gen, so it stays message content to anchors.
  • fold: the line a folded group stands as, which opens and closes it, a settled decision's "Settled · …". Its face moved unchanged from options.css.
  • proxy: the hidden presses only the keyboard or a screen reader reach: a block's comment note, a picture's response proxy and a gloss's mark. Focus on a note or picture proxy now rings what it stands for (the block, the picture, or a declared part in its own outline) and brings it into view, on any focus, on every page whether or not it loads the annotation overlay. This replaces the framed card that appeared at the window's head. The ring is the chrome's target painter (target-paint.js), shared with the target trace. A note moves with its block when the block is redrawn, so focus survives.

What looks different

  • A selected panel tab or a pressed Compare shows the toggle's accent frame instead of a faint wash.
  • The Resolved heading is in ink.
  • The file editor's Retry is a muted symbol, and Not saved is inline words in the warning tone.
  • Board columns are about 6px narrower, since the grip takes the symbol's 28px box.
  • The command reference's focus ring sits inside the row.
  • A screen reader on a comment note sees its block ringed instead of a card.
  • In the panel's passing notice, such as the one a Resolve leaves, only Undo is a press, in the accent of every press among words. Before, the whole notice was one press, with Undo in ink.

Margin entries, reactions, the response bar, Send and Dictate are unchanged to the pixel in before/after stills, light and dark.

Also

  • The toggle's selected face moved from integration.css into controls.css beside the faces, and the composer's glyph actions restate their pressed state. Listening Dictate no longer shows a chip frame in the panel's field. A probe of every word, symbol and authored button on twelve corpus pages found no other change.
  • namedAction is removed: its one caller, the floating panel's Close, is built by offeredAction like every other symbol. nameAction is the one way to give a symbol a new action.
  • leaf-dev stills gains states for the moved presses, focused proxies, and listening Dictate.
  • browser/AGENTS.md, controls.css's header, module-authoring.md and module-reading.md describe the current roles and copyControl.

Most of the remaining diff is the rebuilt kernel under dist/kernel/.

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

Several controls and marks drew a look of their own where Leaf already has one,
so two of a kind stood side by side drawn differently, as a message's Edit did
beside the thread's own controls.

Symbols now wear the symbol face (`.lf-icon-action`), set to their surface's
height through `--lf-icon-action-face` where they need one:

- The floating panel's Show, Undo, Find, Show on page, Resolve/Reopen and More
  room were `.lf-fp-icon-btn` presses in the panel's 72% ink with a 5% wash;
  now they rest in the muted ink and take the chip under the pointer, as the
  open thread's own controls beside them do. Resolve and Reopen take the card's
  face (response.css), which the panel's copy had drifted from, and a view's
  symbols follow the panel's press height, a line under a finger.
- A recording's Play and Full screen, a heading's Copy link, and the Copy of
  About this page's diagnostics. A symbol on Web Awesome's copy button draws its
  face on the host, and its button fills it and takes the press, as a mark's
  already does.
- lf-motion's Play draws its action's symbol (`showAction`) instead of an SVG it
  built and stroked itself.

A toggled symbol, such as Find while it searches or More room while it widens,
wears the toggle's selected face that a word toggle wears.

Counts wear `.tag`: lf-tally's count (`.tag.ok` once answered), and a tab's and
a settled decision's count of changed passages, which share
`.tag.lf-change-count` in the tint of the changed words. The unread dot is one
class, `.lf-unread-dot`, on a reply, a row of Threads, the On me mark and the
folded leaf. An activity row's link takes the page's link underline, the tab
strip's edge presses draw the previous and next symbols rather than ‹ and ›
glyphs, and lf-file-editor's icons take Leaf's stroke.

The panel's rows, answer choices and row end, margin entries, reaction chips and
the response bar keep their own families (controls.css).
# Conflicts:
#	dist/kernel/kernel.json
Main's On me card drew a to-do's Done with .lf-fp-icon-btn, which this branch deleted; the answer family now centres a symbol answer in the panel's muted ink, as that class did.
… agent-ae20455a54a54692e

# Conflicts:
#	dist/kernel/kernel.json
Building it by role gave it the action's name, Show on page, which the tests that find it and the card's tooltip called Show.
# Conflicts:
#	browser/runtime/floating-panel.js
#	browser/runtime/video-controls.js
#	dist/kernel/kernel.json
#	dist/kernel/leaf.js
#	dist/kernel/runtime/bundle-data.js
The role check refused code that spells a role's classes, but a press built
outside the role builders with a face of its own passed it. That is how a
message's Edit and Add reaction, and the floating panel's symbols, came to
draw a 26px face beside the thread's 28px symbols.

`test_every_press_is_built_by_role_or_family` now reads every press the
runtime and the bundled packages build: each `<button>`, or element marked
`role="button"`, in a template or HTML string, and each "button" made by
`offer`, `el` or `document.createElement`. A press passes when a role's
builder dresses it, whether `offeredAction` in its tag, a directive or `ref`
callback it names that calls one, or `offerActionElement` taking the element
as it is made. Otherwise one of the classes it is built with must belong to a
family in `PRESS_FAMILIES`, the one list of presses that keep a face of their
own, each with the reason no role serves it. On failure the message names
both ways out: build the press by role, or add its class to a family with its
reason for a reviewer to weigh. A family class that no press outside the roles
wears also fails, so a family shrinks as its presses move onto a role.
Drawing a press's symbol and name from its action (`showAction`, and
`nameAction` on main) gives it no face, so such a press still needs a role or
a family. A role set by script on an element made elsewhere, as a margin
entry's host writer sets it, isn't read, and neither is a copy control built
by `copyControl`, which makes a `wa-copy-button`.

The families are margin entries, reaction chips, the response bar, rows, the
panel's answers, the panel row's ends, the panel's words, the composer's
actions, pictures, disclosures, keyboard stops, grips, line numbers, news
notices, links, status presses, and message controls. Message controls is the
known duplicate: branch message-copy-markdown builds them by role, and the
check fails there until it deletes the family. controls.css's prose list and
browser/AGENTS.md now point to `PRESS_FAMILIES`. The check shares the role
check's module walk (`_bundled_modules`, `_uncommented`).

Presses changed so that the check can read them:

- lf-board's Move to buttons, shown under a finger on a narrow board, were a
  word with a framed chip on the field ground, the face words dropped on 25
  October. They are now built as the word role and wear its quiet face.
- A margin entry host is made with `lf-margin-entry`, which
  `presentContributionEntry` added right after anyway, so nothing visible
  changes; the unused `className` parameter is gone.
- The panel's tabs carry `lf-fp-tab`, the class the panel's words family names
  them by.

Checks: planting `<button class="lf-demo">` with its own face in
page-inspection.js fails with that message, as do a planted `<span
role="button">`, `offer("button", …)`, `createElement("button")` and a
`namedAction` press on the panel's old face; removing them passes again. Run
over main's tree, which still has the panel's own symbol faces, the check
flags those `lf-fp-icon-btn` presses and the recording's Play and Full screen.
The role tests, the stylesheet and kernel-selector tests, and
`pnpm run test:runtime` (692) pass, and the kernel is rebuilt.
# Conflicts:
#	browser/styles/floating-panel.css
#	dist/kernel/kernel.json
Web Awesome's copy button wraps its button in an unparted div, which the symbol
face's centring shrank to the icon, so the button, its focus ring and its reach
measured 16px inside the 32px face. The host now stretches that wrapper, and the
button fills the face (30px inside its 1px border on a heading's Copy link).

Found by the computed-face census; the heading-link and menu Copy link browser
tests pass.
# Conflicts:
#	dist/kernel/kernel.json
… agent-ae20455a54a54692e

# Conflicts:
#	dist/kernel/kernel.json
`test_every_press_is_built_by_role_or_family` now reads two more kinds of
press. A copy control, Web Awesome's copy button made by `copyControl`,
passes when its options name a role and otherwise needs a family's class like
any press. An element a module makes and then gives the role `button` by
script (`setAttribute` or `keeps`) is read by its making. An element handed to
the code that sets its role, as a margin entry's host writer is handed its
host, still can't be traced and goes unread.

Changed presses:

- lf-playground's Copy instruction stood on Web Awesome's own face: ink at rest
  and a 26px fill inside a 34x29 host, beside Leaf's symbols. It is now built
  with `role: "symbol"` and wears the symbol face, 28px, muted at rest with the
  chip under a hovering pointer, as a heading's Copy link does. Its own
  `::part(button)` rule and the unstyled `lf-quiet-action` class are gone.
- About's Copy diagnostics and the leaf's menu's copy rows wrap a trigger of
  their own, a word-role press and a menu row. Web Awesome hides its button
  behind a trigger in its default slot, so the host draws no face, and the
  trigger is read where it is built. They form a new family, copy triggers;
  About's host gains `lf-inspection-copy` so the family can name it.

Checks: planted presses (a `copyControl` without a role, a span given the
role by `setAttribute`, and one given it by `keeps`) each fail with the
check's message, and pass once given a role or a family class. The two role
tests, `pnpm run test:runtime` (694), and the browser tests that press Copy
instruction and Copy diagnostics pass, and the kernel is rebuilt.
# Conflicts:
#	browser/styles/components/controls.css
#	dist/kernel/kernel.json
…t pass one

The press check read modules as text, which let four cases through or failed
them wrongly:

- A family's class anywhere in a tag or call counted, so
  `<button class="own-face" title="lf-react">` and
  `offer("button", "own-face", "lf-react")` passed as reaction chips.
- A `className` was matched to a press by its variable's spelling across the
  module, so markdown.js's image button lent `lf-media-open` to any other
  `const button` there.
- Spacing hid a press: `document.createElement ("button")`,
  `<div role = "button">` and `<div role=${"button"}>`.
- A `>` inside a quoted attribute ended the tag, so
  `<button title="a > b" class="lf-react">` failed.

`tests/js_facts.mjs presses` now reads each press from oxc's tree. It returns
its line, its kind (a template's element, a made "button", a copy control, or
a role set by script), how a role's builder dresses it, and the classes it is
built with. Classes come only from where a class is given: a `class`
attribute, a builder's class argument, or a `className` given to the same
binding. A name is followed through the lexical scopes that bind it, and
`this.name` through the enclosing class. Templates and HTML strings are read
with parse5's tokenizer, so quoting holds; each `${…}` stands in as a marker,
and an expression standing as an attribute name is the element part, where
`offeredAction` or a `ref` callback dresses the press. parse5 8.0.1, already
locked for jsdom, is now a direct dev dependency.

The test keeps `PRESS_FAMILIES`, the failure message and the check that every
family class still names a press that needs it. The regex helpers it
replaces, `_reach`, `_opening_tag`, `_binding`, `_uncommented` and the old
`_presses`, are gone. dev/tests/test_js_facts.py holds the four cases as
fixtures beside presses each kind of building reads.

Checks: the role tests and the js_facts tests pass. Planting the four cases,
a face of its own and a copy control without a role in page-inspection.js
fails each with its tag or call, except the quoted `>` press, whose
`lf-react` now reads as its class. A fixture read with the class argument
widened to every argument, or with a `className` matched by spelling, fails.
`pnpm run check:browser` passes with the new dependency.
Four ordinary cases still gave the press check a wrong class:

- A `className` given to a parameter was lent to any made element bound to
  nothing, since neither lookup found a binding. An assignment now reaches
  only a press bound to the declaration it names.
- Joined text read as classes: `"lf-react" + "-icon"` and
  `class="lf-react${suffix}"` gave `lf-react`. A word counts only when it is
  whole and static; one that touches a join or an expression is unknown and
  gives nothing.
- A template's markup was its raw text, so an escaped quote, as in
  `title=\"a > b\"`, ended the tag early. It is now the cooked text Lit
  receives.
- Lit's `classMap` was unread. Each static key whose value isn't literally
  false is now a class.

dev/tests/test_js_facts.py holds one fixture for each case, and each reads
wrong on the previous reader. The role tests and the js_facts tests pass, and
planted presses (a face of its own, and a joined family name) still fail the
check.
A reaction the user added wore the same grey chip and contour as a choice under the
pointer, so in the open palette yours and a hovered neighbour looked alike, and pointing
at your own changed nothing. It now rests on the accent tint inside an accent contour,
and the tint deepens under the pointer or focus, as an idle choice's chip rises. The
user picked this face from three candidates on the canonical-element-faces page.
Margin reactions keep their own family's face.

The reopened-picker test now holds the contour constant through opening, hover and
focus, and expects the tint to answer the pointer; it previously asserted that hover
changed nothing.
…thor beside held news

Four presses sit in a line of words and each drew a face of its own: a
thread's held news (bold 10px, danger red), the activity feed's notice
(underlined at rest), the floating panel's Next unread (body weight, a grey
wash under the pointer) and a retained quote's Full quote (muted 12px, a
wash). They are now built by a fifth control role, `inline`, beside symbol,
word, commit and mark (`ACTION_FACES`, prepaint.js), whose one face lives in
controls.css: the accent ink at weight 600 and the size of the line the
press sits on, no chip, fill or border, underlined (offset 3px) under a
hovering pointer. A press announcing news waiting carries `data-lf-news`,
which the face draws in the danger ink, as it does the words a seat's
Resolved summary says its threads hold. The progress run's "Show N progress
messages" disclosure shares the class with Full quote and takes the face.

What changed for each:
- Held news: 600 at the head's line (`--t-6`, 11.5px) instead of 700 10px;
  in the panel's crumb it takes the crumb's 13px on a line an em tall, so
  its arrival still grows no line.
- The activity feed's notice: no underline until hovered. The feed states
  its line (`--t-5`, sans) once, on `lf-activity`, and the notice inherits it.
- Next unread: weight 600, no wash; it keeps its symbol, padding and height.
- Full quote: accent 13px (the quote's size) instead of muted 12px; no wash.
- The steps disclosure: 11.5px (its head's size) instead of 11px.
Each surface's colour, size, weight, decoration and ring rules for these
presses are gone, keeping only placement; `.lf-thread-notice` and
`.lf-thread-notice-news` no longer exist.

A margin card holding news cut the head of the user's message to "M51d ago":
the notice, drawn whole in the actions row, left the heads' track 41px. The
notice now takes at most the room a notice beside a head's words takes in a
primary reader (`--lf-news-width`, renamed from `--lf-primary-news-width`),
drops the facts past it and counts them, so the card reads "Me 51d ago
1 new reply +1". The count stands just past the last fact shown rather than
at the room's end, so it reads with the words, and its room is in the
notice's own size. Rejected: the time giving way while news waits, which
frees 43px, too little for a name beside a whole notice; and the notice
wrapping beneath the actions, over the first message's words. A phone's
320px card is still too narrow for the user's name beside its Edit control,
three 44px controls and the notice's first fact.

`floating-thread-unread` (and `-dark`) is a new stills state that offers
Next unread. `test_a_card_s_head_keeps_the_user_s_name_and_time_beside_news`
is new and fails on the base with the time cut; tests and stills that found
the notice by `.lf-thread-notice-news` find it by `.lf-thread-news`.
…for its first fact

On a phone's margin card holding news, the head of the user's message still
read "M51d ago": the notice stood at a notice's room (`--lf-news-width`)
whatever the head beside it needed. A margin card now measures that room: the
notice's width and the narrowest head's width beyond its padding, name, gap
and time, which the actions' track and the heads' track trade one for one
(thread-card.js, `#fitMarginNews`, `--lf-news-room`), watched as a time ticks
on. The notice takes no more.

Where even its first fact would be cut, the notice now says one count of all
that waits instead, "2 new", or "+2" where that doesn't fit either
(`data-lf-short`). The existing drop-and-count observer decides it from the
cut it already reads; the facts keep their places, unseen, so what it measures
doesn't change with what it shows and the accessible name still says every
fact. The count is the sum of the news's counts, a settling counting as one,
measured with the runtime's `textWidth`.

A desktop card is unchanged: the room is wider than a notice's, so it still
reads "Me 51d ago  1 new reply +1". A 320px phone card can't hold the head's
name, time and Edit beside three 44px controls and a 44px notice, so its
heads now give up the time before the name: annotations, then the time, then
the name, each with an ellipsis. That reverses #3104's order, in which the
time was never cut; the phone card reads "Me 5… ✎ 2 new".

`test_a_card_s_head_keeps_the_user_s_name_beside_news` now runs at a desktop
and a phone width; the phone case asserts "2 new" and "Me" whole.
27f92a8 had a margin card's head give up its time before its name. This
restores #3104's order: the annotations after the time first, then the
name, and the time is never cut. The defect was the notice drawn over the
head, which the notice's fitted room and its one count fix by themselves. A
phone's 320px card now reads "M 51d ago ✎ 2 new": the notice stands clear of
the head and the time is whole. Beside a finger-wide Edit, the name has no
content room left, so its first letter shows cut in its padding.

The margin card refits its notice's room when a head's time changes size,
in the next frame rather than inside the size observer's delivery, and
watches only the times, whose size the fit doesn't change. Fitting inside the
delivery resized boxes the delivery had already passed, which Chrome reported
as "ResizeObserver loop completed with undelivered notifications".

`test_a_card_s_head_stands_whole_beside_news` (renamed from
`…_keeps_the_user_s_name_beside_news`) now asserts on a phone that the
notice says "2 new" and stands clear of the head, the time stands whole and
clear of the Edit, and the name is cut with an ellipsis.
… agent-ae20455a54a54692e

# Conflicts:
#	browser/styles/components/controls.css
#	dist/kernel/kernel.json
# Conflicts:
#	browser/styles/components/surfaces.css
#	dist/kernel/kernel.json
#	dist/kernel/runtime/bundle-data.js
#	dist/kernel/runtime/widget-api.js
…ssage controls family

A message's private `#copyControl` method was read as a copy control with no role.
The message controls are now built by role (message-copy-markdown), so the stale
family check asked for lf-msg-control to leave PRESS_FAMILIES.
…e news count

A phone's margin card holding news read "M51d ago": the name, squeezed to no
room, kept the gap before the time as its own padding, so a sliver of its first
letter stood in the gap against the time (main's desktop card showed the same).
The gap is now the time's: the metadata carries it as padding, with its ground
over it as the name's was, so a name cut to nothing takes no box and the time
starts clean. Where a head the notice still leaves short would show less than an
em of its name, which is a sliver of a letter or of the ellipsis, the margin
card's fit gives the name no width (`data-lf-nameless`, thread-card.js). #3104's
order holds: the annotations, then the name, and the time is never cut. The
phone card reads "51d ago ✎ 2 new".

The fit reads a head's words at the fraction of a pixel they are laid out at,
from a range, rather than by scrollWidth, which rounds a whole name and counts a
cut one's ellipsis; a 0.3px shortfall had left a desktop head reading "M…".

The notice's counts, "+1" past its facts and the one count that replaces them,
stand out of the words' flow, so the face's underline under the pointer
stopped at the facts and "+1" read as something apart. They now inherit it
through the words. The one count hides the facts by visibility rather than by
a transparent colour, so the underline they still carried isn't drawn under
nothing; the title names the press while they are hidden.

The phone case of `test_a_card_s_head_stands_whole_beside_news` now asserts
that the name takes no box. Its desktop case no longer asserts the notice's
full facts: since main gave a head's Copy and Edit their room, the desktop card
says one count too.
# Conflicts:
#	dist/kernel/kernel.json
816f796 moved the 8px gap before a margin head's time from the name's padding to
the metadata's, so a name squeezed to nothing would leave no sliver of its first
letter there. The name's ground spans that gap so an annotation rising under the
head never shows through it, and
`test_a_stuck_card_head_keeps_the_name_and_lets_its_annotations_scroll_out`
checks that the gap reads as the name: with the metadata holding it, the point
left of the time hit the metadata, and the test failed in both widths. The
annotations themselves still scrolled out ("edited" moved 6px with the reply's
first line).

The gap is the name's again. A name the margin card's fit leaves less than an em
(`data-lf-nameless`, thread-card.js) now draws its letters transparent as well as
taking no content width, so the gap keeps the name's ground and shows no sliver:
a phone's card holding news still reads "51d ago ✎ 2 new". The phone case of
`test_a_card_s_head_stands_whole_beside_news` asserts the nameless name's letters
are transparent rather than that its box is empty.
…accent

Seven lists drew their rows six ways: the floating panel washed its rows in a 5% ink,
the command reference laid the word chip under its row, the Page Map darkened the
chip with 8% ink, a timeline step and a visual-review case took the generic offer
shadow, and a recording's moments took the word chip. The current row had four
faces: weight 600 in Versions, accent words on the accent tint for a recording's
moment, a 4% ink wash with an ink underline for a visual-review case (close enough
to its own hover that the two read alike), and the accent stripe on the tint for a
timeline step. The `word` role claimed to cover a row of a list or menu, but no row
wore it, and its muted ink would have dimmed every label.

A fifth role, `row` (`lf-row`, controls.css), draws them all: the label in the ink at
the list's own type; under the pointer or the keys (`data-lf-focus-visible`, or a
listbox's `aria-selected`) the offer's wash, now the token `--offer-hover`, laid over
the row's own ground as an image so a list's tint shows through; and the row the list
stands on (`aria-current`) on the accent tint with a 2px accent stripe at its start,
square-cornered. Every row keeps the stripe's room as a transparent border, so the
wash never hides the stripe and marking the current row moves no words. The user
picked this face from candidate captures (chip hover with stripe, wash hover with
weight, and this mix) on 28 October.

Moved onto it, each surface's own hover and current rules deleted:

- The floating panel's menu, Versions and Threads rows, On me's item lines, All
  pages' links, and the menu's Back. Versions marks its current row's press with
  `aria-current` (`menuItem`'s `current`) rather than weight; the wrapper keeps
  `data-current`.
- The view's Back is a row too, so both Backs are one face: chevron and destination
  in the ink with the row's wash. It reaches out past its words by its padding and
  the stripe room, so its words stay where they were.
- The command reference's rows (on the row, not the stretched button) and the Page
  Map's presses; a Page Map status keeps the stripe room so its words share the
  presses' edge.
- lf-timeline's steps, through `selectableOfferElement`'s new optional fourth
  argument, the action role whose face a selectable press wears; lf-trace's saved
  moments; visual-review cases, which stay square since a rule parts them.

Each list keeps what is its own: Threads lights a thread's passage under the
pointer (`.lf-mark-hover` still replaces the wash there), a timeline mutes the steps
still ahead, and the Page Map tints a thread on the user's turn with the wash over
it. Rows padded 2px less at the start where they had no border before, so words
stay put; a recording's moment gives back the 1px all round the word face's border
kept.

`selectableOffer`/`selectableOffered` and the TS declarations take the face role;
module-authoring.md lists `row` and drops the word role's claim to rows.
`test_no_rule_rounds_a_box_edged_on_one_side` now treats a transparent side as no
stripe, since it draws no edge; the room every row keeps is one.

Visible changes beyond the unification: the panel's hover wash is 7% ink where it was
5%; a disabled menu row (Undo with nothing to undo) dims by the offer's 0.55 opacity
rather than the panel's 72% ink; Copy Leaf version and Copy link read in the ink
rather than `--ink-2`; a recording's current moment reads in the ink rather than the
accent.
The row face rounded its wash but squared its current row, as the visual grammar
requires of a striped box, so where a hovered row sat under the current one the
two fills met with a notch (a recording's moments, a visual review's cases), and
a visual review's hover was square besides. A row is now square in every state,
the Page Map's and All pages' rows included, so rows stack edge to edge. In the
panel's menu the square wash stands 6px inside the menu's rounded corners, which
reads as a band across the list rather than a box on it. A timeline step's wash
now runs the step's full width square at both ends, as its current step does.

The two ways back were two shapes: the view's hugged its words and the menu's ran
the menu's width, with their words 4px apart. Both are now one press
(`:is(.lf-fp-back, .lf-fp-menu-back)`): as wide as their words, since a view's way
back shares its line with the thread's facts and presses and so can't run the
panel's width, and in the menu that width says the press leaves the list rather
than standing in it. Each holds its chevron 8px into its wash with 4px before the
words, so the menu's starts on its rows' edge and the view's reaches out by those
8px to start on the view's words. The menu's way back drops `.lf-fp-item` and its
label wrapper.

A visual review's case keeps 6px between the stripe and its numeral, as the panel's
rows do; it had 2px.
…e role proxy

A note or a picture's proxy on the details shelf rang its target only on
visible focus, so a screen reader moving onto a note after a click on the page
showed nothing; the card it replaced had shown on any focus. Nothing but the
keys or assistive technology reaches the shelf, so any focus there now rings
what the proxy stands for. A gloss's proxy keeps ringing its phrase on visible
focus, since a press on the phrase focuses it too.

A block the page drew anew while its note held focus lost the ring for good:
the note view released the old block's note and claimed a new one, which also
dropped the user's focus. It now hands the note to the new block that enters
the same thread, and shelving a note under another element moves it there
(details-shelf.js, `shelve`); the shelf re-rings on every shelving, so the
ring follows. The trace painter no longer writes its box's `data-for` and
plane off when it clears, so drawing round the redrawn block is no write.

The role is renamed `proxy` (`lf-proxy`, the proxy ring), since current-target's
walks already have stops. The stale prose about the card at the window's head
goes: composing/surface.js says why a drawing's proxy is only a fallback
return place, and base.css no longer lists it among --raise-2's surfaces.
…anew

A comment quoting across two blocks gives each a note entering the same
thread. The note view kept the notes of departed blocks in a map keyed by that
thread, so when both blocks were drawn anew in one task the second overwrote
the first: that note was never released, stood on the shelf named by nothing,
and a user on it was stranded with no ring. Departed notes now wait in page
order in a list per thread, each new block takes the first, and whatever none
takes is released.
Main's changes kept, with the branch's intent applied on top:

- The floating panel: main split a view's Close out of the row's end, made Back a
  symbol, made the menu the On view's first tab and gave the row notice a passing
  form with keys. The way out, the On me mark, the view's Close and the leaf are
  symbols, Compare and Dismiss words, and the row notice's press an inline press
  inside the notice (with the passing flag and its keys), so the panel still
  draws no face of its own. The leaf's tone is `data-lf-tone`, as main writes
  Leaf's states, and colours its mark.
- A diff's line number: main made it a number alone where no comment can be
  made; where one can, it is still a gutter press.
- `namedAction`, which main moved to control-labels.js, goes as before: nothing
  calls it. The `imports` reading main removed stays removed; the presses
  reading and its fixture test stay.
- Tests main moved or added that read the command reference's rows read its
  options; the tone checks read `data-lf-tone` on the leaf.
- module-authoring.md's role list is tightened to keep the file under the
  30,000-character read cap.
… constant

On a 390px phone the On view's tabs, now word presses with a border and a
finger's floor, stood 261px against 256px of room, so Close went to a line of
its own (#4895 promised one line). A tighter inset constant fit by 2.7px in
Apple's faces and not at all in DejaVu.

Each tab now stands its words between two rooms that shrink to nothing, and the
strip gives every tab the same share of what it has (a grid of
minmax(min-content, max-content) columns); the room between tabs is folded into
those rooms. The tabs' line breaks only where the tabs at their narrowest don't
fit beside the room kept for a press and Close, and holds that width when On
<agent>'s plan head takes a line of its own, so no tab moves between views. At
390px the tabs keep about 1.6px of room each in Apple's faces and 0.5px in
DejaVu. test_on_a_phone_turning_on_s_tabs_moves_nothing now fails when Close
leaves the tabs' line at 390px; it failed on dee738b.

Also: the journey test that disables quick shortcuts presses the reference's
option, which is the press now; the inline face's comments say news keeps the
accent; and a diff line number's look has one home, `.lf-diff-line-number`,
with the gutter face adding only what makes it a press.
Main's changes kept, with the branch's intent applied on top:

- #5116 draws the location ring as a mark over the decision and states where a
  box's marks stand in `--lf-ring-at`. The proxy ring stands on the same model:
  both are the focus ring drawn as a mark over what it rings, sharing one CSS
  rule for their box, their whole band and a drawn part's contour ink, and both
  stand where the ringed thing's `--lf-ring-at` says, through `standOver`. The
  location painter joins the trace painters in target-paint.js, and a layout
  change or scroll relocates it before moving the traces. On me's cards state
  their inset ring as `--lf-ring-at`; the ring sweep counts the proxy ring as
  the focus cue it carries.
- #5113's narrower margin-label rule is kept on the margin face's class.
leaf-agent
leaf-agent previously approved these changes Nov 3, 2026
The first merge of main kept the branch's line-height: 1.3 on a panel answer that
says what it gives, which test_interface_fonts refuses: a line height comes only
with a declared font. Main's padding-block: 7px stands the two-line answer as it
did before.
leaf-agent
leaf-agent previously approved these changes Nov 3, 2026
The branch's first round outlined a focused On me card itself
(.lf-fp-on-item:focus-visible), beside the shared ring that already stands it
inside the card through --lf-ring-at, so the ring sweep journey named that rule.
Only the card the m walk stands on, which holds no focus, draws its own outline.

@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 role check leaves a shipped family of controls outside its coverage: selectable buttons can still draw their own face and pass. This prevents the new check from enforcing the PR’s central guarantee; the inline finding includes a current bundled counterexample.

Comment thread tests/js_facts.mjs Resolved
…ld role

The press check read a `<button>`, a `role="button"` element and the presses
Leaf's makers build, but not a selectable offer, so a selectable button could
draw its own face and pass: the Settled line of a decided option group did,
with its border, padding and hover in options.css.

`presses` now reads `selectableOffer("button", …)` as a press (kind
"selectable"), dressed when it names its face, and a template element whose
part is `selectableOffered("button", …)` as a template press, dressed the same
way. A selectable offer of another role, such as lf-tabs' tab, chooses what
shows, as a native choice does, and stays outside the check: a tab is no
press by the check's own definition, a button or a button's role. Fixtures
cover each form dressed and undressed.

The Settled line's look was its own, so it takes a role of its own, `fold`:
the line a folded group stands as, which opens and closes it, its face moved
from options.css into controls.css unchanged. options.css keeps where the
line stands and that only the screen offers it.
@max-sixty
max-sixty merged commit 0888ab9 into main Nov 3, 2026
6 of 7 checks passed
@max-sixty
max-sixty deleted the press-family-check branch November 3, 2026 07:01
leaf-agent added a commit that referenced this pull request Nov 3, 2026
…orpus ids unique (#5217)

The generated corpus failed `page check` for two separate reasons, and
each is fixed here:

- **Quoted playgrounds threw on connect.** #4873 (strict type checking)
replaced a cast with `if (!split) throw new Error("The playground needs
its rendered split view")`. A quoted playground, one inside
`data-lf-exhibit`, draws only its authored markup and never has a
`.lf-playground-split`, so every quoted playground failed. That includes
`quoted-alerts` in the corpus and the playground browser tests in #5072.
The split view's only job there is to receive the controls region's
height. A quoted playground has no controls region, so the lookup is
optional again (`split?.style`). This keeps #4873's typing without the
invariant it wrongly assumed.
- **Duplicate ids stopped the corpus from being generated.** #5118 added
`tests/fixtures/pages/page-annotations.html` with ids `title`, `plan`
and `tail`, which `thread-journey-inline.html` already uses. On current
main, `leaf-dev corpus` refuses to build ("id 'title' is in both …").
This landed after the scheduled run in the report, so the nightly would
have hit it next. The fixture's ids now have a `rollout-` prefix, and
the `proxy-note-own-annotations` still follows the paragraph's new id.
Nothing on screen changes apart from those ids.

Verification:
-
`tests/journeys/test_interact_product.py::test_page_fixtures_pass_check[corpus]`
(`--run-nightly`): fails on main at corpus generation. With only the id
rename it fails with the two `page-report` split-view errors. With both
changes it passes.
- `tests/browser/widgets/test_playgrounds.py`: the two quoted-playground
tests named in #5072 error at teardown on main. The whole file passes
with the change (38 passed).
- `pnpm run check:browser` passes.

The `measurement-lag` finding in the report is advice-level and doesn't
affect the check's status.

Closes #5173 — automated triage
Closes #5072 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 3, 2026
…erence rows and folded contents (#5253)

`test_each_sampled_focus_ring_is_shown_whole_in_its_surface` has failed
in the scheduled `ci` run on Linux and macOS since [run
41432142330](https://github.com/max-sixty/leaf/actions/runs/41432142330).
Three of its samples were out of date with changes that were meant to
happen, and each stopped the sweep in turn. This PR updates the three
samples, changes no product code, and leaves every surface's ring
assertion in place.

- **On me** (#5179): #4715 deliberately puts the On me mark aside while
the caret is in the panel's field (`quickHidden` in
`browser/runtime/floating-panel.js`). Before focusing each sample, the
sampler pressed Tab so that the focus would count as keyboard focus.
From the leaf button, that Tab landed in the field, which hid
`.lf-fp-quick`, and `.lf-fp-on-user` could not take focus. The sampler
now presses Shift instead. Shift sets the browser's keyboard modality
for `:focus-visible`, which Leaf's `data-lf-focus-visible` follows
(`visibleFocus` in `browser/runtime/focus.js`), and it moves no focus. I
checked in Chromium that `focus()` after a Shift press matches
`:focus-visible`, and after a click alone it does not.
- **Command reference rows**: #5118 builds these rows by the `row` role
and deleted their own `[data-lf-focus-visible]` rule, so their ring now
comes from the floor rule. The sample now expects `FLOOR_RING`.
- **Contents link**: the feature gallery's `lf-toc` stands in the
reading column, not in a sidebar track, so its outline is a folded
native disclosure (`lf-toc.js` header, `#measure`). The selector's
`:visible` matched no link, so the locator waited out its 120 s timeout
before the runtime's `reveal` could open the disclosure. Without
`:visible`, `reveal` opens the outline and the link's ring is measured.

Verification: on a local run at main `89482e4a5`, the test failed
exactly as in CI. After each fix, the next stale sample surfaced. With
all three fixes the whole test passes (`1 passed in 451.67s`, `-n0`).
This PR's CI runs the edited journey on the rebased head.

Closes #5179 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 7, 2026
…5628)

#5118 ("Build every press by a role") turned seven browser tests red on
main. Six still fail on main, and each one was expecting a shape that
#5118 deliberately replaced. This PR updates those six tests to the
shapes #5118 introduced and changes no runtime behaviour. The seventh,
`test_an_inline_contribution_name_needs_no_physical_margin`, passes on
current main, both locally and in push run
[42320062138](https://github.com/max-sixty/leaf/actions/runs/42320062138).

| Test | What #5118 changed | Repair |
| --- | --- | --- |
| `test_s_aims_at_the_addressable_element_named_by_its_hint` | The
command reference is a listbox. A section heading is `aria-hidden`, and
it names a `group` around each option. | Look up the `group` named "In
the target picker" instead of a heading. |
| `test_stylesheet_motion_inputs_drive_css_and_web_animations` | A
margin entry's face class, which carries the agent-arrival animation, is
`lf-margin-face`. `lf-margin-entry` is left as the script hook. | The
synthetic arrival is built on `lf-margin-face`. |
| `test_on_me_s_tabs_stand_where_a_view_names_itself` | The tab strip's
inline padding and negative margin now reserve room for the tabs' focus
ring, so the strip's box starts 5px before the tabs. | Measure the first
tab, which still starts exactly at the controls' content edge. |
| `test_a_finger_s_taller_grip_…` (renamed
`test_a_grip_taller_than_its_title_…`) | The grip is a symbol: its face
is 28px tall at every pointer, and under touch its reach comes from the
`::after`, not from its box. | The premise is now "the grip is taller
than the title" rather than "44px". The assertions that the blocks clear
the grip are unchanged. The `board.css` comment is updated to match. |
| `test_diagnostics_arrival_inside_sample_stays_in_child_document`,
`test_sample_diagnostics_copy_failure_keeps_a_visible_manual_copy_route`
| The tab strip's block reach grew from `max(0px, …)` to at least the
focus ring's room. | The child sample gets room for the menu
(`MENU_ROOM`). |

On the last row: a sample's frame takes its child page's height, so
these child pages were 222px tall. In both `0888ab9da^` and current
main, the menu opened inside that frame has a 14px view, and the About
this page row sits below the window. Before #5118, Playwright still
managed to land a click on the row after scrolling it into view. With
the strip's larger reach, the strip now takes that click. The cramped
menu inside a short sample is older than #5118. This PR doesn't change
it.

**Verification.** All six fail on main at `903e1d106`. With this change,
those six and the inline-name test pass (`uv run pytest --run-main -n2`
over the seven node ids, 8 passed counting both parametrizations of the
inline test).

Closes #5473 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 22, 2026
This week's duplicate sweep of `dev/`, `build/`, `tests/` and `worker/`
(week 47) moves six duplicated helpers onto one home each and moves
every caller. Behavior stays the same. The touched model tests, the dev
js_facts tests and the Worker's routing, storage and index tests pass. A
script compared the old and new outputs of the consolidated `leaf_dev`
functions and the seeded-log reads across the corpus, and they match.

| Question | Home | Copies removed (introducing PR) |
|---|---|---|
| Which stylesheets do the core and the bundled packages ship, leaving
out vendored files? | new `interact_support.shipped_sheets` | `sheets()`
in `test_interface_fonts.py` (#4804) and `test_theme_tokens.py` (#6025).
Five inline loops in `test_interact_layer.py` (#3138, #3886) |
| Run `tests/js_facts.mjs` | `interact_support.js_facts` (#2666) | its
own subprocess call in `dev/tests/test_js_facts.py` (#5118) |
| Lowercase hex of bytes in the Worker | `routing.hex`, which is
`newSessionId` (#313) renamed, plus a `sha256Hex` in `storage.ts` | the
publication-identity and chunk-digest copies in `storage.ts` (#2652) |
| Is this pid alive? | `leaf.machine.pid_alive` | `_alive` in
`tests/process/test_codex_tool.py` (#3331). `running()` in
`test_interact_layer.py` (#1774) |
| Read an example's seeded log | `read_event_lines(seed_log(source))`
(#4484) | inline parsers in `test_render_pages.py`,
`test_interact_product.py` (#924) and `test_render_gate.py` (#509). The
last one split lines with `splitlines()`, which also breaks at U+2028 |
| Paths of the bundled registries and packages; which registry keys name
elements | `leaf.schema.ASSETS` / `BUNDLED_PACKAGES` /
`DEFAULT_PACKAGE`, `leaf.registry.contract.is_element_name`,
`docs.registries()` | `docs.py`'s own `ASSETS`/`PACKAGES` (#3593) and
its `startswith("lf-")` checks (#2660). `logs usage`'s hand-written
regex and registry list (#5970). `ROOT / "packages" / "default"` in
`stills.py` (#3927) and `test_product_page.py` (#3593) |

`is_element_name` and the two checks it replaces give the same answer
for every key in the bundled registries today. A selector key such as
`lf-options.selected` would have passed the `lf-` prefix test.

<details><summary>Sets found and left alone</summary>

- **Sets an open PR is changing.** Nothing in this diff overlaps another
open PR's hunks. #6732 moves tests out of `test_render_gate.py`,
`test_render_pages.py` and `test_interact_layer.py`, but none of the
tests changed here.
- **Changes to browser tests with nothing run to check them.** The WCAG
contrast computation exists as about 11 copies across browser, journey
and model tests. Other copies: about 9 `EDITOR_ROOTS` shadow-root
keepers, the `/api/interaction` batch predicates, CDP `touch()`
closures, one-line patch templates, reply-holding route handlers, and
the `data-lf-entry` runtime-module import snippet in
`dev/leaf_dev/states.py` and in tests. Each would mean editing browser
tests that this sweep can't run on a shared host. They suit a sweep that
can run those tests.
- **Vendor bundling.** `build/browser/build.mjs` builds signals-core and
Lit with esbuild calls that repeat `build/vendor.mjs`'s `bundle()`.
Merging them changes build options and needs a full `check:browser` byte
comparison, so it was left for a change that runs that.
- **Copies that are near but not the same.** `_build.py`'s `check_links`
repeats `leaf_website.released_path`, but it also needs the matched
page's root and kind. The list of API-key variables an eval drops is
repeated across Python and the Promptfoo configs, as subsets and
supersets of one another. The Codex token-expiry check has different
thresholds, 1 h and 60 s.
- **Too small to be worth it.** Picking a free loopback port
(`eval_user.py`, `interact_support.available_loopback_port`). The XDG
state root in `leaf_dev.state_home` and `leaf.state.state_home`. The
`settled` helper in two `tests/runtime` files.

</details>

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