diff --git a/tui/tui.go b/tui/tui.go index aa768c4..0dce43c 100644 --- a/tui/tui.go +++ b/tui/tui.go @@ -3159,7 +3159,7 @@ func (m model) groupColumns(width int) []tableColumn { {Key: "time", Title: activeTimeLabel("latest", active), Width: timeW}, {Key: "age", Title: activeTimeLabel("age", active), Width: ageW}, } - if m.hasVisibleGroupScope() { + if m.shouldShowGroupScopeColumn() { scopeW := minInt(maxInt(8, width/7), 16) titleW := maxInt(1, width-kindW-countW-timeW-ageW-scopeW-5) columns = append(columns, tableColumn{Key: "scope", Title: activeLabel("scope", active == sortScope), Width: scopeW}) @@ -3171,7 +3171,10 @@ func (m model) groupColumns(width int) []tableColumn { return columns } -func (m model) hasVisibleGroupScope() bool { +func (m model) shouldShowGroupScopeColumn() bool { + if m.layoutPreset == LayoutChat { + return false + } for _, group := range m.groups { if strings.TrimSpace(group.Scope) != "" { return true diff --git a/tui/tui_test.go b/tui/tui_test.go index c28e0a6..405b884 100644 --- a/tui/tui_test.go +++ b/tui/tui_test.go @@ -229,7 +229,7 @@ func TestViewUsesGitcrawlStylePaneTables(t *testing.T) { m.width = 300 m.height = 28 view := stripANSI(m.View()) - for _, want := range []string{"kind", "msgs", "latest", "scope", "channel", "time", "who", "title"} { + for _, want := range []string{"kind", "msgs", "latest", "channel", "time", "who", "title"} { if !strings.Contains(view, want) { t.Fatalf("table view missing %q:\n%s", want, view) } @@ -262,7 +262,7 @@ func TestWideRenderFillsTerminalAndKeepsThreePaneColumns(t *testing.T) { if len(lines[0]) != 220 || len(lines[len(lines)-1]) != 220 { t.Fatalf("view did not fill terminal width: first=%d last=%d\n%s", len(lines[0]), len(lines[len(lines)-1]), view) } - for _, want := range []string{"Channels", "Messages", "3/3 rows", "Conversation", "kind", "msgs", "latest", "age", "scope", "channel", "time", "who", "title"} { + for _, want := range []string{"Channels", "Messages", "3/3 rows", "Conversation", "kind", "msgs", "latest", "age", "channel", "time", "who", "title"} { if !strings.Contains(view, want) { t.Fatalf("wide render missing %q:\n%s", want, view) }