Skip to content

feat(ui): clickable KPI cards on Activity / Servers / Agent Tokens (#436) - #442

Merged
Dumbris merged 1 commit into
mainfrom
feat/clickable-kpi-cards
Apr 30, 2026
Merged

Dumbris merged 1 commit into
mainfrom
feat/clickable-kpi-cards

Conversation

@Dumbris

@Dumbris Dumbris commented Apr 30, 2026

Copy link
Copy Markdown
Member

Summary

Closes #436. KPI cards on three pages were passive — the count would change but you couldn't click them. Jason filed the issue saying "It was the first thing I tried but nothing happened." Bundling all three (and matching the same affordance) is more consistent than fixing one and leaving the others awkward.

Each card now drives the matching filter:

Page Card Filter
Activity Total (24h) filterStatus = ''
Success 'success'
Errors 'error'
Blocked 'blocked'
Servers Total Servers filter = 'all'
Connected 'connected'
Quarantined 'quarantined'
Total Tools — (no matching list-state, intentionally non-clickable)
Agent Tokens Total Tokens tokenFilter = 'all'
Active 'active'
Expired / Revoked 'expired'

Clicking an already-active non-Total card toggles the filter off; Total always resets to all. Active card has bg-base-200 + ring-2 ring-inset ring-primary/40; all clickable cards have cursor-pointer + hover:bg-base-200/60.

Each card carries a stable data-test="kpi-card-<state>" and proper aria-pressed for accessibility / future Playwright tests.

Notes

  • Servers + Activity drive existing filter state (no behaviour change for users who use the filter row / dropdown directly).
  • Agent Tokens had no filter at all; adds a tokenFilter ref + filteredTokens computed, plus a "no tokens match this filter — Show all" empty state.
  • Secrets was deferred (its KPIs aren't mutually-exclusive states of one list — see brainstorm in [Feature] Filter activity log by type #436 follow-up).
  • Generated frontend/src/types/contracts.ts regen from make frontend-build was reverted (unrelated IsolationDefaults regression — not part of this PR).

Test plan

End-to-end verified via the Chrome extension MCP against a live mcpproxy serve on port 18083:

  • Servers (3 servers, 1 quarantined): clicking Quarantined toggles the existing Quarantined (1) filter button to btn-primary; clicking Connected highlights kpi-connected; clicking Connected again resets to Total.
  • Agent Tokens (2 active + 1 revoked): baseline 3 rows → click Active → 2 rows (2 Active badges, 0 Revoked) → click Expired → 1 row (1 Revoked, 0 Active) → click Total → 3 rows.
  • Activity (1 system_start success): click Success → status select="success", "Status: success" badge appears; click Errors → "Status: error"; click Errors again → toggles off.
  • vue-tsc --noEmit clean.
  • npm run build clean.

🤖 Generated with Claude Code

KPI summary cards on three pages were passive — the count would change
but the cards weren't clickable, so users (Jason in #436) tried clicking
them as their first instinct and "nothing happened."

Each card now drives the matching filter:

  Activity page (filterStatus):
    Total (24h)        → ''        (all)
    Success            → 'success'
    Errors             → 'error'
    Blocked            → 'blocked'

  Servers page (filter):
    Total Servers      → 'all'
    Connected          → 'connected'
    Quarantined        → 'quarantined'
    Total Tools        → no filter (intentionally non-clickable, no
                         matching list-state to drive)

  Agent Tokens page (tokenFilter, new):
    Total Tokens       → 'all'
    Active             → 'active'
    Expired / Revoked  → 'expired'

Implementation:
- Clickable cards rendered as <button> with type="button", aria-pressed
  bound to the active state, data-test attribute for stable selection.
- Active card shows bg-base-200 + ring-2 ring-inset ring-primary/40 +
  cursor-pointer + hover:bg-base-200/60 (consistent across all three pages).
- Clicking the already-active card toggles back to 'all' / '' (clearing
  the filter); clicking 'Total' always resets.
- Servers + Activity drive existing filter state; AgentTokens introduces
  a new tokenFilter ref and filteredTokens computed (the page previously
  had no filter, so it also gets a "no tokens match this filter" empty
  state with a 'Show all' shortcut).

Verified end-to-end via the Chrome extension MCP against a live
mcpproxy serve on port 18083:

  Servers (3 servers, 1 quarantined):
    click Quarantined  → kpi-quarantined.aria-pressed=true,
                         filter button "Quarantined (1)" goes btn-primary,
                         all other filter buttons go btn-outline
    click Connected    → kpi-connected.aria-pressed=true
    click Connected ×2 → toggles back to Total/all

  Agent Tokens (2 active + 1 revoked):
    baseline           → 3 rows visible
    click Active       → 2 rows, 0 'Revoked' badges, 2 'Active' badges
    click Expired      → 1 row, 1 'Revoked' badge, 0 'Active' badges
    click Total        → 3 rows

  Activity (1 system_start success):
    click Success      → kpi-success highlighted, status select='success',
                         "Status: success" badge appears in the Active
                         filters chip row
    click Errors       → status select='error', badge shows "Status: error"
    click Errors ×2    → toggles off, no Status badge

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: b506041
Status: ✅  Deploy successful!
Preview URL: https://690f4901.mcpproxy-docs.pages.dev
Branch Preview URL: https://feat-clickable-kpi-cards.mcpproxy-docs.pages.dev

View logs

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: feat/clickable-kpi-cards

Available Artifacts

  • archive-darwin-amd64 (26 MB)
  • archive-darwin-arm64 (23 MB)
  • archive-linux-amd64 (15 MB)
  • archive-linux-arm64 (13 MB)
  • archive-windows-amd64 (26 MB)
  • archive-windows-arm64 (23 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (19 MB)
  • installer-dmg-darwin-arm64 (18 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 25180152922 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris
Dumbris merged commit f9c8d0e into main Apr 30, 2026
24 checks passed
Dumbris added a commit that referenced this pull request May 2, 2026
…#445)

The release-notes generator (scripts/generate-release-notes.sh) feeds
commit subjects to Claude with no edition context, and Claude has been
inventing edition annotations from thin air:

- v0.29.0: "*Note: The onboarding improvements primarily affect the
  **Personal Edition** desktop application.*"
- v0.29.1: "**Personal Edition (macOS)**" header
- v0.29.2: "*Note: All changes in this release apply to the Teams
  edition only.*" — wrong, all three PRs (#442, #443, #444) modify
  shared code (internal/runtime/, frontend/) and ship in both editions

This patch updates the prompt to:

1. Briefly explain the two-edition build model so the model doesn't have
   to guess from training data.
2. Forbid edition-only annotations unless a commit subject explicitly
   says so (e.g. contains "(server)", "(teams)", "server-only").
3. Forbid speculation from subject keywords (ui/runtime/oauth/etc).
4. Use "Server edition", not "Teams edition" — Teams is an internal
   package name.
5. Default to BOTH editions when unsure.

The v0.29.2 release body has been hand-corrected separately.

Co-authored-by: Claude Code <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Filter activity log by type

2 participants