Skip to content

fix(dialog): allow selecting both files and folders in add music picker#19

Open
pythoninthegrass wants to merge 4 commits intomainfrom
task-266
Open

fix(dialog): allow selecting both files and folders in add music picker#19
pythoninthegrass wants to merge 4 commits intomainfrom
task-266

Conversation

@pythoninthegrass
Copy link
Collaborator

Summary

  • Fix filepicker regression where only directories were selectable in the "Add Music" dialog (backlog task-266)
  • macOS: Use NSOpenPanel directly with canChooseFiles + canChooseDirectories for native combined file/folder selection — same behavior as Apple Music
  • Linux: Fall back to pick_files() with audio filters since GTK does not support combined mode (still fixes the regression — was pick_folders() only before)
  • Fix scan deletion bug: Scanning a single file no longer erases the rest of the library — db_fingerprints are now scoped to the scan paths before the inventory deletion check runs

Changes

File What
crates/mt-tauri/Cargo.toml Add macOS-only deps (objc2, objc2-app-kit, objc2-foundation, dispatch2) — already transitive deps of rfd
crates/mt-tauri/src/dialog.rs Rewrite open_add_music_dialog with platform-specific NSOpenPanel (macOS) / pick_files fallback (Linux)
crates/mt-tauri/src/scanner/commands.rs Add scope_fingerprints_to_paths() to prevent out-of-scope tracks from being marked deleted
app/frontend/views/footer.html Add data-testid for E2E testing
app/frontend/js/stores/library.js Remove stale comment

Test plan

  • macOS: Click "+", verify dialog allows selecting both individual audio files AND folders
  • macOS: Select a single .mp3 file, confirm it's added without erasing existing library
  • macOS: Select a folder, confirm all audio files inside are scanned
  • Linux: Click "+", verify file picker opens with audio file filters
  • Verify existing library tracks are preserved after any add operation

🤖 Generated with Claude Code

pythoninthegrass and others added 4 commits February 12, 2026 23:47
The file picker regression only allowed directory selection because
open_add_music_dialog used pick_folders(). On macOS, use NSOpenPanel
directly with canChooseFiles + canChooseDirectories for native combined
selection. On Linux, fall back to pick_files() (GTK limitation).

Also fix a latent bug in scan_paths_to_library where scanning a single
file would mark every other library track as deleted — the inventory
deletion logic compared the filesystem walk against ALL DB fingerprints
instead of scoping to the scan paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep macOS objc2 dependencies from task-266, drop reverted Linux gtk
dependency that was removed from main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
_loadCacheFromSettings uses only synchronous calls.
_fetchLibraryData returns a promise without awaiting it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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