app

package
v0.0.0-...-6b1cd05 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FocusPane

func FocusPane(p Pane) tea.Cmd

FocusPane returns a command that sends a FocusPaneMsg.

func JoinLayout

func JoinLayout(sidebar, main, statusBar string, layout Layout) string

JoinLayout renders the sidebar and main pane side by side, with the status bar below. Top/bottom padding keeps content away from terminal/tmux chrome.

func SwitchView

func SwitchView(v ViewMode) tea.Cmd

SwitchView returns a command that sends a SwitchViewMsg.

Types

type ErrorMsg

type ErrorMsg struct{ Err error }

ErrorMsg wraps an error for display in the status bar.

func (ErrorMsg) Error

func (e ErrorMsg) Error() string

type FocusPaneMsg

type FocusPaneMsg struct{ Pane Pane }

FocusPaneMsg requests focus to move to a specific pane.

type FolderPickedMsg

type FolderPickedMsg struct {
	Path string
	Err  error
}

FolderPickedMsg is sent when the macOS folder picker completes.

type Layout

type Layout struct {
	SidebarWidth  int
	SidebarHeight int
	MainWidth     int
	MainHeight    int
	StatusWidth   int
	TotalWidth    int
	TotalHeight   int
}

Layout holds the computed dimensions for each pane.

func ComputeLayout

func ComputeLayout(totalWidth, totalHeight, sidebarWidth int) Layout

ComputeLayout calculates pane dimensions from the terminal size. If sidebarWidth is > 0, it uses that value; otherwise auto-calculates.

type Model

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

Model is the root application model.

func New

func New() (Model, error)

New creates a new application model. Returns an error if tmux is unavailable.

func NewForTest

func NewForTest() Model

NewForTest creates a model without tmux for unit testing.

func (*Model) Cleanup

func (m *Model) Cleanup()

Cleanup shuts down the tmux session. Call this before exiting.

func (Model) FocusedPane

func (m Model) FocusedPane() Pane

FocusedPane returns the currently focused pane.

func (Model) FocusedSessionID

func (m Model) FocusedSessionID() string

FocusedSessionID returns the ID of the focused session.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) Quitting

func (m Model) Quitting() bool

Quitting returns whether the app is quitting.

func (Model) Ready

func (m Model) Ready() bool

Ready returns whether the app has received its first WindowSizeMsg.

func (*Model) SaveAndDetach

func (m *Model) SaveAndDetach()

SaveAndDetach saves state without killing tmux. Used by signal handlers.

func (Model) SessionManager

func (m Model) SessionManager() *session.Manager

SessionManager returns the session manager.

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.

func (Model) ViewMode

func (m Model) ViewMode() ViewMode

ViewMode returns the current view mode.

type Pane

type Pane int

Pane identifies a UI pane.

const (
	SidebarPane Pane = iota
	MainPane
)

type SessionSelectedMsg

type SessionSelectedMsg struct{ SessionID string }

SessionSelectedMsg is sent when a session is selected in the sidebar.

type SwitchViewMsg

type SwitchViewMsg struct{ View ViewMode }

SwitchViewMsg requests switching the main pane view.

type Theme

type Theme struct {
	Colors theme.ColorPalette

	// Borders
	FocusedBorder   lipgloss.Style
	UnfocusedBorder lipgloss.Style

	// Text
	TitleStyle    lipgloss.Style
	SubtitleStyle lipgloss.Style
	HintStyle     lipgloss.Style
	ErrorStyle    lipgloss.Style
}

Theme holds all centralized styles for the application.

func DefaultTheme

func DefaultTheme() Theme

DefaultTheme returns the default application theme.

func ThemeFromConfig

func ThemeFromConfig(cfg config.ThemeConfig) Theme

ThemeFromConfig builds a theme from the given config, falling back to defaults.

type ViewMode

type ViewMode int

ViewMode identifies which view is shown in the main pane.

const (
	AgentView ViewMode = iota
	DiffView
	PlanView
)

Jump to

Keyboard shortcuts

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