Repository navigation
Clarify the Versions menu - #494
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
Three points, all in skills/leaf/assets/runtime/version.js, inline.
The Compare control's accessible name is the one worth settling before merge: naming that press in words is this change's point, and the aria-label takes the word back out of the name. The repository's axe gate stays green through it — serious_axe_violations selects rules by WCAG tag, and under that selection label-content-name-mismatch does not run at all (it appears in none of violations, passes, incomplete or inapplicable), while selecting it by rule id flags this exact markup as serious. The one sweep that opens this menu, test_the_chrome_a_key_opens_has_no_serious_violations, reads a page on v1 where no row is comparable, so it renders no Compare press either way.
# Conflicts: # skills/leaf/assets/runtime/version.js # tests/test_render_anchors.py
leaf-agent
left a comment
There was a problem hiding this comment.
The three points from the previous round are all closed — I re-checked the accessible name against label-content-name-mismatch, the derived range against a page whose v1 revision is gone, and the compact line from both doors. The base merge's resolution reads right too: hoisting beginWalk above the unmoved-row return is what keeps the boundary readout live on a clamped press, and the walk-position and versions-menu cases pass at this head.
One finding on the new pending-comparison state, below. It is a correctness regression on the walk this PR is about, reproduced at e2805c35.
It also explains an intermittent failure I hit in test_the_version_menu_is_worked_by_pointer_and_key at ff738b4e — once in five runs of uv run pytest tests/test_render_anchors.py -n0 -k "version or menu or comparison or picker", on expect(page.locator('.lf-version-row[data-lf-version="1"]')).to_be_focused(), the same wrong row. That test's settle-wait is expect(btn).to_have_class(re.compile(r"\bon\b")), under a comment reading "the base is settled when the chooser says so"; paintDiff now lights on for diffOn || diffPendingBase !== null, so the wait no longer separates pending from settled and the test can walk past a comparison still on its way. Fixing the projection fixes the test with it — no test-side change needed.
Happy to push the fix if you'd like it; the edit focusVersionRow needs is outside this diff.
leaf-agent
left a comment
There was a problem hiding this comment.
The pending-selection finding from the last round is closed. selectedBase() puts a reopen on the base the reader marked, and activateRevision now reads it too, so a live activation cancels the old-document request before the authored main moves and restores that base against the arriving revision. comparisonBase stays settled for living-margin.js, which is the pairing that had to hold.
Five runs of uv run pytest tests/test_render_anchors.py -n0 -k "version or comparison or menu or picker" are green here, including test_the_version_menu_is_worked_by_pointer_and_key, which failed once in five at ff738b4e on the same wrong row.
One item left, inline: the new test reads the held route before the route has been dispatched into this process. test_comparison_selection_moves_before_its_documents_finish_loading has the same read at its own assert held, one expect_request stronger.
…tly tests to the shipped behavior (#509) The daily complete-suite run on `main` went red with eleven failures ([run 34342437953](https://github.com/max-sixty/leaf/actions/runs/34342437953)). None of them is a flake: every one reproduces locally at `26754cc4`, and each traces to a change that landed since the previous nightly and could not be gated by it. The two scheduled runs are ~70 commits apart — the one before this ran at `7e403108`, so this was the first complete suite over that whole span, and eleven failures is what a span that wide accumulated. Ten of the eleven are the nightly-only tests still describing a behavior a shipped change has replaced, or an arrangement a shipped change has moved. One is a real defect on <https://leaf.page/>. ## The site defect `docs/sitenote.js` looked for `main > :only-child > header` and, finding none, dropped the site's context label beside the workspace under `main`. That second element under `main` is exactly what `syncRootWorkspace` reads to decide a workspace is *not* the page's root, so the note cost the example the bounded allocation it is published to demonstrate: `notification-playground` arrived on the site in ordinary document flow with no bounded regions at all. It became reachable when #481 compacted the example and removed the `<header>` the note had been landing in — the site's placement rule had been resting on markup the example was free to drop. The note now gives a headerless framed task a header of its own rather than standing beside it. The generated header is marked `lf-ui`, like the note it carries, so the example's anchorable reading is unchanged. The framed root is still read as `main`'s only element child: narrowing that to the `lf-workspace` tag would have moved the same defect onto `live-progress`, whose root is `lf-monitor`. `test_published_workspaces_keep_their_allocation_under_site_context` is what let the original defect through — it named two examples, so neither `live-progress` nor `current-proposed-comparison` was gated. It now derives its parametrization from the corpus, covering every example whose whole `main` is one framed task, and reads the root by the `lf-workspace-arranged` class the runtime marks any arranged workspace with rather than by tag. Under the tag-name selector that gate fails on `live-progress` and passes on the other three. ## The stale readings | Failure | What moved under it | | --- | --- | | `test_a_key_on_screen_is_a_key_that_works`, `test_no_two_hints_on_the_key_line_say_the_same_word` | #494 renamed `version.previous`/`version.next` to `version.later`/`version.earlier`, added `1`–`9` numbered travel to the menu's `aria-keyshortcuts`, and set `promoteEscape: false` on both of the menu's doors out, so the compact line now prints the walk beside numbered travel rather than the Escape return. The assertions name the new commands, keys, and words. | | `test_the_layer_traps_no_margin_in_the_panel_it_draws` | The test picked its page as the first corpus source shipping *any* `.jsonl`. #505 added `current-proposed-comparison.jsonl`, which sorts first and holds one widget action and no conversation, so the panel opened on nothing and the test's own positive control — a rule planted to trap a margin against a thread's quoted address — found nothing to plant against. The selection now asks for a log holding an anchored comment. | | `test_page_round_trip`, `test_browser_and_file_captures_stop_at_the_same_widget_fences[1,2]` | #471 keeps an open thread card standing in a stable page margin. Both tests send a comment and then reach for something underneath the card it leaves open: the board column the drag is aimed at (the board is a wide widget, so its columns run out into that same band) and the composer field for the next passage. Both now dismiss the card first, which is what a reader does. | | `test_an_exported_page_fixture_stands_on_its_own[notification-playground, corpus]` | The copy's `unshown` reading reported `section#notification-artifact` — the slot `notification-playground` authors `hidden` so that `notification-artifact` is bound before the agent captures it. `lf-source` renders a `no data` caption into it, and the reading counted those words as content a copy had lost. A slot the markup hides is hidden on the live page too, so the copy withholds nothing; `[hidden]` joins the reading's exemptions. Across the whole corpus this exempts that slot and nothing else — every other fixture's reading is already empty. | | `test_the_feature_gallery_keeps_its_real_actions_reachable[390]` | The gallery is ~20,000px tall at 390px, and its arrival cascade after the test's bare `page.reload` intermittently raises `ResizeObserver loop completed with undelivered notifications` — the platform reporting a deferred delivery. The repo already adjudicates that notice over two attempts on the same document, in `render_harness.navigate` and again in the render gate's own arrival readings; this reload was the one that bypassed it. It goes through `navigate` now. | ## Verification `uv run pytest tests --run-nightly` on this branch: **2327 passed, 6 skipped, 10 failed** in 45:23. All eleven of the run's failures pass. Every one of the ten remaining failures is this sandbox's, not the branch's — none appeared in the CI run, and all ten reproduce identically with `tests/` and `docs/` checked out at the merge base. They are three capabilities the container withholds: no IPv6 for the two stated-host wildcard binds `tests/CLAUDE.md` already names, no `AF_UNIX` socket for the two app-server tests, and a denied `process_singleton` socket for the six that launch the installed Chrome from a subprocess (`Check failed: socket() failed: Operation not permitted`) rather than through the pinned headless shell the fixtures use. `uv run pre-commit run --files` over every changed file: passed. <details><summary>How the two non-obvious causes were established</summary> `test_page_round_trip` fails deterministically at `26754cc4` and passes with `skills/` and `examples/` checked out at `7e403108`; swapping either alone still fails, because `examples/layer.json` at head names a package the older `skills/` has not got. Swapping the pair commit by commit lands on #471, and a probe of `document.elementFromPoint` at the drop coordinate returns `div.lf-margin-thread-body` — the card the comment opened, over the column. The gallery's notice was traced by wrapping `ResizeObserver` on the page and recording each callback's construction site per frame. With the reload followed by a settle, no notice arrives at all and no gesture in the test produces one; the frames that raise it are the post-reload arrival cascade, in which body height climbs from ~18,000 to ~20,500px across a dozen frames while three observers deliver on each. </details> --------- Co-authored-by: leaf-agent <[email protected]>
The Versions menu mixed two distinct actions: opening an immutable version and comparing the current page with an earlier one. Its ascending order also put the current cursor at the bottom, while comparison selection lagged behind keyboard focus until two document reads completed.
This makes the structure explicit. Versions are newest-first; the secondary action is named Compare; a pending comparison moves its checked state immediately;
g Vadvertises numbered travel for v1–v9; and an older page marks the stable version control when a newer page is available. The closed control keeps its reserved width, the one-version state remains passive orientation, and the menu stays attached to that control on narrow screens.The feature-gallery corpus, public descriptions, keyboard reference behavior, responsive geometry, and async comparison races are covered by the updated tests.