Skip to content

Give a press its surface faces its symbol and name from its action, as a role does - #4563

Merged
max-sixty merged 5 commits into
mainfrom
action-names
Oct 28, 2026
Merged

max-sixty merged 5 commits into
mainfrom
action-names

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A runtime press that wears a role's face took its symbol and name from ACTIONS (#4547), but a press whose face its surface draws, such as the floating panel's, drew actionTemplate(action) and spelled its tooltip and accessible name by hand. The two could drift, and had: On me's Show said "Show" where the action said "Show on page".

nameAction(control, action, {label, title, className}) in widget-elements.js, with its template directive namedAction, gives such a press the action's symbol and name together, as a symbol role does; label and title say more where the press needs to ("Resolve thread", "Edit message", "Full screen", the composer's Send wording and keys). actionName in icon-paths.js is the one home of an action's name, read by both paths.

Cut over: the panel's On me mark and stance exit, More/Less room, Show, Undo, Done, Find, Resolve/Reopen and the thread view's Show on page; a message's Edit, Add reaction and the rewrite's Discard; the composer's Send and Dictate; a recording's Full screen. actionTemplate stays for a symbol that isn't a press's whole face, such as a menu row's icon or the second of two symbols a press swaps by CSS (a recording's and a trace's play/pause).

The show action's name is now "Show": it takes the reader to where a thing stands, which On me's Show does whether that is the page or a message. The thread view's seat and About's row say "Show on page" or "Show in message" as their label.

Behavior: the panel's Find and a recording's Full screen now carry a tooltip matching their accessible name; every name is otherwise unchanged.

Package widgets are left as they are: giving them namedAction would change the public package API and the page protocol, and their hand-written names (lf-file-editor's Retry) match their actions today.

Checks: pnpm run check (runtime tests 693/693, with a new case in action-offers.test.mjs), the role-face lint, and 28 focused browser tests covering every test that finds these presses by name.

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

Done had three faces: the word on a thread's to-do line and on its On me card,
and ✓ in the panel row's way out of a to-do. The thread line was worded because
✓ is the thread head's Resolve, and the row's end takes only a symbol.

Done now names its own symbol, a ticked circle as task apps draw a finished
task, so it is one symbol on the thread line, the On me card and the row's end,
and never reads as Resolve. `ACTIONS.done` points at the new `checked` icon;
browser/AGENTS.md's example of ✓ now names resolve.

Behavior: the Done buttons on a thread's to-do and on an On me card show the
symbol with "Done" as tooltip and accessible name, rather than the word.
A role's symbol press took its symbol and name from `ACTIONS`, but a press
whose face its surface draws, such as the floating panel's, a message's
controls, the composer's Send and Dictate and a recording's Full screen,
drew `actionTemplate(action)` and spelled its tooltip and accessible name by
hand. The two could drift: On me's Show was "Show" where the action said
"Show on page".

`nameAction(control, action, {label, title, className})`, and the template
directive `namedAction`, give such a press the action's symbol and name, as a
symbol role does, with `label` and `title` saying more where the press needs
to. Every such press in the runtime uses it; `actionTemplate` stays for a
symbol that is not a press's whole face, such as a menu row's icon or the
second of two symbols a press swaps by CSS. `actionName` is the one home of an
action's name, read by both paths.

The `show` action's name is now "Show": it takes the reader to where a thing
stands, which On me's Show does whether that is the page or a message. The
thread view's seat and About's row say "Show on page" or "Show in message" as
their label.

Behavior: the panel's Find, the recording's Full screen and the expand toggle
now carry a tooltip matching their accessible name; names are otherwise
unchanged.
# Conflicts:
#	browser/runtime/floating-panel.js
#	dist/kernel/kernel.json
#	dist/kernel/leaf.js
@max-sixty
max-sixty merged commit d2edb90 into main Oct 28, 2026
4 checks passed
@max-sixty
max-sixty deleted the action-names branch October 28, 2026 08:37
max-sixty added a commit that referenced this pull request Oct 28, 2026
#4563 gave every runtime press whose face its surface draws its symbol
and name from `ACTIONS` through `nameAction`. Package presses still
paired `showAction` or `actionTemplate` with a hand-written name, so the
two could drift there.

The public package API (`widget-api.js`) now offers `nameAction` and
`namedAction`, and these presses use them, keeping their own labels
where they say more:

- `lf-sample`'s Full view / Return to page
- `lf-diff`'s Expand/Collapse all files and `lf-call-diff`'s
Expand/Collapse all call-tree roots
- `lf-deck`'s forward press (Start / Next)
- `lf-file-editor`'s Retry

`showAction` and `actionElement` leave the public package API: no
package uses them, and `nameAction` already swaps the symbol for a press
whose action follows its state. `actionTemplate` stays for a symbol that
isn't a press's whole face, such as `lf-trace`'s play/pause pair.
`module-reading.md`'s Icons section says which to use. No protocol bump,
since the public package API doesn't bump it (#4551).

No behavior change: each press keeps its symbol, label and tooltip, and
each keeps its own face.

Checks: `pnpm run check` (runtime tests 693/693) and 9 focused browser
tests covering each of these presses (live samples' full view, diff
fold-all, call-diff rows, deck, file-editor status controls on a phone).

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Oct 31, 2026
Main moved the playground's initial producer into widgets/playground-view.js
(#4545), lets page CSS reach every control (#4490), draws presses from their
actions (#4547, #4563), registers commands through lfCommands, and already
lets a playground run with no lf-playground-control. The PR's prose about
offer() and data-controls, its relaxed control check and its deleted
initial/vendor producer files take main's side.

What stays from the PR is actions="page", now built in the Lit view:

- playground-view.js draws no actions bar under actions="page", and no rail
  unless controls are written there; the instruction renders after the stage,
  where it was written. `give({submit, reset})` takes the page's buttons, and
  render writes the submission's words into the page's button from the same
  template Leaf's own submission uses (submit-label, then Undo choice).
- lf-playground.js's registerActions hands the buttons to the view and sets
  the playground's commands then, since a Decision command needs its control:
  the 1 key, Alt+0 and On me's arrival reach the page's buttons. A page that
  never calls registerActions still fails after first presentation.
- The copy control and popover wiring run only when Leaf draws the popover.
- The PR's test and corpus fixture pass the contributor editor main's
  registerContributor now requires.

Behavior from main kept: the submit no longer disables while a submission is
in flight (#4516), so a page's button follows the same rule.
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