fix(web): align composer inline chips with prompt text (#5495)

This commit is contained in:
Wout Stiens authored and GitHub committed 2026-08-06 12:57:02 -04:00
1 parent 470d4eb993
commit aa16c180e5
2 files changed
+9 -5

No files matched your search

@@ -72,8 +72,8 @@ import { cn, isMacPlatform } from "~/lib/utils";
import { basenameOfPath } from "~/pierre-icons";
import {
COMPOSER_INLINE_CHIP_ICON_CLASS_NAME,
COMPOSER_INLINE_CHIP_LABEL_CLASS_NAME,
COMPOSER_INLINE_SKILL_CHIP_CLASS_NAME,
COMPOSER_INLINE_SKILL_CHIP_LABEL_CLASS_NAME,
SKILL_CHIP_ICON_SVG,
} from "./composerInlineChip";
import { FILE_TAG_CHIP_CLASS_NAME, FileTagChipContent } from "./chat/FileTagChip";
@@ -188,7 +188,7 @@ class ComposerMentionNode extends DecoratorNode<React.ReactElement> {
override createDOM(): HTMLElement {
const dom = document.createElement("span");
dom.className = "composer-inline-chip relative inline-flex align-middle leading-none";
dom.className = "composer-inline-chip relative inline-flex align-[-0.125em] leading-none";
return dom;
}
@@ -256,7 +256,7 @@ function ComposerSkillDecorator(props: { skillLabel: string; skillDescription: s
className={COMPOSER_INLINE_CHIP_ICON_CLASS_NAME}
dangerouslySetInnerHTML={{ __html: SKILL_CHIP_ICON_SVG }}
/>
<span className={COMPOSER_INLINE_CHIP_LABEL_CLASS_NAME}>{props.skillLabel}</span>
<span className={COMPOSER_INLINE_SKILL_CHIP_LABEL_CLASS_NAME}>{props.skillLabel}</span>
</span>
);
@@ -326,7 +326,7 @@ class ComposerSkillNode extends DecoratorNode<React.ReactElement> {
override createDOM(): HTMLElement {
const dom = document.createElement("span");
dom.className = "composer-inline-chip relative inline-flex align-middle leading-none";
dom.className = "composer-inline-chip relative inline-flex align-[-0.125em] leading-none";
return dom;
}
@@ -397,7 +397,7 @@ class ComposerTerminalContextNode extends DecoratorNode<React.ReactElement> {
override createDOM(): HTMLElement {
const dom = document.createElement("span");
dom.className = "composer-inline-chip relative inline-flex align-middle leading-none";
dom.className = "composer-inline-chip relative inline-flex align-[-0.125em] leading-none";
return dom;
}
@@ -14,6 +14,10 @@ export const CHAT_INLINE_CHIP_LABEL_CLASS_NAME = "truncate leading-tight";
export const COMPOSER_INLINE_CHIP_LABEL_CLASS_NAME = `${CHAT_INLINE_CHIP_LABEL_CLASS_NAME} select-none`;
// The skill label is smaller than the surrounding prompt text; offset its
// glyphs without moving the pill box or changing the editor's line height.
export const COMPOSER_INLINE_SKILL_CHIP_LABEL_CLASS_NAME = `${COMPOSER_INLINE_CHIP_LABEL_CLASS_NAME} relative top-[0.15em]`;
export const COMPOSER_INLINE_SKILL_CHIP_CLASS_NAME =
"inline-flex max-w-full select-none items-center gap-[0.33em] rounded-[0.5em] border border-fuchsia-500/25 bg-fuchsia-500/12 px-[0.5em] py-[0.08em] font-medium text-[0.86em] leading-[1.1] text-fuchsia-700 align-middle dark:text-fuchsia-300";