Skip to content

Decorations: fall back to lower-priority colors#325422

Open
justjavac wants to merge 3 commits into
microsoft:mainfrom
justjavac:fix/238040-decoration-color-fallback
Open

Decorations: fall back to lower-priority colors#325422
justjavac wants to merge 3 commits into
microsoft:mainfrom
justjavac:fix/238040-decoration-color-fallback

Conversation

@justjavac

Copy link
Copy Markdown

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.

Comment thread src/vs/workbench/services/decorations/browser/decorationsService.ts

@alexr00 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 alexr00 enabled auto-merge (squash) July 13, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color of tab name of modified file reverts to default color if a problem is detected

4 participants