Summary
macOS mouse side buttons (back/forward) do not trigger navigation in the app. Users expect these buttons to work like in web browsers and other native apps.
Current Behavior
- ✅ Keyboard shortcuts work (
Cmd+[ / Cmd+])
- ✅ Header UI buttons work (◀ ▶)
- ❌ Mouse side buttons (button 3/4) do nothing
- ❌ Trackpad two-finger swipe gestures do not work
Technical Analysis
The current implementation only handles left-click (0) and middle-click (1) in the WebView:
// markdown.rs
if (event.button === 0 || event.button === 1) {
event.preventDefault();
window.handleMarkdownLinkClick('{escaped_href}', event.button);
}
Mouse back/forward buttons (button: 3 for back, button: 4 for forward) are not captured anywhere in the application.
Proposed Solution
Add a document-level mousedown event listener in the WebView to detect button 3/4 and invoke the existing GoBack/GoForward navigation logic:
- Inject a global JavaScript listener for
mousedown events
- When
event.button === 3 (back) or event.button === 4 (forward), call a Rust handler
- Reuse the existing
HistoryManager navigation methods
Related Files
desktop/src/history.rs - History management (already implemented)
desktop/src/components/content/file_viewer.rs - WebView event handling
desktop/src/menu.rs - Menu handler for GoBack/GoForward
desktop/src/components/header.rs - UI button handlers
Notes
- Keyboard shortcuts use muda's
Accelerator which only supports keyboard Code, not mouse buttons
- Trackpad gestures may require OS-level event handling (separate from this issue)
Summary
macOS mouse side buttons (back/forward) do not trigger navigation in the app. Users expect these buttons to work like in web browsers and other native apps.
Current Behavior
Cmd+[/Cmd+])Technical Analysis
The current implementation only handles left-click (0) and middle-click (1) in the WebView:
Mouse back/forward buttons (
button: 3for back,button: 4for forward) are not captured anywhere in the application.Proposed Solution
Add a document-level
mousedownevent listener in the WebView to detect button 3/4 and invoke the existingGoBack/GoForwardnavigation logic:mousedowneventsevent.button === 3(back) orevent.button === 4(forward), call a Rust handlerHistoryManagernavigation methodsRelated Files
desktop/src/history.rs- History management (already implemented)desktop/src/components/content/file_viewer.rs- WebView event handlingdesktop/src/menu.rs- Menu handler forGoBack/GoForwarddesktop/src/components/header.rs- UI button handlersNotes
Acceleratorwhich only supports keyboardCode, not mouse buttons