Repository navigation
Set aria-modal on modal dialogs - #19255
Conversation
ModalDialogTracker makes the rest of the page inert while a modal is showing, but the dialogs never said so themselves. axe only treats role="dialog" or aria-modal="true" as an open modal, so with an alertdialog showing (MessageDialog, the trust dialog) it checked the page behind it and reported the hidden main landmark and the missing level-one heading. onShow now sets aria-modal="true" on panels with a dialog or alertdialog role, the only roles that allow it. Addresses #19251.
|
FYI, not for this PR: |
RStudio E2E - all platforms1 test(s) failed
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
…n external-server runs (#19262) * e2e: name a chat send blocked by a missing model sendChatMessage clicked Send as soon as it was visible, so a Send that Posit Assistant kept disabled for lack of a model surfaced as a 10s click timeout. It now waits for Send to enable. When it stays disabled with "Please pick a model", the test skips if Posit AI is unreachable from the runner too (posit-dev/assistant#2850) and otherwise fails naming that state. Addresses #19261. * e2e: attach positai.log to failures on external-server runs Session logs were attached only on Desktop, where the harness can read the log directory, so the Linux Server CI failure in #19255 carried no record of what the Posit Assistant backend fetched. On external-server runs the fixture now fetches positai.log through the session's /files/ endpoint, from the account's default data home, and attaches the entries stamped since the failing test started. Addresses #19261. * e2e: read the no-model reason from Send's own description The check matched "pick a model" anywhere in the chat frame, so a chat message with that phrase could turn an unrelated disabled Send into the no-model failure and its outage check. It now reads only the text Send's aria-describedby points at. The harness test that sends now starts with Send disabled and enables it later than click()'s own wait would last, so it covers the wait itself. Addresses #19261. * e2e: keep the server's path prefix when fetching positai.log The fetch kept only the origin of PW_RSTUDIO_SERVER_URL, so a server served under a path prefix (https://host/rstudio) got a request for /files/... instead of /rstudio/files/... and the log was never attached. /files/ is now resolved under the configured URL. Addresses #19261. * e2e: suppress Snyk's HTTP finding on the harness's loopback stub server Addresses #19261. * e2e: skip the positai.log fetch when the session is deaf Addresses #19261. * e2e: keep Send's timeout when its description can't be read Addresses #19261. * e2e: warn when /files/ answers with something other than positai.log Addresses #19261. * e2e: drop the Sec-Fetch-Site header from the positai.log fetch /files/ accepts a request with neither Sec-Fetch-Site nor Referer (SessionFiles.cpp), which is what page.request sends. Addresses #19261. * e2e: rely on externalServerUrl() for the trailing slash in the log URL Addresses #19261. * e2e: rewrap the positai.log paragraph in the README Addresses #19261. * e2e: finish rewrapping the README's failure-diagnostics paragraph Addresses #19261. * e2e: don't warn about an empty positai.log Addresses #19261. * e2e: test that a Send leaving the page keeps the plain timeout Addresses #19261. * e2e: remove Send once typing goes quiet, not a second after it starts Addresses #19261. * e2e: bound the read of Send's description to 1s Addresses #19261.
ModalDialogTracker.onShownow setsaria-modal="true"on any panel whose role isdialogoralertdialog. That coversModalDialogBasedialogs (includingMessageDialog),ApplicationEndedPopupPanel, and the command palette. Tracked panels with no dialog role, such asFullscreenPopupPanel, are left alone, sincearia-modalisn't allowed on other roles.While a modal is showing, the rest of the page is already inert, but the dialog itself didn't say it was modal. axe only treats
dialog,[role=dialog], or[aria-modal=true]as an open modal, so with an alertdialog showing (the project trust dialog, any message box) it checked the page behind it and reported "Document should have one main landmark" and "Page should contain a level-one heading". With this change both checks pass on the trust dialog (axe-core 4.13).Fixes #19251.
Testing
ModalDialogTrackerTests(dialog, alertdialog, and a panel without a dialog role);ant unittestpasses.aria-modal="true"and passeslandmark-one-mainandpage-has-heading-one. It still failsaria-dialog-name, which is Project trust dialog has no accessible name #19252.<body>, outside the dialog) is still in the accessibility tree in Chrome, and behaves the same in Safari with and without this change.