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.
This commit is contained in:
Daniel 2025-07-26 17:21:53 -05:00 • committed by GitHub
parent 478869e37a
commit 4d0550c855
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,6 +31,10 @@ export const CommandPatternSelector: React.FC<CommandPatternSelectorProps> = ({
const [isExpanded, setIsExpanded] = useState(false)
const [editingStates, setEditingStates] = useState<Record<string, { isEditing: boolean; value: string }>>({})
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<CommandPatternSelectorProps> = ({
components={{
settingsLink: (
<VSCodeLink
href="command:workbench.action.openSettings?%5B%22roo-code%22%5D"
href="#"
onClick={(e) => {
e.preventDefault()
handleOpenSettings()
}}
className="text-vscode-textLink-foreground hover:text-vscode-textLink-activeForeground"
/>
),