Skip to content

Commit 4d0550c

Browse files
authored
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 77bc9e6 when the tooltip was updated to use command URI instead of the working onClick pattern.
1 parent 478869e commit 4d0550c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

webview-ui/src/components/chat/CommandPatternSelector.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ export const CommandPatternSelector: React.FC<CommandPatternSelectorProps> = ({
3131
const [isExpanded, setIsExpanded] = useState(false)
3232
const [editingStates, setEditingStates] = useState<Record<string, { isEditing: boolean; value: string }>>({})
3333

34+
const handleOpenSettings = () => {
35+
window.postMessage({ type: "action", action: "settingsButtonClicked", values: { section: "autoApprove" } })
36+
}
37+
3438
// Create a combined list with full command first, then patterns
3539
const allPatterns = useMemo(() => {
3640
// Trim the command to ensure consistency with extracted patterns
@@ -90,7 +94,11 @@ export const CommandPatternSelector: React.FC<CommandPatternSelectorProps> = ({
9094
components={{
9195
settingsLink: (
9296
<VSCodeLink
93-
href="command:workbench.action.openSettings?%5B%22roo-code%22%5D"
97+
href="#"
98+
onClick={(e) => {
99+
e.preventDefault()
100+
handleOpenSettings()
101+
}}
94102
className="text-vscode-textLink-foreground hover:text-vscode-textLink-activeForeground"
95103
/>
96104
),

0 commit comments

Comments
 (0)