Skip to content

🌐 Dashboard Web MVP#58

Merged
jmanzanog merged 6 commits intomainfrom
feat/dashboard-web-mvp
Mar 30, 2026
Merged

🌐 Dashboard Web MVP#58
jmanzanog merged 6 commits intomainfrom
feat/dashboard-web-mvp

Conversation

@jmanzanog
Copy link
Copy Markdown
Owner

@jmanzanog jmanzanog commented Mar 26, 2026

What this PR does

  • serves a lightweight web dashboard at / and /dashboard
  • keeps the existing JSON API intact and hydrates the page from GET /api/v1/dashboard
  • renders summary cards, allocation breakdowns, positions table, and inline sparkline trends with zero frontend dependencies
  • documents how to access the new browser dashboard in the README

Why this idea

This implements the Dashboard Web MVP idea from the feature backlog PR (#57): a minimal browser UI on top of the dashboard endpoint instead of introducing a full SPA.

Validation

  • go test ./internal/interfaces/http -run "TestDashboardPageRoutes|TestGetDashboard|TestParseSparklineDays"
  • go test ./cmd/tracker -run TestBuildServer

Both were executed inside golang:1.26 Docker because Go is not installed on the host PATH.

Notes

  • the existing broader cmd/tracker integration tests still rely on a Docker/testcontainers setup and were intentionally not used as the acceptance signal for this PR
  • top-level totals are rendered as numeric values rather than forcing a single currency symbol, so the UI does not imply everything is USD when portfolios contain mixed currencies

@wilson-ai-jm wilson-ai-jm force-pushed the feat/dashboard-web-mvp branch from be50395 to 1b133a1 Compare March 26, 2026 17:17
wilson-ai added 5 commits March 26, 2026 18:23
- Replace innerHTML string interpolation with DOM APIs (textContent) for
  all untrusted dynamic values (instrument names, symbols, error messages)
  to close reflected XSS vectors.
- Change default sparkline range from 30d to 7d to avoid large JSON
  payloads; picks shortest available range so 7d is used when present.
- Keep decimal values as strings for display; only convert to Number
  where numeric comparison is strictly needed, avoiding JS floating-point
  rounding errors on financial data.
- Add explanatory comments in code.
- Update README to document the 7d default.
Convert renderSparkline() to return a DOM node (span with SVG children)
instead of an HTML string. This eliminates the last innerHTML call and
ensures all dynamic content construction uses DOM APIs or textContent.
Updated corresponding test expectation for sparklines URL.
Repository owner deleted a comment from codecov-commenter Mar 26, 2026
@jmanzanog jmanzanog merged commit a6848dc into main Mar 30, 2026
1 check passed
@jmanzanog jmanzanog deleted the feat/dashboard-web-mvp branch March 30, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant