components

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllAppsListView

func AllAppsListView(
	allApps []simulator.App,
	cursor int,
	viewport int,
	width, height int,
	searchMode bool,
	searchQuery string,
	loading bool,
	err error,
	keys *config.KeysConfig,
) string

AllAppsListView renders the combined apps list view

Types

type AppList

type AppList struct {
	Width         int
	Height        int
	Apps          []simulator.App
	Cursor        int
	Viewport      int
	SearchMode    bool
	SearchQuery   string
	SimulatorName string
	Keys          *config.KeysConfig
}

AppList renders the app list view

func NewAppList

func NewAppList(width, height int) *AppList

NewAppList creates a new app list renderer

func (*AppList) GetFooter

func (al *AppList) GetFooter() string

GetFooter returns the footer for the app list

func (*AppList) GetStatus

func (al *AppList) GetStatus() string

GetStatus returns the status message for the app list

func (*AppList) GetTitle

func (al *AppList) GetTitle(totalCount int) string

GetTitle returns the title for the app list

func (*AppList) Render

func (al *AppList) Render() string

Render renders the app list content

func (*AppList) Update

func (al *AppList) Update(apps []simulator.App, cursor, viewport int, searchMode bool, searchQuery, simName string, keys *config.KeysConfig)

Update updates the list data

type Component added in v1.1.0

type Component interface {
	Render() string
	GetTitle() string
	GetFooter() string
}

Component is implemented by view-state components (lists, viewers) that produce a title, body, and footer for Layout to compose.

type ContentBox

type ContentBox struct {
	Width  int
	Height int
}

ContentBox represents a content area with optional header

func NewContentBox

func NewContentBox(width, height int) *ContentBox

NewContentBox creates a new content box

func (*ContentBox) Render

func (cb *ContentBox) Render(header, content string, hasHeader bool) string

Render renders content with optional header section

type DatabaseTableContent

type DatabaseTableContent struct {
	Width        int
	Height       int
	Table        *simulator.TableInfo
	TableData    []map[string]any
	DatabaseFile *simulator.FileInfo
	Viewport     int
	DataOffset   int
	Keys         *config.KeysConfig
}

DatabaseTableContent renders individual table content view

func NewDatabaseTableContent

func NewDatabaseTableContent(width, height int) *DatabaseTableContent

NewDatabaseTableContent creates a new database table content renderer

func (*DatabaseTableContent) GetFooter

func (dtc *DatabaseTableContent) GetFooter() string

GetFooter returns the footer for the table content view

func (*DatabaseTableContent) GetTitle

func (dtc *DatabaseTableContent) GetTitle() string

GetTitle returns the title for the table content view

func (*DatabaseTableContent) Render

func (dtc *DatabaseTableContent) Render() string

Render renders the table content

func (*DatabaseTableContent) Update

func (dtc *DatabaseTableContent) Update(table *simulator.TableInfo, data []map[string]any, dbFile *simulator.FileInfo, viewport, dataOffset int, keys *config.KeysConfig)

Update updates the table data

type DatabaseTableList

type DatabaseTableList struct {
	Width        int
	Height       int
	DatabaseInfo *simulator.DatabaseInfo
	DatabaseFile *simulator.FileInfo
	Cursor       int
	Viewport     int
	Keys         *config.KeysConfig
}

DatabaseTableList renders the database table list view

func NewDatabaseTableList

func NewDatabaseTableList(width, height int) *DatabaseTableList

NewDatabaseTableList creates a new database table list renderer

func (*DatabaseTableList) GetFooter

func (dtl *DatabaseTableList) GetFooter() string

GetFooter returns the footer for the database table list

func (*DatabaseTableList) GetTitle

func (dtl *DatabaseTableList) GetTitle() string

GetTitle returns the title for the database table list

func (*DatabaseTableList) Render

func (dtl *DatabaseTableList) Render() string

Render renders the database table list content

func (*DatabaseTableList) Update

func (dtl *DatabaseTableList) Update(dbInfo *simulator.DatabaseInfo, dbFile *simulator.FileInfo, cursor, viewport int, keys *config.KeysConfig)

Update updates the list data

type FileList

type FileList struct {
	Width       int
	Height      int
	Files       []simulator.FileInfo
	Cursor      int
	Viewport    int
	App         *simulator.App
	Breadcrumbs []string
	Keys        *config.KeysConfig
}

FileList renders the file list view

func NewFileList

func NewFileList(width, height int) *FileList

NewFileList creates a new file list renderer

func (*FileList) GetFooter

func (fl *FileList) GetFooter() string

GetFooter returns the footer for the file list

func (*FileList) GetTitle

func (fl *FileList) GetTitle() string

GetTitle returns the title for the file list

func (*FileList) Render

func (fl *FileList) Render() string

Render renders the file list content

func (*FileList) Update

func (fl *FileList) Update(files []simulator.FileInfo, cursor, viewport int, app *simulator.App, breadcrumbs []string, keys *config.KeysConfig)

Update updates the list data

type Layout

type Layout struct {
	Width  int
	Height int
}

Layout represents the main TUI layout structure

func NewLayout

func NewLayout(width, height int) *Layout

NewLayout creates a new layout with the given dimensions

func (*Layout) Render

func (l *Layout) Render(title, content, footer, status string) string

Render renders the complete layout with title, content, and footer

type SimulatorList

type SimulatorList struct {
	Width        int
	Height       int
	Simulators   []simulator.Item
	Cursor       int
	Viewport     int
	FilterActive bool
	SearchMode   bool
	SearchQuery  string
	Keys         *config.KeysConfig
}

SimulatorList renders the simulator list view

func NewSimulatorList

func NewSimulatorList(width, height int) *SimulatorList

NewSimulatorList creates a new simulator list renderer

func (*SimulatorList) GetFooter

func (sl *SimulatorList) GetFooter() string

GetFooter returns the footer for the simulator list

func (*SimulatorList) GetStatus

func (sl *SimulatorList) GetStatus() string

GetStatus returns the status message for the simulator list

func (*SimulatorList) GetTitle

func (sl *SimulatorList) GetTitle(totalCount int) string

GetTitle returns the title for the simulator list

func (*SimulatorList) Render

func (sl *SimulatorList) Render() string

Render renders the simulator list content

func (*SimulatorList) Update

func (sl *SimulatorList) Update(simulators []simulator.Item, cursor, viewport int, filterActive, searchMode bool, searchQuery string, keys *config.KeysConfig)

Update updates the list data

type StatusProvider added in v1.1.0

type StatusProvider interface {
	GetStatus() string
}

StatusProvider is an optional extension: components that also emit a status-line message implement this. Only FileViewer currently does (for SVG rendering warnings).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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