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
Copy file name to clipboardExpand all lines: apps/desktop/src-tauri/src/commands/CLAUDE.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,13 @@ immediately to business-logic modules. No significant logic lives here.
33
33
-**Platform gates.**`volumes` is macOS-only; `mtp` and `network` are macOS+Linux; `volumes_linux` is Linux-only. Individual functions also use `#[cfg]` where behaviour differs (e.g., `sync_status`).
34
34
-**`start_selection_drag`** requires the main thread. It uses `app.run_on_main_thread()` plus a `std::sync::mpsc` channel to return the result synchronously.
35
35
-**`list_shares_with_credentials`** has `#[allow(clippy::too_many_arguments)]` because Tauri command parameters must be top-level arguments — no struct bundling.
36
+
-**`set_menu_context` and Close tab (⌘W).** When the main window loses focus, `set_menu_context("other")` disables all
37
+
non-App menu items — but `CLOSE_TAB_ID` is explicitly excluded. On macOS, ⌘W means "close the front window," and the
38
+
`on_menu_event` close-tab exception handles this: if main is focused it closes a tab, otherwise it closes the focused
39
+
non-main window (Settings, viewer, debug). If `CLOSE_TAB_ID` were disabled, its accelerator wouldn't fire and ⌘W would
40
+
stop working in non-main windows. This is the only item that needs this exemption — all other non-App items are
41
+
correctly disabled because they only make sense in the explorer.
42
+
36
43
## Dependencies
37
44
38
45
All major subsystems: `file_system`, `volumes`, `mtp`, `network`, `font_metrics`, `icons`,
0 commit comments