From d6d1c78bd91d139c981ea4db5713cddcac8366e8 Mon Sep 17 00:00:00 2001 From: Maggie Appleton <5599295+MaggieAppleton@users.noreply.github.com> Date: Thu, 24 Sep 2026 15:39:16 +0100 Subject: [PATCH 1/2] Document shared visual adoption --- apps/web/src/design-audit/adoption.tsx | 27 ++++++++ apps/web/src/design-audit/frame.test.tsx | 24 ++++++++ apps/web/src/design-audit/frame.tsx | 6 +- apps/web/src/design-audit/icons.tsx | 10 +-- apps/web/src/design-audit/inventory.ts | 6 ++ apps/web/src/design-audit/page.test.tsx | 30 +++++++++ apps/web/src/design-audit/page.tsx | 2 + apps/web/src/design-audit/specimens.test.tsx | 3 +- apps/web/src/design-audit/styles.css | 65 ++++++++++++++++---- 9 files changed, 147 insertions(+), 26 deletions(-) create mode 100644 apps/web/src/design-audit/adoption.tsx diff --git a/apps/web/src/design-audit/adoption.tsx b/apps/web/src/design-audit/adoption.tsx new file mode 100644 index 00000000..db34e038 --- /dev/null +++ b/apps/web/src/design-audit/adoption.tsx @@ -0,0 +1,27 @@ +import { AuditPlate } from "./frame"; + +export function Adoption() { + return ( + +
+
+

Shared foundation

+

Tokens, icons, and presentation primitives come from @chopin/visuals.

+
+
+

Adopted shared controls

+
    +
  • + Select + Design audit field only +
  • +
+
+
+
+ ); +} diff --git a/apps/web/src/design-audit/frame.test.tsx b/apps/web/src/design-audit/frame.test.tsx index 104167d3..119bcb79 100644 --- a/apps/web/src/design-audit/frame.test.tsx +++ b/apps/web/src/design-audit/frame.test.tsx @@ -38,4 +38,28 @@ describe("design audit specimen framing", () => { } } }); + + it("places source provenance after the specimen description", () => { + let markup = renderToStaticMarkup( + createElement(AuditPlate, { + description: "Shared action hierarchy", + item: "buttons", + title: "Primary button", + }), + ); + + expect(markup.indexOf("Shared action hierarchy")).toBeLessThan( + markup.indexOf("apps/web/src/theme.css"), + ); + }); + + it("styles state labels as quiet metadata rather than pills", async () => { + let css = await Bun.file(new URL("./styles.css", import.meta.url)).text(); + let rule = css.match(/\.design-audit-state\s*\{([^}]*)\}/)?.[1] ?? ""; + + expect(rule).toContain("color: var(--color-text-quaternary)"); + expect(rule).not.toContain("background:"); + expect(rule).not.toContain("border-radius:"); + expect(rule).not.toContain("padding-inline:"); + }); }); diff --git a/apps/web/src/design-audit/frame.tsx b/apps/web/src/design-audit/frame.tsx index a0c5757a..0e209ed5 100644 --- a/apps/web/src/design-audit/frame.tsx +++ b/apps/web/src/design-audit/frame.tsx @@ -72,11 +72,9 @@ export function AuditPlate( return (
-
-

{title}

- {source ? {source} : null} -
+

{title}

{description ?

{description}

: null} + {source ? {source} : null}
{children}
diff --git a/apps/web/src/design-audit/icons.tsx b/apps/web/src/design-audit/icons.tsx index d8799ae4..0975983a 100644 --- a/apps/web/src/design-audit/icons.tsx +++ b/apps/web/src/design-audit/icons.tsx @@ -32,7 +32,6 @@ import type { ComponentType } from "react"; type IconCatalogueItem = { className?: string; - duplicate?: string; icon?: ComponentType; name: string; source?: string; @@ -41,11 +40,7 @@ type IconCatalogueItem = { const NUCLEO_ICONS: readonly IconCatalogueItem[] = [ { name: "Add project", source: addProject }, { name: "Chopin", source: chopin }, - { - duplicate: "collapse.svg and chat-close.svg consolidated", - name: "Panel close", - source: panelClose, - }, + { name: "Panel close", source: panelClose }, { name: "Document actions", source: documentActions }, { name: "New document", source: newDocument }, { name: "Chat", source: chat }, @@ -84,7 +79,7 @@ export function IconCatalogue() {

Nucleo icons

- {NUCLEO_ICONS.map(({ className, duplicate, icon: Glyph, name, source }) => ( + {NUCLEO_ICONS.map(({ className, icon: Glyph, name, source }) => (
{source ? : null} @@ -92,7 +87,6 @@ export function IconCatalogue() {
{name} - {duplicate ? Consolidated exact duplicate: {duplicate} : null}
))} diff --git a/apps/web/src/design-audit/inventory.ts b/apps/web/src/design-audit/inventory.ts index 7f8a41ab..18187258 100644 --- a/apps/web/src/design-audit/inventory.ts +++ b/apps/web/src/design-audit/inventory.ts @@ -21,6 +21,12 @@ export const AUDIT_INVENTORY: readonly AuditGroup[] = [ id: "foundations", label: "Foundations", items: [ + { + id: "shared-adoption", + label: "One foundation, gradual adoption", + source: "apps/web/src/design-audit/adoption.tsx", + states: ["shared-foundation", "audit-field-select"], + }, { id: "colours", label: "Colour roles", diff --git a/apps/web/src/design-audit/page.test.tsx b/apps/web/src/design-audit/page.test.tsx index 986e4283..612093d2 100644 --- a/apps/web/src/design-audit/page.test.tsx +++ b/apps/web/src/design-audit/page.test.tsx @@ -2,6 +2,7 @@ import { describe, expect, it } from "bun:test"; import { createElement } from "react"; import { renderToStaticMarkup } from "react-dom/server"; +import { AUDIT_INVENTORY } from "./inventory"; import { DesignAuditPage } from "./page"; describe("design audit page", () => { @@ -18,4 +19,33 @@ describe("design audit page", () => { expect(markup).toContain(`id="${id}"`); } }); + + it("documents one shared foundation with only the audit field Select adopted", () => { + let markup = renderToStaticMarkup(createElement(DesignAuditPage)); + let adoptedControls = markup.match( + /