diff --git a/src/renderer/components/team/ToolApprovalSheet.tsx b/src/renderer/components/team/ToolApprovalSheet.tsx index d6e3fc66..535ba772 100644 --- a/src/renderer/components/team/ToolApprovalSheet.tsx +++ b/src/renderer/components/team/ToolApprovalSheet.tsx @@ -5,7 +5,7 @@ import { useTheme } from '@renderer/hooks/useTheme'; import { useStore } from '@renderer/store'; import { shortenDisplayPath } from '@renderer/utils/pathDisplay'; import { highlightLines } from '@renderer/utils/syntaxHighlighter'; -import { AlertTriangle, FileText, Search, Terminal } from 'lucide-react'; +import { AlertTriangle, FileText, MessageCircleQuestion, Search, Terminal } from 'lucide-react'; import { MemberBadge } from './MemberBadge'; @@ -35,6 +35,8 @@ function getToolIcon(toolName: string): React.JSX.Element { case 'Grep': case 'Glob': return ; + case 'AskUserQuestion': + return ; default: return ; } @@ -378,6 +380,78 @@ const ToolInputPreview = ({ toolInput: Record; projectPath?: string; }): React.JSX.Element => { + // AskUserQuestion: render questions with options as readable UI + if (toolName === 'AskUserQuestion' && Array.isArray(toolInput.questions)) { + const questions = toolInput.questions as { + question?: string; + header?: string; + options?: { label?: string; description?: string }[]; + multiSelect?: boolean; + }[]; + return ( +
+ {questions.map((q, qi) => ( +
+ {q.header && ( + + {q.header} + + )} + {q.question && ( +

+ {q.question} +

+ )} + {Array.isArray(q.options) && ( +
+ {q.options.map((opt, oi) => ( +
+ + {q.multiSelect ? '☐' : '○'} + +
+ + {opt.label} + + {opt.description && ( +

+ {opt.description} +

+ )} +
+
+ ))} +
+ )} +
+ ))} +
+ ); + } + const text = renderToolInput(toolName, toolInput, projectPath); const fileName = getToolInputFileName(toolName, toolInput); const lines = useMemo(() => highlightLines(text, fileName), [text, fileName]);