Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(Chat): drawer muted tint paints over content (+ CLI parity fix) (#2536)

Kenton Quatmana0444ed9c284
diff --git a/packages/cli/src/api/component.mjs b/packages/cli/src/api/component.mjs
index 1288b9b24d..19d195a973 100644
--- a/packages/cli/src/api/component.mjs
+++ b/packages/cli/src/api/component.mjs
@@ -45,7 +45,7 @@ function resolveExternalPackage(packageName, cwd) {
* @param {boolean} [options.source]
* @param {boolean} [options.showcase]
* @param {boolean} [options.blocks]
- * @param {'full'|'compact'|'brief'} [options.detail]
+ * @param {'full'|'compact'|'brief'} [options.detail] - Defaults to 'full' for a single component, 'brief' for list views (list/category/no name), matching the CLI.
* @param {string} [options.lang]
* @param {boolean} [options.zh]
* @param {boolean} [options.dense]
@@ -61,12 +61,19 @@ export async function component(name, options = {}) {
source = false,
showcase = false,
blocks = false,
- detail = 'full',
+ detail: detailOption,
lang = null,
zh = false,
dense = false,
} = options;
+ // Default detail level mirrors the CLI (see commands/component/index.mjs):
+ // single-component views default to 'full', list-style views (--list,
+ // --category, or no name) default to 'brief' (scannable name lists).
+ // Keeping this in sync with the CLI is what the API↔CLI parity test checks.
+ const isListView = list || category != null || !name;
+ const detail = detailOption ?? (isListView ? 'brief' : 'full');
+
const coreDir = findCoreDir(cwd);
if (!coreDir) {
throw new XDSError('Could not find @xds/core package');
diff --git a/packages/core/src/Chat/XDSChatComposerDrawer.tsx b/packages/core/src/Chat/XDSChatComposerDrawer.tsx
index f86c16031e..0959ccfae9 100644
--- a/packages/core/src/Chat/XDSChatComposerDrawer.tsx
+++ b/packages/core/src/Chat/XDSChatComposerDrawer.tsx
@@ -88,16 +88,15 @@ const styles = stylex.create({
paddingBlockStart: spacingVars['--spacing-3'],
paddingBlockEnd: `calc(${spacingVars['--spacing-3']} + ${radiusVars['--radius-page']})`,
marginBlockEnd: `calc(-1 * ${radiusVars['--radius-page']})`,
+ // Surface base with a muted tint layered on top, both in the element's
+ // own background layer. The muted backgroundImage composites over the
+ // surface backgroundColor and — by CSS rule — paints behind all in-flow
+ // content (tokens, labels, collapse handle) automatically. This restores
+ // the original "surface bg + muted tint" intent (#1182) without a
+ // positioned ::before, so it needs no z-index and works whether muted is
+ // opaque or translucent.
backgroundColor: colorVars['--color-background-surface'],
- '::before': {
- content: '""',
- position: 'absolute',
- inset: 0,
- borderTopLeftRadius: 'inherit',
- borderTopRightRadius: 'inherit',
- backgroundColor: colorVars['--color-background-muted'],
- pointerEvents: 'none',
- },
+ backgroundImage: `linear-gradient(${colorVars['--color-background-muted']}, ${colorVars['--color-background-muted']})`,
borderTopLeftRadius: radiusVars['--radius-page'],
borderTopRightRadius: radiusVars['--radius-page'],
},