Uh oh!
There was an error while loading. Please reload this page.
perf(ButtonGroup): Scope :has() selector to direct child for O(1) lookup - #7328
perf(ButtonGroup): Scope :has() selector to direct child for O(1) lookup#7328mattcosta7 wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: e497cb2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days. |
Summary
Performance optimization for ButtonGroup CSS selector to improve INP.
Changes
Scope
:has(div:last-child:empty)to direct child with>combinator.Expected INP Impact
Why this matters
The original selector scanned the entire subtree looking for an empty div. ButtonGroup interactions (hover, focus) trigger style recalc. By scoping to direct children, we get O(1) lookup.
Part of the INP performance optimization effort. See #7312 for full context.