headroom/headroom
r00t 5eae32ba47
fix(dashboard): light-mode backgrounds + aligned savings tables (#1064)
## 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).
2026-06-17 11:43:29 -05:00
..
audit feat: compression extraction — Rust knob exposure, CCR hardening, traffic audits (#818) 2026-06-16 20:21:13 -07:00
backends fix(anyllm): forward openai api_base/api_key to the any-llm backend (#942) (#954) 2026-06-15 11:07:43 -05:00
cache feat: compression extraction — Rust knob exposure, CCR hardening, traffic audits (#818) 2026-06-16 20:21:13 -07:00
capture feat: add differential network capture harness (#761) 2026-06-08 22:18:31 -07:00
ccr feat: compression extraction — Rust knob exposure, CCR hardening, traffic audits (#818) 2026-06-16 20:21:13 -07:00
cli feat: output-token reduction — verbosity shaper, per-user learning, counterfactual savings (#965) 2026-06-16 21:06:43 -07:00
compression fix(compression): use thread-local tree-sitter parsers in code handler (#893) 2026-06-15 16:38:08 -05:00
dashboard fix(dashboard): light-mode backgrounds + aligned savings tables (#1064) 2026-06-17 11:43:29 -05:00
evals docs(evals): add session probes section to evals README (#888) 2026-06-13 18:07:31 -05:00
graph Auto-download codebase-memory-mcp binary, add watchdog to proxy deps 2026-04-11 19:30:38 -07:00
image fix(startup): suppress proxy startup log noise (#619) 2026-06-05 14:44:40 -08:00
install fix(init): guard persistent task startup (#616) 2026-06-10 20:34:43 -05:00
integrations docs: align MCP proxy docs with implemented API (#614) 2026-06-10 21:14:23 -05:00
lean_ctx feat: add lean-ctx context tool support 2026-05-11 17:54:17 -04:00
learn feat: output-token reduction — verbosity shaper, per-user learning, counterfactual savings (#965) 2026-06-16 21:06:43 -07:00
mcp_registry fix(mcp): honor CLAUDE_CONFIG_DIR for Claude registrar (#886) 2026-06-15 22:07:31 -05:00
memory fix: suppress '[transformers] PyTorch was not found' startup warning (#1066) 2026-06-16 21:05:25 -05:00
models fix(content-router,proxy): compress text blocks + close DeepSeek metrics gaps 2026-05-08 14:33:50 -07:00
observability feat: add Anthropic Claude Code subscription window tracking 2026-04-11 21:53:44 -05:00
perf feat: measure and surface token throughput (tokens/sec) through the proxy (#983) 2026-06-17 09:42:38 -05:00
prediction chore: add nosec B324 annotations to non-cryptographic MD5 usages and update temporary database path to use system temp directory 2026-04-07 13:07:26 +06:00
pricing style: fix linting and formatting issues 2026-06-03 20:08:26 +05:30
providers fix(codex): retag thread providers so history menu stays whole across the proxy boundary (#1034) 2026-06-16 15:13:21 -05:00
proxy fix(proxy): treat NODE_EXTRA_CA_CERTS as additive, not replacement (#998) (#1031) 2026-06-17 11:41:49 -05:00
relevance feat(relevance): weight BM25 score_batch by corpus IDF (#646) 2026-06-05 14:15:44 -08:00
reporting feat: attribute reread waste to over-compression via marker check (#901) 2026-06-13 10:43:35 -05:00
rtk refactor: migrate Python callsites to canonical paths module 2026-04-16 19:12:21 -05:00
storage Fix 19 test failures: missing security attr, nosec inside f-strings, stale test mock 2026-04-07 18:30:29 -07:00
subscription fix(codex): poll /wham/usage for subscription limits (handshake no longer sends x-codex-* headers) (#924) 2026-06-12 17:03:14 -05:00
telemetry fix: decode/encode owned config, state and template assets as UTF-8 2026-06-03 03:25:42 +08:00
tokenizers fix: correct tiktoken encoding for unknown gpt-4 model snapshots (#552) 2026-06-03 13:12:16 -07:00
transforms feat: compression extraction — Rust knob exposure, CCR hardening, traffic audits (#818) 2026-06-16 20:21:13 -07:00
__init__.py fix: B1 — retire ICM, RollingWindow, scoring, relevance + dependents 2026-05-02 12:23:17 -07:00
_version.py fix: make proxy upgrades version-aware 2026-05-09 15:58:27 -07:00
agent_savings.py feat(proxy): add agent-90 savings profile (#830) 2026-06-11 18:58:06 -05:00
binaries.py fix: docker install fails with PermissionError in readonly cache dir 2026-04-20 17:36:44 -07:00
cli.py Add Click-based CLI with memory management commands 2026-01-29 21:30:21 -08:00
client.py refactor: DRY cache logic, add thread safety, fix Bash exclusion (#704) 2026-06-16 14:50:04 -05:00
compress.py feat: add dashboard agent usage stats (#814) 2026-06-12 14:12:22 -05:00
config.py feat: compression extraction — Rust knob exposure, CCR hardening, traffic audits (#818) 2026-06-16 20:21:13 -07:00
copilot_auth.py fix: support Copilot Business subscription auth (#641) 2026-06-12 20:46:38 -05:00
copilot_linux_secret.py fix(copilot): support subscription auth through Headroom 2026-06-02 21:24:47 -07:00
copilot_macos_keychain.py fix(copilot): support subscription auth through Headroom 2026-06-02 21:24:47 -07:00
exceptions.py fix: B1 — retire ICM, RollingWindow, scoring, relevance + dependents 2026-05-02 12:23:17 -07:00
hooks.py feat: introduce canonical pipeline lifecycle contract 2026-04-21 23:54:28 -05:00
onnx_runtime.py fix(proxy): make Kompress eager preload cache-only so a cold cache can't block startup (#783) 2026-06-11 12:53:03 -05:00
parser.py feat: attribute reread waste to over-compression via marker check (#901) 2026-06-13 10:43:35 -05:00
paths.py fix(wrap): track shared proxy clients with markers (#877) 2026-06-11 19:42:43 -05:00
pipeline.py feat: introduce canonical pipeline lifecycle contract 2026-04-21 23:54:28 -05:00
py.typed Prepare for OSS release v0.2.0 2026-01-07 11:36:44 -08:00
release_version.py chore: renormalize line endings to LF 2026-04-24 15:33:30 +02:00
shared_context.py Add SharedContext for multi-agent, rewrite README, fix proxy cleanup 2026-03-17 16:31:04 -07:00
tokenizer.py Initial commit: Headroom SDK - LLM context optimization toolkit 2026-01-06 23:16:58 -08:00
tools.json fix(review): address PR #210 feedback — race, query-params, SHA logging, frozen prefix, etc 2026-04-20 17:36:44 -07:00
utils.py chore: add nosec B324 annotations to non-cryptographic MD5 usages and update temporary database path to use system temp directory 2026-04-07 13:07:26 +06:00