Skip to content

Read a root header's mark, a visual's lfParts and an exhibit's mark off the element, in place of three package functions - #6946

Merged
max-sixty merged 3 commits into
mainfrom
agent-a7c6fa9bd203691fd
Nov 24, 2026
Merged

max-sixty merged 3 commits into
mainfrom
agent-a7c6fa9bd203691fd

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

One step of the package-interface redesign: a widget states three things on its element and Leaf reads them, in place of functions it imported. A header over the document carries data-lf-root-header, which one arrival watch counts. A visual's lfParts property replaces registerVisualParts, beside the data-lf-part marks. quoted() becomes a read of the data-lf-exhibit mark delivery paints. The package API goes from 177 names to 174.

To weigh:

  • Two new names: data-lf-root-header and lfParts.
  • A visual's parts are read again only when an lf-layout event passes the visual, from it or inside it; marked visuals used to follow every widget's.
  • A widget moved out of its exhibit, or in a shadow root inside one, no longer reads as quoted. Its verbs stay unavailable.
  • Four stay exported: reading regions would need a declared-region watch, copyControl a different-looking Copy, shadowStage its staging moved into each widget.

Ran: pnpm run check, pre-commit twice, pnpm run test:runtime, 44 browser tests by node id, the dial cases of test_page_holds_still.py, leaf-dev probe --base in Chromium and Firefox on eight pages, and two header eval cases twice per arm (all pass).

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

…ff the element, in place of three package functions

One step of the package-interface redesign: a widget states each of these
on its element, and Leaf reads it, so the module imports nothing to say it.

- `registerRootHeader(header)` becomes a `data-lf-root-header` mark on the
  header. One arrival watch, started at installation, counts each marked
  header while it stands in the page, so lf-tabs toggles the mark on its
  strip and lf-dial marks itself once.
- `registerVisualParts(source, read, options)` becomes the element's
  `lfParts` property, `{read, reveal, label, find, at, focus}`, read at each
  reading, with the `data-lf-part` marks standing in for `read`. A reading
  of a visual's parts is kept until an `lf-layout` event passes the visual,
  from it or from inside it, which the registration's `update()` already
  dispatched through `layoutChanged`. Marked visuals, which read every
  widget's layout version before, now follow their own too.
- `quoted(element)` becomes a read of the `data-lf-exhibit` mark delivery
  paints on an exhibit (`[data-lf-exhibit] *`), as the stylesheets already
  read it. A quoted widget's verbs were already never available; the
  runtime keeps `quoted` for the version comparison. A widget moved out of
  its exhibit, or built in a shadow root inside one, no longer reads as
  quoted.

`registerReadingRegion`, `compoundReadingRegionId`, `copyControl` and
`shadowStage` stay exported: stating each would need a new mechanism or
change what a control looks like.
# Conflicts:
#	examples/developer/feature-gallery.html
#	packages/detail/widgets/lf-dial.js
leaf-agent
leaf-agent previously approved these changes Nov 24, 2026

@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.

This overlaps #6894, which exports quoted() from portable-api.js so a widget that runs off Leaf can ask it, and has module-authoring.md tell such widgets to call it. This PR deletes quoted() and has widgets read the data-lf-exhibit mark instead, which already works off Leaf. Whichever PR lands second either conflicts or puts quoted() guidance back, so one of them should be closed or rebased onto the other. #6894's note that the drafting text field is Leaf-only is the part this PR doesn't cover.

# Conflicts:
#	packages/default/widgets/lf-board.js
#	skills/leaf/references/module-plain-elements.md
@max-sixty
max-sixty merged commit 7bdf6a7 into main Nov 24, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-a7c6fa9bd203691fd branch November 24, 2026 04:49
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