From 8a4d23c22a8e85bf8c5da912b27cfee41baa4d78 Mon Sep 17 00:00:00 2001 From: David Kaya Date: Mon, 30 Mar 2026 09:49:20 +0200 Subject: [PATCH] feat: add Enable all / Approve all buttons to inline pills Add bulk action buttons to the Tools and Auto-approval pill popovers: - Tools pill: sticky header with Enable all / Disable all toggle button that enables or disables every MCP server and LSP profile at once - Approval pill: Approve all / Unapprove all button in the existing sticky header next to the Reset button, approving or clearing all tool and server approval keys Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/renderer/components/chat/InlinePills.tsx | 63 +++++++++++++++++--- 1 file changed, 56 insertions(+), 7 deletions(-) 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 */}