Repository navigation
Keep a focus preview's description on links that open in a new tab, and update three journeys for #5614's previews - #5748
Merged
Merged
Conversation
…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
commented
Nov 9, 2026
leaf-agent
left a comment
Collaborator
Author
There was a problem hiding this comment.
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_descriptionreaches the row withArrowDownand expects a preview.test_all_pages_takes_the_keyboardcallsput_preview_awayafter the arrow walk. That helper fails unless a preview was standing.test_a_diff_outlet_keeps_the_shared_attachment_controlscallsput_preview_awayafter a scriptedfocus()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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thearia-describedbyattribute. On a link that opens in a new tab, such as an All pages row,declared-words.jsread 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 theunchanged write: aria-describedbythe 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_routesandthreads/test_navigationfor 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, soput_preview_awaycomes 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_pageandtest_the_public_catalog_is_a_visual_index_of_full_page_routescount one chrome root (.lf-chromenot inside another). Pointing reads; pressing acts: one owner previews every control #5614's preview stage is an.lf-chromebox 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, withuv 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:runtimeandpnpm run checkpass.Closes #5707 — automated triage