Skip to content

Use Lit from first paint through TOC and activity updates - #3535

Merged
max-sixty merged 4 commits into
mainfrom
codex/lit-preact-tracking
Oct 22, 2026
Merged

max-sixty merged 4 commits into
mainfrom
codex/lit-preact-tracking

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

The table of contents and activity feed currently build their first drawing by hand, then maintain custom row maps and DOM reconciliation after startup. This change lets Lit own both drawings from first paint through live updates, preserving their nodes, focus, native disclosure state and held activity.

Build metadata records which initial producers import Lit. Only pages using those producers initialize Lit before first paint; their module imports resolve to that same instance. Other pages load normal module Lit, with no extra request, and can still initialize later-arriving widgets. Each producer returns its template closure to the live widget so upgrade retains the same Lit parts. Both widgets use keyed repeat; the shared mover preserves focus during live reordering. Hosted and offline delivery select one implementation, and the authoring contract describes the same pattern for package authors.

On the combined-widget fixture against the integrated base, initial HTML grows by 34,358 bytes while code falls by 44,394 bytes and two requests (10,036 fewer bytes overall). A plain page has no early Lit, keeps the same 36 code requests, and adds 2,011 decoded bytes overall; normal Lit grows by 524 gzip bytes to expose its namespace for later producers. These are byte/request comparisons, not timing claims. Shared build and delivery support increases maintained code overall while removing the two hand-written reconciliation mechanisms.

Validation: 519 runtime, 132 framework and 85 Worker tests; 67 focused delivery model tests; browser coverage for early-to-live node identity, focus, disclosure, activity holding and print; streamed first paint in Chromium and Firefox; both offline delivery paths and late-arriving widgets with one Lit instance. Independent UI review exercised desktop/phone, light/dark, mouse, keyboard and touch, with 19 identical matched screenshots against the pre-integration base. After integrating main's activity-decoration cleanup, the affected activity and handoff cases were rerun. The browser coverage also exposed a test-order dependency in the existing saved-record regression: its deliberate asyncio loop now runs in its own worker, preserving active-loop publication coverage without colliding with Playwright's session loop.

This was written by Codex on behalf of max-sixty

…king

# Conflicts:
#	skills/leaf/packages/default/vendor/lf-activity-initial.js
#	skills/leaf/packages/default/widgets/activity-view.js
#	skills/leaf/packages/default/widgets/lf-activity.js

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

The startup path for pages without an early Lit drawing needs to stay lean.

Derive producer dependencies during build and select the shared facade only for early Lit pages, retaining normal module loading elsewhere and one implementation in offline exports. Keep late producer initialization on the same namespace. Isolate the saved-record test loop from the Playwright session loop exposed by the new browser coverage.
…king

# Conflicts:
#	skills/leaf/kernel/kernel.json
@max-sixty
max-sixty merged commit feea632 into main Oct 22, 2026
3 checks passed
@max-sixty
max-sixty deleted the codex/lit-preact-tracking branch October 22, 2026 07:03
max-sixty added a commit that referenced this pull request Oct 22, 2026
…3537)

Visual review now gives each capture case a stable dashboard with a
“Looks right” checkbox and feedback through Leaf threads. This replaces
verdict radio buttons and shifting inspection controls with retained
case views, direct thread access, and a More inspection popover.
Screenshot comparison remains owned by `lf-shot`.

Each case is also a separate On me obligation. The new generic
`x-awaits.records` declaration derives those obligations from a bound
data contract’s record keys; the server folds approvals, Undo, and
case-specific discussion into their current state. Shared `m` /
`Shift+m` navigation reveals the selected datum, including cases inside
frozen thread widgets. Local `n`, `a`, `c`, and `i` shortcuts cover case
navigation, approval, feedback, and inspection.

The main review boundaries are the visual-review package (presentation
and approval contract), `obligations.py` and its canonical reading
inputs (per-record state), and shared obligation arrival (datum reveal
and focus). Package-author documentation, schemas, generated bundles,
and affected callers move together. Existing radio-verdict tests are
replaced with approval, thread, navigation, reading-continuity, and
responsive-layout coverage.

Validation: 78 focused model/browser tests passed after integrating
main, along with the full `pnpm run check`. Independent live review
covered desktop and phone layouts, keyboard navigation, feedback, and On
me arrival. Earlier matched startup captures showed no layout shifts or
console errors. Final lint refinements passed pre-commit and 517 runtime
tests. CI exposed an extra handover for generated options; the repair
preserves their log ownership, with 19 focused stop/obligation checks.
The comparison transaction test now permits the data read its obligation
inventory needs while checking the lock remains held. The website
loop-order test reuses the fix already on main in #3535.

The broader redesign of `lf-shot` comparison and pixel/outline
inspection controls is separate work.

> _This was written by Codex on behalf of max-sixty_
leaf-agent added a commit that referenced this pull request Oct 22, 2026
The streamed initial host browser test failed before opening a page
because its synthetic resource map omitted the build's initial
dependency manifest. The delivery code added by #3535 reads that
manifest to select a producer's prerequisites. This fixture now supplies
the committed manifest with its JSON content type, so the test again
exercises the full browser behavior it protects.

Both Chromium and Firefox cases failed with `KeyError:
'/vendor/initial-dependencies.json'` in [main CI run
39741006770](https://github.com/max-sixty/leaf/actions/runs/39741006770)
and passed locally with this change.

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