on main help sign in
chore(ui): adjust status notification details (#1490)
b363612Christian Rocha
internal/tui/components/core/status/status.go+5−1
@@ -82,7 +82,11 @@ func (m *statusCmp) infoMsg() string {
82 info := ansi.Truncate(m.info.Msg, widthLeft, "…")
82 info := ansi.Truncate(m.info.Msg, widthLeft, "…")
83 message = t.S().Base.Foreground(t.BgOverlay).Width(widthLeft+2).Background(t.Warning).Padding(0, 1).Render(info)
83 message = t.S().Base.Foreground(t.BgOverlay).Width(widthLeft+2).Background(t.Warning).Padding(0, 1).Render(info)
84 default:
84 default:
85+ note := "OKAY!"
86+ if m.info.Type == util.InfoTypeUpdate {
87+ note = "HEY!"
88+ }
85− infoType = t.S().Base.Foreground(t.BgSubtle).Background(t.Green).Padding(0, 1).Bold(true).Render("HEY!")
89+ infoType = t.S().Base.Foreground(t.BgSubtle).Background(t.Green).Padding(0, 1).Bold(true).Render(note)
86 widthLeft := m.width - (lipgloss.Width(infoType) + 2)
90 widthLeft := m.width - (lipgloss.Width(infoType) + 2)
87 info := ansi.Truncate(m.info.Msg, widthLeft, "…")
91 info := ansi.Truncate(m.info.Msg, widthLeft, "…")
88 message = t.S().Base.Background(t.GreenDark).Width(widthLeft+2).Foreground(t.BgSubtle).Padding(0, 1).Render(info)
92 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) {
380 statusMsg = fmt.Sprintf("This is a development version of Crush. The latest version is v%s.", msg.LatestVersion)
380 statusMsg = fmt.Sprintf("This is a development version of Crush. The latest version is v%s.", msg.LatestVersion)
381 }
381 }
382 s, statusCmd := a.status.Update(util.InfoMsg{
382 s, statusCmd := a.status.Update(util.InfoMsg{
383− Type: util.InfoTypeInfo,
383+ Type: util.InfoTypeUpdate,
384 Msg: statusMsg,
384 Msg: statusMsg,
385− TTL: 30 * time.Second,
385+ TTL: 10 * time.Second,
386 })
386 })
387 a.status = s.(status.StatusCmp)
387 a.status = s.(status.StatusCmp)
388 return a, statusCmd
388 return a, statusCmd
internal/tui/util/util.go+1
@@ -38,6 +38,7 @@ const (
38 InfoTypeSuccess
38 InfoTypeSuccess
39 InfoTypeWarn
39 InfoTypeWarn
40 InfoTypeError
40 InfoTypeError
41+ InfoTypeUpdate
41)
42)
42
43
43func ReportInfo(info string) tea.Cmd {
44func ReportInfo(info string) tea.Cmd {