fix: wire the mouse side buttons to back and forward - #39
Merged
Merged
Conversation
The README has always said the mouse's side buttons retrace the visited directories, and on_mouse_down had the two MouseButton::Navigate arms for it, but nothing ever delivered buttons 8 and 9: the mosaic registered listeners per button, for Left and Middle only. The arms were dead code. Replaced the two registrations with on_any_mouse_down, so every button reaches on_mouse_down and the Navigate arms work. One listener rather than four, and the per-button form would have needed a new registration for each button the platform names. Guarded the arms on Screen::Explore, matching the alt-arrow path: on the review screen the marked list is not somewhere history should move. The help screen and the hover card on `<` and `>` named only the keys, so the in-app bindings were narrower than the README's. Both now mention the side buttons.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The README has always documented that the mouse's side buttons retrace the visited directories, and
Disktree::on_mouse_downhad the twoMouseButton::Navigatearms for exactly that. But the mosaic registered its mouse-down listeners per button, forLeftandMiddleonly, so buttons 8 and 9 never reachedon_mouse_downand the arms were dead code. The keys (alt ←alt →,⌘[⌘]) and the header</>buttons worked, which is why this went unnoticed.Fix
on_any_mouse_down, so every button reacheson_mouse_downand the existingNavigatearms work. One listener instead of four, and the per-button form would have needed a registration per button the platform names.Navigatearms onScreen::Explore, matching the alt-arrow path. On the review screen the marked list is not somewhere history should move.treemapdebug selector, so the harness test can aim at the mosaic the way a person aims with the pointer.</>named only the keys, so the in-app bindings were narrower than the README's. Both now mention the side buttons.Verification
cargo xtask ciis green: rustfmt, clippy with the workspace's pedantic and nursery lints at-D warnings, then 55 window-harness tests and 105 core tests.The new test
mouse_side_buttons_go_back_and_forwarddrives the real window harness: it descends twice, presses button 8 over the mosaic and asserts the crumbs retrace, presses button 9 and asserts they return, then enters the review screen and asserts a further press 8 changes nothing.That test synthesizes the
MouseDownEvent, so it proves the wiring, not that a compositor delivers button 8.gpui-predoes map them: buttons 8/9 on X11,BTN_BACK/BTN_SIDEandBTN_FORWARD/BTN_EXTRAon Wayland, andXBUTTON1/XBUTTON2on Windows. There is no mapping ingpui-pre-apple, so side buttons stay macOS-dead, where the keys and the header buttons are the whole story.Checked by hand on Linux (Hyprland) with a real mouse: buttons 8 and 9 retrace the history from over the mosaic, and do nothing on the review screen.