Split hidden issue counts by level

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 20:21:00 +02:00
co-authored by Claude Sonnet 5.5
parent aec4ec6e3b
commit 17151a578d
8 changed files with 57 additions and 28 deletions
+10 -2
View File
@@ -138,8 +138,16 @@ func (m Model) lines(s *submodule.Submodule) []string {
out = append(out, "")
if n := len(s.Children); n > 0 {
children := fmt.Sprintf("%d direct", n)
if k, worst := s.HiddenIssues(); k > 0 {
children += t.LevelStyle(worst, lipgloss.NewStyle()).Render(fmt.Sprintf(" · %d issue(s) below", k))
h := s.HiddenIssues()
var parts []string
if h.Danger > 0 {
parts = append(parts, t.LevelStyle(submodule.LevelDanger, lipgloss.NewStyle()).Render(fmt.Sprintf("%d error(s)", h.Danger)))
}
if h.Warn > 0 {
parts = append(parts, t.LevelStyle(submodule.LevelWarn, lipgloss.NewStyle()).Render(fmt.Sprintf("%d warning(s)", h.Warn)))
}
if len(parts) > 0 {
children += muted.Render(" · ") + strings.Join(parts, muted.Render(", ")) + muted.Render(" below")
}
out = append(out, label("Children")+children)
}
+13 -5
View File
@@ -15,7 +15,7 @@ import (
)
const (
statusWidth = 14 // "unpushed +1 ·2"
statusWidth = 16 // "unpushed +1 ·2 ·3"
deltaWidth = 6
maxRefWidth = 22
)
@@ -414,11 +414,19 @@ func (m Model) nodeLine(r row, nameColW, refW int) string {
default:
status = seg(t.Muted, theme.InSync)
}
if k, worst := s.HiddenIssues(); collapsed && k > 0 {
if status != "" {
status += pad(1)
if h := s.HiddenIssues(); collapsed && h.Total() > 0 {
for _, c := range []struct {
level submodule.Level
n int
}{{submodule.LevelDanger, h.Danger}, {submodule.LevelWarn, h.Warn}} {
if c.n == 0 {
continue
}
if status != "" {
status += pad(1)
}
status += t.LevelStyle(c.level, base).Render(fmt.Sprintf("%s%d", t.Glyphs.Problems, c.n))
}
status += t.LevelStyle(worst, base).Render(fmt.Sprintf("%s%d", t.Glyphs.Problems, k))
}
status = ansi.Truncate(status, statusWidth, "")
status += pad(statusWidth - lipgloss.Width(status))