feat(command-palette): add command-palette-group-heading theme target - #4422
Merged
Merged
Conversation
The CommandPaletteGroup heading carries no themeable handle: the group
root has `astryx-command-palette-group`, but the heading `<div>` had only
its StyleX class, so a theme could reach it only through a fragile
structural selector.
Add a `themeProps('command-palette-group-heading')` surface on the
heading element so it renders a stable `astryx-command-palette-group-heading`
class. Default rendering is byte-identical — the change only adds the class.
Documents the new target in CommandPalette.doc.mjs (theming.targets), adds
tests asserting the class renders, stays distinct from the group root, keeps
the heading decorative, and that a defineTheme override resolves to the
`.astryx-command-palette-group-heading` selector, plus a Storybook story
showing a heading override.
freddymeta
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 27, 2026 13:28
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsCommandPalette · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
approved these changes
Jul 27, 2026
cixzhang
enabled auto-merge (squash)
July 27, 2026 16:40
github-actions
Bot
deleted the
feat/command-palette-group-heading-theme-target
branch
July 28, 2026 06:57
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.
What
Adds a dedicated
astryx-command-palette-group-headingtheme target to theCommandPaletteGroupheading text.Why
CommandPaletteGrouprenders its heading (e.g. a "Suggestions" label) as a<div aria-hidden="true">that carries only its StyleX class. The group root already exposesastryx-command-palette-groupviathemeProps, but the heading itself has no stable theme target. A theme that wants to style just the heading — for example its padding or typography — can today reach it only through a fragile structural selector, which couples themes to internal DOM structure and breaks the moment the group's markup changes.This adds the target the sanctioned way (
themeProps+theming.targets), consistent with the existingastryx-command-palette-*family and the recent sibling theme-target additions (astryx-tree-list-item-label,astryx-tree-list-chevron), sodefineThemecan scope overrides to the heading alone.What changed
CommandPaletteGroup.tsx—themeProps('command-palette-group-heading')spread (viamergeProps) onto the heading<div>, rendering a stableastryx-command-palette-group-headingclass. Which element: the group root keepsastryx-command-palette-group; this new target lands on the heading child<div>— distinct handles for the group vs. its heading text.CommandPalette.doc.mjs— new{className: 'astryx-command-palette-group-heading'}entry indocs.theming.targets, keeping thethemingTargetsguard green. (CommandPalette'sdocsZhis a lightweightTranslationDocoverlay with nothemingblock — adding one there would be a mismatched, out-of-scope conversion, so the target is documented in the canonical ENdocs.theming.targetsthat the guard and codegen read.)CommandPaletteGroup.test.tsx— asserts the target class renders on the heading, stays distinct from the group root, keeps the heading decorative (aria-hidden), and that adefineTheme({ components: { 'command-palette-group-heading': { base } } })resolves to the.astryx-command-palette-group-headingselector in generated CSS.CommandPalette.stories.tsx— aThemedGroupHeadingstory demonstrating a heading override (bold/accent/uppercase) viadefineTheme.[feat], patch).Notes
aria-hidden="true"; grouping is still announced via the root'saria-label.