diff --git a/src/renderer/components/chat/InlinePills.tsx b/src/renderer/components/chat/InlinePills.tsx index 3d05a84..d068cb0 100644 --- a/src/renderer/components/chat/InlinePills.tsx +++ b/src/renderer/components/chat/InlinePills.tsx @@ -418,9 +418,19 @@ export function InlineApprovalPill({ .filter((g) => g.tools.length > 0 || g.label.toLowerCase().includes(searchLower)); }, [groups, searchLower]); - function toggleTool(toolId: string) { + function toggleTool(toolId: string, group: ApprovalToolGroup) { const next = new Set(effectiveAutoApproved); - if (next.has(toolId)) { + + // If the group has server-level approval, expand it to individual tools + // so the user can selectively disable one tool. + if (group.serverApprovalKey && next.has(group.serverApprovalKey)) { + next.delete(group.serverApprovalKey); + for (const tool of group.tools) { + if (tool.id !== toolId) { + next.add(tool.id); + } + } + } else if (next.has(toolId)) { next.delete(toolId); } else { next.add(toolId); @@ -491,6 +501,12 @@ export function InlineApprovalPill({ return expandedGroups.has(groupId); } + function isToolEffectivelyApproved(toolId: string, group: ApprovalToolGroup): boolean { + if (effectiveAutoApproved.has(toolId)) return true; + if (group.serverApprovalKey && effectiveAutoApproved.has(group.serverApprovalKey)) return true; + return false; + } + const allApprovedGlobal = effectiveAutoApprovedCount === totalItemCount && totalItemCount > 0; const approveAll = useCallback(() => { @@ -656,9 +672,9 @@ export function InlineApprovalPill({
toggleTool(tool.id)} + onToggle={() => toggleTool(tool.id, group)} />
); @@ -691,8 +707,8 @@ function GroupToggle({ return (