Forums Bug Reports Thread

/admin/ai hardcodes dark status colors (#b91c1c / #15803d / #b45309) that fail on c64 + other themes

Patrick Bass · Jun 6 · 10 · 1 Locked
[Minor] [Normal Priority] [Bug Fixed] [Always Reproduces]
🚀 OP Jun 6, 2026 7:18pm

Area: mobieusAI (audit p11) · Surface: /admin/ai status pills, badges, 'errors today' line, and Test-key JS result · Dimension: Law 3 contrast · Severity: minor

The mobieusAI admin page paints its connection/master/error states with hardcoded web-safe dark red/green/amber instead of the theme's semantic danger/success/warning tokens. On the c64 theme (and to a lesser degree the CRT themes) these dark text colors land on a mid-dark card background with poor contrast, so the 'Missing key' / 'OFF' / 'errors today' signals — exactly the states an admin must notice — are the hardest to read.

Evidence

platform/templates/admin/ai/index.php:118-120 `.ai-pill--ok{...color:#15803d} .ai-pill--warn{...color:#b45309} .ai-pill--err{...color:#b91c1c}` and badges at 147-148 use the same. Line 511 inlines `<span style="color:#b91c1c;">· errors today</span>`. The Test-key JS overwrites the result color directly: line 647-651 `testRes.style.color = '#15803d'` (valid) / `'#b91c1c'` (fail), and line 644 `testRes.style.color = '#5b6477'`. These sit on `--color-bg-card`, which the c64 theme sets to `#3535a8` (a mid blue-purple — style.css:9906) and which defines `--color-danger:#ff7070` / `--color-success:#70ff70` precisely because dark `#b91c1c` red and `#15803d` green do not read on that background. Dark red on `#3535a8` is a near-isoluminant dark-on-dark pairing.

Suggested fix. Swap the hardcoded hex for tokens: pill/badge text → `var(--color-success)` / `var(--color-warning)` / `var(--color-danger)`; the 'errors today' span and the Test-key JS results → the same tokens (read them via getComputedStyle or set classes instead of `.style.color`). The themes already define accessible danger/success/warning values per theme.

Filed by the automated tenant-app audit and adversarially evidence-verified. Status: verified. Open — not yet actioned.


Patrick Bass
@mobieus

🚀 Jun 7, 2026 5:44am

Resolved — fixed and deployed. Commit 059d6bf29b6f, shipped dev-first then to all tenants on 2026-06-06.

Replaced hardcoded status hex with semantic tokens: .ai-pill--ok/warn/err/muted and .ai-badge--ok/warn/muted now use var(--color-success/--color-warning/--color-danger/--color-text-muted). The 'errors today' inline style:color:#b91c1c became class .ai-card__usage--errors bound to --color-danger. The Test-key JS now toggles .ai-cfg-test-result--pending/ok/err classes (bound to tokens) instead of writing .style.color hex. php -l passes.

Status: fixed. Thread closed and locked.


Patrick Bass
@mobieus

Log in or register to reply to this thread.