Documentation
¶
Index ¶
- Constants
- func TruncateANSI(s string, n int) string
- type Column
- type Row
- type TableModel
- func (t *TableModel) Cursor() int
- func (t *TableModel) GotoTop()
- func (t TableModel) HeaderView() string
- func (t *TableModel) Rows() []Row
- func (t *TableModel) SetColumns(cols []Column)
- func (t *TableModel) SetCursor(row int)
- func (t *TableModel) SetHeight(h int)
- func (t *TableModel) SetRows(rows []Row)
- func (t *TableModel) SetWidth(w int)
- func (t TableModel) Update(msg tea.Msg) (TableModel, tea.Cmd)
- func (t TableModel) View() string
Constants ¶
View Source
const ( CLIAccent = "#5EB8FF" CLIBrightWhite = "#FFFFFF" CLIText = "#CED1D7" CLITextMuted = "#989EA8" CLITextSubtle = "#848892" CLIBorder = "#343A47" CLIBgElevated = "#1A1B1E" CLIError = "#FF7870" CLISuccess = "#5DE28D" CLIWarning = "#FFC833" )
Harness CLI terminal palette — fixed dark theme (docs/design-system.md).
View Source
const GutterWidth = 2
GutterWidth is the reserved left gutter: "▶ " or " ".
Variables ¶
This section is empty.
Functions ¶
func TruncateANSI ¶
TruncateANSI keeps the first n visible runes of s, preserving ANSI codes.
Types ¶
type TableModel ¶
type TableModel struct {
// contains filtered or unexported fields
}
TableModel is a bubbletea-compatible table with a custom renderer. It owns cursor/scroll state and supports colored cell values.
func NewTable ¶
func NewTable(columns []Column, height, width int) TableModel
NewTable creates a TableModel with sensible defaults.
func (*TableModel) Cursor ¶
func (t *TableModel) Cursor() int
func (*TableModel) GotoTop ¶
func (t *TableModel) GotoTop()
func (TableModel) HeaderView ¶
func (t TableModel) HeaderView() string
HeaderView returns just the header row (same styling as View).
func (*TableModel) Rows ¶
func (t *TableModel) Rows() []Row
func (*TableModel) SetColumns ¶
func (t *TableModel) SetColumns(cols []Column)
func (*TableModel) SetCursor ¶
func (t *TableModel) SetCursor(row int)
SetCursor moves the cursor to row, clamped to [0, len(rows)-1] (or 0 when there are no rows), and scrolls it into view.
func (*TableModel) SetHeight ¶
func (t *TableModel) SetHeight(h int)
func (*TableModel) SetRows ¶
func (t *TableModel) SetRows(rows []Row)
func (*TableModel) SetWidth ¶
func (t *TableModel) SetWidth(w int)
func (TableModel) Update ¶
func (t TableModel) Update(msg tea.Msg) (TableModel, tea.Cmd)
func (TableModel) View ¶
func (t TableModel) View() string
Click to show internal directories.
Click to hide internal directories.