Skip to content

Browser: support device APIs#322800

Merged
kycutler merged 3 commits into
mainfrom
kycutler/devices
Jun 24, 2026
Merged

Browser: support device APIs#322800
kycutler merged 3 commits into
mainfrom
kycutler/devices

Conversation

@kycutler

Copy link
Copy Markdown
Collaborator

Copilot AI review requested due to automatic review settings June 24, 2026 18:49
@kycutler kycutler self-assigned this Jun 24, 2026

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

Adds integrated-browser support for device-related permission flows (USB/Serial/HID/Bluetooth) by introducing a unified “Devices” permission category, wiring Electron device chooser events through the existing permission request pipeline, and surfacing selection UI in the workbench.

Changes:

  • Introduces PermissionCategory.Devices plus shared device request payload types (BrowserDeviceType, IBrowserDeviceCandidate).
  • Implements main-process device chooser handling (USB/Serial/HID via session events, Bluetooth via select-bluetooth-device) and a new selectDevice(...) API to return the user’s selection/cancellation.
  • Adds a workbench Quick Pick device chooser UI and extends unit tests for permission/category mapping defaults.
Show a summary per file
File Description
src/vs/workbench/contrib/browserView/electron-browser/features/browserPermissionsFeature.ts Adds a Quick Pick-based device chooser UI and routes device requests vs. standard permission prompts.
src/vs/workbench/contrib/browserView/common/browserView.ts Extends IBrowserViewModel with selectDevice(...) and forwards to the platform service.
src/vs/platform/browserView/test/common/browserPermissions.test.ts Adds coverage for Devices default state and permission-string-to-category mappings (usb/serial/hid).
src/vs/platform/browserView/electron-main/browserViewMainService.ts Exposes selectDevice(...) on the main-process browser view service.
src/vs/platform/browserView/electron-main/browserView.ts Hooks Bluetooth device selection into session permissions and forwards device requests to the workbench event stream.
src/vs/platform/browserView/electron-main/browserSessionPermissions.ts Implements unified device-request lifecycle, hot-plug updates, and request resolution by requestId.
src/vs/platform/browserView/common/browserView.ts Adds IBrowserViewDeviceRequest and optional device payload on permission request events; adds selectDevice(...) to service API.
src/vs/platform/browserView/common/browserPermissions.ts Adds the Devices permission category plus cross-IPC device candidate/type types and category descriptor metadata.

Copilot's findings

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

Comment thread src/vs/platform/browserView/electron-main/browserSessionPermissions.ts Outdated
Comment thread src/vs/platform/browserView/electron-main/browserView.ts
@kycutler kycutler marked this pull request as ready for review June 24, 2026 20:24
@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/platform/browserView/common/browserPermissions.ts
  • src/vs/platform/browserView/common/browserView.ts
  • src/vs/platform/browserView/electron-main/browserSessionPermissions.ts
  • src/vs/platform/browserView/electron-main/browserView.ts
  • src/vs/platform/browserView/electron-main/browserViewMainService.ts
  • src/vs/platform/browserView/test/common/browserPermissions.test.ts
  • src/vs/workbench/contrib/browserView/common/browserView.ts
  • src/vs/workbench/contrib/browserView/electron-browser/features/browserPermissionsFeature.ts

@kycutler kycutler merged commit e4e5ed0 into main Jun 24, 2026
28 checks passed
@kycutler kycutler deleted the kycutler/devices branch June 24, 2026 20:45
@vs-code-engineering vs-code-engineering Bot added this to the 1.127.0 milestone Jun 24, 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