- Add 8-SUMMARY.md with execution results - Update STATE.md with quick task 008 entry
3.8 KiB
3.8 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| quick | 8 | playlist |
|
|
|
|
|
|
Quick Task 8: Add Duplicate Tracks Dialog to Playlist Summary
Backend duplicate detection using existing playlist track queries, new Lit dialog component stepping through duplicates one-by-one with Add/Skip and batch-apply toggle, wired into both playlist-picker context menu and playlist-view drag-drop flows.
What Was Built
Backend: FindDuplicateTracksInPlaylist (Task 1)
- Added
DuplicateTrackInfoandDuplicateCheckResulttypes tobackend/playlist/playlist.go - Implemented
FindDuplicateTracksInPlaylist(playlistID, filePaths)method onService - Uses existing
GetPlaylistTracksWithMetadataquery to build a map of existing file paths - Partitions incoming file paths into duplicates (with metadata) and unique paths
- Wails TypeScript bindings regenerated with proper type mappings
Frontend: DuplicateTracksDialog Component (Task 2)
- New
<duplicate-tracks-dialog>Lit component atfrontend/src/components/duplicate-tracks-dialog/ - Follows existing wa-dialog patterns from
track-details.tsandphantom-resolver.ts - Shows duplicate track count header, progress indicator (Track N of M)
- Track card displays Title, Artist, Album, Duration for the current duplicate
- "Add" button includes duplicate in final add; "Skip" excludes it
wa-switchtoggle "Apply to all remaining" batch-applies the current choicefinalize()combines unique paths + user-approved duplicates, callsAddTracksToPlaylist, dispatchesplaylist-action-complete
Frontend: Integration (Task 3)
- playlist-picker.ts:
handleSelectPlaylistnow callsFindDuplicateTracksInPlaylistbefore adding. If duplicates found, opens the dialog instead. Otherwise adds directly as before. - playlist-view.ts:
onPlaylistDropdrag-drop handler similarly checks for duplicates before adding. Shows dialog when duplicates found. - Both components render
<duplicate-tracks-dialog>and listen forplaylist-action-completeto trigger refresh.
Commits
| Task | Name | Commit | Key Files |
|---|---|---|---|
| 1 | Add backend FindDuplicateTracksInPlaylist | 83de934 |
backend/playlist/playlist.go, wailsjs bindings |
| 2 | Create duplicate-tracks-dialog component | 9f3ba2b |
frontend/src/components/duplicate-tracks-dialog/duplicate-tracks-dialog.ts |
| 3 | Wire duplicate detection into playlist-picker and playlist-view | 917a79a |
playlist-picker.ts, playlist-view.ts |
Deviations from Plan
None - plan executed exactly as written.
Verification
go build ./...— backend compilesnpx tsc --noEmit— frontend typechecks- Wails bindings regenerated with
FindDuplicateTracksInPlaylist DuplicateCheckResultandDuplicateTrackInfotypes in generated models.ts
Self-Check: PASSED
All created files exist, all commits found, all modified files present.