MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / renderNarrowHeader

Method renderNarrowHeader

internal/tui/dashboard.go:209–242  ·  view source on GitHub ↗

renderNarrowHeader renders a condensed header for narrow terminals.

()

Source from the content-addressed store, hash-verified

207
208// renderNarrowHeader renders a condensed header for narrow terminals.
209func (a *App) renderNarrowHeader() string {
210 // Branding
211 brand := headerStyle.Render("chief")
212
213 // State indicator - use the centralized style system
214 stateStyle := GetStateStyle(a.state)
215 state := stateStyle.Render(fmt.Sprintf("[%s]", a.state.String()))
216
217 // Condensed iteration and time
218 elapsed := a.GetElapsedTime()
219 iterTime := SubtitleStyle.Render(fmt.Sprintf("#%d %s", a.iteration, formatDuration(elapsed)))
220
221 // Combine elements
222 leftPart := lipgloss.JoinHorizontal(lipgloss.Center, brand, " ", state)
223 rightPart := iterTime
224
225 // Create the full header line with proper spacing
226 spacing := strings.Repeat(" ", max(0, a.width-lipgloss.Width(leftPart)-lipgloss.Width(rightPart)-2))
227 headerLine := lipgloss.JoinHorizontal(lipgloss.Center, leftPart, spacing, rightPart)
228
229 // Tab bar (compact)
230 tabBarLine := a.renderTabBar()
231
232 // Worktree info line (only shown when branch is set)
233 worktreeInfoLine := a.renderWorktreeInfoLine()
234
235 // Add a border below
236 border := DividerStyle.Render(strings.Repeat("─", a.width))
237
238 if worktreeInfoLine != "" {
239 return lipgloss.JoinVertical(lipgloss.Left, headerLine, tabBarLine, worktreeInfoLine, border)
240 }
241 return lipgloss.JoinVertical(lipgloss.Left, headerLine, tabBarLine, border)
242}
243
244// renderFooter renders the footer with keyboard shortcuts, PRD name, and activity line.
245func (a *App) renderFooter() string {

Callers 1

Calls 8

GetElapsedTimeMethod · 0.95
renderTabBarMethod · 0.95
GetStateStyleFunction · 0.85
formatDurationFunction · 0.85
maxFunction · 0.85
RenderMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected