From a6293178b64060f9927ebc8758f4ab9ffe688ea2 Mon Sep 17 00:00:00 2001 From: keb Date: Mon, 12 Oct 2026 00:07:00 +0200 Subject: [PATCH] feat: the status pane counts repos with secret files next to the accounts (#27) Co-Authored-By: Claude Opus 5.5 (1M context) --- internal/ui/app/app_test.go | 12 ++++++++++++ internal/ui/app/status.go | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/internal/ui/app/app_test.go b/internal/ui/app/app_test.go index db83bb1..0a104a1 100644 --- a/internal/ui/app/app_test.go +++ b/internal/ui/app/app_test.go @@ -1181,6 +1181,18 @@ func TestDetailsFollowFocus(t *testing.T) { } } +func TestStatusLineCountsRepos(t *testing.T) { + t.Parallel() + d := newDriver(t, fake.Azure(0), fake.Repos()) + if line := strings.Split(d.screen(), "\n")[1]; !strings.Contains(line, "1 account · 3 repos") { + t.Errorf("status line: %q", line) + } + d = newDriver(t, fake.Azure(0)) + if line := strings.Split(d.screen(), "\n")[1]; strings.Contains(line, "repo") { + t.Errorf("repos counted without any: %q", line) + } +} + func TestStatusPane(t *testing.T) { t.Parallel() var opened []string diff --git a/internal/ui/app/status.go b/internal/ui/app/status.go index 7925d01..7bc4730 100644 --- a/internal/ui/app/status.go +++ b/internal/ui/app/status.go @@ -38,9 +38,10 @@ func (m Model) statusLine() string { case m.newer != nil: parts = append(parts, m.st.Notice.Render("↑ "+m.newer.Tag+withKey(m.keys.Update, " %s"))) } - accounts, failing := 0, 0 + accounts, failing, repos := 0, 0, 0 for _, p := range m.providers { if p.Kind() == provider.KindRepo { + repos += len(m.sourceResults[p.ID()].sources) // those with secret files continue } accounts++ @@ -58,6 +59,9 @@ func (m Model) statusLine() string { } parts = append(parts, s) } + if repos > 0 { + parts = append(parts, plural(repos, "repo")) + } return " " + strings.Join(parts, m.st.Muted.Render(" · ")) }