From 691efb0025bfeeebd3aca9fe833aa01526aa960b Mon Sep 17 00:00:00 2001 From: Dudu-0223 Date: Thu, 23 Jul 2026 11:11:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(gui):=20add=20'edit'=20variant=20for=20too?= =?UTF-8?q?l=20row,=20showing=20as=20'Edit=20=C2=B7=20path'=20like=20Read?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add 'edit' to ToolRowVariant type and TOOL_VARIANTS mapping - Add 'edit' title and summary key preference (path/file_path) - Add IconEditOutline16 as the leading icon for edit variant --- .../src/client/chat/GenericToolCard.tsx | 3 ++- .../src/client/contract/tool-call-model.ts | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/client/ui-conversation/src/client/chat/GenericToolCard.tsx b/packages/client/ui-conversation/src/client/chat/GenericToolCard.tsx index 32793fb804..a772b1b191 100644 --- a/packages/client/ui-conversation/src/client/chat/GenericToolCard.tsx +++ b/packages/client/ui-conversation/src/client/chat/GenericToolCard.tsx @@ -4,7 +4,7 @@ import type { ReactNode } from 'react' import { - IconApiOutline14, IconBrowseOutline16, IconSearchOutline16, IconThinkOutline14, + IconApiOutline14, IconBrowseOutline16, IconEditOutline16, IconSearchOutline16, IconThinkOutline14, } from '@deepseek-ai/dsh-client-ui-primitives' import type { ToolViewProps } from '../contract/toolview.ts' import { toolRowModel, type ToolCallBlock, type ToolRowVariant } from '../contract/tool-call-model.ts' @@ -17,6 +17,7 @@ const VARIANT_ICONS: Record = { search: , read: , bash: , + edit: , others: , } diff --git a/packages/client/ui-conversation/src/client/contract/tool-call-model.ts b/packages/client/ui-conversation/src/client/contract/tool-call-model.ts index 0c3e100ec8..9a3978cf5a 100644 --- a/packages/client/ui-conversation/src/client/contract/tool-call-model.ts +++ b/packages/client/ui-conversation/src/client/contract/tool-call-model.ts @@ -10,18 +10,18 @@ export type { ToolCallBlock } from './toolview.ts' /** The frozen slice the chat view hands to toolview components as `block` * (both members are cache-stable references off ConversationSnapshot). */ -/** The five figma row variants (think is fed by reasoning blocks, not tool calls). */ -export type ToolRowVariant = 'think' | 'search' | 'read' | 'bash' | 'others' +/** The six figma row variants (think is fed by reasoning blocks, not tool calls). */ +export type ToolRowVariant = 'think' | 'search' | 'read' | 'bash' | 'edit' | 'others' /** Row state semantic; colors self-supplied via StateDot (design gives none). */ export type ToolRowState = 'running' | 'ok' | 'error' | 'stopped' /** Figma row titles per variant (design literals, not translatable copy). */ export const VARIANT_TITLES: Record = { - think: 'Think', search: 'Search', read: 'Read', bash: 'Bash', others: 'Tool call', + think: 'Think', search: 'Search', read: 'Read', bash: 'Bash', edit: 'Edit', others: 'Tool call', } -/** Known tool name -> variant; fs write/edit intentionally fall to others (no figma form). */ +/** Known tool name -> variant; fs write intentionally fall to others (no figma form). */ const TOOL_VARIANTS: Record = { bash: 'bash', read: 'read', @@ -29,6 +29,7 @@ const TOOL_VARIANTS: Record = { web_search: 'search', grep: 'search', glob: 'search', + edit: 'edit', } /** @@ -78,6 +79,7 @@ const SUMMARY_KEYS: Record = { read: ['path', 'file_path', 'url'], search: ['query', 'pattern', 'url'], think: [], + edit: ['path', 'file_path'], others: [], }