diff --git a/packages/webui/src/components/pages/logs-page.tsx b/packages/webui/src/components/pages/logs-page.tsx index 03e0e1f0..f3e91a62 100644 --- a/packages/webui/src/components/pages/logs-page.tsx +++ b/packages/webui/src/components/pages/logs-page.tsx @@ -13,13 +13,17 @@ import { useApi } from '@/lib/api'; import { useTheme } from '@/contexts/ThemeContext'; import { useLayout } from '@/contexts/LayoutContext'; +// Dedicated log-level text tokens (see index.css): the app accent colors are +// too light as small text on the light canvas (WCAG AA fails), so these hit +// >=4.5:1 in light mode while keeping the bright values in dark. trace stays the +// faintest level (dimmer than debug) but at /90 it now also clears AA. const levelClass: Record = { - trace: 'text-muted-foreground/60', + trace: 'text-muted-foreground/90', debug: 'text-muted-foreground', - info: 'text-primary', - success: 'text-success', - warn: 'text-warning', - error: 'text-destructive', + info: 'text-log-info', + success: 'text-log-success', + warn: 'text-log-warn', + error: 'text-log-error', }; const LEVELS: LogLevel[] = ['trace', 'debug', 'info', 'success', 'warn', 'error']; diff --git a/packages/webui/src/components/pages/overview-page.tsx b/packages/webui/src/components/pages/overview-page.tsx index 023af6a0..766691b6 100644 --- a/packages/webui/src/components/pages/overview-page.tsx +++ b/packages/webui/src/components/pages/overview-page.tsx @@ -889,13 +889,16 @@ function AccountWidget({ config }: { config: AccountConfig }) { // ─────────────── recent alerts ─────────────── +// Same WCAG-tuned log-level text tokens as the logs page (see index.css / the +// levelClass note there): the raw accent colors fail AA as small text on the +// light canvas. const ALERT_LEVEL_CLASS: Record = { - trace: 'text-muted-foreground/60', + trace: 'text-muted-foreground/90', debug: 'text-muted-foreground', - info: 'text-primary', - success: 'text-success', - warn: 'text-warning', - error: 'text-destructive', + info: 'text-log-info', + success: 'text-log-success', + warn: 'text-log-warn', + error: 'text-log-error', }; function RecentAlertsCard({ config }: { config: AlertsConfig }) { diff --git a/packages/webui/src/index.css b/packages/webui/src/index.css index b8860998..b67b6885 100644 --- a/packages/webui/src/index.css +++ b/packages/webui/src/index.css @@ -37,6 +37,16 @@ --success: oklch(70% 0.15 160); --warning: oklch(78% 0.16 80); + /* Log-level TEXT colors. The accent tokens above are tuned as fills (white + text on them passes AA); as small text on the light canvas they fail WCAG + AA (info 2.6:1, success 2.4:1, warn 2.0:1, error 4.3:1). These darker + variants restore >=4.5:1 for the log viewer without darkening the app-wide + accent. Dark theme keeps the bright values (they already pass on dark). */ + --log-info: oklch(50% 0.155 230); + --log-success: oklch(50% 0.15 160); + --log-warn: oklch(52% 0.16 80); + --log-error: oklch(55% 0.22 27); + --border: oklch(92% 0.01 240); --input: oklch(94% 0.012 240); --ring: oklch(68.5% 0.155 230); @@ -79,6 +89,13 @@ --success: oklch(72% 0.15 160); --warning: oklch(80% 0.16 80); + /* On the dark canvas the bright accents already clear AA as text, so the + log-level text tokens mirror them (see the :root note above). */ + --log-info: oklch(75% 0.14 230); + --log-success: oklch(72% 0.15 160); + --log-warn: oklch(80% 0.16 80); + --log-error: oklch(62% 0.2 27); + --border: oklch(28% 0.02 250); --input: oklch(26% 0.02 250); --ring: oklch(75% 0.14 230); @@ -112,6 +129,10 @@ --color-destructive-foreground: var(--destructive-foreground); --color-success: var(--success); --color-warning: var(--warning); + --color-log-info: var(--log-info); + --color-log-success: var(--log-success); + --color-log-warn: var(--log-warn); + --color-log-error: var(--log-error); --color-border: var(--border); --color-input: var(--input); --color-ring: var(--ring);