@@ -69,13 +69,13 @@ type permissionDialogCmp struct {
6969func formatDiff(diffText string) string {
7070 lines := strings.Split(diffText, "\n")
7171 var formattedLines []string
72−
72+
7373 // Define styles for different line types
7474 addStyle := lipgloss.NewStyle().Foreground(styles.Green)
7575 removeStyle := lipgloss.NewStyle().Foreground(styles.Red)
7676 headerStyle := lipgloss.NewStyle().Bold(true).Foreground(styles.Blue)
7777 contextStyle := lipgloss.NewStyle().Foreground(styles.SubText0)
78−
78+
7979 // Process each line
8080 for _, line := range lines {
8181 if strings.HasPrefix(line, "+") {
@@ -90,7 +90,7 @@ func formatDiff(diffText string) string {
9090 formattedLines = append(formattedLines, line)
9191 }
9292 }
93−
93+
9494 // Join all formatted lines
9595 return strings.Join(formattedLines, "\n")
9696}
@@ -112,13 +112,13 @@ func (p *permissionDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
112112 p.selectOption.Blur()
113113 // Add a visual indicator for focus change
114114 cmds = append(cmds, tea.Batch(
115− util.CmdHandler(util.InfoMsg("Viewing content - use arrow keys to scroll")),
115+ util.ReportInfo("Viewing content - use arrow keys to scroll"),
116116 ))
117117 } else {
118118 p.selectOption.Focus()
119119 // Add a visual indicator for focus change
120120 cmds = append(cmds, tea.Batch(
121− util.CmdHandler(util.InfoMsg("Select an action")),
121+ util.CmdHandler(util.ReportInfo("Select an action")),
122122 ))
123123 }
124124 return p, tea.Batch(cmds...)
@@ -162,44 +162,44 @@ func (p *permissionDialogCmp) render() string {
162162 lipgloss.JoinHorizontal(lipgloss.Left, keyStyle.Render("Path:"), " ", valueStyle.Render(p.permission.Path)),
163163 " ",
164164 }
165−
165+
166166 // Create the header content first so it can be used in all cases
167167 headerContent := lipgloss.NewStyle().Padding(0, 1).Render(lipgloss.JoinVertical(lipgloss.Left, headerParts...))
168−
168+
169169 r, _ := glamour.NewTermRenderer(
170170 glamour.WithStyles(styles.CatppuccinMarkdownStyle()),
171171 glamour.WithWordWrap(p.width-10),
172172 glamour.WithEmoji(),
173173 )
174−
174+
175175 // Handle different tool types
176176 switch p.permission.ToolName {
177177 case tools.BashToolName:
178178 pr := p.permission.Params.(tools.BashPermissionsParams)
179179 headerParts = append(headerParts, keyStyle.Render("Command:"))
180180 content := fmt.Sprintf("```bash\n%s\n```", pr.Command)
181−
181+
182182 renderedContent, _ := r.Render(content)
183183 p.contentViewPort.Width = p.width - 2 - 2
184−
184+
185185 // Calculate content height dynamically based on content
186186 contentLines := len(strings.Split(renderedContent, "\n"))
187187 // Set a reasonable min/max for the viewport height
188188 minContentHeight := 3
189189 maxContentHeight := p.height - lipgloss.Height(headerContent) - lipgloss.Height(form) - 2 - 2 - 1
190−
190+
191191 // Add some padding to the content lines
192192 contentHeight := contentLines + 2
193193 contentHeight = max(contentHeight, minContentHeight)
194194 contentHeight = min(contentHeight, maxContentHeight)
195195 p.contentViewPort.Height = contentHeight
196−
196+
197197 p.contentViewPort.SetContent(renderedContent)
198−
198+
199199 // Style the viewport
200200 var contentBorder lipgloss.Border
201201 var borderColor lipgloss.TerminalColor
202−
202+
203203 if p.isViewportFocus {
204204 contentBorder = lipgloss.DoubleBorder()
205205 borderColor = styles.Blue
@@ -207,47 +207,47 @@ func (p *permissionDialogCmp) render() string {
207207 contentBorder = lipgloss.RoundedBorder()
208208 borderColor = styles.Flamingo
209209 }
210−
210+
211211 contentStyle := lipgloss.NewStyle().
212212 MarginTop(1).
213213 Padding(0, 1).
214214 Border(contentBorder).
215215 BorderForeground(borderColor)
216−
216+
217217 if p.isViewportFocus {
218218 contentStyle = contentStyle.BorderBackground(styles.Surface0)
219219 }
220−
220+
221221 contentFinal := contentStyle.Render(p.contentViewPort.View())
222−
222+
223223 return lipgloss.JoinVertical(
224224 lipgloss.Top,
225225 headerContent,
226226 contentFinal,
227227 form,
228228 )
229−
229+
230230 case tools.EditToolName:
231231 pr := p.permission.Params.(tools.EditPermissionsParams)
232232 headerParts = append(headerParts, keyStyle.Render("Update"))
233233 // Recreate header content with the updated headerParts
234234 headerContent = lipgloss.NewStyle().Padding(0, 1).Render(lipgloss.JoinVertical(lipgloss.Left, headerParts...))
235−
235+
236236 // Format the diff with colors
237237 formattedDiff := formatDiff(pr.Diff)
238−
238+
239239 // Set up viewport for the diff content
240240 p.contentViewPort.Width = p.width - 2 - 2
241−
241+
242242 // Calculate content height dynamically based on window size
243243 maxContentHeight := p.height - lipgloss.Height(headerContent) - lipgloss.Height(form) - 2 - 2 - 1
244244 p.contentViewPort.Height = maxContentHeight
245245 p.contentViewPort.SetContent(formattedDiff)
246−
246+
247247 // Style the viewport
248248 var contentBorder lipgloss.Border
249249 var borderColor lipgloss.TerminalColor
250−
250+
251251 if p.isViewportFocus {
252252 contentBorder = lipgloss.DoubleBorder()
253253 borderColor = styles.Blue
@@ -255,47 +255,47 @@ func (p *permissionDialogCmp) render() string {
255255 contentBorder = lipgloss.RoundedBorder()
256256 borderColor = styles.Flamingo
257257 }
258−
258+
259259 contentStyle := lipgloss.NewStyle().
260260 MarginTop(1).
261261 Padding(0, 1).
262262 Border(contentBorder).
263263 BorderForeground(borderColor)
264−
264+
265265 if p.isViewportFocus {
266266 contentStyle = contentStyle.BorderBackground(styles.Surface0)
267267 }
268−
268+
269269 contentFinal := contentStyle.Render(p.contentViewPort.View())
270−
270+
271271 return lipgloss.JoinVertical(
272272 lipgloss.Top,
273273 headerContent,
274274 contentFinal,
275275 form,
276276 )
277−
277+
278278 case tools.WriteToolName:
279279 pr := p.permission.Params.(tools.WritePermissionsParams)
280280 headerParts = append(headerParts, keyStyle.Render("Content"))
281281 // Recreate header content with the updated headerParts
282282 headerContent = lipgloss.NewStyle().Padding(0, 1).Render(lipgloss.JoinVertical(lipgloss.Left, headerParts...))
283−
283+
284284 // Format the diff with colors
285285 formattedDiff := formatDiff(pr.Content)
286−
286+
287287 // Set up viewport for the content
288288 p.contentViewPort.Width = p.width - 2 - 2
289−
289+
290290 // Calculate content height dynamically based on window size
291291 maxContentHeight := p.height - lipgloss.Height(headerContent) - lipgloss.Height(form) - 2 - 2 - 1
292292 p.contentViewPort.Height = maxContentHeight
293293 p.contentViewPort.SetContent(formattedDiff)
294−
294+
295295 // Style the viewport
296296 var contentBorder lipgloss.Border
297297 var borderColor lipgloss.TerminalColor
298−
298+
299299 if p.isViewportFocus {
300300 contentBorder = lipgloss.DoubleBorder()
301301 borderColor = styles.Blue
@@ -303,75 +303,75 @@ func (p *permissionDialogCmp) render() string {
303303 contentBorder = lipgloss.RoundedBorder()
304304 borderColor = styles.Flamingo
305305 }
306−
306+
307307 contentStyle := lipgloss.NewStyle().
308308 MarginTop(1).
309309 Padding(0, 1).
310310 Border(contentBorder).
311311 BorderForeground(borderColor)
312−
312+
313313 if p.isViewportFocus {
314314 contentStyle = contentStyle.BorderBackground(styles.Surface0)
315315 }
316−
316+
317317 contentFinal := contentStyle.Render(p.contentViewPort.View())
318−
318+
319319 return lipgloss.JoinVertical(
320320 lipgloss.Top,
321321 headerContent,
322322 contentFinal,
323323 form,
324324 )
325−
325+
326326 case tools.FetchToolName:
327327 pr := p.permission.Params.(tools.FetchPermissionsParams)
328328 headerParts = append(headerParts, keyStyle.Render("URL: "+pr.URL))
329329 content := p.permission.Description
330−
330+
331331 renderedContent, _ := r.Render(content)
332332 p.contentViewPort.Width = p.width - 2 - 2
333333 p.contentViewPort.Height = p.height - lipgloss.Height(headerContent) - lipgloss.Height(form) - 2 - 2 - 1
334334 p.contentViewPort.SetContent(renderedContent)
335−
335+
336336 // Style the viewport
337337 contentStyle := lipgloss.NewStyle().
338338 MarginTop(1).
339339 Padding(0, 1).
340340 Border(lipgloss.RoundedBorder()).
341341 BorderForeground(styles.Flamingo)
342−
342+
343343 contentFinal := contentStyle.Render(p.contentViewPort.View())
344344 if renderedContent == "" {
345345 contentFinal = ""
346346 }
347−
347+
348348 return lipgloss.JoinVertical(
349349 lipgloss.Top,
350350 headerContent,
351351 contentFinal,
352352 form,
353353 )
354−
354+
355355 default:
356356 content := p.permission.Description
357−
357+
358358 renderedContent, _ := r.Render(content)
359359 p.contentViewPort.Width = p.width - 2 - 2
360360 p.contentViewPort.Height = p.height - lipgloss.Height(headerContent) - lipgloss.Height(form) - 2 - 2 - 1
361361 p.contentViewPort.SetContent(renderedContent)
362−
362+
363363 // Style the viewport
364364 contentStyle := lipgloss.NewStyle().
365365 MarginTop(1).
366366 Padding(0, 1).
367367 Border(lipgloss.RoundedBorder()).
368368 BorderForeground(styles.Flamingo)
369−
369+
370370 contentFinal := contentStyle.Render(p.contentViewPort.View())
371371 if renderedContent == "" {
372372 contentFinal = ""
373373 }
374−
374+
375375 return lipgloss.JoinVertical(
376376 lipgloss.Top,
377377 headerContent,