From 64e1ba87b99aa3a2a616e6d9b436bcb81ec2d840 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Wed, 25 Feb 2026 12:20:48 -0500 Subject: [PATCH] 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) --- templates/admin.templ | 73 +++++++++++----- web/src/admin.ts | 193 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+), 19 deletions(-) diff --git a/templates/admin.templ b/templates/admin.templ index 527112b..815627b 100644 --- a/templates/admin.templ +++ b/templates/admin.templ @@ -8,6 +8,7 @@ templ Admin(user User) { Admin Dashboard - Bookhoard + @@ -51,7 +52,7 @@ templ Admin(user User) {

Quick Actions

- @@ -61,29 +62,63 @@ templ Admin(user User) {
+ + +