Skip to content

feat(nav): the mouse forward button retraces a back - #236

Merged
thisisgm merged 1 commit into
thisisgm:mainfrom
t1nk333r:mouse-forward
Oct 6, 2026
Merged

thisisgm merged 1 commit into
thisisgm:mainfrom
t1nk333r:mouse-forward

Conversation

@t1nk333r

@t1nk333r t1nk333r commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What

The mouse's forward side button now goes forward through the history, retracing a back. Issue #20 / PR #49 bound only the back button; forward had no binding.

  • ui/WindowBody.qml: the window's side-button TapHandler accepts Qt.BackButton | Qt.ForwardButton and branches on the button. Both buttons share the existing overlay refusals (dialogs, preview, share overlay, path bar, rename editors). Forward does nothing while Trash is open, matching Pane.goForward; back still closes Trash. The file stays at its recorded 547 lines.
  • ui/js/Nav.js: adds mouseForward(pane). The context-menu and collision-card refusal mouseBack had is now one shared mouseRefused. With nothing ahead, forward does nothing: no climb, no listing request. A press during a load keeps its history entry, as forward already guards.
  • keys.toml: a second where = "window" pointer row (press = "forward", does = "forward") and forward in the does legend. ui/js/Keymap.js is regenerated.
  • AGENTS.md: updates the pointer-table paragraph, the back-button testing paragraph and the collision-card sentence that said no forward binding existed.

Tests

  • tests/js/navmouse.js (new, 6 checks): covers the back-then-forward round trip, nothing ahead, a press during a load, and refusal behind the context menu and behind the collision card. It is a separate suite because tests/js/nav.js is one line under its hard cap; it reuses nav.js's browsing() pane.
  • tests/js/tap.js: the pointer table now has 21 rows, 2 of them for the window.
  • tests/ui.sh case click: between its two back presses it now sends ydotool click 0xC4 (BTN_EXTRA, which Qt reports as Qt.ForwardButton), requires the path forward, and backs again, so the existing climb check still finds the history spent.

Verification

  • ./tests/js.sh: 5587 checks, 0 failed. ./tests/keymap-gen.sh: all ok. cargo test --release --locked: 1139 passed. tools/flea-qmllint-gate: 0 regressions. tools/flea-file-budget: no new growth.
  • On a real Hyprland window with real ydotool side-button presses, this branch's build passed 8 of 8: into a folder; back; forward; forward with nothing ahead stays put; back.
  • Not run: tests/ui.sh click itself, because omarchy-drive was not installed on the test box.

Summary by CodeRabbit

  • New Features
    • Mouse back and forward buttons now navigate directory history; back still climbs to the parent when no back history is available.
  • Bug Fixes
    • Side-button navigation is ignored when menus or collision cards are open. Forward navigation also does nothing when no forward history is available or Trash is open.
  • Tests
    • Added coverage for forward-history navigation, empty history, and interactions with active overlays and listings.

The window's side-button TapHandler now accepts Qt.ForwardButton beside
Qt.BackButton. Forward calls the new Nav.mouseForward, which goes forward
through the history behind the same context-menu and collision-card
refusal mouseBack uses (now one mouseRefused), does nothing with nothing
ahead, and never acts while Trash is open, as Pane.goForward refuses
there. The overlay refusals in ui/WindowBody.qml cover both buttons.

keys.toml declares the button as a window pointer row, with "forward" in
the does legend; ui/js/Keymap.js is regenerated.

Tests: tests/js/navmouse.js drives mouseForward (nav.js is at its hard
cap), tests/js/tap.js counts the new row, and tests/ui.sh case click
presses the real button (ydotool 0xC4) between its two back presses.
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3e26b034-d1d1-411d-b23c-87036e366284

📥 Commits

Reviewing files that changed from the base of the PR and between 58fc89f and 770c611.

📒 Files selected for processing (9)
  • AGENTS.md
  • keys.toml
  • tests/js/harness.qml
  • tests/js/navmouse.js
  • tests/js/tap.js
  • tests/ui.sh
  • ui/WindowBody.qml
  • ui/js/Keymap.js
  • ui/js/Nav.js

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The window now handles both back and forward mouse side buttons. Forward input follows pane history when available and is refused under specified overlays. JavaScript and UI tests cover forward navigation and its refusal conditions.

Changes

Mouse navigation

Layer / File(s) Summary
Forward-button handling
keys.toml, ui/WindowBody.qml, ui/js/Keymap.js, ui/js/Nav.js, AGENTS.md
The window binding adds the forward side button. Nav.mouseForward checks for an open context menu or collision card before following history. Back navigation retains its existing behavior. Documentation describes the bindings and refusal conditions.
Navigation tests and documentation
tests/js/navmouse.js, tests/js/harness.qml, tests/js/tap.js, tests/ui.sh, AGENTS.md
The test harness registers forward-navigation tests. Tests cover history round trips, empty forward history, in-flight listings, and open overlays. The UI test exercises forward and back navigation through the shipped window.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant WindowBody
  participant Nav
  participant Pane
  User->>WindowBody: Press forward side button
  WindowBody->>Nav: Call mouseForward(pane) unless Trash is open
  Nav->>Nav: Check mouseRefused(pane)
  Nav->>Pane: Follow forward history when navigation is not refused
Loading

Suggested reviewers: thisisgm

Merge Risk: ⚪ Minimal · up to 770c6

Forward side-button navigation follows existing history behavior while respecting overlays and Trash. No actionable merge-blocking risk is established; the window integration test remains unrun because its required tool was unavailable.

🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ❓ Inconclusive Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (5 skipped: 4… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: forward mouse-button navigation retraces back history. It is concise and directly related to the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (5 skipped: 4 unsupported, 1 too large.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.

Warning

Some tools did not complete. Review the errors below.

🔧 Biome (2.5.13)
tests/js/navmouse.js

File contains syntax errors that prevent linting: Line 1: Expected a statement but instead found '.'.; Line 1: Expected a semicolon or an implicit semicolon after a statement, but found none; Line 1: Expected a semicolon or an implicit semicolon after a statement, but found none; Line 2: Expected a semicolon or an implicit semicolon after a statement, but found none

tests/js/tap.js

File contains syntax errors that prevent linting: Line 1: Expected a statement but instead found '.'.; Line 1: Expected a semicolon or an implicit semicolon after a statement, but found none; Line 1: Expected a semicolon or an implicit semicolon after a statement, but found none; Line 2: Expected a semicolon or an implicit semicolon after a statement, but found none

ui/js/Keymap.js

File contains syntax errors that prevent linting: Line 1: Expected a statement but instead found '.pragma library'.

  • 1 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thisisgm
thisisgm merged commit 755a071 into thisisgm:main Oct 6, 2026
1 check passed
thisisgm added a commit that referenced this pull request Oct 6, 2026
PRs #239, #240 and #236 with GM corrections and the #244 side-column watch, advloop APPROVED r6.
Natives on 416c9c18: colwatch, watch, click and picker exit 0; suite lists merged as a union.
@thisisgm

thisisgm commented Oct 6, 2026

Copy link
Copy Markdown
Owner

merged as authored; the mouse forward button retraces a back (770c611, v0.3.8). Thanks @t1nk333r! https://github.com/thisisgm/flea/releases/tag/v0.3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants