Repository navigation
Show the complete Button grammar in the feature gallery - #338
Conversation
# Conflicts: # skills/leaf/assets/widgets/lf-suggestion.js
# Conflicts: # tests/test_render_margin.py
leaf-agent
left a comment
There was a problem hiding this comment.
ci on a PR runs the everyday suite only — .github/workflows/ci.yaml gates --run-nightly on push to main — and test_render_*.py is nightly-marked, so this PR's own green gate never read test_render_margin.py, test_render_navigation.py, or test_render_export.py. I ran the nightly render files against this head. test_render_margin.py (80), test_render_gate.py (73), test_render_navigation.py/test_render_reactions.py/test_render_startup.py (205), and test_render_controls.py/test_render_conversations.py/test_render_drawing.py (175) all pass. One fails:
FAILED tests/test_render_export.py::test_an_exported_page_fixture_stands_on_its_own[feature-gallery]
AssertionError: the copy says less than the page did: content sitting behind a control that
needed a handler, and nothing in a file can press one — ['lf-old']
bg-button-accepted seeds a standing accept, so replay paints data-lf-retired on its lf-old slot and theme.css's [data-lf-retired] { display: none; } hides it — which the export probe's unshown reading counts as words the copy lost. The exemption for that was in this branch's first commit (19216a3a), but it is not at this head: tests/test_render_export.py, skills/leaf/assets/runtime/widget-elements.js, and skills/leaf/assets/widgets/lf-suggestion.js are all byte-identical to main here, so all three files' edits from that commit went out in one of the branch's merges from main. Only the export one is load-bearing — the other two were guarded-write refactors, and every margin test passes without them.
Restoring it in the unshown filter turns that test green (verified locally, and the other 41 export fixtures stay green):
// A disclosure the reader can still work, a control's own
// label, a slot a standing decision deliberately retired, and
// an element with no box by design are all fine; what is not
// is the page's words with nothing to reveal them.
&& !el.closest('details, [data-lf-offer], [data-lf-retired], '
+ '.lf-ui, style, script')Since the nightly suite first runs after main moves, this lands as a red main rather than a red PR. Happy to push that one-hunk fix to this branch if you want it — it's outside the diff, so there's no inline suggestion to apply.
Separately, #339 carries the same tests/test_render_margin.py repair as this PR — the target rebinding at the address hint, renamed to phase there and target_id here. Whichever lands second conflicts on those two lines.
Sources and notes
- Nightly selection:
tests/CLAUDE.md— "Thetest_render_*.pymodules andtest_site.pyare marked nightly";.github/workflows/ci.yamlrunsuv run pytest tests -vonpull_requestanduv run pytest tests --run-nightly -vonpush. - The failing probe is the
unshownreading insidetest_an_exported_page_fixture_stands_on_its_own;PAGE_FIXTURESintests/render_harness.pyis(*EXAMPLES, FEATURE_GALLERY), so the gallery is one of its parameters. [data-lf-retired] { display: none; }is inskills/leaf/assets/theme.css;passages.jsandx-retired-wheninskills/leaf/assets/registry.jsondescribe reconciliation painting it from the standing log.- Head read as
d59837ef, merge base7f042906.git diff 7f042906 d59837ef -- <path>is empty for each of the three files named above. - Everything else I checked came back clean:
leaf package check skills/leaf/packages/gallerypasses, the seededacceptevent's coordinate matcheslf-suggestion'sx-state(facet: "settlement",unit: "widget"), every icon the atlas names exists inruntime/icons.js, and thechrome.csscursor change fixes a case wider than the atlas —.lf-margin-button[aria-disabled="true"] { cursor: default; }was losing on specificity to the pointer rule, so anaria-disabledmargin Button drew a hand before this.
The everyday suite `ci` runs on a pull request deselects every nightly-marked module, so a pull request whose whole diff is one of those modules goes green having exercised none of it. That is how #336 landed a rewrite of `tests/test_render_margin.py` and `tests/test_render_anchors.py` under a green gate and reddened `main` the moment it merged — #339 is the repair — and #338 is in the same position right now with `tests/test_render_margin.py` and `tests/test_render_navigation.py`. This names the touched modules back. A new pull-request step diffs the merge commit against its base parent, collects the `tests/test_*.py` files the diff touches, and runs them with `-m nightly`: `conftest.py` already runs what an explicit file selection names, `-m nightly` leaves a mixed module's everyday cases to the step above rather than running them twice, and pytest's exit 5 is what a pull request that touches no nightly case gets. The cost is the touched files, not the 22–41 minute nightly suite, and a pull request that touches no test module pays nothing. A change to the runtime those modules drive is still the nightly run's to catch; this reaches the modules themselves. <details><summary>Verification</summary> The step's shell was run locally against real commit ranges, with `uv run pytest` swapped for the same invocation: - `83f69563..d10463f` (#339's two nightly modules) — selects both, 155 nightly cases collected. - `ff580ecb..867c526` (touches `tests/test_render_mcp.py`, which carries no nightly mark) — selects it, `no tests ran`, exit 5 tolerated, step exits 0. - An empty range — `No test module touched.`, exit 0. - `d10463fd..83f6956` (the same diff reversed, so the range reads as deletions) — the `[ -f ]` filter drops what is not on disk and the step still selects correctly. End-to-end, `uv run pytest tests/test_render_drawing.py -m nightly -q` is 21 passed, so the invocation drives real browser cases rather than only collecting them. Suite and lint on this branch: - `uv run pytest tests` — 891 passed, 6 skipped. - `uv run pytest tests/test_interact_layer.py` — 157 passed, 6 skipped (this is the module that reads `ci.yaml`; the new step declares no `working-directory`, so the gate-naming test is unaffected). - `pre-commit run --files .github/workflows/ci.yaml CLAUDE.md tests/CLAUDE.md` — passed, including actionlint's shellcheck pass over the new `run:` block. `fetch-depth: 2` on the `test` job's checkout is what gives the merge commit its base parent; the default depth of 1 has no `HEAD^1` to diff against. </details> Co-authored-by: leaf-agent <[email protected]>
The everyday suite `ci` runs on a pull request deselects every nightly-marked module, so a pull request whose whole diff is one of those modules goes green having exercised none of it. That is how #336 landed a rewrite of `tests/test_render_margin.py` and `tests/test_render_anchors.py` under a green gate and reddened `main` the moment it merged — #339 is the repair — and #338 is in the same position right now with `tests/test_render_margin.py` and `tests/test_render_navigation.py`. This names the touched modules back. A new pull-request step diffs the merge commit against its base parent, collects the `tests/test_*.py` files the diff touches, and runs them with `-m nightly`: `conftest.py` already runs what an explicit file selection names, `-m nightly` leaves a mixed module's everyday cases to the step above rather than running them twice, and pytest's exit 5 is what a pull request that touches no nightly case gets. The cost is the touched files, not the 22–41 minute nightly suite, and a pull request that touches no test module pays nothing. A change to the runtime those modules drive is still the nightly run's to catch; this reaches the modules themselves. <details><summary>Verification</summary> The step's shell was run locally against real commit ranges, with `uv run pytest` swapped for the same invocation: - `83f69563..d10463f` (#339's two nightly modules) — selects both, 155 nightly cases collected. - `ff580ecb..867c526` (touches `tests/test_render_mcp.py`, which carries no nightly mark) — selects it, `no tests ran`, exit 5 tolerated, step exits 0. - An empty range — `No test module touched.`, exit 0. - `d10463fd..83f6956` (the same diff reversed, so the range reads as deletions) — the `[ -f ]` filter drops what is not on disk and the step still selects correctly. End-to-end, `uv run pytest tests/test_render_drawing.py -m nightly -q` is 21 passed, so the invocation drives real browser cases rather than only collecting them. Suite and lint on this branch: - `uv run pytest tests` — 891 passed, 6 skipped. - `uv run pytest tests/test_interact_layer.py` — 157 passed, 6 skipped (this is the module that reads `ci.yaml`; the new step declares no `working-directory`, so the gate-naming test is unaffected). - `pre-commit run --files .github/workflows/ci.yaml CLAUDE.md tests/CLAUDE.md` — passed, including actionlint's shellcheck pass over the new `run:` block. `fetch-depth: 2` on the `test` job's checkout is what gives the merge commit its base parent; the default depth of 1 has no `HEAD^1` to diff against. </details> Co-authored-by: leaf-agent <[email protected]>
The feature gallery's existing Button section showed a composed cluster but not the complete visual grammar. This adds a gallery-only atlas built from the canonical margin Button factory, with every role, behavior, tone, and lifecycle state visible together.
The same section now carries a real suggestion through failure, animated delivery, the transient Accepted acknowledgment, settled content and Undo, handoff status, and active work. Atlas coverage is checked against the runtime-owned
BUTTON_GRAMMAR, so a new Button value cannot leave the gallery and its test green but incomplete.The standalone-export probe now recognizes content deliberately retired by a standing decision as absent by design. This branch also incorporates the two browser-test repairs from #339, keeping current
main's nightly anchor and margin files aligned with generated go-to hints.