MCPcopy
hub / github.com/MadAppGang/dingo / renderHeader

Method renderHeader

pkg/ui/watch_ui.go:221–238  ·  view source on GitHub ↗

renderHeader renders the title and timestamp (must be called with lock held)

()

Source from the content-addressed store, hash-verified

219
220// renderHeader renders the title and timestamp (must be called with lock held)
221func (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)
241func (ui *WatchUI) renderMascotSection() string {

Callers 1

renderLayoutMethod · 0.95

Calls 2

RenderMethod · 0.80
FormatMethod · 0.65

Tested by

no test coverage detected