feat: the status pane counts repos with secret files next to the accounts #27

Merged
keb merged 1 commits from feat/status-repos into main 2026-10-12 00:07:01 +02:00
2 changed files with 17 additions and 1 deletions
Showing only changes of commit 960c7ea936 - Show all commits

No files matched your search

+12
View File
@@ -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) { func TestStatusPane(t *testing.T) {
t.Parallel() t.Parallel()
var opened []string var opened []string
+5 -1
View File
@@ -38,9 +38,10 @@ func (m Model) statusLine() string {
case m.newer != nil: case m.newer != nil:
parts = append(parts, m.st.Notice.Render("↑ "+m.newer.Tag+withKey(m.keys.Update, " %s"))) 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 { for _, p := range m.providers {
if p.Kind() == provider.KindRepo { if p.Kind() == provider.KindRepo {
repos += len(m.sourceResults[p.ID()].sources) // those with secret files
continue continue
} }
accounts++ accounts++
@@ -58,6 +59,9 @@ func (m Model) statusLine() string {
} }
parts = append(parts, s) parts = append(parts, s)
} }
if repos > 0 {
parts = append(parts, plural(repos, "repo"))
}
return " " + strings.Join(parts, m.st.Muted.Render(" · ")) return " " + strings.Join(parts, m.st.Muted.Render(" · "))
} }