Skip to content

Browser: never focus a URL suggestion by default#320239

Merged
kycutler merged 2 commits into
mainfrom
kycutler/urlfocus
Jun 6, 2026
Merged

Browser: never focus a URL suggestion by default#320239
kycutler merged 2 commits into
mainfrom
kycutler/urlfocus

Conversation

@kycutler
Copy link
Copy Markdown
Contributor

@kycutler kycutler commented Jun 6, 2026

No description provided.

Copilot AI review requested due to automatic review settings June 6, 2026 15:53
@kycutler kycutler self-assigned this Jun 6, 2026
@kycutler kycutler enabled auto-merge (squash) June 6, 2026 15:53
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering Bot commented Jun 6, 2026

📬 CODENOTIFY

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

@jruales

Matched files:

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the Integrated Browser URL picker’s focus behavior so asynchronously streamed URL suggestions never become the active (focused) item by default, keeping focus on the synchronous default (“Go to …”) entry unless the user explicitly selects a suggestion.

Changes:

  • Update URL picker rendering to explicitly control activeItems, distinguishing between user typing (reset to default) and background provider refreshes (preserve current selection).
  • Add regression tests covering “no auto-focus on streamed suggestions” and “preserve selection on refresh, reset on typing”.
Show a summary per file
File Description
src/vs/workbench/contrib/browserView/electron-browser/widgets/browserUrlBarWidget.ts Explicitly manages quick pick active item to prevent async suggestions from stealing focus; preserves selection on background refresh.
src/vs/workbench/contrib/browserView/test/electron-browser/widgets/browserUrlBarWidget.test.ts Adds tests validating the new focus/selection behavior across streaming and refresh scenarios.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +524 to +525
const suggestion = picker.items.find((i): i is IQuickPickItem => i.type !== 'separator' && i.id === 'tab-1')!;
picker.activeItems = [suggestion];
@kycutler kycutler merged commit 4d36841 into main Jun 6, 2026
25 checks passed
@kycutler kycutler deleted the kycutler/urlfocus branch June 6, 2026 19:39
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 6, 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.

3 participants