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

Method renderFooter

internal/tui/dashboard.go:245–284  ·  view source on GitHub ↗

renderFooter renders the footer with keyboard shortcuts, PRD name, and activity line.

()

Source from the content-addressed store, hash-verified

243
244// renderFooter renders the footer with keyboard shortcuts, PRD name, and activity line.
245func (a *App) renderFooter() string {
246 // Keyboard shortcuts (context-sensitive based on view and state)
247 var shortcuts []string
248
249 if a.viewMode == ViewLog {
250 // Log view shortcuts
251 shortcuts = []string{"t: dashboard", "d: diff", "e: edit", "n: new", "l: list", "1-9: switch", "?: help", "j/k: scroll", "q: quit"}
252 } else if a.viewMode == ViewDiff {
253 // Diff view shortcuts
254 shortcuts = []string{"d: dashboard", "t: log", "e: edit", "n: new", "l: list", "?: help", "j/k: scroll", "q: quit"}
255 } else {
256 // Dashboard view shortcuts
257 switch a.state {
258 case StateReady, StatePaused:
259 shortcuts = []string{"s: start", "d: diff", "e: edit", "t: log", "n: new", "l: list", "1-9: switch", "?: help", "q: quit"}
260 case StateRunning:
261 shortcuts = []string{"p: pause", "x: stop", "d: diff", "t: log", "n: new", "l: list", "1-9: switch", "?: help", "q: quit"}
262 case StateStopped, StateError:
263 shortcuts = []string{"s: retry", "d: diff", "e: edit", "t: log", "n: new", "l: list", "1-9: switch", "?: help", "q: quit"}
264 default:
265 shortcuts = []string{"d: diff", "e: edit", "t: log", "n: new", "l: list", "1-9: switch", "?: help", "q: quit"}
266 }
267 }
268 shortcutsStr := footerStyle.Render(strings.Join(shortcuts, " │ "))
269
270 // PRD name
271 prdInfo := footerStyle.Render(fmt.Sprintf("PRD: %s", a.prdName))
272
273 // Create footer line with proper spacing
274 spacing := strings.Repeat(" ", max(0, a.width-lipgloss.Width(shortcutsStr)-lipgloss.Width(prdInfo)-2))
275 footerLine := lipgloss.JoinHorizontal(lipgloss.Center, shortcutsStr, spacing, prdInfo)
276
277 // Activity line
278 activityLine := a.renderActivityLine()
279
280 // Add border above
281 border := DividerStyle.Render(strings.Repeat("─", a.width))
282
283 return lipgloss.JoinVertical(lipgloss.Left, border, activityLine, footerLine)
284}
285
286// renderNarrowFooter renders a condensed footer for narrow terminals.
287func (a *App) renderNarrowFooter() string {

Callers 3

renderDashboardMethod · 0.95
renderDiffViewMethod · 0.95
renderLogViewMethod · 0.95

Calls 3

renderActivityLineMethod · 0.95
maxFunction · 0.85
RenderMethod · 0.45

Tested by

no test coverage detected