Repository navigation
Make Before and After captions clickable - #464
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
The two new rail tab stops draw a focus ring the frame paints over. test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus fails on this head and passes at the merge base 3b4c2caf, so this is the branch's; the case is nightly-marked, which is why ci is green here.
2 faults over 733 stops:
in the page of release-notes, the ring on span.lf-shotcap.lf-ui "before" is not all there:
its bottom edge is under img "" (ring 290,423,364,467 vs 289,463,1007,760, sampled 327,466)
in the page of release-notes, the ring on span.lf-shotcap.lf-ui "after" is not all there:
its bottom edge is under img "" (ring 942,423,1006,467 vs 289,463,1007,760, sampled 974,466)
The caption is align-self: stretch inside a 34px rail, so its bottom edge is exactly .lf-shotframe's top edge, and the layer's pressable ring — 2px at a 3px offset — lands its bottom run 5px inside the frame, under the screenshot. A reader arriving on Before or After by Tab gets a ring with one side missing. The inline suggestion draws that ring inside the caption instead, which clears the walk; the other direction is to find the ring room at the rail's foot, which moves the accent rule the active state is drawn with, so which one to take is yours.
The other two are inline: the shortcut line names a press that does nothing on the caption already showing, and the caption hovers two different ways depending on which side it is.
What I ran
Green on this head: test_render_commands.py (whole file), test_render_options.py::test_working_the_evidence_in_an_option_is_not_a_pick, test_an_exported_page_fixture_stands_on_its_own[feature-gallery, corpus], test_page_fixtures_have_no_serious_wcag_a_or_aa_violations[feature-gallery, corpus], test_render_gate.py -k "feature-gallery or corpus", test_corpus_is_generated_from_the_examples.
Red on this head, green at 3b4c2caf under the same selection and -n0: test_render_controls.py::test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus --run-nightly. Each suggestion below was applied and re-measured before being written: the ring one takes that walk back to green, and the other two were read off getComputedStyle and the shortcut bar with the change in place.
`test_the_composed_corpus_declares_every_control_row_archetype` is red on main: the corpus sweep finds four controls with neighbours and no archetype covering them — the Before and After captions on the two `lf-shot` comparisons, in the Notes and Features tabs. #464 made those rail labels pressable. That turned the rail into a control row the sweep visits, and the row had no entry in `CONTROL_ARCHETYPES`, which is the declaration the sweep exists to hold open. This adds it: `coverage` classifies the rail's captions, and the causal case presses After and holds the caption beside it still — the transition worth proving, because both captions repaint their active state and a rule that spent width on the active word would move the other one under the reader's pointer. That case runs on `CONTROL_STABILITY_PAGE`, where the rest of the vocabulary is proved. The harness reserves `example` for a mechanism no synthetic page can compose, and a comparison is not one: the page composes an `lf-shot` and the archetype's own `serve` call lays in the two frames through `media=`, the same way `test_a_shot_shows_one_frame_and_flips_between_them` drives the rail. Anchoring it to `#bg-shot` in the shipped feature gallery instead would have let an edit to an authored example silently retarget or break it. The failure is a day old and not in the last complete-suite run: the 2026-09-08 scheduled run (`7e403108`) failed on three other cases with this one green, and #464 landed at 17:21 that day. <details><summary>Verification</summary> Reproduced at `d5902aa3` in a worktree, with the same four rows, before writing the fix. With the archetype declared: ``` uv run pytest tests/test_render_controls.py -q -n0 --run-nightly -k archetype 12 passed, 79 deselected in 362.93s ``` That selection is the corpus sweep plus every archetype's stillness case, including the new one, run on this branch rebased onto `6df40353`. Bug-back on the synthetic page: widening the resting caption on the press (`lf-shot:has(input:checked) .lf-shotcap[data-lf-state="before"] { padding-inline: 40px }`) turns the case red with `span.lf-shotcap.lf-ui "before" moved by [0, 0, 70, 0]`, so the neighbour the case holds is the one the comment names. </details> --------- Co-authored-by: leaf-agent <[email protected]>
The screenshot comparison rail now selects the named frame directly: clicking or pressing Enter or Space on Before or After switches to that state, while the image and margin control keep toggling.
The labels expose their active state, remain selectable as page text, and become static in exports and print. The feature gallery and registry describe the interaction, with browser coverage for direct selection, repeated active presses, keyboard routes, and nested-option isolation. Active caption and search-result underlines remain square.