Skip to content

Commit f55ae76

Browse files
mohammeds1992claude
andcommitted
fix: improve dashboard header and add update command to help
- Make version more visible in dashboard header (bright cyan) - Add update notification on separate line - Add update command to help output in Upgrades section - Add release.sh script for creating releases 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bd82c8f commit f55ae76

File tree

3 files changed

+369
-22
lines changed

3 files changed

+369
-22
lines changed

cmd/push-validator/root_cobra.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ func init() {
164164

165165
// Upgrades
166166
fmt.Fprintln(w, c.SubHeader("Upgrades"))
167+
fmt.Fprintln(w, c.FormatCommandAligned("update", "Update push-validator to latest version", cmdWidth))
167168
fmt.Fprintln(w, c.FormatCommandAligned("cosmovisor status", "Show Cosmovisor status", cmdWidth))
168169
fmt.Fprintln(w, c.FormatCommandAligned("cosmovisor upgrade-info", "Generate upgrade JSON", cmdWidth))
169170
fmt.Fprintln(w)

internal/dashboard/header.go

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,38 +65,35 @@ func (c *Header) View(w, h int) string {
6565
// Apply bold + cyan highlighting to title
6666
titleStyled := FormatTitle(c.Title(), inner)
6767

68-
// Add version after title (dimmed)
68+
// Add version on a new line (more visible cyan color)
69+
var versionLine string
6970
if c.data.CLIVersion != "" {
7071
versionStyle := lipgloss.NewStyle().
71-
Foreground(lipgloss.Color("241")) // Dim gray
72-
titleStyled = titleStyled + " " + versionStyle.Render("v"+strings.TrimPrefix(c.data.CLIVersion, "v"))
72+
Foreground(lipgloss.Color("81")). // Bright cyan - more visible
73+
Bold(false)
74+
versionLine = versionStyle.Render("v" + strings.TrimPrefix(c.data.CLIVersion, "v"))
7375
}
7476

75-
// Build the title line with optional update notification
76-
var titleLine string
77+
// Title line is just the styled title (centered)
78+
titleLine := titleStyled
79+
80+
var lines []string
81+
lines = append(lines, titleLine)
82+
83+
// Add version line (centered below title)
84+
if versionLine != "" {
85+
lines = append(lines, versionLine)
86+
}
87+
88+
// Add update notification if available (on its own line, more prominent)
7789
if c.data.UpdateInfo.Available && c.data.UpdateInfo.LatestVersion != "" {
78-
// Style for update notification
7990
updateStyle := lipgloss.NewStyle().
8091
Foreground(lipgloss.Color("226")). // Yellow/gold
8192
Bold(true)
82-
updateText := updateStyle.Render(fmt.Sprintf("⬆ Update v%s available", c.data.UpdateInfo.LatestVersion))
83-
84-
// Calculate spacing to push update text to the right
85-
titleLen := lipgloss.Width(titleStyled)
86-
updateLen := lipgloss.Width(updateText)
87-
spacing := inner - titleLen - updateLen
88-
if spacing < 2 {
89-
spacing = 2
90-
}
91-
92-
titleLine = titleStyled + strings.Repeat(" ", spacing) + updateText
93-
} else {
94-
titleLine = titleStyled
93+
updateLine := updateStyle.Render(fmt.Sprintf("⬆ Update v%s available - run: push-validator update", c.data.UpdateInfo.LatestVersion))
94+
lines = append(lines, updateLine)
9595
}
9696

97-
var lines []string
98-
lines = append(lines, titleLine)
99-
10097
if c.data.Err != nil {
10198
errLine := fmt.Sprintf("⚠ %s", c.data.Err.Error())
10299
lines = append(lines, errLine)

0 commit comments

Comments
 (0)