model

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package model provides Bubble Tea models for CLI commands.

Package model provides Bubble Tea models for CLI commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupModel

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

CleanupModel wraps styles.CleanupModel for standalone use.

func NewCleanupModel

func NewCleanupModel(theme *styles.Theme, historyUC *usecase.SearchHistoryUseCase) CleanupModel

NewCleanupModel creates a new cleanup command model.

func (CleanupModel) Init

func (m CleanupModel) Init() tea.Cmd

Init implements tea.Model.

func (CleanupModel) Update

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

Update implements tea.Model.

func (CleanupModel) View

func (m CleanupModel) View() string

View implements tea.Model.

type DmenuModel

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

DmenuModel is the Bubble Tea model for interactive dmenu.

func NewDmenuModel

func NewDmenuModel(theme *styles.Theme, historyUC *usecase.SearchHistoryUseCase) DmenuModel

NewDmenuModel creates a new dmenu model.

func (DmenuModel) Init

func (m DmenuModel) Init() tea.Cmd

Init implements tea.Model.

func (DmenuModel) SelectedURL

func (m DmenuModel) SelectedURL() string

SelectedURL returns the URL selected by the user.

func (DmenuModel) Update

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

Update implements tea.Model.

func (DmenuModel) View

func (m DmenuModel) View() string

View implements tea.Model.

type HistoryListModel

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

HistoryListModel is a simpler non-interactive model for JSON output.

func NewHistoryListModel

func NewHistoryListModel(ctx context.Context, historyUC *usecase.SearchHistoryUseCase, maxEntries int) HistoryListModel

NewHistoryListModel creates a model for list output.

func (HistoryListModel) Entries

func (m HistoryListModel) Entries() []*entity.HistoryEntry

Entries returns the loaded entries.

func (HistoryListModel) Error

func (m HistoryListModel) Error() error

Error returns any error that occurred.

func (HistoryListModel) Init

func (m HistoryListModel) Init() tea.Cmd

Init implements tea.Model.

func (HistoryListModel) Update

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

Update implements tea.Model.

func (HistoryListModel) View

func (m HistoryListModel) View() string

View implements tea.Model.

type HistoryModel

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

HistoryModel is the Bubble Tea model for interactive history browser.

func NewHistoryModel

func NewHistoryModel(ctx context.Context, theme *styles.Theme, historyUC *usecase.SearchHistoryUseCase) HistoryModel

NewHistoryModel creates a new history browser model.

func (HistoryModel) Init

func (m HistoryModel) Init() tea.Cmd

Init implements tea.Model.

func (HistoryModel) Update

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

Update implements tea.Model.

func (HistoryModel) View

func (m HistoryModel) View() string

View implements tea.Model.

type PurgeModel

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

PurgeModel wraps styles.PurgeModel for standalone CLI use.

func NewPurgeModel

func NewPurgeModel(ctx context.Context, theme *styles.Theme, purgeUC *usecase.PurgeDataUseCase, cfg PurgeModelConfig) PurgeModel

NewPurgeModel creates a new purge command model.

func (PurgeModel) Init

func (m PurgeModel) Init() tea.Cmd

Init implements tea.Model.

func (PurgeModel) Update

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

Update implements tea.Model.

func (PurgeModel) View

func (m PurgeModel) View() string

View implements tea.Model.

type PurgeModelConfig added in v0.21.0

type PurgeModelConfig struct {
	ListSessionsUC  *usecase.ListSessionsUseCase
	DeleteSessionUC *usecase.DeleteSessionUseCase
}

PurgeModelConfig contains optional dependencies for session purging.

type SessionsModel added in v0.21.0

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

SessionsModel is the Bubble Tea model for interactive session browser.

func NewSessionsModel added in v0.21.0

func NewSessionsModel(ctx context.Context, theme *styles.Theme, cfg SessionsModelConfig) SessionsModel

NewSessionsModel creates a new sessions browser model.

func (SessionsModel) Init added in v0.21.0

func (m SessionsModel) Init() tea.Cmd

Init implements tea.Model.

func (SessionsModel) Update added in v0.21.0

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

Update implements tea.Model.

func (SessionsModel) View added in v0.21.0

func (m SessionsModel) View() string

View implements tea.Model.

type SessionsModelConfig added in v0.21.0

type SessionsModelConfig struct {
	ListSessionsUC    *usecase.ListSessionsUseCase
	RestoreUC         *usecase.RestoreSessionUseCase
	DeleteSessionUC   *usecase.DeleteSessionUseCase
	CurrentSession    entity.SessionID
	MaxExitedSessions int
}

SessionsModelConfig holds configuration for the sessions model.

type StatsModel

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

StatsModel displays history analytics.

func NewStatsModel

func NewStatsModel(theme *styles.Theme, historyUC *usecase.SearchHistoryUseCase) StatsModel

NewStatsModel creates a new stats display model.

func (StatsModel) Init

func (m StatsModel) Init() tea.Cmd

Init implements tea.Model.

func (StatsModel) Update

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

Update implements tea.Model.

func (StatsModel) View

func (m StatsModel) View() string

View implements tea.Model.

Jump to

Keyboard shortcuts

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