Skip to content

Remove the static export; export is the offline runtime - #1136

Merged
max-sixty merged 13 commits into
mainfrom
static-export-burden
Sep 24, 2026
Merged

max-sixty merged 13 commits into
mainfrom
static-export-burden

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Leaf had two exports. The static one froze the drawn page, stripped every script, and marked the root html.lf-copy. The offline-interactive one (--interactive) embeds the page's own runtime and its captured state, so the page draws itself when the file opens. This removes the static export. leaf version export now writes only the offline file, and takes no flag.

Why

With no script in the static copy, every feature had to say what it looks like without its JavaScript. That took:

  • about 90 html.lf-copy / html:not(.lf-copy) selectors across 8 stylesheets;
  • lfPrepareExport() hooks in five widgets;
  • runtime attributes that existed only for the copy (staticLabel, the tab-icon rest link);
  • a 541-line bake probe;
  • about 2,000 lines of tests, including a corpus-wide export test that fails whenever a new widget arrives.

Since August, 131 commits touched the export files and 77 touched lf-copy. Main still carries one from today: #1132 fixed a nightly failure on a copy width.

The case that surfaced this was How it works in a static copy. The #739 rule html.lf-copy body > main:has(> lf-tabs…) stretched its text to the full window (1392px paragraphs, all five tabs stacked). The offline file draws the same page exactly as the site does: 720px paragraphs and a working tab strip. Its runtime is the live page's, so new features need no export-specific handling.

Changes

  • exporting.py: cmd_export always builds the offline file (export_document). The browser bake and its readiness waits are gone. A page with a live specimen is refused, as --interactive already refused one.
  • Render checks: standalone.js is deleted and coveredWords moves into words.js. The file:// probe route, prepare_standalone_probes, and EXPORT_FLOOR are gone.
  • CSS: every html.lf-copy rule is deleted, including the copy scroll-cue timeline in shadow.css. Some screen rules had depended on the class weight of html:not(.lf-copy); without it, the "Another option" textarea took the runtime's textarea border. That guard is now html:root, which has identical specificity, and theme.css states the convention. :where(html:not(.lf-copy)) wrappers carried no weight and are unwrapped.
  • Runtime and widgets: the lfPrepareExport hooks, staticLabel, data-lf-rest, data-lf-export="document" on specimen frames, serializable shadow roots, the live-leaves detached-tray guard, and comments that argued from the copy are all gone.
  • Tests: the static-copy tests are deleted. --interactive tests drop the flag. UTF-8, captured-CSS and CSP checks now run against the offline file. The corpus-wide static export test is deleted.
  • Docs: serving-pages.md "Exported files" describes the single export. Package guidance no longer asks widget authors to design for a script-free copy.

Verification

  • Computed styles: across all 17 examples, every element's computed style (document and open shadow roots) was diffed between the base and this branch at 1440px. There were no differences beyond the removed --lf-copy-* properties and the timing noise a base-vs-base control also shows.
  • Suite: the full nightly suite passes, except test_visual_review_guides_one_typed_still_run, which fails the same way on main at c61f52f.

What this drops

  • Exported files show no conversations: the offline runtime boots with the conversation surface off.
  • Pages with live specimens (the corpus, the feature gallery, docs/event-log.html) can't be exported.
  • The offline file embeds every vendored bundle: 11.8 MB for How it works, against 630 KB static.

Each is a follow-up.

🤖 Generated with Claude Code

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

max-sixty and others added 13 commits September 24, 2026 12:26
`leaf version export` now always writes the offline copy that boots Leaf's
runtime from an embedded state reading, so the references, sidecars, and
maintainer guidance drop the script-free copy: the `lf-copy` medium and
"Standalone copies and print" section, `lfPrepareExport` and the
attributes-because-export obligation, the Chromium 125 export floor, the
corpus export test, and the `--interactive` flag. serving-pages.md
"Exported files" owns the single command; page-authoring.md points there
for the live-specimen refusal.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Export now always writes the offline interactive copy, so tests whose
subject was the baked static copy (what it keeps, drops, or looks like,
its readiness waits, its browser floor, its scroll cue, the corpus-wide
sweep) are deleted. Tests that did live work before exporting keep the
live half; gloss, inline-thread, and pending-change checks keep their
print assertions on the live page. `--interactive` tests drop the flag.
The UTF-8, captured CSS graph, CSP, and capture-key checks now read the
interactive export; live-specimen refusal matches its message prefix.
Assertions on the removed lf-copy class and CSS guards are gone, and
the served probe routes are every render-check source.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	docs/registry.html
#	tests/test_render_projection.py
@max-sixty
max-sixty merged commit 3be3a1c into main Sep 24, 2026
5 checks passed
@max-sixty
max-sixty deleted the static-export-burden branch September 24, 2026 22:21
max-sixty added a commit that referenced this pull request Sep 24, 2026
The Rust sort example landed beside #1136 with an lfPrepareExport() that
froze the film on its first merge for the static export. #1136 removed that
export, so nothing calls the hook any more. Remove it from the example and
regenerate the corpus copy.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Nov 22, 2026
…it flags (#6695)

The corpus journey (`test_page_fixture_renders`) now takes an axe
reading of every authored page in light and dark, which nothing has done
since #1136 removed the static export's axe pass. This fixes the seven
pages it flagged:

- **Tally (alert-review, command-hub):** Next On Me's `aria-controls`
named an id outside the widget's shadow root, which no browser resolves.
The button steps through the region rather than controlling it, so the
attribute is removed.
- **File tree (deploy-config, file-tree, file-tree-input):**
@pierre/trees puts `role="tree"` on the root that also holds the search
field, and a tree may own only items and groups. A vendor seam moves the
role to the scroller holding the rows, and moves the root's one
`[role="tree"]` layout rule onto the root's own attribute. 1.0.0 still
has this, so the seam outlives an upgrade. Base and head lay the tree
out to the same pixel.
- **shadow-scale:** the example's quiet text, a row's labels, the card
eyebrow and the dark Save button were 2.2–4.4:1. They are now 4.7:1 or
better.
- **wt-merge:** the film's 13px flag checkboxes sat 23px apart where the
row wraps. Each label is now at least 24px tall.

The colour-scheme switch shared by `unread_syntax` and the new reading
finished only the document's own transitions. It read a search field
inside a shadow root mid-transition, as light under dark ink. It now
finishes every finite motion through `finishMoving`.

Max asked for this (#10 on the Gridlines page). Nobody else has read it
yet. Checked by running the eleven affected pages through
`test_page_fixture_renders`, running an axe-only sweep of all 49
authored pages, running the file tree, tally, film and syntax-probe
browser tests, and confirming that the unfixed shadow-scale fails the
new entry.

> _This was written by Claude Code on behalf of max-sixty_
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