From ed804a14e9f3e2a4df8e1e7906ad066a94b484a8 Mon Sep 17 00:00:00 2001 From: Pavel Date: Sun, 27 Sep 2026 16:17:59 +0400 Subject: [PATCH 1/7] Cards standartization --- frontend/DESIGN.md | 81 +++-- frontend/eslint.config.js | 5 + frontend/eslint/card-surfaces.d.ts | 4 + frontend/eslint/card-surfaces.js | 36 +++ frontend/src/agents/NewAgent.test.tsx | 45 ++- frontend/src/agents/NewAgent.tsx | 56 ++-- frontend/src/agents/SharedAgentCard.test.tsx | 22 ++ frontend/src/agents/SharedAgentCard.tsx | 2 +- .../components/GuardrailsSection.test.tsx | 7 +- .../agents/components/GuardrailsSection.tsx | 18 +- .../src/agents/schedules/SchedulesView.tsx | 289 +++++++++--------- frontend/src/components/Chunks.test.tsx | 13 + frontend/src/components/Chunks.tsx | 27 +- frontend/src/components/SkeletonLoader.tsx | 29 +- frontend/src/components/ui/card.test.tsx | 10 + frontend/src/components/ui/card.tsx | 19 +- frontend/src/design/DesignSystem.tsx | 18 +- frontend/src/design/cardSurfaces.lint.test.ts | 85 ++++++ frontend/src/settings/Teams.tsx | 2 + 19 files changed, 535 insertions(+), 233 deletions(-) create mode 100644 frontend/eslint/card-surfaces.d.ts create mode 100644 frontend/eslint/card-surfaces.js create mode 100644 frontend/src/agents/SharedAgentCard.test.tsx create mode 100644 frontend/src/design/cardSurfaces.lint.test.ts diff --git a/frontend/DESIGN.md b/frontend/DESIGN.md index 3584eab5..f45d45b1 100644 --- a/frontend/DESIGN.md +++ b/frontend/DESIGN.md @@ -91,6 +91,8 @@ One tint scale, by purpose: - Neutral hover: solid `bg-accent` in both themes (ghost buttons, combobox, SelectTrigger, Card `interactive`, Dropzone, every list-row highlight). - Quiet panel inside a page or card: `bg-muted`, not `bg-muted/40` or `/60`. + It is a small box inside a panel (a well, a guardrail stage), never a + page-sized panel around cards (see Card surfaces). - Dividers: `border-border`, not `border-border/60`. Patterns: @@ -242,10 +244,11 @@ rounded-3xl`) are `variant="sidebar-item"`: left-aligned, full-radius, normal justify-start` and `aria-expanded`: a lucide `ChevronRight` first (`rotate-90` while open) in primary, then the foreground title, with a primary underline on hover. The button draws no focus ring; the panel does, - so keyboard focus outlines the whole white block: - `has-[[data-variant=section-toggle]:focus-visible]:ring-3 …:ring-ring/50 -…:ring-inset` on the panel `
` (inset, because a scrolling column clips - an outset ring). Status badges go beside the button, not inside it, or the + so keyboard focus outlines the whole panel. The panel is a `Card` (a place, + `subtle lg`), and every Card carries that ring + (`has-[[data-variant=section-toggle]:focus-visible]:ring-3 … ring-inset`, + inset because a scrolling column clips an outset ring), so pages pass + nothing for it. Status badges go beside the button, not inside it, or the hover underline runs under them. - Drop `text-white` on default and destructive buttons; the foreground token already provides it. Drop `disabled:cursor-not-allowed` on buttons; the @@ -267,28 +270,68 @@ justify-start` and `aria-expanded`: a lucide `ChevronRight` first ### Card (`ui/card.tsx`) -| Prop | Values | -| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `variant` | `outline` (border + card surface, the default), `filled` (muted fill, no border, for tiles on a card-coloured page), `subtle` (border on the page background) | -| `tone` | `default`, `destructive` (the status soft fill and border, `border-destructive/50 bg-destructive/10`, over any variant) | -| `padding` | `none`, `sm` (p-3, row boxes and code blocks), `default` (p-4), `lg` (p-6, tiles, chart panels and stat tiles) | -| `interactive` | whole card is the target: hover, focus ring and `selected` highlight; pair with `asChild` around a `