on main help sign in
chore(ui): adjust status notification details (#1490)
commitb363612510b0d5071a7d4e5643682ddb003728d3 authorChristian Rocha <christian@rocha.is> dateFri 21 Nov 2025, 07:13 (1 year ago) parent7b4691e
3 files changed+8−3
internal/tui/components/core/status/status.go+5−1 internal/tui/tui.go+2−2 internal/tui/util/util.go+1
internal/tui/components/core/status/status.go+5−1
@@ -82,7 +82,11 @@ func (m *statusCmp) infoMsg() string {
8282 info := ansi.Truncate(m.info.Msg, widthLeft, "…")
8383 message = t.S().Base.Foreground(t.BgOverlay).Width(widthLeft+2).Background(t.Warning).Padding(0, 1).Render(info)
8484 default:
85− infoType = t.S().Base.Foreground(t.BgSubtle).Background(t.Green).Padding(0, 1).Bold(true).Render("HEY!")
85+ note := "OKAY!"
86+ if m.info.Type == util.InfoTypeUpdate {
87+ note = "HEY!"
88+ }
89+ infoType = t.S().Base.Foreground(t.BgSubtle).Background(t.Green).Padding(0, 1).Bold(true).Render(note)
8690 widthLeft := m.width - (lipgloss.Width(infoType) + 2)
8791 info := ansi.Truncate(m.info.Msg, widthLeft, "…")
8892 message = t.S().Base.Background(t.GreenDark).Width(widthLeft+2).Foreground(t.BgSubtle).Padding(0, 1).Render(info)
internal/tui/tui.go+2−2
@@ -380,9 +380,9 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
380380 statusMsg = fmt.Sprintf("This is a development version of Crush. The latest version is v%s.", msg.LatestVersion)
381381 }
382382 s, statusCmd := a.status.Update(util.InfoMsg{
383− Type: util.InfoTypeInfo,
383+ Type: util.InfoTypeUpdate,
384384 Msg: statusMsg,
385− TTL: 30 * time.Second,
385+ TTL: 10 * time.Second,
386386 })
387387 a.status = s.(status.StatusCmp)
388388 return a, statusCmd
internal/tui/util/util.go+1
@@ -38,6 +38,7 @@ const (
3838 InfoTypeSuccess
3939 InfoTypeWarn
4040 InfoTypeError
41+ InfoTypeUpdate
4142)
4243
4344func ReportInfo(info string) tea.Cmd {