tui

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package tui provides a terminal user interface for msgvault.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionController

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

ActionController handles business logic for actions like deletion and export, keeping domain operations out of the TUI Model.

func NewActionController

func NewActionController(queries query.Engine, dataDir string, deletions *deletion.Manager) *ActionController

NewActionController creates a new action controller. If deletions is nil, the manager will be lazily initialized on first use.

func (*ActionController) ExportAttachments

func (c *ActionController) ExportAttachments(detail *query.MessageDetail, selection map[int]bool) tea.Cmd

ExportAttachments performs the export logic.

func (*ActionController) SaveManifest

func (c *ActionController) SaveManifest(manifest *deletion.Manifest) error

SaveManifest initializes the deletion manager if needed and saves the manifest.

func (*ActionController) StageForDeletion

func (c *ActionController) StageForDeletion(ctx DeletionContext) (*deletion.Manifest, error)

StageForDeletion prepares messages for deletion based on selection.

type DeletionContext added in v0.4.0

type DeletionContext struct {
	AggregateSelection map[string]bool
	MessageSelection   map[int64]bool
	AggregateViewType  query.ViewType
	AccountFilter      *int64
	Accounts           []query.AccountInfo
	TimeGranularity    query.TimeGranularity
	Messages           []query.MessageSummary
	DrillFilter        *query.MessageFilter
}

DeletionContext bundles the parameters needed for staging deletions.

type ExportResultMsg

type ExportResultMsg struct {
	Result string
	Err    error
}

ExportResultMsg is returned when attachment export completes.

type Model

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

Model is the main TUI model following the Elm architecture.

func New

func New(engine query.Engine, opts Options) Model

New creates a new TUI model with the given options.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) Update

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

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

type Options

type Options struct {
	DataDir string
	Version string

	// AggregateLimit overrides the maximum number of aggregate rows to load.
	// Zero uses the default (50,000).
	AggregateLimit int

	// ThreadMessageLimit overrides the maximum number of messages in a thread view.
	// Zero uses the default (1,000).
	ThreadMessageLimit int
}

Options configuration for TUI.

Jump to

Keyboard shortcuts

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