From 36a966a57c652ac855421c3936d2a5e65f6ae70d Mon Sep 17 00:00:00 2001 From: Daniel Riccio Date: Sat, 26 Jul 2025 17:11:23 -0500 Subject: [PATCH] fix: restore working settings link in command permissions tooltip - Replace broken command URI with onClick handler that posts message - Command URIs don't work in webview context, must use postMessage - Restores original working implementation from PR #5798 - Directs to autoApprove section where command permissions are configured The bug was introduced in commit 77bc9e6f when the tooltip was updated to use command URI instead of the working onClick pattern. --- .../src/components/chat/CommandPatternSelector.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/webview-ui/src/components/chat/CommandPatternSelector.tsx b/webview-ui/src/components/chat/CommandPatternSelector.tsx index b79d86ccfea..c3b13b79d92 100644 --- a/webview-ui/src/components/chat/CommandPatternSelector.tsx +++ b/webview-ui/src/components/chat/CommandPatternSelector.tsx @@ -31,6 +31,10 @@ export const CommandPatternSelector: React.FC = ({ const [isExpanded, setIsExpanded] = useState(false) const [editingStates, setEditingStates] = useState>({}) + const handleOpenSettings = () => { + window.postMessage({ type: "action", action: "settingsButtonClicked", values: { section: "autoApprove" } }) + } + // Create a combined list with full command first, then patterns const allPatterns = useMemo(() => { // Trim the command to ensure consistency with extracted patterns @@ -90,7 +94,11 @@ export const CommandPatternSelector: React.FC = ({ components={{ settingsLink: ( { + e.preventDefault() + handleOpenSettings() + }} className="text-vscode-textLink-foreground hover:text-vscode-textLink-activeForeground" /> ),