Show failed loads as errors in the header

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 20:17:27 +02:00
co-authored by Claude Sonnet 5.5
parent e5fdc875af
commit aec4ec6e3b
2 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -36,7 +36,7 @@ func View(t theme.Theme, repo *submodule.Repo, fetch Fetch, spinner string, widt
}
// count submodules per issue kind (most severe first), plus staged pins
var total, loading, staged int
var total, loading, errored, staged int
perKind := map[submodule.IssueKind]int{}
level := map[submodule.IssueKind]submodule.Level{}
submodule.Walk(repo.Submodules, func(s *submodule.Submodule) {
@@ -44,6 +44,8 @@ func View(t theme.Theme, repo *submodule.Repo, fetch Fetch, spinner string, widt
if s.Status == nil {
if s.Err == nil {
loading++
} else {
errored++
}
return
}
@@ -58,6 +60,9 @@ func View(t theme.Theme, repo *submodule.Repo, fetch Fetch, spinner string, widt
sep := seg(t.Muted, " · ")
mid := seg(t.Muted, fmt.Sprintf("%d submodules", total))
if errored > 0 {
mid += sep + t.LevelStyle(submodule.LevelDanger, bar).Render(fmt.Sprintf("%d error", errored))
}
for _, k := range []submodule.IssueKind{
submodule.IssueUnpushed, submodule.IssueConflict, submodule.IssueMissing,
submodule.IssueOffPin, submodule.IssueChanged,