Summary
Add support for integrating third-party shell context menu extensions (like 7-Zip, WinRAR, "Open with Code", etc.) into Marlin's file context menu. These are the custom menu items that applications register with the operating system to appear in native file explorers.
Current State
The app currently uses a hybrid context menu approach:
- Native Tauri menus as primary (
show_native_context_menu in src-tauri/src/commands.rs:4438-4688)
- React fallback component (
src/components/ContextMenu.tsx)
Current menu items are all internal to Marlin:
- File operations (Rename, Copy, Cut, Paste, Delete, Trash)
- View preferences (Hidden files, Sort options)
- Utilities (Copy path, Calculate size, Reveal symlink)
No integration exists with OS-level shell extensions - the context menu only shows Marlin's own actions.
Proposed Changes
Windows (Primary target - most common use case)
Windows shell extensions are registered in the registry under:
HKEY_CLASSES_ROOT\*\shell\ - All files
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\ - COM-based handlers
HKEY_CLASSES_ROOT\Directory\shell\ - Folders
HKEY_CLASSES_ROOT\<extension>\shell\ - Specific file types
Approach options:
- Registry parsing - Read registry keys to discover shell commands and add them to our menu
- IContextMenu COM interface - Use Windows COM APIs to invoke the actual shell context menu (more complete but complex)
- Hybrid - Parse registry for simple commands, provide "Show in Explorer" for complex handlers
macOS
- Finder extensions use the
FinderSync framework
- Services menu items are registered in
~/Library/Services/ and /Library/Services/
- Quick Actions appear in Finder's context menu
- Consider: Reading services plist files and/or providing "Reveal in Finder" for full native menu access
Linux
- Desktop files in
/usr/share/applications/ define actions
- Nautilus/Dolphin/Thunar each have their own extension mechanisms
*.desktop files can specify MimeType associations and custom actions
- freedesktop.org specifications for file manager integration
Technical Notes
Relevant files:
src-tauri/src/commands.rs - Native context menu builder (lines 4438-4688)
src-tauri/src/menu.rs - Menu event handling
src/components/MainPanel.tsx - Right-click detection (lines 94-179)
Platform abstraction pattern already exists:
#[cfg(target_os = "macos")]
mod native_drag;
#[cfg(target_os = "windows")]
use windows::...
Existing Windows dependencies in Cargo.toml:
[target.'cfg(target_os = "windows")'.dependencies]
windows = { version = "0.62", features = ["Win32_Storage_FileSystem", ...] }
Would need to add registry and potentially shell features to the Windows crate.
Acceptance Criteria
Additional Context
This is a common expectation for power users switching from native file explorers. Windows is the highest priority since shell extensions are most prevalent there (7-Zip, WinRAR, TortoiseSVN/Git, VS Code, etc.).
Research links:
Summary
Add support for integrating third-party shell context menu extensions (like 7-Zip, WinRAR, "Open with Code", etc.) into Marlin's file context menu. These are the custom menu items that applications register with the operating system to appear in native file explorers.
Current State
The app currently uses a hybrid context menu approach:
show_native_context_menuinsrc-tauri/src/commands.rs:4438-4688)src/components/ContextMenu.tsx)Current menu items are all internal to Marlin:
No integration exists with OS-level shell extensions - the context menu only shows Marlin's own actions.
Proposed Changes
Windows (Primary target - most common use case)
Windows shell extensions are registered in the registry under:
HKEY_CLASSES_ROOT\*\shell\- All filesHKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\- COM-based handlersHKEY_CLASSES_ROOT\Directory\shell\- FoldersHKEY_CLASSES_ROOT\<extension>\shell\- Specific file typesApproach options:
macOS
FinderSyncframework~/Library/Services/and/Library/Services/Linux
/usr/share/applications/define actions*.desktopfiles can specifyMimeTypeassociations and custom actionsTechnical Notes
Relevant files:
src-tauri/src/commands.rs- Native context menu builder (lines 4438-4688)src-tauri/src/menu.rs- Menu event handlingsrc/components/MainPanel.tsx- Right-click detection (lines 94-179)Platform abstraction pattern already exists:
Existing Windows dependencies in
Cargo.toml:Would need to add registry and potentially shell features to the Windows crate.
Acceptance Criteria
Additional Context
This is a common expectation for power users switching from native file explorers. Windows is the highest priority since shell extensions are most prevalent there (7-Zip, WinRAR, TortoiseSVN/Git, VS Code, etc.).
Research links: