Repository navigation
Observe widget preparation through each producer lifetime - #2673
Merged
Merged
Conversation
leaf-agent
approved these changes
Oct 12, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 13, 2026
A reply can carry a widget introduced after the page a reader has pinned, or use a different meaning of an existing widget. Previously, every pinned page had to accept that markup and one globally registered implementation rendered all revisions. Each page and frozen message now retains its own widget publication: declarations, constructors, private modules, styles, initial drawings and recorded command meaning. Decisions and asks keep their captured meaning while the reader changes page versions. The document still runs one current Leaf kernel and one instance of shared runtime/vendor libraries. Publication-addressed widget resources and scoped custom-element registries isolate their implementations. Samples preserve those identities, including generated children; served pages, captured exports and Worker delivery follow the same resource ownership. Classic initial drawings remain classic scripts outside the module graph. Shared reaction chrome follows the viewed document. Registry-declared widgets now default-export a constructor; Leaf owns registration. Generated child widgets use `createWidgetElement(owner, tag, Constructor)`, and `layerFact(owner, name)` reads the owning publication. All maintained widgets, authoring examples, public references and callers are converted together. Removing the old registration wrapper outdents class bodies by two spaces and accounts for most raw changed lines; the loader and all maintained widget callers move to this registration contract together. Independent survey fixes landed first in [#2672](#2672) (preview producer), [#2673](#2673) (preparation lifetime), [#2679](#2679) (deferred presence), [#2680](#2680) (annotation seats), [#2683](#2683) (preview shutdown), and [#2685](#2685) (native Git evidence). This PR now contains only the publication migration and its integration proof: 228 files, +17,248/−14,329 lines; ignoring whitespace leaves +5,052/−2,133 (77% of raw changed lines disappear). Validation exercises different meanings of the same tag, new reply widgets in old pinned pages, captured actions and undo, generated sample children, classic initial drawings, private-module/shared-runtime identity, and historical offline exports with zero external requests. Independent readers used desktop, keyboard and phone interactions. The last browser-startup source caac297 served triage comparison against maina3a139255 adds four code requests and 19,133 code bytes before presentation; both arms have no browser errors, identical layout shifts and byte-identical settled screenshots. The current integrated source passes 108 framework/build checks, 410 runtime tests, the complete lint gate and focused model/browser contrasts. Earlier source-specific proof includes 82 Worker and eight eval-runner checks; the integrated 51310e7 build passes all 105 site pages and three public Worker startup checks against main250595204. Its product/triage add about 4.7 KB with unchanged code request counts, while the frozen gallery adds 94,125 code bytes for its captured registry, scoped styles and separately addressed constructors. Layout shifts are identical in each pair. Integration with main3a7414145 preserves the upgraded commenting interface while private history loads. Local comments now paint through the canonical publication presenter in that waiting phase; existing early-send, arrival and refusal controls pass. Sample conversation selection captures intent when its command arrives, before waiting for child history, and carries it through both canonical destinations. Four held-child contrasts verify ordinary page/panel selection and cancellation after newer child typing. Structured admission and source refusals now preserve canonical finding codes through the publication-specific callers; seven focused model/process controls cover captured commands, retired captures, approval and quiet hooks. The subsequent CLI JSON integration also passes five reply/refusal controls and the complete-publication atomicity control; the constructor and browser runtime source is unchanged. The newly merged late-shadow usability fixture also uses the constructor export; its unchanged browser assertions pass. The scoped-registry vendoring adapter forwards native retained-move callbacks; the unchanged composer selection assertion and five lifecycle/browser contrasts pass. Broad CI exposed eager page-parser imports in the quiet Codex hook. Reserved revision identities now stay lightweight, while content reads use the unchanged canonical capture validator. Quiet/pending hook paths and seven incomplete/obsolete/duplicate capture controls pass. Ten other failures were outdated fixtures for complete captures, captured replies, native Git headers, scoped child creation, split widget styles, structured findings and the ask API; all eleven original failures pass locally with their behavioral assertions preserved. Final exact-head Linux CI passes the broad Python suite, complete website lifecycle including dormant reads and wake/restore/write, all bundle/runtime/Worker/eval assertions, pre-commit, website build and bundled-release Chrome measurement. The fresh automated review approves 80d3708 with no findings. [Final CI run](https://github.com/max-sixty/leaf/actions/runs/38334710468). The main risk is a constructor-timing or generated-child caller missed by the focused contrasts. The scoped-registry dependency and the across-corpus API cutover are the architectural cost of removing the old pinned-page vocabulary restriction. > _This was written by Codex on behalf of max-sixty_
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.
A widget's semantic presentation can fail or be superseded while its asynchronous producers still have DOM work to commit. Observing that aggregate loses the remaining producers' input attribution; treating removal as settlement can instead excuse unrelated movement.
Rendering now observes each concrete producer hold through settlement or cancellation. Disconnection cancels its observation, and a promise reaction checks current connection even if the departure's mutation observer has not run. Semantic presentation keeps its aggregate proof separately.
Seven focused browser cases pass, covering independently pending/rejected siblings and both promise-resolution/removal orderings. The new resolve-before-remove case reproduced the defect before its correction. All 381 runtime tests and changed-file lint gates pass. Independent code and prose review completed with no remaining findings.
Extracted from #2336; native disclosure instrumentation and publication isolation remain separate changes.