Skip to content

scm: allow diffDecorationsGutterWidth up to 10px#316395

Open
Priyanshu-byte-coder wants to merge 2 commits into
microsoft:mainfrom
Priyanshu-byte-coder:fix/scm-gutter-width-max-increase
Open

scm: allow diffDecorationsGutterWidth up to 10px#316395
Priyanshu-byte-coder wants to merge 2 commits into
microsoft:mainfrom
Priyanshu-byte-coder:fix/scm-gutter-width-max-increase

Conversation

@Priyanshu-byte-coder
Copy link
Copy Markdown

Closes #278083

Problem

scm.diffDecorationsGutterWidth is constrained to the values [1, 2, 3, 4, 5] via a JSON Schema enum. This means:

  • The Settings UI renders a dropdown instead of a number input, which feels wrong for a width value.
  • Users who want a wider gutter (e.g. on HiDPI / high-resolution displays) are blocked at 5 px.

Fix

Replace the enum array with minimum: 1 / maximum: 10 so the Settings UI shows a number input and any integer in that range is valid.

Also raise the runtime safety guard in quickDiffDecorator.ts from width > 5 to width > 10 to stay consistent — values outside [1, 10] still fall back to the default of 3.

Changes

File Change
src/vs/workbench/contrib/scm/browser/scm.contribution.ts enum: [1,2,3,4,5]minimum: 1, maximum: 10
src/vs/workbench/contrib/scm/browser/quickDiffDecorator.ts width > 5width > 10

Fixes microsoft#278083 — the previous enum [1,2,3,4,5] prevented users from
setting the SCM diff gutter wider than 5px. Replace enum constraint
with minimum/maximum so the Settings UI renders a number input
instead of a dropdown, letting users choose any integer from 1–10.
Keeps the runtime guard consistent with the new maximum of 10 set in
the configuration schema. Values outside 1–10 still fall back to the
default of 3.
Copilot AI review requested due to automatic review settings May 14, 2026 11:49
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

@lszomoru

Matched files:

  • src/vs/workbench/contrib/scm/browser/quickDiffDecorator.ts
  • src/vs/workbench/contrib/scm/browser/scm.contribution.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

Raises the allowed range for scm.diffDecorationsGutterWidth from [1..5] to [1..10] and switches the schema from an enum to minimum/maximum, so the Settings UI renders a number input and HiDPI users can choose a wider gutter.

Changes:

  • Replace enum: [1,2,3,4,5] with minimum: 1, maximum: 10 in the configuration schema.
  • Update runtime validation guard to accept widths up to 10 (still falling back to default 3 otherwise).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs/workbench/contrib/scm/browser/scm.contribution.ts Schema change from enum to numeric range (1–10).
src/vs/workbench/contrib/scm/browser/quickDiffDecorator.ts Bumps the upper bound in the runtime safety check from 5 to 10.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Author

@lszomoru you were notified via CODENOTIFY for the files changed here. Copilot reviewed both files and raised no issues. The change is small:

  • scm.contribution.ts: swap enum: [1,2,3,4,5]minimum: 1, maximum: 10 so the Settings UI renders a number input instead of a dropdown, and HiDPI users can set wider gutter widths
  • quickDiffDecorator.ts: bump the runtime guard from width > 5 to width > 10 to stay consistent

Could you take a look when you get a chance?

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.

scm.diffDecorationsGutterWidth allow higher values in settings editor

3 participants