diff --git a/.changeset/accessible-control-contrast.md b/.changeset/accessible-control-contrast.md new file mode 100644 index 0000000..bcf43ca --- /dev/null +++ b/.changeset/accessible-control-contrast.md @@ -0,0 +1,5 @@ +--- +'@directory/web': patch +--- + +Improve primary button and read-only destination text contrast, remove the sign-in lock icon, and give Search a single native label. diff --git a/apps/web/e2e/details-dialog.e2e.ts b/apps/web/e2e/details-dialog.e2e.ts index 0ac1d3a..e499e51 100644 --- a/apps/web/e2e/details-dialog.e2e.ts +++ b/apps/web/e2e/details-dialog.e2e.ts @@ -310,6 +310,11 @@ for (const width of [360, 1280]) { await page.goto(`${server.url}/?link=alpha`); const dialog = page.getByRole('dialog', { name: 'Alpha service' }); await expect(dialog).toBeVisible(); + const destination = dialog.getByRole('textbox', { name: 'Destination', exact: true }); + await expect(destination).toHaveCSS( + 'color', + colorScheme === 'light' ? 'rgb(23, 23, 23)' : 'rgb(245, 245, 245)' + ); const close = dialog.getByRole('button', { name: 'Close', exact: true }); const external = dialog.getByRole('link', { name: 'Open Alpha service (opens in a new tab)', diff --git a/apps/web/e2e/search.e2e.ts b/apps/web/e2e/search.e2e.ts index f4d827c..779bf69 100644 --- a/apps/web/e2e/search.e2e.ts +++ b/apps/web/e2e/search.e2e.ts @@ -39,6 +39,10 @@ test('search finds a bookmark, opens its details and clears back to browsing', a await expect(search).toBeEnabled(); await expect(page.getByRole('heading', { level: 2 })).toHaveText(['Media', 'Tools']); + const label = page.locator('label[for="directory-search"]'); + await expect(label).toHaveCount(1); + await label.click(); + await expect(search).toBeFocused(); await search.fill('photos'); await expect(results.getByRole('link')).toHaveCount(1); await expect(results.getByRole('link')).toContainText('Family photos'); diff --git a/apps/web/e2e/signin.e2e.ts b/apps/web/e2e/signin.e2e.ts index 007e0c7..eeae3a7 100644 --- a/apps/web/e2e/signin.e2e.ts +++ b/apps/web/e2e/signin.e2e.ts @@ -21,7 +21,7 @@ const logo = ''; const favicon = ''; -const light = '#abc'; +const light = '#0f766e'; const dark = '#13579b'; let publicDir: string; @@ -127,15 +127,12 @@ for (const strategy of ['credentials', 'sso'] as const) { colorScheme === 'light' ? 'rgb(254, 242, 242)' : 'rgb(69, 10, 10)' ); const button = page.getByRole('button'); - await expect(button).toHaveCSS( - 'background-color', - colorScheme === 'light' ? 'rgb(170, 187, 204)' : 'rgb(19, 87, 155)' - ); const colors = await button.evaluate((node) => ({ foreground: getComputedStyle(node).color, background: getComputedStyle(node).backgroundColor })); - expect(contrast(colors.foreground, colors.background)).toBeGreaterThanOrEqual(4.5); + expect(colors.background).toMatch(/^rgb\(\d+, \d+, \d+\)$/); + expect(contrast(colors.foreground, colors.background)).toBeGreaterThanOrEqual(7); for (const input of await page.locator('input:not([type="hidden"])').all()) { expect((await input.boundingBox())!.height).toBeGreaterThanOrEqual(44); } @@ -163,6 +160,7 @@ for (const strategy of ['credentials', 'sso'] as const) { expect(Math.abs(card!.y + card!.height / 2 - 450)).toBeLessThan(1); } if (strategy === 'credentials') { + await expect(button.locator('svg')).toHaveCount(0); await expect(page.getByLabel('Username')).toBeFocused(); await expect(page.getByLabel('Username')).toHaveAttribute('autocomplete', 'username'); await expect(page.getByLabel('Password')).toHaveAttribute( @@ -205,9 +203,7 @@ for (const strategy of ['credentials', 'sso'] as const) { expectPrivate(text, app); for (const value of ['/logo', '/favicon']) expect(text).toContain(value); if (path === '/signin') { - expect(text).toContain( - `` - ); + expect(text).toContain(`--color-primary:light-dark(${light},${dark})`); } else { expect(text).not.toContain('--color-primary'); } diff --git a/apps/web/src/lib/components/search/BookmarkSearch.svelte b/apps/web/src/lib/components/search/BookmarkSearch.svelte index 56bf190..0b03315 100644 --- a/apps/web/src/lib/components/search/BookmarkSearch.svelte +++ b/apps/web/src/lib/components/search/BookmarkSearch.svelte @@ -139,6 +139,7 @@ aria-hidden="true" focusable="false" /> + Search {/snippet} {#snippet clearButton()} @@ -148,7 +149,6 @@ {/snippet}