Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frontend/src/api/types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ export interface UserPreferences {
defaultModel?: string
defaultAgent?: string
autoScroll: boolean
showReasoning: boolean
expandToolCalls: boolean
expandDiffs: boolean
expandToolCalls: boolean
showReasoning: boolean
simpleChatMode: boolean
leaderKey?: string
directShortcuts?: string[]
keyboardShortcuts: Record<string, string>
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/message/FileToolRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ export function FileToolRender({ part, filediff, filePath, content, toolName, on
const { preferences } = useSettings()
const isReadTool = toolName === 'Read'
const isEditTool = toolName === 'Edit'
const isWriteTool = toolName === 'Write'
const hasExpandableContent = !isReadTool && (filediff || content)

const defaultExpanded = isEditTool
? (preferences?.expandDiffs ?? true)
const isFileMutatingTool = isEditTool || isWriteTool
const defaultExpanded = isFileMutatingTool
? (preferences?.expandDiffs ?? true)
: (preferences?.expandToolCalls ?? false)
const [expanded, setExpanded] = useState(defaultExpanded)

Expand Down
Loading
Loading