Skip to content

Set aria-modal on modal dialogs - #19255

Merged
gtritchie merged 1 commit into
mainfrom
bugfix/19251-aria-modal
Oct 24, 2026
Merged

gtritchie merged 1 commit into
mainfrom
bugfix/19251-aria-modal

Conversation

@gtritchie

Copy link
Copy Markdown
Member

ModalDialogTracker.onShow now sets aria-modal="true" on any panel whose role is dialog or alertdialog. That covers ModalDialogBase dialogs (including MessageDialog), ApplicationEndedPopupPanel, and the command palette. Tracked panels with no dialog role, such as FullscreenPopupPanel, are left alone, since aria-modal isn'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

  • New ModalDialogTrackerTests (dialog, alertdialog, and a panel without a dialog role); ant unittest passes.
  • On a dev server, the trust dialog has aria-modal="true" and passes landmark-one-main and page-has-heading-one. It still fails aria-dialog-name, which is Project trust dialog has no accessible name #19252.
  • With Install Packages open, the package-name suggestion popup (attached to <body>, outside the dialog) is still in the accessibility tree in Chrome, and behaves the same in Safari with and without this change.

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.
@gtritchie gtritchie added this to the 2026.11 (Montauk Daisy) milestone Oct 23, 2026
@gtritchie gtritchie self-assigned this Oct 23, 2026
@gtritchie

Copy link
Copy Markdown
Member Author

FYI, not for this PR: FullscreenPopupPanel (used by ViewFilePanel for viewing files from VCS history and R Markdown output, and by the presentation zoom) also goes through ModalDialogTracker, so the main window is made inert and aria-hidden while it shows. It has no dialog role, though, so it doesn't get aria-modal, and axe probably reports the same landmark-one-main / page-has-heading-one failures there as it did for the trust dialog (not checked). Giving it role="dialog" and an accessible name would let this change cover it too, but that can be a separate issue.

@github-actions

Copy link
Copy Markdown

RStudio E2E - all platforms

1 test(s) failed

###################- 99% pass rate

Passed Failed Skipped Flaky
4187 1 223 3
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 14 0
✅ desktop-linux 1051 0 42 0
✅ desktop-macos 1047 0 46 1
✅ desktop-windows 1049 0 49 1
❌ server-linux 1002 1 44 1
✅ setup 36 0 28 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit 84977cea84d7bab550bd806ab2afe3d408bc650a - Run #1666

@gtritchie
gtritchie merged commit e9abac7 into main Oct 24, 2026
40 of 41 checks passed
@gtritchie
gtritchie deleted the bugfix/19251-aria-modal branch October 24, 2026 19:00
gtritchie added a commit that referenced this pull request Oct 24, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modal dialogs don't set aria-modal, so alert dialogs fail axe page-level checks

1 participant