Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/instructions/css-best-practices.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ applyTo: "**/*.css"
## Selectors

- Avoid `:has()` selectors. Because their result depends on descendant state, DOM mutations can invalidate styles on ancestors and cause expensive style recalculation, especially when selectors are broadly scoped. Instead, represent the state explicitly with a class or data attribute on the smallest container you own, and scope selectors to that marker. Add and remove the marker together with the state it represents.
- Never match the `class` attribute by substring (`[class*="…"]`, `[class^="…"]`, `[class$="…"]`). A single such selector anywhere in the workbench stylesheet defeats Blink's per-class invalidation: every `classList` change then forces a style recalculation for that element, even when no rule references the class that changed. Measured on a 3.7k-node workbench, the ten `[class*="monaco-decoration-itemColor"]` selectors in the Modern UI tab styles alone made a full style recalculation 2.4x slower. When a class carries a generated suffix, have the code that applies it also set a stable marker class (see `DECORATION_LABEL_COLOR_CLASS`) and match that instead.
- Never add a new match on the `class` attribute by substring (`[class*="…"]`, `[class^="…"]`, `[class$="…"]`). A single such selector anywhere in the workbench stylesheet defeats Blink's per-class invalidation: every `classList` change then forces a style recalculation for that element, even when no rule references the class that changed. Measured on a 3.7k-node workbench, the ten `[class*="monaco-decoration-itemColor"]` selectors in the Modern UI tab styles alone made a full style recalculation 2.4x slower. When a class carries a generated suffix, have the code that applies it also set a stable marker class (see `DECORATION_LABEL_COLOR_CLASS`) and match that instead. Existing `codicon-*` substring selectors are a grandfathered compatibility contract and must only be changed in a dedicated, separately validated codicon migration.
4 changes: 3 additions & 1 deletion .github/skills/auto-perf-optimize/scratchpad/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ These are reusable, generic runners. Use them directly or as templates:
- **`chat-session-switch-smoke.mts`** — Creates multiple chat sessions with
different content, then repeatedly switches between them via the sessions
sidebar. Measures per-switch memory growth.

- **`workbench-css-performance.mts`** — Measures Modern UI style and layout
cost while resizing, opening/switching/closing editor tabs, and toggling
workbench parts. Writes per-round data and medians to `summary.json`.
- **`userDataProfile.mts`** — Utility for managing user-data profiles in
smoke test runs.

Expand Down
Loading
Loading