mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-06-02 02:15:34 +08:00
Feat: subagent tool grouping (#398)
* fix(mobile): prevent bottom padding removal on input focus * fix: change subagent rendering * fix: subagent task name
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import React, { memo, useMemo, useCallback } from 'react';
|
||||
import { getToolConfig } from './configs/toolConfigs';
|
||||
import { OneLineDisplay, CollapsibleDisplay, DiffViewer, MarkdownContent, FileListContent, TodoListContent, TaskListContent, TextContent, QuestionAnswerContent } from './components';
|
||||
import { OneLineDisplay, CollapsibleDisplay, DiffViewer, MarkdownContent, FileListContent, TodoListContent, TaskListContent, TextContent, QuestionAnswerContent, SubagentContainer } from './components';
|
||||
import type { Project } from '../../../types/app';
|
||||
import type { SubagentChildTool } from '../types/types';
|
||||
|
||||
type DiffLine = {
|
||||
type: string;
|
||||
@@ -21,6 +22,12 @@ interface ToolRendererProps {
|
||||
autoExpandTools?: boolean;
|
||||
showRawParameters?: boolean;
|
||||
rawToolInput?: string;
|
||||
isSubagentContainer?: boolean;
|
||||
subagentState?: {
|
||||
childTools: SubagentChildTool[];
|
||||
currentToolIndex: number;
|
||||
isComplete: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
function getToolCategory(toolName: string): string {
|
||||
@@ -50,8 +57,24 @@ export const ToolRenderer: React.FC<ToolRendererProps> = memo(({
|
||||
selectedProject,
|
||||
autoExpandTools = false,
|
||||
showRawParameters = false,
|
||||
rawToolInput
|
||||
rawToolInput,
|
||||
isSubagentContainer,
|
||||
subagentState
|
||||
}) => {
|
||||
// Route subagent containers to dedicated component
|
||||
if (isSubagentContainer && subagentState) {
|
||||
if (mode === 'result') {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<SubagentContainer
|
||||
toolInput={toolInput}
|
||||
toolResult={toolResult}
|
||||
subagentState={subagentState}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const config = getToolConfig(toolName);
|
||||
const displayConfig: any = mode === 'input' ? config.input : config.result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user