feat(069-B1): Dashboard Overview↔Usage switcher + usage API client#570
Merged
Conversation
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
Deploying mcpproxy-docs with
|
| 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 |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 26795664989 --repo smart-mcp-proxy/mcpproxy-go
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/usageendpoint (#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. NewUsageAggregateResponse+UsageToolStat/UsageOtherBucket/UsageTimeBuckettypes mirror the contract exactly.views/Dashboard.vue) — tabbed switcher rendered withv-show(neverv-if) so the Overview subtree stays mounted and its state survives a switch-back (SC-006).Verification
activity-usage.spec.ts(client param forwarding) anddashboard-usage-switcher.spec.ts(default tab, lazy fetch,v-showstate preservation, window refetch, no-refetch-on-switch-back) — written failing first, then implemented.npx vitest run→ 91 passed ·vue-tsc --noEmit→ clean ·make build→ green (frontend embedded).window=24hthenwindow=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.vuecharts and the full Playwright sweep.Related #745