From 4d0550c855e1a4f42cac6b7e3a27559468ff7d19 Mon Sep 17 00:00:00 2001 From: Daniel <57051444+daniel-lxs@users.noreply.github.com> Date: Sat, 26 Jul 2025 17:21:53 -0500 Subject: [PATCH] fix: restore working settings link in command permissions tooltip (#6253) - 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 b79d86ccfe..c3b13b79d9 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" /> ),