Documentation
¶
Index ¶
- Constants
- func BuildFooter(info FooterInfo, width int, bp Breakpoint, t theme.Theme) string
- func BuildHeader(info HeaderInfo, width int, bp Breakpoint, t theme.Theme) string
- func CenterText(text string, style lipgloss.Style, width int) string
- func RenderOverlay(base string, overlay string, width, height, overlayWidth int, t theme.Theme) string
- func RenderPage(chrome PageChrome, content string, header HeaderInfo, footer FooterInfo, ...) string
- func RenderTooNarrow(width, height int, t theme.Theme) string
- func ShowFooterCost(width int) bool
- func ShowFooterHints(width int) bool
- func ShowHeaderRight(width int) bool
- func ShowSidebar(width int) bool
- type Breakpoint
- type FooterInfo
- type HeaderInfo
- type PageChrome
Constants ¶
const ( MinWidth = 40 CompactMax = 59 StandardMax = 79 )
Width thresholds.
const ChromeHeight = 2
ChromeHeight is the total number of rows consumed by the unified header and footer. Content height = terminal height - ChromeHeight.
Variables ¶
This section is empty.
Functions ¶
func BuildFooter ¶
func BuildFooter(info FooterInfo, width int, bp Breakpoint, t theme.Theme) string
BuildFooter renders the unified 1-line footer bar.
Layout (premium): ⌂ cwd ⎇ branch │ ⠹ responding... │ ctrl+p · ctrl+b $0.02 Uses │ separators to create distinct zones with visual weight.
func BuildHeader ¶
func BuildHeader(info HeaderInfo, width int, bp Breakpoint, t theme.Theme) string
BuildHeader renders the unified 1-line header bar.
Layout (premium): M31A │ breadcrumb ········ model [provider] [ctx] Uses │ separators and leader dots to create visual depth.
func CenterText ¶
CenterText centers a styled text within a given width.
func RenderOverlay ¶
func RenderOverlay(base string, overlay string, width, height, overlayWidth int, t theme.Theme) string
RenderOverlay renders a sidebar or modal overlay on top of existing content. The overlay occupies the right portion of the terminal with a dimmed backdrop.
func RenderPage ¶
func RenderPage(chrome PageChrome, content string, header HeaderInfo, footer FooterInfo, t theme.Theme) string
RenderPage composes the unified page layout: 1-line header + content + 1-line footer. The total output is exactly Height rows.
func RenderTooNarrow ¶
RenderTooNarrow renders a centered "resize terminal" message when the terminal is below the minimum width threshold.
func ShowFooterCost ¶
ShowFooterCost returns true when token/cost info should appear in the footer. Hidden below 80 cols.
func ShowFooterHints ¶
ShowFooterHints returns true when keyboard shortcut hints should appear in the footer. Hidden below 60 cols.
func ShowHeaderRight ¶
ShowHeaderRight returns true when the header right zone (model badge, context meter) should be rendered. Hidden below 60 cols.
func ShowSidebar ¶
ShowSidebar returns true when the sidebar should be displayed alongside content (width ≥ 80). Below this threshold the sidebar is hidden and can only be shown as an overlay via ctrl+b.
Types ¶
type Breakpoint ¶
type Breakpoint int
Breakpoint classifies terminal width for responsive layout decisions.
const ( // UltraNarrow: < 40 cols — show "resize terminal" message only. UltraNarrow Breakpoint = iota // Compact: 40–59 cols — minimal chrome, no sidebar, no hints. Compact // Standard: 60–79 cols — full chrome, no sidebar. Standard // Full: ≥ 80 cols — sidebar visible, all chrome, full key hints. Full )
func Detect ¶
func Detect(width int) Breakpoint
Detect returns the breakpoint for a given terminal width.
type FooterInfo ¶
type FooterInfo struct {
}
FooterInfo carries the data needed to render the unified footer.
type HeaderInfo ¶
type HeaderInfo struct {
Brand string // "M31A"
Breadcrumb string // screen name, phase breadcrumb, or git branch
ModelName string // active model name
Provider string // provider short name (OR, ZEN)
CtxUsed int // context tokens used
CtxTotal int // context tokens total
}
HeaderInfo carries the data needed to render the unified header.
type PageChrome ¶
PageChrome holds the computed header and footer strings along with dimensions used for content layout.
func (PageChrome) ContentHeight ¶
func (p PageChrome) ContentHeight() int
ContentHeight returns the number of rows available for screen content.
func (PageChrome) ContentWidth ¶
func (p PageChrome) ContentWidth() int
ContentWidth returns the width available for screen content.