Skip to content

Let pages own annotations without loading the physical overlay - #1652

Merged
max-sixty merged 24 commits into
mainfrom
codex/contribution-content-owners
Oct 3, 2026
Merged

max-sixty merged 24 commits into
mainfrom
codex/contribution-content-owners

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Pages can now place annotations in their own layout without booting Leaf's physical overlay. A body declaration selects page presentation, and an allocated lf-annotation-rail draws the same conversations, Asks and contributed actions as core. The default retains floating contextual replies and source marks; both presentations retain drawing capture, live revisions, decisions and Undo.

The overlay's layout, placement, persistent paint and styles move into the bundled default package. Both presentations consume one core annotation inventory, target directory, retained native controls, Thread/cohort commit and composer. Page consumers nominate contained outlets; surviving widget-local outlets keep priority at final admission. Switching presentation uses the existing executable-document replacement and draft carry. Rail layout holds foreign arrivals, source moves and retired allocations behind one notice while current records and controls stay authoritative; this tab's own comment appears immediately.

This is a boundary simplification: +902 production lines (runtime/Python/CSS/registry files, with renames expanded) and +1,878 lines overall across 98 files, rather than a LOC cut. The added lines supply the page view, its contract and integration evidence. annotation-workspace and the feature gallery exercise the new arrangement; author guidance and its scored independent-sample case describe the supported route.

Matched complete-fixture startup at authoritative presentation (base 79f540a57, candidate 2ba401429): default presentation rises from 207 to 212 JS/CSS requests and from 3,433,184 to 3,440,060 encoded code bytes, with 8,048 additional document bytes. Page presentation takes 200 requests and 3,191,203 code bytes, loads none of the physical overlay modules, and constructs no overlay nodes. The selected renderer must be constructed before the first conversation publication so its required seats participate in that publication's proof; deferring it until after presentation would expose a partial initial layout. These measurements establish request/byte effects, not a latency improvement.

Validation: complete independent architectural/source review; six native rail arrival, relocation, refusal, composer, Ask/Undo and drawing contrasts; native drawing recovery and actual mode replacement/caret contrasts; three literal instruction-eval responses admitted with independent child comments and unchanged parent logs; matched startup capture; desktop/narrow composed workspace review; 13 refreshed public previews; precommit; reproducible bundles; 1,880 Python tests, 194 runtime tests, 74 browser-framework tests, 66 Worker tests, six eval assertions and both TypeScript checks.

This was written by Codex on behalf of max-sixty

Keep generated draft editors through subscription-owned identity, resolve reply continuation through the canonical placed Thread destination, and land replacement editing after immutable document adoption and presentation. Share mechanical error ownership across fresh and in-place replacement so accepted state and deferred arrivals still complete.

Remove the page-interface semantic region in favor of its actual preparation join and make paint attributes import-free. Add native producer, stale-input, generation, fault, and automatic gallery revision coverage; update the public continuation guide and its admitted native eval evidence.
# Conflicts:
#	tests/test_render_startup.py
Keep the native editor seat, readiness and outlet retirement with composition. Supply floating geometry through the actual default placement factory and admit only a displayed editor at candidate seats. Derive notes, standing reactions and draft labels directly from canonical target readings so optional painting cannot supply control state.
# Conflicts:
#	tests/test_website_server.py
@max-sixty
max-sixty merged commit 9546e99 into main Oct 3, 2026
4 checks passed
@max-sixty
max-sixty deleted the codex/contribution-content-owners branch October 3, 2026 05:47
max-sixty added a commit that referenced this pull request Oct 12, 2026
…kage to widget-api (#2517)

Survey item F87. The physical annotation overlay moves from
`skills/leaf/packages/default/runtime/annotation-overlay/` into the
kernel at `skills/leaf/assets/runtime/annotation-overlay/` (a `git mv`;
`index.js` shows as delete+add because its header grew). It keeps its
`/runtime/annotation-overlay/*` URLs, and `leaf.js` still imports it
dynamically only for overlay presentation, so a `data-annotations=page`
page loads none of it.

This reverses #1652's placement. Every overlay module imports private
runtime owners (126 imports of 60 kernel modules), which no package may
do, so the package boundary held only through exemptions. All of them
are deleted:

- `layer.py`: the default package's runtime is no longer a protected
kernel path, and the default package is no longer skipped by the
private-import check.
- `.dependency-cruiser.mjs`: the `/runtime/annotation-overlay` alias,
`.dependency-cruiser-resolve.mjs`, and the per-name directory fallback
are gone. The overlay's imports are now relative, like every other
kernel owner's, and `core-independent-of-overlay` still keeps other
owners from reaching it (checked with a deliberate violating import).
- `dev/leaf_dev/distribution.py` no longer deletes a second runtime
tree, and `build/runtime-bundle.mjs` no longer names the overlay as an
extra install entry. In a prepared install the overlay is now a lazily
loaded chunk, as it already was on the website.
- eslint and the pre-commit depcruise hook drop their
`packages/*/runtime` globs.

With the default package's exemption removed, the check also caught its
vendored Sortable importing `/runtime/dom-move.js`. It now gets the same
`move` from `/runtime/widget-api.js`, which already exported it
(`build/vendor.mjs` and the committed bundle; `check:browser` reproduces
the bytes). The default package now holds only widgets, their initial
drawing, styles, theme, registry, and vendored libraries, and every
bundled package passes the private-import check.

The layer-returns lint message also changes. It sent packages to
`runtime/focus.js` for `layerLanding`, which widget-api stopped
exporting in #2475. It now names `layerLanding` as kernel-only and says
a package gets `closeLayer` and `handBack` from `widget-api.js`.

Checks: pre-commit (eslint, depcruise, prettier, ruff), `check:browser`,
`test:browser`, `test:runtime`, a real `prepare()` of the install tree,
and focused pytest for distribution, revision delivery, and layer
composition.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty pushed a commit that referenced this pull request Nov 2, 2026
Queued contribution focus started a second explicit arrival after its
update had already rendered. During suggestion decision and undo, that
extra publication could leave margin layout measuring the old
parent-passage Undo row between presentations, then restoring the same
style attribute. Focus restoration now finishes the existing update and
uses its retained control, keeping the request available until the
renderer has materialized its surface.

This preserves the surface materialization introduced in #1652 and
batching of updates within one script. Explicit navigation still
requests a fresh arrival. The change adds no scheduling mode or geometry
exception; the shared contribution owner removes the duplicate
publication for every caller.

The reported browser journey fails the unchanged-style watch on the
starting main commit and passes with this repair, including at 6× CPU
throttling. The runtime regression also fails before the fix with two
publications instead of one, then passes while checking that the last
batched focus request reaches its control.

<details><summary>Validation</summary>

- Four focused margin cases pass: suggestion decision/undo across rail
and pin widths, the suggestion lifecycle including refusal, secondary
action settlement, and secondary controls’ disabled/focus behavior.
- The page-owned annotation obligation/action/Undo case passes.
- All 746 runtime tests pass. Browser build, reproducible bundle check,
and changed-file pre-commit checks pass.
- Served startup comparison on the existing margin-actions fixture: both
arms deliver the document, upgrade and present the first server state
without reported layout shifts. Upgrade and presentation each retain 37
requests, including 31 JavaScript requests. JavaScript grows from
2,209,316 to 2,209,539 bytes (+223); no additional request or
preparation is introduced. Elapsed times are diagnostic only.
- The source review covered correctness, removed behavior, callers,
lifecycle cleanup, layering, and cost. Focus-request cleanup preserves a
newer request created during rendering.

</details>

Closes #5085 — automated triage

Co-authored-by: leaf-agent <[email protected]>
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