Skip to content

AI-native design editor. Open-source Figma alternative.

fix: meet WCAG AA contrast and name controls for screen readers (#952)

Danila Poyarkov1717d8d19d71
diff --git a/.storybook/preview.ts b/.storybook/preview.ts
index 93c8fc29c..19130ff07 100644
--- a/.storybook/preview.ts
+++ b/.storybook/preview.ts
@@ -34,30 +34,33 @@ const preview: Preview = {
layout: 'fullscreen',
options: {
storySort: {
+ // Design System follows the families under src/components/ui; App follows product areas.
order: [
'Design System',
[
'Actions',
- ['Button', 'Icon Button'],
'Inputs',
- ['Combobox', 'Segmented Control'],
- 'Navigation',
- ['Tabs'],
- 'Lists',
- ['Action Row'],
- 'Paint',
- ['Fill Swatch'],
- 'Overlays',
- ['Dialog'],
+ 'Selection',
'Feedback',
- ['Placeholder', 'Toast'],
+ 'Overlays',
'Layout',
- ['Panel Foundation']
+ 'Lists',
+ 'Navigation',
+ 'Paint'
+ ],
+ 'App',
+ [
+ 'Editor',
+ ['Navigation', 'Layer Tree', 'Properties'],
+ 'Chat',
+ ['Markdown', 'Message', 'Attachments'],
+ 'Collaboration',
+ 'Settings',
+ 'Home',
+ 'Shell',
+ 'Brand'
],
- 'Editor',
- ['Navigation', 'Layer Tree', 'Properties'],
- 'Chat',
- ['Markdown', 'Message', 'Attachments'],
+ 'Vue SDK',
'*'
]
}
@@ -69,7 +72,19 @@ const preview: Preview = {
}
},
a11y: {
- test: 'error'
+ test: 'error',
+ context: {
+ include: ['body'],
+ exclude: [
+ // Reka's toast viewport brackets its list with empty aria-hidden spans that only pass
+ // focus into the toasts; they never keep it.
+ '[role=region] > span[aria-hidden="true"][tabindex="0"]',
+ // A row being dragged stays behind as a faded placeholder; the drag preview carries it.
+ '[data-dragging]',
+ // Design Check shows the document's own failing text and background colors as a sample.
+ '[data-contrast-sample]'
+ ]
+ }
}
}
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7c73f7dec..bd74b1834 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -118,6 +118,7 @@
- Generate Tailwind JSX with the same class mapping as Tailwind HTML export, so both describe a design the same way, and write opaque colors as hex in HTML, CSS, and Tailwind output. `openpencil export -f jsx --style tailwind` now exports a whole page when no `--node` is given.
- Show download progress with a percentage and transferred size while installing a desktop update, instead of an indeterminate message that lasted until the restart.
- Opening a share link or joining a room opens it in a tab of its own, so a document you already have open is never changed. Until the room's file arrives the tab says it is joining or, when nobody who has the file is online, explains why it is waiting; reloading rejoins, and leaving a room you joined keeps its file as a local unsaved copy.
+- Text in the dark and light themes meets the WCAG AA contrast ratio of 4.5:1. The dark theme's blue fills are deeper, and its blue, purple, pink, and red text is lighter. Light-theme secondary text and warning amber are darker, and hidden layers in the Layers panel dim less.
### Fixed
@@ -206,6 +207,7 @@
- Fill the open subpaths of filled, unstroked SVG paths as if they were closed, as SVG does, in icons from `insert_icon` and Design JSX `<Icon>`, inline Design JSX `<svg>`, SVG from `import_svg` or dropped and pasted files, and SVG clip paths. Icons that cut holes with open subpaths, such as some Font Awesome icons, no longer render with those holes filled in, and filled `<polyline>` elements render filled instead of not at all.
- Keep round and other stroke caps and joins after saving and reopening the file on icons from `insert_icon` and Design JSX `<Icon>`, and on vectors from inline Design JSX `<svg>`, `import_svg`, and dropped or pasted SVG files. They were set only on the stroke paint, which `.fig` does not store, so outline icons such as Lucide's reopened with butt caps and miter joins and showed gaps where their strokes meet.
- Join the right room from a pasted link that ends in a query, `#`, or `/`, and say so when pasted text is not a room link instead of joining an empty room.
+- Name the layer and page rename fields, the command palette list, and picker lists for screen readers, and announce disabled picker options as disabled.
### Performance
diff --git a/packages/core/src/canvas/labels/color.ts b/packages/core/src/canvas/labels/color.ts
index 276e1c476..2fe90725d 100644
--- a/packages/core/src/canvas/labels/color.ts
+++ b/packages/core/src/canvas/labels/color.ts
@@ -1,11 +1,6 @@
-import type { Color } from '@open-pencil/scene-graph'
-import { compositeOver, contrastRatio } from '@open-pencil/scene-graph/color'
-
-import { BLACK } from '#core/constants'
-
-const WHITE: Color = { r: 1, g: 1, b: 1, a: 1 }
+import { WHITE, type Color } from '@open-pencil/scene-graph'
+import { compositeOver, readableForeground } from '@open-pencil/scene-graph/color'
export function canvasLabelForeground(background: Color, canvasBackground: Color = WHITE): Color {
- const composited = compositeOver(background, canvasBackground)
- return contrastRatio(composited, BLACK) >= contrastRatio(composited, WHITE) ? BLACK : WHITE
+ return readableForeground(compositeOver(background, canvasBackground))
}
diff --git a/packages/scene-graph/src/color/contrast.ts b/packages/scene-graph/src/color/contrast.ts
index 03be5421b..7e6e956e4 100644
--- a/packages/scene-graph/src/color/contrast.ts
+++ b/packages/scene-graph/src/color/contrast.ts
@@ -1,5 +1,6 @@
import { wcagContrast } from 'culori'
+import { BLACK, WHITE } from '../constants'
import type { Color } from '../primitives'
/** Opaque color seen when `foreground` at `alpha` is drawn over an opaque `background`. */
@@ -23,3 +24,8 @@ export function contrastRatio(
{ mode: 'rgb', r: b.r, g: b.g, b: b.b }
)
}
+
+/** Black or white, whichever reads better on an opaque `background`. */
+export function readableForeground(background: Pick<Color, 'r' | 'g' | 'b'>): Color {
+ return contrastRatio(background, BLACK) >= contrastRatio(background, WHITE) ? BLACK : WHITE
+}
diff --git a/packages/scene-graph/src/constants.ts b/packages/scene-graph/src/constants.ts
index df2867cbf..28837c017 100644
--- a/packages/scene-graph/src/constants.ts
+++ b/packages/scene-graph/src/constants.ts
@@ -1,6 +1,7 @@
import type { Color } from './primitives'
export const BLACK: Color = { r: 0, g: 0, b: 0, a: 1 }
+export const WHITE: Color = { r: 1, g: 1, b: 1, a: 1 }
export const TRANSPARENT: Color = { r: 0, g: 0, b: 0, a: 0 }
export const DEFAULT_FONT_FAMILY = 'Inter'
export const DEFAULT_STROKE_MITER_LIMIT = 4
diff --git a/packages/scene-graph/tests/color/contrast.test.ts b/packages/scene-graph/tests/color/contrast.test.ts
index d65dc7a3d..b4fa093b9 100644
--- a/packages/scene-graph/tests/color/contrast.test.ts
+++ b/packages/scene-graph/tests/color/contrast.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { compositeOver, contrastRatio } from '@open-pencil/scene-graph/color'
+import { compositeOver, contrastRatio, readableForeground } from '@open-pencil/scene-graph/color'
import type { Color } from '@open-pencil/scene-graph/primitives'
const BLACK: Color = { r: 0, g: 0, b: 0, a: 1 }
@@ -31,3 +31,11 @@ describe('compositeOver', () => {
expect(compositeOver(BLACK, WHITE, 0)).toEqual(WHITE)
})
})
+
+describe('readableForeground', () => {
+ test('picks whichever of black and white contrasts more', () => {
+ expect(readableForeground({ r: 0xeb / 255, g: 0x57 / 255, b: 0x4a / 255 })).toEqual(BLACK)
+ expect(readableForeground({ r: 0x25 / 255, g: 0x63 / 255, b: 0xeb / 255 })).toEqual(WHITE)
+ expect(readableForeground(GRAY_94)).toEqual(BLACK)
+ })
+})
diff --git a/packages/vue/src/i18n/locales/de/pages.json b/packages/vue/src/i18n/locales/de/pages.json
index 9fe12795e..3f04a6020 100644
--- a/packages/vue/src/i18n/locales/de/pages.json
+++ b/packages/vue/src/i18n/locales/de/pages.json
@@ -6,5 +6,6 @@
"pages": "Seiten",
"goToPage": "Zu Seite wechseln…",
"recentPage": "Zuletzt besucht",
- "currentPage": "Aktuelle Seite"
+ "currentPage": "Aktuelle Seite",
+ "pageNameLabel": "Seitenname"
}
diff --git a/packages/vue/src/i18n/locales/de/rename.json b/packages/vue/src/i18n/locales/de/rename.json
index 9ab35d96a..d600da410 100644
--- a/packages/vue/src/i18n/locales/de/rename.json
+++ b/packages/vue/src/i18n/locales/de/rename.json
@@ -5,6 +5,7 @@
"match": "Übereinstimmung",
"to": "Umbenennen in",
"currentName": "Aktueller Name",
+ "layerName": "Ebenenname",
"numberAscending": "Nummer ↑",
"numberDescending": "Nummer ↓",
"startAscendingFrom": "Aufsteigend beginnen bei",
diff --git a/packages/vue/src/i18n/locales/es/pages.json b/packages/vue/src/i18n/locales/es/pages.json
index b1b80fd02..8541e726c 100644
--- a/packages/vue/src/i18n/locales/es/pages.json
+++ b/packages/vue/src/i18n/locales/es/pages.json
@@ -6,5 +6,6 @@
"pages": "Páginas",
"goToPage": "Ir a la página…",
"recentPage": "Reciente",
- "currentPage": "Página actual"
+ "currentPage": "Página actual",
+ "pageNameLabel": "Nombre de la página"
}
diff --git a/packages/vue/src/i18n/locales/es/rename.json b/packages/vue/src/i18n/locales/es/rename.json
index f2e00ce6d..7d76ff92a 100644
--- a/packages/vue/src/i18n/locales/es/rename.json
+++ b/packages/vue/src/i18n/locales/es/rename.json
@@ -5,6 +5,7 @@
"match": "Coincidencia",
"to": "Renombrar como",
"currentName": "Nombre actual",
+ "layerName": "Nombre de la capa",
"numberAscending": "Número ↑",
"numberDescending": "Número ↓",
"startAscendingFrom": "Comenzar ascendente desde",
diff --git a/packages/vue/src/i18n/locales/fr/pages.json b/packages/vue/src/i18n/locales/fr/pages.json
index 592cef383..893825447 100644
--- a/packages/vue/src/i18n/locales/fr/pages.json
+++ b/packages/vue/src/i18n/locales/fr/pages.json
@@ -6,5 +6,6 @@
"pages": "Pages",
"goToPage": "Aller à la page…",
"recentPage": "Récente",
- "currentPage": "Page actuelle"
+ "currentPage": "Page actuelle",
+ "pageNameLabel": "Nom de la page"
}
diff --git a/packages/vue/src/i18n/locales/fr/rename.json b/packages/vue/src/i18n/locales/fr/rename.json
index ca2a72c65..01c854526 100644
--- a/packages/vue/src/i18n/locales/fr/rename.json
+++ b/packages/vue/src/i18n/locales/fr/rename.json
@@ -5,6 +5,7 @@
"match": "Correspondance",
"to": "Renommer en",
"currentName": "Nom actuel",
+ "layerName": "Nom du calque",
"numberAscending": "Numéro ↑",
"numberDescending": "Numéro ↓",
"startAscendingFrom": "Commencer l’ordre croissant à",
diff --git a/packages/vue/src/i18n/locales/it/pages.json b/packages/vue/src/i18n/locales/it/pages.json
index e642d0f73..1541ee65b 100644
--- a/packages/vue/src/i18n/locales/it/pages.json
+++ b/packages/vue/src/i18n/locales/it/pages.json
@@ -6,5 +6,6 @@
"pages": "Pagine",
"goToPage": "Vai alla pagina…",
"recentPage": "Recente",
- "currentPage": "Pagina corrente"
+ "currentPage": "Pagina corrente",
+ "pageNameLabel": "Nome della pagina"
}
diff --git a/packages/vue/src/i18n/locales/it/rename.json b/packages/vue/src/i18n/locales/it/rename.json
index b5f21f39d..002eb07a5 100644
--- a/packages/vue/src/i18n/locales/it/rename.json
+++ b/packages/vue/src/i18n/locales/it/rename.json
@@ -5,6 +5,7 @@
"match": "Corrispondenza",
"to": "Rinomina in",
"currentName": "Nome attuale",
+ "layerName": "Nome del livello",
"numberAscending": "Numero ↑",
"numberDescending": "Numero ↓",
"startAscendingFrom": "Inizia ordine crescente da",
diff --git a/packages/vue/src/i18n/locales/ja/pages.json b/packages/vue/src/i18n/locales/ja/pages.json
index b597b06c9..7227dae2a 100644
--- a/packages/vue/src/i18n/locales/ja/pages.json
+++ b/packages/vue/src/i18n/locales/ja/pages.json
@@ -6,5 +6,6 @@
"pages": "ページ",
"goToPage": "ページへ移動…",
"recentPage": "最近",
- "currentPage": "現在のページ"
+ "currentPage": "現在のページ",
+ "pageNameLabel": "ページ名"
}
diff --git a/packages/vue/src/i18n/locales/ja/rename.json b/packages/vue/src/i18n/locales/ja/rename.json
index 11e867bc9..2a4d2b297 100644
--- a/packages/vue/src/i18n/locales/ja/rename.json
+++ b/packages/vue/src/i18n/locales/ja/rename.json
@@ -5,6 +5,7 @@
"match": "一致",
"to": "変更後の名前",
"currentName": "現在の名前",
+ "layerName": "レイヤー名",
"numberAscending": "番号 ↑",
"numberDescending": "番号 ↓",
"startAscendingFrom": "昇順の開始番号",
diff --git a/packages/vue/src/i18n/locales/pl/pages.json b/packages/vue/src/i18n/locales/pl/pages.json
index 911d26a78..bdce55fff 100644
--- a/packages/vue/src/i18n/locales/pl/pages.json
+++ b/packages/vue/src/i18n/locales/pl/pages.json
@@ -6,5 +6,6 @@
"pages": "Strony",
"goToPage": "Przejdź do strony…",
"recentPage": "Ostatnio otwarta",
- "currentPage": "Bieżąca strona"
+ "currentPage": "Bieżąca strona",
+ "pageNameLabel": "Nazwa strony"
}
diff --git a/packages/vue/src/i18n/locales/pl/rename.json b/packages/vue/src/i18n/locales/pl/rename.json
index d617419b2..9b6037737 100644
--- a/packages/vue/src/i18n/locales/pl/rename.json
+++ b/packages/vue/src/i18n/locales/pl/rename.json
@@ -5,6 +5,7 @@
"match": "Dopasowanie",
"to": "Zmień nazwę na",
"currentName": "Bieżąca nazwa",
+ "layerName": "Nazwa warstwy",
"numberAscending": "Numer ↑",
"numberDescending": "Numer ↓",
"startAscendingFrom": "Zacznij rosnąco od",
diff --git a/packages/vue/src/i18n/locales/ru/pages.json b/packages/vue/src/i18n/locales/ru/pages.json
index c4fb4ebaf..10a6cb607 100644
--- a/packages/vue/src/i18n/locales/ru/pages.json
+++ b/packages/vue/src/i18n/locales/ru/pages.json
@@ -6,5 +6,6 @@
"pages": "Страницы",
"goToPage": "Перейти к странице…",
"recentPage": "Недавняя",
- "currentPage": "Текущая страница"
+ "currentPage": "Текущая страница",
+ "pageNameLabel": "Название страницы"
}
diff --git a/packages/vue/src/i18n/locales/ru/rename.json b/packages/vue/src/i18n/locales/ru/rename.json
index 3d52e40e0..bac181bce 100644
--- a/packages/vue/src/i18n/locales/ru/rename.json
+++ b/packages/vue/src/i18n/locales/ru/rename.json
@@ -5,6 +5,7 @@
"match": "Совпадение",
"to": "Новое имя",
"currentName": "Текущее имя",
+ "layerName": "Название слоя",
"numberAscending": "Номер ↑",
"numberDescending": "Номер ↓",
"startAscendingFrom": "Начать по возрастанию с",
diff --git a/packages/vue/src/i18n/locales/zh-cn/pages.json b/packages/vue/src/i18n/locales/zh-cn/pages.json
index 95c4403b7..689c4031b 100644
--- a/packages/vue/src/i18n/locales/zh-cn/pages.json
+++ b/packages/vue/src/i18n/locales/zh-cn/pages.json
@@ -6,5 +6,6 @@
"pages": "页面",
"goToPage": "转到页面…",
"recentPage": "最近",
- "currentPage": "当前页面"
+ "currentPage": "当前页面",
+ "pageNameLabel": "页面名称"
}
diff --git a/packages/vue/src/i18n/locales/zh-cn/rename.json b/packages/vue/src/i18n/locales/zh-cn/rename.json
index c684aaeea..a458d266a 100644
--- a/packages/vue/src/i18n/locales/zh-cn/rename.json
+++ b/packages/vue/src/i18n/locales/zh-cn/rename.json
@@ -5,6 +5,7 @@
"match": "匹配",
"to": "重命名为",
"currentName": "当前名称",
+ "layerName": "图层名称",
"numberAscending": "编号 ↑",
"numberDescending": "编号 ↓",
"startAscendingFrom": "升序起始值",
diff --git a/packages/vue/src/i18n/messages/pages.ts b/packages/vue/src/i18n/messages/pages.ts
index 998069aba..4ce75ed3e 100644
--- a/packages/vue/src/i18n/messages/pages.ts
+++ b/packages/vue/src/i18n/messages/pages.ts
@@ -10,7 +10,8 @@ export const pageMessageDefaults = {
pages: 'Pages',
goToPage: 'Go to page…',
recentPage: 'Recent',
- currentPage: 'Current page'
+ currentPage: 'Current page',
+ pageNameLabel: 'Page name'
} as const
export const pageMessages = i18n('pages', pageMessageDefaults)
diff --git a/packages/vue/src/i18n/messages/rename.ts b/packages/vue/src/i18n/messages/rename.ts
index 2154e143f..61792407d 100644
--- a/packages/vue/src/i18n/messages/rename.ts
+++ b/packages/vue/src/i18n/messages/rename.ts
@@ -9,6 +9,7 @@ export const renameMessageDefaults = {
match: 'Match',
to: 'Rename to',
currentName: 'Current name',
+ layerName: 'Layer name',
numberAscending: 'Number ↑',
numberDescending: 'Number ↓',
startAscendingFrom: 'Start ascending from',
diff --git a/packages/vue/src/primitives/CommandPalette/CommandPaletteRoot.vue b/packages/vue/src/primitives/CommandPalette/CommandPaletteRoot.vue
index a06a35d12..65512579c 100644
--- a/packages/vue/src/primitives/CommandPalette/CommandPaletteRoot.vue
+++ b/packages/vue/src/primitives/CommandPalette/CommandPaletteRoot.vue
@@ -56,7 +56,6 @@ function select(item: CommandPaletteItem) {
<ListboxRoot
v-model="palette.selectedId.value"
:class="ui?.root"
- :aria-label="labels.paletteLabel"
:data-searching="palette.searchTerm.value ? '' : undefined"
>
<div v-if="palette.isNested.value" :class="ui?.back">
@@ -77,7 +76,7 @@ function select(item: CommandPaletteItem) {
</ListboxFilter>
<slot name="search-trailing" />
</div>
- <ListboxContent :class="ui?.content">
+ <ListboxContent :class="ui?.content" :aria-label="labels.paletteLabel">
<template v-if="palette.filteredGroups.value.length">
<ListboxGroup
v-for="group in palette.filteredGroups.value"
diff --git a/src/AGENTS.md b/src/AGENTS.md
index 3c74c2c56..7e4f72ead 100644
--- a/src/AGENTS.md
+++ b/src/AGENTS.md
@@ -83,5 +83,6 @@ The supported browser baseline lives in `src/app/shell/support/baseline.ts` and
### Storybook
- Colocate `ComponentName.stories.ts` with `ComponentName.vue`; multipart compositions may use a descriptive family name. Preserve explicit titles and exported story names during moves. Default playgrounds stay static; interaction flows get named stories. Prefer inline story fixtures for small app-local states; use colocated `examples/<Variant>.vue` SFCs for substantial templates or fixtures that need SFC template/slot typing, including app-only fixtures (shared SDK examples follow `packages/vue/AGENTS.md`, Documentation). Story templates compile at runtime, so they must be plain JavaScript with no TypeScript syntax, and `icon-lucide-*` tags do not resolve there; import icons from `~icons/...` and register them.
-- Every story must render and pass its play function: `tests/e2e/storybook/stories.spec.ts` runs them all in `bun run test:storybook`, so a play function asserts behavior that stays true, not copy or obsolete markup.
+- Titles mirror ownership in Title Case: `Design System/<Family>/<Component>` for `src/components/ui/<family>`, `App/<Area>/…` for app components, `Vue SDK/…` for SDK primitives. Two files share a title only to keep a heavy example out of the docs page (`packages/vue/src/primitives/BindableValue/BindableValueModeEdit.stories.ts`); the sidebar order lives in `.storybook/preview.ts`.
+- Every story must render, pass its play function, and pass axe in the dark and light themes: `tests/e2e/storybook/stories.spec.ts` runs them all in `bun run test:storybook`, so a play function asserts behavior that stays true, not copy or obsolete markup. Exempt an axe rule only for third-party markup or a deliberate demo state, scoped as narrowly as axe allows and explained where it is set (`.storybook/preview.ts`, `src/components/chat/ChatMarkdown.stories.ts`).
- Isolated visual states of feedback components belong in stories, not Playwright application screenshots. Do not add automated tests or snapshot baselines for CSS-only changes (spacing, sizing, colors, breakpoints); verify those visually. Settings E2E covers integration behavior: feedback appearance, validation and focus, retained drafts, successful retries.
diff --git a/src/app.css b/src/app.css
index 41ee58822..07ad7bc98 100644
--- a/src/app.css
+++ b/src/app.css
@@ -54,16 +54,16 @@
--color-panel-field-hover: #404040;
--color-panel-focus: #3b82f6;
--color-panel-selected: #2f6fdd;
- --color-panel-selected-muted: #3d4450;
+ --color-panel-selected-muted: #353b46;
--color-canvas: #1e1e1e;
--color-border: #3a3a3a;
--color-hover: #353535;
- --color-accent: #3b82f6;
+ --color-accent: #2563eb;
--color-surface: #f0f0f0;
--color-muted: #a6a6a6;
--color-input: #1e1e1e;
- --color-component: #9747ff;
- --color-slot: #f24bbc;
+ --color-component: #bb8cff;
+ --color-slot: #f45cc4;
--color-warning-bg: rgb(245 158 11 / 0.1);
--color-warning-border: rgb(245 158 11 / 0.3);
--color-warning-text: #fde68a;
@@ -71,12 +71,12 @@
--color-success: #4ade80;
--color-primary: #60a5fa;
--color-inverted: #1f2328;
- --color-error: #f87171;
+ --color-error: #fa8585;
--color-issue-error: #f24822;
--color-issue-warning: #ffb314;
--color-issue-info: #a6a6a6;
- --color-error-bg: rgb(248 113 113 / 0.1);
- --color-error-border: rgb(248 113 113 / 0.4);
+ --color-error-bg: rgb(250 133 133 / 0.1);
+ --color-error-border: rgb(250 133 133 / 0.4);
--color-success-bg: #16a34a;
--color-success-bg-hover: #15803d;
--color-code-tag: #7dd3fc;
@@ -104,10 +104,10 @@ html[data-theme='light'] {
--color-border: #d8dce3;
--color-hover: #eef1f5;
--color-accent: #2563eb;
- --color-primary: #2563eb;
+ --color-primary: #1d4ed8;
--color-inverted: #ffffff;
--color-surface: #1f2328;
- --color-muted: #6b7280;
+ --color-muted: #5f6673;
--color-input: #ffffff;
--color-component: #7c3aed;
--color-slot: #db2777;
@@ -118,8 +118,8 @@ html[data-theme='light'] {
--color-success: #15803d;
--color-error: #b91c1c;
--color-issue-error: #dc3412;
- --color-issue-warning: #b86e00;
- --color-issue-info: #6b7280;
+ --color-issue-warning: #8f5500;
+ --color-issue-info: #5f6673;
--color-error-bg: rgb(185 28 28 / 0.08);
--color-error-border: rgb(185 28 28 / 0.28);
--color-success-bg: #16a34a;
diff --git a/src/components/LayerTree/LayerTree.stories.ts b/src/components/LayerTree/LayerTree.stories.ts
index 7d05a8ae7..3352ba08f 100644
--- a/src/components/LayerTree/LayerTree.stories.ts
+++ b/src/components/LayerTree/LayerTree.stories.ts
@@ -5,7 +5,7 @@ import LayerTreeStateMatrix from './examples/States.vue'
import LayerTreeVirtualized from './examples/Virtualized.vue'
const meta = {
- title: 'Editor/Layer Tree',
+ title: 'App/Editor/Layer Tree',
component: LayerTreeStateMatrix,
tags: ['autodocs'],
parameters: {
diff --git a/src/components/LayerTree/LayerTreeRenameRow.vue b/src/components/LayerTree/LayerTreeRenameRow.vue
index 35f97720c..f88bed5bb 100644
--- a/src/components/LayerTree/LayerTreeRenameRow.vue
+++ b/src/components/LayerTree/LayerTreeRenameRow.vue
@@ -2,7 +2,7 @@
import { tv } from 'tailwind-variants'
import { computed, useTemplateRef, watch } from 'vue'
-import type { LayerNode } from '@open-pencil/vue'
+import { useI18n, type LayerNode } from '@open-pencil/vue'
import { nodeIcon } from '@/app/editor/icons'
import layerTreeTheme from '@/theme/layer-tree'
@@ -22,6 +22,7 @@ const { renameControls, expanded } = defineProps<{
}>()
const renameInput = useTemplateRef<HTMLInputElement>('renameInput')
+const { rename } = useI18n()
const ui = useLayerTreeUI()
const layerTree = tv(layerTreeTheme)
const styles = computed(() => layerTree({ expanded }))
@@ -57,6 +58,7 @@ watch(renameInput, (input) => {
data-layer-edit
data-test-id="layers-item-input"
data-slot="rename-input"
+ :aria-label="rename.layerName"
:class="styles.renameInput({ class: ui?.renameInput })"
:value="node.name"
@blur="renameControls.commit(node.id, $event)"
diff --git a/src/components/LayerTree/examples/States.vue b/src/components/LayerTree/examples/States.vue
index e5b28e317..331a31c75 100644
--- a/src/components/LayerTree/examples/States.vue
+++ b/src/components/LayerTree/examples/States.vue
@@ -100,6 +100,12 @@ const states: Array<{
chrome: chrome()
},
{ label: 'Hidden', node: node('Hidden', { visible: false }), selected: false, chrome: chrome() },
+ {
+ label: 'Selected hidden',
+ node: node('Selected hidden', { visible: false }),
+ selected: true,
+ chrome: chrome({ focused: true })
+ },
{ label: 'Locked', node: node('Locked', { locked: true }), selected: false, chrome: chrome() },
{
label: 'Slot',
diff --git a/src/components/MobileDrawer.vue b/src/components/MobileDrawer.vue
index 698f2d472..680994e67 100644
--- a/src/components/MobileDrawer.vue
+++ b/src/components/MobileDrawer.vue
@@ -136,7 +136,7 @@ const drawerTransition = useMotionTransition({
<TabsTrigger
data-test-id="mobile-ribbon-layers"
value="layers"
- class="flex h-full cursor-pointer items-center justify-center gap-1.5 px-4 text-xs transition-colors outline-none select-none data-[state=active]:text-accent"
+ class="flex h-full cursor-pointer items-center justify-center gap-1.5 px-4 text-xs transition-colors outline-none select-none data-[state=active]:text-primary"
@click="toggleTab('layers')"
>
<icon-lucide-layers class="size-4" />
@@ -145,7 +145,7 @@ const drawerTransition = useMotionTransition({
<TabsTrigger
data-test-id="mobile-ribbon-design"
value="design"
- class="flex h-full cursor-pointer items-center justify-center gap-1.5 px-4 text-xs transition-colors outline-none select-none data-[state=active]:text-accent"
+ class="flex h-full cursor-pointer items-center justify-center gap-1.5 px-4 text-xs transition-colors outline-none select-none data-[state=active]:text-primary"
@click="toggleTab('design')"
>
<icon-lucide-sliders-horizontal class="size-4" />
@@ -156,7 +156,7 @@ const drawerTransition = useMotionTransition({
<TabsTrigger
data-test-id="mobile-ribbon-code"
value="code"
- class="flex h-full cursor-pointer items-center justify-center px-3 transition-colors outline-none select-none data-[state=active]:text-accent"
+ class="flex h-full cursor-pointer items-center justify-center px-3 transition-colors outline-none select-none data-[state=active]:text-primary"
@click="toggleTab('code')"
>
<icon-lucide-code class="size-4" />
@@ -165,7 +165,7 @@ const drawerTransition = useMotionTransition({
<TabsTrigger
data-test-id="mobile-ribbon-ai"
value="ai"
- class="flex h-full cursor-pointer items-center justify-center px-3 transition-colors outline-none select-none data-[state=active]:text-accent"
+ class="flex h-full cursor-pointer items-center justify-center px-3 transition-colors outline-none select-none data-[state=active]:text-primary"
@click="toggleTab('ai')"
>
<icon-lucide-sparkles class="size-4" />
diff --git a/src/components/MobileHud/MobileActionToast.vue b/src/components/MobileHud/MobileActionToast.vue
index e6d154154..257b6680f 100644
--- a/src/components/MobileHud/MobileActionToast.vue
+++ b/src/components/MobileHud/MobileActionToast.vue
@@ -12,7 +12,7 @@ const hud = useMobileHudContext()
:key="hud.actionToast"
class="flex h-8 items-center rounded-full border border-accent/20 bg-panel/70 px-3 shadow-md backdrop-blur-xl"
>
- <span class="text-xs whitespace-nowrap text-accent">{{ hud.actionToast }}</span>
+ <span class="text-xs whitespace-nowrap text-primary">{{ hud.actionToast }}</span>
</div>
</Transition>
</template>
diff --git a/src/components/MobileHud/MobileActiveToolBadge.vue b/src/components/MobileHud/MobileActiveToolBadge.vue
index c79f4455f..c9dc20305 100644
--- a/src/components/MobileHud/MobileActiveToolBadge.vue
+++ b/src/components/MobileHud/MobileActiveToolBadge.vue
@@ -13,7 +13,7 @@ const hud = useMobileHudContext()
<component
:is="hud.activeToolIcon"
:key="hud.store.state.activeTool"
- class="size-3.5 text-accent"
+ class="size-3.5 text-primary"
/>
</Transition>
</div>
diff --git a/src/components/PagesPanel.vue b/src/components/PagesPanel.vue
index 409d3005a..d8e24f034 100644
--- a/src/components/PagesPanel.vue
+++ b/src/components/PagesPanel.vue
@@ -136,6 +136,7 @@ function setupPageRowRef(
<input
ref="pageInput"
data-test-id="pages-item-input"
+ :aria-label="pageMessages.pageNameLabel"
:class="pageStyles(pg, currentPageId).renameInput()"
:value="pg.name"
@blur="rename.commit(pg.id, $event)"
diff --git a/src/components/Toolbar/Toolbar.stories.ts b/src/components/Toolbar/Toolbar.stories.ts
index c57dcbfca..86d0f388b 100644
--- a/src/components/Toolbar/Toolbar.stories.ts
+++ b/src/components/Toolbar/Toolbar.stories.ts
@@ -8,7 +8,7 @@ import IconType from '~icons/lucide/type'
import ToolButton from './ToolButton.vue'
const meta = {
- title: 'Editor/Toolbar',
+ title: 'App/Editor/Toolbar',
render: () => ({
components: { ToolbarRoot, ToolButton },
setup: () => ({
diff --git a/src/components/assets-panel/AssetsPanel.vue b/src/components/assets-panel/AssetsPanel.vue
index dd433072d..9a5645b64 100644
--- a/src/components/assets-panel/AssetsPanel.vue
+++ b/src/components/assets-panel/AssetsPanel.vue
@@ -376,7 +376,7 @@ async function insertSelectedAsset() {
:draggable="!!asset.componentId"
:aria-busy="insertingAssetId === asset.id"
:class="[
- 'group/asset rounded text-left text-xs text-surface outline-none hover:bg-hover focus-visible:ring-1 focus-visible:ring-accent',
+ 'group/asset rounded text-left text-xs text-surface outline-none hover:bg-hover focus-visible:ring-1 focus-visible:ring-panel-focus',
assetView === 'grid'
? 'flex min-w-0 flex-col items-center gap-1 p-1.5'
: 'flex w-full items-center gap-2 px-1.5 py-1'
diff --git a/src/components/brand/BrandMark.stories.ts b/src/components/brand/BrandMark.stories.ts
index 48c42ba47..b246993cd 100644
--- a/src/components/brand/BrandMark.stories.ts
+++ b/src/components/brand/BrandMark.stories.ts
@@ -4,7 +4,7 @@ import BrandMark from './BrandMark.vue'
import type { BrandMarkProps } from './types'
const meta = {
- title: 'Brand/Mark',
+ title: 'App/Brand/Mark',
component: BrandMark,
args: { variant: 'mark', appearance: 'light', class: 'size-32' }
} satisfies Meta<BrandMarkProps>
diff --git a/src/components/chat/ChatMarkdown.stories.ts b/src/components/chat/ChatMarkdown.stories.ts
index 3416b9fd4..bf87ddb04 100644
--- a/src/components/chat/ChatMarkdown.stories.ts
+++ b/src/components/chat/ChatMarkdown.stories.ts
@@ -7,10 +7,28 @@ type ChatMarkdownStoryArgs = {
mode?: 'static' | 'streaming'
}
+/**
+ * vue-stream-markdown wraps each code block in its own <header> and <main>, which its component
+ * overrides cannot replace; until upstream drops them they read as page landmarks.
+ */
+const codeBlockLandmarks = {
+ a11y: {
+ config: {
+ rules: [
+ 'landmark-banner-is-top-level',
+ 'landmark-main-is-top-level',
+ 'landmark-no-duplicate-banner',
+ 'landmark-no-duplicate-main',
+ 'landmark-unique'
+ ].map((id) => ({ id, enabled: false }))
+ }
+ }
+}
+
type Story = StoryObj<ChatMarkdownStoryArgs>
const meta = {
- title: 'Chat/Markdown',
+ title: 'App/Chat/Markdown',
component: ChatMarkdown,
parameters: { layout: 'centered' },
render: (args) => ({
@@ -48,6 +66,7 @@ export const InlineCode: Story = {
}
export const CodeBlock: Story = {
+ parameters: codeBlockLandmarks,
args: {
content: `\`\`\`typescript
const button = {
@@ -59,6 +78,7 @@ const button = {
}
export const MixedContent: Story = {
+ parameters: codeBlockLandmarks,
args: {
content: `## Updated layout
diff --git a/src/components/chat/ChatMessage.stories.ts b/src/components/chat/ChatMessage.stories.ts
index 2b5a4f6e9..33dffc8f6 100644
--- a/src/components/chat/ChatMessage.stories.ts
+++ b/src/components/chat/ChatMessage.stories.ts
@@ -35,7 +35,7 @@ type ChatMessageStoryArgs = {
}
const meta = {
- title: 'Chat/Message',
+ title: 'App/Chat/Message',
component: ChatMessage,
parameters: { layout: 'centered' },
render: (args) => ({
diff --git a/src/components/chat/ChatMessage.vue b/src/components/chat/ChatMessage.vue
index 7acf4ff96..6799f3fc2 100644
--- a/src/components/chat/ChatMessage.vue
+++ b/src/components/chat/ChatMessage.vue
@@ -96,9 +96,10 @@ function groupKey(group: MessagePartGroup): string {
:class="message.role === 'user' ? 'max-w-[85%]' : ''"
>
<template v-if="message.role === 'assistant'">
- <!-- A reverted reply's edits are gone; its content stays, dimmed, under its actions. -->
+ <!-- A reverted reply's edits are gone; its content stays, dimmed, under its actions. Text
+ dims to the muted color rather than through opacity, so it still reads at 4.5:1. -->
<div
- class="space-y-2 transition-opacity motion-reduce:transition-none data-[reverted=true]:opacity-50"
+ class="space-y-2 data-[reverted=true]:**:text-muted data-[reverted=true]:[&_img]:opacity-50"
data-slot="chat-reply-content"
:data-reverted="reverted"
>
diff --git a/src/components/chat/ChatPlayground.stories.ts b/src/components/chat/ChatPlayground.stories.ts
index 7fb37a7a6..4489d5311 100644
--- a/src/components/chat/ChatPlayground.stories.ts
+++ b/src/components/chat/ChatPlayground.stories.ts
@@ -16,7 +16,7 @@ interface Args {
narrow: boolean
}
const meta = {
- title: 'Chat/Playground',
+ title: 'App/Chat/Playground',
args: { initialChat: 'dashboard', narrow: false },
parameters: {
docs: {
diff --git a/src/components/chat/ChatRunLocation.stories.ts b/src/components/chat/ChatRunLocation.stories.ts
index 168944a3e..38876adcd 100644
--- a/src/components/chat/ChatRunLocation.stories.ts
+++ b/src/components/chat/ChatRunLocation.stories.ts
@@ -6,7 +6,7 @@ import ChatRunLocation from './ChatRunLocation.vue'
type Args = { agent: string; page: string; onOpen: () => void }
const meta = {
- title: 'Chat/Run Location',
+ title: 'App/Chat/Run Location',
component: ChatRunLocation,
tags: ['autodocs'],
args: { agent: 'Fern', page: 'Checkout', onOpen: fn() },
diff --git a/src/components/chat/ReasoningBlock.stories.ts b/src/components/chat/ReasoningBlock.stories.ts
index c2de46d19..4df8a9699 100644
--- a/src/components/chat/ReasoningBlock.stories.ts
+++ b/src/components/chat/ReasoningBlock.stories.ts
@@ -13,7 +13,7 @@ interface Args {
}
const meta = {
- title: 'Chat/Reasoning',
+ title: 'App/Chat/Reasoning',
component: ReasoningBlock,
args: {
text: 'I’ll inspect the selected frame, compare its spacing, and arrange the summary cards.\n\nThe layout should keep a consistent **24 px gap**.',
diff --git a/src/components/chat/ReasoningBlock.vue b/src/components/chat/ReasoningBlock.vue
index 73abb34ab..da90c92ca 100644
--- a/src/components/chat/ReasoningBlock.vue
+++ b/src/components/chat/ReasoningBlock.vue
@@ -85,7 +85,7 @@ function updateOpen(value: boolean): void {
data-slot="chat-reasoning-trigger"
class="flex w-full cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-left text-[11px] text-muted hover:bg-hover hover:text-surface"
>
- <icon-lucide-brain class="size-3.5 shrink-0 text-accent" aria-hidden="true" />
+ <icon-lucide-brain class="size-3.5 shrink-0 text-primary" aria-hidden="true" />
<span class="flex-1">{{ streaming ? thinkingLabel : finishedLabel }}</span>
<icon-lucide-loader-circle
v-if="streaming"
diff --git a/src/components/chat/attachment/AttachmentCard.vue b/src/components/chat/attachment/AttachmentCard.vue
index fb96a19a3..1f7c2da90 100644
--- a/src/components/chat/attachment/AttachmentCard.vue
+++ b/src/components/chat/attachment/AttachmentCard.vue
@@ -28,18 +28,17 @@ const dimensions = computed(
<button
type="button"
:aria-label="ai.viewAttachment({ name: attachment.name })"
- class="group block overflow-hidden rounded-lg border border-white/25 bg-black/15 text-left shadow-xs transition-colors hover:border-white/50 focus-visible:border-white/60 focus-visible:outline-2 focus-visible:outline-white"
+ class="block overflow-hidden rounded-lg border border-border bg-panel-field text-left shadow-xs transition-colors hover:border-muted focus-visible:outline-2 focus-visible:outline-panel-focus"
@click="viewerOpen = true"
>
+ <!-- The button names the attachment; its thumbnail and caption need no second name. -->
<img
v-if="previewURL"
:src="previewURL"
- :alt="attachment.name"
- class="h-20 w-28 border-b border-white/15 bg-black/10 object-contain"
+ alt=""
+ class="h-20 w-28 border-b border-border bg-canvas object-contain"
/>
- <span
- class="block max-w-28 truncate px-1.5 py-1 text-[9px] leading-tight text-white/85 group-hover:text-white"
- >
+ <span class="block max-w-28 truncate px-1.5 py-1 text-[9px] leading-tight text-surface">
{{ attachment.name }}
</span>
</button>
diff --git a/src/components/chat/attachment/AttachmentList.stories.ts b/src/components/chat/attachment/AttachmentList.stories.ts
index 3aef356ce..a90a4891a 100644
--- a/src/components/chat/attachment/AttachmentList.stories.ts
+++ b/src/components/chat/attachment/AttachmentList.stories.ts
@@ -42,13 +42,13 @@ type AttachmentListStoryArgs = {
}
const meta = {
- title: 'Chat/Attachments',
+ title: 'App/Chat/Attachments',
component: AttachmentList,
parameters: { layout: 'centered' },
render: (args) => ({
components: { AttachmentList },
setup: () => ({ args }),
- template: '<div class="w-96 rounded-xl bg-accent p-3"><AttachmentList v-bind="args" /></div>'
+ template: '<div class="w-96 rounded-xl bg-panel p-3"><AttachmentList v-bind="args" /></div>'
})
} satisfies Meta<AttachmentListStoryArgs>
diff --git a/src/components/chat/tool/ToolCallGroup.stories.ts b/src/components/chat/tool/ToolCallGroup.stories.ts
index 0ff36e29d..4afa18da4 100644
--- a/src/components/chat/tool/ToolCallGroup.stories.ts
+++ b/src/components/chat/tool/ToolCallGroup.stories.ts
@@ -62,7 +62,7 @@ interface Args {
}
const meta = {
- title: 'Chat/Tool calls',
+ title: 'App/Chat/Tool Calls',
component: ToolCallGroup,
args: { parts: [rendered] },
render: (args) => ({
diff --git a/src/components/chat/tool/ToolChangeView.stories.ts b/src/components/chat/tool/ToolChangeView.stories.ts
index 713630fd9..c9e316871 100644
--- a/src/components/chat/tool/ToolChangeView.stories.ts
+++ b/src/components/chat/tool/ToolChangeView.stories.ts
@@ -40,7 +40,7 @@ interface Args {
}
const meta = {
- title: 'Chat/Tool change',
+ title: 'App/Chat/Tool Change',
component: ToolChangeView,
args: { change },
render: (args) => ({
diff --git a/src/components/code-editor/CodeViewer.vue b/src/components/code-editor/CodeViewer.vue
index 1f1a80c42..d01a66866 100644
--- a/src/components/code-editor/CodeViewer.vue
+++ b/src/components/code-editor/CodeViewer.vue
@@ -43,6 +43,8 @@ const view = useCodeMirror(useTemplateRef('host'), {
theme: (dark) => [fill ? codeViewerFillTheme : [], codeEditorTheme(dark), codeViewerTheme],
extensions: [
EditorState.readOnly.of(true),
+ // The content is already a tab stop; saying so lets checkers see the scroller is reachable.
+ EditorView.contentAttributes.of({ tabindex: '0' }),
highlightSpecialChars(),
foldGutter(),
search({ top: true }),
diff --git a/src/components/collab-panel/ConnectedRoom.vue b/src/components/collab-panel/ConnectedRoom.vue
index f8a22d087..1c69602d3 100644
--- a/src/components/collab-panel/ConnectedRoom.vue
+++ b/src/components/collab-panel/ConnectedRoom.vue
@@ -68,7 +68,7 @@ const statusText = computed(() =>
>
<a
:href="room.desktopLink.value"
- class="text-accent underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-none"
+ class="text-primary underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-none"
data-test-id="collab-open-desktop"
>
{{ collab.messages.openInDesktopApp }}
@@ -79,7 +79,7 @@ const statusText = computed(() =>
:href="room.downloadURL.value"
target="_blank"
rel="noopener noreferrer"
- class="text-accent underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-none"
+ class="text-primary underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-none"
data-test-id="collab-download-desktop"
>
{{ collab.messages.downloadDesktopApp }}
diff --git a/src/components/collab-panel/PresenceAvatars.stories.ts b/src/components/collab-panel/PresenceAvatars.stories.ts
index 58a1eb2a7..cb8f4eaeb 100644
--- a/src/components/collab-panel/PresenceAvatars.stories.ts
+++ b/src/components/collab-panel/PresenceAvatars.stories.ts
@@ -22,7 +22,7 @@ type Args = {
}
const meta = {
- title: 'Collaboration/Presence Avatars',
+ title: 'App/Collaboration/Presence Avatars',
component: PresenceAvatars,
tags: ['autodocs'],
args: {
diff --git a/src/components/collab-room/LeftRoomNotice.stories.ts b/src/components/collab-room/LeftRoomNotice.stories.ts
index eab94e94d..6c54dba10 100644
--- a/src/components/collab-room/LeftRoomNotice.stories.ts
+++ b/src/components/collab-room/LeftRoomNotice.stories.ts
@@ -6,7 +6,7 @@ import LeftRoomNotice from './LeftRoomNotice.vue'
type Args = { onDismiss: () => void }
const meta = {
- title: 'Collaboration/Left Room Notice',
+ title: 'App/Collaboration/Left Room Notice',
component: LeftRoomNotice,
tags: ['autodocs'],
args: { onDismiss: fn() },
diff --git a/src/components/collab-room/RoomScreen.stories.ts b/src/components/collab-room/RoomScreen.stories.ts
index 038068c9b..b665ef82a 100644
--- a/src/components/collab-room/RoomScreen.stories.ts
+++ b/src/components/collab-room/RoomScreen.stories.ts
@@ -19,7 +19,7 @@ type Args = {
}
const meta = {
- title: 'Collaboration/Room Screen',
+ title: 'App/Collaboration/Room Screen',
component: RoomScreen,
tags: ['autodocs'],
args: {
diff --git a/src/components/design-check/IssueGroup.stories.ts b/src/components/design-check/IssueGroup.stories.ts
index a862aa6c7..207d27d94 100644
--- a/src/components/design-check/IssueGroup.stories.ts
+++ b/src/components/design-check/IssueGroup.stories.ts
@@ -132,7 +132,7 @@ interface IssueGroupStoryArgs {
}
const meta = {
- title: 'Editor/Design Check/Issue Group',
+ title: 'App/Editor/Design Check/Issue Group',
component: IssueGroup,
args: { group: contrast },
render: (args) => ({
diff --git a/src/components/design-check/IssueRow.vue b/src/components/design-check/IssueRow.vue
index d4aaa20ce..b9e35b1d4 100644
--- a/src/components/design-check/IssueRow.vue
+++ b/src/components/design-check/IssueRow.vue
@@ -55,6 +55,7 @@ const styles = designCheck()
v-else-if="row.swatch?.kind === 'contrast'"
:class="styles.contrastSwatch()"
:style="{ backgroundColor: row.swatch.background, color: row.swatch.foreground }"
+ data-contrast-sample
aria-hidden="true"
>
Aa
diff --git a/src/components/editor/WorkspacePill.stories.ts b/src/components/editor/WorkspacePill.stories.ts
index c50295902..9e38b1995 100644
--- a/src/components/editor/WorkspacePill.stories.ts
+++ b/src/components/editor/WorkspacePill.stories.ts
@@ -4,7 +4,7 @@ import { expect, userEvent, waitFor, within } from 'storybook/test'
import Pill from './examples/Pill.vue'
const meta = {
- title: 'Editor/Workspace Pill',
+ title: 'App/Editor/Workspace Pill',
component: Pill,
parameters: {
docs: {
diff --git a/src/components/editor/WorkspacePill.vue b/src/components/editor/WorkspacePill.vue
index 75b207fb7..cb3e49292 100644
--- a/src/components/editor/WorkspacePill.vue
+++ b/src/components/editor/WorkspacePill.vue
@@ -38,7 +38,7 @@ const { editor } = useI18n()
</IconButton>
<template v-else>
<span
- class="ml-1 flex h-5 items-center gap-1 rounded bg-accent/15 px-1.5 text-[10px] font-medium text-accent"
+ class="ml-1 flex h-5 items-center gap-1 rounded bg-accent/15 px-1.5 text-[10px] font-medium text-primary"
>
<icon-lucide-play class="size-3" />
{{ editor.previewing }}
diff --git a/src/components/font-picker/FontPicker.vue b/src/components/font-picker/FontPicker.vue
index 4bfe93d72..29784addf 100644
--- a/src/components/font-picker/FontPicker.vue
+++ b/src/components/font-picker/FontPicker.vue
@@ -84,7 +84,7 @@ function loadPreviewFont(family: string, source: string) {
class="flex min-w-0 flex-1 items-center gap-2"
@vue:mounted="loadPreviewFont(family, source)"
>
- <icon-lucide-check v-if="selected" class="size-3 shrink-0 text-accent" />
+ <icon-lucide-check v-if="selected" class="size-3 shrink-0 text-primary" />
<span v-else class="size-3 shrink-0" />
<span class="truncate" :style="{ fontFamily: `'${family}', sans-serif` }">{{
family
diff --git a/src/components/home/document/DocumentEntry.stories.ts b/src/components/home/document/DocumentEntry.stories.ts
index da7710a80..501826759 100644
--- a/src/components/home/document/DocumentEntry.stories.ts
+++ b/src/components/home/document/DocumentEntry.stories.ts
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/vue3-vite'
import DocumentEntry from './DocumentEntry.vue'
const meta = {
- title: 'Home/Document Entry',
+ title: 'App/Home/Document Entry',
component: DocumentEntry,
args: { name: 'Design system', metadata: 'Sep 7, 2026', view: 'grid' },
render: (args) => ({
diff --git a/src/components/libraries/review/LibraryUpdateReviewDialog.vue b/src/components/libraries/review/LibraryUpdateReviewDialog.vue
index 426cb69c7..2e6b4e97f 100644
--- a/src/components/libraries/review/LibraryUpdateReviewDialog.vue
+++ b/src/components/libraries/review/LibraryUpdateReviewDialog.vue
@@ -228,7 +228,7 @@ watch([request, currentInstanceId], () => void loadPreview(), { immediate: true
<SliderRange class="absolute h-full bg-accent" />
</SliderTrack>
<SliderThumb
- class="block size-3.5 rounded-full border border-accent bg-panel shadow outline-none focus-visible:ring-2 focus-visible:ring-accent"
+ class="block size-3.5 rounded-full border border-accent bg-panel shadow outline-none focus-visible:ring-2 focus-visible:ring-panel-focus"
/>
</SliderRoot>
<span v-if="mode === 'overlay'" class="w-8 text-right text-[10px] text-muted">
diff --git a/src/components/mobile-hud/HudButton.stories.ts b/src/components/mobile-hud/HudButton.stories.ts
index f21582c9d..44267fa94 100644
--- a/src/components/mobile-hud/HudButton.stories.ts
+++ b/src/components/mobile-hud/HudButton.stories.ts
@@ -5,7 +5,7 @@ import IconUndo from '~icons/lucide/undo-2'
import HudButton from './HudButton.vue'
const meta = {
- title: 'Editor/Mobile HUD/Actions',
+ title: 'App/Editor/Mobile HUD/Actions',
render: () => ({
components: { HudButton, IconUndo, IconShare },
template: `<div class="flex items-center gap-2 bg-canvas p-6">
diff --git a/src/components/navigation/NavigationTheme.stories.ts b/src/components/navigation/NavigationTheme.stories.ts
index 32d6f7f44..2f8048641 100644
--- a/src/components/navigation/NavigationTheme.stories.ts
+++ b/src/components/navigation/NavigationTheme.stories.ts
@@ -4,7 +4,7 @@ import { expect, within } from 'storybook/test'
import NavigationStates from './examples/States.vue'
const meta = {
- title: 'Design System/Editor/Navigation',
+ title: 'App/Editor/Navigation',
tags: ['autodocs'],
parameters: {
docs: {
diff --git a/src/components/navigation/examples/States.vue b/src/components/navigation/examples/States.vue
index b59c5adf6..157e8b4ed 100644
--- a/src/components/navigation/examples/States.vue
+++ b/src/components/navigation/examples/States.vue
@@ -60,7 +60,7 @@ const pageStates = [
</div>
<div aria-label="Rename" :class="pageStyles().renameRow()">
<icon-lucide-file :class="pageStyles().icon()" />
- <input :class="pageStyles().renameInput()" value="Rename page" />
+ <input :class="pageStyles().renameInput()" value="Rename page" aria-label="Page name" />
</div>
</div>
</section>
diff --git a/src/components/preparation/tab/Indicator.vue b/src/components/preparation/tab/Indicator.vue
index a68d23121..d17029a12 100644
--- a/src/components/preparation/tab/Indicator.vue
+++ b/src/components/preparation/tab/Indicator.vue
@@ -19,7 +19,7 @@ const percent = computed(() => preparationPercent(progress))
:aria-valuemin="percent === null ? undefined : 0"
:aria-valuemax="percent === null ? undefined : 100"
aria-label="Preparing document"
- class="relative flex size-3 shrink-0 items-center justify-center text-accent"
+ class="relative flex size-3 shrink-0 items-center justify-center text-primary"
>
<icon-lucide-loader-circle class="size-3" :class="motionStyles.spinner" />
</span>
diff --git a/src/components/presence/AvatarStack.stories.ts b/src/components/presence/AvatarStack.stories.ts
index eec6ad093..7a8d6f460 100644
--- a/src/components/presence/AvatarStack.stories.ts
+++ b/src/components/presence/AvatarStack.stories.ts
@@ -12,7 +12,7 @@ type Args = {
}
const meta = {
- title: 'Collaboration/Avatar Stack',
+ title: 'App/Collaboration/Avatar Stack',
component: AvatarStack,
tags: ['autodocs'],
args: { people: room, max: 3, size: 'sm', label: 'In this room: Dana, Ana, Ben' },
diff --git a/src/components/presence/FollowFrame.stories.ts b/src/components/presence/FollowFrame.stories.ts
index ac0da8f7a..7fc831c0b 100644
--- a/src/components/presence/FollowFrame.stories.ts
+++ b/src/components/presence/FollowFrame.stories.ts
@@ -10,7 +10,7 @@ const ana = { r: 0.92, g: 0.34, b: 0.29, a: 1 }
type Args = { followed: FollowedLabel; onStop: () => void }
const meta = {
- title: 'Collaboration/Follow Frame',
+ title: 'App/Collaboration/Follow Frame',
component: FollowFrame,
args: { followed: { kind: 'person', name: 'Ana', color: ana }, onStop: fn() },
render: (args) => ({
diff --git a/src/components/presence/FollowFrame.vue b/src/components/presence/FollowFrame.vue
index fc6e69090..dc7bc743e 100644
--- a/src/components/presence/FollowFrame.vue
+++ b/src/components/presence/FollowFrame.vue
@@ -2,7 +2,7 @@
import { useEventListener } from '@vueuse/core'
import { computed } from 'vue'
-import { colorToCSS } from '@open-pencil/scene-graph/color'
+import { colorToCSS, readableForeground } from '@open-pencil/scene-graph/color'
import { useI18n } from '@open-pencil/vue'
import type { FollowedLabel } from '@/app/presence/registry'
@@ -16,6 +16,8 @@ const { collaboration: messages } = useI18n()
const ui = followFrame()
const color = computed(() => colorToCSS(followed.color))
+// People's colors range from pale to deep, so the bar's text takes whichever reads on it.
+const foreground = computed(() => colorToCSS(readableForeground(followed.color)))
const text = computed(() =>
followed.owner
? messages.value.followingAgent({ agent: followed.name, owner: followed.owner })
@@ -30,7 +32,7 @@ useEventListener(window, 'keydown', (event: KeyboardEvent) => {
<template>
<div data-test-id="follow-frame" :class="ui.root()" :style="{ borderColor: color }">
- <div role="status" :class="ui.bar()" :style="{ background: color }">
+ <div role="status" :class="ui.bar()" :style="{ background: color, color: foreground }">
<icon-lucide-sparkle v-if="followed.kind === 'agent'" :class="ui.icon()" />
<span :class="ui.label()">{{ text }}</span>
<button type="button" data-test-id="follow-stop" :class="ui.stop()" @click="emit('stop')">
diff --git a/src/components/presence/PresenceList.stories.ts b/src/components/presence/PresenceList.stories.ts
index 2ad9f1db5..bdc5bbba1 100644
--- a/src/components/presence/PresenceList.stories.ts
+++ b/src/components/presence/PresenceList.stories.ts
@@ -10,7 +10,7 @@ import type { PresencePersonRow } from './rows'
type Args = { rows: PresencePersonRow[]; following: FollowTarget | null }
const meta = {
- title: 'Collaboration/Presence List',
+ title: 'App/Collaboration/Presence List',
component: PresenceList,
tags: ['autodocs'],
args: { rows: room, following: null, onFollow: fn(), onRename: fn() },
diff --git a/src/components/presence/PresenceMarkers.stories.ts b/src/components/presence/PresenceMarkers.stories.ts
index bf850110b..cc5b138b0 100644
--- a/src/components/presence/PresenceMarkers.stories.ts
+++ b/src/components/presence/PresenceMarkers.stories.ts
@@ -17,7 +17,7 @@ const anaWithAgent: PagePresenceEntry[] = [
type Args = { entries: PagePresenceEntry[] }
const meta = {
- title: 'Collaboration/Page Presence Markers',
+ title: 'App/Collaboration/Page Presence Markers',
component: PresenceMarkers,
tags: ['autodocs'],
args: { entries: anaWithAgent },
diff --git a/src/components/properties/ExportScaleInput.vue b/src/components/properties/ExportScaleInput.vue
index ccbd90d3e..258228dc1 100644
--- a/src/components/properties/ExportScaleInput.vue
+++ b/src/components/properties/ExportScaleInput.vue
@@ -64,7 +64,7 @@ function isActive(scale: number) {
<template>
<Tip :label="label" :disabled="!label">
<div
- class="flex min-w-0 flex-1 overflow-hidden rounded border border-border bg-input focus-within:border-accent"
+ class="flex min-w-0 flex-1 overflow-hidden rounded border border-border bg-input focus-within:border-panel-focus"
>
<input
ref="inputRef"
@@ -101,7 +101,7 @@ function isActive(scale: number) {
@select="pick(scale)"
>
<span>{{ scale }}x</span>
- <icon-lucide-check v-if="isActive(scale)" class="size-3 text-accent" />
+ <icon-lucide-check v-if="isActive(scale)" class="size-3 text-primary" />
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenuPortal>
diff --git a/src/components/properties/binding/BindingField.stories.ts b/src/components/properties/binding/BindingField.stories.ts
index 0c7c4689c..5667fa112 100644
--- a/src/components/properties/binding/BindingField.stories.ts
+++ b/src/components/properties/binding/BindingField.stories.ts
@@ -4,7 +4,7 @@ import { expect, userEvent, within } from 'storybook/test'
import BindingFieldStates from './examples/States.vue'
const meta = {
- title: 'Editor/Properties/Binding Field',
+ title: 'App/Editor/Properties/Binding Field',
component: BindingFieldStates,
tags: ['autodocs'],
parameters: {
diff --git a/src/components/properties/component-properties/behaviour/Behaviour.stories.ts b/src/components/properties/component-properties/behaviour/Behaviour.stories.ts
index 40cdeb75d..fa87f6ff6 100644
--- a/src/components/properties/component-properties/behaviour/Behaviour.stories.ts
+++ b/src/components/properties/component-properties/behaviour/Behaviour.stories.ts
@@ -4,10 +4,12 @@ import { expect, userEvent, waitFor, within } from 'storybook/test'
import BehaviourStates from './examples/States.vue'
const meta = {
- title: 'Editor/Properties/Behaviour',
+ title: 'App/Editor/Properties/Behaviour',
component: BehaviourStates,
tags: ['autodocs'],
parameters: {
+ // The page shows one Behaviour section per demo; the editor only ever shows one.
+ a11y: { config: { rules: [{ id: 'landmark-unique', enabled: false }] } },
docs: {
description: {
component:
diff --git a/src/components/properties/component-properties/behaviour/BehaviourBindingField.vue b/src/components/properties/component-properties/behaviour/BehaviourBindingField.vue
index 602c2bbcd..2ebcede47 100644
--- a/src/components/properties/component-properties/behaviour/BehaviourBindingField.vue
+++ b/src/components/properties/component-properties/behaviour/BehaviourBindingField.vue
@@ -69,7 +69,7 @@ const items = computed(() => options.map((option) => ({ value: option.id, label:
<button
v-else
type="button"
- class="flex h-6 w-full items-center gap-1.5 rounded border border-dashed border-border px-2 text-xs text-muted outline-none hover:border-accent hover:text-surface focus-visible:border-accent"
+ class="flex h-6 w-full items-center gap-1.5 rounded border border-dashed border-border px-2 text-xs text-muted outline-none hover:border-accent hover:text-surface focus-visible:border-panel-focus"
:data-missing="missing || undefined"
v-bind="$attrs"
@click="emit('create')"
diff --git a/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue b/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue
index b40cc7a8d..349fc603d 100644
--- a/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue
+++ b/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue
@@ -40,7 +40,7 @@ const { available, updating, updateSelectedInstance } = useInstanceUpdate(
<button
type="button"
data-test-id="instance-update-action"
- class="flex size-7 items-center justify-center rounded bg-accent/10 text-accent hover:bg-accent/20 data-[state=open]:bg-accent/20 disabled:opacity-50"
+ class="flex size-7 items-center justify-center rounded bg-accent/10 text-primary hover:bg-accent/20 data-[state=open]:bg-accent/20 disabled:opacity-50"
:disabled="updating"
:aria-label="panels.updateSelectedInstance"
>
diff --git a/src/components/properties/component-properties/slot/SlotProperty.stories.ts b/src/components/properties/component-properties/slot/SlotProperty.stories.ts
index 535eac8d9..c99040daa 100644
--- a/src/components/properties/component-properties/slot/SlotProperty.stories.ts
+++ b/src/components/properties/component-properties/slot/SlotProperty.stories.ts
@@ -5,7 +5,7 @@ import SlotSettings from './examples/Settings.vue'
import SlotPropertyStates from './examples/States.vue'
const meta = {
- title: 'Editor/Properties/Slot Property',
+ title: 'App/Editor/Properties/Slot Property',
component: SlotPropertyStates,
tags: ['autodocs'],
parameters: {
diff --git a/src/components/properties/layout/alignment/LayoutAlignmentControl.stories.ts b/src/components/properties/layout/alignment/LayoutAlignmentControl.stories.ts
index 70bcb414b..9bbb3b97d 100644
--- a/src/components/properties/layout/alignment/LayoutAlignmentControl.stories.ts
+++ b/src/components/properties/layout/alignment/LayoutAlignmentControl.stories.ts
@@ -7,7 +7,7 @@ import LayoutAlignmentControl from './LayoutAlignmentControl.vue'
const positions = ['MIN', 'CENTER', 'MAX'] as const
const meta = {
- title: 'Editor/Properties/Layout Alignment',
+ title: 'App/Editor/Properties/Layout Alignment',
render: () => ({
components: { LayoutAlignmentControl },
setup() {
diff --git a/src/components/properties/layout/flex/FlexGapField.vue b/src/components/properties/layout/flex/FlexGapField.vue
index f8f168bcf..e8a957fe6 100644
--- a/src/components/properties/layout/flex/FlexGapField.vue
+++ b/src/components/properties/layout/flex/FlexGapField.vue
@@ -44,7 +44,7 @@ function setMode(value: string) {
<div
v-if="auto"
data-test-id="layout-gap-input"
- class="flex h-[26px] items-center rounded border border-border bg-input focus-within:border-accent"
+ class="flex h-[26px] items-center rounded border border-border bg-input focus-within:border-panel-focus"
>
<span class="px-[5px] text-muted">
<icon-lucide-align-horizontal-space-between v-if="horizontal" class="size-3.5" />
@@ -100,7 +100,7 @@ function setMode(value: string) {
:class="menu.item"
>
<SelectItemIndicator class="absolute left-1.5 inline-flex items-center justify-center"
- ><icon-lucide-check class="size-3 text-accent"
+ ><icon-lucide-check class="size-3 text-primary"
/></SelectItemIndicator>
<SelectItemText>{{
mode === 'AUTO' ? panels.auto : Math.round(ctx.node.itemSpacing)
diff --git a/src/components/properties/layout/size/SizeAxisField.vue b/src/components/properties/layout/size/SizeAxisField.vue
index 0fe1c339e..73b261d34 100644
--- a/src/components/properties/layout/size/SizeAxisField.vue
+++ b/src/components/properties/layout/size/SizeAxisField.vue
@@ -119,7 +119,7 @@ function handleSelect(value: SizeSelectValue) {
<SelectItemIndicator
class="absolute left-1.5 inline-flex items-center justify-center"
>
- <icon-lucide-check class="size-3 text-accent" />
+ <icon-lucide-check class="size-3 text-primary" />
</SelectItemIndicator>
<SelectItemText>{{ option.label }}</SelectItemText>
</SelectItem>
diff --git a/src/components/settings/ai-setup/AISetupConnection.stories.ts b/src/components/settings/ai-setup/AISetupConnection.stories.ts
index 7034377c0..aa36d4860 100644
--- a/src/components/settings/ai-setup/AISetupConnection.stories.ts
+++ b/src/components/settings/ai-setup/AISetupConnection.stories.ts
@@ -67,7 +67,7 @@ function piSetup(overrides: Partial<PiSetupState>): PiSetupState {
}
const meta = {
- title: 'Settings/AI Setup/Connection',
+ title: 'App/Settings/AI Setup/Connection',
args: {
providerID: 'openrouter',
signInStatus: 'idle',
diff --git a/src/components/settings/ai-setup/AISetupFlow.stories.ts b/src/components/settings/ai-setup/AISetupFlow.stories.ts
index f09cd00b4..bc5e5b11b 100644
--- a/src/components/settings/ai-setup/AISetupFlow.stories.ts
+++ b/src/components/settings/ai-setup/AISetupFlow.stories.ts
@@ -43,7 +43,7 @@ const freshInstall: AIModelSettings = {
}
const meta = {
- title: 'Settings/AI Setup/Guided setup',
+ title: 'App/Settings/AI Setup/Guided Setup',
args: { entry: 'guided', agentsAvailable: false },
parameters: {
docs: {
diff --git a/src/components/settings/ai-setup/AISetupRoles.stories.ts b/src/components/settings/ai-setup/AISetupRoles.stories.ts
index 4a0ca7443..b64f0cc95 100644
--- a/src/components/settings/ai-setup/AISetupRoles.stories.ts
+++ b/src/components/settings/ai-setup/AISetupRoles.stories.ts
@@ -16,7 +16,7 @@ const plan = planOnboarding(
)
const meta = {
- title: 'Settings/AI Setup/Roles',
+ title: 'App/Settings/AI Setup/Roles',
args: { isRecommended: true },
render: (args) => ({
components: { AISetupRoles },
diff --git a/src/components/settings/layout/SettingsLink.stories.ts b/src/components/settings/layout/SettingsLink.stories.ts
index aa581a58c..8c1b50d48 100644
--- a/src/components/settings/layout/SettingsLink.stories.ts
+++ b/src/components/settings/layout/SettingsLink.stories.ts
@@ -8,7 +8,7 @@ interface Args {
}
const meta = {
- title: 'Settings/Layout/Link',
+ title: 'App/Settings/Layout/Link',
component: SettingsLink,
args: {
href: 'https://openpencil.dev/programmable/mcp-server#webmcp',
diff --git a/src/components/settings/layout/SettingsSection.stories.ts b/src/components/settings/layout/SettingsSection.stories.ts
index 7d94ef639..becfa271f 100644
--- a/src/components/settings/layout/SettingsSection.stories.ts
+++ b/src/components/settings/layout/SettingsSection.stories.ts
@@ -14,7 +14,7 @@ interface Args {
}
const meta = {
- title: 'Settings/Layout/Section',
+ title: 'App/Settings/Layout/Section',
component: SettingsSection,
args: { heading: 'Recovery' },
render: (args) => ({
diff --git a/src/components/settings/mcp/MCPConnectionEditor.stories.ts b/src/components/settings/mcp/MCPConnectionEditor.stories.ts
index 041a92083..083828ae2 100644
--- a/src/components/settings/mcp/MCPConnectionEditor.stories.ts
+++ b/src/components/settings/mcp/MCPConnectionEditor.stories.ts
@@ -27,7 +27,7 @@ const savedDraft: MCPConnectionDraft = {
authenticationType: 'bearer'
}
const meta = {
- title: 'Settings/MCP/Connection editor',
+ title: 'App/Settings/MCP/Connection Editor',
args: { draft: emptyDraft, tokenStatus: 'missing', busy: false, error: '' },
render: (args) => ({
components: { MCPConnectionEditor },
diff --git a/src/components/settings/mcp/MCPFailureAlert.stories.ts b/src/components/settings/mcp/MCPFailureAlert.stories.ts
index 2868714b6..d20602086 100644
--- a/src/components/settings/mcp/MCPFailureAlert.stories.ts
+++ b/src/components/settings/mcp/MCPFailureAlert.stories.ts
@@ -29,7 +29,7 @@ const reasons: Record<MCPFailureCode, MCPFailure> = {
}
const meta = {
- title: 'Settings/MCP/Failure alert',
+ title: 'App/Settings/MCP/Failure Alert',
component: MCPFailureAlert,
args: { failure: reasons.timeout, restarting: false, externallyManaged: false },
render: (args) => ({
diff --git a/src/components/settings/mcp/WebMCPSettingsPanel.stories.ts b/src/components/settings/mcp/WebMCPSettingsPanel.stories.ts
index b3a4294c2..88f677b10 100644
--- a/src/components/settings/mcp/WebMCPSettingsPanel.stories.ts
+++ b/src/components/settings/mcp/WebMCPSettingsPanel.stories.ts
@@ -8,7 +8,7 @@ import WebMCPSettingsPanel from './WebMCPSettingsPanel.vue'
type Args = { modelValue: WebMCPMode; state: WebMCPRuntimeState }
const meta = {
- title: 'Settings/MCP/WebMCP',
+ title: 'App/Settings/MCP/WebMCP',
args: { modelValue: 'off', state: { status: 'off', toolCount: 0, error: null } },
render: (args) => ({
components: { WebMCPSettingsPanel },
diff --git a/src/components/settings/tool-access/ToolAccessList.stories.ts b/src/components/settings/tool-access/ToolAccessList.stories.ts
index b31c43375..d74f24d6e 100644
--- a/src/components/settings/tool-access/ToolAccessList.stories.ts
+++ b/src/components/settings/tool-access/ToolAccessList.stories.ts
@@ -19,7 +19,7 @@ const writeEntries: ToolAccessEntry[] = Array.from({ length: 20 }, (_, index) =>
}))
const meta = {
- title: 'Settings/Tool access/List',
+ title: 'App/Settings/Tool Access/List',
args: {
disabledTools: [] as string[],
initiallyCollapsed: false,
diff --git a/src/components/ui/button/button.ts b/src/components/ui/button/button.ts
index deb7a03d9..4e6effcd0 100644
--- a/src/components/ui/button/button.ts
+++ b/src/components/ui/button/button.ts
@@ -8,7 +8,7 @@ const button = tv({
ghost: 'bg-transparent text-muted hover:bg-hover hover:text-surface',
accent: 'bg-accent text-white hover:bg-accent/90',
panel: 'bg-panel/70 text-surface backdrop-blur-xl',
- panelAccent: 'border-accent/20 bg-panel/70 text-accent backdrop-blur-xl'
+ panelAccent: 'border-accent/20 bg-panel/70 text-primary backdrop-blur-xl'
},
shape: {
square: 'rounded',
diff --git a/src/components/ui/collapsible/AppCollapsible.stories.ts b/src/components/ui/collapsible/AppCollapsible.stories.ts
index 35eb1688b..4ac8c3173 100644
--- a/src/components/ui/collapsible/AppCollapsible.stories.ts
+++ b/src/components/ui/collapsible/AppCollapsible.stories.ts
@@ -7,7 +7,7 @@ import AppButton from '@/components/ui/button/AppButton.vue'
import AppCollapsible from './AppCollapsible.vue'
const meta = {
- title: 'Design System/Disclosure/Collapsible',
+ title: 'Design System/Layout/Collapsible',
args: { label: 'Advanced settings' },
render: (args) => ({
components: { AppCollapsible, AppButton },
diff --git a/src/components/ui/dialog/Dialog.stories.ts b/src/components/ui/dialog/Dialog.stories.ts
index c4491c96f..ae5f73068 100644
--- a/src/components/ui/dialog/Dialog.stories.ts
+++ b/src/components/ui/dialog/Dialog.stories.ts
@@ -12,7 +12,7 @@ import AppDialogHeader from './AppDialogHeader.vue'
import AppDialogRoot from './AppDialogRoot.vue'
const meta = {
- title: 'Design System/Dialog',
+ title: 'Design System/Overlays/Dialog',
component: AppDialogRoot,
tags: ['autodocs']
} satisfies Meta<typeof AppDialogRoot>
diff --git a/src/components/ui/feedback/AppAlert.stories.ts b/src/components/ui/feedback/AppAlert.stories.ts
index cb871e9a4..25a3c96ec 100644
--- a/src/components/ui/feedback/AppAlert.stories.ts
+++ b/src/components/ui/feedback/AppAlert.stories.ts
@@ -4,7 +4,7 @@ import type { AlertProps } from './alert'
import AppAlert from './AppAlert.vue'
const meta = {
- title: 'Design System/Alert',
+ title: 'Design System/Feedback/Alert',
component: AppAlert,
args: {
heading: 'Connection information',
diff --git a/src/components/ui/feedback/AppBadge.vue b/src/components/ui/feedback/AppBadge.vue
index 13b65a0b4..322de9670 100644
--- a/src/components/ui/feedback/AppBadge.vue
+++ b/src/components/ui/feedback/AppBadge.vue
@@ -9,7 +9,7 @@ const { ui } = defineProps<{
}>()
const cls = computed(() =>
- twMerge('shrink-0 rounded bg-accent/10 px-1 py-px text-[9px] text-accent', ui?.base)
+ twMerge('shrink-0 rounded bg-accent/10 px-1 py-px text-[9px] text-primary', ui?.base)
)
</script>
diff --git a/src/components/ui/feedback/AppBanner.stories.ts b/src/components/ui/feedback/AppBanner.stories.ts
index 5c9f056ec..33caac1ef 100644
--- a/src/components/ui/feedback/AppBanner.stories.ts
+++ b/src/components/ui/feedback/AppBanner.stories.ts
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/vue3-vite'
import AppBanner from './AppBanner.vue'
const meta = {
- title: 'Design System/Banner',
+ title: 'Design System/Feedback/Banner',
component: AppBanner,
parameters: { layout: 'fullscreen' }
} satisfies Meta<typeof AppBanner>
diff --git a/src/components/ui/feedback/AppPlaceholder.stories.ts b/src/components/ui/feedback/AppPlaceholder.stories.ts
index b5ceccc76..7c4bbd2bc 100644
--- a/src/components/ui/feedback/AppPlaceholder.stories.ts
+++ b/src/components/ui/feedback/AppPlaceholder.stories.ts
@@ -10,7 +10,7 @@ type PlaceholderStoryArgs = {
}
const meta = {
- title: 'Design System/Placeholder',
+ title: 'Design System/Feedback/Placeholder',
args: {
label: 'No documents yet',
description: 'Create a document to start working in this space.',
diff --git a/src/components/ui/feedback/AppProgress.stories.ts b/src/components/ui/feedback/AppProgress.stories.ts
index 8133807c3..be263ecbe 100644
--- a/src/components/ui/feedback/AppProgress.stories.ts
+++ b/src/components/ui/feedback/AppProgress.stories.ts
@@ -10,7 +10,7 @@ type ProgressStoryArgs = {
}
const meta = {
- title: 'Design System/Progress',
+ title: 'Design System/Feedback/Progress',
component: AppProgress,
args: { amount: { value: 42, max: 100 }, label: '42% · 9.6 MiB of 22.9 MiB' },
render: (args) => ({
diff --git a/src/components/ui/feedback/AppToast.stories.ts b/src/components/ui/feedback/AppToast.stories.ts
index 66aa01221..41d38fed2 100644
--- a/src/components/ui/feedback/AppToast.stories.ts
+++ b/src/components/ui/feedback/AppToast.stories.ts
@@ -9,7 +9,7 @@ import { progressPercent, type ProgressAmount } from './progress'
import type { ToastProps } from './toast'
const meta = {
- title: 'Design System/Toast',
+ title: 'Design System/Feedback/Toast',
component: AppToast,
// A toast only renders inside a provider, and the viewport is where it lands.
decorators: [
diff --git a/src/components/ui/input/PresetNumberField.stories.ts b/src/components/ui/input/PresetNumberField.stories.ts
index 3148c73f8..190e9cbb5 100644
--- a/src/components/ui/input/PresetNumberField.stories.ts
+++ b/src/components/ui/input/PresetNumberField.stories.ts
@@ -7,7 +7,7 @@ import PresetNumberField from './PresetNumberField.vue'
const LABEL = 'Maximum steps per message'
const meta = {
- title: 'Design System/Inputs/Preset number',
+ title: 'Design System/Inputs/Preset Number',
args: {
presets: [25, 50, 100, 200],
min: 1,
diff --git a/src/components/ui/panel/PanelFoundation.stories.ts b/src/components/ui/panel/PanelFoundation.stories.ts
index 632671189..b529ac4e8 100644
--- a/src/components/ui/panel/PanelFoundation.stories.ts
+++ b/src/components/ui/panel/PanelFoundation.stories.ts
@@ -139,7 +139,7 @@ export const StateMatrix: Story = {
<PanelSection label="Appearance">
<PanelGrid :columns="2">
<PanelFieldGroup label="Blend mode">
- <AppSelect v-model="blendMode" :options="blendModes" data-story-control aria-label="Blend mode" />
+ <AppSelect v-model="blendMode" :options="blendModes" data-story-control label="Blend mode" />
</PanelFieldGroup>
<PanelFieldGroup label="Opacity">
<AppInput v-model="mixed" tone="panel" size="xs" state="mixed" readonly data-story-control aria-label="Mixed opacity" />
diff --git a/src/components/ui/select/AppCombobox.stories.ts b/src/components/ui/select/AppCombobox.stories.ts
index 83733890e..af9a587d9 100644
--- a/src/components/ui/select/AppCombobox.stories.ts
+++ b/src/components/ui/select/AppCombobox.stories.ts
@@ -53,7 +53,7 @@ type AppComboboxStoryArgs = {
type Story = StoryObj<AppComboboxStoryArgs>
const meta = {
- title: 'Design System/Combobox',
+ title: 'Design System/Selection/Combobox',
component: AppCombobox,
parameters: { layout: 'centered' },
render: (args) => ({
diff --git a/src/components/ui/select/AppCombobox.vue b/src/components/ui/select/AppCombobox.vue
index 4fb66f335..0758052ac 100644
--- a/src/components/ui/select/AppCombobox.vue
+++ b/src/components/ui/select/AppCombobox.vue
@@ -158,7 +158,7 @@ function updateOpen(value: boolean): void {
:class="styles.item({ class: ui?.item })"
>
<ComboboxItemIndicator :class="styles.indicator({ class: ui?.indicator })">
- <icon-lucide-check class="size-3 text-accent" />
+ <icon-lucide-check class="size-3 text-primary" />
</ComboboxItemIndicator>
<slot name="option" :option="option">
<div class="min-w-0 flex-1">
diff --git a/src/components/ui/select/AppPicker.stories.ts b/src/components/ui/select/AppPicker.stories.ts
index 654d9fa06..d3875bea3 100644
--- a/src/components/ui/select/AppPicker.stories.ts
+++ b/src/components/ui/select/AppPicker.stories.ts
@@ -4,7 +4,7 @@ import { expect, userEvent, waitFor, within } from 'storybook/test'
import Picker from './examples/Picker.vue'
const meta = {
- title: 'Design System/Picker',
+ title: 'Design System/Selection/Picker',
component: Picker,
tags: ['autodocs'],
parameters: {
diff --git a/src/components/ui/select/AppPicker.vue b/src/components/ui/select/AppPicker.vue
index 758362296..8710abef2 100644
--- a/src/components/ui/select/AppPicker.vue
+++ b/src/components/ui/select/AppPicker.vue
@@ -136,12 +136,7 @@ function select(value: AcceptableValue) {
</AppButton>
</PopoverClose>
</div>
- <ListboxRoot
- class="flex min-h-0 flex-col"
- highlight-on-hover
- :aria-label="heading"
- @update:model-value="select"
- >
+ <ListboxRoot class="flex min-h-0 flex-col" highlight-on-hover @update:model-value="select">
<div :class="styles.search({ class: ui?.search })">
<icon-lucide-search :class="styles.searchIcon({ class: ui?.searchIcon })" />
<ListboxFilter
@@ -152,7 +147,7 @@ function select(value: AcceptableValue) {
:class="styles.input({ class: ui?.input })"
/>
</div>
- <ListboxContent :class="styles.list({ class: ui?.list })">
+ <ListboxContent :class="styles.list({ class: ui?.list })" :aria-label="heading">
<p v-if="groups.length === 0" :class="styles.empty({ class: ui?.empty })">
{{ emptyLabel }}
</p>
@@ -160,11 +155,13 @@ function select(value: AcceptableValue) {
<ListboxGroupLabel v-if="group" :class="styles.groupLabel({ class: ui?.groupLabel })">
{{ group }}
</ListboxGroupLabel>
+ <!-- Reka marks a disabled option only with data-disabled; assistive tech needs aria-disabled. -->
<ListboxItem
v-for="item in entries"
:key="item.value"
:value="item.value"
:disabled="item.disabled"
+ :aria-disabled="item.disabled || undefined"
:class="styles.item({ class: ui?.item })"
>
<span v-if="slots.leading" :class="styles.leading({ class: ui?.leading })">
diff --git a/src/components/ui/select/AppSelect.stories.ts b/src/components/ui/select/AppSelect.stories.ts
index e1e4f5135..d3e3ac95a 100644
--- a/src/components/ui/select/AppSelect.stories.ts
+++ b/src/components/ui/select/AppSelect.stories.ts
@@ -6,7 +6,7 @@ import AppButton from '@/components/ui/button/AppButton.vue'
import AppSelect from './AppSelect.vue'
const meta = {
- title: 'Design System/Select',
+ title: 'Design System/Selection/Select',
render: () => ({
components: { AppSelect, AppButton },
setup() {
diff --git a/src/components/ui/select/AppSelect.vue b/src/components/ui/select/AppSelect.vue
index a1f7b7dfd..462ea72fa 100644
--- a/src/components/ui/select/AppSelect.vue
+++ b/src/components/ui/select/AppSelect.vue
@@ -73,7 +73,7 @@ const selectedLabel = computed(
:class="styles.item({ class: ui?.item })"
>
<SelectItemIndicator :class="styles.indicator({ class: ui?.indicator })">
- <icon-lucide-check class="size-3 text-accent" />
+ <icon-lucide-check class="size-3 text-primary" />
</SelectItemIndicator>
<SelectItemText>{{ opt.label }}</SelectItemText>
<slot name="option-end" :option="opt" />
diff --git a/src/components/ui/toggle/AppCheckboxCard.stories.ts b/src/components/ui/toggle/AppCheckboxCard.stories.ts
index 8f3996fae..e3d712c46 100644
--- a/src/components/ui/toggle/AppCheckboxCard.stories.ts
+++ b/src/components/ui/toggle/AppCheckboxCard.stories.ts
@@ -11,7 +11,7 @@ interface Args {
}
const meta = {
- title: 'Design System/Inputs/Checkbox card',
+ title: 'Design System/Inputs/Checkbox Card',
args: {
label: 'Review designs visually',
description: 'A model that reads images checks the result against your request.'
diff --git a/src/components/ui/toggle/AppCheckboxCard.vue b/src/components/ui/toggle/AppCheckboxCard.vue
index 408bd33b3..d6a1305eb 100644
--- a/src/components/ui/toggle/AppCheckboxCard.vue
+++ b/src/components/ui/toggle/AppCheckboxCard.vue
@@ -25,7 +25,12 @@ const id = useId()
</script>
<template>
- <label data-slot="checkbox-card" :class="styles.root({ class: ui?.root })">
+ <!-- The whole card is the control, so its description is disabled along with the checkbox. -->
+ <label
+ data-slot="checkbox-card"
+ :aria-disabled="disabled || undefined"
+ :class="styles.root({ class: ui?.root })"
+ >
<AppCheckbox
v-model="checked"
:disabled="disabled"
diff --git a/src/components/updater/UpdatePrompt.stories.ts b/src/components/updater/UpdatePrompt.stories.ts
index 37152af55..bce4d0459 100644
--- a/src/components/updater/UpdatePrompt.stories.ts
+++ b/src/components/updater/UpdatePrompt.stories.ts
@@ -36,7 +36,7 @@ type Args = { state: UpdaterState; currentVersion: string; installQuitsApp?: boo
type Story = StoryObj<Args>
const meta = {
- title: 'Shell/Update Prompt',
+ title: 'App/Shell/Update Prompt',
component: UpdatePrompt,
parameters: { layout: 'centered' },
args: { currentVersion: '0.15.0' },
diff --git a/src/components/variables/TokenTable.vue b/src/components/variables/TokenTable.vue
index 49134fa4e..262db4880 100644
--- a/src/components/variables/TokenTable.vue
+++ b/src/components/variables/TokenTable.vue
@@ -181,7 +181,6 @@ function dropEdge(id: string) {
selection-behavior="replace"
:class="ui.list()"
highlight-on-hover
- :aria-label="collection.name"
data-test-id="token-list"
@keydown="onKeydown"
>
@@ -208,7 +207,11 @@ function dropEdge(id: string) {
@new-group="emit('newGroup', [...selectedIds])"
@remove="emit('remove', [...selectedIds])"
>
- <ListboxContent ref="content" @contextmenu.capture="onContextMenu">
+ <ListboxContent
+ ref="content"
+ :aria-label="collection.name"
+ @contextmenu.capture="onContextMenu"
+ >
<ListboxGroup v-for="group in groups" :key="group.path">
<ListboxGroupLabel v-if="group.path" :class="ui.group()">{{
group.path
diff --git a/src/components/variables/TokensPanel.stories.ts b/src/components/variables/TokensPanel.stories.ts
index dcfa57577..22afcc7bc 100644
--- a/src/components/variables/TokensPanel.stories.ts
+++ b/src/components/variables/TokensPanel.stories.ts
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/vue3-vite'
import DesignSystem from './examples/DesignSystem.vue'
const meta = {
- title: 'Editor/Tokens Panel',
+ title: 'App/Editor/Tokens Panel',
component: DesignSystem,
parameters: {
layout: 'centered',
diff --git a/src/theme/button/icon-button.ts b/src/theme/button/icon-button.ts
index 637aa1eaf..4be0ee664 100644
--- a/src/theme/button/icon-button.ts
+++ b/src/theme/button/icon-button.ts
@@ -7,7 +7,7 @@ export default {
md: 'size-8 rounded-md border border-transparent text-base leading-none'
},
active: {
- true: 'border-accent text-accent'
+ true: 'border-accent text-primary'
},
disabled: {
true: 'cursor-not-allowed opacity-50 hover:bg-transparent hover:text-muted'
diff --git a/src/theme/chat/history.ts b/src/theme/chat/history.ts
index 0c57d7689..f0d9192af 100644
--- a/src/theme/chat/history.ts
+++ b/src/theme/chat/history.ts
@@ -13,12 +13,12 @@ export const chatHistoryTheme = tv({
icon: 'size-3.5 shrink-0',
content: ['z-50 w-80 max-w-[calc(100vw-1rem)] p-2', floatingSurface, motionStyles.floating],
input:
- 'w-full rounded border border-border bg-input px-2 py-1.5 text-xs outline-none focus:border-accent',
+ 'w-full rounded border border-border bg-input px-2 py-1.5 text-xs outline-none focus:border-panel-focus',
scope: 'my-2 flex gap-1',
scopeButton:
'flex-1 rounded px-2 py-1 text-[11px] text-muted hover:bg-hover data-[active=true]:bg-hover data-[active=true]:text-surface',
list: 'max-h-64 space-y-0.5 overflow-y-auto',
- row: 'flex w-full items-center gap-2 rounded px-2 py-2 text-left hover:bg-hover focus-visible:outline-accent data-[selected=true]:bg-hover',
+ row: 'flex w-full items-center gap-2 rounded px-2 py-2 text-left hover:bg-hover focus-visible:outline-panel-focus data-[selected=true]:bg-hover',
detail: 'block truncate text-[10px] text-muted',
label: 'block truncate text-xs',
empty: 'px-2 py-4 text-center text-xs text-muted',
diff --git a/src/theme/chat/profile.ts b/src/theme/chat/profile.ts
index e61580696..d1308dba0 100644
--- a/src/theme/chat/profile.ts
+++ b/src/theme/chat/profile.ts
@@ -15,7 +15,7 @@ export const chatProfileTheme = tv({
headerLabel: 'text-[9px] font-medium tracking-wide text-muted uppercase',
headerDescription: 'mt-0.5 text-[9px] leading-3 text-muted',
item: 'grid h-auto min-h-11 grid-cols-[14px_minmax(0,1fr)_auto] gap-2 rounded px-2 py-1.5',
- indicator: 'flex size-3.5 shrink-0 items-center justify-center text-accent',
+ indicator: 'flex size-3.5 shrink-0 items-center justify-center text-primary',
indicatorIcon: 'size-3',
text: 'min-w-0',
name: 'block truncate text-[11px] leading-4 font-medium',
diff --git a/src/theme/chat/thinking.ts b/src/theme/chat/thinking.ts
index 435801b18..631e16bcf 100644
--- a/src/theme/chat/thinking.ts
+++ b/src/theme/chat/thinking.ts
@@ -4,7 +4,7 @@ import { tv } from 'tailwind-variants'
export const chatThinkingTheme = tv({
slots: {
meter:
- 'inline-flex h-3 shrink-0 items-end gap-px text-muted data-[level=high]:text-violet-400 data-[level=low]:text-sky-400 data-[level=medium]:text-accent data-[level=minimal]:text-sky-300 data-[level=xhigh]:text-fuchsia-400',
+ 'inline-flex h-3 shrink-0 items-end gap-px text-muted data-[level=high]:text-violet-400 data-[level=low]:text-sky-400 data-[level=medium]:text-primary data-[level=minimal]:text-sky-300 data-[level=xhigh]:text-fuchsia-400',
bar: 'w-[3px] rounded-[1px] bg-current data-[filled=false]:bg-muted/30',
trigger: 'flex shrink-0 items-center',
/** Narrow composers show only the meter, leaving the width to the model name. */
diff --git a/src/theme/chat/tool.ts b/src/theme/chat/tool.ts
index a0d05eb9e..0b448b394 100644
--- a/src/theme/chat/tool.ts
+++ b/src/theme/chat/tool.ts
@@ -6,7 +6,7 @@ export const chatToolTheme = tv({
trigger:
'flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-left hover:bg-hover disabled:cursor-default disabled:hover:bg-transparent',
status:
- 'flex size-4 shrink-0 items-center justify-center rounded-full data-[state=done]:bg-green-500/20 data-[state=done]:text-green-400 data-[state=error]:bg-red-500/20 data-[state=error]:text-red-400 data-[state=pending]:bg-accent/20 data-[state=pending]:text-accent',
+ 'flex size-4 shrink-0 items-center justify-center rounded-full data-[state=done]:bg-success/20 data-[state=done]:text-success data-[state=error]:bg-error/15 data-[state=error]:text-error data-[state=pending]:bg-accent/20 data-[state=pending]:text-primary',
statusIcon: 'size-3',
name: 'shrink-0 text-[11px] font-medium text-surface',
summary: 'min-w-0 flex-1 truncate font-mono text-[10px] text-muted',
@@ -14,7 +14,7 @@ export const chatToolTheme = tv({
'ml-auto size-3 shrink-0 text-muted transition-transform motion-reduce:transition-none [[data-state=open]>&]:rotate-180',
body: 'space-y-2 border-t border-border px-2 py-2 text-[10px]',
nodes: 'flex flex-wrap gap-1',
- node: 'inline-flex max-w-40 cursor-pointer items-center gap-1 rounded border border-border bg-input px-1.5 py-0.5 text-[10px] text-surface hover:border-accent hover:text-accent disabled:cursor-default disabled:opacity-50 disabled:hover:border-border disabled:hover:text-surface',
+ node: 'inline-flex max-w-40 cursor-pointer items-center gap-1 rounded border border-border bg-input px-1.5 py-0.5 text-[10px] text-surface hover:border-accent hover:text-primary disabled:cursor-default disabled:opacity-50 disabled:hover:border-border disabled:hover:text-surface',
nodeIcon: 'size-3 shrink-0 text-muted',
nodeLabel: 'truncate',
image:
@@ -33,9 +33,9 @@ export const chatToolTheme = tv({
group: 'rounded-lg border border-dashed border-border',
groupTrigger:
'flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-left text-[11px] text-muted hover:bg-hover hover:text-surface',
- groupIcon: 'size-3.5 shrink-0 text-accent',
+ groupIcon: 'size-3.5 shrink-0 text-primary',
groupNames: 'min-w-0 flex-1 truncate',
- groupFailed: 'bg-red-500/20 text-red-400',
+ groupFailed: 'bg-error/15 text-error',
groupItems: 'space-y-1.5 px-1.5 pb-1.5'
}
})
diff --git a/src/theme/code/editor.ts b/src/theme/code/editor.ts
index 77d5ba210..e2d01fd1a 100644
--- a/src/theme/code/editor.ts
+++ b/src/theme/code/editor.ts
@@ -34,7 +34,7 @@ export function codeEditorTheme(dark: boolean) {
fontFamily: 'var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)',
lineHeight: '1.65'
},
- '.cm-content': { padding: '10px 0', caretColor: 'var(--color-accent)' },
+ '.cm-content': { padding: '10px 0', caretColor: 'var(--color-primary)' },
'.cm-line': { padding: '0 8px' },
'.cm-gutters': {
backgroundColor: 'var(--color-panel)',
@@ -50,7 +50,7 @@ export function codeEditorTheme(dark: boolean) {
backgroundColor: 'var(--color-hover)',
color: 'var(--color-surface)'
},
- '.cm-cursor, .cm-dropCursor': { borderLeftColor: 'var(--color-accent)' },
+ '.cm-cursor, .cm-dropCursor': { borderLeftColor: 'var(--color-primary)' },
'.cm-selectionBackground, &.cm-focused .cm-selectionBackground': {
backgroundColor: 'color-mix(in srgb, var(--color-accent) 22%, transparent)'
},
@@ -75,6 +75,10 @@ export function codeEditorTheme(dark: boolean) {
'.cm-searchMatch.cm-searchMatch-selected': {
backgroundColor: 'color-mix(in srgb, var(--color-accent) 35%, transparent)'
},
+ // The merge view's own deletion red is too strong for syntax colors to read on.
+ '.cm-deletedChunk .cm-deletedText': {
+ backgroundColor: 'color-mix(in srgb, var(--color-error) 8%, transparent)'
+ },
'.cm-textfield, .cm-button': {
background: 'var(--color-input)',
color: 'var(--color-surface)',
diff --git a/src/theme/collaboration/follow-frame.ts b/src/theme/collaboration/follow-frame.ts
index 648424849..c60b65ed3 100644
--- a/src/theme/collaboration/follow-frame.ts
+++ b/src/theme/collaboration/follow-frame.ts
@@ -4,9 +4,9 @@ import { tv } from 'tailwind-variants'
export const followFrame = tv({
slots: {
root: 'pointer-events-none absolute inset-0 z-30 border-2',
- bar: 'pointer-events-auto absolute top-0 left-1/2 flex max-w-[calc(100%-1rem)] -translate-x-1/2 items-center gap-1.5 rounded-b-md py-1 pr-1 pl-2.5 text-[11px] font-medium text-white shadow-md',
+ bar: 'pointer-events-auto absolute top-0 left-1/2 flex max-w-[calc(100%-1rem)] -translate-x-1/2 items-center gap-1.5 rounded-b-md py-1 pr-1 pl-2.5 text-[11px] font-medium shadow-md',
icon: 'size-3 shrink-0',
label: 'min-w-0 truncate',
- stop: 'shrink-0 cursor-pointer rounded bg-white/20 px-1.5 py-0.5 text-[11px] font-medium text-white outline-none hover:bg-white/30 focus-visible:ring-1 focus-visible:ring-white'
+ stop: 'shrink-0 cursor-pointer rounded bg-current/15 px-1.5 py-0.5 text-[11px] font-medium outline-none hover:bg-current/25 focus-visible:ring-1 focus-visible:ring-current'
}
})
diff --git a/src/theme/collaboration/presence-avatars.ts b/src/theme/collaboration/presence-avatars.ts
index 427453bff..eb9e3c0c0 100644
--- a/src/theme/collaboration/presence-avatars.ts
+++ b/src/theme/collaboration/presence-avatars.ts
@@ -7,12 +7,12 @@ import { floatingSurface } from '@/theme/overlay'
export const presenceAvatars = tv({
slots: {
trigger:
- 'relative shrink-0 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-accent',
+ 'relative shrink-0 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-panel-focus',
chevron: 'size-2',
/** On your avatar while you are in a room. */
live: 'absolute -top-0.5 -right-0.5 size-2 rounded-full border border-panel bg-[var(--color-success-bg)]',
overflow:
- 'relative flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border-2 border-panel bg-hover text-[9px] font-semibold text-surface outline-none focus-visible:ring-2 focus-visible:ring-accent',
+ 'relative flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border-2 border-panel bg-hover text-[9px] font-semibold text-surface outline-none focus-visible:ring-2 focus-visible:ring-panel-focus',
card: ['z-50 w-60 p-2', floatingSurface, motionStyles.floating],
leave: 'mt-2 w-full'
}
diff --git a/src/theme/collaboration/presence-list.ts b/src/theme/collaboration/presence-list.ts
index 7c4947051..f84a26db9 100644
--- a/src/theme/collaboration/presence-list.ts
+++ b/src/theme/collaboration/presence-list.ts
@@ -1,7 +1,7 @@
import { tv } from 'tailwind-variants'
const NAME =
- 'min-w-0 cursor-default truncate text-left text-[11px] text-surface outline-none focus-visible:ring-1 focus-visible:ring-accent'
+ 'min-w-0 cursor-default truncate text-left text-[11px] text-surface outline-none focus-visible:ring-1 focus-visible:ring-panel-focus'
/** People in a room, each followed by their agents. */
export const presenceList = tv({
diff --git a/src/theme/collaboration/room-screen.ts b/src/theme/collaboration/room-screen.ts
index 188bcaf6d..daeaa01e6 100644
--- a/src/theme/collaboration/room-screen.ts
+++ b/src/theme/collaboration/room-screen.ts
@@ -16,7 +16,7 @@ export const roomScreen = tv({
actions: 'flex flex-col items-center gap-3',
buttons: 'flex items-center justify-center gap-2',
footnote: 'flex flex-wrap items-center justify-center gap-1.5 text-[11px] text-muted',
- link: 'text-accent underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-none'
+ link: 'text-primary underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-none'
}
})
diff --git a/src/theme/collaboration/share-button.ts b/src/theme/collaboration/share-button.ts
index 8fda78095..e4e6acf4f 100644
--- a/src/theme/collaboration/share-button.ts
+++ b/src/theme/collaboration/share-button.ts
@@ -1,7 +1,7 @@
import { tv } from 'tailwind-variants'
export const shareButton = tv({
- base: 'flex h-7 cursor-pointer items-center gap-1.5 rounded border-none px-3 text-[11px] font-medium transition-colors outline-none focus-visible:ring-1 focus-visible:ring-accent',
+ base: 'flex h-7 cursor-pointer items-center gap-1.5 rounded border-none px-3 text-[11px] font-medium transition-colors outline-none focus-visible:ring-1 focus-visible:ring-panel-focus',
variants: {
connection: {
idle: 'bg-accent text-white hover:bg-accent/90',
diff --git a/src/theme/constraints.ts b/src/theme/constraints.ts
index 23e6aa358..fd539c061 100644
--- a/src/theme/constraints.ts
+++ b/src/theme/constraints.ts
@@ -5,12 +5,12 @@ const constraintsTheme = {
pin: 'absolute flex cursor-pointer items-center justify-center rounded-sm border border-transparent bg-transparent text-muted outline-none hover:bg-hover hover:text-surface focus-visible:ring-1 focus-visible:ring-panel-focus',
pinMark: 'block rounded-full bg-current',
scaleBadge:
- 'pointer-events-none absolute inset-2 flex items-center justify-center text-[9px] font-medium tracking-wide text-accent uppercase',
+ 'pointer-events-none absolute inset-2 flex items-center justify-center text-[9px] font-medium tracking-wide text-primary uppercase',
selects: 'grid min-w-0 gap-1.5'
},
variants: {
active: {
- true: { pin: 'border-accent bg-accent/12 text-accent' },
+ true: { pin: 'border-accent bg-accent/12 text-primary' },
false: {}
},
scale: {
diff --git a/src/theme/design-check.ts b/src/theme/design-check.ts
index 3442b623f..8365412c2 100644
--- a/src/theme/design-check.ts
+++ b/src/theme/design-check.ts
@@ -34,7 +34,7 @@ export const designCheck = tv({
rowDetail: 'flex max-w-[50%] min-w-0 shrink items-center gap-1.5 text-muted tabular-nums',
rowDetailText: 'truncate',
rowAction:
- 'absolute top-1/2 right-1.5 hidden h-5 -translate-y-1/2 cursor-pointer items-center rounded bg-panel px-1.5 text-accent shadow-[0_0_0_1px_var(--color-border)] outline-none group-focus-within/row:flex group-hover/row:flex hover:bg-hover focus-visible:ring-1 focus-visible:ring-panel-focus',
+ 'absolute top-1/2 right-1.5 hidden h-5 -translate-y-1/2 cursor-pointer items-center rounded bg-panel px-1.5 text-primary shadow-[0_0_0_1px_var(--color-border)] outline-none group-focus-within/row:flex group-hover/row:flex hover:bg-hover focus-visible:ring-1 focus-visible:ring-panel-focus',
contrastSwatch:
'flex h-3.5 shrink-0 items-center rounded-[3px] px-[3px] text-[9px] leading-none font-semibold shadow-[inset_0_0_0_1px_rgb(0_0_0/0.12)]',
swatch: 'size-2.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgb(0_0_0/0.12)]',
diff --git a/src/theme/feedback/progress.ts b/src/theme/feedback/progress.ts
index 40a072fd1..801a208e2 100644
--- a/src/theme/feedback/progress.ts
+++ b/src/theme/feedback/progress.ts
@@ -11,7 +11,7 @@ const progressTheme = {
/** On panels: an accent bar on a quiet track. */
accent: { track: 'bg-hover', fill: 'bg-accent', label: 'text-muted' },
/** On coloured surfaces such as toasts: follows the text colour. */
- current: { track: 'bg-current/25', fill: 'bg-current', label: 'opacity-80' }
+ current: { track: 'bg-current/25', fill: 'bg-current', label: '' }
}
},
defaultVariants: { tone: 'accent' as const }
diff --git a/src/theme/feedback/toast.ts b/src/theme/feedback/toast.ts
index 5ce6ec65c..69425f730 100644
--- a/src/theme/feedback/toast.ts
+++ b/src/theme/feedback/toast.ts
@@ -6,7 +6,7 @@ const toastTheme = {
icon: 'mt-0.5 size-3 shrink-0',
content: 'min-w-0 flex-1',
message: 'select-text',
- count: 'ml-1.5 opacity-70',
+ count: 'ml-1.5',
progress: 'mt-1.5',
action:
'shrink-0 cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-medium underline-offset-2 hover:underline',
diff --git a/src/theme/fill-picker.ts b/src/theme/fill-picker.ts
index 022b0e970..6bb1e6102 100644
--- a/src/theme/fill-picker.ts
+++ b/src/theme/fill-picker.ts
@@ -1,8 +1,8 @@
const fillPickerTheme = {
slots: {
- tab: 'flex size-6 cursor-pointer items-center justify-center rounded border-none p-0 text-muted transition-colors outline-none focus-visible:ring-1 focus-visible:ring-accent',
+ tab: 'flex size-6 cursor-pointer items-center justify-center rounded border-none p-0 text-muted transition-colors outline-none focus-visible:ring-1 focus-visible:ring-panel-focus',
barStop:
- 'absolute top-1/2 size-3.5 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-sm border-2 border-white/60 shadow-sm outline-none data-[dragging]:cursor-grabbing focus-visible:ring-1 focus-visible:ring-accent',
+ 'absolute top-1/2 size-3.5 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-sm border-2 border-white/60 shadow-sm outline-none data-[dragging]:cursor-grabbing focus-visible:ring-1 focus-visible:ring-panel-focus',
listStop: 'flex items-center gap-1 py-0.5'
},
variants: {
diff --git a/src/theme/home/document-entry.ts b/src/theme/home/document-entry.ts
index 7676d3eb2..7f1a992c8 100644
--- a/src/theme/home/document-entry.ts
+++ b/src/theme/home/document-entry.ts
@@ -9,7 +9,7 @@ export const documentEntry = tv({
'flex aspect-video items-center justify-center overflow-hidden rounded-lg border border-border bg-panel-field transition-colors group-hover:border-panel-focus',
image: 'size-full object-cover transition-transform duration-200 group-hover:scale-[1.015]',
fallback: 'size-8 text-muted/40',
- icon: 'size-4 shrink-0 text-accent',
+ icon: 'size-4 shrink-0 text-primary',
body: 'min-w-0 flex-1',
name: 'block truncate text-xs font-medium',
metadata: 'mt-0.5 block truncate text-[10px] text-muted',
diff --git a/src/theme/layer-tree.ts b/src/theme/layer-tree.ts
index bb254d6f4..3790a807f 100644
--- a/src/theme/layer-tree.ts
+++ b/src/theme/layer-tree.ts
@@ -32,7 +32,7 @@ const layerTreeTheme = {
},
visible: {
true: {},
- false: { row: 'opacity-50' }
+ false: {}
},
component: {
true: { icon: 'text-component opacity-100' },
@@ -82,7 +82,11 @@ const layerTreeTheme = {
selected: true,
focused: false,
class: { row: 'bg-panel-selected-muted text-surface hover:bg-panel-selected-muted' }
- }
+ },
+ // A hidden layer dims while its name still reads at 4.5:1. Once selected, fading the row would
+ // fade its highlight too, so only the icon dims.
+ { visible: false, selected: false, class: { row: 'opacity-65' } },
+ { visible: false, selected: true, class: { icon: 'opacity-50' } }
],
defaultVariants: {
selected: false,
diff --git a/src/theme/layout-alignment.ts b/src/theme/layout-alignment.ts
index 07e4b338d..7d2c5984e 100644
--- a/src/theme/layout-alignment.ts
+++ b/src/theme/layout-alignment.ts
@@ -6,7 +6,7 @@ const layoutAlignmentTheme = {
},
variants: {
active: {
- true: { cell: 'bg-accent/10 text-accent' },
+ true: { cell: 'bg-accent/10 text-primary' },
false: { cell: 'text-muted hover:bg-hover hover:text-surface' }
},
disabled: {
diff --git a/src/theme/link.ts b/src/theme/link.ts
index b4d9ed1d0..3de8e02f7 100644
--- a/src/theme/link.ts
+++ b/src/theme/link.ts
@@ -1,6 +1,6 @@
const linkTheme = {
slots: {
- base: 'inline-flex w-fit cursor-pointer items-center gap-1 rounded-sm font-medium text-surface underline decoration-muted/60 underline-offset-2 hover:decoration-current focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent',
+ base: 'inline-flex w-fit cursor-pointer items-center gap-1 rounded-sm font-medium text-surface underline decoration-muted/60 underline-offset-2 hover:decoration-current focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-panel-focus',
icon: 'size-3 shrink-0'
}
}
diff --git a/src/theme/select/combobox.ts b/src/theme/select/combobox.ts
index 8347bbc82..a6b456c46 100644
--- a/src/theme/select/combobox.ts
+++ b/src/theme/select/combobox.ts
@@ -25,7 +25,7 @@ const appComboboxTheme = {
item: 'relative flex min-h-8 cursor-pointer items-center gap-2 rounded py-1 pr-2 pl-6 text-surface outline-none select-none data-[disabled]:pointer-events-none data-[highlighted]:bg-hover data-[disabled]:opacity-50',
indicator: 'absolute left-1.5 inline-flex items-center justify-center',
description: 'truncate font-mono text-[9px] text-muted',
- meta: 'shrink-0 rounded bg-accent/10 px-1 py-px text-[9px] text-accent'
+ meta: 'shrink-0 rounded bg-accent/10 px-1 py-px text-[9px] text-primary'
}
}
diff --git a/src/theme/select/picker.ts b/src/theme/select/picker.ts
index 2adf53a53..2e861a2a7 100644
--- a/src/theme/select/picker.ts
+++ b/src/theme/select/picker.ts
@@ -24,7 +24,7 @@ const appPickerTheme = {
text: 'min-w-0 flex-1',
label: 'block truncate text-xs text-surface',
description: 'block truncate text-[10px] text-muted',
- check: 'size-3 shrink-0 text-accent',
+ check: 'size-3 shrink-0 text-primary',
empty: 'px-1 py-2 text-[11px] text-muted',
footer: 'border-t border-border p-1'
},
diff --git a/src/theme/tab-bar.ts b/src/theme/tab-bar.ts
index 9fe86664d..d2354ac1c 100644
--- a/src/theme/tab-bar.ts
+++ b/src/theme/tab-bar.ts
@@ -4,7 +4,7 @@ const tabBarTheme = {
list: 'flex h-full items-end',
item: 'group/tab flex h-full max-w-48 min-w-0 items-center border-r border-border pr-3',
trigger:
- 'flex h-full min-w-0 cursor-pointer touch-manipulation items-center gap-1.5 px-3 text-[11px] transition-colors outline-none select-none focus-visible:ring-1 focus-visible:ring-accent',
+ 'flex h-full min-w-0 cursor-pointer touch-manipulation items-center gap-1.5 px-3 text-[11px] transition-colors outline-none select-none focus-visible:ring-1 focus-visible:ring-panel-focus',
icon: 'size-3 shrink-0 opacity-50',
label: 'min-w-0 flex-1 truncate',
close:
diff --git a/src/theme/tokens-panel.ts b/src/theme/tokens-panel.ts
index 023a6b916..c206710d2 100644
--- a/src/theme/tokens-panel.ts
+++ b/src/theme/tokens-panel.ts
@@ -42,11 +42,11 @@ export default {
cssStacked: 'truncate font-mono text-[11px] text-muted @2xl/tokens-list:hidden',
value:
'flex min-w-0 animate-in items-center gap-1.5 truncate font-mono text-[11px] fade-in duration-150 motion-reduce:animate-none',
- expression: 'truncate font-mono text-[11px] text-accent',
+ expression: 'truncate font-mono text-[11px] text-primary',
modeHeader: 'flex min-w-0 flex-col gap-0.5',
/** When a mode applies: words in the UI font, a selector or query in the code font. */
modeCondition:
- 'truncate text-[11px] font-normal text-muted data-[code]:font-mono data-[code]:text-[10px] data-[code]:text-muted/80',
+ 'truncate text-[11px] font-normal text-muted data-[code]:font-mono data-[code]:text-[10px]',
section: 'flex flex-col gap-2',
sectionTitle: 'text-[11px] font-semibold text-muted',
field: 'flex flex-col gap-1',
diff --git a/src/theme/toolbar.ts b/src/theme/toolbar.ts
index 826917be2..2674c6eff 100644
--- a/src/theme/toolbar.ts
+++ b/src/theme/toolbar.ts
@@ -1,11 +1,11 @@
const toolbarTheme = {
slots: {
button:
- 'flex size-8 cursor-pointer items-center justify-center border-none bg-transparent text-muted transition-colors outline-none focus-visible:ring-1 focus-visible:ring-accent',
+ 'flex size-8 cursor-pointer items-center justify-center border-none bg-transparent text-muted transition-colors outline-none focus-visible:ring-1 focus-visible:ring-panel-focus',
icon: 'size-4',
flyoutGroup: 'flex items-center',
flyoutTrigger:
- 'flex h-8 w-3 cursor-pointer items-center justify-center border-none bg-transparent text-muted transition-colors outline-none data-[state=open]:bg-hover data-[state=open]:text-surface focus-visible:ring-1 focus-visible:ring-accent',
+ 'flex h-8 w-3 cursor-pointer items-center justify-center border-none bg-transparent text-muted transition-colors outline-none data-[state=open]:bg-hover data-[state=open]:text-surface focus-visible:ring-1 focus-visible:ring-panel-focus',
flyoutTriggerIcon: 'size-2.5',
flyoutContent: '',
flyoutItem: '',
@@ -13,10 +13,10 @@ const toolbarTheme = {
flyoutItemIcon: 'size-3.5',
flyoutItemLabel: 'flex-1',
navigationAction:
- 'flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full border border-border bg-panel text-muted shadow-sm outline-none select-none focus-visible:ring-1 focus-visible:ring-accent disabled:pointer-events-none',
+ 'flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full border border-border bg-panel text-muted shadow-sm outline-none select-none focus-visible:ring-1 focus-visible:ring-panel-focus disabled:pointer-events-none',
navigationIcon: 'size-3.5',
action:
- 'flex size-8 cursor-pointer items-center justify-center rounded-[6px] border-none bg-transparent text-muted transition-colors outline-none select-none active:bg-hover active:text-surface focus-visible:ring-1 focus-visible:ring-accent',
+ 'flex size-8 cursor-pointer items-center justify-center rounded-[6px] border-none bg-transparent text-muted transition-colors outline-none select-none active:bg-hover active:text-surface focus-visible:ring-1 focus-visible:ring-panel-focus',
actionIcon: 'size-4'
},
variants: {
diff --git a/tests/e2e/code/panel.spec.ts b/tests/e2e/code/panel.spec.ts
index 8791501fa..76e2a6474 100644
--- a/tests/e2e/code/panel.spec.ts
+++ b/tests/e2e/code/panel.spec.ts
@@ -121,7 +121,7 @@ test('keeps the last valid preview while showing invalid-code diagnostics', asyn
await codeEditor().fill('<Frame>')
const errorAlert = editor.page.getByTestId('code-panel-error')
await expect(errorAlert).toBeVisible()
- await expect(errorAlert).toHaveCSS('color', 'rgb(248, 113, 113)')
+ await expect(errorAlert).toHaveCSS('color', 'rgb(250, 133, 133)')
await editor.page.evaluate(async () => {
const themeModulePath = '/src/app/shell/theme.ts'
diff --git a/tests/e2e/settings/feedback.spec.ts b/tests/e2e/settings/feedback.spec.ts
index a482b1fee..cb2acb54a 100644
--- a/tests/e2e/settings/feedback.spec.ts
+++ b/tests/e2e/settings/feedback.spec.ts
@@ -37,8 +37,8 @@ test('model Save and Test explain missing fields and focus the first error', asy
)
})
).toBe(true)
- await expect(name).toHaveCSS('border-top-color', 'rgb(248, 113, 113)')
- await expect(editor.getByRole('alert').first()).toHaveCSS('color', 'rgb(248, 113, 113)')
+ await expect(name).toHaveCSS('border-top-color', 'rgb(250, 133, 133)')
+ await expect(editor.getByRole('alert').first()).toHaveCSS('color', 'rgb(250, 133, 133)')
await name.fill('My model')
await expect(name).toHaveAttribute('aria-invalid', 'false')
const testConnection = page.getByTestId('provider-test-connection')
diff --git a/tests/e2e/storybook/alignment.spec.ts b/tests/e2e/storybook/alignment.spec.ts
index 916bed159..862e3ea12 100644
--- a/tests/e2e/storybook/alignment.spec.ts
+++ b/tests/e2e/storybook/alignment.spec.ts
@@ -1,7 +1,7 @@
import { expect, test } from '@playwright/test'
test('alignment arrows move spatially without applying until activation', async ({ page }) => {
- await page.goto('/iframe.html?id=editor-properties-layout-alignment--default&viewMode=story')
+ await page.goto('/iframe.html?id=app-editor-properties-layout-alignment--default&viewMode=story')
const first = page.getByRole('button', { name: 'Top left', exact: true })
await first.focus()
await first.press('ArrowRight')
diff --git a/tests/e2e/storybook/binding-actions.spec.ts b/tests/e2e/storybook/binding-actions.spec.ts
index 33f6f7189..2b57477aa 100644
--- a/tests/e2e/storybook/binding-actions.spec.ts
+++ b/tests/e2e/storybook/binding-actions.spec.ts
@@ -1,7 +1,9 @@
import { expect, test } from '@playwright/test'
test('binding picker creates a variable through submit and detaches it', async ({ page }) => {
- await page.goto('/iframe.html?id=editor-properties-binding-field--picker-actions&viewMode=story')
+ await page.goto(
+ '/iframe.html?id=app-editor-properties-binding-field--picker-actions&viewMode=story'
+ )
const field = page.getByLabel('Unbound field', { exact: true })
await field.getByRole('button', { name: 'Apply variable' }).click()
await page.getByRole('button', { name: 'Create number variable' }).click()
diff --git a/tests/e2e/storybook/controls.spec.ts b/tests/e2e/storybook/controls.spec.ts
index b6f1086ba..edd9c2893 100644
--- a/tests/e2e/storybook/controls.spec.ts
+++ b/tests/e2e/storybook/controls.spec.ts
@@ -2,25 +2,25 @@ import { expect, test } from '@playwright/test'
const stories = [
'design-system-inputs-input--default',
- 'editor-mobile-hud-actions--default',
+ 'app-editor-mobile-hud-actions--default',
'design-system-actions-button--color-matrix',
'design-system-actions-button--constrained-labels',
- 'editor-toolbar--default',
- 'editor-properties-layout-alignment--default',
- 'home-document-entry--default',
- 'home-document-entry--list',
- 'home-document-entry--long-name',
- 'home-document-entry--disabled',
+ 'app-editor-toolbar--default',
+ 'app-editor-properties-layout-alignment--default',
+ 'app-home-document-entry--default',
+ 'app-home-document-entry--list',
+ 'app-home-document-entry--long-name',
+ 'app-home-document-entry--disabled',
'design-system-lists-action-row--default',
'design-system-paint-fill-swatch--default',
'design-system-paint-fill-swatch--transparent',
'design-system-paint-fill-swatch--gradient',
'design-system-paint-fill-swatch--image-placeholder',
'design-system-navigation-tabs--constrained-labels',
- 'design-system-disclosure-collapsible--collapsed',
+ 'design-system-layout-collapsible--collapsed',
'design-system-inputs-preset-number--custom-selected',
- 'settings-tool-access-list--mixed-access',
- 'settings-mcp-failure-alert--all-reasons'
+ 'app-settings-tool-access-list--mixed-access',
+ 'app-settings-mcp-failure-alert--all-reasons'
]
for (const theme of ['light', 'dark']) {
diff --git a/tests/e2e/storybook/layer-tree-interaction.spec.ts b/tests/e2e/storybook/layer-tree-interaction.spec.ts
index 25bd66a14..a64b64891 100644
--- a/tests/e2e/storybook/layer-tree-interaction.spec.ts
+++ b/tests/e2e/storybook/layer-tree-interaction.spec.ts
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'
test('virtualized rename commits and selection persists outside the tree', async ({ page }) => {
await page.goto(
- '/iframe.html?id=editor-layer-tree--virtualized&viewMode=story&globals=theme:light'
+ '/iframe.html?id=app-editor-layer-tree--virtualized&viewMode=story&globals=theme:light'
)
const row = page.getByRole('treeitem').first()
await row.focus()
diff --git a/tests/e2e/storybook/layer-tree.spec.ts b/tests/e2e/storybook/layer-tree.spec.ts
index aeb2fab7e..8e961915c 100644
--- a/tests/e2e/storybook/layer-tree.spec.ts
+++ b/tests/e2e/storybook/layer-tree.spec.ts
@@ -3,7 +3,7 @@ import { expect, test } from '@playwright/test'
for (const theme of ['light', 'dark']) {
test(`adjacent hovered layer does not overlap selected row in ${theme}`, async ({ page }) => {
await page.goto(
- `/iframe.html?id=editor-layer-tree--virtualized&viewMode=story&globals=theme:${theme}`
+ `/iframe.html?id=app-editor-layer-tree--virtualized&viewMode=story&globals=theme:${theme}`
)
await page.getByRole('treeitem').nth(1).hover()
await expect(page.locator('#storybook-root')).toHaveScreenshot(
diff --git a/tests/e2e/storybook/presence/avatars.spec.ts b/tests/e2e/storybook/presence/avatars.spec.ts
index 00b2bd433..5394aba04 100644
--- a/tests/e2e/storybook/presence/avatars.spec.ts
+++ b/tests/e2e/storybook/presence/avatars.spec.ts
@@ -4,7 +4,7 @@ const story = (id: string) => `/iframe.html?id=${id}&viewMode=story`
// Stories with play functions click on their own; these use ones that do not.
test("an avatar counts its person's agents and lists them on hover", async ({ page }) => {
- await page.goto(story('collaboration-presence-avatars--many-people'))
+ await page.goto(story('app-collaboration-presence-avatars--many-people'))
const ana = page.getByRole('button', { name: 'Follow Ana' })
await expect(ana).toContainText('2')
await ana.hover()
@@ -14,27 +14,27 @@ test("an avatar counts its person's agents and lists them on hover", async ({ pa
})
test('more people than fit collapse into +N, which lists everyone', async ({ page }) => {
- await page.goto(story('collaboration-presence-avatars--many-people'))
+ await page.goto(story('app-collaboration-presence-avatars--many-people'))
await page.getByRole('button', { name: '2 more' }).click()
await expect(page.getByText('Fay')).toBeVisible()
await expect(page.getByText('Dana (you)')).toBeVisible()
})
test('your avatar shows the room is live and opens your menu with Leave room', async ({ page }) => {
- await page.goto(story('collaboration-presence-avatars--many-people'))
+ await page.goto(story('app-collaboration-presence-avatars--many-people'))
await expect(page.getByRole('img', { name: 'Connected' })).toBeVisible()
await page.getByRole('button', { name: 'Dana (you)' }).click()
await expect(page.getByRole('button', { name: 'Leave room' })).toBeVisible()
})
test('the follow frame names an agent with its owner and offers to stop', async ({ page }) => {
- await page.goto(story('collaboration-follow-frame--following-their-agent'))
+ await page.goto(story('app-collaboration-follow-frame--following-their-agent'))
await expect(page.getByRole('status')).toHaveText(/Following Orbit \(Ana\)/)
await expect(page.getByRole('button', { name: 'Stop following' })).toBeVisible()
})
test("the keyboard reaches a collaborator's agents through the room list", async ({ page }) => {
- await page.goto(story('collaboration-presence-avatars--room'))
+ await page.goto(story('app-collaboration-presence-avatars--room'))
const everyone = page.getByRole('button', { name: 'In this room' })
await everyone.focus()
await everyone.press('Enter')
diff --git a/tests/e2e/storybook/presence/list.spec.ts b/tests/e2e/storybook/presence/list.spec.ts
index fd52fd678..857015d64 100644
--- a/tests/e2e/storybook/presence/list.spec.ts
+++ b/tests/e2e/storybook/presence/list.spec.ts
@@ -1,7 +1,7 @@
import { expect, test } from '@playwright/test'
const story = (name: string) =>
- `/iframe.html?id=collaboration-presence-list--${name}&viewMode=story`
+ `/iframe.html?id=app-collaboration-presence-list--${name}&viewMode=story`
test('lists people with their agents and what each agent is doing', async ({ page }) => {
await page.goto(story('room'))
diff --git a/tests/e2e/storybook/presence/pages.spec.ts b/tests/e2e/storybook/presence/pages.spec.ts
index fdc900ebc..65a192019 100644
--- a/tests/e2e/storybook/presence/pages.spec.ts
+++ b/tests/e2e/storybook/presence/pages.spec.ts
@@ -3,20 +3,20 @@ import { expect, test } from '@playwright/test'
const story = (id: string) => `/iframe.html?id=${id}&viewMode=story`
test('page markers name everyone and summarize the overflow', async ({ page }) => {
- await page.goto(story('collaboration-page-presence-markers--more-than-fit'))
+ await page.goto(story('app-collaboration-page-presence-markers--more-than-fit'))
const markers = page.getByRole('img', { name: 'Ana, Orbit, Ben, Pixel, Fern' })
await expect(markers).toBeVisible()
await expect(markers.getByText('+2')).toBeVisible()
})
test('page markers render nothing for an empty page', async ({ page }) => {
- await page.goto(story('collaboration-page-presence-markers--nobody'))
+ await page.goto(story('app-collaboration-page-presence-markers--nobody'))
await expect(page.getByText('Checkout')).toBeVisible()
await expect(page.getByRole('img')).toHaveCount(0)
})
test('the chat names the page its reply works on and offers to go there', async ({ page }) => {
- await page.goto(story('chat-run-location--on-another-page'))
+ await page.goto(story('app-chat-run-location--on-another-page'))
await expect(page.getByRole('status')).toHaveText(/Fern is working on “Checkout”/)
await expect(page.getByRole('button', { name: 'Go to page' })).toBeVisible()
})
diff --git a/tests/e2e/storybook/stories.spec.ts b/tests/e2e/storybook/stories.spec.ts
index e09a29d8f..0af541ed5 100644
--- a/tests/e2e/storybook/stories.spec.ts
+++ b/tests/e2e/storybook/stories.spec.ts
@@ -1,4 +1,4 @@
-import { expect, test } from '@playwright/test'
+import { expect, test, type Page } from '@playwright/test'
import * as v from 'valibot'
const StoryIndex = v.object({
@@ -8,53 +8,76 @@ const StoryIndex = v.object({
/** How long one story may take to render and run its play function. */
const STORY_TIMEOUT_MS = 20_000
+/** Each story is checked in both app themes, since their tokens meet contrast separately. */
+const THEMES = ['dark', 'light'] as const
+
// Storybook's index exists only once its server runs, after Playwright has collected tests,
// so one test walks every story and reports each failure separately.
-test('every story renders and passes its play function', async ({ page, request }) => {
+test('every story renders, passes its play function, and meets axe in both themes', async ({
+ page,
+ request
+}) => {
const text = await (await request.get('/index.json')).text()
const index = v.parse(v.pipe(v.string(), v.parseJson(), StoryIndex), text)
const stories = Object.values(index.entries).filter((entry) => entry.type === 'story')
- test.setTimeout(stories.length * STORY_TIMEOUT_MS)
+ test.setTimeout(stories.length * THEMES.length * STORY_TIMEOUT_MS)
expect(stories.length).toBeGreaterThan(0)
- for (const story of stories) {
- await page.goto(`/iframe.html?id=${story.id}&viewMode=story`)
- const outcome = await page.evaluate(
- (timeout) =>
- new Promise<string>((resolve) => {
- const channel: unknown = Reflect.get(window, '__STORYBOOK_ADDONS_CHANNEL__')
- if (typeof channel !== 'object' || channel === null || !('on' in channel)) {
- resolve('Storybook channel is missing')
- return
- }
- const on = channel.on as (event: string, listener: (detail?: unknown) => void) => void
- // Exceptions name what failed. storyFinished comes last, after afterEach, and its
- // reporters say whether anything else failed; accessibility reports are left to axe.
- const failures: string[] = []
- const record = (kind: string) => (detail?: unknown) => {
- const message =
- detail instanceof Object && 'message' in detail ? detail.message : detail
- failures.push(`${kind}: ${String(message)}`)
- }
- on.call(channel, 'playFunctionThrewException', record('play function'))
- on.call(channel, 'storyThrewException', record('render'))
- on.call(channel, 'storyErrored', record('story'))
- on.call(channel, 'storyFinished', (detail?: unknown) => {
- const reporters =
- detail instanceof Object && 'reporters' in detail && Array.isArray(detail.reporters)
- ? detail.reporters
- : []
- for (const report of reporters) {
- const { type, status } = report as { type?: unknown; status?: unknown }
- if (type !== 'a11y' && status === 'failed')
- failures.push(`${String(type)} report failed`)
- }
- resolve(failures[0] ?? 'ok')
- })
- setTimeout(() => resolve('timed out'), timeout)
- }),
- STORY_TIMEOUT_MS
- )
- expect.soft(outcome, story.id).toBe('ok')
+ for (const theme of THEMES) {
+ for (const story of stories) {
+ await page.goto(`/iframe.html?id=${story.id}&viewMode=story&globals=theme:${theme}`)
+ expect.soft(await storyOutcome(page), `${story.id} (${theme})`).toBe('ok')
+ }
}
})
+
+/** 'ok', or the first failure the open story reports. */
+function storyOutcome(page: Page): Promise<string> {
+ return page.evaluate(
+ (timeout) =>
+ new Promise<string>((resolve) => {
+ const channel: unknown = Reflect.get(window, '__STORYBOOK_ADDONS_CHANNEL__')
+ if (typeof channel !== 'object' || channel === null || !('on' in channel)) {
+ resolve('Storybook channel is missing')
+ return
+ }
+ const on = channel.on as (event: string, listener: (detail?: unknown) => void) => void
+ // Exceptions name what failed. storyFinished comes last, after afterEach, and its
+ // reporters say whether anything else failed, axe's naming the rules it found broken.
+ const failures: string[] = []
+ const record = (kind: string) => (detail?: unknown) => {
+ const message = detail instanceof Object && 'message' in detail ? detail.message : detail
+ failures.push(`${kind}: ${String(message)}`)
+ }
+ on.call(channel, 'playFunctionThrewException', record('play function'))
+ on.call(channel, 'storyThrewException', record('render'))
+ on.call(channel, 'storyErrored', record('story'))
+ on.call(channel, 'storyFinished', (detail?: unknown) => {
+ const reporters =
+ detail instanceof Object && 'reporters' in detail && Array.isArray(detail.reporters)
+ ? detail.reporters
+ : []
+ for (const report of reporters) {
+ const { type, status, result } = report as {
+ type?: unknown
+ status?: unknown
+ result?: {
+ violations?: { id: string; nodes: { target: unknown }[] }[]
+ }
+ }
+ if (status !== 'failed') continue
+ const violations = (result?.violations ?? []).map(
+ (violation) =>
+ `${violation.id} at ${violation.nodes.map((node) => String(node.target)).join(', ')}`
+ )
+ failures.push(
+ `${String(type)} report failed${violations.length ? `: ${violations.join('; ')}` : ''}`
+ )
+ }
+ resolve(failures[0] ?? 'ok')
+ })
+ setTimeout(() => resolve('timed out'), timeout)
+ }),
+ STORY_TIMEOUT_MS
+ )
+}
diff --git a/tests/e2e/storybook/toast.spec.ts b/tests/e2e/storybook/toast.spec.ts
index 26c0de1db..fe0db23a3 100644
--- a/tests/e2e/storybook/toast.spec.ts
+++ b/tests/e2e/storybook/toast.spec.ts
@@ -1,7 +1,7 @@
import { expect, test } from '@playwright/test'
test('determinate progress exposes its value and bar width', async ({ page }) => {
- await page.goto('/iframe.html?id=design-system-toast--download-progress&viewMode=story')
+ await page.goto('/iframe.html?id=design-system-feedback-toast--download-progress&viewMode=story')
const toast = page.locator('[data-slot="toast"]')
await expect(toast).toHaveAttribute('data-progress', 'determinate')
@@ -18,7 +18,7 @@ test('determinate progress exposes its value and bar width', async ({ page }) =>
test('progress without a known total stays indeterminate', async ({ page }) => {
await page.goto(
- '/iframe.html?id=design-system-toast--download-progress-unknown-total&viewMode=story'
+ '/iframe.html?id=design-system-feedback-toast--download-progress-unknown-total&viewMode=story'
)
const toast = page.locator('[data-slot="toast"]')
@@ -29,7 +29,7 @@ test('progress without a known total stays indeterminate', async ({ page }) => {
test('a reported total flips between determinate, indeterminate, and cleared', async ({ page }) => {
await page.clock.install()
- await page.goto('/iframe.html?id=design-system-toast--progress-lifecycle&viewMode=story')
+ await page.goto('/iframe.html?id=design-system-feedback-toast--progress-lifecycle&viewMode=story')
const toast = page.locator('[data-slot="toast"]')
const bar = toast.getByRole('progressbar')
@@ -60,7 +60,7 @@ test('a reported total flips between determinate, indeterminate, and cleared', a
test('resuming progress cancels the pending auto-dismissal', async ({ page }) => {
await page.clock.install()
- await page.goto('/iframe.html?id=design-system-toast--progress-lifecycle&viewMode=story')
+ await page.goto('/iframe.html?id=design-system-feedback-toast--progress-lifecycle&viewMode=story')
const toast = page.locator('[data-slot="toast"]')
await expect(toast).toHaveAttribute('data-progress', 'determinate')
@@ -77,7 +77,7 @@ test('resuming progress cancels the pending auto-dismissal', async ({ page }) =>
})
test('an action toast renders its action', async ({ page }) => {
- await page.goto('/iframe.html?id=design-system-toast--with-action&viewMode=story')
+ await page.goto('/iframe.html?id=design-system-feedback-toast--with-action&viewMode=story')
const toast = page.locator('[data-slot="toast"]')
await expect(toast).toContainText('Design file moved to Trash.')