fix: Mouse Back/Forward support in webviews + few bugfixes#3141
fix: Mouse Back/Forward support in webviews + few bugfixes#3141mswiszcz wants to merge 4 commits intowavetermdev:mainfrom
Conversation
mswiszcz
commented
Mar 27, 2026
- Add Mouse-3/Mouse-4 (back/forward) navigation support in webviews
- Add COLORTERM=truecolor env variable for terminal sessions
- Fix AI button width calculation when button is hidden
- Fix setSizeAndPosition animation on tab layout updates
- Increase DevInitTimeout for slower startup scenarios
- Update .gitignore and package-lock.json
- Add Mouse-3/Mouse-4 (back/forward) navigation support in webviews - Add COLORTERM=truecolor env variable for terminal sessions - Fix AI button width calculation when button is hidden - Fix setSizeAndPosition animation on tab layout updates - Increase DevInitTimeout for slower startup scenarios - Adjust background opacity for better visual consistency - Update .gitignore and package-lock.json
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughThis pull request adds mouse-button back/forward navigation: a preload script listens for mouseup of buttons 3/4 and sends IPC; the main process adds a Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes DetailsChanges are heterogeneous across renderer preload, main process IPC and window/tab lifecycle, frontend tabbar sizing, gitignore, and a small Go env-var addition. The most involved review area is 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@emain/emain-window.ts`:
- Around line 464-466: The code skips reinitialization when tabView.isWaveReady
is true, but doesn't verify the savedInitOpts.windowId matches the current
window context (this.waveWindowId), risking stale windowId reuse; update the
branch guarding reuse (where tabView.isWaveReady is checked before calling
finalizePositioning) to validate tabView.savedInitOpts.windowId ===
this.waveWindowId and if it mismatches, clear or reset savedInitOpts and set
tabView.isWaveReady = false so the normal wave-init runs (or log and throw if
you prefer strict enforcement); alternatively add a clear comment above the
check documenting the architectural assumption if you choose not to implement
the runtime validation.
In `@emain/preload-webview.ts`:
- Around line 28-33: The mouseup listener currently sends IPC for any event,
allowing page scripts to synthesize navigation events; modify the
document.addEventListener("mouseup", ...) handler to reject non-user input by
checking event.isTrusted (and optionally that event is a MouseEvent and button
is 3 or 4) before calling ipcRenderer.send("webview-mouse-navigate", ...), so
only trusted user-initiated mouse events trigger back/forward navigation.
In `@pkg/util/shellutil/shellutil.go`:
- Line 225: The code unconditionally sets COLORTERM="truecolor"
(rtn["COLORTERM"] = "truecolor"), which overwrites any user value when merged
into envs used by RunCmdInPty and RunSimpleCmdInPty; change this to only set
COLORTERM when it is not already present—i.e., check for an existing COLORTERM
in the environment map (or os.Environ() derived map) and only assign "truecolor"
if absent so user-defined COLORTERM is preserved.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 66b1bd9c-8353-4309-84f4-a9630b7823ed
📒 Files selected for processing (6)
.gitignoreemain/emain-ipc.tsemain/emain-window.tsemain/preload-webview.tsfrontend/app/tab/tabbar.tsxpkg/util/shellutil/shellutil.go
- Add event.isTrusted guard to webview mouse navigation to prevent synthetic event injection - Only set COLORTERM=truecolor when not already set by user - Validate windowId when reusing wave-ready tabs across windows Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review SummaryStatus: No New Issues | Recommendation: Merge The changes implement mouse back/forward navigation, COLORTERM support, and various bug fixes as described. No new issues identified beyond existing comments. Files Reviewed (6 files)
Reviewed by minimax-m2.5-20260211 · 533,858 tokens |