[lists-1] Add local browser-based army list import #1

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

Goal

Allow the user to import a WH40K army list (BattleScribe / New Recruit JSON) directly in the browser. Parsed lists must persist to localStorage so the user can come back to them later.

Acceptance Criteria

  1. There is an "Import list" button (and drag-and-drop area) on the home page.
  2. The user can pick a .json file from disk. It is parsed using the bs-roster-parser library.
  3. Parsed lists are saved to localStorage under a stable key (e.g. wh40k-pc:lists:v1) with: id, name, importedAt, source filename, unit list (name, pts, model_count, breakdown).
  4. The home page shows all saved lists with: name, total pts, unit count, imported date, plus Load and Delete buttons.
  5. Loading a list displays its units in a DataGrid (name, pts, model count, weapons).
  6. Delete removes the list from localStorage with a confirm dialog.
  7. The app does not break if localStorage is full or unavailable — show an error message instead.

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/listStore.js (new — localStorage helpers)
  • react-app/src/lib/battlescribeParser.js (new — JS port of bs-roster-parser, or vendor a minimal copy)
  • react-app/src/components/ListImport.jsx (new — file picker + drop zone)
  • react-app/src/components/ListsPanel.jsx (new — saved lists list + load/delete)
  • react-app/src/main.jsx
  • react-app/package.json
## Goal Allow the user to import a WH40K army list (BattleScribe / New Recruit JSON) directly in the browser. Parsed lists must persist to localStorage so the user can come back to them later. ## Acceptance Criteria 1. There is an "Import list" button (and drag-and-drop area) on the home page. 2. The user can pick a `.json` file from disk. It is parsed using the `bs-roster-parser` library. 3. Parsed lists are saved to `localStorage` under a stable key (e.g. `wh40k-pc:lists:v1`) with: id, name, importedAt, source filename, unit list (name, pts, model_count, breakdown). 4. The home page shows all saved lists with: name, total pts, unit count, imported date, plus Load and Delete buttons. 5. Loading a list displays its units in a DataGrid (name, pts, model count, weapons). 6. Delete removes the list from localStorage with a confirm dialog. 7. The app does not break if localStorage is full or unavailable — show an error message instead. ## 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/listStore.js` (new — localStorage helpers) - `react-app/src/lib/battlescribeParser.js` (new — JS port of bs-roster-parser, or vendor a minimal copy) - `react-app/src/components/ListImport.jsx` (new — file picker + drop zone) - `react-app/src/components/ListsPanel.jsx` (new — saved lists list + load/delete) - `react-app/src/main.jsx` - `react-app/package.json`
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#1