Defines the "Bulk Import All Sources" feature for the on-demand bestiary system: one-click loading of all ~104 bestiary sources with concurrent fetching, progress feedback, toast notifications, and completion reporting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.4 KiB
1.4 KiB
Quickstart: Bulk Import All Sources
Prerequisites
- Node.js 20+, pnpm
- Feature 029 (on-demand bestiary) merged and working
Setup
git checkout 030-bulk-import-sources
pnpm install
pnpm --filter web dev
Key Files
| File | Role |
|---|---|
apps/web/src/hooks/use-bulk-import.ts |
NEW — bulk import state + logic |
apps/web/src/components/bulk-import-prompt.tsx |
NEW — side panel bulk import UI |
apps/web/src/components/toast.tsx |
NEW — lightweight toast notification |
apps/web/src/components/action-bar.tsx |
MODIFIED — Import button added |
apps/web/src/components/stat-block-panel.tsx |
MODIFIED — bulk import mode |
apps/web/src/App.tsx |
MODIFIED — wiring |
apps/web/src/hooks/use-bestiary.ts |
MODIFIED — expose fetchAndCacheSource for bulk use |
Testing
pnpm test # All tests
pnpm vitest run apps/web/src # Web app tests only
pnpm check # Full merge gate
Manual Verification
- Open app at
localhost:5173 - Click Import button (top bar) — side panel opens with bulk import prompt
- Verify base URL is pre-filled, editable
- Click "Load All" — observe progress counter and bar
- Close side panel mid-import — toast appears at bottom-center
- Wait for completion — toast shows success/failure message
- Search for any creature — stat block displays without fetch prompt