Repository navigation
fix(web): keep focus in the welcome dialog, make the page behind it inert and close it on Escape - #318
Open
harenome wants to merge 1 commit into
Open
fix(web): keep focus in the welcome dialog, make the page behind it inert and close it on Escape#318harenome wants to merge 1 commit into
harenome wants to merge 1 commit into
Conversation
…nert and close it on Escape The first-open question is now a native dialog opened with showModal(), so the page behind it is inert and Escape closes it. Escape takes the same path as No, I'll explore. Tab and Shift+Tab wrap between its two buttons, and the focus goes back to the element that had it before.
This branch has not been deployed
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.
Closes #295
What
The first-open question ("Welcome to Nullius. Want a guided start?") was a
divwithrole="dialog"andaria-modal="true"over a scrim. Tab left it for the page behind, the page stayed reachable, and Escape did nothing.<dialog>opened withshowModal(), the way the app's other dialogs open. The browser makes the page behind it inert and closes it on Escape. It looks the same: the scrim is its::backdrop, and its size and colours are unchanged in both themes and at phone width.The tour pop-ups after Yes, guide me are not modal and are unchanged.
Touches
static (
app/static/onboarding.js,app/static/onboarding.css) · testsBefore and after
/new-runwith an empty profile, Tab pressed twice. Before: the focus is on Skip to content, behind the scrim. After: the focus is back on Yes, guide me.Verified
A Playwright check in Chromium, 1280 x 900, an empty profile, on upstream/main (
262567b8) and on this branch:#rail-toggle. Shift+Tab 2 to 4:#nb-next, then the benchmark cards#rail-toggle.focus()takes the focus while open. The accessibility tree has 61 buttons and links#rail-toggle.focus()does nothing while open and works after it closes. The accessibility tree has only the dialog's two buttonsaskedstays falseAlso on this branch: Yes, guide me still starts the tour, no page errors, dark theme and 375 px width look as before, with reduced motion too.
app/ui_tests/test_onboarding_dialog.pyrunsonboarding.jsunder Node with a stand-in DOM: it opens modal with the focus on Yes, guide me, Tab and Shift+Tab wrap between the two buttons, Escape stores the same state as No, Yes still opens the guide, and every close returns the focus. Both tests fail on upstream/main.python:3.12container with Node:python3 app/tests/parallel.py: 3215 tests in 169 modules, OK.python3 app/tests/parallel.py app/ui_tests: 721 tests in 62 modules, OK.Risk
z-index: 90. Nothing else in the app is shown over it.