Skip to content

Decorations: fall back to lower-priority colors - #325422

Merged
Alex Ross (alexr00) merged 4 commits into
microsoft:mainfrom
justjavac:fix/238040-decoration-color-fallback
Jul 14, 2026
Merged

Alex Ross (alexr00) merged 4 commits into
microsoft:mainfrom
justjavac:fix/238040-decoration-color-fallback

Conversation

@justjavac

Copy link
Copy Markdown
Contributor

Fixes #238040

When multiple file decorations apply to the same resource, generate a CSS variable fallback chain in priority order. This preserves a lower-priority decoration color when a higher-priority color is undefined by the active theme, such as list.errorForeground in high contrast themes.

The fallback chain is also used for decoration badges and icons, so it continues to work when the color theme changes.

Tests:

  • npm run typecheck-client
  • npm run test-browser-no-install -- --run src/vs/workbench/services/decorations/test/browser/decorationsService.test.ts --browser chromium
  • npm run eslint -- src/vs/workbench/services/decorations/browser/decorationsService.ts src/vs/workbench/services/decorations/test/browser/decorationsService.test.ts
Copilot AI review requested due to automatic review settings July 11, 2026 09:45

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 priority-ordered theme color fallbacks for file decorations.

Changes:

  • Generates CSS variable fallback chains for decoration colors.
  • Adds a browser test for lower-priority label color fallback.
  • Updates icon color handling for computed CSS values.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
decorationsService.ts Builds and applies prioritized color fallback chains.
decorationsService.test.ts Tests label color fallback behavior.

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the PR!

@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) July 13, 2026 13:20
@alexr00

Copy link
Copy Markdown
Member

@microsoft-github-policy-service rerun

@alexr00
Alex Ross (alexr00) merged commit d650689 into microsoft:main Jul 14, 2026
29 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.130.0 milestone Jul 14, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

5 participants