Skip to content

feat(ui): dashboard SVG sparklines — daily net + earn trend (v1.18 A) - #48

Merged
argszero merged 1 commit into
mainfrom
feat/ui-ue-round3
Aug 17, 2026
Merged

argszero merged 1 commit into
mainfrom
feat/ui-ue-round3

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Rant 2026-08-17T18:06:09 (UI/UE 第三轮多角度深化), item A — 仪表盘数据可视化: the dashboard currently shows only plain text; add pure-SVG mini charts (sparklines) with zero external dependencies.

Changes

  • New helpers in ui/js/app.js:
    • sparkline(values, opts) — hand-written SVG polyline + gradient area fill; per-point <title> for hover (label + formatted value); colors via existing CSS vars (--accent / --ok); unique gradient ids; safe for empty/single/all-zero series;
    • lastDayLabels(n) — last n day labels (MM-DD);
    • dailySeries(days, filter) — daily point aggregation from transactions.
  • Dashboard wiring:
    • 「本月点数变化」card: 7-day daily net change sparkline (gradient fill, hover shows day + signed value);
    • 「我的共享」card: cumulative earnings trend sparkline (--ok stroke); empty state preserved when no active listings (no chart drawn).
  • CSS: .sparkline { width:100%; height:38px; };
  • Docs: docs/user-stories.md v1.18 changelog adds item A; ui/README.md 数据可视化约定 section.

Acceptance

Dashboard shows SVG mini charts; hover reveals daily values; zero deps.

Tests

  • node --check on app.js — syntax OK
  • sparkline unit tests 9/9 PASS (polyline + gradient + titles + unique ids; empty/single/zero series safe)
  • DOM-stub init smoke — no ReferenceError
  • cargo test — 1 passed
  • cargo fmt --check — clean

@argszero
argszero merged commit 2fa057e into main Aug 17, 2026
1 check passed
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