Repository navigation
Automations: remove lingering :has() selectors from dialog and list - #325864
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes remaining costly :has() selectors from the Automations UI.
Changes:
- Adds per-instance chat toolbar action hiding.
- Tracks expanded rows with an explicit class.
- Replaces structural and focus
:has()selectors.
Show a summary per file
| File | Description |
|---|---|
chatInputPart.ts |
Adds toolbar action suppression. |
aiCustomizationManagement.css |
Removes remaining :has() rules. |
automationsListWidget.ts |
Toggles expanded-row styling state. |
automationDialog.ts |
Configures hidden dialog toolbar actions. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Medium
Follow-up to #324986 / #324985, which removed the catastrophic body:has(.automation-dialog) rules. The Automations UI still shipped four :has() selectors in aiCustomizationManagement.css that add :has() invalidation bookkeeping to the global stylesheet (present in Stable even when the feature is off). This removes all of them: - Chat-input chips (Configure Tools / Add Context / List MCP Servers) were hidden with .action-item:has(.action-label.codicon-*). .action-item is a workbench-wide anchor, so this was the one with Stable-wide reach. They are now hidden by targeting the .action-label codicon class directly. .action-item has no intrinsic box spacing, so the slot collapses to zero width and there is no visual gap. Known trade-off: the hidden chips stay in the toolbar's arrow-key focus rotation (the action bar skips only disabled/separator items). This is accepted for now; the dialog will migrate to newChatInput.ts, which never renders these MenuId.ChatInput chips. - .automations-row:has(:focus-visible) -> .automations-row:focus-within, matching the sibling customization lists' documented focus-ring pattern. - .automations-row-wrapper:has(> .automations-row-history) (x2) -> a JS-toggled .automations-row-wrapper-expanded class. The history panel is always in the DOM, so the old :has() matched every row; the class reflects the actual expanded state, which also restores hover highlight on collapsed rows and only flattens the card corners when expanded. Scoped entirely to the automations CSS block; no shared components change. Type-check, ESLint, and stylelint pass. Co-authored-by: Copilot <[email protected]> Copilot-Session: 21ce38e3-a711-467a-a289-8a13d1414f58
Ben Villalobos (benvillalobos)
force-pushed
the
bv/automation-css-audit
branch
from
July 14, 2026 23:04
5f9a650 to
441ec1a
Compare
|
Did you notice this issue also affecting file icons in the file explorer having the same lag on scroll which could be related to this as it presented at the same time and improved in insiders with some of the fixes applied? |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Member
Author
|
Tomek Marchi (@tomekmarchi) I did not notice that specifically, but that lines up. The fix from #324986 should have fixed that and 1.128 has since been patched |
Ben Villalobos (benvillalobos)
marked this pull request as ready for review
July 17, 2026 17:57
Paul (pwang347)
approved these changes
Jul 17, 2026
Connor Peet (connor4312)
approved these changes
Jul 17, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Context
Follow-up to #324986 (which fixed #324985), the fix that removed the catastrophic
body:has(.automation-dialog)rules causing persistent workbench-wide style-recalc jank. That PR removed the worst offenders, but the Automations UI still shipped four:has()selectors inaiCustomizationManagement.css. This is the audit follow-up that removes the rest.This stylesheet is imported by eagerly-loaded chat-contrib modules, so its rules live in the global document stylesheet whenever the chat contrib is loaded — present in Stable even when the Automations feature is off (
chat.automations.enableddefaults tofalse).What changed
All four remaining
:has()selectors are gone (a:has(grep now matches only explanatory comments):.action-item:has(.action-label.codicon-{settings,add,server})— hides 3 embedded chat-input chipshiddenInputToolbarActionIdsChatInputPartoption (rendered asHiddenActionViewItem). No CSS needed..automations-row:has(:focus-visible).automations-row:focus-within.automations-row-wrapper:has(> .automations-row-history)(×2).automations-row-wrapper-expandedclassWhy the chip rule mattered most
.action-itemis a workbench-wide element andcodicon-settings/add/serverare common toolbar icons, so.action-item:has(.action-label.codicon-*)registered:has()invalidation bookkeeping keyed on common classes across the whole workbench — the same bug family as the fixedbody:has(), just lower severity (anchor is.action-item, notbody). Hiding those chips at the view-item level (the codebase's establishedHiddenActionViewItemmechanism, already used for the phone Mode picker) removes them from layout and keyboard tab order with no:has().Incidental fix
The
.automations-row-historyelement is always present in the DOM, so:has(> .automations-row-history)matched every row regardless of expanded state — meaning collapsed rows silently lost their hover highlight and always had flattened bottom corners. The new.automations-row-wrapper-expandedclass (toggled inautomationsListWidget.tsrenderElement) reflects the actual expanded state, restoring hover highlight on collapsed rows and only flattening the card corners when the run-history panel is expanded — which matches the original CSS comment's intent.Notes for reviewers
ChatInputPartinstance..action-itemelements are stilldisplay:none(viaHiddenActionViewItem), identical DOM ordering to before, so the existing inter-chip divider-suppression rule remains valid.:focus-withinvs keyboard-only:focus-visible), consistent with the sibling tools/prompts lists' documented pattern.Validation
npm run typecheck-client— passesDraft while I run through the local visual test pass (enable
chat.automations.enabled, open Open Customizations → Automations, exercise list hover/focus/expand and the create/edit dialog toolbar).