mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
## Description Several dashboard cards and tables hardcoded a dark background (`bg-[#141414]`) that ignored the light theme. The most visible case was the **Agent Usage** section, which rendered black in light mode while every other surface flipped correctly. This converts those hardcoded backgrounds to the theme-aware `bg-card-alt` utility so the whole dashboard responds to the active theme, and tightens table column alignment. ## Type of Change - [x] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Performance improvement - [ ] Code refactoring (no functional changes) ## Changes Made - Replace hardcoded `bg-[#141414]` with the `bg-card-alt` utility (`var(--card-alt-bg)`: `#f3f4f6` light / `#141414` dark) across Agent Usage cards, the request-count badge, and per-agent rows. 0 hardcoded darks remain. - Per-model and per-project savings tables: `table-layout:fixed` + explicit `<col>` widths for stable columns. - Recent Requests: switch table markup to a CSS grid so columns align regardless of content length. - Add a per-project savings section (progress bar, Last Active column, empty state). - Single file changed: `headroom/dashboard/templates/dashboard.html`. ## Testing - [x] Unit tests pass (`pytest`) - [ ] Linting passes (`ruff check .`) - [ ] Type checking passes (`mypy headroom`) - [ ] New tests added for new functionality - [x] Manual testing performed ### Test Output ```text $ .venv/Scripts/python.exe -m pytest tests/test_dashboard_agent_usage.py -q ======================== 13 passed, 1 warning in 0.89s ======================== $ grep -c "bg-\[#141414\]" headroom/dashboard/templates/dashboard.html 0 # zero hardcoded dark backgrounds remain $ grep -c "bg-card-alt" headroom/dashboard/templates/dashboard.html 8 # all converted to the theme-aware utility ``` ## Real Behavior Proof - Environment: Windows 11, headroom proxy 0.26.0 serving `/dashboard` (template read per-request from disk, no cache). - Exact command / steps: start proxy, open `http://127.0.0.1:8787/dashboard`, toggle light mode, inspect the Agent Usage section. - Observed result: Agent Usage cards (Before/After/Saved/Savings + per-agent rows) now use the light surface (`#f3f4f6`) in light mode and `#141414` in dark mode, matching the rest of the dashboard. Confirmed visually on refresh; `grep` confirms 0 hardcoded darks remain. - Not tested: `ruff`/`mypy` (HTML template, no Python changed); no automated visual-regression test added. ## Review Readiness - [x] I have performed a self-review - [x] This PR is ready for human review ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] I have updated the CHANGELOG.md if applicable ## Additional Notes Presentation-only change to a single HTML template; no Python touched, so `ruff`/`mypy` are N/A. No visual-regression test added (none exists for the dashboard); existing `test_dashboard_agent_usage.py` data tests still pass. CHANGELOG not updated (UI fix). |
||
|---|---|---|
| .. | ||
| audit | ||
| backends | ||
| cache | ||
| capture | ||
| ccr | ||
| cli | ||
| compression | ||
| dashboard | ||
| evals | ||
| graph | ||
| image | ||
| install | ||
| integrations | ||
| lean_ctx | ||
| learn | ||
| mcp_registry | ||
| memory | ||
| models | ||
| observability | ||
| perf | ||
| prediction | ||
| pricing | ||
| providers | ||
| proxy | ||
| relevance | ||
| reporting | ||
| rtk | ||
| storage | ||
| subscription | ||
| telemetry | ||
| tokenizers | ||
| transforms | ||
| __init__.py | ||
| _version.py | ||
| agent_savings.py | ||
| binaries.py | ||
| cli.py | ||
| client.py | ||
| compress.py | ||
| config.py | ||
| copilot_auth.py | ||
| copilot_linux_secret.py | ||
| copilot_macos_keychain.py | ||
| exceptions.py | ||
| hooks.py | ||
| onnx_runtime.py | ||
| parser.py | ||
| paths.py | ||
| pipeline.py | ||
| py.typed | ||
| release_version.py | ||
| shared_context.py | ||
| tokenizer.py | ||
| tools.json | ||
| utils.py | ||