feat(web): merge Usage route into Stats as tab (UC-3) #268
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!268
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/264"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Tabscontrol to/statswith three panels: Tasks (former stats content), Quota (former/usagecontent), Cost caps (placeholder for #231)?tab=tasks|quota|caps(defaulttasks);validateSearchdrops malformed valuesrounded-pill+aria-selected:*Tailwind variants for accent styling — no raw hexStatsQuotaPanelfrom formerUsageRoutebody intocomponents/stats/quota-panel.tsx/usageroute with a redirect to/stats?tab=quota(search params preserved)Usagenav entry from both desktop and mobile nav arrays inapp-shell.tsxTests
validateSearchdefaults/accepts/rejects tab values (3 cases)navigatewithreplace: trueNAV_ITEMSno longer contains a Usage entry/app/usageredirects to/app/stats?tab=quotawith threshold banner visibleTest plan
bun run test— 201 tests passbun run typecheck— cleanbun run lint— clean/app/stats→ Tasks tab active by default?tab=quota, usage-hero visible/app/usage→ redirected to/app/stats?tab=quotaCloses #264
🤖 Generated with Claude Code
Review: APPROVED ✅
CI green (run #1943, 4m23s). All acceptance criteria from issue #264 are met.
AC walkthrough
?tab=tasks|quota|capsURL param;validateSearchdrops malformed valuesrounded-pill,border-accent,aria-selected:*) — no raw hex/usage→ redirect to/stats?tab=quotawith existing search params preservedUsageRoutebody extracted toStatsQuotaPanelUsageentry removed from bothNAV_ITEMSandBOTTOM_TAB_ITEMSvalidateSearch3 casesnavigate({ replace: true })/app/usage→/app/stats?tab=quota,usage-herovisibleCode correctness notes
handleTabChangecorrectly guardsif (!newTab) returnbefore callingvoid navigate(...)— Base UI passesnullon deselect.usage.tsxusesthrow redirect(...)inbeforeLoad— idiomatic TanStack Router redirect form, preserves existing search params via{ ...search, tab: "quota" }.quota-panel.tsx(data.totals.tasks === 0) matches the originalUsageRoutebehaviour.Minor nit (non-blocking)
apps/web/src/components/app-shell.tsx— the JSDoc comment aboveBOTTOM_TAB_ITEMSstill lists "Stats, Usage" in its prose description. Usage is gone. The accompanying Vitest guard (NAV_ITEMSdoes not contain a Usage entry) prevents regression; the comment is just stale. Fine to fix in a follow-up.