Skip to content

Commit b0cbf0d

Browse files
authored
fix(statusbar): remove redundant default-branch warning from secondary row (#199)
1 parent f65d951 commit b0cbf0d

5 files changed

Lines changed: 9 additions & 17 deletions

File tree

‎cmd/footer_layout_clip_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
func TestLayoutFooterRow_TokensSurviveFinishFooterLine(t *testing.T) {
1111
m := chatModel{width: 70, height: 24}
12-
left := lipgloss.NewStyle().Foreground(statusCWDColor).Inline(true).Render("~/OSS2026/RealWork/graycode-eco/hawk:")
12+
left := lipgloss.NewStyle().Foreground(statusCWDColor).Inline(true).Render("~/OSS2026/RealWork/graycode-eco/hawk")
1313
left += " " + lipgloss.NewStyle().Foreground(statusBranchColor).Inline(true).Render("⎇ main")
1414
right := lipgloss.NewStyle().Foreground(statusTokenColor).Inline(true).Render("[db] 13k")
1515
right += lipgloss.NewStyle().Foreground(dimColor).Inline(true).Render(" · ")
@@ -42,7 +42,7 @@ func TestLayoutFooterRow_LeftWiderThanFooterStillShowsTokens(t *testing.T) {
4242

4343
func TestLayoutFooterRow_ClipDoesNotDropStyledTokens(t *testing.T) {
4444
m := chatModel{width: 55, height: 24}
45-
left := lipgloss.NewStyle().Foreground(statusCWDColor).Inline(true).Render("~/Desktop/OSS2026/RealWork/graycode-eco/hawk:")
45+
left := lipgloss.NewStyle().Foreground(statusCWDColor).Inline(true).Render("~/Desktop/OSS2026/RealWork/graycode-eco/hawk")
4646
left += " " + lipgloss.NewStyle().Foreground(statusBranchColor).Inline(true).Render("⎇ feature/footer-fix")
4747
dim := lipgloss.NewStyle().Foreground(dimColor).Inline(true)
4848
tok := lipgloss.NewStyle().Foreground(statusTokenColor).Inline(true)

‎cmd/footer_layout_width_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func TestLayoutFooterRow_StyledStringsAlignRight(t *testing.T) {
1313
tokenStyle := lipgloss.NewStyle().Foreground(statusTokenColor).Inline(true)
1414
dim := lipgloss.NewStyle().Foreground(dimColor).Inline(true)
1515

16-
left := cwdStyle.Render("~/hawk:") + " " + cwdStyle.Render("⎇ main")
16+
left := cwdStyle.Render("~/hawk") + " " + cwdStyle.Render("⎇ main")
1717
right := tokenStyle.Render("[db] 13k") + dim.Render(" · ") + tokenStyle.Render("$0.00")
1818
width := 80
1919

@@ -42,7 +42,7 @@ func TestLayoutFooterRow_StyledStringsAlignRight(t *testing.T) {
4242
func TestFinishFooterLine_PreservesRightAlignedStats(t *testing.T) {
4343
m := chatModel{width: 100, height: 24}
4444
tokenStyle := lipgloss.NewStyle().Foreground(statusTokenColor).Inline(true)
45-
left := lipgloss.NewStyle().Foreground(statusCWDColor).Inline(true).Render("~/proj:")
45+
left := lipgloss.NewStyle().Foreground(statusCWDColor).Inline(true).Render("~/proj")
4646
right := tokenStyle.Render("[db] 1k") + lipgloss.NewStyle().Foreground(dimColor).Inline(true).Render(" · ") + tokenStyle.Render("$1.00")
4747
row := layoutFooterRow(left, right, m.footerContentWidth(100))
4848
out := m.finishFooterLine(row, 100)

‎cmd/statusbar.go‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func renderStatusBarPrimaryLeft(m *chatModel) string {
121121
if !ok {
122122
return ""
123123
}
124-
parts := []string{statusCwdStyle.Render(cwd + ":")}
124+
parts := []string{statusCwdStyle.Render(cwd)}
125125
if branch := cachedStatusBranch(m); branch != "" {
126126
parts = append(parts, statusBranchStyle.Render(icons.Branch()+" "+branch))
127127
if m != nil && len(m.statusLeftPRs) > 0 {
@@ -165,15 +165,7 @@ func formatStatusCost(c *engine.Cost) string {
165165
}
166166

167167
func renderStatusBarSecondaryLeft(m *chatModel) string {
168-
if m == nil || m.session == nil {
169-
return ""
170-
}
171-
parts := []string{}
172-
branch := cachedStatusBranch(m)
173-
if branch == "main" || branch == "master" {
174-
parts = append(parts, dryRunStyle.Render(icons.Alert()+" default-branch"))
175-
}
176-
return strings.Join(parts, statusDimStyle.Render(" · "))
168+
return ""
177169
}
178170

179171
// renderStatusBarSecondaryRight — errors, dry-run, vim, focus/pause, spend.
@@ -304,7 +296,7 @@ func renderStatusBarLeft(m *chatModel) string {
304296
if !ok {
305297
return ""
306298
}
307-
parts := []string{statusCwdStyle.Render(cwd + ":")}
299+
parts := []string{statusCwdStyle.Render(cwd)}
308300
if branch := cachedStatusBranch(m); branch != "" {
309301
parts = append(parts, statusBranchStyle.Render(icons.Branch()+" "+branch))
310302
if m != nil && len(m.statusLeftPRs) > 0 {

‎cmd/statusbar_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func TestRenderStatusBarRight_OmitsDuplicatedContext(t *testing.T) {
8989
func TestRenderStatusBarLeft_UsesCachedState(t *testing.T) {
9090
m := &chatModel{statusLeftVal: "~/repo", statusLeftBranch: "main"}
9191
got := renderStatusBarLeft(m)
92-
if !strings.Contains(got, "~/repo:") {
92+
if !strings.Contains(got, "~/repo") {
9393
t.Fatalf("status left = %q, want cached cwd", got)
9494
}
9595
if !strings.Contains(got, "main") {

‎docs/architecture/control-plane.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Single entry for subagents + background tasks:
9696
### Git safety
9797
- `engine.InspectGitBranch` / `EnsureAgentBranch`
9898
- `/branch-agent` when on main/master
99-
- Status bar warns `default-branch` when on main
99+
- Status bar warns `main!` when on main
100100

101101
### HUD
102102
- Wide status secondary row: `mode:act · iso:workspace · trusted`

0 commit comments

Comments
 (0)