The best way to control Claude Code, Codex and more from any computer or phone
fix(web): screen readers see one Notifications landmark, not two (#31724)
Julius Marminge committed
Nov 16, 2026 at 12:30 UTC
8ca0c88cfd16135afb995771ac5becee0de9bc1b
2 files changed
+26
-2
apps/web/src/components/ui/toast.browser.test.tsx
+20
-1
@@ -2,7 +2,7 @@ import { describe, expect, it } from "vite-plus/test";
2
import { page } from "vite-plus/test/browser";
3
4
import { render } from "../../../test/render";
5
-import { ToastProvider, toastManager } from "./toast";
5
+import { AnchoredToastProvider, ToastProvider, toastManager } from "./toast";
6
7
describe("toastManager", () => {
8
it("shows a toast added before any provider mounted", async () => {
@@ -12,4 +12,23 @@ describe("toastManager", () => {
12
13
await expect.element(page.getByText("Raised before the first render")).toBeVisible();
14
});
15
+
16
+ it("exposes one Notifications landmark when both toast providers mount", async () => {
17
+ await using _screen = await render(
18
+ <ToastProvider>
19
+ <AnchoredToastProvider>{null}</AnchoredToastProvider>
20
+ </ToastProvider>,
21
+ );
22
+
23
+ const notifications = page.getByRole("region", { name: "Notifications" });
24
+ await expect.element(notifications.first()).toBeInTheDocument();
25
+ expect(
26
+ notifications.elements(),
27
+ "only the corner toast viewport should be a Notifications landmark",
28
+ ).toHaveLength(1);
29
+ await expect.element(notifications).toHaveAttribute("data-slot", "toast-viewport");
30
+
31
+ const anchoredViewport = document.querySelector("[data-slot=toast-viewport-anchored]");
32
+ expect(anchoredViewport).toHaveAttribute("aria-live", "polite");
33
+ });
34
});
apps/web/src/components/ui/toast.tsx
+6
-1
@@ -726,7 +726,12 @@ function AnchoredToasts() {
726
727
return (
728
<Toast.Portal data-slot="toast-portal-anchored">
729
- <Toast.Viewport className="outline-none" data-slot="toast-viewport-anchored">
729
+ <Toast.Viewport
730
+ aria-label={undefined}
731
+ className="outline-none"
732
+ data-slot="toast-viewport-anchored"
733
+ role={undefined}
734
+ >
735
{toasts
736
.filter((toast) => shouldRenderThreadScopedToast(toast.data, activeThreadRef))
737
.map((toast) => {