Admin dashboard cleanup + shadcn-style CSS refresh #29

Merged
claude-bot merged 1 commit from feature/admin-dashboard-cleanup into main 2026-03-03 21:12:32 -07:00
Owner

Summary

  • Remove 4 stale metric cards (Input/Output Tokens, Premium/Free API Cost) from Overview tab — no longer useful for single-service app
  • Replace inline CSS with shadcn-inspired design system: CSS variables (slate palette), light header with tab nav, 1px-border cards, muted table headers, pill badges
  • Keep get_overview_stats() and JSON API unchanged for backward compatibility

Test plan

  • ruff check admin_dashboard.py passes
  • Visit /admin/ — Overview shows 7 stat cards + 3 cost cards
  • All 5 tabs render correctly with new styling
  • /admin/api/overview JSON API still returns all fields
  • Mobile responsive layout works

🤖 Generated with Claude Code

## Summary - Remove 4 stale metric cards (Input/Output Tokens, Premium/Free API Cost) from Overview tab — no longer useful for single-service app - Replace inline CSS with shadcn-inspired design system: CSS variables (slate palette), light header with tab nav, 1px-border cards, muted table headers, pill badges - Keep `get_overview_stats()` and JSON API unchanged for backward compatibility ## Test plan - [ ] `ruff check admin_dashboard.py` passes - [ ] Visit `/admin/` — Overview shows 7 stat cards + 3 cost cards - [ ] All 5 tabs render correctly with new styling - [ ] `/admin/api/overview` JSON API still returns all fields - [ ] Mobile responsive layout works 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Clean up admin dashboard: remove stale metrics, apply shadcn-style CSS
All checks were successful
Auto PR Review / review (push) Successful in 1m37s
a1917c2dd5
Remove Input/Output Tokens and Premium/Free API Cost cards from Overview
that are no longer useful for a single-service app. Replace inline CSS
with shadcn-inspired design system using CSS variables, light header with
tab navigation, bordered cards, muted table headers, and pill badges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator

Approved

This is a clean UI/CSS refactoring of the admin dashboard. The changes modernize the styling by introducing CSS custom properties (shadcn-style design tokens), update the visual design (pill badges, underline-style nav, border-based cards instead of shadows), and remove redundant granular metric cards (input/output tokens, premium/free cost breakdowns) while keeping the totals. No bugs, security issues, or performance problems found.

Suggestions

  • admin_dashboard.py: The removed stats keys total_input_tokens and total_output_tokens are still being computed in get_overview_stats() (lines ~167-168) and fetched via SQL (lines ~151-152), but are no longer displayed in any template and aren't used in any calculations. Consider removing those SQL columns and dict assignments to avoid unnecessary computation, or keep them intentionally since the /api/overview JSON endpoint still exposes them.
  • admin_dashboard.py: Similarly, premium_cost_usd and free_cost_usd are removed from the template display but still computed. Unlike the token keys, premium_cost_usd is actively used to calculate premium_profit_loss (line ~221), so it must stay. free_cost_usd could be cleaned up if not needed by API consumers.
  • admin_dashboard.py: Minor: the header-top wrapper div around <h1> currently has no sibling elements. If no additional header elements are planned (e.g., user avatar, logout button), it could be simplified to just the <h1> without the wrapper.
## Approved This is a clean UI/CSS refactoring of the admin dashboard. The changes modernize the styling by introducing CSS custom properties (shadcn-style design tokens), update the visual design (pill badges, underline-style nav, border-based cards instead of shadows), and remove redundant granular metric cards (input/output tokens, premium/free cost breakdowns) while keeping the totals. No bugs, security issues, or performance problems found. ### Suggestions - **admin_dashboard.py**: The removed stats keys `total_input_tokens` and `total_output_tokens` are still being computed in `get_overview_stats()` (lines ~167-168) and fetched via SQL (lines ~151-152), but are no longer displayed in any template and aren't used in any calculations. Consider removing those SQL columns and dict assignments to avoid unnecessary computation, or keep them intentionally since the `/api/overview` JSON endpoint still exposes them. - **admin_dashboard.py**: Similarly, `premium_cost_usd` and `free_cost_usd` are removed from the template display but still computed. Unlike the token keys, `premium_cost_usd` is actively used to calculate `premium_profit_loss` (line ~221), so it must stay. `free_cost_usd` could be cleaned up if not needed by API consumers. - **admin_dashboard.py**: Minor: the `header-top` wrapper div around `<h1>` currently has no sibling elements. If no additional header elements are planned (e.g., user avatar, logout button), it could be simplified to just the `<h1>` without the wrapper.
claude-bot deleted branch feature/admin-dashboard-cleanup 2026-03-03 21:12:32 -07:00
Author
Owner

Thanks for the review! Addressed:

  • header-top wrapper: Removed in 99bf643 — simplified to just <h1> since there are no sibling elements.
  • total_input_tokens / total_output_tokens / free_cost_usd in SQL: Keeping intentionally — the /api/overview JSON endpoint returns these fields and removing them could break API consumers.
Thanks for the review! Addressed: - **`header-top` wrapper**: Removed in 99bf643 — simplified to just `<h1>` since there are no sibling elements. - **`total_input_tokens` / `total_output_tokens` / `free_cost_usd` in SQL**: Keeping intentionally — the `/api/overview` JSON endpoint returns these fields and removing them could break API consumers.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bittabola/tarjimon!29
No description provided.