diff --git a/frontend/src/components/message/FileToolRender.tsx b/frontend/src/components/message/FileToolRender.tsx index ea684803..1b381ff4 100644 --- a/frontend/src/components/message/FileToolRender.tsx +++ b/frontend/src/components/message/FileToolRender.tsx @@ -53,6 +53,11 @@ export function getRelativePath(filePath: string): string { return filePath } +function getFileName(filePath: string): string { + const normalizedPath = filePath.replace(/\/+$/, '') + return normalizedPath.split('/').pop() || filePath +} + interface FileToolRenderProps { part: ToolPart filediff?: FileDiffData @@ -60,14 +65,17 @@ interface FileToolRenderProps { content?: string toolName: string onFileClick?: (filePath: string, lineNumber?: number) => void + messageMeta?: { + model: string + time?: number + } } -export function FileToolRender({ part, filediff, filePath, content, toolName, onFileClick }: FileToolRenderProps) { +export function FileToolRender({ part, filediff, filePath, content, toolName, onFileClick, messageMeta }: FileToolRenderProps) { const { preferences } = useSettings() - const isReadTool = toolName === 'Read' const isEditTool = toolName === 'Edit' const isWriteTool = toolName === 'Write' - const hasExpandableContent = !isReadTool && (filediff || content) + const hasExpandableContent = Boolean(filediff || content) const isFileMutatingTool = isEditTool || isWriteTool const defaultExpanded = isFileMutatingTool @@ -90,29 +98,38 @@ export function FileToolRender({ part, filediff, filePath, content, toolName, on } return ( -