Skip to content

feat: volume picker dialog and centered alert dialog popups - #41

Merged
tobi merged 4 commits into
tobi:mainfrom
ai94iq:partitions
Sep 27, 2026
Merged

tobi merged 4 commits into
tobi:mainfrom
ai94iq:partitions

Conversation

@ai94iq

@ai94iq ai94iq commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds a cross-platform volume picker dialog to quickly switch scan roots across mounted drives and partitions, centers alert dialog popups in the window, and documents the feature in the README.

Note on Testing: This implementation has been actively built and tested on Windows only (x86_64-pc-windows-msvc). Linux (/proc/mounts) and macOS mount parsing are covered by unit tests, but have not yet been manually verified in live Linux/macOS desktop sessions.


Key Changes

  1. Volume Picker Dialog (v / side panel button)

    • Cross-platform candidate detection:
      • Windows: queries drive letters and volume mount points, filtering unready drives (e.g. empty card readers).
      • Linux: inspects /proc/mounts, filters out pseudo-filesystems (sysfs, proc, tmpfs, cgroup, etc.), and collapses multiple btrfs subvolume mounts sharing the same device to the shortest mount path (e.g. / over /home).
      • macOS: parses mount output, handles /System/Volumes/Data deduplication, and formats disk names.
    • Interactive UI:
      • Lists volumes sorted fullest first with mount path, device name, and free space.
      • Supports arrow navigation (Up/Down), Enter to select and switch scan root, Escape or backdrop click to dismiss.
      • Adds a secondary "Volumes" button in the side panel header beside the active disk name.
      • Keyboard hint added to both the footer key bar and ? help overlay.
  2. Centered Alert Dialog Popups

    • Introduced centred_popup in views.rs to place dialog cards in the middle of the viewport (instead of GPUI's default top-left coordinate).
    • Preserved dismiss-on-backdrop-click behavior by capturing outside clicks on the full-window wrapper while stopping propagation inside the card.
    • Applied consistently to both volumes_dialog and the deletion confirmation delete_dialog.
  3. Code Quality & Maintenance

    • Modernized byte pair chunking in Windows record parsing from chunks_exact(2) to as_chunks::<2>() to satisfy Clippy 1.98.
    • Added unit and integration tests covering volume candidate filtering, keyboard navigation, and centered dialog layout with backdrop dismissal.
    • Updated README.md key table and added a Switching volumes section.

Verification (Windows)

  • Tested on Windows 11 (x86_64-pc-windows-msvc).
  • Passed cargo test --workspace (165 tests passing across disktree-app, disktree-core, and xtask).
  • Passed cargo xtask lint (rustfmt --check and strict Clippy -D warnings).
  • Passed cargo build --release.

@ai94iq

ai94iq commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Screenshots:
image
image

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.

2 participants