Skip to content

Say a widget's walk with an lf-walk event, and take beginWalk, listWalkPosition, labelOf and saying out of the package API - #7001

Merged
max-sixty merged 6 commits into
mainfrom
agent-a1dc9d58a097eca8f
Nov 24, 2026
Merged

max-sixty merged 6 commits into
mainfrom
agent-a1dc9d58a097eca8f

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

One group of step six of the package-interface redesign. A widget says where a step of its own walk landed with an lf-walk event on the stop, gives a preview's keys as bindings and gives an announcement the rows whose keys to name, where it imported four functions. beginWalk, listWalkPosition, labelOf and saying leave the package API (101 names to 97). rowWalk stays, since its rows call Leaf's focus and landing scroll.

To weigh:

  • A widget's place stands for its step's moment (4 s), where beginWalk's reader kept it while the user stayed on the stop. The event carries a place and no reader, so Leaf ends it with the moment, at the next step, or as the stop leaves the page. The page's field already said it for 4 s only. Before an open thread's Reply it now gives way to the thread's word:
main, 5 s after ] on a diff this branch
  • New names: lf-walk, with detail {noun, position, total, list}; {words, rows} as an lf-announce detail; each press in lfPreview().keys lists its steps' bindings, which Leaf spells.

Max hasn't read this diff; a fresh agent reviewed it. Ran pnpm run check, pre-commit, 87 browser tests by node id, leaf-dev words --base origin/main on three pages in Chromium and Firefox (641 rows, none differ), probes of each ported widget's steps in both engines, and the three keyboard eval cases (6 of 9 on each arm).

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

… keys

A widget says where a step of its own walk landed with an `lf-walk` event on
the stop, gives a preview's `keys` as bindings and gives an announcement the
rows whose keys to name. `beginWalk`, `listWalkPosition`, `labelOf` and
`saying` leave the package API; walk-declaration.js joins walk-position.js,
which hears the event.

A place a widget says stands for its step's moment and while its stop stays
in the page, where `beginWalk`'s reader stood as long as the user stayed.
A step Leaf declines now ends the place the last step said, which stood on
over a stop the user had left, and the stop's departure ends it through the
page's own watch rather than at the next frame that happens to read it. An
announcement's rows travel as `rows`, since a preview's `keys` are bindings.
… leaving

The Node test for a stop's departure left a step's real timer running, and
the tab test polled a place that lasts four real seconds; both now read what
no clock decides. The reference says a stop is heard leaving the page or a
shadow stage, not a shadow root a widget attaches itself.
# Conflicts:
#	browser/runtime/portable-api.js

@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 On panel's tabs still pass preview keys in the old form, so a tab now draws its Go-to door as a single chip, gA, where main draws g and A. The tab's preview in floating-panel.js (tabs, return steps.length ? { keys: [steps] } : null;) passes commandKeysNow(opens), which is a sequence of already-spelled steps such as ["g", "A"]. lines in preview.js now treats each entry as one binding, [spell(binding)]. spell(["g", "A"]) finds no +, so it returns the array unchanged. That makes one press whose single step is an array, and chip renders it inside one <kbd>. The type check doesn't catch this, because a Lit .lfPreview=${…} binding isn't typed against Preview. test_o_presses_the_leaf_and_the_arrows_turn_the_on_view_s_tabs passes on this head because its regex ^\s*g\s*A\s*$ matches gA as well as g A. Asserting the two chips (.lf-preview-keys kbd) would catch it.

There is also a contract gap behind this. The new keys is a list of single bindings, so it can't express a multi-step press like a Go-to door, which Leaf's own callers need. One way out is to make each entry a sequence of bindings, each spelled in turn. That would mean the board passing grab.keys.map((binding) => [binding]) and the panel passing the door's bindings rather than their spellings. Another is to give the panel's tab its keys through the control's own presses (own.keys) instead of the public field. Either keeps one form for keys, so no branch is needed on whether an entry is a string.

… steps

A preview's `keys` took one binding a press, which drew the On panel tab's
Go-to door, a press of two steps, as one chip. Each press is again a list,
now of the bindings of its steps, which Leaf spells; the panel hands on the
door's bindings (`commandBindingsNow`) rather than their spellings, and its
test reads the two chips.
@max-sixty
max-sixty merged commit 9fc720c into main Nov 24, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-a1dc9d58a097eca8f branch November 24, 2026 11:42
max-sixty added a commit that referenced this pull request Nov 24, 2026
Brings in two main commits:

- #7001 (9fc720c): a widget's walk is said through an `lf-walk`
  event, and `beginWalk`, `listWalkPosition`, `labelOf` and `saying`
  leave the package API.
- #7002 (097bee4): the reading line is read inside `holdPlace`, which
  now takes a column; the old one-node hold is `holdPlaceOf`, and
  `readingAt` leaves the package API.

One conflict, in the imports of browser/runtime/floating-panel.js:

- This branch added `import { focusByKey, focusKey } from "./carry.js"`
  above the user-place import.
- #7002 renamed that import's `holdPlace` to `holdPlaceOf`.

The resolution keeps the carry.js import and main's
`import { focusPlace, holdPlaceOf, standsAt } from "./user-place.js"`.
main's other floating-panel changes merged cleanly: the press hold
calls `holdPlaceOf(node)`, and a tab's preview reads
`commandBindingsNow`. Nothing this branch adds or moves calls a name
main took out of the package API or the old one-node `holdPlace`.

check-api.js, runtime-globals.d.ts and module-scroll-and-motion.md
merged cleanly, with both sides' additions:

- check-api.js: main's `beginWalk` export and this branch's
  `anchoringIsReady`.
- runtime-globals.d.ts: main's `lf-walk` event and announce words, and
  this branch's `DocumentInputs` and `lfStorage` members.
- module-scroll-and-motion.md: main's `holdPlace(column, standIn)` and
  `{ words, rows }` text, and this branch's entry-state paragraph.

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