docs(11-02): complete frontend scan UI plan
- SUMMARY.md documents per-library progress display and queue-aware cancel dialog - STATE.md updated: plan 2/3, session continuity, new decisions - ROADMAP.md updated: phase 11 progress 2/3 - REQUIREMENTS.md: LSCAN-03 marked complete
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
---
|
||||
phase: 11-per-library-scan-pipeline
|
||||
plan: 02
|
||||
subsystem: ui
|
||||
tags: [lit-element, scan-progress, cancel-dialog, per-library, wails-bindings]
|
||||
|
||||
# Dependency graph
|
||||
requires:
|
||||
- phase: 11-per-library-scan-pipeline
|
||||
provides: ScanLibrary, ScanAllLibraries, CancelCurrentScan, CancelAllScans, queue-aware ScanProgress with libraryId/libraryName/queuedCount, LibraryScanQueued/LibraryScanQueueDrained events
|
||||
provides:
|
||||
- Per-library progress display showing library name and queue count in config-page and library-manager
|
||||
- Queue-aware cancel dialog with "Cancel This Library" / "Cancel All Scanning" scope choice
|
||||
- "Scan All Libraries" button in both config-page and library-manager
|
||||
affects: [12-library-crud-data-integrity, 13-library-views-phantom-tracks]
|
||||
|
||||
# Tech tracking
|
||||
tech-stack:
|
||||
added: []
|
||||
patterns:
|
||||
- "Queue-aware cancel dialog: scope choice when queuedCount > 0, single-scan dialog otherwise"
|
||||
- "Library name in progress label: baseLabel + libraryName from ScanProgress"
|
||||
- "Queue draining guard: handleScanComplete defers full reset when queue still has entries"
|
||||
|
||||
key-files:
|
||||
created: []
|
||||
modified:
|
||||
- frontend/src/components/config-page/config-page.ts
|
||||
- frontend/src/components/library-manager/library-manager.ts
|
||||
|
||||
key-decisions:
|
||||
- "Cancel dialog shows two-option scope choice (Cancel This Library / Cancel All) only when queuedCount > 0; single-scan uses existing Keep/Discard/Continue pattern"
|
||||
- "handleScanComplete defers scanning=false when queue has entries, relying on ScanQueueDrained for final reset"
|
||||
- "Wails binding stubs already generated by Plan 01 auto-generation; no manual stubs needed"
|
||||
|
||||
patterns-established:
|
||||
- "Queue-aware cancel dialog: conditional dialog content based on scanQueuedCount > 0"
|
||||
- "Progress library prefix: libraryName from ScanProgress displayed in progress-label"
|
||||
|
||||
requirements-completed: [LSCAN-03, LSCAN-04]
|
||||
|
||||
# Metrics
|
||||
duration: 4min
|
||||
completed: 2026-03-09
|
||||
---
|
||||
|
||||
# Phase 11 Plan 02: Frontend Scan UI Summary
|
||||
|
||||
**Per-library progress display with library name and queue count, queue-aware cancel dialog with scope choice, and Scan All Libraries button in both config-page and library-manager**
|
||||
|
||||
## Performance
|
||||
|
||||
- **Duration:** 4 min
|
||||
- **Started:** 2026-03-09T20:07:11Z
|
||||
- **Completed:** 2026-03-09T20:11:36Z
|
||||
- **Tasks:** 2
|
||||
- **Files modified:** 2
|
||||
|
||||
## Accomplishments
|
||||
- Config-page and library-manager both show "Scanning: [Library Name]" in progress bar during scans
|
||||
- Queue count displayed as "[N] libraries queued" below progress bar when libraries are queued
|
||||
- Cancel dialog in config-page shows "Cancel This Library" / "Cancel All Scanning" scope choice when multiple scans queued
|
||||
- "Scan All Libraries" button added alongside Soft Scan and Full Rescan in both components
|
||||
- ScanProgress interface updated with libraryId, libraryName, queuedCount in both components
|
||||
- Event subscriptions for LibraryScanQueued and LibraryScanQueueDrained properly managed
|
||||
|
||||
## Task Commits
|
||||
|
||||
Each task was committed atomically:
|
||||
|
||||
1. **Task 1: Add Wails binding stubs and update progress/cancel UI in config-page** - `d01591d` (feat)
|
||||
2. **Task 2: Update library-manager component for per-library scan display** - `d61f122` (feat)
|
||||
|
||||
## Files Created/Modified
|
||||
- `frontend/src/components/config-page/config-page.ts` - Updated ScanProgress interface, replaced CancelScan with CancelCurrentScan/CancelAllScans, added queue-aware cancel dialog with scope choice, progress shows library name and queue count, Scan All Libraries button added
|
||||
- `frontend/src/components/library-manager/library-manager.ts` - Updated ScanProgress interface, progress shows library name and queue count, Scan All Libraries button added, queue event subscriptions, scan complete defers reset when queue draining
|
||||
|
||||
## Decisions Made
|
||||
- **Cancel dialog scope choice:** When queuedCount > 0, show "Cancel This Library" (btn-warning) and "Cancel All Scanning" (btn-danger) — no default, user must pick. When queuedCount === 0, keep existing three-option Keep/Discard/Continue pattern but calling CancelCurrentScan instead of deprecated CancelScan.
|
||||
- **Queue drain guard:** handleScanComplete checks scanQueuedCount before resetting scanning=false. If queue has entries, only metrics are updated; full reset waits for LibraryScanQueueDrained event.
|
||||
- **Wails binding stubs already present:** Plan 01's auto-generation already created all needed stubs (ScanLibrary, ScanAllLibraries, CancelCurrentScan, CancelAllScans, GetScanQueueLength, QueuedLibraryNames) — no manual stub additions needed.
|
||||
|
||||
## Deviations from Plan
|
||||
|
||||
### Auto-fixed Issues
|
||||
|
||||
**1. [Rule 3 - Blocking] Unstaged backend files in git index**
|
||||
- **Found during:** Task 2 commit
|
||||
- **Issue:** Backend Go files (app.go, library.go, rescan.go) were staged in the git index from prior work, causing golangci-lint failures in the pre-commit hook on unrelated code
|
||||
- **Fix:** Unstaged the backend files before committing the frontend-only change
|
||||
- **Files modified:** None (git index manipulation only)
|
||||
- **Verification:** Commit succeeded with frontend-typecheck passing
|
||||
- **Committed in:** d61f122 (Task 2 commit)
|
||||
|
||||
---
|
||||
|
||||
**Total deviations:** 1 auto-fixed (1 blocking)
|
||||
**Impact on plan:** Minor git workflow issue, no scope creep.
|
||||
|
||||
## Issues Encountered
|
||||
None
|
||||
|
||||
## User Setup Required
|
||||
None - no external service configuration required.
|
||||
|
||||
## Next Phase Readiness
|
||||
- Per-library scan UI complete — progress identifies library by name, queue count visible, cancel has scope choice
|
||||
- Ready for Phase 11 Plan 03 (if exists) or Phase 12 (Library CRUD & Data Integrity)
|
||||
- Frontend fully wired to backend scan queue API from Plan 01
|
||||
|
||||
---
|
||||
*Phase: 11-per-library-scan-pipeline*
|
||||
*Completed: 2026-03-09*
|
||||
Reference in New Issue
Block a user