renderNarrowLogHeader renders a condensed header for the log view in narrow mode.
()
| 960 | |
| 961 | // renderNarrowLogHeader renders a condensed header for the log view in narrow mode. |
| 962 | func (a *App) renderNarrowLogHeader() string { |
| 963 | // Branding |
| 964 | brand := headerStyle.Render("chief") |
| 965 | |
| 966 | // Condensed view indicator |
| 967 | viewIndicator := lipgloss.NewStyle(). |
| 968 | Foreground(PrimaryColor). |
| 969 | Bold(true). |
| 970 | Render("[Log]") |
| 971 | |
| 972 | // State indicator |
| 973 | stateStyle := GetStateStyle(a.state) |
| 974 | state := stateStyle.Render(fmt.Sprintf("[%s]", a.state.String())) |
| 975 | |
| 976 | // Condensed iteration and scroll indicator |
| 977 | var scrollIcon string |
| 978 | if a.logViewer.IsAutoScrolling() { |
| 979 | scrollIcon = lipgloss.NewStyle().Foreground(SuccessColor).Render("▼") |
| 980 | } else { |
| 981 | scrollIcon = lipgloss.NewStyle().Foreground(MutedColor).Render("▽") |
| 982 | } |
| 983 | rightPart := SubtitleStyle.Render(fmt.Sprintf("#%d", a.iteration)) + " " + scrollIcon |
| 984 | |
| 985 | // Combine elements |
| 986 | leftPart := lipgloss.JoinHorizontal(lipgloss.Center, brand, " ", viewIndicator, " ", state) |
| 987 | |
| 988 | // Create the full header line with proper spacing |
| 989 | spacing := strings.Repeat(" ", max(0, a.width-lipgloss.Width(leftPart)-lipgloss.Width(rightPart)-2)) |
| 990 | headerLine := lipgloss.JoinHorizontal(lipgloss.Center, leftPart, spacing, rightPart) |
| 991 | |
| 992 | // Add a border below |
| 993 | border := DividerStyle.Render(strings.Repeat("─", a.width)) |
| 994 | |
| 995 | return lipgloss.JoinVertical(lipgloss.Left, headerLine, border) |
| 996 | } |
no test coverage detected