You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add `SmbConnectionState` enum (Direct/OsMount) to `LocationInfo`
- Add `smb_connection_state()` to `Volume` trait, SmbVolume maps its atomic state
- Enrich volume lists: volumes with `fs_type == "smbfs"` without smb2 session show as OsMount
- Extract `is_smb_fs_type()` helper in `volumes/mod.rs`
- Green/yellow CSS circle indicator in dropdown and breadcrumb
- Yellow state shows submenu trigger (CSS right-pointing triangle) with "Connect directly for faster access" item
- Breadcrumb: yellow circle + down arrow inside a clickable button, opens popup menu
- All arrows are CSS triangles for consistent rendering across fonts
- Submenu: fixed positioning to escape dropdown overflow clip, keyboard nav (ArrowRight/Left/Enter/Escape)
- Single cursor: main menu highlight suppressed when submenu is open
Copy file name to clipboardExpand all lines: apps/desktop/src-tauri/src/file_system/volume/CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ Optional methods default to `Err(VolumeError::NotSupported)` or `false`, so new
39
39
-`supports_streaming()` — enables chunked MTP-to-MTP transfers. Only `MtpVolume` returns `true`.
40
40
-`local_path()` — returns `Some` only for local volumes; allows `copyfile(2)` fast-path in copy operations. `SmbVolume` returns `None` so copies go through smb2 instead of the slow OS mount.
41
41
-`supports_local_fs_access()` — whether `std::fs` operations (stat, read_dir) work on this volume's paths. Default `true`. `MtpVolume` returns `false`. Used to skip synthetic entry diffs for protocol-only volumes.
42
+
-`smb_connection_state()` — returns `Some(SmbConnectionState)` for SMB volumes (green/yellow indicator in volume picker). Default `None`. Only `SmbVolume` implements it.
42
43
-`on_unmount()` — lifecycle hook called before unregistration. `SmbVolume` uses it to disconnect its smb2 session. Default is no-op.
43
44
-`scanner()` / `watcher()` — drive indexing hooks; `None` by default.
Copy file name to clipboardExpand all lines: apps/desktop/src-tauri/src/volumes/CLAUDE.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ macOS volume and location discovery, plus live mount/unmount watching via FSEven
6
6
7
7
| File | Purpose |
8
8
|---|---|
9
-
|`mod.rs`|`LocationInfo` type and `VolumeInfo` type alias (`pub use LocationInfo as VolumeInfo` for backwards compatibility), `LocationCategory` enum. `list_locations()`, `get_volume_space()`, `parse_cloud_provider_name()`, `get_mount_point()` (statfs-based mount resolution with APFS firmlink normalization), `resolve_path_volume_fast()` (builds `VolumeInfo` from statfs without enumerating volumes), and private helpers using `objc2`/`objc2_foundation`. |
9
+
|`mod.rs`|`LocationInfo` type and `VolumeInfo` type alias (`pub use LocationInfo as VolumeInfo` for backwards compatibility), `LocationCategory` enum, `SmbConnectionState` enum. `list_locations()`, `get_volume_space()`, `parse_cloud_provider_name()`, `get_mount_point()` (statfs-based mount resolution with APFS firmlink normalization), `resolve_path_volume_fast()` (builds `VolumeInfo` from statfs without enumerating volumes), and private helpers using `objc2`/`objc2_foundation`. |
10
10
|`watcher.rs`|`notify` (FSEvents) watcher on `/Volumes`. Detects mount/unmount by diffing against `KNOWN_VOLUMES`. Registers/unregisters with `VolumeManager` via `register_volume_with_manager`/`unregister_volume_from_manager` (coupling to `file_system::get_volume_manager()`). Emits `volume-mounted` / `volume-unmounted` Tauri events (still needed — `DualPaneExplorer` uses `volume-unmounted` with the volume path to redirect panes off ejected volumes). Triggers `volume_broadcast::emit_volumes_changed()` on changes. Spawns a mount-settle watcher that polls `fsid` until the volume metadata is ready. |
**Gotcha**: Use `is_smb_fs_type()` to detect SMB volumes, never raw `"smbfs"` / `"cifs"` string comparisons
58
+
**Why**: The helper in `mod.rs` handles both macOS (`smbfs`) and Linux (`cifs`) in one place. Raw string comparisons scatter platform knowledge and are easy to get wrong.
59
+
60
+
**Gotcha**: `LocationInfo` enrichment with `VolumeManager` data happens in two places
61
+
**Why**: `commands/volumes.rs::enrich_smb_connection_state` (for `list_volumes` IPC calls) and `volume_broadcast.rs::enrich_smb_connection_state` (for `volumes-changed` push events). Both must stay in sync. The pattern is: build the base `LocationInfo` from OS APIs, then cross-reference `VolumeManager` to add runtime state (`smb_connection_state`). If new enrichment fields are added, update both call sites.
62
+
55
63
## Key decisions
56
64
57
65
**Decision**: Use `OnceLock` for all three watcher statics (`APP_HANDLE`, `WATCHER`, `KNOWN_VOLUMES`)
0 commit comments