From e0c933ad7e10eb280e399564610678567f808da0 Mon Sep 17 00:00:00 2001 From: patriceckhart Date: Tue, 19 May 2026 17:47:27 +0200 Subject: [PATCH] Allow styled extension panel lines --- internal/agent/modes/ext_panel_dialog.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/agent/modes/ext_panel_dialog.go b/internal/agent/modes/ext_panel_dialog.go index 57af405..1f26147 100644 --- a/internal/agent/modes/ext_panel_dialog.go +++ b/internal/agent/modes/ext_panel_dialog.go @@ -64,7 +64,7 @@ func (d *extPanelDialog) Render(th tui.Theme, width int) []string { plain := stripANSIBytes(l) trimmed := strings.TrimLeft(plain, " ") selected := strings.HasPrefix(trimmed, "▸ ") || strings.HasPrefix(trimmed, "● ") - out = append(out, styleExtPanelLine(th, plain, width, selected)) + out = append(out, styleExtPanelLine(th, l, plain, width, selected)) } if strings.TrimSpace(d.footer) != "" { out = append(out, "") @@ -74,7 +74,7 @@ func (d *extPanelDialog) Render(th tui.Theme, width int) []string { return out } -func styleExtPanelLine(th tui.Theme, plain string, width int, selected bool) string { +func styleExtPanelLine(th tui.Theme, raw string, plain string, width int, selected bool) string { if selected { if visible := runewidth.StringWidth(plain); visible < width { plain += strings.Repeat(" ", width-visible) @@ -83,6 +83,9 @@ func styleExtPanelLine(th tui.Theme, plain string, width int, selected bool) str green := fmt.Sprintf("\x1b[38;5;%dm\x1b[48;5;%dm", th.Tool, th.SelectionBG) return base + strings.ReplaceAll(plain, "✓", green+"✓"+base) + "\x1b[0m" } + if raw != plain { + return raw + "\x1b[0m" + } styled := th.FG256(th.Muted, plain) styled = strings.ReplaceAll(styled, "✓", th.FG256(th.Tool, "✓")) return styled