components

package
v0.1.52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinLeftPanelWidth  = 45
	MinRightPanelWidth = 40
)
View Source
const (
	// Slightly wider than the minimum width for
	// horizontal layout for test execution view
	TestViewMinRecommendedWidth  = 150
	TestViewMinRecommendedHeight = 40

	// Below this, show warning overlay
	TestViewAbsoluteMinWidth  = 60
	TestViewAbsoluteMinHeight = 25
)
View Source
const (
	ListViewMinRecommendedWidth  = 140
	ListViewMinRecommendedHeight = 20

	// Below this, show warning overlay
	ListViewAbsoluteMinWidth  = 55
	ListViewAbsoluteMinHeight = 15
)

Variables

This section is empty.

Functions

func Footer(width int, helpText string) string

func RenderScrollbar added in v0.1.43

func RenderScrollbar(height, totalLines, scrollOffset int) string

RenderScrollbar renders a vertical scrollbar given the visible height, total content lines, and current scroll offset.

func Title

func Title(width int, text string) string

Types

type ContentPanel added in v0.1.43

type ContentPanel struct {

	// Configuration
	EmptyLineAfterTitle bool
	// contains filtered or unexported fields
}

ContentPanel is a scrollable panel with text selection support

func NewContentPanel added in v0.1.43

func NewContentPanel() *ContentPanel

NewContentPanel creates a new content panel

func (*ContentPanel) ClearSelection added in v0.1.43

func (cp *ContentPanel) ClearSelection()

ClearSelection clears the current selection

func (*ContentPanel) CopyText added in v0.1.49

func (cp *ContentPanel) CopyText(text string) tea.Cmd

CopyText copies the given text to clipboard and shows the "[copied]" indicator. Returns a tea.Cmd to reset the indicator after a timeout.

func (*ContentPanel) GetRawContent added in v0.1.49

func (cp *ContentPanel) GetRawContent() string

GetRawContent returns the raw content without ANSI codes

func (*ContentPanel) GetSelectedText added in v0.1.43

func (cp *ContentPanel) GetSelectedText() string

GetSelectedText returns the currently selected text

func (*ContentPanel) GetViewportWidth added in v0.1.43

func (cp *ContentPanel) GetViewportWidth() int

GetViewportWidth returns the viewport width

func (*ContentPanel) GotoBottom added in v0.1.43

func (cp *ContentPanel) GotoBottom()

GotoBottom scrolls to the bottom

func (*ContentPanel) GotoTop added in v0.1.43

func (cp *ContentPanel) GotoTop()

GotoTop scrolls to the top

func (*ContentPanel) HalfPageDown added in v0.1.43

func (cp *ContentPanel) HalfPageDown()

HalfPageDown scrolls down by half a page

func (*ContentPanel) HalfPageUp added in v0.1.43

func (cp *ContentPanel) HalfPageUp()

HalfPageUp scrolls up by half a page

func (*ContentPanel) IsSelecting added in v0.1.43

func (cp *ContentPanel) IsSelecting() bool

IsSelecting returns true if the user is currently selecting text

func (*ContentPanel) ScrollDown added in v0.1.43

func (cp *ContentPanel) ScrollDown(n int)

ScrollDown scrolls down by n lines

func (*ContentPanel) ScrollUp added in v0.1.43

func (cp *ContentPanel) ScrollUp(n int)

ScrollUp scrolls up by n lines

func (*ContentPanel) SetContent added in v0.1.43

func (cp *ContentPanel) SetContent(content string)

SetContent sets the content to display

func (*ContentPanel) SetContentLines added in v0.1.43

func (cp *ContentPanel) SetContentLines(lines []string)

SetContentLines sets the content lines directly (useful for pre-processed content)

func (*ContentPanel) SetContentWithWrapping added in v0.1.51

func (cp *ContentPanel) SetContentWithWrapping(content string, wrapWidth int)

SetContentWithWrapping sets content and wraps it to the given width Uses SoftLineBreak markers so copying preserves original line structure

func (*ContentPanel) SetOffset added in v0.1.43

func (cp *ContentPanel) SetOffset(x, y int)

SetOffset sets the panel's position on screen (for mouse coordinate translation)

func (*ContentPanel) SetTitle added in v0.1.43

func (cp *ContentPanel) SetTitle(title string)

SetTitle sets the panel title

func (*ContentPanel) SetXOffset added in v0.1.43

func (cp *ContentPanel) SetXOffset(offset int)

SetXOffset sets the panel's X position on screen (for mouse coordinate translation)

func (*ContentPanel) SetYOffset added in v0.1.43

func (cp *ContentPanel) SetYOffset(offset int)

SetYOffset sets the panel's Y position on screen (for mouse coordinate translation)

func (*ContentPanel) Update added in v0.1.43

func (cp *ContentPanel) Update(msg tea.Msg) tea.Cmd

Update handles input messages (mouse and auto-scroll only)

func (*ContentPanel) UpdateContentLines added in v0.1.43

func (cp *ContentPanel) UpdateContentLines(lines []string)

UpdateContentLines updates content lines without clearing selection Use this when content changes but you want to preserve any active selection Lines may contain SoftLineBreak markers which will be stripped for display but preserved for copy operations

func (*ContentPanel) View added in v0.1.43

func (cp *ContentPanel) View(width, height int) string

View renders the panel with the given dimensions

type DetailsPanel added in v0.1.43

type DetailsPanel struct {
	*ContentPanel
}

DetailsPanel wraps ContentPanel for the list command

func NewDetailsPanel added in v0.1.43

func NewDetailsPanel() *DetailsPanel

NewDetailsPanel creates a new details panel

func (*DetailsPanel) CopyAllContent added in v0.1.49

func (dp *DetailsPanel) CopyAllContent() tea.Cmd

CopyAllContent copies all panel content to the clipboard

func (*DetailsPanel) SetSize added in v0.1.43

func (dp *DetailsPanel) SetSize(width, height int)

SetSize sets the panel dimensions

func (*DetailsPanel) Update added in v0.1.43

func (dp *DetailsPanel) Update(msg tea.Msg) tea.Cmd

Update handles input messages

func (*DetailsPanel) View added in v0.1.43

func (dp *DetailsPanel) View() string

View renders the panel (uses stored dimensions from SetSize)

type LogPanelComponent

type LogPanelComponent struct {
	*ContentPanel
	// contains filtered or unexported fields
}

LogPanelComponent wraps ContentPanel and adds log management

func NewLogPanelComponent

func NewLogPanelComponent() *LogPanelComponent

NewLogPanelComponent creates a new log panel

func (*LogPanelComponent) AddServiceLog

func (lp *LogPanelComponent) AddServiceLog(line string)

AddServiceLog adds a log line to service logs

func (*LogPanelComponent) AddTestLog

func (lp *LogPanelComponent) AddTestLog(testID, line string)

AddTestLog adds a log line to a specific test's logs

func (*LogPanelComponent) CopyAllLogs added in v0.1.49

func (lp *LogPanelComponent) CopyAllLogs() tea.Cmd

CopyAllLogs copies all currently visible logs to the clipboard

func (*LogPanelComponent) GetRawLogs

func (lp *LogPanelComponent) GetRawLogs() string

GetRawLogs returns the raw log content without ANSI codes

func (*LogPanelComponent) SetCurrentTest

func (lp *LogPanelComponent) SetCurrentTest(testID string)

SetCurrentTest sets the current test to display logs for

func (*LogPanelComponent) SetOffset added in v0.1.43

func (lp *LogPanelComponent) SetOffset(x, y int)

SetOffset sets the panel's position on screen (for mouse coordinate translation)

func (*LogPanelComponent) Update

func (lp *LogPanelComponent) Update(msg tea.Msg) tea.Cmd

Update handles input messages

func (*LogPanelComponent) View

func (lp *LogPanelComponent) View(width, height int) string

View renders the panel with the given dimensions

type PanelWidths added in v0.1.51

type PanelWidths struct {
	Left  int
	Right int
}

PanelWidths holds calculated widths for a two-panel layout

func CalculatePanelWidths added in v0.1.51

func CalculatePanelWidths(totalWidth, minLeft, minRight int) PanelWidths

CalculatePanelWidths computes optimal widths for horizontal layout. Uses 50/50 split when both halves can meet their minimums. Otherwise shrinks proportionally while respecting minimums.

type SelectionPos added in v0.1.43

type SelectionPos struct {
	Line int
	Col  int
}

SelectionPos represents a position in the content

type SelectorOption added in v0.1.23

type SelectorOption struct {
	ID    string
	Label string
}

SelectorOption represents a selectable item

func RunSelector added in v0.1.23

func RunSelector(prompt string, options []SelectorOption, currentID string) (*SelectorOption, error)

RunSelector runs an interactive selector and returns the selected option

type TerminalSizeWarning added in v0.1.16

type TerminalSizeWarning struct {
	// contains filtered or unexported fields
}

TerminalSizeWarning handles the terminal size warning overlay

func NewListViewSizeWarning added in v0.1.16

func NewListViewSizeWarning() *TerminalSizeWarning

NewListViewSizeWarning creates a warning for list view

func NewTerminalSizeWarning added in v0.1.16

func NewTerminalSizeWarning(minWidth, minHeight, recommendedWidth, recommendedHeight int) *TerminalSizeWarning

func NewTestViewSizeWarning added in v0.1.16

func NewTestViewSizeWarning() *TerminalSizeWarning

NewTestExecutorSizeWarning creates a warning for test view

func (*TerminalSizeWarning) Dismiss added in v0.1.16

func (w *TerminalSizeWarning) Dismiss()

Dismiss marks the warning as dismissed

func (*TerminalSizeWarning) IsDismissed added in v0.1.16

func (w *TerminalSizeWarning) IsDismissed() bool

IsDismissed returns whether the warning has been dismissed

func (*TerminalSizeWarning) IsTooSmall added in v0.1.16

func (w *TerminalSizeWarning) IsTooSmall(width, height int) bool

IsTooSmall checks if the terminal size is below minimum

func (*TerminalSizeWarning) Reset added in v0.1.16

func (w *TerminalSizeWarning) Reset()

Reset resets the dismissed state (useful when window becomes large then small again)

func (*TerminalSizeWarning) ShouldShow added in v0.1.16

func (w *TerminalSizeWarning) ShouldShow(width, height int) bool

ShouldShow returns true if the warning should be displayed. Always returns false if TUSK_TUI_CI_MODE=1 to support CI testing.

func (*TerminalSizeWarning) View added in v0.1.16

func (w *TerminalSizeWarning) View(width, height int) string

View renders the warning overlay

type TestExecutionHeaderComponent

type TestExecutionHeaderComponent struct {
	// contains filtered or unexported fields
}

func NewTestExecutionHeaderComponent

func NewTestExecutionHeaderComponent(testCount int) *TestExecutionHeaderComponent

func (*TestExecutionHeaderComponent) SetCompleted

func (h *TestExecutionHeaderComponent) SetCompleted()

func (*TestExecutionHeaderComponent) SetInitialProgress added in v0.1.4

func (h *TestExecutionHeaderComponent) SetInitialProgress() tea.Cmd

func (*TestExecutionHeaderComponent) Update

func (h *TestExecutionHeaderComponent) Update(msg tea.Msg) tea.Cmd

func (*TestExecutionHeaderComponent) UpdateStats

func (h *TestExecutionHeaderComponent) UpdateStats(completed, passed, failed, running int) tea.Cmd

func (*TestExecutionHeaderComponent) View

func (h *TestExecutionHeaderComponent) View(width int) string

type TestTableComponent

type TestTableComponent struct {
	// contains filtered or unexported fields
}

func NewTestTableComponent

func NewTestTableComponent(tests []runner.Test) *TestTableComponent

func (*TestTableComponent) Cursor added in v0.1.43

func (tt *TestTableComponent) Cursor() int

func (*TestTableComponent) GetSelectedTest

func (tt *TestTableComponent) GetSelectedTest() *runner.Test

func (*TestTableComponent) GotoBottom

func (tt *TestTableComponent) GotoBottom()

func (*TestTableComponent) GotoTop

func (tt *TestTableComponent) GotoTop()

func (*TestTableComponent) HalfPageDown added in v0.1.43

func (tt *TestTableComponent) HalfPageDown()

HalfPageDown scrolls the viewport down by half a page, clamping cursor

func (*TestTableComponent) HalfPageUp added in v0.1.43

func (tt *TestTableComponent) HalfPageUp()

HalfPageUp scrolls the viewport up by half a page, clamping cursor

func (*TestTableComponent) Height added in v0.1.43

func (tt *TestTableComponent) Height() int

func (*TestTableComponent) IsServiceLogsSelected

func (tt *TestTableComponent) IsServiceLogsSelected() bool

func (*TestTableComponent) MoveDown added in v0.1.43

func (tt *TestTableComponent) MoveDown(n int)

MoveDown is an alias for SelectDown (for backwards compatibility)

func (*TestTableComponent) MoveUp added in v0.1.43

func (tt *TestTableComponent) MoveUp(n int)

MoveUp is an alias for SelectUp (for backwards compatibility)

func (*TestTableComponent) ScrollDown added in v0.1.43

func (tt *TestTableComponent) ScrollDown(n int)

ScrollDown scrolls the viewport down by n rows, clamping cursor to visible bounds

func (*TestTableComponent) ScrollUp added in v0.1.43

func (tt *TestTableComponent) ScrollUp(n int)

ScrollUp scrolls the viewport up by n rows, clamping cursor to visible bounds

func (*TestTableComponent) SelectDown added in v0.1.43

func (tt *TestTableComponent) SelectDown(n int)

SelectDown moves the selection down by n rows (updates details panel)

func (*TestTableComponent) SelectUp added in v0.1.43

func (tt *TestTableComponent) SelectUp(n int)

SelectUp moves the selection up by n rows (updates details panel)

func (*TestTableComponent) TotalRows added in v0.1.43

func (tt *TestTableComponent) TotalRows() int

func (*TestTableComponent) Update

func (tt *TestTableComponent) Update(msg tea.Msg) tea.Cmd

func (*TestTableComponent) UpdateTestResult

func (tt *TestTableComponent) UpdateTestResult(index int, result runner.TestResult, err error)

func (*TestTableComponent) View

func (tt *TestTableComponent) View(width, height int) string

func (*TestTableComponent) ViewportYOffset added in v0.1.43

func (tt *TestTableComponent) ViewportYOffset() int

ViewportYOffset returns the current viewport scroll offset

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL