renderLogHeader renders the header for the log view.
()
| 920 | |
| 921 | // renderLogHeader renders the header for the log view. |
| 922 | func (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. |
| 962 | func (a *App) renderNarrowLogHeader() string { |
no test coverage detected