tui

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package tui implements the terminal user interface for grut using Bubble Tea v2, Lip Gloss v2, and Bubbles v2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model is the top-level TUI model for grut. It composes panels via the layout engine, routes keyboard events, and renders the final view.

func New

func New(engine *layout.Engine, th *theme.Theme, km *keymap.Keymap, bmMgr *bm.Manager) Model

New creates a new TUI model with the given layout engine, theme, keymap, and bookmark manager.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model. Initializes all panels and starts the auto-fetch timer if configured.

func (Model) Update

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

Update implements tea.Model. Routes messages to the layout engine and handles global key bindings.

func (Model) View

func (m Model) View() tea.View

View implements tea.Model. Composes all panels and the status bar into the final view. F27: overlay notifications on top of the panel layout.

func (Model) WithChat

func (m Model) WithChat(c *chat.Model) Model

WithChat returns a copy of the model with the given chat model attached as a footer. When non-nil, the chat footer is rendered below the panel area and can receive keyboard focus via ctrl+space.

func (Model) WithConfig

func (m Model) WithConfig(cfg *config.Config) Model

WithConfig returns a copy of the model with the given configuration. Used for auto-fetch interval and sign-commits settings.

func (Model) WithGitClient

func (m Model) WithGitClient(gc git.GitClient) Model

WithGitClient returns a copy of the model with the given git client configured for app-level operations (commit, push, pull, fetch).

func (Model) WithSessionManager

func (m Model) WithSessionManager(mgr *session.Manager) Model

WithSessionManager returns a copy of the model with the given session manager configured. When set, the current session state is saved to disk on quit and restored on the next launch.

func (Model) WithUndoManager

func (m Model) WithUndoManager(um *git.UndoManager) Model

WithUndoManager returns a copy of the model with the given UndoManager configured. When set, ctrl+z and ctrl+y trigger undo/redo operations.

Jump to

Keyboard shortcuts

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