Documentation
¶
Overview ¶
Package ui contains View functions and Lipgloss styles for the TUI. Pure: Model -> string. Bubble Tea's runtime calls these on every frame; keep them allocation-light.
Index ¶
- Variables
- func EndSessionModalView(s *app.EndSessionModalState) string
- func HelpModalView() string
- func MainPaneView(m app.Model, width, height int) string
- func NewSessionModalView(m app.Model) string
- func PaletteView(p app.PaletteState, width int) string
- func SidebarView(m app.Model) string
- func TitleBarView(m app.Model, width int) string
- func View(m app.Model, width, height int) string
Constants ¶
This section is empty.
Variables ¶
var ( StyleSidebarFrame = lipgloss.NewStyle(). Border(lipgloss.NormalBorder(), false, true, false, false). Padding(0, 1). Width(28) StyleSidebarRowFocused = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("12")) StyleSidebarRowNormal = lipgloss.NewStyle() StyleSidebarRowFailed = lipgloss.NewStyle().Foreground(lipgloss.Color("9")) StyleSidebarRowRunning = lipgloss.NewStyle().Foreground(lipgloss.Color("10")) StyleHeader = lipgloss.NewStyle().Bold(true).Padding(0, 1) StyleStatusBar = lipgloss.NewStyle().Faint(true).Padding(0, 1) StyleErrBanner = lipgloss.NewStyle().Foreground(lipgloss.Color("9")).Bold(true).Padding(0, 1) StyleRunHeader = lipgloss.NewStyle().Bold(true) // StyleRunCursor is applied to the header of the run currently // selected by RunCursor when FocusArea == FocusMainPane. StyleRunCursor = lipgloss.NewStyle().Bold(true).Reverse(true) StylePromptArea = lipgloss.NewStyle().Padding(0, 1).Width(60) StyleModalFrame = lipgloss.NewStyle().Border(lipgloss.RoundedBorder()).Padding(1, 2) )
Functions ¶
func EndSessionModalView ¶
func EndSessionModalView(s *app.EndSessionModalState) string
func HelpModalView ¶
func HelpModalView() string
func MainPaneView ¶
MainPaneView renders the focused session's run timeline plus the prompt input.
height bounds how many lines are visible at once. When the rendered content exceeds height, the slice shown is anchored to the BOTTOM (so the latest run is always in view by default), shifted upward by m.MainScrollFromBottom so the user can review older history with PgUp/PgDn. height <= 0 disables clipping (useful for tests that don't care about layout).
func NewSessionModalView ¶
NewSessionModalView renders the new-session modal. It takes the whole Model (rather than just the modal state) so it can show the target namespace at the top — sessions created here land in m.Namespace, so making that visible BEFORE submission avoids surprise admission rejections.
func PaletteView ¶
func PaletteView(p app.PaletteState, width int) string
PaletteView renders the command palette overlay. Returns the empty string when the palette is closed so the caller can layer it unconditionally.
func SidebarView ¶
SidebarView renders the sidebar from the given model. Returns the styled string suitable for placement at the left of a JoinHorizontal.
The "[+ new session]" row is the last entry in visibleNames (the app.NewSessionSentinel value). Rendering it inside the loop — rather than as a separately-appended static row — lets it pick up selection styling when the user arrows down onto it.
func TitleBarView ¶
TitleBarView renders the one-line title bar at the top of the TUI: the binary name on the left and the active namespace on the right. The width parameter controls how far apart left and right are pushed; when width is non-positive a sensible default is used.
func View ¶
View renders the full TUI: title bar / sidebar | main pane / footer status bar, with an optional modal overlay.
The main pane is bounded to (height - title - footer) lines so a long run history can't push the sidebar or footer off the visible terminal. Scroll within that bounded view with PgUp/PgDn/Home/End (handled globally in the reducer).
Types ¶
This section is empty.