From 0e5cbd3fb62f4190874b008f7262d7a260d92dac Mon Sep 17 00:00:00 2001 From: TheMightyTRexUK <196487809+TheMightyTRex@users.noreply.github.com> Date: Sun, 1 Nov 2026 21:12:37 +0000 Subject: [PATCH] Calendar: one main heading on the Discover calendar Discover, Calendar had two h1 headings: Discover's visually hidden page heading and the calendar's own "Calendar" heading. Screen readers announced both as main headings, where a page should have one. The calendar's heading is now an h2 under the Discover heading, as in the other Discover views, so it also takes their heading style. Adds a mocked UI test that the calendar view has a single h1. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/pages/ReleaseCalendar.tsx | 2 +- .../tests/ui/release-calendar-heading.spec.ts | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 apps/web/tests/ui/release-calendar-heading.spec.ts diff --git a/apps/web/src/pages/ReleaseCalendar.tsx b/apps/web/src/pages/ReleaseCalendar.tsx index c3b7c626..e47d7026 100644 --- a/apps/web/src/pages/ReleaseCalendar.tsx +++ b/apps/web/src/pages/ReleaseCalendar.tsx @@ -586,7 +586,7 @@ export default function ReleaseCalendar({ canEdit }: { canEdit: boolean }) { >
-

Calendar

+

Calendar

Audiobook release days for the genres you follow. A work date is labeled when the audiobook day is still unknown. diff --git a/apps/web/tests/ui/release-calendar-heading.spec.ts b/apps/web/tests/ui/release-calendar-heading.spec.ts new file mode 100644 index 00000000..bdbdb92c --- /dev/null +++ b/apps/web/tests/ui/release-calendar-heading.spec.ts @@ -0,0 +1,41 @@ +import { expect, test } from "../fixtures"; + +test("the Discover calendar has one main heading", async ({ page }) => { + await page.route("**/api/**", (route) => { + const url = new URL(route.request().url()); + let data: unknown = []; + if (url.pathname === "/api/auth/me") + data = { + user: { + id: "reader", + role: "member", + display_name: "Reader", + permissions: [], + access_label: "Member", + onboarding_status: "complete", + }, + csrf_token: "test", + }; + else if (url.pathname === "/api/setup/onboarding") + data = { status: "completed" }; + else if (url.pathname === "/api/releases/calendar") + data = { + month: url.searchParams.get("month"), + genres: [], + choices: ["Fantasy"], + items: [], + undated: [], + page: 1, + has_more: false, + status: "ready", + stale: false, + }; + return route.fulfill({ json: data }); + }); + await page.goto("/discover?view=calendar"); + await expect( + page.getByRole("heading", { level: 2, name: "Calendar" }), + ).toBeVisible(); + await expect(page.getByRole("heading", { level: 1 })).toHaveCount(1); + await expect(page.getByRole("heading", { level: 1 })).toHaveText("Discover"); +});