Skip to content

refactor(frontend): migrate Monitoring view to design-system tokens (#554) - #595

Merged
vybe merged 1 commit into
devfrom
feature/554-sweep-monitoring
Apr 30, 2026
Merged

refactor(frontend): migrate Monitoring view to design-system tokens (#554)#595
vybe merged 1 commit into
devfrom
feature/554-sweep-monitoring

Conversation

@oleksandr-korin

Copy link
Copy Markdown
Contributor

Summary

Slice 2 of the #554 sweep. Migrates the `/monitoring` (Health tab) view from raw status colors to the semantic tokens introduced in #67 / #555. Visual output unchanged.

What got migrated

Element Before After
"Monitoring Active" badge `bg-green-100/text-green-700` `status-success-*`
Healthy / Degraded / Unhealthy / Critical summary cards `green-500` / `yellow-500` / `red-500` / `red-700` borders + text `status-success` / `status-warning` / `status-danger-500` / `status-danger-700`
Active alerts banner `bg-red-50`, `text-red-800` `status-danger-*`
Per-alert urgent vs non-urgent icon `text-red-600` / `text-yellow-600` `status-danger-600` / `status-warning-600`
"N issues" count `text-red-600` `status-danger-600`
`getStatusBgClass` / `getStatusTextClass` / `getStatusBadgeClass` (all 5 statuses + critical extra-emphasis) mixed green/yellow/red shades mapped to status-* tokens

26 token replacements, all 1:1 palette aliases. Net diff: 26 ins / 26 del in `Monitoring.vue`.

Deferred (10 raw blue refs remain)

Same I2 caveat as #569 — these need their own token decision before mass migration:

  • "Auto-refresh" toggle button (selected-state highlight) — needs `action-primary` or `state-selected`
  • "Check All" admin primary action button
  • Per-row "trigger health check" hover/focus styling

Tests

  • Adds `/monitoring` smoke spec to `e2e/smoke.spec.js` — total grows from 5 to 6 tests.
  • ✅ `npm run check:tokens` passes (10 tokens equivalent; all references resolve)
  • ✅ `npm run build` succeeds

Visual regression — deferred

The PR description originally proposed adding visual regression baselines (`monitoring.visual.spec.js` with `toHaveScreenshot()`). Removed for this PR because:

  • Playwright PNG baselines are platform-specific. macOS-rendered text vs Linux CI runner = pixel diff = false-fail.
  • Setting up cross-platform baseline capture is its own infrastructure decision (capture in CI via `--update-snapshots` and commit, or use Playwright's Docker image locally).

I'll file a follow-up issue for the visual regression infrastructure work — it's the natural next step once a few more sweep slices land and the pattern is dialed.

Test plan

  • CI `frontend-build` passes (token validator + build)
  • CI `frontend-e2e` passes (`ui` label is set; runs full smoke incl. new `/monitoring` test)
  • Visual smoke at http://localhost/monitoring — colors should look identical to before

Refs #554

🤖 Generated with Claude Code

…554)

Slice 2 of the #554 sweep. Migrates the /monitoring view (Health tab)
from raw status colors to semantic tokens.

Migrations (all clear status semantics):
  - Service-active badge (green)
  - 5 summary cards: healthy / degraded / unhealthy / critical (extra)
  - Active alerts banner background and heading
  - Per-alert priority icon (urgent vs warning)
  - "N issues" count for unhealthy agents
  - getStatusBgClass / getStatusTextClass / getStatusBadgeClass — all 5
    statuses route through status-success / status-warning / status-danger
    (with 200/700 shades for the "critical" emphasis tier)

Deferred (10 raw blue refs remain):
  - "Auto-refresh" toggle button — selected-state highlight, needs an
    `action-primary` or `state-selected` token (per #554 caveat)
  - "Check All" admin primary action button
  - Per-row "trigger health check" hover/focus styling

These are the same categories deferred in #569 (operator queue slice 1).
A future PR can introduce `action-*` tokens to cover them across the
whole codebase.

Tests:
  - Adds /monitoring smoke spec to e2e/smoke.spec.js (5 → 6 tests)

Visual regression baselines for /monitoring will land in a follow-up PR
once the cross-platform snapshot capture path is in place (Linux runner
font rendering ≠ macOS, so locally captured PNGs would always fail in CI).

Refs #554

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@oleksandr-korin oleksandr-korin added the ui PR touches the frontend UI — triggers Playwright e2e tests label Apr 29, 2026

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validation passed. Clean 1:1 token migration, all security checks clear, smoke test added. LGTM.

@vybe
vybe merged commit 9a4655c into dev Apr 30, 2026
3 checks passed
vybe pushed a commit that referenced this pull request Apr 30, 2026
/#556)

  /api-keys page (top-level route). 19 status-color refs migrated:
    - Active / Revoked badges and indicators        → status-success / status-danger
    - Revoke / Delete buttons                       → status-warning / status-danger
    - "Connect to MCP Server" info banner           → status-info (banner + icon + code blocks)
    - "Copy before closing" warning banner          → status-warning
    - Success-state checkmarks (modal, copy button) → status-success
    - "Agent" scope tag                             → accent-purple

  Deferred:
    - Indigo primary action buttons ("Create API Key", "Create", "I've copied")
      — same `action-primary` token gap as #569 / #595
    - "System" scope tag (orange) — needs accent-orange (or brand-system)
      token; out of scope for status-only sweep

Adds a tag-and-grep model so the suite can grow without coupling local-dev
needs to CI runtime cost.

  Tag       Runs in CI?  Purpose
  ─────────────────────────────────────────────────────────────────
  @smoke    yes          Cross-page health, must always pass
  @visual   no (local)   Screenshot baselines, deferred until #596
  @Interactive no (local) Multi-step flows, local-only until stable

  Changes:
    - smoke.spec.js — every test now starts with @smoke
    - new spec: @smoke api keys page loads
    - package.json — adds `npm run test:e2e:smoke` (--grep @smoke)
    - frontend-e2e.yml — CI now runs the smoke subset only
    - e2e/README.md — tag convention documented

  Local default (`npm run test:e2e`) still runs everything; CI now matches
  what `npm run test:e2e:smoke` runs locally.

Refs #554 #556

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
vybe pushed a commit that referenced this pull request Apr 30, 2026
/#556) (#597)

/api-keys page (top-level route). 19 status-color refs migrated:
    - Active / Revoked badges and indicators        → status-success / status-danger
    - Revoke / Delete buttons                       → status-warning / status-danger
    - "Connect to MCP Server" info banner           → status-info (banner + icon + code blocks)
    - "Copy before closing" warning banner          → status-warning
    - Success-state checkmarks (modal, copy button) → status-success
    - "Agent" scope tag                             → accent-purple

  Deferred:
    - Indigo primary action buttons ("Create API Key", "Create", "I've copied")
      — same `action-primary` token gap as #569 / #595
    - "System" scope tag (orange) — needs accent-orange (or brand-system)
      token; out of scope for status-only sweep

Adds a tag-and-grep model so the suite can grow without coupling local-dev
needs to CI runtime cost.

  Tag       Runs in CI?  Purpose
  ─────────────────────────────────────────────────────────────────
  @smoke    yes          Cross-page health, must always pass
  @visual   no (local)   Screenshot baselines, deferred until #596
  @Interactive no (local) Multi-step flows, local-only until stable

  Changes:
    - smoke.spec.js — every test now starts with @smoke
    - new spec: @smoke api keys page loads
    - package.json — adds `npm run test:e2e:smoke` (--grep @smoke)
    - frontend-e2e.yml — CI now runs the smoke subset only
    - e2e/README.md — tag convention documented

  Local default (`npm run test:e2e`) still runs everything; CI now matches
  what `npm run test:e2e:smoke` runs locally.

Refs #554 #556

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants