Add mouse tests; tidy TUI idioms

This commit is contained in:
Andy Dixon
2026-10-02 08:36:23 +01:00
parent 71556b76de
commit 8559616b65
7 changed files with 85 additions and 36 deletions
+6 -2
View File
@@ -313,7 +313,7 @@ func (m *Model) describeSelection() string {
parts = append(parts, fmt.Sprintf("%d errors", n.Errors))
}
if m.opts.Diff != nil {
parts = append(parts, textutil.SignedSize(m.opts.Diff.Delta(id, m.sizeMode))+" since "+"snapshot")
parts = append(parts, textutil.SignedSize(m.opts.Diff.Delta(id, m.sizeMode))+" vs old snapshot")
}
return strings.Join(parts, " · ")
}
@@ -403,6 +403,10 @@ func (m *Model) paintStatus(cv *Canvas, r treemap.Rect, class sizeClass) {
if x+textutil.Width(s) > r.X+avail {
break
}
x += cv.Text(x, r.Y, s, avail-x, Style{FG: p.fg, BG: t.StatusBg, Attr: map[bool]Attr{true: Bold}[i == 0]})
st := Style{FG: p.fg, BG: t.StatusBg}
if i == 0 {
st.Attr = Bold
}
x += cv.Text(x, r.Y, s, avail-x, st)
}
}