Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

PRD-8100 fix inverted CTA emphasis in two dialog footers (#3645)

serafin-garcia1eac39c454f4
diff --git a/.changeset/dialog-confirm-emphasis.md b/.changeset/dialog-confirm-emphasis.md
new file mode 100644
index 000000000..658e36a78
--- /dev/null
+++ b/.changeset/dialog-confirm-emphasis.md
@@ -0,0 +1,11 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+Confirmation dialogs no longer make their confirm button look like the least important control in the footer. Two of them, the "Maintain generated indexes in every folder?" prompt in Settings and the skill plugin bundle install prompt, drew Cancel as a bordered button and the confirm as flat text with no fill or border, so the escape action read as the primary one. Both confirms now use the standard primary button, the same shape the app's other non-destructive confirmation dialogs already use.
+
+The light theme's primary blue is also slightly deeper. At its previous lightness it fell below the WCAG 2 AA contrast floor both as a button fill under white label text and as the text of a link-styled button. The new value clears 4.5:1 on both while keeping the same hue and saturation.
+
+Document links in the light theme are a deeper blue now too. That is a separate token from the primary, and it was reading at 3.56:1 on the page background, so ordinary links inside a document sat below the same floor. It now clears 5.2:1. The palette entry it used to point at is unchanged, because that entry also drives icon fills and text selection, where no text contrast requirement applies.
+
+Catppuccin Latte and Solarized get the same treatment. Both took their blue straight from the upstream palette, and in both cases that blue missed the same 4.5:1 floor, at 4.35:1 for Latte and 4.08:1 for Solarized. Latte's is now a little darker and Solarized's a little lighter, each clearing 4.63:1. Because these themes derive their whole blue from one palette entry, the change also lifts link text, note callouts, and the sidebar accent in those two themes above the floor.
diff --git a/biome-plugins/README.md b/biome-plugins/README.md
index f7736c3a6..787dbabab 100644
--- a/biome-plugins/README.md
+++ b/biome-plugins/README.md
@@ -340,6 +340,26 @@ The rule does NOT catch:
Plugin: [`biome-plugins/no-physical-direction-utility.grit`](no-physical-direction-utility.grit). Fixture: [`biome-plugins/__fixtures__/no-physical-direction-utility.fixture.tsx`](__fixtures__/no-physical-direction-utility.fixture.tsx). Test: [`packages/app/tests/lint-plugins/no-physical-direction-utility.test.ts`](../packages/app/tests/lint-plugins/no-physical-direction-utility.test.ts). See [PRECEDENTS.md #42](../PRECEDENTS.md#custom-lint-enforcement-precedent-42) for the GritQL-plugin convention.
+### `no-demoted-dialog-confirm.grit`
+
+Dialog-footer emphasis hierarchy. A confirmation dialog's footer holds two actions, and the confirm has to outrank the dismiss. `secondary` is the one Button variant that draws no border and whose fill is imperceptible: `bg-secondary` sits within roughly 1.1:1 of the dialog surface in both light and dark, so the button reads as flat text rather than an action. Every other variant either fills with a contrasting color or draws a border, so `secondary` is the only one that can lose that contest with the `outline` Cancel standing beside it. A footer authored that way inverts the hierarchy: the escape action reads as the primary one, and the actual primary CTA reads as de-emphasized text. The rule flags a `DialogFooter` or `AlertDialogFooter` containing `variant="secondary"` and asks for `default` (or `destructive`, when the action is irreversible removal).
+
+**The typographic treatment comes with the variant.** `default` and `destructive` bake `font-mono uppercase` into their variant strings, and `DialogClose` hardcodes the same pair, so a footer gets its look from the design system rather than from hand-added classes. The two sites this rule was written against had reached for `variant="secondary"` plus a hand-added `className="font-mono uppercase"`, which recovered the footer's typography while leaving the confirm without a perceptible fill. That is what makes the inversion easy to author by accident: the footer still looks like a footer. The canonical shape omits the prop entirely and lets `defaultVariants` supply `default`, matching every other confirm dialog in the tree.
+
+**Matched as one whole JSX element, not as `<Tag $...>$body</Tag>`.** A footer holds two or more children, and a single `$body` capture binds only an arity-one child list. GritQL regex matches the entire node text, so the leading tag name anchors the match to footers themselves rather than to any ancestor that happens to contain one.
+
+**Scoped via `overrides[].plugins`** to `packages/{app,desktop,plugin}/src/**/*.tsx`. `.tsx` only: the single branch matches a JSX element, so a `.ts` glob would be dead scope rather than extra coverage. Exemptions as negative `!`-globs: `!packages/app/src/components/ui/**` (the dialog and button primitives themselves, regenerated by `shadcn add`), and `!**/*.test.tsx` / `!**/*.dom.test.tsx` (a test that renders the demoted shape on purpose is pinning the regression, not shipping it).
+
+The rule does NOT catch:
+
+- **Indirect composition.** A confirm passed into the footer as a prop, or rendered by a shared sub-component, sits outside the footer element's text. The ceiling is deliberate: it keeps the rule to one structural predicate rather than a type-aware analysis.
+- **The other direction.** A footer whose dismiss is over-emphasized (a `default` Cancel next to a `default` confirm) is a hierarchy problem this rule has no predicate for, since both buttons carry a fill.
+- **Non-footer emphasis inversions.** A `CardFooter` or toolbar pairing a muted primary action with a prominent secondary one. `secondary` outside a dialog footer is a legitimate choice, which is why the scope is the footer element.
+
+Suppress a footer that genuinely wants a muted tertiary control alongside a properly-weighted confirm with an inline `// biome-ignore lint/plugin/no-demoted-dialog-confirm: <reason>`.
+
+Plugin: [`biome-plugins/no-demoted-dialog-confirm.grit`](no-demoted-dialog-confirm.grit). Fixture: [`biome-plugins/__fixtures__/no-demoted-dialog-confirm.fixture.tsx`](__fixtures__/no-demoted-dialog-confirm.fixture.tsx). Test: [`packages/app/tests/lint-plugins/no-demoted-dialog-confirm.test.ts`](../packages/app/tests/lint-plugins/no-demoted-dialog-confirm.test.ts). See [PRECEDENTS.md #42](../PRECEDENTS.md#custom-lint-enforcement-precedent-42) for the GritQL-plugin convention.
+
## Suppression
Inline `// biome-ignore` comments silence individual diagnostics. The most specific form names the rule and the reason:
@@ -363,6 +383,7 @@ Current production suppressions:
- `no-roundtrip-identity-oracle`: 0 sites
- `no-inline-tolerance-class`: 0 sites
- `no-uninstall-forbidden-import`: 0 sites
+- `no-demoted-dialog-confirm`: 0 sites
- `no-unwrapped-user-facing-string`: 1 site — `components/settings/lint-plugin-meta.ts` (`Frontmatter schemas`, the plugin's name beside `markdownlint`; `frontmatter` is a `GLOSSARY.md` never-translate term). Everything else the rule has ever found — the four hits on landing, the 50 the object-property branch was written for — was wrapped rather than suppressed.
- `no-physical-direction-utility`: 81 file-level `biome-ignore-all` headers across `packages/app/src/**` (pre-rule backlog awaiting the logical-property pass; see the rule's section above for the ratchet contract)
diff --git a/biome-plugins/__fixtures__/no-demoted-dialog-confirm.fixture.tsx b/biome-plugins/__fixtures__/no-demoted-dialog-confirm.fixture.tsx
new file mode 100644
index 000000000..012686d16
--- /dev/null
+++ b/biome-plugins/__fixtures__/no-demoted-dialog-confirm.fixture.tsx
@@ -0,0 +1,121 @@
+// FIXTURE — drives `no-demoted-dialog-confirm.test.ts` via shell-out to
+// `biome check`. Not part of the main lint (lives outside the lint
+// command's path list).
+//
+// Three positive cases (deliberate violations — plugin must fire) + four
+// negative cases (clean usage that must NOT fire). Exact-equality
+// (`toBe(3)`) in the test catches both false-negative regressions (drop
+// below 3) and false-positive widenings (above 3).
+
+import { AlertDialogFooter } from '@/components/ui/alert-dialog';
+import { Button } from '@/components/ui/button';
+import { DialogClose, DialogFooter } from '@/components/ui/dialog';
+
+declare const close: () => void;
+declare const submit: () => void;
+
+// === Positive cases — must fire ===
+
+// (1) The reported shape: an outline dismiss beside a secondary confirm.
+// The confirm hand-adds the mono treatment that `default` would have
+// supplied, which is what makes the inversion easy to author by
+// accident — the footer still LOOKS like a footer.
+export function Positive1() {
+ return (
+ <DialogFooter>
+ <Button variant="outline" onClick={close}>
+ Cancel
+ </Button>
+ <Button variant="secondary" className="font-mono uppercase" onClick={submit}>
+ Enable indexes
+ </Button>
+ </DialogFooter>
+ );
+}
+
+// (2) Same inversion with the dismiss wrapped in `DialogClose asChild`,
+// which is the other way this footer gets written.
+export function Positive2() {
+ return (
+ <DialogFooter>
+ <DialogClose asChild>
+ <Button variant="outline">Cancel</Button>
+ </DialogClose>
+ <Button variant="secondary" onClick={submit}>
+ Install selected
+ </Button>
+ </DialogFooter>
+ );
+}
+
+// (3) AlertDialogFooter — the sibling footer primitive. Same predicate.
+export function Positive3() {
+ return (
+ <AlertDialogFooter>
+ <Button variant="outline" onClick={close}>
+ Cancel
+ </Button>
+ <Button variant="secondary" onClick={submit}>
+ Confirm
+ </Button>
+ </AlertDialogFooter>
+ );
+}
+
+// === Negative cases — must NOT fire ===
+
+// (1) The canonical shape: the confirm omits the variant entirely and takes
+// `default` from `defaultVariants`.
+export function Negative1() {
+ return (
+ <DialogFooter>
+ <Button variant="outline" onClick={close}>
+ Cancel
+ </Button>
+ <Button onClick={submit}>Publish</Button>
+ </DialogFooter>
+ );
+}
+
+// (2) `destructive` confirm — correct for irreversible removal, and it
+// outranks the dismiss. Must NOT fire.
+export function Negative2() {
+ return (
+ <DialogFooter>
+ <Button variant="outline" onClick={close}>
+ Cancel
+ </Button>
+ <Button variant="destructive" onClick={submit}>
+ Delete permanently
+ </Button>
+ </DialogFooter>
+ );
+}
+
+// (3) `variant="secondary"` OUTSIDE a footer. The rule is scoped to the
+// footer element, and a muted action elsewhere is a legitimate choice.
+// Must NOT fire.
+export function Negative3() {
+ return (
+ <div className="card-actions">
+ <Button variant="secondary" onClick={submit}>
+ Install skill
+ </Button>
+ </div>
+ );
+}
+
+// (4) A footer holding a deliberately muted tertiary control alongside a
+// properly-weighted confirm, suppressed inline. Exercises the escape
+// hatch the diagnostic names.
+export function Negative4() {
+ return (
+ // biome-ignore lint/plugin/no-demoted-dialog-confirm: tertiary control beside a correctly-weighted confirm
+ <DialogFooter>
+ <Button variant="secondary" onClick={close}>
+ Remind me later
+ </Button>
+ <Button onClick={submit}>Update now</Button>
+ </DialogFooter>
+ );
+}
diff --git a/biome-plugins/no-demoted-dialog-confirm.grit b/biome-plugins/no-demoted-dialog-confirm.grit
new file mode 100644
index 000000000..edb0b00b2
--- /dev/null
+++ b/biome-plugins/no-demoted-dialog-confirm.grit
@@ -0,0 +1,56 @@
+// no-demoted-dialog-confirm — a dialog footer's confirm must outrank its dismiss.
+//
+// `secondary` is the variant behind the real footers this rule was written
+// for: `bg-secondary` sits within roughly 1.1:1 of the dialog surface in both
+// themes, and the base class draws `border-transparent`, so the button reads
+// as flat text and LOSES the emphasis contest with the `outline` Cancel
+// standing beside it. A footer authored that way inverts the visual
+// hierarchy: the escape action reads as the primary one and the actual
+// primary CTA reads as de-emphasized text.
+//
+// `ghost`, `link` and `link-muted` are flat at rest too, so the failure shape
+// is not unique to `secondary`. They are not plausible footer-confirm choices
+// and no such footer exists in the codebase, so the pattern below stays
+// narrow rather than widening to catch a shape nobody writes. If one lands,
+// widen the pattern rather than assuming it is already covered.
+//
+// The confirm belongs on `default` (or `destructive` when the action is
+// irreversible removal). Both bake `font-mono uppercase` into their variant
+// string, so the footer's typographic treatment comes with the variant —
+// there is nothing to hand-add. Canonical shape, matching every other
+// confirm dialog in the codebase, is to omit the prop entirely and let
+// `defaultVariants` supply `default`:
+//
+// <DialogFooter>
+// <Button variant="outline" onClick={close}>Cancel</Button>
+// <Button onClick={submit}>Publish</Button>
+// </DialogFooter>
+//
+// The rule reads the footer element's whole text, so a confirm composed
+// indirectly (passed in as a prop, rendered by a shared sub-component) is
+// outside its reach. That ceiling is deliberate — it keeps the rule to one
+// structural predicate rather than a type-aware analysis.
+//
+// Suppress a footer that genuinely wants a muted control (a tertiary action
+// sitting alongside a properly-weighted confirm) with:
+// // biome-ignore lint/plugin/no-demoted-dialog-confirm: <reason>
+//
+// See PRECEDENTS.md #42 (custom Biome enforcement is GritQL plugins).
+
+language js
+
+// Matched as one whole element rather than as `<Tag $...>$body</Tag>`,
+// because a footer holds two or more children and a single `$body` capture
+// binds only an arity-one child list. GritQL regex matches the ENTIRE node
+// text, so the leading tag name anchors the match to footers themselves and
+// not to any ancestor that happens to contain one. `(?s)` lets `.` cross
+// newlines; capturing groups silently never match in Biome's dialect, hence
+// `(?:…)`.
+jsx_element() as $footer where {
+ $footer <: r"(?s)<(?:Alert)?DialogFooter[\s>].*",
+ $footer <: r"(?s).*variant=\"secondary\".*",
+ register_diagnostic(
+ span = $footer,
+ message = "Demoted confirm in a dialog footer. `secondary` draws no border and its `bg-secondary` fill sits within about 1.1:1 of the dialog surface, so it reads as flat text and loses the emphasis contest with the `outline` dismiss beside it. Drop the variant prop and let the confirm take `default` (or `destructive` for irreversible removal), which also supplies the footer's font-mono uppercase treatment. See https://github.com/inkeep/open-knowledge/blob/main/biome-plugins/README.md#no-demoted-dialog-confirmgrit"
+ )
+}
diff --git a/biome.jsonc b/biome.jsonc
index 71cfb6b18..6c9852075 100644
--- a/biome.jsonc
+++ b/biome.jsonc
@@ -295,6 +295,31 @@
],
"plugins": ["./biome-plugins/no-physical-direction-utility.grit"]
},
+ {
+ // Dialog-footer emphasis hierarchy. `secondary` is the one Button variant
+ // whose fill is low enough in contrast to lose the emphasis contest with
+ // the `outline` dismiss standing beside it — a footer authored that way
+ // reads with its hierarchy inverted. The rule's only branch matches a JSX
+ // element, so the scope is `.tsx` alone; a `.ts` glob would be dead
+ // scope, not extra coverage.
+ // Exemptions:
+ // - packages/app/src/components/ui/** — the dialog and button primitives
+ // themselves, regenerated by `shadcn add` (matches the
+ // no-physical-direction-utility exemption).
+ // - *.test.tsx / *.dom.test.tsx — fixtures aren't rendered chrome, and
+ // a test that renders the demoted shape on purpose is pinning the
+ // regression, not shipping it.
+ "includes": [
+ "packages/app/src/**/*.tsx",
+ "packages/desktop/src/**/*.tsx",
+ "packages/plugin/src/**/*.tsx",
+ "!packages/app/src/components/ui/**",
+ "!**/*.test.tsx",
+ "!**/*.dom.test.tsx",
+ "biome-plugins/__fixtures__/no-demoted-dialog-confirm.fixture.tsx"
+ ],
+ "plugins": ["./biome-plugins/no-demoted-dialog-confirm.grit"]
+ },
{
// Internal developer tooling for the static-string audit. Uses ts-morph's
// untyped node accessors, embeds `${...}` placeholder literals, and a few
diff --git a/docs/src/app/global.css b/docs/src/app/global.css
index 717821fcd..380cad7bd 100644
--- a/docs/src/app/global.css
+++ b/docs/src/app/global.css
@@ -185,7 +185,10 @@
over --slide-bg (#fbf9f4). Solid color so dashed borders + small
squares render cleanly without alpha self-overlap. */
--border: #e4e3e0;
- --primary: oklch(0.6321 0.1983 259.59);
+ /* Tracks the app's light-theme primary. At the previous lightness this
+ failed WCAG 2 AA both as a fill under white label text and as link text
+ on the page background, the same way --slide-accent above does. */
+ --primary: oklch(0.5621 0.1983 259.59);
}
.dark {
diff --git a/docs/src/components/html-preview.test.ts b/docs/src/components/html-preview.test.ts
index eb0976a7e..ac4835683 100644
--- a/docs/src/components/html-preview.test.ts
+++ b/docs/src/components/html-preview.test.ts
@@ -21,6 +21,7 @@
* src` gate is the right home.
*/
+import { PREVIEW_THEME_TOKENS } from '@inkeep/open-knowledge-core';
import { act, createElement } from 'react';
import { createRoot, type Root } from 'react-dom/client';
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
@@ -235,3 +236,99 @@ describe('HtmlPreview space reservation', () => {
expect(firstPaintReserve(BLOCK_A)).toBe(withIframe);
});
});
+
+/**
+ * Token parity with the editor's preview iframe.
+ *
+ * The component's header promises an authored `html preview` block looks the
+ * same in the OK editor and here. The editor injects its tokens from
+ * `PREVIEW_THEME_TOKENS`, generated from `packages/app/src/globals.css` and
+ * drift-tested there; this component hardcodes a hand-maintained copy. The two
+ * drifted silently the first time a light-theme token moved in the app, which
+ * is the failure these tests exist to make loud.
+ *
+ * Read off the rendered `srcDoc` rather than the module constants, because
+ * `srcDoc` is what a reader's iframe actually resolves `var()` against.
+ */
+describe('preview theme tokens track the editor', () => {
+ /** Dark-mode tokens the docs iframe deliberately does not take from the app. */
+ const DARK_OVERRIDES = new Map([
+ // The docs iframe sits on a docs card, not the editor's canvas, so its dark
+ // surfaces are lifted to stay visible against the page behind them.
+ ['--background', 'sits on the docs card surface, not the editor canvas'],
+ ['--card', 'sits on the docs card surface, not the editor canvas'],
+ // Not a notation difference: `/ 0.14` is 14% alpha and `/ 10%` is 10%, so
+ // the docs border is genuinely more opaque. The docs card sits lighter than
+ // the editor canvas, where a white border at the editor's alpha would carry
+ // less separation, which is the only reason the gap holds up. Nobody
+ // recorded the intent when the constant was hand-copied, so treat the value
+ // as load-bearing until someone re-derives it rather than normalizing the
+ // two strings together.
+ ['--border', 'docs card is lighter, so its border runs 14% alpha against the editor 10%'],
+ ]);
+
+ const tokensFrom = (srcDoc: string, selector: RegExp): Map<string, string> => {
+ const block = selector.exec(srcDoc);
+ if (!block) throw new Error(`no token block matching ${selector} in srcDoc`);
+ return new Map(
+ block[1]
+ .split(';')
+ .filter((decl) => decl.startsWith('--'))
+ .map((decl) => {
+ const colon = decl.indexOf(':');
+ return [decl.slice(0, colon), decl.slice(colon + 1)] as const;
+ }),
+ );
+ };
+
+ const renderedTokens = () => {
+ render(BLOCK_A);
+ const iframe = container.querySelector<HTMLIFrameElement>(
+ 'iframe[title="Interactive preview"]',
+ );
+ if (!iframe) throw new Error('component rendered no iframe to read tokens from');
+ const srcDoc = iframe.getAttribute('srcdoc') ?? '';
+ return {
+ light: tokensFrom(srcDoc, /:root\{([^}]*)\}/),
+ dark: tokensFrom(srcDoc, /:root\[data-theme="dark"\]\{([^}]*)\}/),
+ };
+ };
+
+ test('light-theme values match the tokens the editor injects', () => {
+ const { light } = renderedTokens();
+ const shared = PREVIEW_THEME_TOKENS.filter((token) => light.has(token.name));
+
+ expect(shared.length).toBeGreaterThan(0);
+ expect(shared.map((token) => [token.name, light.get(token.name)])).toEqual(
+ shared.map((token) => [token.name, token.light]),
+ );
+ });
+
+ test('dark-theme values match except where the docs surface deliberately differs', () => {
+ const { dark } = renderedTokens();
+ const shared = PREVIEW_THEME_TOKENS.filter(
+ (token) => dark.has(token.name) && !DARK_OVERRIDES.has(token.name),
+ );
+
+ expect(shared.length).toBeGreaterThan(0);
+ expect(shared.map((token) => [token.name, dark.get(token.name)])).toEqual(
+ shared.map((token) => [token.name, token.dark]),
+ );
+ });
+
+ test('every declared dark override is still a real divergence', () => {
+ // Without this the allowlist becomes a place stale exemptions accumulate: an
+ // override that has since converged would keep a real future drift on that
+ // token permanently exempt.
+ const { dark } = renderedTokens();
+
+ for (const [name] of DARK_OVERRIDES) {
+ const token = PREVIEW_THEME_TOKENS.find((candidate) => candidate.name === name);
+ expect(token, `${name} is no longer an injected token`).toBeDefined();
+ expect(
+ dark.get(name),
+ `${name} now matches the editor; drop it from DARK_OVERRIDES`,
+ ).not.toBe(token?.dark);
+ }
+ });
+});
diff --git a/docs/src/components/html-preview.tsx b/docs/src/components/html-preview.tsx
index b62b864d2..92c7a4f28 100644
--- a/docs/src/components/html-preview.tsx
+++ b/docs/src/components/html-preview.tsx
@@ -27,7 +27,7 @@ const BASE =
'*{box-sizing:border-box}html,body{margin:0}body{background:transparent;color:var(--foreground);font-family:system-ui,-apple-system,sans-serif;font-size:14px;line-height:1.5}';
const LIGHT =
- '--background:oklch(1 0 0);--foreground:oklch(0.145 0 0);--card:oklch(1 0 0);--card-foreground:oklch(0.145 0 0);--muted:oklch(0.97 0 0);--muted-foreground:oklch(0.556 0 0);--border:oklch(0.922 0 0);--primary:oklch(0.6321 0.1983 259.59);--accent-soft:#e6efff;--accent-ink:#00245d;--chart-1:oklch(0.62 0.19 259);--chart-2:oklch(0.58 0.14 145);--chart-3:oklch(0.62 0.15 70);--chart-4:oklch(0.55 0.18 290);--chart-5:oklch(0.58 0.21 25);--radius:0.625rem;color-scheme:light';
+ '--background:oklch(1 0 0);--foreground:oklch(0.145 0 0);--card:oklch(1 0 0);--card-foreground:oklch(0.145 0 0);--muted:oklch(0.97 0 0);--muted-foreground:oklch(0.556 0 0);--border:oklch(0.922 0 0);--primary:oklch(0.5621 0.1983 259.59);--accent-soft:#e6efff;--accent-ink:#00245d;--chart-1:oklch(0.62 0.19 259);--chart-2:oklch(0.58 0.14 145);--chart-3:oklch(0.62 0.15 70);--chart-4:oklch(0.55 0.18 290);--chart-5:oklch(0.58 0.21 25);--radius:0.625rem;color-scheme:light';
const DARK =
'--background:oklch(0.205 0 0);--foreground:oklch(0.985 0 0);--card:oklch(0.245 0 0);--card-foreground:oklch(0.985 0 0);--muted:oklch(0.3 0 0);--muted-foreground:oklch(0.708 0 0);--border:oklch(1 0 0 / 0.14);--primary:#69a3ff;--accent-soft:#12233f;--accent-ink:#9ec3ff;--chart-1:oklch(0.72 0.14 259);--chart-2:oklch(0.73 0.13 145);--chart-3:oklch(0.77 0.14 70);--chart-4:oklch(0.72 0.16 290);--chart-5:oklch(0.72 0.2 25);--radius:0.625rem;color-scheme:dark';
diff --git a/packages/app/src/color-themes.generated.css b/packages/app/src/color-themes.generated.css
index 0003f9f6b..1c0afdc4b 100644
--- a/packages/app/src/color-themes.generated.css
+++ b/packages/app/src/color-themes.generated.css
@@ -182,7 +182,7 @@ html[data-color-theme="catppuccin-latte"] {
--card-foreground: #4c4f69;
--popover: #e6e9ef;
--popover-foreground: #4c4f69;
- --primary: #1e66f5;
+ --primary: #1d62ec;
--primary-foreground: #eff1f5;
--secondary: #e6e9ef;
--secondary-foreground: #4c4f69;
@@ -193,44 +193,44 @@ html[data-color-theme="catppuccin-latte"] {
--destructive: #d20f39;
--border: #ccd0da;
--input: #ccd0da;
- --ring: #1e66f5;
+ --ring: #1d62ec;
--selection-soft: #ccd0da;
- --chart-1: #1e66f5;
+ --chart-1: #1d62ec;
--chart-2: #40a02b;
--chart-3: #df8e1d;
--chart-4: #8839ef;
--chart-5: #d20f39;
--sidebar: #e6e9ef;
--sidebar-foreground: #4c4f69;
- --sidebar-primary: #1e66f5;
+ --sidebar-primary: #1d62ec;
--sidebar-primary-foreground: #eff1f5;
--sidebar-accent: #ccd0da;
- --sidebar-accent-foreground: #1e66f5;
+ --sidebar-accent-foreground: #1d62ec;
--sidebar-hover: #ccd0da;
--sidebar-border: #ccd0da;
- --sidebar-ring: #1e66f5;
+ --sidebar-ring: #1d62ec;
--syntax-keyword: #8839ef;
--syntax-tag: #d20f39;
- --syntax-attr: #1e66f5;
+ --syntax-attr: #1d62ec;
--syntax-string: #40a02b;
--syntax-number: #fe640b;
--syntax-atom: #179299;
--syntax-comment: #bcc0cc;
- --syntax-func: #1e66f5;
+ --syntax-func: #1d62ec;
--syntax-var: #d20f39;
--syntax-type: #df8e1d;
--syntax-operator: #4c4f69;
--syntax-meta: #dd7878;
--syntax-bg: #e6e9ef;
- --link-color: #1e66f5;
+ --link-color: #1d62ec;
--broken-link-color: #d20f39;
--lint-warning-color: #df8e1d;
--lint-error-color: #d20f39;
--diff-added: #40a02b;
--diff-removed: #d20f39;
- --callout-note-color: #1e66f5;
- --callout-info-color: #1e66f5;
- --callout-todo-color: #1e66f5;
+ --callout-note-color: #1d62ec;
+ --callout-info-color: #1d62ec;
+ --callout-todo-color: #1d62ec;
--callout-abstract-color: #179299;
--callout-tip-color: #40a02b;
--callout-success-color: #40a02b;
@@ -247,7 +247,7 @@ html[data-color-theme="catppuccin-latte"] {
--ansi-red: #d20f39;
--ansi-green: #40a02b;
--ansi-yellow: #df8e1d;
- --ansi-blue: #1e66f5;
+ --ansi-blue: #1d62ec;
--ansi-magenta: #8839ef;
--ansi-cyan: #179299;
--ansi-white: #4c4f69;
@@ -255,7 +255,7 @@ html[data-color-theme="catppuccin-latte"] {
--ansi-bright-red: #d20f39;
--ansi-bright-green: #40a02b;
--ansi-bright-yellow: #df8e1d;
- --ansi-bright-blue: #1e66f5;
+ --ansi-bright-blue: #1d62ec;
--ansi-bright-magenta: #8839ef;
--ansi-bright-cyan: #179299;
--ansi-bright-white: #7287fd;
@@ -443,7 +443,7 @@ html[data-color-theme="solarized"] {
--card-foreground: #93a1a1;
--popover: #073642;
--popover-foreground: #93a1a1;
- --primary: #268bd2;
+ --primary: #2995e1;
--primary-foreground: #002b36;
--secondary: #073642;
--secondary-foreground: #93a1a1;
@@ -454,44 +454,44 @@ html[data-color-theme="solarized"] {
--destructive: #dc322f;
--border: #586e75;
--input: #586e75;
- --ring: #268bd2;
+ --ring: #2995e1;
--selection-soft: #586e75;
- --chart-1: #268bd2;
+ --chart-1: #2995e1;
--chart-2: #859900;
--chart-3: #b58900;
--chart-4: #6c71c4;
--chart-5: #dc322f;
--sidebar: #073642;
--sidebar-foreground: #93a1a1;
- --sidebar-primary: #268bd2;
+ --sidebar-primary: #2995e1;
--sidebar-primary-foreground: #002b36;
--sidebar-accent: #586e75;
- --sidebar-accent-foreground: #268bd2;
+ --sidebar-accent-foreground: #2995e1;
--sidebar-hover: #586e75;
--sidebar-border: #586e75;
- --sidebar-ring: #268bd2;
+ --sidebar-ring: #2995e1;
--syntax-keyword: #6c71c4;
--syntax-tag: #dc322f;
- --syntax-attr: #268bd2;
+ --syntax-attr: #2995e1;
--syntax-string: #859900;
--syntax-number: #cb4b16;
--syntax-atom: #2aa198;
--syntax-comment: #657b83;
- --syntax-func: #268bd2;
+ --syntax-func: #2995e1;
--syntax-var: #dc322f;
--syntax-type: #b58900;
--syntax-operator: #93a1a1;
--syntax-meta: #d33682;
--syntax-bg: #073642;
- --link-color: #268bd2;
+ --link-color: #2995e1;
--broken-link-color: #dc322f;
--lint-warning-color: #b58900;
--lint-error-color: #dc322f;
--diff-added: #859900;
--diff-removed: #dc322f;
- --callout-note-color: #268bd2;
- --callout-info-color: #268bd2;
- --callout-todo-color: #268bd2;
+ --callout-note-color: #2995e1;
+ --callout-info-color: #2995e1;
+ --callout-todo-color: #2995e1;
--callout-abstract-color: #2aa198;
--callout-tip-color: #859900;
--callout-success-color: #859900;
@@ -508,7 +508,7 @@ html[data-color-theme="solarized"] {
--ansi-red: #dc322f;
--ansi-green: #859900;
--ansi-yellow: #b58900;
- --ansi-blue: #268bd2;
+ --ansi-blue: #2995e1;
--ansi-magenta: #6c71c4;
--ansi-cyan: #2aa198;
--ansi-white: #93a1a1;
@@ -516,7 +516,7 @@ html[data-color-theme="solarized"] {
--ansi-bright-red: #dc322f;
--ansi-bright-green: #859900;
--ansi-bright-yellow: #b58900;
- --ansi-bright-blue: #268bd2;
+ --ansi-bright-blue: #2995e1;
--ansi-bright-magenta: #6c71c4;
--ansi-bright-cyan: #2aa198;
--ansi-bright-white: #fdf6e3;
diff --git a/packages/app/src/components/SkillPluginBundleDialog.dom.test.tsx b/packages/app/src/components/SkillPluginBundleDialog.dom.test.tsx
index f63e91900..b14b052b9 100644
--- a/packages/app/src/components/SkillPluginBundleDialog.dom.test.tsx
+++ b/packages/app/src/components/SkillPluginBundleDialog.dom.test.tsx
@@ -1,6 +1,7 @@
import { cleanup, render, screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { afterEach, describe, expect, test, vi } from 'vitest';
+import { expectVisualClassTokens } from '@/test-utils/visual-contract';
type WindowGlobals = { NodeFilter?: typeof NodeFilter };
type GlobalWithDomShims = typeof globalThis &
@@ -103,4 +104,41 @@ describe('SkillPluginBundleDialog', () => {
expect(onInstalled).toHaveBeenCalledWith(new Map([['alpha', 'alpha']]));
expect(onOpenChange).toHaveBeenCalledWith(false);
});
+
+ test('the install footer weights the confirm above the dismiss', async () => {
+ render(
+ <SkillPluginBundleDialog
+ bundle={{ plugin: 'Example', names: ['alpha', 'beta'] }}
+ source="https://example.com/plugin"
+ defaultScope="project"
+ onInstalled={vi.fn()}
+ onOpenChange={vi.fn()}
+ />,
+ );
+
+ const dialog = screen.getByRole('dialog', { name: 'Install from Example' });
+ // Let the bundle discovery resolve before reading the footer, so the
+ // assertions run against a settled tree rather than the pending one.
+ await within(dialog).findByRole('checkbox', { name: /alpha/i });
+
+ const cancel = within(dialog).getByRole('button', { name: 'Cancel' });
+ const confirm = within(dialog).getByTestId('plugin-bundle-install');
+
+ expect(cancel.getAttribute('data-variant')).toBe('outline');
+ expect(confirm.getAttribute('data-variant')).toBe('default');
+ // Asserted on the merged class list rather than on the authored prop, so
+ // this holds whether the treatment arrives from the variant or from a
+ // hand-added className. The fill tokens are the point of the assertion:
+ // `data-variant` reports the authored prop, but `cn`'s tailwind-merge lets
+ // a hand-added `bg-*` override the variant's fill while `data-variant`
+ // still reads `default`. That is the same hand-added-className shape the
+ // bug this test guards was authored in, so the merged list is the only
+ // place a demotion of that form shows up.
+ expectVisualClassTokens(confirm.className, [
+ 'font-mono',
+ 'uppercase',
+ 'bg-primary',
+ 'text-primary-foreground',
+ ]);
+ });
});
diff --git a/packages/app/src/components/SkillPluginBundleDialog.tsx b/packages/app/src/components/SkillPluginBundleDialog.tsx
index 043964218..7966a7d22 100644
--- a/packages/app/src/components/SkillPluginBundleDialog.tsx
+++ b/packages/app/src/components/SkillPluginBundleDialog.tsx
@@ -376,8 +376,6 @@ function OpenSkillPluginBundleDialog({
<Trans>Cancel</Trans>
</Button>
<Button
- variant="secondary"
- className="font-mono uppercase"
data-testid="plugin-bundle-install"
disabled={busy || selected.size === 0}
onClick={() => void install()}
diff --git a/packages/app/src/components/settings/LintingSection.dom.test.tsx b/packages/app/src/components/settings/LintingSection.dom.test.tsx
index 2dd9113d6..2a41c229f 100644
--- a/packages/app/src/components/settings/LintingSection.dom.test.tsx
+++ b/packages/app/src/components/settings/LintingSection.dom.test.tsx
@@ -16,6 +16,7 @@ import { cleanup, render, screen, waitFor, within } from '@testing-library/react
import userEvent from '@testing-library/user-event';
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
import { TooltipProvider } from '@/components/ui/tooltip';
+import { expectVisualClassTokens } from '@/test-utils/visual-contract';
import { LINT_PLUGIN_META } from './lint-plugin-meta';
import { describedTextOf } from './settings-a11y.test-helper';
@@ -822,6 +823,42 @@ describe('OkfPluginSection', () => {
);
});
+ test('the confirmation footer weights the confirm above the dismiss', async () => {
+ const user = userEvent.setup();
+ const { binding } = makeBinding();
+ mockProjectBinding = binding;
+ mockProjectConfig = configWith({ okf: {} });
+ renderPanel();
+
+ await user.click(await generatedIndexToggle());
+ const dialog = await screen.findByRole('dialog', {
+ name: 'Maintain generated indexes in every folder?',
+ });
+
+ // Select the dismiss by role rather than slot: it is wrapped in
+ // `DialogClose asChild`, so the rendered element carries the close slot
+ // while still emitting the Button's own variant attribute.
+ const cancel = within(dialog).getByRole('button', { name: 'Cancel' });
+ const confirm = within(dialog).getByTestId('settings-okf-generate-index-confirm-accept');
+
+ expect(cancel.getAttribute('data-variant')).toBe('outline');
+ expect(confirm.getAttribute('data-variant')).toBe('default');
+ // Asserted on the merged class list rather than on the authored prop, so
+ // this holds whether the treatment arrives from the variant or from a
+ // hand-added className. The fill tokens are the point of the assertion:
+ // `data-variant` reports the authored prop, but `cn`'s tailwind-merge lets
+ // a hand-added `bg-*` override the variant's fill while `data-variant`
+ // still reads `default`. That is the same hand-added-className shape the
+ // bug this test guards was authored in, so the merged list is the only
+ // place a demotion of that form shows up.
+ expectVisualClassTokens(confirm.className, [
+ 'font-mono',
+ 'uppercase',
+ 'bg-primary',
+ 'text-primary-foreground',
+ ]);
+ });
+
test('declining the confirmation leaves generation off and writes nothing', async () => {
const user = userEvent.setup();
const { binding, calls } = makeBinding();
diff --git a/packages/app/src/components/settings/LintingSection.tsx b/packages/app/src/components/settings/LintingSection.tsx
index 655387453..59bca1170 100644
--- a/packages/app/src/components/settings/LintingSection.tsx
+++ b/packages/app/src/components/settings/LintingSection.tsx
@@ -799,8 +799,6 @@ export function OkfPluginSection() {
</Button>
</DialogClose>
<Button
- variant="secondary"
- className="font-mono uppercase"
onClick={() => void confirmGenerateIndex()}
disabled={generatedIndexSettings.pending}
data-testid="settings-okf-generate-index-confirm-accept"
diff --git a/packages/app/src/globals.css b/packages/app/src/globals.css
index a9949b65a..ce4057052 100644
--- a/packages/app/src/globals.css
+++ b/packages/app/src/globals.css
@@ -3100,7 +3100,15 @@ button:active:not(:disabled) {
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
- --primary: oklch(0.6321 0.1983 259.59);
+ /* Lightness is pinned by the WCAG 2 AA floor, not by taste: this token is
+ both a fill under --primary-foreground (Button variant="default") and a
+ text color on --background (Button variant="link"). At L 0.6321 it read
+ 3.41:1 against the fill's foreground and 3.56:1 as link text, so both
+ surfaces failed the 4.5:1 requirement for normal-weight body text. L
+ 0.5621 is the first step that clears it on both (4.56:1 and 4.76:1) while
+ holding chroma and hue, so the blue is the same blue, just deeper. Do not
+ lighten without re-measuring both pairs. */
+ --primary: oklch(0.5621 0.1983 259.59);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
@@ -3182,7 +3190,14 @@ button:active:not(:disabled) {
--syntax-bg: oklch(0.97 0 0);
/* Editor affordances a theme repaints. */
- --link-color: var(--color-azure-blue);
+ /* Every document link paints this token, so it is normal-weight body text
+ and owes the WCAG 2 AA 4.5:1 floor. `--color-azure-blue` (#3784ff) reads
+ 3.56:1 on --background and cannot be used here. It stays the palette
+ entry for SVG fills, strokes and selection color-mix, where no text
+ contrast requirement applies, so the fix is this declaration rather than
+ the palette entry. `--color-azure-600` is the next step up the same ramp
+ at 5.2:1. Do not point this back at --color-azure-blue. */
+ --link-color: var(--color-azure-600);
--broken-link-color: oklch(55% 0.15 25);
--lint-warning-color: oklch(70% 0.15 75);
--lint-error-color: oklch(55% 0.15 25);
diff --git a/packages/app/tests/a11y/component-blocks.e2e.ts b/packages/app/tests/a11y/component-blocks.e2e.ts
index 9a7ed93e6..f5889a279 100644
--- a/packages/app/tests/a11y/component-blocks.e2e.ts
+++ b/packages/app/tests/a11y/component-blocks.e2e.ts
@@ -330,23 +330,20 @@ test('A11Y09: Wildcard block chrome has accessible name', async ({ page, api })
// ── A11Y10: Zero axe-core violations on fixture document ───────
//
// Notes on scope:
-// - `color-contrast` is disabled here because axe flags a pre-existing
-// WCAG 2 AA violation on the default light-theme link color (`#3784ff`,
-// measured contrast 3.55 vs the 4.5 requirement). The violation lives
-// in the design-system's light-theme link token, NOT in any surface
-// this PR introduces. Fixing the token is the right action, but it's
-// a cross-surface change (impacts every anchor in the product, not
-// just editor-embedded ones) that belongs in a dedicated design-
-// system PR. Disabling the rule here keeps the fuller axe matrix
-// (keyboard, ARIA roles, form labels, landmarks, link purpose, …)
-// actively enforced on this PR's surface so regressions surface.
+// - `color-contrast` runs. It was disabled for a long stretch because the
+// light-theme `--link-color` token, which every document link paints,
+// failed WCAG 2 AA at 3.56:1, a design-system fault rather than anything
+// this fixture renders. That token now resolves to `--color-azure-600`
+// at 5.2:1, and `--primary`, which paints `Button variant="link"`, was
+// raised alongside it to 4.76:1, so the rule is back on. The fixture
+// carries a link specifically so the rule covers the link token rather
+// than passing vacuously on it: this is the only axe surface in the
+// suite that renders one. If it reds on a link, re-measure
+// `--link-color` in `globals.css` before touching the fixture.
// - `aria-allowed-attr` is NOT disabled: the wrapper's `role="group"`
// intentionally omits `aria-selected` (see precedent #36) and axe
// agrees, so the rule passes.
-test('A11Y10: Zero axe-core violations on 5-pack fixture (excluding color-contrast)', async ({
- page,
- api,
-}) => {
+test('A11Y10: Zero axe-core violations on 5-pack fixture', async ({ page, api }) => {
// Build a realistic document with the 5-pack.
const content = [
'# 5-Pack Accessibility Test',
@@ -379,7 +376,11 @@ test('A11Y10: Zero axe-core violations on 5-pack fixture (excluding color-contra
'',
'<audio src="/sample.mp3" />',
'',
- 'Some paragraph with normal text.',
+ // The link is load-bearing, not decoration: it is the only element in
+ // this fixture painted with `--link-color`, so it is what makes the
+ // re-enabled `color-contrast` rule actually cover the document-link
+ // token. Without it the rule passes vacuously on that token.
+ 'Some paragraph with normal text and [a link to the docs](https://example.com/docs).',
].join('\n');
await setupDoc(page, api, content);
@@ -391,7 +392,6 @@ test('A11Y10: Zero axe-core violations on 5-pack fixture (excluding color-contra
// Run axe-core against the editor surface. Runner chrome (sidebar, header)
// is shared with other surfaces and not this suite's responsibility.
- // `disableRules(['color-contrast'])` is explained in the test header.
// axe-core's keyboard / aria / form-label / landmark / link-purpose rules
// already enforce tabindex correctness and accessible names on every
// rendered element — the previously-here structural for-loops were
@@ -399,10 +399,28 @@ test('A11Y10: Zero axe-core violations on 5-pack fixture (excluding color-contra
// interactive elements. axe-core's `violations: []`
// expectation is the load-bearing assertion; keeping the loops added
// failure-shape redundancy without coverage gain.
+ // Pin the link-token coverage rather than asserting it in a comment: if the
+ // link stops rendering, `color-contrast` goes back to passing vacuously on
+ // `--link-color` and nothing else in the suite would notice. OK paints
+ // document links as a `role="link"` span, not an anchor, so `a[href]` would
+ // silently match nothing.
+ const link = page.locator('.ProseMirror').first().locator('[data-link][role="link"]');
+ await expect(link).toHaveCount(1);
+ // The fixture is seeded through the agent-write API, so every inserted range
+ // carries the 1.4s insert-flash wash. Measuring under it reports the wash
+ // tint as the background rather than the page background, which both
+ // understates real contrast and varies run to run with where in the
+ // animation the scan lands. Wait for the decoration sweep so axe sees the
+ // steady reading state.
+ await expect(page.locator('.ok-agent-insert-flash')).toHaveCount(0, { timeout: 5_000 });
+ // `color-contrast` resolves a background by hit-testing the element's center
+ // point, so it silently skips anything below the fold. Without this scroll
+ // the link paints `--link-color` and axe still never measures it.
+ await link.scrollIntoViewIfNeeded();
+
const axeResults = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
.include('.ProseMirror')
- .disableRules(['color-contrast'])
.analyze();
expect(axeResults.violations).toEqual([]);
});
diff --git a/packages/app/tests/lint-plugins/no-demoted-dialog-confirm.test.ts b/packages/app/tests/lint-plugins/no-demoted-dialog-confirm.test.ts
new file mode 100644
index 000000000..742c1757b
--- /dev/null
+++ b/packages/app/tests/lint-plugins/no-demoted-dialog-confirm.test.ts
@@ -0,0 +1,85 @@
+/**
+ * no-demoted-dialog-confirm — Biome GritQL plugin fixture test.
+ *
+ * Plugin: `biome-plugins/no-demoted-dialog-confirm.grit`
+ * Fixture: `biome-plugins/__fixtures__/no-demoted-dialog-confirm.fixture.tsx`
+ *
+ * Per precedent #42 (custom Biome enforcement is GritQL plugins). Forbids a
+ * dialog footer whose confirm sits on `secondary`, whose near-invisible fill
+ * loses the emphasis contest with the `outline` dismiss standing beside it.
+ * `ghost`, `link` and `link-muted` are flat at rest too but are not plausible
+ * footer confirms; the plugin header records why the pattern stays narrow.
+ *
+ * The fixture pairs 3 positive cases (the reported shape, the same inversion
+ * with the dismiss wrapped in `DialogClose asChild`, and the
+ * `AlertDialogFooter` sibling) with 4 negative cases (the canonical
+ * variant-omitted confirm, a `destructive` confirm, a `secondary` button
+ * outside any footer, and an inline-suppressed tertiary control).
+ * Exact-equality (`toBe(3)`) catches both false-negative regressions (a
+ * weakened pattern drops below 3) and false-positive widenings (a negative
+ * starts firing, rising above 3).
+ */
+
+import { spawnSync } from 'node:child_process';
+import { join } from 'node:path';
+import { describe, expect, test } from 'vitest';
+import { readBiomeConfig } from '../../../../test-support/read-biome-config.test-helper';
+
+// __dirname → packages/app/tests/lint-plugins/. Repo root is 4 levels up.
+const REPO_ROOT = join(__dirname, '..', '..', '..', '..');
+const FIXTURE_REL = 'biome-plugins/__fixtures__/no-demoted-dialog-confirm.fixture.tsx';
+const PLUGIN_REL = './biome-plugins/no-demoted-dialog-confirm.grit';
+
+describe('no-demoted-dialog-confirm GritQL plugin', () => {
+ test('fires on exactly 3 demoted dialog footers (and on no negative case)', () => {
+ const result = spawnSync('pnpm', ['exec', 'biome', 'check', FIXTURE_REL], {
+ cwd: REPO_ROOT,
+ encoding: 'utf-8',
+ });
+ // Surface a spawn failure explicitly: without this, `status` is null on a
+ // `pnpm exec` spawn error and the `not.toBe(0)` below passes vacuously,
+ // masking the failure as "0 diagnostics".
+ expect(result.error).toBeUndefined();
+ // biome check exits non-zero when any diagnostic (incl. plugin) fires.
+ expect(result.status).not.toBe(0);
+ const output = `${result.stdout}\n${result.stderr}`;
+ const fires = (output.match(/Demoted confirm in a dialog footer/g) ?? []).length;
+ expect(fires).toBe(3);
+ // Diagnostic message names the fix (action verb-phrase substring).
+ expect(output).toContain('Drop the variant prop');
+ // Diagnostic message appends a docs URL — generic URL regex + anchor
+ // substring. The anchor check keeps the regex from being vacuously
+ // satisfied by an unrelated URL biome might surface elsewhere.
+ expect(output).toMatch(/https?:\/\/[^\s]+/);
+ expect(output).toContain('biome-plugins/README.md#no-demoted-dialog-confirmgrit');
+ });
+
+ test('plugin is registered as an override scoped to product chrome (not workspace-wide)', () => {
+ const config = readBiomeConfig(REPO_ROOT);
+ // NOT at root plugins[] — a workspace-wide promotion would fire on the
+ // shadcn primitives and on tests that render the demoted shape on purpose.
+ const rootPlugins: string[] = config.plugins ?? [];
+ expect(rootPlugins).not.toContain(PLUGIN_REL);
+
+ const overrides: Array<{ includes?: string[]; plugins?: string[] }> = config.overrides ?? [];
+ const entry = overrides.find((o) => (o.plugins ?? []).includes(PLUGIN_REL));
+ expect(entry).toBeDefined();
+ const includes = entry?.includes ?? [];
+ // The fixture must be in scope so the firing test above can trigger the rule.
+ expect(includes).toContain(FIXTURE_REL);
+ // App, desktop, and plugin chrome are the surfaces the rule exists for — a
+ // dropped glob would silently stop covering dialogs in that tree.
+ expect(includes).toContain('packages/app/src/**/*.tsx');
+ expect(includes).toContain('packages/desktop/src/**/*.tsx');
+ expect(includes).toContain('packages/plugin/src/**/*.tsx');
+ // Assert the negative set so a removed exclusion is caught here rather
+ // than only by a red lint run.
+ for (const excluded of [
+ '!packages/app/src/components/ui/**',
+ '!**/*.test.tsx',
+ '!**/*.dom.test.tsx',
+ ]) {
+ expect(includes).toContain(excluded);
+ }
+ });
+});
diff --git a/packages/core/scripts/generate-preview-theme-tokens.ts b/packages/core/scripts/generate-preview-theme-tokens.ts
index 38906a5a1..11e8d8cca 100644
--- a/packages/core/scripts/generate-preview-theme-tokens.ts
+++ b/packages/core/scripts/generate-preview-theme-tokens.ts
@@ -3,7 +3,7 @@
* preview token subset from `packages/app/src/globals.css`, resolves `var()`
* indirections, and writes the constants module verbatim. Run via:
*
- * bun run packages/core/scripts/generate-preview-theme-tokens.ts
+ * pnpm exec tsx packages/core/scripts/generate-preview-theme-tokens.ts
*
* After running, diff the output — landing it should only flip values when a
* listed token in `globals.css` actually moved. The drift test in
diff --git a/packages/core/scripts/preview-theme-token-resolver.ts b/packages/core/scripts/preview-theme-token-resolver.ts
index e6602e8c1..21ef6f28c 100644
--- a/packages/core/scripts/preview-theme-token-resolver.ts
+++ b/packages/core/scripts/preview-theme-token-resolver.ts
@@ -180,7 +180,7 @@ export function renderPreviewThemeTokensModule(tokens: ResolvedPreviewToken[]):
* GENERATED FILE — do not hand-edit. Regenerate after changing any listed
* token in \`packages/app/src/globals.css\`:
*
- * bun run packages/core/scripts/generate-preview-theme-tokens.ts
+ * pnpm exec tsx packages/core/scripts/generate-preview-theme-tokens.ts
*
* Drift between this file and the CSS is caught by
* \`preview-theme-tokens.test.ts\` (re-resolves from globals.css).
diff --git a/packages/core/src/constants/preview-theme-tokens.ts b/packages/core/src/constants/preview-theme-tokens.ts
index bd31c12ff..bd9085408 100644
--- a/packages/core/src/constants/preview-theme-tokens.ts
+++ b/packages/core/src/constants/preview-theme-tokens.ts
@@ -7,7 +7,7 @@
* GENERATED FILE — do not hand-edit. Regenerate after changing any listed
* token in `packages/app/src/globals.css`:
*
- * bun run packages/core/scripts/generate-preview-theme-tokens.ts
+ * pnpm exec tsx packages/core/scripts/generate-preview-theme-tokens.ts
*
* Drift between this file and the CSS is caught by
* `preview-theme-tokens.test.ts` (re-resolves from globals.css).
@@ -28,7 +28,7 @@ export const PREVIEW_THEME_TOKENS: readonly PreviewThemeToken[] = [
{ name: '--chart-3', light: 'oklch(0.62 0.15 70)', dark: 'oklch(0.77 0.14 70)' },
{ name: '--chart-4', light: 'oklch(0.55 0.18 290)', dark: 'oklch(0.72 0.16 290)' },
{ name: '--chart-5', light: 'oklch(0.58 0.21 25)', dark: 'oklch(0.72 0.2 25)' },
- { name: '--primary', light: 'oklch(0.6321 0.1983 259.59)', dark: '#69a3ff' },
+ { name: '--primary', light: 'oklch(0.5621 0.1983 259.59)', dark: '#69a3ff' },
{ name: '--primary-foreground', light: 'oklch(0.985 0 0)', dark: 'oklch(0.205 0 0)' },
{ name: '--foreground', light: 'oklch(0.145 0 0)', dark: 'oklch(0.985 0 0)' },
{ name: '--background', light: 'oklch(1 0 0)', dark: 'oklch(0.145 0 0)' },
diff --git a/packages/core/src/theme/theme-plugins.ts b/packages/core/src/theme/theme-plugins.ts
index 0a62ae96f..255bc6640 100644
--- a/packages/core/src/theme/theme-plugins.ts
+++ b/packages/core/src/theme/theme-plugins.ts
@@ -114,7 +114,11 @@ const CATPPUCCIN_LATTE: Base16Scheme = {
base0A: '#df8e1d',
base0B: '#40a02b',
base0C: '#179299',
- base0D: '#1e66f5',
+ // Upstream Catppuccin Latte blue is #1e66f5, which lands at 4.35:1 against
+ // base00. That is below the WCAG 2 AA 4.5:1 floor both as a `--primary` fill
+ // under `--primary-foreground` and as link text on the page background.
+ // Darkened 3.6% to clear the floor. Keep any future palette resync above 4.5:1.
+ base0D: '#1d62ec',
base0E: '#8839ef',
base0F: '#dd7878',
},
@@ -186,7 +190,14 @@ const SOLARIZED: Base16Scheme = {
base0A: '#b58900',
base0B: '#859900',
base0C: '#2aa198',
- base0D: '#268bd2',
+ // Upstream Solarized blue is #268bd2, which lands at 4.08:1 against base00.
+ // That is below the WCAG 2 AA 4.5:1 floor both as a `--primary` fill under
+ // `--primary-foreground` and as link text on the page background. base00
+ // fills both roles (label on the button, background on the page), and this
+ // is a dark scheme, so base00 is near-black either way: raising base0D's
+ // luminance widens the gap on both surfaces. Lightened 7% to clear the
+ // floor. Keep any future palette resync above 4.5:1.
+ base0D: '#2995e1',
base0E: '#6c71c4',
base0F: '#d33682',
},