Skip to content

Test visual review copy width against its sheet - #1132

Merged
max-sixty merged 1 commit into
mainfrom
fix/ci-36034594106
Sep 24, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/ci-36034594106

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

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.

@max-sixty
max-sixty merged commit f1e0234 into main Sep 24, 2026
4 checks passed
@max-sixty
max-sixty deleted the fix/ci-36034594106 branch September 24, 2026 19:50
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]>
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