Repository navigation
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
Conversation
…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
previously approved these changes
Nov 24, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
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
leaf-agent
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'slfPartsproperty replacesregisterVisualParts, beside thedata-lf-partmarks.quoted()becomes a read of thedata-lf-exhibitmark delivery paints. The package API goes from 177 names to 174.To weigh:
data-lf-root-headerandlfParts.lf-layoutevent passes the visual, from it or inside it; marked visuals used to follow every widget's.copyControla different-looking Copy,shadowStageits 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 oftest_page_holds_still.py,leaf-dev probe --basein Chromium and Firefox on eight pages, and two header eval cases twice per arm (all pass).