Skip to content

Correct three package references: the widget tag rule, keys in a Thread outlet, and what whenLeft hears - #6103

Merged
max-sixty merged 1 commit into
mainfrom
margin-as-widget
Nov 16, 2026
Merged

max-sixty merged 1 commit into
mainfrom
margin-as-widget

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Corrects three places where the package references misdescribe the code. A trial that built a margin widget against the public package interface alone ran into each of them.

  • packages.md, "A widget", now says a registry key declares a widget only when it is lf- followed by hyphen-separated lowercase words, and that any other key is read as an idiom's selector. A widget declared as x-margin is refused today with "idiom 'x-margin' registry: Additional properties are not allowed", which doesn't name the rule.
  • module-input.md, "How scopes compose": a key pressed inside an outlet Leaf fills with a Thread stops at the outlet, so the widget holding the outlet never receives it.
  • module-input.md, whenLeft: it hears focus leave the focused element or a shadow host, and not a control among the element's children.

#5968 edits the same two files. It deletes the whenLeft sentence, since that export leaves the public interface there, and rewords the paragraph below the new one in packages.md, so whichever of the two lands second takes a small conflict.

Max asked for this on the Leaf page about the margin. No code changes. Each statement was checked by a run: leaf-dev probe in Chromium for the key scopes and whenLeft, and leaf page check for the refusal; the commit message has the readings.

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

…ad outlet, and what whenLeft hears

A trial that built a margin widget on the public package interface alone
found three places where the shipped references misled its author.

`packages.md`, "A widget", now says a registry key declares a widget
only when it is `lf-` followed by hyphen-separated lowercase words, and
that any other key is read as an idiom's selector. No package reference
stated the rule, and a widget declared as `x-margin` is refused with
"idiom 'x-margin' registry: Additional properties are not allowed",
which doesn't name it.

`module-input.md`, "How scopes compose", said a key goes to the widgets
around the focused control. A key pressed inside an outlet Leaf fills
with a Thread stops at the outlet (`scopesFor` in `keyboard/scopes.js`),
so the widget holding the outlet never receives it. The section now says
so.

`module-input.md` said `whenLeft(element, leave)` runs when focus leaves
an element. It listens for the element's own `blur`, which doesn't
bubble, so it hears focus leave the focused element or a host whose
shadow tree holds focus, and not a control among the element's children.

Checked in Chromium with `leaf-dev probe`: a scope declared on the box
around a Thread outlet ran 0 times for a key pressed in the Thread and
once from a control beside the outlet, a scope on the outlet ran once,
and `?` opened the command reference from inside it; `whenLeft` ran 0
times for a box whose child button lost focus, once for the button
itself and once for a shadow host. `leaf page check` on a page widget
named `x-margin` gave the refusal quoted above.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit 6a47200 into main Nov 16, 2026
5 checks passed
@max-sixty
max-sixty deleted the margin-as-widget branch November 16, 2026 05:00
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