renderHeader renders the title and timestamp (must be called with lock held)
()
| 219 | |
| 220 | // renderHeader renders the title and timestamp (must be called with lock held) |
| 221 | func (ui *WatchUI) renderHeader() string { |
| 222 | titleStyle := lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("#7D56F4")) |
| 223 | versionStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("#6C7086")) |
| 224 | timestampStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("#6C7086")) |
| 225 | |
| 226 | title := titleStyle.Render("🐕 Dingo Watch") + " " + versionStyle.Render("v"+version.Version) |
| 227 | timestamp := timestampStyle.Render(fmt.Sprintf("[%s]", time.Now().Format("2006-01-02 15:04"))) |
| 228 | |
| 229 | // Pad to align timestamp to right (assuming 60 char width) |
| 230 | titleLen := 15 + len(version.Version) // Approximate visible length |
| 231 | timestampLen := 18 // [YYYY-MM-DD HH:MM] |
| 232 | padding := 60 - titleLen - timestampLen |
| 233 | if padding < 0 { |
| 234 | padding = 0 |
| 235 | } |
| 236 | |
| 237 | return title + strings.Repeat(" ", padding) + timestamp |
| 238 | } |
| 239 | |
| 240 | // renderMascotSection renders mascot with status on the right (must be called with lock held) |
| 241 | func (ui *WatchUI) renderMascotSection() string { |
no test coverage detected