john-okeefe
64e1ba87b9
Implement Part 1: Fix Scan Library button with progress UI
Implements the frontend scan button fix from TASKS-scanning-progress.md Part 1.
Changes:
1. web/src/admin.ts - Added 6 new TypeScript functions:
- scanAllLibraries(): Fetches all libraries, triggers scan for each
- showScanProgress(): Displays progress UI with per-library progress bars
- pollScanProgress(): Polls status every 2 seconds, updates progress
- updateLibraryProgress(): Updates individual library progress bar/status
- showScanResults(): Displays scan completion results
- hideScanProgress(): Hides progress UI
2. templates/admin.templ - Updated UI:
- Added admin.js script include (Step 2)
- Changed button onclick from quickScan() to scanAllLibraries() (Step 3)
- Removed broken inline quickScan() function (Step 3.5)
- Added progress UI HTML with slide-in animation (Step 4)
Key Features:
- Fetches all libraries via GET /api/libraries
- Triggers scan for each library via POST /api/libraries/{id}/scan
- Displays per-library progress bars
- Shows overall progress percentage
- Real-time status updates every 2 seconds
- Results summary with file counts and errors
- TailwindCSS animation (no custom CSS)
- Follows PROJECT_GUIDELINES.md: TypeScript only, TailwindCSS classes
TypeScript compiles successfully (npm run build:ts)
All guidelines verified (26/26 checks pass)