renderNarrowHeader renders a condensed header for narrow terminals.
()
| 207 | |
| 208 | // renderNarrowHeader renders a condensed header for narrow terminals. |
| 209 | func (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. |
| 245 | func (a *App) renderFooter() string { |
no test coverage detected