Prometheus Design System

Action Items

18 PR-style tasks. Priority and effort are set during extraction; refine as needed when triaging.

High priority 2

p1-high medium AI-002 Promote Health Status Badge to every boolean-state field inconsistency component accessibility INC-002 Open issue

Wrap every UP/DOWN/Successful/Failed/Ready field in <HealthBadge>. Today /status renders 'Configuration Reload: Successful' as plain black text so failure and success look identical at a glance.

Before

<td>Successful</td>

After

<td><HealthBadge value="Successful" /></td>
Files
  • web/ui/components/HealthBadge.tsx
  • web/ui/pages/Status.tsx
p1-high medium AI-003 Replace bare <code> with Label Badge on /tsdb-status and /flags inconsistency component INC-003 Open issue

Label names on /tsdb-status and flag names on /flags render as bare <code>, while the same concept renders as a pill Label Badge on /targets. Unify on the pill form.

Before

<code>__name__</code>

After

<LabelBadge>__name__</LabelBadge>
Files
  • web/ui/pages/TSDBStatus.tsx
  • web/ui/pages/Flags.tsx

Medium priority 7

p2-medium easy AI-001 Drop duplicate body on empty-state Alerts inconsistency component INC-001 Open issue

Today the empty-state Alert on /alerts, /rules, and both /alertmanager-discovery cards renders the same string twice (title + body). Delete the body prop or replace it with actionable setup guidance.

Before

<Alert title="No rules found">No rules found.</Alert>

After

<Alert title="No alerting rules found">Configure alert rules in prometheus.yml under the <code>rule_files</code> key.</Alert>
Files
  • web/ui/pages/Alerts.tsx
  • web/ui/pages/Rules.tsx
  • web/ui/pages/AlertmanagerDiscovery.tsx
p2-medium medium AI-004 Make every Table sortable by default inconsistency component accessibility INC-004 Open issue

Flip the Table wrapper default to sortable. Keep an opt-out for cases where source-order matters (Build/Runtime KV tables).

Before

<Table>…</Table>

After

<Table sortable>…</Table>   // now the default
Files
  • web/ui/components/Table.tsx
p2-medium easy AI-005 Unify Card title treatment — always icon + text inconsistency component INC-005 Open issue

Four stacked TSDB cards plus the title-less Flags card and Card-less Config section break the page-chrome pattern established on /status and /alertmanager-discovery. Add <CardTitle icon=… /> to each and wrap Flags + Config in Card.

Before

<Card><h3>TSDB Head Status</h3>…</Card>

After

<Card><CardTitle icon={IconDatabase}>TSDB Head Status</CardTitle>…</Card>
Files
  • web/ui/pages/TSDBStatus.tsx
  • web/ui/pages/Flags.tsx
  • web/ui/pages/Config.tsx
p2-medium easy AI-008 Define --font-family-mono and apply everywhere inconsistency tokens INC-008 Open issue

pre and code currently resolve to the bare 'monospace' keyword — falls back to Courier on most OSes. Introduce a single CSS custom property with a modern stack and point every pre/code at it.

Before

pre, code { font-family: monospace; }

After

--font-family-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
pre, code { font-family: var(--font-family-mono); }
Files
  • web/ui/styles/theme.css
  • web/ui/styles/global.css
p2-medium easy AI-011 Add focus-visible outline to Icon Buttons in the header accessibility component Open issue

Header Icon Buttons inherit the default Mantine focus ring (faint on the slate header). Promote to a 2px brand-blue outline for keyboard users.

Before

.mantine-ActionIcon-root:focus-visible { outline: 1px solid rgba(34,139,230,0.5); }

After

.mantine-ActionIcon-root:focus-visible { outline: 2px solid rgb(34,139,230); outline-offset: 2px; }
Files
  • web/ui/styles/theme.css
p2-medium medium AI-013 Responsive review — header collapses below 768px responsive component Open issue

The header nav buttons and utility icons crowd on tablet widths. Introduce a burger at <768px that collapses the nav into a drawer; keep theme toggle visible.

Before

<header><nav>…all buttons…</nav><tools>…</tools></header>

After

<header><button class="burger">☰</button><tools>…</tools></header>  /* sidebar drawer at <768px */
Files
  • web/ui/components/Header.tsx
  • web/ui/styles/responsive.css
p2-medium easy AI-015 Add aria-sort to Sortable Table headers accessibility component Open issue

/flags sortable headers currently lack aria-sort. Screen readers announce them as plain columns.

Before

<th onClick={sort}>Flag</th>

After

<th aria-sort={order} onClick={sort}>Flag</th>
Files
  • web/ui/components/Table.tsx

Low priority 9

p3-low easy AI-006 Stabilize highlight.js role-to-color across themes inconsistency tokens INC-006 Open issue

YAML keys render green in light and blue in dark; strings do the opposite. Pick a stable hue per role (keys=green, strings=blue) and vary only luminance between themes.

Before

[data-theme="dark"] .hljs-attr { color: rgb(165,216,255); } /* blue */

After

[data-theme="dark"] .hljs-attr { color: var(--doc-syntax-key-dark); } /* green family */
Files
  • web/ui/styles/hljs-theme.css
p3-low easy AI-007 Parameterize empty-state copy per rule type inconsistency component documentation INC-007 Open issue

'No rules found' is ambiguous when two different rule types share the string. Say 'No alerting rules found' on /alerts and 'No recording rules found' on /rules.

Before

<EmptyState title="No rules found" />

After

<EmptyState ruleType="alerting" />
Files
  • web/ui/components/EmptyState.tsx
  • web/ui/pages/Alerts.tsx
  • web/ui/pages/Rules.tsx
p3-low easy AI-009 Fix Stats Badge uppercase mismatch inconsistency component INC-009 Open issue

Root .mantine-Badge-root resolves to text-transform:uppercase but the inner .mantine-Badge-label overrides to none. Intent mismatches output — set text-transform:none at the root for the stats variant.

Before

<Badge variant="default">573ms</Badge>  /* root: uppercase, label: none */

After

<StatsBadge>573ms</StatsBadge>  /* root: none — matches intent */
Files
  • web/ui/components/StatsBadge.tsx
p3-low easy AI-010 Add Copy Button to the Flags table component accessibility Open issue

Flag names and values are among the most-copied strings in the UI but /flags has no Copy Button — users hand-select cells. Mirror the /config Copy Button on each row.

Before

<td><code>--config.file</code></td>

After

<td><code>--config.file</code> <CopyButton value="--config.file" /></td>
Files
  • web/ui/pages/Flags.tsx
p3-low medium AI-012 Tokenize hardcoded spacing in page layouts tokens refactor Open issue

Several page files use literal `16px`, `24px`, `8px 16px` in inline styles. Replace with the named scale (lg, xl, sm) or the layout semantics (card-padding, header-height).

Before

<div style={{ padding: '16px', marginTop: '24px' }}>

After

<div style={{ padding: 'var(--spacing-lg)', marginTop: 'var(--spacing-xl)' }}>
Files
  • web/ui/pages/Query.tsx
  • web/ui/pages/Targets.tsx
  • web/ui/pages/Status.tsx
p3-low easy AI-014 Deprecate Card Title without Icon component refactor INC-005 Open issue

Mark the variant deprecated, route call-sites through Card Title with Icon. Covered by AI-005 for /tsdb-status; this issue tracks the component-level deprecation.

Before

export const CardTitle = ({children}) => …

After

export const CardTitle = ({icon, children}) => { if (!icon) console.warn('CardTitle: icon is required'); … }
Files
  • web/ui/components/CardTitle.tsx
p3-low easy AI-016 Add :hover underline to Link component accessibility component Open issue

Link renders without underline — fine for color-sighted users, fails for users who rely on non-color affordances. Underline on :hover and :focus.

Before

a { color: rgb(34,139,230); text-decoration: none; }

After

a { color: rgb(34,139,230); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
Files
  • web/ui/styles/theme.css
p3-low medium AI-017 Document the tokens.json → CSS variable mapping documentation Open issue

Tokens exist in Mantine theme but are not published as a single CSS custom-property file. Emit tokens.css from tokens.json and ship it on the docs site for copy-paste consumption.

Files
  • scripts/tokens-to-css.py
  • web/ui/styles/tokens.css
p3-low easy AI-018 Introduce --doc-status-warn for pending states tokens Open issue

Status scale covers ok/error/info but no 'warn' — once Alertmanager 'pending' state surfaces, there's no token ready. Add yellow-family ok-adjacent.

Before

status: [ok, error, info]

After

status: [ok, warn, error, info]
Files
  • tokens.json
  • web/ui/styles/theme.css