Documentation
¶
Overview ¶
Package ui provides shared UI styling and components for the TUI application.
Index ¶
- Constants
- Variables
- func ApplyFuzzyFilter(query string, items []string) []string
- func ApplyTheme()
- func ConfigColumns() []table.Column
- func FitColumns(cols []table.Column, width, gutter int) table.Layout
- func FormatEmptyValue(val string) string
- func InitTheme(p theme.Palette)
- func PaneStyle(width, height int, focused bool) lipgloss.Style
- func RemoveListBackgrounds(l list.Model) list.Model
- func RenderEmptyValue(val string) string
- func RenderScrollIndicator(hasMore, hasLess bool) string
- func TableHeader(layout table.Layout, gutter int) string
- func TableRow(layout table.Layout, values map[string]string) string
Constants ¶
const ( ColKeyName = "name" ColKeyWorkflow = "workflow" ColTitleName = "Name" )
Column keys and titles shared by more than one table.
const ( ColWidthReq = 3 ColMinFlag = 1 ColMinCount = 4 ColMinShort = 6 ColMinLabel = 8 ColMinName = 10 ColMaxFlag = 1 ColMaxCount = 4 ColMaxSteps = 5 ColMaxTime = 12 ColMaxStatus = 14 ColMaxValue = 24 ColMaxBranch = 28 ColMaxName = 36 WeightLow = 1 WeightMid = 2 WeightHigh = 3 PrioFirstToGo = 1 PrioSecondToGo = 2 PrioThirdToGo = 3 )
Column sizing vocabulary shared by every table, in display cells. Naming the floors keeps a table readable as a set of tradeoffs rather than a wall of digits. Every column holding a short value is capped, because surplus width spread across them pushes a row's cells so far apart that the eye has to travel between them on a wide terminal.
const PaneBorderSize = 2
PaneBorderSize is the space a pane's border occupies on each axis, which is what separates the width a pane is given from the width its content gets.
const RowGutterWidth = 2
RowGutterWidth is the "> " selection gutter and any status glyph that sit left of the first column, which the table itself never sees.
Variables ¶
var ( PrimaryColor color.Color SecondaryColor color.Color AccentColor color.Color MutedColor color.Color SoftMutedColor color.Color TextColor color.Color ModalBgColor color.Color ErrorColor color.Color LinkColor color.Color )
Colors used throughout the UI.
var ( BorderStyle lipgloss.Style CLIPreviewStyle lipgloss.Style ErrorStyle lipgloss.Style ErrorTitleStyle lipgloss.Style FocusedBorderStyle lipgloss.Style HelpStyle lipgloss.Style LinkStyle lipgloss.Style NormalStyle lipgloss.Style SelectedStyle lipgloss.Style SubtitleStyle lipgloss.Style TableDefaultStyle lipgloss.Style TableDimmedStyle lipgloss.Style TableHeaderStyle lipgloss.Style TableItalicStyle lipgloss.Style TableRowStyle lipgloss.Style TableSelectedStyle lipgloss.Style TitleStyle lipgloss.Style )
Styles for the application (initialized in ApplyTheme).
Functions ¶
func ApplyFuzzyFilter ¶
ApplyFuzzyFilter returns items filtered by query using fuzzy matching. Returns original items if query is empty.
func ApplyTheme ¶
func ApplyTheme()
ApplyTheme updates all colors and styles from the current palette. The three roles beyond theme.Semantic are named here because only this application needs them: a softer muted for defaults, a modal ground, and a link color.
func ConfigColumns ¶ added in v1.2.0
ConfigColumns describes the workflow-input table. Name is the column a reader scans, so it keeps the most weight and is the last to give ground.
func FitColumns ¶ added in v1.2.0
FitColumns resolves cols against the room a pane leaves for its rows, past the gutter its selection indicator and status glyphs occupy.
func FormatEmptyValue ¶
FormatEmptyValue returns the display string for a value, showing ("") for empty strings.
func PaneStyle ¶
PaneStyle returns a style for a pane with optional focus. Lipgloss counts the border inside Width and Height, so the pane occupies exactly the width and height it is given and its content gets PaneBorderSize less.
func RemoveListBackgrounds ¶
RemoveListBackgrounds removes all backgrounds from a list.Model for modal overlay.
func RenderEmptyValue ¶
RenderEmptyValue returns a styled string for a value, using italic style for empty strings.
func RenderScrollIndicator ¶
RenderScrollIndicator renders scroll arrows (^ and v) for lists.
func TableHeader ¶ added in v1.2.0
TableHeader renders a column header indented past the row gutter.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package modal provides modal dialogs for user interactions in the TUI application.
|
Package modal provides modal dialogs for user interactions in the TUI application. |
|
Package panes provides the main UI panes for workflow, history, and configuration views.
|
Package panes provides the main UI panes for workflow, history, and configuration views. |