From eb027f7b4a7daa17e881c8231bfad41af19d5500 Mon Sep 17 00:00:00 2001 From: kev1n77 Date: Wed, 9 Sep 2026 02:14:47 +0800 Subject: [PATCH 1/2] fix(flow-chat): align ambient status icons and text columns Share the 14px icon slot and 4px text gap across public ambient cards, thinking, exploration and the resident runtime row. Remove double opacity and transparent-border offsets. Lab uses real Todo, AgentWait, Skill and terminal cards with state and expansion controls. Validation: design-system:check, check:web, motion inventory and 21 focused thinking/Todo/AgentWait/runtime tests pass. Native desktop existing transcript confirms thinking disclosure and body leading edge. Full mixed-state, theme/density and remote scenarios remain manual pending; no remote runtime tested. --- .../src/preview/FlowChatToolGallery.css | 12 +++++ .../src/preview/FlowChatToolGallery.tsx | 47 +++++++++++++++++++ .../design-tokens/src/system.tokens.json | 2 + design-system/packages/ui/README.md | 8 ++++ .../tool-cards/ActivityToolCards.tsx | 1 + .../tool-cards/AmbientToolCard.meta.ts | 2 + .../tool-cards/FlowChatToolCard.module.css | 9 ++-- .../StandardAmbientToolCards.module.css | 11 +++-- .../tool-cards/StandardAmbientToolCards.tsx | 10 ++-- .../tool-cards/StandardToolCards.meta.ts | 2 + .../tool-cards/ToolCardStatusSlot.module.css | 2 + .../ui/generated/design-system.css | 2 + .../flow_chat/components/FlowTextBlock.scss | 4 +- .../components/modern/ExploreRegion.scss | 11 ++--- .../modern/FLOWCHAT_VIRTUALIZATION.md | 14 ++++++ .../modern/RuntimeStatusSlot.appearance.ts | 2 +- .../components/modern/RuntimeStatusSlot.scss | 16 +++++-- .../modern/RuntimeStatusSlot.test.tsx | 4 ++ .../components/modern/RuntimeStatusSlot.tsx | 4 +- .../tool-cards/ModelThinkingDisplay.scss | 17 +++---- .../tool-cards/ModelThinkingDisplay.test.tsx | 5 ++ 21 files changed, 146 insertions(+), 39 deletions(-) diff --git a/design-system/apps/design-lab/src/preview/FlowChatToolGallery.css b/design-system/apps/design-lab/src/preview/FlowChatToolGallery.css index dc8cdab64c..dc9b84e080 100644 --- a/design-system/apps/design-lab/src/preview/FlowChatToolGallery.css +++ b/design-system/apps/design-lab/src/preview/FlowChatToolGallery.css @@ -10,6 +10,18 @@ margin-top: 42px; } +.flow-chat-tool-sequence { + display: grid; + min-inline-size: 0; + gap: var(--openbitfun-space-5); +} + +.flow-chat-tool-sequence__rows { + display: grid; + min-inline-size: 0; + gap: var(--openbitfun-control-flow-chat-flow-item-gap); +} + .flow-chat-tool-gallery > .component-catalog-section-heading { margin-block: 0 -8px; padding-top: 34px; diff --git a/design-system/apps/design-lab/src/preview/FlowChatToolGallery.tsx b/design-system/apps/design-lab/src/preview/FlowChatToolGallery.tsx index 2b17f1d87a..c6cb713c5d 100644 --- a/design-system/apps/design-lab/src/preview/FlowChatToolGallery.tsx +++ b/design-system/apps/design-lab/src/preview/FlowChatToolGallery.tsx @@ -2,6 +2,9 @@ import { ArrowRight, Eye, } from "lucide-react"; +import { useState } from "react"; +import { TabGroup } from "@openbitfun/ui"; +import { AgentWaitToolCard, SkillToolCard, TerminalControlToolCard, TodoToolCard } from "@openbitfun/ui/flow-chat"; import { useI18n } from "../i18n"; import { getComponentDescription } from "../i18n/componentMetadata"; import { @@ -28,6 +31,47 @@ const productOwnedToolExamples = [ "PatchCanvas", ] as const; +function ToolSequencePreview() { + const { t } = useI18n(); + const [status, setStatus] = useState<"running" | "completed" | "error">("running"); + const [expanded, setExpanded] = useState(false); + const completed = status === "completed"; + return
+ setStatus(value as typeof status)} + items={[ + { value: "running", label: t("components.preview.flowChat.running") }, + { value: "completed", label: t("components.preview.flowChat.completed") }, + { value: "error", label: t("components.preview.flowChat.failed") }, + ]} + /> +
+ + setExpanded(!expanded)} + /> + + +
+
; +} + function ToolSpecimenCard({ componentName, specimen, @@ -67,6 +111,8 @@ export function FlowChatToolGallery({

{t("components.flowChat.toolsDescription")}

+ + {toolCardEntries.map(({ component, definition }) => (
@@ -105,6 +151,7 @@ export function FlowChatToolGallery({
{t("components.flowChat.dedicatedTitle")}

{t("components.flowChat.dedicatedDescription")}

+ ModelThinkingDisplay · ExploreGroupRenderer · RuntimeStatusSlot
{productOwnedToolExamples.join(" · ")} diff --git a/design-system/packages/design-tokens/src/system.tokens.json b/design-system/packages/design-tokens/src/system.tokens.json index 32fb07dbbd..ade17725a8 100644 --- a/design-system/packages/design-tokens/src/system.tokens.json +++ b/design-system/packages/design-tokens/src/system.tokens.json @@ -495,6 +495,8 @@ "flowChat": { "$description": "Shared FlowChat rhythm for product and package-owned conversation surfaces.", "$type": "dimension", + "rowIconSize": { "$value": "{control.icon.sizeSm}" }, + "rowIconGap": { "$value": "{space.1}" }, "flowItemGap": { "$value": "0.42rem" }, "turnGap": { "$value": "{space.4}" }, "inlineGap": { "$value": "0.35rem" }, diff --git a/design-system/packages/ui/README.md b/design-system/packages/ui/README.md index 9242c36222..55eddd55a1 100644 --- a/design-system/packages/ui/README.md +++ b/design-system/packages/ui/README.md @@ -440,3 +440,11 @@ long description while metadata and sibling actions retain their own slots. Lab Patterns includes long paths, large change counts, expandable detail and disabled actions. The current Web UI has no direct ActivityItem consumer; FlowChat ambient tool cards keep their separate presentation contract. + +Ambient FlowChat summaries, product thinking/explore headers and runtime status +share a 14px icon column followed by a 4px gap. The icon column starts at the +transcript body edge; heading text starts 18px after that edge. Loading, tool +and disclosure glyphs occupy that same column. Expanded thinking prose remains +aligned with the body edge; bordered tool detail retains its own content inset. +The 12px/4px Figma inline trace is a smaller typography scene; the existing +product 14px glyph size is retained when applying its gap to these summaries. diff --git a/design-system/packages/ui/src/flow-chat/tool-cards/ActivityToolCards.tsx b/design-system/packages/ui/src/flow-chat/tool-cards/ActivityToolCards.tsx index fcba529cd3..53028e269c 100644 --- a/design-system/packages/ui/src/flow-chat/tool-cards/ActivityToolCards.tsx +++ b/design-system/packages/ui/src/flow-chat/tool-cards/ActivityToolCards.tsx @@ -52,6 +52,7 @@ function ActivityToolCardBase({ ) : undefined} icon={( svg { - inline-size: 0.875rem; - block-size: 0.875rem; + inline-size: 100%; + block-size: 100%; } .todoCompactMeta { diff --git a/design-system/packages/ui/src/flow-chat/tool-cards/StandardAmbientToolCards.tsx b/design-system/packages/ui/src/flow-chat/tool-cards/StandardAmbientToolCards.tsx index 6051796cf1..46adf81397 100644 --- a/design-system/packages/ui/src/flow-chat/tool-cards/StandardAmbientToolCards.tsx +++ b/design-system/packages/ui/src/flow-chat/tool-cards/StandardAmbientToolCards.tsx @@ -98,7 +98,7 @@ export function RunCodeToolCard({ action={action} content={summary} extra={actions ? {actions} : undefined} - icon={