views

package
v1.5.3 Latest Latest
Warning

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

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

Documentation

Overview

Package views provides pure rendering components for TUI views.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatLogLine

func FormatLogLine(level, message string) string

FormatLogLine formats a single log entry with appropriate styling

func FormatLogLines

func FormatLogLines(logs []LogEntry) string

FormatLogLines formats multiple log entries

func RenderWithChrome

func RenderWithChrome(
	config ChromeConfig,
	renderBody func(contentHeight int) string,
) string

RenderWithChrome renders a page body with consistent header and footer chrome

Types

type ChromeConfig

type ChromeConfig struct {
	Width          int
	Height         int
	ConfigFile     string
	CompletedCount int
	TotalRuns      int
	Elapsed        time.Duration
	KeyBindings    []KeyBinding
}

ChromeConfig contains configuration for rendering page chrome

type HeaderFooterView

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

HeaderFooterView renders header and footer components

func NewHeaderFooterView

func NewHeaderFooterView(width int) *HeaderFooterView

NewHeaderFooterView creates a new header/footer view

func (*HeaderFooterView) RenderFooter

func (v *HeaderFooterView) RenderFooter(keyBindings []KeyBinding) string

RenderFooter renders the bottom help text with dynamic key bindings

func (*HeaderFooterView) RenderHeader

func (v *HeaderFooterView) RenderHeader(
	configFile string,
	completedCount, totalRuns int,
	elapsed time.Duration,
) string

RenderHeader renders the top banner with progress

type KeyBinding

type KeyBinding struct {
	Keys        string // e.g., "↑/↓ j/k", "enter", "q/ctrl+c"
	Description string // e.g., "navigate", "select file", "quit"
}

KeyBinding represents a keyboard shortcut with description

type LogEntry

type LogEntry struct {
	Level   string
	Message string
}

LogEntry represents a single log line

type LogsView

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

LogsView renders the logs panel with viewport

func NewLogsView

func NewLogsView(focused bool) *LogsView

NewLogsView creates a new logs view

func (*LogsView) Render

func (v *LogsView) Render(vp *viewport.Model, ready bool, width int) string

Render renders the logs panel

type ResultView

type ResultView struct{}

ResultView renders a detailed result for a completed run

func NewResultView

func NewResultView() *ResultView

NewResultView creates a new result view

func (*ResultView) Render

func (v *ResultView) Render(res *statestore.RunResult, status RunStatus) string

Render renders the result details

type RunStatus

type RunStatus int

RunStatus represents the status of a run

const (
	// StatusRunning indicates a run is currently executing
	StatusRunning RunStatus = iota
	// StatusCompleted indicates a run finished successfully
	StatusCompleted
	// StatusFailed indicates a run encountered an error
	StatusFailed
)

Run status constants

type RunsTableView

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

RunsTableView renders the active runs table

func NewRunsTableView

func NewRunsTableView() *RunsTableView

NewRunsTableView creates a new RunsTableView

func (*RunsTableView) GetColumns

func (v *RunsTableView) GetColumns() []table.Column

GetColumns returns the table columns

func (*RunsTableView) GetTableStyle

func (v *RunsTableView) GetTableStyle() table.Styles

GetTableStyle returns the table style

func (*RunsTableView) Render

Render renders the runs table with the given view model

func (*RunsTableView) SetDimensions

func (v *RunsTableView) SetDimensions(width, height int)

SetDimensions updates the view dimensions

func (*RunsTableView) SetFocused

func (v *RunsTableView) SetFocused(focused bool)

SetFocused sets the focused state

type SummaryView

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

SummaryView renders the final execution summary

func NewSummaryView

func NewSummaryView(width int, ciMode bool) *SummaryView

NewSummaryView creates a new summary view

func (*SummaryView) Render

Render renders the summary using the provided ViewModel

Jump to

Keyboard shortcuts

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