Skip to content

Remove the system-wide keybindings first-run dialog#324045

Open
ulugbekna wants to merge 2 commits into
mainfrom
ulugbekna/remove-system-wide-keybindings-notice
Open

Remove the system-wide keybindings first-run dialog#324045
ulugbekna wants to merge 2 commits into
mainfrom
ulugbekna/remove-system-wide-keybindings-notice

Conversation

@ulugbekna

Copy link
Copy Markdown
Contributor

Follow-up to #323871.

Why

We got feedback that the first-run notice for system-wide keybindings can pop up in more than one window at the same time on startup. The feature had a main-process "elect one window" mechanism meant to prevent that, but it was racy across renderers that sync concurrently, so the notice still leaked into multiple windows.

Rather than harden the election, we're removing the dialog entirely. The feature is always on, and a user who marks a keybinding "systemWide": true in keybindings.json already knows what they are doing, so a one-time notice adds little.

What

Deletes the whole notice path, which only existed to serve that dialog:

  • Renderer (systemWideKeybindings.contribution.ts): drops the first-run notification, the acknowledged-storage gate, and the IDialogService/IStorageService dependencies. sync() now just warns about ignored when clauses and pushes bindings to the main process.
  • Main process (globalKeybindingsMainService.ts, nativeHostMainService.ts): drops the elected-window bookkeeping, so INativeSystemWideKeybindingResult reports only registration failures.
  • Schema / tests: updates the systemWide description in the keybindings.json schema and removes the now-obsolete election unit tests.

Global registration and trigger routing are unchanged.

Notes for reviewers

The diff is a net removal (+17 / -63 across 5 files). It builds on an unmerged follow-up that had added the election machinery, so the squashed change relative to main cleanly deletes the dialog without leaving native.ts or the test service mock touched.

How to test

  1. Add a systemWide keybinding to keybindings.json, e.g. { "key": "ctrl+cmd+a", "command": "workbench.action.openAgentsWindow", "systemWide": true }.
  2. Restart with multiple windows open and confirm no first-run dialog appears in any window.
  3. Confirm the keybinding still registers and triggers the command system-wide.

The first-run notice could appear in multiple windows at once on startup, and
the single-window election meant to prevent that was racy across concurrently
syncing renderers. Rather than harden the election, remove the dialog entirely:
the feature is always on and users who opt a keybinding into "systemWide" know
what they are doing.

This deletes the whole notice path, which existed only to serve the dialog:
- renderer: drop the first-run notification, the acknowledged-storage gate, and
  the IDialogService/IStorageService deps; sync() now just warns about ignored
  when-clauses and pushes to the main process.
- main process: drop the elected-window bookkeeping so INativeSystemWideKeybindingResult
  only reports failures.
- update the systemWide keybindings.json schema description and drop the
  now-obsolete election unit tests.

Global registration and trigger routing are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 2, 2026 12:06
@ulugbekna ulugbekna enabled auto-merge (squash) July 2, 2026 12:06

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

Removes the first-run “system-wide keybindings” notice path to avoid racy multi-window startup behavior, keeping the underlying global shortcut registration/routing intact while simplifying the renderer↔main-process sync contract.

Changes:

  • Drops the renderer-side first-run dialog, storage gating, and related service dependencies; sync now only warns about ignored when clauses and pushes keybindings to the main process.
  • Simplifies main-process sync results to report only registration failures via INativeSystemWideKeybindingResult.
  • Updates schema text and adapts unit tests to the updated return shape.
Show a summary per file
File Description
src/vs/workbench/services/keybinding/browser/keybindingService.ts Updates the systemWide schema description to remove the first-run notice wording.
src/vs/workbench/contrib/keybindings/electron-browser/systemWideKeybindings.contribution.ts Removes the first-run dialog/storage gate and leaves only warning + sync behavior.
src/vs/platform/native/electron-main/nativeHostMainService.ts Returns the main-service result directly from syncSystemWideKeybindings (failures only).
src/vs/platform/globalKeybindings/test/electron-main/globalKeybindingsMainService.test.ts Updates tests to destructure { failed } from the new result shape.
src/vs/platform/globalKeybindings/electron-main/globalKeybindingsMainService.ts Changes updateKeybindings to return INativeSystemWideKeybindingResult instead of a raw string array.

Review details

  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Low

@ulugbekna ulugbekna closed this Jul 2, 2026
auto-merge was automatically disabled July 2, 2026 13:37

Pull request was closed

@ulugbekna ulugbekna reopened this Jul 2, 2026
alexr00
alexr00 previously approved these changes Jul 2, 2026
Co-locate an architecture/spec document next to the renderer contribution so
future work has the full feature context (user contract, renderer<->main-process
flow, the systemWide flag plumbing, design rationale, tests, and gotchas).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

4 participants