diff --git a/src/renderer/components/chat/InlinePills.tsx b/src/renderer/components/chat/InlinePills.tsx index c642112..3d05a84 100644 --- a/src/renderer/components/chat/InlinePills.tsx +++ b/src/renderer/components/chat/InlinePills.tsx @@ -1,4 +1,4 @@ -import { useMemo, useState } from 'react'; +import { useCallback, useMemo, useState } from 'react'; import { ChevronDown, ChevronRight, Loader2, Minus, Search, Sparkles, TerminalSquare } from 'lucide-react'; import { ProviderIcon } from '@renderer/components/ProviderIcons'; @@ -250,7 +250,27 @@ export function InlineToolsPill({ {open && !disabled && ( -
+
+ {/* Header: enable / disable all */} +
+
+ +
+
+ +
{workspaceMcpServers.length > 0 && ( )} +
)}
@@ -470,6 +491,25 @@ export function InlineApprovalPill({ return expandedGroups.has(groupId); } + const allApprovedGlobal = effectiveAutoApprovedCount === totalItemCount && totalItemCount > 0; + + const approveAll = useCallback(() => { + const next = new Set(); + for (const group of groups) { + if (group.serverApprovalKey) { + next.add(group.serverApprovalKey); + } + for (const tool of group.tools) { + next.add(tool.id); + } + } + onUpdate({ autoApprovedToolNames: [...next] }); + }, [groups, onUpdate]); + + const unapproveAll = useCallback(() => { + onUpdate({ autoApprovedToolNames: [] }); + }, [onUpdate]); + return (
+ )} - )} +
{/* Search */}