From 8f37bd69d91b344cd8d3a35727ce06eba27eb653 Mon Sep 17 00:00:00 2001 From: mickey-228 <2909457016@qq.com> Date: Fri, 8 May 2026 10:13:24 +0800 Subject: [PATCH 1/2] fix(tui): add spacing after tree marker in tool details --- tui/component_conversation.go | 7 ++++--- tui/component_render_test.go | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tui/component_conversation.go b/tui/component_conversation.go index bdacb67a..e32fc462 100644 --- a/tui/component_conversation.go +++ b/tui/component_conversation.go @@ -11,6 +11,7 @@ import ( const ( toolIcon = "●" toolTreeChar = "└" + toolTreeLead = "└ " ) func (m model) renderConversation() string { @@ -479,7 +480,7 @@ func renderRunSectionGroup(group []chatEntry, width int, toolDetailsExpanded boo if runewidth.StringWidth(compact) > maxDetail { compact = runewidth.Truncate(compact, maxDetail, "…") } - detailLines = append(detailLines, connectorStyle.Render(toolTreeChar)+compact) + detailLines = append(detailLines, connectorStyle.Render(toolTreeLead)+compact) } indent := " " @@ -554,7 +555,7 @@ func renderToolTreeItem(item chatEntry, width int, toolDetailsExpanded bool, run if detail == "" { continue } - detailLines = append(detailLines, connectorStyle.Render(toolTreeChar)+detail) + detailLines = append(detailLines, connectorStyle.Render(toolTreeLead)+detail) } if len(detailLines) > 0 { body = headLine + "\n" + indent + strings.Join(detailLines, "\n"+indent) @@ -625,7 +626,7 @@ func renderLiveInspectGroup(group []chatEntry, width int, runningIndicatorVisibl if detail := latestLiveInspectHint(group); detail != "" { connectorStyle := lipgloss.NewStyle().Foreground(colorTool) maxDetailWidth := max(12, contentWidth-6) - headLine += "\n " + connectorStyle.Render(toolTreeChar) + " " + compact(detail, maxDetailWidth) + headLine += "\n " + connectorStyle.Render(toolTreeLead) + compact(detail, maxDetailWidth) } } diff --git a/tui/component_render_test.go b/tui/component_render_test.go index 5a478c58..79459d14 100644 --- a/tui/component_render_test.go +++ b/tui/component_render_test.go @@ -312,13 +312,13 @@ func TestRenderConversationToolDetailsDefaultCollapsedAndExpandToggle(t *testing } collapsed := stripANSI(m.renderConversation()) - if strings.Contains(collapsed, "└a.go") || strings.Contains(collapsed, "└ b.go (1-20)") { + if strings.Contains(collapsed, "└ a.go") || strings.Contains(collapsed, "└ b.go (1-20)") { t.Fatalf("expected collapsed tool details to hide detail hint rows by default, got %q", collapsed) } m.toolDetailExpanded = true expanded := stripANSI(m.renderConversation()) - for _, want := range []string{"└a.go (1-10)", "└b.go (1-20)"} { + for _, want := range []string{"└ a.go (1-10)", "└ b.go (1-20)"} { if !strings.Contains(expanded, want) { t.Fatalf("expected expanded tool detail view to contain %q, got %q", want, expanded) } From 1a0cb0462d8fd74cdf12c4f3ff576716c2d16235 Mon Sep 17 00:00:00 2001 From: mickey-228 <2909457016@qq.com> Date: Fri, 8 May 2026 18:20:05 +0800 Subject: [PATCH 2/2] test(tui): cover spaced tree prefix in live inspect details --- tui/component_render_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tui/component_render_test.go b/tui/component_render_test.go index 79459d14..b75baa8f 100644 --- a/tui/component_render_test.go +++ b/tui/component_render_test.go @@ -389,6 +389,17 @@ func TestRenderBytemindRunCardCollapsedLiveInspectSummaryAcrossTools(t *testing. } } +func TestRenderLiveInspectGroupDetailPrefixHasSpace(t *testing.T) { + group := []chatEntry{ + {Kind: "tool", Title: toolEntryTitle("search_text"), Status: "running", CompactBody: `"finalizeAssistantTurnForTool"`}, + } + + view := stripANSI(renderLiveInspectGroup(group, 100, true)) + if !strings.Contains(view, `└ "finalizeAssistantTurnForTool"`) { + t.Fatalf("expected live inspect detail prefix to include a space after tree marker, got %q", view) + } +} + func TestRenderBytemindRunCardCollapsedDoneInspectGroupKeepsSingleLine(t *testing.T) { entries := []chatEntry{ {Kind: "tool", Title: toolEntryTitle("search_text"), Status: "done", CompactBody: `17 matches for "toolDetailsExpanded"`},