Skip to content

Keep a focus preview's description on links that open in a new tab, and update three journeys for #5614's previews - #5748

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-5707
Nov 9, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-5707

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

This fixes the five nightly journeys that #5614 turned red. One failure was a runtime bug, and the other four were journeys written before #5614's documented behavior.

The runtime bug. A focus preview describes what has focus through ariaDescribedByElements, which empties the aria-describedby attribute. On a link that opens in a new tab, such as an All pages row, declared-words.js read the empty attribute as an author change and wrote its "opens in a new tab" id back. That removed the preview from what a screen reader hears. When the preview went, its restore wrote that same id again, which is the unchanged write: aria-describedby the nightly reported. The link treatment now leaves the element references in place while they still hold its new-tab description. So while the preview stands, the row is described by both the new-tab words and the preview. Once the preview goes, it is described by the new-tab words alone. test_a_focus_preview_on_a_link_elsewhere_keeps_its_new_tab_description (browser tier) fails on main, where the row's references hold only "opens in a new tab", and passes with the fix.

Journeys that predate #5614. #5614 says: "Escape puts away a standing preview before it does anything else, so after a Tab onto a control that previews, closing the surface takes two presses". It also says it updated test_command_routes and threads/test_navigation for this, but those runs don't reach nightly journeys. This PR updates the rest:

  • test_all_pages_takes_the_keyboard: the arrow walk leaves the row's preview standing, so put_preview_away comes before the Escape that closes All pages. Its 120 s timeout was that Escape being taken by the preview.
  • test_a_diff_outlet_keeps_the_shared_attachment_controls: focus on "Other responses" after a key shows its preview, so the bar closes on the second Escape.
  • test_every_product_route_is_a_live_leaf_page and test_the_public_catalog_is_a_visual_index_of_full_page_routes count one chrome root (.lf-chrome not inside another). Pointing reads; pressing acts: one owner previews every control #5614's preview stage is an .lf-chrome box nested in the root on purpose (preview.js, stage), so that the chrome sheet dresses the preview inside a modal dialog too. The two roots in the report were that stage, not a second runtime.

No interface moves beyond what #5614 decided.

Verification

Each of the five journeys named in #5707 failed on main with the issue's diagnostic. All five pass on this branch, rebased on 57eb1d46b, with uv run pytest --run-nightly <node id>, along with the new browser test. The external-link tests (test_a_render_of_an_external_links_words_keeps_its_treatment, test_an_external_link_says_and_opens_where_it_goes, test_call_diff_projects_stable_commentable_rows, test_a_projected_external_link_gets_the_pages_link_treatment), test_a_preview_shown_on_focus_describes_what_focus_is_on, pnpm run test:runtime and pnpm run check pass.

Closes #5707 — automated triage

…nd update three journeys for #5614's previews

A focus preview describes what focus is on through `ariaDescribedByElements`, which
empties the `aria-describedby` attribute. On a link that opens elsewhere, such as an All
pages row, the link's own treatment (declared-words.js) read that as a change and wrote
its "opens in a new tab" id back, which dropped the preview from what a screen reader
hears; when the preview went, its restore wrote the same id again, the unchanged write
the nightly journey reported. The treatment now leaves the references alone while they
still hold its description, so the row is described by both while the preview stands
and by its new-tab words once it goes.

Three journeys predated #5614's documented behavior and now follow it:
- `test_all_pages_takes_the_keyboard` and the diff outlet's attachment journey put
  away the focus preview with a first Escape before the Escape that closes the panel or
  bar.
- The site journeys count one chrome root (`.lf-chrome` not inside another), since
  the preview's stage is a nested `.lf-chrome` box by design.

Closes #5707

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR overlaps with #5746. That PR stops a walk's or an arrow key's landing (move) from showing a preview: "A command's landing reads nothing: a walk such as m, an arrow key through a list". Three steps here assume the landing still previews:

  • test_a_focus_preview_on_a_link_elsewhere_keeps_its_new_tab_description reaches the row with ArrowDown and expects a preview.
  • test_all_pages_takes_the_keyboard calls put_preview_away after the arrow walk. That helper fails unless a preview was standing.
  • test_a_diff_outlet_keeps_the_shared_attachment_controls calls put_preview_away after a scripted focus() on "Other responses". Whether that still previews under #5746 depends on how it classifies the focus.

I'll push a change that moves the browser test onto tab_onto. Tab still previews under both rules, and the runtime fix is about that path. The two journey edits can't satisfy both rules at once, and PR CI doesn't run journeys. So whichever of the two PRs lands second needs to drop those put_preview_away calls, or the nightly journeys go red again.

Tab shows a focus preview under the current rules and under #5746, which
stops an arrow key's landing from previewing; the test is about the
description a Tab-shown preview adds, so it no longer depends on the
arrow landing.
@leaf-agent
leaf-agent merged commit c997131 into main Nov 9, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5707 branch November 9, 2026 09:31
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.

Five nightly journeys fail on main since #5614: a repeated aria-describedby write, two .lf-chrome roots on site routes, a visible inline diff bar

1 participant