diff --git a/apps/web/src/decision-view-control.tsx b/apps/web/src/decision-view-control.tsx index ae1260a50..2ddad7c7c 100644 --- a/apps/web/src/decision-view-control.tsx +++ b/apps/web/src/decision-view-control.tsx @@ -70,7 +70,7 @@ export function DecisionViewControl( aria-current={view === "plan" ? "page" : undefined} aria-label={view === "plan" ? undefined : documentActivityLabel(documentActivity)} aria-pressed={view === "plan"} - className={`btn btn-sm relative transition-[background-color,box-shadow,color] ${ + className={`btn btn-sm gap-1.5 transition-[background-color,box-shadow,color] ${ view === "plan" ? "bg-ground font-medium text-gray-800" : "text-text-tertiary hover:bg-hover" @@ -79,7 +79,7 @@ export function DecisionViewControl( type="button" > Document - {view !== "plan" && } + {view !== "plan" && } ); } diff --git a/e2e/document-activity.e2e.ts b/e2e/document-activity.e2e.ts index c5ed8ed4b..a5c736c5f 100644 --- a/e2e/document-activity.e2e.ts +++ b/e2e/document-activity.e2e.ts @@ -54,6 +54,15 @@ for ( await expect(documentTab).toHaveAccessibleName("Document, new changes"); await expect(documentTab.locator("[data-document-activity='unseen']")).toBeVisible(); + if (name === "desktop") { + // A still dot after the label, inside the tab and centred on its text. + let dot = documentTab.locator("[data-document-activity='unseen']"); + await expect(dot).toHaveCSS("animation-name", "none"); + let mark = (await dot.boundingBox())!; + let tab = (await documentTab.boundingBox())!; + expect(mark.x + mark.width).toBeLessThanOrEqual(tab.x + tab.width); + expect(Math.abs(mark.y + mark.height / 2 - (tab.y + tab.height / 2))).toBeLessThanOrEqual(1); + } await documentTab.click(); await expect(content(page)).toContainText("Revised paragraph."); diff --git a/e2e/responsive-activity.e2e.ts b/e2e/responsive-activity.e2e.ts index 406d04851..90aad2973 100644 --- a/e2e/responsive-activity.e2e.ts +++ b/e2e/responsive-activity.e2e.ts @@ -133,6 +133,10 @@ test("a closed desktop Chat tab keeps unread activity visible", async ({ join, p let toggle = page.getByRole("button", { name: "Show chat, 1 unread" }); await expect(toggle).toBeVisible(); await expect(toggle.locator('span[aria-hidden="true"]')).toHaveCount(1); + // The badge sits on the Chat glyph's corner, clear of the label. + let badge = (await toggle.locator('span[aria-hidden="true"]').boundingBox())!; + let label = (await toggle.getByText("Chat", { exact: true }).boundingBox())!; + expect(badge.x + badge.width).toBeLessThanOrEqual(label.x); let count = toggle.locator('[data-motion-feedback="count"]'); expect( await count.evaluate(element => diff --git a/scripts/design-contract/exceptions/dynamic-web.json b/scripts/design-contract/exceptions/dynamic-web.json index f8c552d4a..1c07e47ba 100644 --- a/scripts/design-contract/exceptions/dynamic-web.json +++ b/scripts/design-contract/exceptions/dynamic-web.json @@ -276,7 +276,7 @@ 1 ] ], - "sourceHash": "f6dc937a28e2d6641497848821c5fae44a597375191207598dfba0fa58fea5ee" + "sourceHash": "6dcdd2c5d6243bdc297c311742fc47e8e5da433d201b6e1b728c42c714d9a9c4" }, { "file": "apps/web/src/navigation-dialog.tsx",