feat(web): open the preview page in the system browser from the menu - #10833
feat(web): open the preview page in the system browser from the menu#10833sti0 wants to merge 1 commit into
Conversation
The integrated browser's more menu offered a hard reload, DevTools, a separate preview window and the device toolbar, but no way to hand the current page to the OS default browser. The only entry point was the hover-reveal button inside the URL input, which is easy to miss. PreviewMoreMenu gains an onOpenInBrowser prop and a menu item "Open in system browser", placed after "Open separate preview window" and disabled under the same condition as its neighbours. PreviewView passes the existing handleOpenInBrowser handler through, the same path the chat's right-click "Open in system browser" already takes.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This adds a small desktop menu item that reuses the existing system-browser handler, without changing existing navigation behavior or contracts. The focused tests cover the current URL and the no-URL case, keeping the change isolated and low risk. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe preview more menu adds an “Open in system browser” action. ChangesPreview browser action
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The preview menu now opens the active page in the system browser while preserving the existing disabled behavior and no-op handling for empty tabs. No merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant PreviewMoreMenu
participant PreviewView
participant localApi.shell
participant SystemBrowser
PreviewMoreMenu->>PreviewView: Invoke onOpenInBrowser
PreviewView->>localApi.shell: Pass active tab URL to openExternal
localApi.shell->>SystemBrowser: Open active tab URL
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What Changed
The integrated browser's ⋮ menu gets an "Open in system browser" item that hands the page the tab is showing to the OS default browser.
PreviewMoreMenugains anonOpenInBrowserprop and the menu item, placed directly after "Open separate preview window" and disabled under the same condition as its neighbours.PreviewViewpasses the existinghandleOpenInBrowserhandler through. That is the same path the chat's right-click "Open in system browser" already takes:localApi.shell.openExternal→desktopBridge.openExternal→ IPC →Electron.shell.openExternal. Same label, same destination, one more way in.PreviewView.test.tsxcovers the new path: the menu hands over the address the tab is actually showing, and a tab with no page opens nothing. Removing theonOpenInBrowserline fromPreviewViewturns the test red. Reaching the shell from that suite needed a window before the module import, becausePreviewViewresolves the local API once at module scope behind atypeof windowguard.Two single-line insertions in the components plus the test.
Why
The menu offered Hard reload, DevTools, a separate preview window and the device toolbar, but no way to hand the current page to the system browser. The only entry point was the hover-reveal button inside the URL input, which is easy to miss. Reusing the existing handler keeps the menu and the URL-input button on one code path.
Surfaces
UI Changes
Clicked in a real desktop client built from this branch (AppImage on Fedora Kinoite). The item opens the page the tab is showing in the system browser.
Checklist
Claude Fable 5.1 via Claude Code inside T3 Code (test and desktop verification: Claude Opus 5).
Created with AI assistance (Klaus/Claude), reviewed by Timo.
Summary by CodeRabbit
New Features
Tests