Repository navigation
Test visual review copy width against its sheet - #1132
Merged
Merged
Conversation
max-sixty
added a commit
that referenced
this pull request
Sep 24, 2026
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](https://claude.com/claude-code) > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
The main nightly run failed in
test_visual_review_gallery_gives_a_laptop_to_the_evidence: the two full-width copy images measured 1214.36px against a 1210px literal expectation. The test reproduces at the current main tip. The recent sheet layout makes the evidence host's width the source of truth for those images, so the old literal checks an incidental viewport calculation rather than the copy behavior.This changes the assertion to compare the full-width images with the evidence host's content width after frame borders. It keeps the exact focus-image widths, all six images, a laptop-width minimum, and the check that a later frame does not resize the copy. The focused browser test passes locally with
uv run pytest tests/test_render_projection.py::test_visual_review_gallery_gives_a_laptop_to_the_evidence -q -n0.