From 9de304758a1fe143710cfd6c7d86d17c6edb323a Mon Sep 17 00:00:00 2001 From: wsp1911 Date: Sun, 29 Mar 2026 21:38:00 +0800 Subject: [PATCH 1/2] fix: collapse completed file operation cards by default --- .../flow_chat/tool-cards/BaseToolCard.scss | 18 +++++++ .../src/flow_chat/tool-cards/BaseToolCard.tsx | 14 +++++ .../tool-cards/FileOperationToolCard.tsx | 54 ++++++++++++++++--- 3 files changed, 80 insertions(+), 6 deletions(-) diff --git a/src/web-ui/src/flow_chat/tool-cards/BaseToolCard.scss b/src/web-ui/src/flow_chat/tool-cards/BaseToolCard.scss index b8484607..471a7e3e 100644 --- a/src/web-ui/src/flow_chat/tool-cards/BaseToolCard.scss +++ b/src/web-ui/src/flow_chat/tool-cards/BaseToolCard.scss @@ -156,6 +156,24 @@ z-index: 0; } +.tool-card-icon-affordance-hit { + position: absolute; + inset: 0; + z-index: 2; + margin: 0; + padding: 0; + border: none; + background: transparent; + cursor: pointer; + appearance: none; + + &:focus-visible { + outline: 2px solid var(--color-accent-500, #60a5fa); + outline-offset: 2px; + border-radius: 6px; + } +} + /* Same square box so tool glyph and chevron share center (no circular fill). */ .tool-card-icon-marks { position: relative; diff --git a/src/web-ui/src/flow_chat/tool-cards/BaseToolCard.tsx b/src/web-ui/src/flow_chat/tool-cards/BaseToolCard.tsx index 2c7a4d40..4a2ac738 100644 --- a/src/web-ui/src/flow_chat/tool-cards/BaseToolCard.tsx +++ b/src/web-ui/src/flow_chat/tool-cards/BaseToolCard.tsx @@ -132,6 +132,8 @@ export interface ToolCardHeaderProps { affordanceKind?: ToolCardHeaderAffordanceKind; /** Override context: expanded state for chevron rotation */ headerExpanded?: boolean; + /** Optional dedicated affordance click handler for the left icon rail. */ + onAffordanceClick?: (e: React.MouseEvent) => void; /** Action text */ action?: string; /** Main content */ @@ -151,6 +153,7 @@ export const ToolCardHeader: React.FC = ({ expandAffordance, affordanceKind, headerExpanded, + onAffordanceClick, action, content, extra, @@ -188,6 +191,17 @@ export const ToolCardHeader: React.FC = ({ )} + {showExpandHint && onAffordanceClick && ( +