Skip to content

Read the page's controls from the root element in two test readers - #5439

Merged
max-sixty merged 1 commit into
mainfrom
agent-a46ad3476dd19dbd7
Nov 5, 2026
Merged

max-sixty merged 1 commit into
mainfrom
agent-a46ad3476dd19dbd7

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

#5228 moved Leaf's interface root out of body, so two test readers that start at body no longer saw the page's controls. The pressed-controls test now collects controls by walking from document.documentElement, and reader_state takes its accessibility snapshot of :root.

Without the change, test_a_pressed_panel_control_keeps_its_face_and_takes_the_next_press[alert-review] and test_page_fixture_renders[alert-review] fail (the second with g opened no go-to). With it, both pass.

I also ran six more of the nightly run 41816958231's failures from these test groups, and five pass with the change: the pressed-panel-control cases [code-comparison] and [playground], the test_page_fixture_renders cases [file-editor] and [page-annotations], and the [browser] case of tests/journeys/widgets/test_pressed_controls.py. test_page_fixture_renders[rust-sort] still fails, now with apparatus among authored: <span>, which Leaf adds, stands among the page's own elements inside <body>, a different check that this change doesn't touch.

This was written by Claude Code on behalf of max-sixty

@max-sixty
max-sixty merged commit e0c0f9c into main Nov 5, 2026
4 checks passed
@max-sixty
max-sixty deleted the agent-a46ad3476dd19dbd7 branch November 5, 2026 08:31
leaf-agent added a commit that referenced this pull request Nov 5, 2026
…5444)

Every external link's `aria-describedby` points at one hidden "opens in
a new tab" span, and `declared-words.js` appended that span to
`document.body`. Since #5228, `body`'s children are the page's own
elements (`pageDocument()` returns `body`), so the span sat beside
`main` and changed what the page's structural selectors match, such as
`main:last-child` or `main + *`. The render gate's
`apparatusAmongAuthored` probe caught this on every corpus page with an
external link. In [scheduled run
41816958231](https://github.com/max-sixty/leaf/actions/runs/41816958231)
it reported `<span>, which Leaf adds, stands among the page's own
elements inside <body>` for github-discoveries, pr-walkthrough,
rust-sort and others. The span now lives in the chrome root
(`chromeRoot`, mounted after `body` in both the live and the export boot
paths). It is in the same document, so the link's accessible description
doesn't change. Inside a shadow root the span still lives in that root.

Verification on Linux:
- `test_page_fixture_renders[github-discoveries]`, `[pr-walkthrough]`,
`[rust-sort]` and `[alert-review]` from
`tests/journeys/test_render_gate.py` (run with `--run-nightly`) pass.
Without this change, github-discoveries fails with the finding above;
the debug output showed the offending element as `<span data-lf-gen="1"
id="lf-external-description-1" hidden data-lf-runtime>`.
- That gate run also carried #5439's one-line `reader_state` change.
Without it these cases also fail with `g opened no go-to`, which #5439
owns.
- The accessible-description tests
`test_a_render_of_an_external_links_words_keeps_its_treatment` and
`test_an_external_link_says_and_opens_where_it_goes` pass.
- `pnpm run test:runtime` (810) and `pnpm run check` pass.

One pr-walkthrough run also ended with a teardown error, `ResizeObserver
loop completed with undelivered notifications` on `versions/v1.html`.
The same error appears in run 41816958231 before this change, on
pr-walkthrough, notification-playground and thread-panel-gallery, so it
is a separate cause.

Refs #4225 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty pushed a commit that referenced this pull request Nov 5, 2026
…settles a round trip (#5451)

`surface_findings` (render gate, closed surfaces) removes the live
region's last announcement from each round trip's reading before
comparing trips. It does this because a panel can mark a message read
after Go-to announces its routes, which changes the routes Go-to speaks
next. Since #5439, `reader_state` snapshots `:root`, which nests the
live region's text one level deeper than the region's own
`aria_snapshot`. The exact-line match never found the announcement, so
on current main `test_page_fixture_renders[ship-review]` fails with `the
on me view closed again leaving`. The only difference between the two
lines is the `u first unread` route. The match now ignores indentation
and still removes one reading line per announced line.


`tests/journeys/test_render_gate.py::test_page_fixture_renders[ship-review]`
(with `--run-nightly`) fails on main `e0c0f9c5f` and passes with this
change.

Refs #4225 — automated triage

Co-authored-by: leaf-agent <[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