Skip to content

Fix browser URL focus quirks#322995

Merged
kycutler merged 2 commits into
mainfrom
kycutler/focus
Jun 25, 2026
Merged

Fix browser URL focus quirks#322995
kycutler merged 2 commits into
mainfrom
kycutler/focus

Conversation

@kycutler

Copy link
Copy Markdown
Collaborator

Fixes #322559

Copilot AI review requested due to automatic review settings June 25, 2026 17:53
@kycutler kycutler self-assigned this Jun 25, 2026
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jruales

Matched files:

  • src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts
  • src/vs/workbench/contrib/browserView/electron-browser/features/browserNavigationFeatures.ts
  • src/vs/workbench/contrib/browserView/electron-browser/widgets/browserUrlBarWidget.ts
  • src/vs/workbench/contrib/browserView/test/electron-browser/widgets/browserUrlBarWidget.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses focus-driven UX quirks in the integrated browser URL bar, specifically preventing the URL picker/dropdown from auto-opening during workspace/window switching or certain focus transfers.

Changes:

  • Updates the URL bar’s focus/click state machine to avoid auto-opening the picker on already-focused clicks and to ignore focus transfers coming from quick input/outside-workbench scenarios.
  • Defers browser editor URL-focus behavior by one tick during tab activation to reduce focus contention with the tab control.
  • Adds coverage for the new click/focus behavior and clears document selection when forcing browser-container focus.
Show a summary per file
File Description
src/vs/workbench/contrib/browserView/test/electron-browser/widgets/browserUrlBarWidget.test.ts Adds new tests for picker-open behavior on focused vs mouse-focused clicks.
src/vs/workbench/contrib/browserView/electron-browser/widgets/browserUrlBarWidget.ts Refines focus/click handling to prevent unwanted picker auto-open and to account for quick input focus transfers.
src/vs/workbench/contrib/browserView/electron-browser/features/browserNavigationFeatures.ts Defers tryFocus() behavior by one macrotask to avoid tab activation focus conflicts.
src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts Clears selection ranges when forcing focus to the browser container.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 3

@kycutler kycutler enabled auto-merge (squash) June 25, 2026 18:13
@kycutler kycutler merged commit e11b160 into main Jun 25, 2026
29 checks passed
@kycutler kycutler deleted the kycutler/focus branch June 25, 2026 18:40
@vs-code-engineering vs-code-engineering Bot added this to the 1.127.0 milestone Jun 25, 2026
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.

Switching to a workspace with browser open triggers URL bar dropdown

3 participants