[lists-2] Points view over time per list #2

Open
opened 2026-06-23 02:48:10 +00:00 by kaykayyali · 0 comments
Owner

Goal

For each saved army list, show a line chart of the list's total points over time. Each "refresh" recomputes total points against the current MFM prices and stores a snapshot.

Acceptance Criteria

  1. When a saved list is loaded, the user can click "Refresh points" to recompute total points using the current live_data.json.
  2. Each refresh appends a snapshot { listId, ts, totalPts, perUnitPts[] } to localStorage under wh40k-pc:points-history:v1.
  3. The list view shows a line chart of totalPts over time (x = ts, y = totalPts), with the latest value highlighted.
  4. The chart is mobile-responsive (SVG, flex layout).
  5. If the list contains units not in the current MFM data, mark them as "not in MFM" in the per-unit breakdown.
  6. Refresh rate-limited: at most one snapshot per list per 60 seconds (or button re-disabled).

Test Command

cd /workspace/projects/wh40k-pc/react-app && npm install --silent && npm run build

File Scope

  • react-app/src/App.jsx
  • react-app/src/lib/pointsHistory.js (new — read/append snapshots)
  • react-app/src/lib/mfmLookup.js (new — name -> current pts)
  • react-app/src/components/PointsOverTime.jsx (new — SVG line chart)
  • react-app/src/components/ListDetail.jsx (new — single-list view, refresh button)
## Goal For each saved army list, show a line chart of the list's total points over time. Each "refresh" recomputes total points against the current MFM prices and stores a snapshot. ## Acceptance Criteria 1. When a saved list is loaded, the user can click "Refresh points" to recompute total points using the current `live_data.json`. 2. Each refresh appends a snapshot `{ listId, ts, totalPts, perUnitPts[] }` to `localStorage` under `wh40k-pc:points-history:v1`. 3. The list view shows a line chart of totalPts over time (x = ts, y = totalPts), with the latest value highlighted. 4. The chart is mobile-responsive (SVG, flex layout). 5. If the list contains units not in the current MFM data, mark them as "not in MFM" in the per-unit breakdown. 6. Refresh rate-limited: at most one snapshot per list per 60 seconds (or button re-disabled). ## Test Command `cd /workspace/projects/wh40k-pc/react-app && npm install --silent && npm run build` ## File Scope - `react-app/src/App.jsx` - `react-app/src/lib/pointsHistory.js` (new — read/append snapshots) - `react-app/src/lib/mfmLookup.js` (new — name -> current pts) - `react-app/src/components/PointsOverTime.jsx` (new — SVG line chart) - `react-app/src/components/ListDetail.jsx` (new — single-list view, refresh button)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kaykayyali/wh40k-points-comparator#2