diff --git a/internal/tui/components/core/status/status.go b/internal/tui/components/core/status/status.go index 66903704e3effcc800b36222381f05ca1be895aa..6d14c5db4c5c343e16bbda7f0846a0fcbfa61b36 100644 --- a/internal/tui/components/core/status/status.go +++ b/internal/tui/components/core/status/status.go @@ -82,7 +82,11 @@ func (m *statusCmp) infoMsg() string { info := ansi.Truncate(m.info.Msg, widthLeft, "…") message = t.S().Base.Foreground(t.BgOverlay).Width(widthLeft+2).Background(t.Warning).Padding(0, 1).Render(info) default: - infoType = t.S().Base.Foreground(t.BgSubtle).Background(t.Green).Padding(0, 1).Bold(true).Render("HEY!") + note := "OKAY!" + if m.info.Type == util.InfoTypeUpdate { + note = "HEY!" + } + infoType = t.S().Base.Foreground(t.BgSubtle).Background(t.Green).Padding(0, 1).Bold(true).Render(note) widthLeft := m.width - (lipgloss.Width(infoType) + 2) info := ansi.Truncate(m.info.Msg, widthLeft, "…") message = t.S().Base.Background(t.GreenDark).Width(widthLeft+2).Foreground(t.BgSubtle).Padding(0, 1).Render(info) diff --git a/internal/tui/tui.go b/internal/tui/tui.go index e4eea700a4c109fa291fbaad3dc764e6df23921b..c53220094ef6af67f789b98ff177a09fa3dfd7b1 100644 --- a/internal/tui/tui.go +++ b/internal/tui/tui.go @@ -380,9 +380,9 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { statusMsg = fmt.Sprintf("This is a development version of Crush. The latest version is v%s.", msg.LatestVersion) } s, statusCmd := a.status.Update(util.InfoMsg{ - Type: util.InfoTypeInfo, + Type: util.InfoTypeUpdate, Msg: statusMsg, - TTL: 30 * time.Second, + TTL: 10 * time.Second, }) a.status = s.(status.StatusCmp) return a, statusCmd diff --git a/internal/tui/util/util.go b/internal/tui/util/util.go index 297a9d36fa47170cae787c82419a17b51fc13b05..ca5c20a837caffbbb257f0527a3b7802c1cf580a 100644 --- a/internal/tui/util/util.go +++ b/internal/tui/util/util.go @@ -38,6 +38,7 @@ const ( InfoTypeSuccess InfoTypeWarn InfoTypeError + InfoTypeUpdate ) func ReportInfo(info string) tea.Cmd {