fix(web): stabilize compact card snapshots

This commit is contained in:
Yichen Jiang
2026-08-08 15:24:50 +08:00
parent 7aca4c6b94
commit ebd3a87834
12 changed files with 36 additions and 18 deletions

View File

@@ -275,7 +275,7 @@ const CommandRow = memo(function CommandRow({ renderSlot, node, compaction, t }:
t: ChatViewSlotProps['t']
}) {
const owner = useMemo(() => ({ node, ...compaction === undefined ? {} : { compaction } }), [compaction, node])
const fallback = node.name === 'compact' || compaction !== undefined
const fallback = node.name === 'compact'
? <CompactionCommandCard {...owner} t={t} />
: <GenericCommandCard {...owner} t={t} />
return (

View File

@@ -19,7 +19,7 @@ export function CompactionCommandCard({ node, compaction, t }: CompactionCommand
return (
<CompactionItem
node={compaction}
title={node.name ?? 'compact'}
title="compact"
fallbackSummary={node.outcome?.text ?? null}
t={t}
/>
@@ -31,7 +31,7 @@ export function CompactionCommandCard({ node, compaction, t }: CompactionCommand
t={t}
variant="others"
icon={<IconApiOutline14 size={14} />}
title={node.name ?? 'compact'}
title="compact"
summary={t('message.compaction.running')}
body={null}
state="running"

View File

@@ -21,7 +21,7 @@ interface CompactionItemProps {
node: CompactionSummaryNode
/** Optional command title for a manual compaction folded into this marker. */
title?: string
/** Command settlement text used only when the summary provenance page is absent. */
/** Command settlement text used when structured compaction counts are unavailable. */
fallbackSummary?: string | null
/** The owning view's locale seat. */
t: ChatViewSlotProps['t']

View File

@@ -155,7 +155,6 @@ export function deriveChatFlow(nodes: readonly ConversationNode[]): ChatFlowItem
for (const node of nodes) {
if (rendersNothing(node)) continue
if (node.kind === 'command' && pairs.byCommandId.has(node.commandId)) {
group = null
continue
}
if (node.kind === 'compaction') {