diff --git a/apps/app/e2e/shell/editor-more-menu.spec.ts b/apps/app/e2e/shell/editor-more-menu.spec.ts index 41b82586..dcca48f6 100644 --- a/apps/app/e2e/shell/editor-more-menu.spec.ts +++ b/apps/app/e2e/shell/editor-more-menu.spec.ts @@ -111,6 +111,11 @@ test.describe('« Plus » dropdown', () => { const boxes = await rows.evaluateAll((els) => els.map((el) => el.getBoundingClientRect().toJSON()), ) + expect(new Set(boxes.map((b) => Math.round(b.x))).size, 'same x').toBe(1) + expect( + new Set(boxes.map((b) => Math.round(b.width))).size, + 'same width', + ).toBe(1) boxes.forEach((box, at) => { expect(box.height, `row ${at} height`).toBeGreaterThanOrEqual(44) expect(box.x, `row ${at} left`).toBeGreaterThanOrEqual(0) @@ -122,6 +127,13 @@ test.describe('« Plus » dropdown', () => { } }) await expectAccessible(page, `« Plus » list at ${width} px`) + // An active row: pick Constats, reopen, axe with the tint and the check. + await rows.first().click() + await more(page).click() + await expect(list(page).locator('[aria-current="true"]')).toHaveCount(1) + // Axe reads the colours: wait until the fade-in has ended. + await expect(list(page)).toHaveCSS('opacity', '1') + await expectAccessible(page, `« Plus » list, active row, at ${width} px`) }) } diff --git a/apps/app/src/components/editor/EditorTabs.tsx b/apps/app/src/components/editor/EditorTabs.tsx index eb4d2096..cfe5d543 100644 --- a/apps/app/src/components/editor/EditorTabs.tsx +++ b/apps/app/src/components/editor/EditorTabs.tsx @@ -20,17 +20,27 @@ import { useT } from '@/i18n/useT' import HistoryButtons from './HistoryButtons' import { MORE_LIST_ID, useMoreDismiss, useMoreMenu } from './useMoreMenu' -const BASE = - 'min-h-11 whitespace-nowrap border-b-2 px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]' +const FOCUS_RING = + 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]' +const BASE = `min-h-11 whitespace-nowrap border-b-2 px-3 text-sm ${FOCUS_RING}` const ACTIVE = 'border-[var(--color-accent)] font-medium text-[var(--color-accent-strong)]' const IDLE = 'border-transparent text-[var(--color-ink-muted)] hover:text-[var(--color-ink)]' const ROW = - 'flex min-h-12 w-full items-center justify-between gap-3 rounded-md px-4 text-left text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]' + `flex min-h-12 w-full items-center justify-between gap-3 rounded-md px-4 text-left + text-sm ${FOCUS_RING}`.replace(/\s+/g, ' ') const ROW_ACTIVE = 'bg-[var(--color-accent)]/10 font-medium text-[var(--color-accent-strong)]' +const ROW_IDLE = + 'text-[var(--color-ink-muted)] hover:bg-[var(--color-accent)]/5 hover:text-[var(--color-ink)]' +const MORE_PANEL = + `absolute inset-x-0 top-full z-20 mt-1 flex flex-col gap-1 rounded-lg border + border-[var(--color-border)] bg-[var(--color-surface)] p-2 shadow-lg`.replace( + /\s+/g, + ' ', + ) /** The blocking-error count on the Vérification tab, as text; absent at zero. */ function ErrorCount({ tab }: { tab: EditorTabId }) { @@ -138,7 +148,7 @@ function MoreList({ more, active, onPick }: MoreListProps) { transition: { duration: reduced ? 0 : 0.15 }, }} exit={{ ...hidden, transition: { duration: reduced ? 0 : 0.12 } }} - className="absolute inset-x-0 top-full z-20 mt-1 flex flex-col gap-1 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-2 shadow-lg" + className={MORE_PANEL} > {more.map((tab) => (