Archived
The update check ran at most once a day and only printed a line after the TUI exited. Now the registry is asked on every start (in the background, 3 s timeout, no cache) and the result reaches the TUI as a message. With a newer release, the footer shows `q quit and update to vX` right of help and quit, on a highlighted background (Theme.Highlight). `q` quits and `main` installs the release once the terminal is restored, sharing the code of `submarine update`; plain quit moves to `Q`, ctrl+c never updates. Drop LatestCached and CheckInterval. Add D27 and F58. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
25 lines
750 B
Go
25 lines
750 B
Go
package theme
|
|
|
|
import (
|
|
"github.com/charmbracelet/bubbles/help"
|
|
"github.com/charmbracelet/lipgloss"
|
|
)
|
|
|
|
// NewHelp returns a help renderer in the theme's colors.
|
|
func NewHelp(t Theme) help.Model {
|
|
h := help.New()
|
|
h.Styles.ShortKey = Fg(t.Text).Bold(true)
|
|
h.Styles.ShortDesc = Fg(t.Muted)
|
|
h.Styles.ShortSeparator = Fg(t.Border)
|
|
h.Styles.FullKey = h.Styles.ShortKey
|
|
h.Styles.FullDesc = h.Styles.ShortDesc
|
|
h.Styles.FullSeparator = h.Styles.ShortSeparator
|
|
return h
|
|
}
|
|
|
|
// Highlight is the style of a key hint that should catch the eye: dark text
|
|
// on the accent color, on the whole hint including its key.
|
|
func (t Theme) Highlight() lipgloss.Style {
|
|
return lipgloss.NewStyle().Foreground(lipgloss.Color("0")).Background(t.Primary).Bold(true)
|
|
}
|