From c5b37f6845a753509640c857443c5ad95a5794b0 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Sat, 8 Aug 2026 16:43:29 +0800 Subject: [PATCH] fix(client): keep compact row in conversation package --- .../src/client/chat/CompactionCommandCard.tsx | 14 +------------- .../src/client/chat/GenericCommandCard.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/packages/client/ui-conversation/src/client/chat/CompactionCommandCard.tsx b/packages/client/ui-conversation/src/client/chat/CompactionCommandCard.tsx index 8012834541..c2f0191d85 100644 --- a/packages/client/ui-conversation/src/client/chat/CompactionCommandCard.tsx +++ b/packages/client/ui-conversation/src/client/chat/CompactionCommandCard.tsx @@ -3,11 +3,9 @@ // generic command card so no-history, cancellation, and failures retain their // complete handler-authored text. -import { IconApiOutline14 } from '@deepseek-ai/dsh-client-ui-primitives' import type { ChatViewSlotProps, CommandRowOwnerProps } from '../contract/slots.ts' import { CompactionItem } from './CompactionItem.tsx' import { GenericCommandCard } from './GenericCommandCard.tsx' -import { ToolRow } from './ToolRow.tsx' interface CompactionCommandCardProps extends CommandRowOwnerProps { t: ChatViewSlotProps['t'] @@ -26,15 +24,5 @@ export function CompactionCommandCard({ node, compaction, t }: CompactionCommand ) } if (node.outcome !== null) return - return ( - } - title="compact" - summary={t('message.compaction.running')} - body={null} - state="running" - /> - ) + return } diff --git a/packages/client/ui-conversation/src/client/chat/GenericCommandCard.tsx b/packages/client/ui-conversation/src/client/chat/GenericCommandCard.tsx index 9d34ef3015..9137181265 100644 --- a/packages/client/ui-conversation/src/client/chat/GenericCommandCard.tsx +++ b/packages/client/ui-conversation/src/client/chat/GenericCommandCard.tsx @@ -25,13 +25,15 @@ function leadingFor(state: CommandRowState): ReactNode { /** Card props: the owner payload plus the render site's locale seat (plain prop). */ export interface GenericCommandCardProps extends CommandRowOwnerProps { t: ChatViewSlotProps['t'] + /** Command-specific running copy; absent uses the generic command label. */ + runningSummary?: string | undefined } -export function GenericCommandCard({ node, t }: GenericCommandCardProps) { +export function GenericCommandCard({ node, t, runningSummary }: GenericCommandCardProps) { const [expanded, setExpanded] = useState(false) const text = node.outcome?.text const summary = node.outcome === null - ? t('command.running') + ? runningSummary ?? t('command.running') : text ?? (node.outcome.kind === 'error' ? t('command.failed') : t('command.done')) // Title is the bare command name: the row already reads `name ยท outcome`, // and the dispatched line's own `/` and arguments only restate what the