worktrees

package
v0.0.331 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseMsg

type CloseMsg struct{}

CloseMsg asks the parent to close the embedded browser.

type CreateMsg

type CreateMsg struct{ Options worktree.CreateOptions }

CreateMsg asks the parent to create and bind a worktree.

type Model

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

Model is a full-screen embedded managed-worktree browser.

func New

func New(root string, store session.Store, boundDir string, width, height int, styles *ui.Styles) *Model

New constructs an embedded worktree browser.

func (*Model) Cursor

func (m *Model) Cursor() int

func (*Model) Error

func (m *Model) Error(err error)

Error displays an action error without closing the browser.

func (*Model) EscalateRemove

func (m *Model) EscalateRemove(risks []string)

EscalateRemove presents the required second, explicit force confirmation.

func (*Model) Height

func (m *Model) Height() int

func (*Model) Init

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

func (*Model) Items

func (m *Model) Items() []worktree.Worktree

Items returns a copy of the current rows.

func (*Model) Refresh

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

Refresh asynchronously reloads the managed worktrees.

func (*Model) ReportCreateResult

func (m *Model) ReportCreateResult(err error)

ReportCreateResult keeps a failed create visible in its form.

func (*Model) ReportRemoveResult

func (m *Model) ReportRemoveResult(err error) tea.Cmd

ReportRemoveResult reports a completed removal. On success it refreshes; a blocked normal removal should instead use EscalateRemove.

func (*Model) SetBusy

func (m *Model) SetBusy(busy bool, status string)

SetBusy updates the browser-owned operation indicator.

func (*Model) SetItems

func (m *Model) SetItems(items []worktree.Worktree)

SetItems replaces rows while preserving the selected directory when possible. It is also useful for deterministic parent and package tests.

func (*Model) Update

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

func (*Model) View

func (m *Model) View() tea.View

func (*Model) Width

func (m *Model) Width() int

type OpenMsg

type OpenMsg struct{ Worktree worktree.Worktree }

OpenMsg asks the parent to bind the current chat to Worktree.

type RefreshMsg

type RefreshMsg struct{}

RefreshMsg requests a fresh managed-worktree list.

type RemoveMsg

type RemoveMsg struct {
	Worktree worktree.Worktree
	Force    bool
}

RemoveMsg asks the parent to remove Worktree. Force is true only after the user accepts the browser's explicit second warning.

Jump to

Keyboard shortcuts

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