Repository navigation
Add mouse side-button tab navigation - #6669
sdhilip200 wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthroughTwo tab-navigation paths are added. In the main process, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/main/window/createMainWindow.ts (1)
324-330: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd the missing “Why” on the
app-commandbridge.Forwarding
browser-backward/browser-forwardintoui:switchTabAcrossAllTypesis not obvious from the code alone. A short note here that this exists because Electron can surface side-button input asapp-commandevents would match the rest of this file and make the main/renderer split easier to preserve.As per coding guidelines,
**/*.{ts,tsx,js,jsx}: When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does.Source: Coding guidelines
src/renderer/src/hooks/useMouseTabNavigation.ts (1)
21-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a short “Why” comment above these global capture listeners.
Using capture-phase
mousedown/mouseup/auxclickhandlers and swallowing defaults is non-obvious. Please document the reason here so this doesn’t get “simplified” later.As per coding guidelines,
**/*.{ts,tsx,js,jsx}: When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 26a0adba-f5f1-4647-bb0f-00a2c4dc65c5
📥 Commits
Reviewing files that changed from the base of the PR and between 7c6f88b and 9fefcc7a91e29406b64e8c46c1f87fd371fe5c83.
📒 Files selected for processing (5)
src/main/window/createMainWindow.test.tssrc/main/window/createMainWindow.tssrc/renderer/src/App.tsxsrc/renderer/src/hooks/useMouseTabNavigation.test.tsxsrc/renderer/src/hooks/useMouseTabNavigation.ts
030fcff to
d0fd343
Compare
|
Rebased onto current \ and resolved the conflict in \ by keeping the newer traffic-light positioning comment and retaining the mouse side-button tab-switch helper from this PR. Force-pushed the updated branch. I couldn’t run the targeted Vitest/typecheck commands in this worktree because the checkout here does not have installed Node dependencies. |
Summary
browser-backward/browser-forwardapp commands from the main window so side-button navigation also works when Electron emits app-command events.Closes #6658.
Screenshots
No visual change.
Testing
./node_modules/.bin/vitest run --config config/vitest.config.ts src/main/window/createMainWindow.test.ts src/main/browser/browser-guest-ui.test.ts src/renderer/src/hooks/useMouseTabNavigation.test.tsx./node_modules/.bin/oxlint src/main/window/createMainWindow.ts src/main/window/createMainWindow.test.ts src/main/browser/browser-guest-ui.ts src/main/browser/browser-guest-ui.test.ts src/main/browser/browser-manager.ts src/renderer/src/App.tsx src/renderer/src/hooks/useMouseTabNavigation.ts src/renderer/src/hooks/useMouseTabNavigation.test.tsx./node_modules/.bin/tsgo --noEmit -p config/tsconfig.node.json./node_modules/.bin/tsgo --noEmit -p config/tsconfig.tc.web.json./node_modules/.bin/tsgo --noEmit -p config/tsconfig.tc.cli.jsongit diff --checkAI Review Report
MouseEvent.buttonhandling covers normal app chrome without OS-specific code; Electron app-command handling coversbrowser-backward/browser-forwardevents emitted for mouse back/forward buttons on supported desktop platforms.ui:switchTabAcrossAllTypes/handleSwitchTabAcrossAllTypestab navigation path instead of introducing a separate tab-history model.Security Audit
browser-backward/browser-forwardapp commands to an existing renderer navigation channel.ELI5
Mouse side buttons (back/forward) switch to the previous or next visible tab. Works both from renderer mouse events and Electron’s app-command path.