Skip to content

Commit ba3e770

Browse files
committed
Add volume selection feature
1 parent 1aac032 commit ba3e770

15 files changed

Lines changed: 996 additions & 18 deletions

docs/notes/2025-12-29-make-files-load-super-fast-tasks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ Goal: Eliminate Svelte reactivity freeze by keeping file data outside reactive s
2828
- [x] Store provides `getAllFiltered()` for current implementation (full virtual scroll getRange coming in Phase 2)
2929
- [x] `storeVersion` reactive trigger for component updates
3030

31-
- [ ] Update `BriefList.svelte` and `FullList.svelte` (deferred to Phase 2)
32-
- [ ] Accept `totalCount` prop for scrollbar sizing
33-
- [ ] Accept `maxFilenameWidth` prop (Brief mode)
34-
- [ ] On scroll, call back to parent for new visible range
31+
- [x] Update `BriefList.svelte` and `FullList.svelte` (deferred to Phase 2)
32+
- [x] Accept `totalCount` prop for scrollbar sizing
33+
- [x] Accept `maxFilenameWidth` prop (Brief mode)
34+
- [x] On scroll, call back to parent for new visible range
3535

3636
- [x] Remove old `filesVersion` pattern
3737
- [x] Delete `filesVersion` state variable (replaced with `storeVersion`)

docs/todo.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
## Listing
22

3-
- [x] Build a (set of) dmg release(s) and document the process
4-
- [...] Enable file drag&drop from the app to other apps.
5-
- [ ] Add "change drive" feature
6-
- [ ] Test with slow drives like network drives
73
- [ ] We need to ask for permissions for `Downloads`, etc. Handle permission denial gracefully!
84
- [ ] Add different sorting options
95
- [ ] When sorting alphabetically, sort numbers ascending, not alphabetically
6+
- [ ] Make it handle network drives
7+
- [ ] Test with slow drives like network drives
108
- [ ] Load iCloud sync statuses, too
119
- [ ] Load Google Drive sync statuses, too
1210
- [ ] Load OneDrive sync statuses, too?

src-tauri/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ plist = "1.8.0"
5050
urlencoding = "2.1.3"
5151
objc2 = "0.6"
5252
objc2-foundation = { version = "0.3", features = [
53-
"NSURL", "NSString", "NSDictionary", "NSDate", "NSArray", "NSValue", "NSError"
53+
"NSURL", "NSString", "NSDictionary", "NSDate", "NSArray", "NSValue", "NSError",
54+
"NSFileManager"
5455
] }
5556

5657
[dev-dependencies]

src-tauri/src/commands/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ pub mod icons;
66
#[cfg(target_os = "macos")]
77
pub mod sync_status;
88
pub mod ui;
9+
#[cfg(target_os = "macos")]
10+
pub mod volumes;

src-tauri/src/commands/volumes.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//! Tauri commands for volume operations.
2+
3+
use crate::volumes::{self, DEFAULT_VOLUME_ID, VolumeInfo};
4+
5+
/// Lists all mounted volumes.
6+
#[tauri::command]
7+
pub fn list_volumes() -> Vec<VolumeInfo> {
8+
volumes::list_mounted_volumes()
9+
}
10+
11+
/// Gets the default volume ID (root filesystem).
12+
#[tauri::command]
13+
pub fn get_default_volume_id() -> String {
14+
DEFAULT_VOLUME_ID.to_string()
15+
}

src-tauri/src/icons.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ fn fetch_icon_for_path(path: &Path) -> Option<String> {
7272
image_to_data_url(&dynamic_img)
7373
}
7474

75+
/// Gets icon for a path as base64 data URL.
76+
/// Public API for use by volumes module.
77+
pub fn get_icon_for_path(path: &str) -> Option<String> {
78+
fetch_icon_for_path(Path::new(path))
79+
}
80+
7581
/// Gets the sample file path to use for fetching an icon by ID.
7682
/// For extension-based icons, we create an actual temp file since the OS may need it to exist.
7783
fn get_sample_path_for_icon_id(icon_id: &str) -> Option<PathBuf> {

src-tauri/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ pub mod icons;
2020
mod macos_icons;
2121
mod menu;
2222
mod settings;
23+
#[cfg(target_os = "macos")]
24+
mod volumes;
2325

2426
use menu::{MenuState, SHOW_HIDDEN_FILES_ID, VIEW_MODE_BRIEF_ID, VIEW_MODE_FULL_ID, ViewMode};
2527
use tauri::{Emitter, Manager};
@@ -136,7 +138,11 @@ pub fn run() {
136138
commands::ui::show_main_window,
137139
commands::ui::update_menu_context,
138140
#[cfg(target_os = "macos")]
139-
commands::sync_status::get_sync_status
141+
commands::sync_status::get_sync_status,
142+
#[cfg(target_os = "macos")]
143+
commands::volumes::list_volumes,
144+
#[cfg(target_os = "macos")]
145+
commands::volumes::get_default_volume_id
140146
])
141147
.run(tauri::generate_context!())
142148
.expect("error while running tauri application");

0 commit comments

Comments
 (0)