Skip to content

feat(069-B1): Dashboard Overview↔Usage switcher + usage API client#570

Merged
Dumbris merged 1 commit into
mainfrom
069-b1-usage-switcher
Jun 2, 2026
Merged

feat(069-B1): Dashboard Overview↔Usage switcher + usage API client#570
Dumbris merged 1 commit into
mainfrom
069-b1-usage-switcher

Conversation

@Dumbris
Copy link
Copy Markdown
Member

@Dumbris Dumbris commented Jun 2, 2026

Spec 069 Stream B1 (T016–T017) — Frontend/Vue

Adds the Overview↔Usage switcher to the dashboard plus the typed API client for the A3 GET /api/v1/activity/usage endpoint (#565). Lane: frontend/src/ only.

What's here

  • getActivityUsage(params) (services/api.ts) — forwards only the supplied filters (window/server/tool/status/top/sort); unset params omitted so the daemon applies its documented defaults. New UsageAggregateResponse + UsageToolStat/UsageOtherBucket/UsageTimeBucket types mirror the contract exactly.
  • Overview↔Usage switcher (views/Dashboard.vue) — tabbed switcher rendered with v-show (never v-if) so the Overview subtree stays mounted and its state survives a switch-back (SC-006).
  • Usage panel — 24h/7d/all window selector, tokens-saved headline (FR-007), loading/error/empty states (FR-009 / SC-007), and a baseline per-tool rollup table. The rich charts (CallHistogram, ResponseSizeRanking, ErrorRateChart, Timeline) arrive in B2 (T018–T022).
  • Lazy load — the aggregate is fetched on first Usage activation and on window change only, so the Overview first paint is never blocked (SC-004).

Verification

  • TDD: activity-usage.spec.ts (client param forwarding) and dashboard-usage-switcher.spec.ts (default tab, lazy fetch, v-show state preservation, window refetch, no-refetch-on-switch-back) — written failing first, then implemented.
  • npx vitest run91 passed · vue-tsc --noEmit → clean · make build → green (frontend embedded).
  • Live Playwright smoke against a fresh binary: tabs render, lazy fetch hits window=24h then window=7d, Overview stays in DOM while hidden, empty-state renders, zero console errors. Endpoint returns the exact contract shape for empty data (200, tools:[], timeline:[]).

Scope note: B1 is the switcher + API client only; B2 (T018–T023) composes Usage.vue charts and the full Playwright sweep.

Related #745

Spec 069 Stream B1 (T016–T017). Adds the Overview↔Usage switcher to the
dashboard and the typed client for the A3 GET /api/v1/activity/usage
endpoint (#565).

- api: getActivityUsage(params) forwards only supplied filters
  (window/server/tool/status/top/sort); UsageAggregateResponse +
  UsageToolStat/UsageOtherBucket/UsageTimeBucket types mirror the contract.
- Dashboard: tabbed Overview↔Usage switcher rendered with v-show (never
  v-if) so Overview state survives a switch-back (SC-006). Usage panel has
  a 24h/7d/all window selector, tokens-saved headline (FR-007),
  loading/error/empty states (FR-009) and a baseline per-tool rollup table;
  the rich charts arrive in B2 (T018–T022).
- Lazy load: the aggregate is fetched on first Usage activation and on
  window change only, so the Overview first paint is never blocked (SC-004).
- Tests (TDD): activity-usage.spec (client param forwarding) +
  dashboard-usage-switcher.spec (default tab, lazy fetch, v-show preserve,
  window refetch). All 91 frontend unit tests green; vue-tsc clean.

Related #745
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 446adef
Status: ✅  Deploy successful!
Preview URL: https://e2b0edea.mcpproxy-docs.pages.dev
Branch Preview URL: https://069-b1-usage-switcher.mcpproxy-docs.pages.dev

View logs

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

📦 Build Artifacts

Workflow Run: View Run
Branch: 069-b1-usage-switcher

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (25 MB)
  • archive-linux-amd64 (16 MB)
  • archive-linux-arm64 (14 MB)
  • archive-windows-amd64 (27 MB)
  • archive-windows-arm64 (24 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (21 MB)
  • installer-dmg-darwin-arm64 (19 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 26795664989 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris Dumbris merged commit c2f1f9d into main Jun 2, 2026
38 checks passed
@Dumbris Dumbris deleted the 069-b1-usage-switcher branch June 2, 2026 06:46
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.

2 participants