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

Method renderLogHeader

internal/tui/dashboard.go:922–959  ·  view source on GitHub ↗

renderLogHeader renders the header for the log view.

()

Source from the content-addressed store, hash-verified

920
921// renderLogHeader renders the header for the log view.
922func (a *App) renderLogHeader() string {
923 // Branding
924 brand := headerStyle.Render("chief")
925
926 // View indicator
927 viewIndicator := lipgloss.NewStyle().
928 Foreground(PrimaryColor).
929 Bold(true).
930 Render("[Log View]")
931
932 // State indicator
933 stateStyle := GetStateStyle(a.state)
934 state := stateStyle.Render(fmt.Sprintf("[%s]", a.state.String()))
935
936 // Iteration count (current/max)
937 iteration := SubtitleStyle.Render(fmt.Sprintf("Iteration: %d/%d", a.iteration, a.maxIter))
938
939 // Auto-scroll indicator
940 var scrollIndicator string
941 if a.logViewer.IsAutoScrolling() {
942 scrollIndicator = lipgloss.NewStyle().Foreground(SuccessColor).Render("[Auto-scroll]")
943 } else {
944 scrollIndicator = lipgloss.NewStyle().Foreground(MutedColor).Render("[Manual scroll]")
945 }
946
947 // Combine elements
948 leftPart := lipgloss.JoinHorizontal(lipgloss.Center, brand, " ", viewIndicator, " ", state)
949 rightPart := lipgloss.JoinHorizontal(lipgloss.Center, iteration, " ", scrollIndicator)
950
951 // Create the full header line with proper spacing
952 spacing := strings.Repeat(" ", max(0, a.width-lipgloss.Width(leftPart)-lipgloss.Width(rightPart)-2))
953 headerLine := lipgloss.JoinHorizontal(lipgloss.Center, leftPart, spacing, rightPart)
954
955 // Add a border below
956 border := DividerStyle.Render(strings.Repeat("─", a.width))
957
958 return lipgloss.JoinVertical(lipgloss.Left, headerLine, border)
959}
960
961// renderNarrowLogHeader renders a condensed header for the log view in narrow mode.
962func (a *App) renderNarrowLogHeader() string {

Callers 1

renderLogViewMethod · 0.95

Calls 5

GetStateStyleFunction · 0.85
maxFunction · 0.85
IsAutoScrollingMethod · 0.80
RenderMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected