Repository navigation
Improve CSS selector performance safeguards - #333818
Merged
Justin Chen (justschen) merged 3 commits intoSep 2, 2026
Merged
Conversation
Replace non-codicon class substring selectors with stable markers, remove disconnected editor header styles, and prevent new high-cost selector patterns. Add a repeatable Modern UI CSS benchmark and document the observed results and limitations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa457496-6844-4e4c-b182-07866a0a7506
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
.github/skills/auto-perf-optimize/scripts/workbench-css-performance.mts — These setup steps run before both summary initialization and the try/catch. If transpilation… |
|
build/stylelint.ts — This also classifies CSS under src/vs/**/test/** as production (for example, the… |
What changed in this PR
Improves CSS selector invalidation safeguards and adds repeatable performance measurement.
Changes:
- Replaces non-codicon class-substring selectors with stable or exact classes.
- Extends stylelint enforcement to core and extension CSS.
- Adds a Modern UI CSS benchmark and audit documentation.
| File | Description |
|---|---|
src/vs/workbench/services/decorations/common/decorations.ts |
Defines a stable badge marker. |
src/vs/workbench/contrib/modernUI/README.md |
Links performance documentation. |
src/vs/workbench/contrib/modernUI/CSS_PERFORMANCE.md |
Documents audit and benchmark results. |
src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css |
Uses an exact decoration class. |
src/vs/workbench/contrib/chat/browser/widget/media/chat.css |
Replaces placeholder substring matching. |
src/vs/workbench/browser/parts/views/media/views.css |
Uses stable decoration markers. |
src/vs/workbench/browser/parts/editor/media/editorgroupview.css |
Removes disconnected header styles. |
src/vs/workbench/browser/labels.ts |
Applies the badge marker. |
package.json |
Adds the CSS benchmark command. |
build/stylelint.ts |
Enforces the new selector restriction. |
build/lib/test/stylelint.test.ts |
Checks extension CSS filtering. |
build/lib/test/rootAnchoredHas.test.ts |
Tests substring-selector parsing. |
build/lib/stylelint/validateHasSelectors.ts |
Implements selector detection. |
build/filters.ts |
Includes production extension CSS. |
.github/skills/auto-perf-optimize/scripts/workbench-css-performance.mts |
Implements the benchmark runner. |
.github/skills/auto-perf-optimize/scratchpad/README.md |
Documents the runner. |
.github/instructions/css-best-practices.instructions.md |
Documents the codicon exception. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Move process-exit error propagation outside benchmark cleanup and use the repository's preferred string quoting in the selector regression test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa457496-6844-4e4c-b182-07866a0a7506
Collaborator
Author
|
CI follow-up:
|
Dmitriy Vasyura (dmitrivMS)
previously approved these changes
Sep 1, 2026
Justin Chen (justschen)
marked this pull request as draft
September 1, 2026 18:03
Ensure benchmark setup failures retain a diagnostic summary artifact and exclude test fixture paths from the production-only class substring selector safeguard. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa457496-6844-4e4c-b182-07866a0a7506
Lee Murray (mrleemurray)
approved these changes
Sep 2, 2026
Lee Murray (mrleemurray)
left a comment
Contributor
There was a problem hiding this comment.
Awesome!
Justin Chen (justschen)
enabled auto-merge (squash)
September 2, 2026 09:25
Justin Chen (justschen)
deleted the
agents/css-performance-audit-and-fixes
branch
September 2, 2026 09:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
:has()rule:has()inventory, correctness rationale, and measurement limitationsExisting codicon-family selectors are intentionally unchanged and grandfathered by the lint rule. The experimental transform shimmer work was fully reverted and is not part of this PR.
Performance
Bracketed before/after runs observed these median wall-time changes:
These are observed timings, not isolated causal gains. Generic style-recalculation counts did not materially decrease because codicon substring selectors remain, so the PR conservatively claims no broad proven speedup and focuses on targeted invalidation prevention.
Validation
npm run compilenpm run hygiene