From b2886c2f2bcf73d28e4f25495aff50d7845eae1d Mon Sep 17 00:00:00 2001 From: Piotr Oleszczyk Date: Fri, 6 Mar 2026 16:25:47 +0100 Subject: [PATCH] refactor(frontend): align observability panels with editorial design system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace hardcoded gray-* colors with design system tokens: - border-gray-200 → border-muted - bg-gray-50 → bg-muted/30 - text-gray-600/700 → text-muted-foreground/foreground - hover:bg-gray-100 → hover:bg-muted/50 Updated components: - MetadataDebugPanel: now matches Card aesthetic - ReasoningChainViewer: now uses warm editorial tones Benefits: - Consistent with existing reasoning/summary cards - Matches warm editorial aesthetic (hsl(42...) palette) - DRY: reuses design system tokens - Documented collapsible panel pattern in cookbook This fixes the cool gray panels that looked out of place among the warm beige editorial UI. --- docs/frontend-design-cookbook.md | 23 ++++++++++++++- .../lib/components/MetadataDebugPanel.svelte | 28 +++++++++---------- .../components/ReasoningChainViewer.svelte | 16 +++++------ 3 files changed, 44 insertions(+), 23 deletions(-) diff --git a/docs/frontend-design-cookbook.md b/docs/frontend-design-cookbook.md index 5dc1f00..ef98dba 100644 --- a/docs/frontend-design-cookbook.md +++ b/docs/frontend-design-cookbook.md @@ -83,7 +83,28 @@ Use these wrappers before introducing route-specific structure: - `editorial-panel`: primary surface for forms, tables, and ledgers. - `editorial-toolbar`: compact action row under hero copy. - `editorial-backlink`: standard top-left back navigation style. -- `editorial-alert`, `editorial-alert--error`, `editorial-alert--success`: feedback banners. +- `editorial-alert`, `editorial-alert--error`, `editorial-alert--success`, `editorial-alert--warning`, `editorial-alert--info`: feedback banners. + +### Collapsible panels + +For secondary information (debug data, reasoning chains, metadata), use this pattern: + +```svelte +
+ + {#if expanded} +
+ +
+ {/if} +
+``` + +This matches the warm editorial aesthetic and maintains visual consistency with Card components. ## Component rules diff --git a/frontend/src/lib/components/MetadataDebugPanel.svelte b/frontend/src/lib/components/MetadataDebugPanel.svelte index 22f035d..35d6e6a 100644 --- a/frontend/src/lib/components/MetadataDebugPanel.svelte +++ b/frontend/src/lib/components/MetadataDebugPanel.svelte @@ -16,37 +16,37 @@ {#if metadata} -
+
{#if expanded} -
+
-
Model
-
{metadata.model_used}
+
Model
+
{metadata.model_used}
-
Duration
-
{formatNumber(metadata.duration_ms)} ms
+
Duration
+
{formatNumber(metadata.duration_ms)} ms
{#if metadata.token_metrics}
-
Token Usage
-
+
Token Usage
+
Prompt:
{/if} -
+
Total: {formatNumber(metadata.token_metrics.total_tokens)} {#if reasoningChain} -
+
{#if expanded} -
+
{reasoningChain}
+ class="text-xs font-mono whitespace-pre-wrap text-muted-foreground leading-relaxed">{reasoningChain}
{/if}