From 4ecb92df2791942d6b3b266856186aa762363dff Mon Sep 17 00:00:00 2001 From: hems Date: Sun, 13 Jul 2025 05:43:47 +0100 Subject: [PATCH] fix: restore correct Path field behavior and hide it for fetch tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reverted Path field to always show working directory (p.permission.Path) instead of URL for fetch tools, preserving original behavior for other tools - Hide Path field entirely for fetch tools since it's not relevant - Fetch tools now only show Tool and URL fields in header This ensures other permission popups (bash, edit, write) continue to work correctly while making fetch popups cleaner. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../dialogs/permissions/permissions.go | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/internal/tui/components/dialogs/permissions/permissions.go b/internal/tui/components/dialogs/permissions/permissions.go index ba5ea132c4902cd7f93e1c86895c1594e975553c..6d9558b6bb3704c4e488f36cc5cebd1fb95d00c9 100644 --- a/internal/tui/components/dialogs/permissions/permissions.go +++ b/internal/tui/components/dialogs/permissions/permissions.go @@ -220,19 +220,9 @@ func (p *permissionDialogCmp) renderHeader() string { Render(fmt.Sprintf(" %s", p.permission.ToolName)) pathKey := t.S().Muted.Render("Path") - var pathDisplayValue string - if p.permission.ToolName == tools.FetchToolName { - if params, ok := p.permission.Params.(tools.FetchPermissionsParams); ok { - pathDisplayValue = params.URL - } else { - pathDisplayValue = p.permission.Path - } - } else { - pathDisplayValue = fsext.PrettyPath(p.permission.Path) - } pathValue := t.S().Text. Width(p.width - lipgloss.Width(pathKey)). - Render(fmt.Sprintf(" %s", pathDisplayValue)) + Render(fmt.Sprintf(" %s", fsext.PrettyPath(p.permission.Path))) headerParts := []string{ lipgloss.JoinHorizontal( @@ -241,12 +231,18 @@ func (p *permissionDialogCmp) renderHeader() string { toolValue, ), baseStyle.Render(strings.Repeat(" ", p.width)), - lipgloss.JoinHorizontal( - lipgloss.Left, - pathKey, - pathValue, - ), - baseStyle.Render(strings.Repeat(" ", p.width)), + } + + // Only show Path field for non-fetch tools + if p.permission.ToolName != tools.FetchToolName { + headerParts = append(headerParts, + lipgloss.JoinHorizontal( + lipgloss.Left, + pathKey, + pathValue, + ), + baseStyle.Render(strings.Repeat(" ", p.width)), + ) } // Add tool-specific header information