tui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package tui provides a Bubbletea-based TUI for the fsck command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FsckPanelUpdateCmd

func FsckPanelUpdateCmd(status fsck.Status) tea.Cmd

FsckPanelUpdateCmd returns a Cmd which Bubbletea can execute in order to retrieve and updateMsg.

func LayerProgressKey

func LayerProgressKey() string

LayerProgressKey returns a rendered "key" which can be used in the UI to visually explain to the user which fsck state is associated with the various styles.

Types

type FsckPanel

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

FsckPanel represents the UI model for the FSCK TUI.

func NewFsckPanel

func NewFsckPanel() *FsckPanel

NewFsckPanel creates a new TUI panel showing information about an ongoing fsck operation.

func (*FsckPanel) Init

func (m *FsckPanel) Init() tea.Cmd

Init is called by Bubbleteam early on to set up the app.

func (*FsckPanel) Update

func (m *FsckPanel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update is called by Bubbletea to handle events.

func (*FsckPanel) View

func (m *FsckPanel) View() string

View is called by Bubbletea to render the UI components.

type FsckPanelUpdateMsg

type FsckPanelUpdateMsg struct {
	Status fsck.Status
}

FsckPanelUpdateMsg is used to tell the FsckPanel about updated status from the fsck operation.

type LayerProgressModel

type LayerProgressModel struct {

	// PercentageStyle controls how the progress percentage is rendered.
	PercentageStyle lipgloss.Style
	// LabelStyle controls how the label string is rendered.
	LabelStyle lipgloss.Style
	// contains filtered or unexported fields
}

LayerProgressModel is the UI model for a progress bar which represents fsck status through a paricular level of the tree.

func NewLayerProgressBar

func NewLayerProgressBar(label string, width int, level int) *LayerProgressModel

NewLayerProgressBar returns a progress bar which can render information about the states of fsck ranges.

Label is the name of the range, and will be shown in the UI. width is the total width available to this model.

func (*LayerProgressModel) Init

func (m *LayerProgressModel) Init() tea.Cmd

func (*LayerProgressModel) Update

func (m *LayerProgressModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update is used to animate the progress bar during transitions. Use SetPercent to create the command you'll need to trigger the animation.

If you're rendering with ViewAs you won't need this.

func (*LayerProgressModel) View

func (m *LayerProgressModel) View() string

func (*LayerProgressModel) ViewAs

func (m *LayerProgressModel) ViewAs(rs []fsck.Range) string

type LayerUpdateMsg

type LayerUpdateMsg struct {
	Ranges []fsck.Range
}

LayerUpdateMsg is a message which carries information for a specific layer in the tree (e.g. tiles for a specific level).

type StatsViewModel

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

StatsViewModel is the UI model for a stats widget.

func NewStatsView

func NewStatsView() *StatsViewModel

NewStatsView returns a widet which displays fsck statistics.

func (*StatsViewModel) Init

func (m *StatsViewModel) Init() tea.Cmd

func (*StatsViewModel) Update

func (m *StatsViewModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update is used to update the widget.

func (*StatsViewModel) View

func (m *StatsViewModel) View() string

Jump to

Keyboard shortcuts

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