sidebar

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

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 Bubbletea model for the sidebar pane

func New

func New() *Model

New creates a new sidebar model

func (*Model) Blur

func (m *Model) Blur()

Blur removes focus

func (*Model) Focus

func (m *Model) Focus()

Focus sets the focus state

func (*Model) Focused

func (m *Model) Focused() bool

Focused returns whether the sidebar is focused

func (*Model) Init

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

Init initializes the sidebar

func (*Model) SetGitStatus

func (m *Model) SetGitStatus(status *git.StatusResult)

SetGitStatus sets the git status

func (*Model) SetShowKeymapHints

func (m *Model) SetShowKeymapHints(show bool)

SetShowKeymapHints controls whether helper text is rendered.

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize sets the sidebar size

func (*Model) SetStyles

func (m *Model) SetStyles(styles common.Styles)

SetStyles updates the component's styles (for theme changes).

func (*Model) SetWorktree

func (m *Model) SetWorktree(wt *data.Worktree)

SetWorktree sets the active worktree

func (*Model) Update

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

Update handles messages

func (*Model) View

func (m *Model) View() string

View renders the sidebar

type SelectionState

type SelectionState struct {
	Active bool
	StartX int
	StartY int
	EndX   int
	EndY   int
}

SelectionState tracks mouse selection state

type SidebarTerminalCreated

type SidebarTerminalCreated struct {
	WorktreeID string
	Terminal   *pty.Terminal
}

SidebarTerminalCreated is a message for terminal creation

type TerminalModel

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

TerminalModel is the Bubbletea model for the sidebar terminal section

func NewTerminalModel

func NewTerminalModel() *TerminalModel

NewTerminalModel creates a new sidebar terminal model

func (*TerminalModel) AddTerminalForHarness

func (m *TerminalModel) AddTerminalForHarness(wt *data.Worktree)

AddTerminalForHarness creates a terminal state without a PTY for benchmarks/tests.

func (*TerminalModel) Blur

func (m *TerminalModel) Blur()

Blur removes focus

func (*TerminalModel) CloseAll

func (m *TerminalModel) CloseAll()

CloseAll closes all terminals

func (*TerminalModel) CloseTerminal

func (m *TerminalModel) CloseTerminal(wtID string)

CloseTerminal closes the terminal for the given worktree

func (*TerminalModel) CopyModeActive

func (m *TerminalModel) CopyModeActive() bool

CopyModeActive returns whether the current terminal is in copy mode

func (*TerminalModel) EnterCopyMode

func (m *TerminalModel) EnterCopyMode()

EnterCopyMode enters copy/scroll mode for the current terminal

func (*TerminalModel) ExitCopyMode

func (m *TerminalModel) ExitCopyMode()

ExitCopyMode exits copy/scroll mode for the current terminal

func (*TerminalModel) Focus

func (m *TerminalModel) Focus()

Focus sets focus state

func (*TerminalModel) Focused

func (m *TerminalModel) Focused() bool

Focused returns whether the terminal is focused

func (*TerminalModel) HandleTerminalCreated

func (m *TerminalModel) HandleTerminalCreated(wtID string, term *pty.Terminal) tea.Cmd

HandleTerminalCreated handles the terminal creation message

func (*TerminalModel) HelpLines

func (m *TerminalModel) HelpLines(width int) []string

HelpLines returns the help lines for the given width, respecting visibility.

func (*TerminalModel) Init

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

Init initializes the terminal model

func (*TerminalModel) SendToTerminal

func (m *TerminalModel) SendToTerminal(s string)

SendToTerminal sends a string directly to the current terminal

func (*TerminalModel) SetOffset

func (m *TerminalModel) SetOffset(x, y int)

SetOffset sets the absolute screen coordinates where the terminal starts

func (*TerminalModel) SetShowKeymapHints

func (m *TerminalModel) SetShowKeymapHints(show bool)

SetShowKeymapHints controls whether helper text is rendered.

func (*TerminalModel) SetSize

func (m *TerminalModel) SetSize(width, height int)

SetSize sets the terminal section size

func (*TerminalModel) SetStyles

func (m *TerminalModel) SetStyles(styles common.Styles)

SetStyles updates the component's styles (for theme changes).

func (*TerminalModel) SetWorktree

func (m *TerminalModel) SetWorktree(wt *data.Worktree) tea.Cmd

SetWorktree sets the active worktree and creates terminal if needed

func (*TerminalModel) StatusLine

func (m *TerminalModel) StatusLine() string

StatusLine returns the status line for the active terminal.

func (*TerminalModel) TerminalLayer

func (m *TerminalModel) TerminalLayer() *compositor.VTermLayer

TerminalLayer returns a VTermLayer for the active worktree terminal.

func (*TerminalModel) TerminalOrigin

func (m *TerminalModel) TerminalOrigin() (int, int)

TerminalOrigin returns the absolute origin for terminal rendering.

func (*TerminalModel) TerminalSize

func (m *TerminalModel) TerminalSize() (int, int)

TerminalSize returns the terminal render size.

func (*TerminalModel) Update

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

Update handles messages

func (*TerminalModel) View

func (m *TerminalModel) View() string

View renders the terminal section

func (*TerminalModel) WriteToTerminal

func (m *TerminalModel) WriteToTerminal(data []byte)

WriteToTerminal writes bytes to the active terminal while holding the lock.

type TerminalState

type TerminalState struct {
	Terminal  *pty.Terminal
	VTerm     *vterm.VTerm
	Running   bool
	CopyMode  bool // Whether in copy/scroll mode (keys not sent to PTY)
	CopyState common.CopyState

	// Selection state
	Selection SelectionState
	// contains filtered or unexported fields
}

TerminalState holds the terminal state for a worktree

Jump to

Keyboard shortcuts

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