Skip to content

fix(web): show the open-in-system-browser button while the URL is focused - #37118

Open
MohsinCoding wants to merge 1 commit into
pingdotgg:mainfrom
MohsinCoding:fix/preview-open-in-browser-focused
Open

MohsinCoding wants to merge 1 commit into
pingdotgg:mainfrom
MohsinCoding:fix/preview-open-in-browser-focused

Conversation

@MohsinCoding

@MohsinCoding MohsinCoding commented Nov 15, 2026 •

Copy link
Copy Markdown

Before and after

Recorded in the desktop dev build with a PDF open in the Browser panel. The captions describe each step.

before-after.mp4
Address bar before and after: idle and hovered are unchanged; with the URL focused and the pointer away, the open-in-system-browser button is missing before and shown after

Problem

In the Browser panel, the "Open in system browser" button disappears as soon as you click into the address bar. Hovering doesn't bring it back while the URL has focus. To open a page externally, for example a PDF that opened in the panel, you have to click away, hover the bar again, and then click the button.

To reproduce: open any page in the Browser panel, click into the address bar, and hover its right end. No button appears.

Expected: the button shows while the address bar is hovered or focused, and stays hidden otherwise.

Change

In PreviewChromeRow, the button was only rendered when !inputFocused. It also used focus-within on its own wrapper, which only applied when focus was on the button itself, never on the URL input.

  • Drop the !inputFocused check so the button stays mounted.
  • Switch focus-within: to group-focus-within/address: so the button shows whenever anything in the address bar has focus, including the URL input.

Hover and idle behavior are unchanged. The trade-off is that the URL field is about 24px narrower while focused.

#29537 fixes the same bug differently. While the URL is focused, it shows a second button on top of the input, only when the pointer is at the far right end. This PR is a 2-line alternative: the existing button is simply visible whenever the bar is focused, which is how it behaves when the bar is hovered. Hover and idle work as they do today.

The change is limited to PreviewChromeRow, which serves web and desktop. Mobile has no Browser address bar.

Scope

This is a small fix for an obvious bug, so it has no issue: the button can't be reached in exactly the state where you're looking at the URL. It adds no settings or new capability.

Verification

I checked this in the desktop (Electron) dev build on Windows, with a PDF open in the Browser panel. I drove the panel with Playwright over CDP and read the button's state in each case:

State Before After
Idle hidden hidden (unchanged)
Hovered shown shown (unchanged)
Focused, pointer away not rendered shown

The video and image at the top come from this run.

vp run check:changed passes: format, lint, knip, typecheck, react compiler.

Not checked: macOS, Linux, or the web-only client.

Claude Opus 5.5 via Claude Code

🤖 Generated with Claude Code

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 15, 2026
@MohsinCoding
MohsinCoding marked this pull request as ready for review November 15, 2026 22:10
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The open-in-system-browser control now appears when onOpenInBrowser is provided, including while the address input is focused. Its reveal styling responds to focus within the address group.

Changes: Address bar control

Layer / File(s) Summary
Focus-based visibility
apps/web/src/components/preview/PreviewChromeRow.tsx
The browser control renders when onOpenInBrowser exists. Its reveal styling responds to focus within the address group.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to a1637

The system-browser button now stays visible while the address bar is focused. The change is small, localized to one UI component, and easy to revert. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: the open-in-system-browser button now appears while the URL input is focused. It follows the conventional commit format and matches the raw summary, which describes renderi…
Description check Passed The description follows the template. It has a Problem section with reproduction steps and expected behavior, a Change section that explains the fix in PreviewChromeRow, a Scope section that explains …
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: Title check

Explanation

The title names the change: the open-in-system-browser button now appears while the URL input is focused. It follows the conventional commit format and matches the raw summary, which describes rendering the action when onOpenInBrowser is provided during focus and revealing it on address-group focus. The title is specific and does not use vague terms.

Full details: Description check

Explanation

The description follows the template. It has a Problem section with reproduction steps and expected behavior, a Change section that explains the fix in PreviewChromeRow, a Scope section that explains why no issue is linked, and a Verification section with a state table, the platform tested, and the checks run. It also states what was not checked. The Scope section gives a reason for omitting an issue but does not link one. The template asks for an issue link or a justification for a small obvious bug, and the justification is present. The description includes before/after visuals, as the UI-change requirement asks. It also names the model and harness used. Two items are weak. The Verification section does not describe the Playwright steps in detail. The PR does not link a maintainer request, which is not needed here.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2330861 and a1637ec.

Files selected for processing: 1

  • apps/web/src/components/preview/PreviewChromeRow.tsx

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

@maria-rcks

maria-rcks commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

Verified as-is on Linux with Playwright from the repo dependencies and /usr/bin/google-chrome. Ran vp i and real dev servers sequentially on github/main (03822a8312) and exact PR head 23308612b0307e593b25dab38ec708fcf194f133, with isolated state.

Created a real git project and threads through the web app. Real Codex gpt-6.1-sol turns created two linked HTML pages, started their server, and verified both routes. Opened that server through the Browser panel.

  • Main: focusing the URL removes the external-open button, including while hovering the address bar.
  • PR: with the URL focused and pointer away, the button remains visible and clickable. Clicking it opens http://localhost:8123/ in a new tab with the expected title and page content.
  • Nearby behavior passes: idle hides the button, hover reveals it, Tab reaches it, Escape cancels an edited URL, Enter navigates, and Back, Forward, and Refresh work.

No source changes or pushes. Existing CI checks pass at this head. The recording below is an animated GIF for GitHub rendering; the MP4 was also checked for playback and seeking in the T3 browser.

main: focused address bar has no external-open button

pr: same page and focused address bar retain the external-open button

pr: hover, focus, external-open click, URL navigation, and back

Not verified

Native Electron external-browser dispatch and OS browser selection were not exercised; this run used the web client's real new-tab path. No macOS, Windows, native iOS/Android, PDF-specific, relay, or tunnel verification was performed. Mobile has no Browser address bar.

@github-actions

Copy link
Copy Markdown
Contributor

This PR conflicts with main. Rebase it or merge main into it. If it still conflicts after 7 days with no activity, it will be closed automatically.

See the conflict window.

@github-actions github-actions Bot added the needs-rebase Conflicts with its base branch. Closes after 7 days with no activity. label Nov 27, 2026
…used

The address bar unmounted the button whenever the URL input had focus, so
hovering could not bring it back while editing. Keep it mounted and reveal
it on hover or when anything in the address bar has focus.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@MohsinCoding
MohsinCoding force-pushed the fix/preview-open-in-browser-focused branch from 2330861 to a1637ec Compare November 30, 2026 01:12
@github-actions github-actions Bot removed the needs-rebase Conflicts with its base branch. Closes after 7 days with no activity. label Nov 30, 2026

This branch has not been deployed

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

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants