Skip to content

Commit 335331e

Browse files
committed
Favorites: ship 'Add to favorites' with no default shortcut
Adding a favorite is infrequent, so it doesn't earn a global key by default. It stays in the command palette and is assignable in Settings > Keyboard shortcuts (grouped under Main window). The native Go-menu item carries no accelerator until the user binds one, at which point the accelerator-sync pass fills it in. Frees up `\u2318D`, which dev builds still use for the (non-configurable) Debug window.
1 parent 608b8c8 commit 335331e

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

apps/desktop/src-tauri/src/menu/linux.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ pub(crate) fn build_menu_linux<R: Runtime>(
273273
true,
274274
Some("Cmd+J"),
275275
)?;
276-
let favorites_add_item = MenuItem::with_id(app, FAVORITES_ADD_ID, "&Add to favorites", true, Some("Cmd+Shift+D"))?;
276+
// No default accelerator: `favorites.add` ships without a default shortcut (synced from any
277+
// user-assigned shortcut later).
278+
let favorites_add_item = MenuItem::with_id(app, FAVORITES_ADD_ID, "&Add to favorites", true, None::<&str>)?;
277279

278280
let go_menu = Submenu::with_items(
279281
app,

apps/desktop/src-tauri/src/menu/macos.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ pub(crate) fn build_menu_macos<R: Runtime>(
296296
let go_to_path_item = MenuItem::with_id(app, GO_TO_PATH_ID, "Go to path\u{2026}", true, Some("Cmd+G"))?;
297297
let go_latest_download_item =
298298
MenuItem::with_id(app, GO_LATEST_DOWNLOAD_ID, "Go to latest download", true, Some("Cmd+J"))?;
299-
let favorites_add_item = MenuItem::with_id(app, FAVORITES_ADD_ID, "Add to favorites", true, Some("Cmd+Shift+D"))?;
299+
// No default accelerator: `favorites.add` ships without a default shortcut. The
300+
// accelerator-sync pass picks up whatever the user later binds in Settings > Keyboard shortcuts.
301+
let favorites_add_item = MenuItem::with_id(app, FAVORITES_ADD_ID, "Add to favorites", true, None::<&str>)?;
300302

301303
let go_menu = Submenu::with_items(
302304
app,

apps/desktop/src-tauri/src/menu/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ pub const GO_TO_PATH_ID: &str = "go_to_path";
153153
/// "Go to latest download" (⌘J): jumps the focused pane to the most recent download.
154154
pub const GO_LATEST_DOWNLOAD_ID: &str = "go_latest_download";
155155

156-
/// "Add to favorites" (⌘⇧D), menu bar + palette: maps to the `favorites.add` command, which favorites
157-
/// the focused pane's current folder. ⌘⇧D, not ⌘D, because dev builds bind ⌘D to "Open Debug window"
158-
/// (non-configurable) and the two would clash.
156+
/// "Add to favorites", menu bar + palette: maps to the `favorites.add` command, which favorites the
157+
/// focused pane's current folder. Ships with NO default shortcut (adding a favorite is infrequent);
158+
/// the menu item's accelerator stays empty until the user binds one in Settings > Keyboard shortcuts,
159+
/// at which point the accelerator-sync pass fills it in.
159160
pub const FAVORITES_ADD_ID: &str = "favorites_add";
160161

161162
/// "Add to favorites", folder-row + parent-row CONTEXT menus: favorites `MenuState.context.path`

apps/desktop/src/lib/commands/command-registry.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ export const commands: Command[] = [
156156
name: 'Add to favorites',
157157
scope: 'Main window',
158158
showInPalette: true,
159-
shortcuts: ['⌘⇧D'],
159+
// No default shortcut: adding a favorite is infrequent, so it doesn't earn a global key by
160+
// default. Stays in the command palette and is assignable in Settings > Keyboard shortcuts.
161+
shortcuts: [],
160162
description: "Add the focused pane's current folder to the switcher's Favorites.",
161163
keywords: ['bookmark', 'favorite', 'pin', 'shortcut'],
162164
},

0 commit comments

Comments
 (0)