diff --git a/src/renderer/components/team/ToolApprovalSheet.tsx b/src/renderer/components/team/ToolApprovalSheet.tsx index 535ba772..a5d9c15e 100644 --- a/src/renderer/components/team/ToolApprovalSheet.tsx +++ b/src/renderer/components/team/ToolApprovalSheet.tsx @@ -380,6 +380,12 @@ const ToolInputPreview = ({ toolInput: Record; projectPath?: string; }): React.JSX.Element => { + const text = renderToolInput(toolName, toolInput, projectPath); + const fileName = getToolInputFileName(toolName, toolInput); + const lines = useMemo(() => highlightLines(text, fileName), [text, fileName]); + const rawFilePath = typeof toolInput.file_path === 'string' ? toolInput.file_path : null; + const isFileTool = FILE_TOOLS.has(toolName) && rawFilePath; + // AskUserQuestion: render questions with options as readable UI if (toolName === 'AskUserQuestion' && Array.isArray(toolInput.questions)) { const questions = toolInput.questions as { @@ -452,12 +458,6 @@ const ToolInputPreview = ({ ); } - const text = renderToolInput(toolName, toolInput, projectPath); - const fileName = getToolInputFileName(toolName, toolInput); - const lines = useMemo(() => highlightLines(text, fileName), [text, fileName]); - const rawFilePath = typeof toolInput.file_path === 'string' ? toolInput.file_path : null; - const isFileTool = FILE_TOOLS.has(toolName) && rawFilePath; - return (