@@ -79,10 +79,18 @@ func (p *permissionDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
79 p.isViewportFocus = !p.isViewportFocus
79 p.isViewportFocus = !p.isViewportFocus
80 if p.isViewportFocus {
80 if p.isViewportFocus {
81 p.selectOption.Blur()
81 p.selectOption.Blur()
82+ // Add a visual indicator for focus change
83+ cmds = append(cmds, tea.Batch(
84+ util.CmdHandler(util.InfoMsg("Viewing content - use arrow keys to scroll")),
83 p.selectOption.Focus()
87 p.selectOption.Focus()
88+ // Add a visual indicator for focus change
89+ cmds = append(cmds, tea.Batch(
90+ util.CmdHandler(util.InfoMsg("Select an action")),
85− return p, nil
93+ return p, tea.Batch(cmds...)
@@ -133,34 +141,55 @@ func (p *permissionDialogCmp) render() string {
133 case tools.BashToolName:
141 case tools.BashToolName:
134 pr := p.permission.Params.(tools.BashPermissionsParams)
142 pr := p.permission.Params.(tools.BashPermissionsParams)
135 headerParts = append(headerParts, keyStyle.Render("Command:"))
143 headerParts = append(headerParts, keyStyle.Render("Command:"))
136− content, _ = r.Render(fmt.Sprintf("```bash\n%s\n```", pr.Command))
144+ content = fmt.Sprintf("```bash\n%s\n```", pr.Command)
137 case tools.EditToolName:
145 case tools.EditToolName:
138 pr := p.permission.Params.(tools.EditPermissionsParams)
146 pr := p.permission.Params.(tools.EditPermissionsParams)
139 headerParts = append(headerParts, keyStyle.Render("Update"))
147 headerParts = append(headerParts, keyStyle.Render("Update"))
140− content, _ = r.Render(fmt.Sprintf("```diff\n%s\n```", pr.Diff))
148+ content = fmt.Sprintf("```\n%s\n```", pr.Diff)
141 case tools.WriteToolName:
149 case tools.WriteToolName:
142 pr := p.permission.Params.(tools.WritePermissionsParams)
150 pr := p.permission.Params.(tools.WritePermissionsParams)
143 headerParts = append(headerParts, keyStyle.Render("Content"))
151 headerParts = append(headerParts, keyStyle.Render("Content"))
144− content, _ = r.Render(fmt.Sprintf("```diff\n%s\n```", pr.Content))
152+ content = fmt.Sprintf("```\n%s\n```", pr.Content)
145 case tools.FetchToolName:
153 case tools.FetchToolName:
146 pr := p.permission.Params.(tools.FetchPermissionsParams)
154 pr := p.permission.Params.(tools.FetchPermissionsParams)
147 headerParts = append(headerParts, keyStyle.Render("URL: "+pr.URL))
155 headerParts = append(headerParts, keyStyle.Render("URL: "+pr.URL))
149− content, _ = r.Render(p.permission.Description)
157+ content = p.permission.Description
160+ renderedContent, _ := r.Render(content)
151 headerContent := lipgloss.NewStyle().Padding(0, 1).Render(lipgloss.JoinVertical(lipgloss.Left, headerParts...))
161 headerContent := lipgloss.NewStyle().Padding(0, 1).Render(lipgloss.JoinVertical(lipgloss.Left, headerParts...))
152 p.contentViewPort.Width = p.width - 2 - 2
162 p.contentViewPort.Width = p.width - 2 - 2
153 p.contentViewPort.Height = p.height - lipgloss.Height(headerContent) - lipgloss.Height(form) - 2 - 2 - 1
163 p.contentViewPort.Height = p.height - lipgloss.Height(headerContent) - lipgloss.Height(form) - 2 - 2 - 1
154− p.contentViewPort.SetContent(content)
164+ p.contentViewPort.SetContent(renderedContent)
166+ // Make focus change more apparent with different border styles and colors
155− contentBorder := lipgloss.RoundedBorder()
167+ var contentBorder lipgloss.Border
168+ var borderColor lipgloss.TerminalColor
156 if p.isViewportFocus {
170 if p.isViewportFocus {
157 contentBorder = lipgloss.DoubleBorder()
171 contentBorder = lipgloss.DoubleBorder()
172+ borderColor = styles.Blue
174+ contentBorder = lipgloss.RoundedBorder()
175+ borderColor = styles.Flamingo
178+ contentStyle := lipgloss.NewStyle().
181+ Border(contentBorder).
182+ BorderForeground(borderColor)
184+ if p.isViewportFocus {
185+ contentStyle = contentStyle.BorderBackground(styles.Surface0)
159− cotentStyle := lipgloss.NewStyle().MarginTop(1).Padding(0, 1).Border(contentBorder).BorderForeground(styles.Flamingo)
187+
160− contentFinal := cotentStyle.Render(p.contentViewPort.View())
188+ contentFinal := contentStyle.Render(p.contentViewPort.View())
161− if content == "" {
189+ if renderedContent == "" {
162 contentFinal = ""
190 contentFinal = ""
164 return lipgloss.JoinVertical(
193 return lipgloss.JoinVertical(
165 lipgloss.Top,
194 lipgloss.Top,
166 headerContent,
195 headerContent,
@@ -241,12 +270,13 @@ func NewPermissionDialogCmd(permission permission.PermissionRequest) tea.Cmd {
241 minWidth := 100
270 minWidth := 100
242 minHeight := 30
271 minHeight := 30
273+ // Make the dialog size more appropriate for bash commands
244 switch permission.ToolName {
274 switch permission.ToolName {
245 case tools.BashToolName:
275 case tools.BashToolName:
246− widthRatio = 0.5
276+ widthRatio = 0.7
247− heightRatio = 0.3
277+ heightRatio = 0.5
248− minWidth = 80
278+ minWidth = 100
249− minHeight = 20
279+ minHeight = 30
251 // Return the dialog command
281 // Return the dialog command
252 return util.CmdHandler(core.DialogMsg{
282 return util.CmdHandler(core.DialogMsg{