Skip to content

feat(library): Reanalyze and Remove-from-library context menu - #89

Merged
robmorgan merged 1 commit into
mainfrom
feat/library-context-menu
Aug 2, 2026
Merged

feat(library): Reanalyze and Remove-from-library context menu#89
robmorgan merged 1 commit into
mainfrom
feat/library-context-menu

Conversation

@robmorgan

Copy link
Copy Markdown
Owner

Summary

Right-clicking a track row in the library browser (now anywhere on the row, not just the Title cell) offers two new actions below the playlist items:

  • Reanalyze — clears analysis_json (new Library::clear_analysis), which re-arms the worker's next_unanalyzed queue, and wakes the analysis worker for an immediate run. The BPM column stays populated while the worker re-runs. The Analyzed event handler no longer skips decks that already hold an artifact, so a loaded deck picks up the refreshed grid (the engine-side apply still waits for a non-playing moment via pending_artifact).
  • Remove from library… — opens a centered confirmation dialog ("Authored lighting cues will be deleted. The audio file on disk is not touched.") since the FK cascade drops playlist_tracks and lighting_cues. On confirm, Library::delete_track deletes the row, any deck/audition still holding the track is detached (track_id = None) without interrupting playback, and the status bar reports the removal.

Testing

  • 2 new library unit tests: clear_analysis re-arms the queue (including from the '' failure marker), and delete_track cascades playlist membership + lighting cues while the playlist itself survives. cargo test --workspace: 119 passed.
  • Manual: right-clicked the row → menu shows Add to playlist / Reanalyze / Remove from library…; Reanalyze produced a second "Analyzed" log line; Remove showed the dialog, Cancel kept the row, Remove emptied the library ("0 tracks", status message) while deck A kept playing its loaded track. No underruns/errors in the log.

🤖 Generated with Claude Code

Move the track context menu from the Title cell to the whole row and
add two actions. Reanalyze clears the stored analysis (re-arming the
worker queue, keeping the BPM column populated) and wakes the analysis
worker; the worker-event handler now refreshes a deck holding the track
even when it already has an artifact, so a reanalyzed grid reaches a
loaded deck. Remove from library opens a confirmation dialog (the FK
cascade also deletes authored lighting cues), then deletes the row —
playlist membership and cues cascade in SQLite, the audio file on disk
is untouched, and any deck still holding the track is detached without
interrupting playback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@robmorgan
robmorgan merged commit 2bc9d4d into main Aug 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant