Skip to content

Let a widget be its own position container, so a reorderable list needs two tags - #7007

Merged
max-sixty merged 9 commits into
mainfrom
own-position-container
Nov 24, 2026
Merged

max-sixty merged 9 commits into
mainfrom
own-position-container

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

A position record's within may now name the widget's own tag, so a list the user reorders needs two tags, the list and its item, instead of a container element between them. The maintainer chose to lift the refusal #6781 added.

That refusal guarded a real crash: the browser looked for containers only among the widget's descendants, so the first drop threw in rankAt. The lookup now reads containers at or inside the widget, and in both runtimes a container belongs to the nearest element at or above it that records positions (projection.container_owner, and closest in projection/authored.js). That is the rule a unit's owner already follows, started one step earlier, so a container and its units always have one owner. The position-container advice counts the widget itself, and an Undo offer names such a move's list once ("moved “X” in the list").

A ranking that needed lf-ranking > lf-rank-list > lf-rank-item is now lf-ranking (content: "members", move within lf-ranking) > lf-rank-item (owners: ["lf-ranking"]).

Ran pnpm run check, pre-commit, the model contract tests (649), and browser tests by node id: a two-tag fixture (tests/fixtures/packages/sortable) records a drag and a key move, keeps them across a reload and undoes the last, in Chromium and Firefox; the board's three-tag moves still pass in both. leaf-dev probe reads the same state in both engines.

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

…ion container no declaration places in the widget

`awaits.answered.<verb>.empty` took its own `within`, which in every use
repeated the container its verb's position record already names. It now
takes only `when`, and `obligations.container_empty` reads the container
from the verb's record, so an author names it once and the two can't
disagree. `answering-container` goes, since the record gate already refuses
an unknown container.

`package check` (and `page init`, `page check`, through
`declaration_advice`) now advises a position record whose `within` names no
tag the declarations place inside the widget, through `owners` at any depth,
with members of its own. Every drop the widget's own structure offers is
then refused at admission, and nothing told the agent. It is advice rather
than a refusal because such a record can still work: a container outside
the declared membership may stand in a member's markup, and another package
may declare the membership that places it. The message names the
containers the declarations do place there, or says to declare one.
A position record's `within` may now name the widget's own tag, so a list
the user reorders needs two tags, the list and its item, instead of a
wrapper container between them. `package check` refused it (#6781) because
the browser looked for containers only among the widget's descendants, so
the first drop threw in `rankAt`. The lookup now reads containers at or
inside the widget, and both runtimes give a container to the nearest element
at or above it whose position record names its tag (`container_owner`,
`containerOwner`), which is the widget itself where it orders its own
members. The position-container advice counts the widget too.

Lifting the refusal is the maintainer's call; this waits for it.
…'s own container once in a move's words

A container now belongs to the nearest element at or above it that records
positions, the rule a unit's owner follows started one step earlier, so a
container and the units in it always answer to one widget. Matching the
owner by `within` instead let a board drop its own card into a zone another
recorder owned, where it could not be moved back. The browser reads the
same rule with `closest` over the selector it already keeps, so
`registry.js` needs no index of its own.

A move into the widget itself serves no `to`, so an Undo offer and the
activity feed say "moved “X” in the list" rather than naming the list twice.
# Conflicts:
#	skills/leaf/references/package-data.md
Base automatically changed from agent-a6847c184900efc2f to main November 24, 2026 13:52
# Conflicts:
#	src/leaf/findings.py
#	src/leaf/registry/state.py
#	src/leaf/registry/widgets.py
#	tests/model/interact_contract/test_recorded_state.py
@max-sixty max-sixty changed the title Proposal: a widget may be its own position container Let a widget be its own position container, so a reorderable list needs two tags Nov 24, 2026
@max-sixty
max-sixty marked this pull request as ready for review November 24, 2026 17:45
@max-sixty
max-sixty merged commit a347884 into main Nov 24, 2026
7 checks passed
@max-sixty
max-sixty deleted the own-position-container branch November 24, 2026 17:58
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