Change summary
internal/tui/components/core/status/status.go | 6 +++++-
internal/tui/tui.go | 4 ++--
internal/tui/util/util.go | 1 +
3 files changed, 8 insertions(+), 3 deletions(-)
Detailed changes
@@ -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)
@@ -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
@@ -38,6 +38,7 @@ const (
InfoTypeSuccess
InfoTypeWarn
InfoTypeError
+ InfoTypeUpdate
)
func ReportInfo(info string) tea.Cmd {