Documentation
¶
Index ¶
- Constants
- Variables
- func AdjustPreviewWidth(width int) int
- func GradientBar(width, filled int, startHex, endHex string) string
- func GradientText(text, startHex, endHex string) string
- type DiffPane
- type GitPane
- func (g *GitPane) IsRunning() bool
- func (g *GitPane) Kill()
- func (g *GitPane) NeedsRespawn(instanceTitle string) bool
- func (g *GitPane) Render() (string, bool)
- func (g *GitPane) SendKey(data []byte) error
- func (g *GitPane) SetSize(width, height int)
- func (g *GitPane) Spawn(worktreePath, instanceTitle string)
- func (g *GitPane) String() string
- type InstanceRenderer
- type List
- func (l *List) AddInstance(instance *session.Instance) (finalize func())
- func (l *List) Attach() (chan struct{}, error)
- func (l *List) Clear()
- func (l *List) CycleSortMode()
- func (l *List) Down()
- func (l *List) GetInstances() []*session.Instance
- func (l *List) GetItemAtRow(row int) int
- func (l *List) GetSelectedIdx() int
- func (l *List) GetSelectedInstance() *session.Instance
- func (l *List) GetSortMode() SortMode
- func (l *List) GetStatusFilter() StatusFilter
- func (l *List) HandleTabClick(localX, localY int) (StatusFilter, bool)
- func (l *List) Kill()
- func (l *List) KillInstancesByTopic(topicName string)
- func (l *List) NumInstances() int
- func (l *List) SetFilter(topicFilter string)
- func (l *List) SetFocused(focused bool)
- func (l *List) SetSearchFilter(query string)
- func (l *List) SetSearchFilterWithTopic(query string, topicFilter string)
- func (l *List) SetSelectedInstance(idx int)
- func (l *List) SetSessionPreviewSize(width, height int) (err error)
- func (l *List) SetSize(width, height int)
- func (l *List) SetStatusFilter(filter StatusFilter)
- func (l *List) String() string
- func (l *List) TotalInstances() int
- func (l *List) Up()
- type Menu
- type MenuState
- type PreviewPane
- func (p *PreviewPane) ResetToNormalMode(instance *session.Instance) error
- func (p *PreviewPane) ScrollDown(instance *session.Instance) error
- func (p *PreviewPane) ScrollUp(instance *session.Instance) error
- func (p *PreviewPane) SetRawContent(content string)
- func (p *PreviewPane) SetSize(width, maxHeight int)
- func (p *PreviewPane) String() string
- func (p *PreviewPane) UpdateContent(instance *session.Instance) error
- type Sidebar
- func (s *Sidebar) ActivateSearch()
- func (s *Sidebar) ClickItem(row int)
- func (s *Sidebar) DeactivateSearch()
- func (s *Sidebar) Down()
- func (s *Sidebar) GetSearchQuery() string
- func (s *Sidebar) GetSelectedID() string
- func (s *Sidebar) GetSelectedIdx() int
- func (s *Sidebar) IsFocused() bool
- func (s *Sidebar) IsSearchActive() bool
- func (s *Sidebar) SelectFirst()
- func (s *Sidebar) SetFocused(focused bool)
- func (s *Sidebar) SetItems(topicNames []string, instanceCountByTopic map[string]int, ungroupedCount int, ...)
- func (s *Sidebar) SetRepoHovered(hovered bool)
- func (s *Sidebar) SetRepoName(name string)
- func (s *Sidebar) SetSearchQuery(q string)
- func (s *Sidebar) SetSize(width, height int)
- func (s *Sidebar) String() string
- func (s *Sidebar) Up()
- func (s *Sidebar) UpdateMatchCounts(matchesByTopic map[string]int, totalMatches int)
- type SidebarItem
- type SortMode
- type StatusFilter
- type Tab
- type TabbedWindow
- func (w *TabbedWindow) ContentScrollDown()
- func (w *TabbedWindow) ContentScrollUp()
- func (w *TabbedWindow) GetActiveTab() int
- func (w *TabbedWindow) GetGitPane() *GitPane
- func (w *TabbedWindow) GetPreviewSize() (width, height int)
- func (w *TabbedWindow) HandleTabClick(localX, localY int) bool
- func (w *TabbedWindow) IsFocusMode() bool
- func (w *TabbedWindow) IsInDiffTab() bool
- func (w *TabbedWindow) IsInGitTab() bool
- func (w *TabbedWindow) IsPreviewInScrollMode() bool
- func (w *TabbedWindow) ResetPreviewToNormalMode(instance *session.Instance) error
- func (w *TabbedWindow) ScrollDown()
- func (w *TabbedWindow) ScrollUp()
- func (w *TabbedWindow) SetActiveTab(tab int)
- func (w *TabbedWindow) SetFocusMode(enabled bool)
- func (w *TabbedWindow) SetGitContent(content string)
- func (w *TabbedWindow) SetInstance(instance *session.Instance)
- func (w *TabbedWindow) SetPreviewContent(content string)
- func (w *TabbedWindow) SetSize(width, height int)
- func (w *TabbedWindow) String() string
- func (w *TabbedWindow) Toggle()
- func (w *TabbedWindow) ToggleWithReset(instance *session.Instance) error
- func (w *TabbedWindow) UpdateDiff(instance *session.Instance)
- func (w *TabbedWindow) UpdatePreview(instance *session.Instance) error
- type TopicStatus
Constants ¶
const ( SidebarAll = "__all__" SidebarUngrouped = "__ungrouped__" )
const ( PreviewTab int = iota DiffTab GitTab )
const ZoneRepoSwitch = "repo-switch"
ZoneRepoSwitch is the bubblezone ID for the clickable repo indicator.
Variables ¶
var ( AdditionStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#22c55e")) DeletionStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#ef4444")) HunkStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#0ea5e9")) )
var FallBackText = lipgloss.JoinVertical(lipgloss.Center, GradientText(fallbackBannerRaw, "#F0A868", "#7EC8D8"))
Functions ¶
func AdjustPreviewWidth ¶
AdjustPreviewWidth adjusts the width of the preview pane to be 90% of the provided width.
func GradientBar ¶
GradientBar renders a progress bar of `width` characters with `filled` filled blocks. Filled portion uses a gradient from startHex to endHex; unfilled uses dim blocks.
func GradientText ¶
GradientText renders a string with a left-to-right truecolor gradient from startHex to endHex. Newlines are preserved; ANSI reset appended.
Types ¶
type DiffPane ¶
type DiffPane struct {
// contains filtered or unexported fields
}
func NewDiffPane ¶
func NewDiffPane() *DiffPane
func (*DiffPane) ScrollDown ¶
func (d *DiffPane) ScrollDown()
type GitPane ¶
type GitPane struct {
// contains filtered or unexported fields
}
GitPane manages an interactive lazygit subprocess inside a tmux session, rendered via tmux capture-pane through an EmbeddedTerminal.
func (*GitPane) Kill ¶
func (g *GitPane) Kill()
Kill stops the lazygit subprocess and cleans up resources.
func (*GitPane) NeedsRespawn ¶
NeedsRespawn returns true if the current instance differs from what's running.
func (*GitPane) SendKey ¶
SendKey forwards raw key bytes to the lazygit PTY via the embedded terminal. If the write fails (e.g. lazygit exited), it cleans up the dead session.
type InstanceRenderer ¶
type InstanceRenderer struct {
// contains filtered or unexported fields
}
InstanceRenderer handles rendering of session.Instance objects
type List ¶
type List struct {
// contains filtered or unexported fields
}
func (*List) AddInstance ¶
AddInstance adds a new instance to the list. It returns a finalizer function that should be called when the instance is started. If the instance was restored from storage or is paused, you can call the finalizer immediately. When creating a new one and entering the name, you want to call the finalizer once the name is done.
func (*List) CycleSortMode ¶
func (l *List) CycleSortMode()
CycleSortMode advances to the next sort mode and rebuilds.
func (*List) GetInstances ¶
GetInstances returns all instances (unfiltered) for persistence and metadata updates.
func (*List) GetItemAtRow ¶
GetItemAtRow maps a row offset (relative to the first item) to an item index. Returns -1 if the row doesn't correspond to any item.
func (*List) GetSelectedIdx ¶
GetSelectedIdx returns the index of the currently selected item in the filtered list.
func (*List) GetSelectedInstance ¶
GetSelectedInstance returns the currently selected instance
func (*List) GetSortMode ¶
GetSortMode returns the current sort mode.
func (*List) GetStatusFilter ¶
func (l *List) GetStatusFilter() StatusFilter
GetStatusFilter returns the current status filter.
func (*List) HandleTabClick ¶
func (l *List) HandleTabClick(localX, localY int) (StatusFilter, bool)
HandleTabClick checks if a click at the given local coordinates (relative to the list's top-left corner) hits a filter tab. Returns the filter and true if a tab was clicked, or false if the click was outside the tab area.
func (*List) KillInstancesByTopic ¶
KillInstancesByTopic kills and removes all instances belonging to the given topic.
func (*List) NumInstances ¶
func (*List) SetFilter ¶
SetFilter filters the displayed instances by topic name. Empty string shows all. SidebarUngrouped shows only ungrouped instances.
func (*List) SetFocused ¶
func (*List) SetSearchFilter ¶
SetSearchFilter filters instances by search query across all topics. SetSearchFilter filters instances by search query across all topics.
func (*List) SetSearchFilterWithTopic ¶
SetSearchFilterWithTopic filters instances by search query, optionally scoped to a topic. topicFilter: "" = all topics, "__ungrouped__" = ungrouped only, otherwise = specific topic.
func (*List) SetSelectedInstance ¶
SetSelectedInstance sets the selected index. Noop if the index is out of bounds.
func (*List) SetSessionPreviewSize ¶
SetSessionPreviewSize sets the height and width for the tmux sessions. This makes the stdout line have the correct width and height.
func (*List) SetStatusFilter ¶
func (l *List) SetStatusFilter(filter StatusFilter)
SetStatusFilter sets the status filter and rebuilds the filtered items.
func (*List) TotalInstances ¶
TotalInstances returns the total number of instances regardless of filter.
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
func (*Menu) ClearKeydown ¶
func (m *Menu) ClearKeydown()
func (*Menu) SetInDiffTab ¶
SetInDiffTab updates whether we're currently in the diff tab
func (*Menu) SetInstance ¶
SetInstance updates the current instance and refreshes menu options
func (*Menu) SetSize ¶
SetSize sets the width of the window. The menu will be centered horizontally within this width.
type PreviewPane ¶
type PreviewPane struct {
// contains filtered or unexported fields
}
func NewPreviewPane ¶
func NewPreviewPane() *PreviewPane
func (*PreviewPane) ResetToNormalMode ¶
func (p *PreviewPane) ResetToNormalMode(instance *session.Instance) error
ResetToNormalMode exits scroll mode and returns to normal mode
func (*PreviewPane) ScrollDown ¶
func (p *PreviewPane) ScrollDown(instance *session.Instance) error
ScrollDown scrolls down in the viewport
func (*PreviewPane) ScrollUp ¶
func (p *PreviewPane) ScrollUp(instance *session.Instance) error
ScrollUp scrolls up in the viewport
func (*PreviewPane) SetRawContent ¶
func (p *PreviewPane) SetRawContent(content string)
SetRawContent sets the preview content directly from a pre-rendered string. Used by the embedded terminal emulator in focus mode.
func (*PreviewPane) SetSize ¶
func (p *PreviewPane) SetSize(width, maxHeight int)
func (*PreviewPane) String ¶
func (p *PreviewPane) String() string
Returns the preview pane content as a string.
func (*PreviewPane) UpdateContent ¶
func (p *PreviewPane) UpdateContent(instance *session.Instance) error
Updates the preview pane content with the tmux pane content
type Sidebar ¶
type Sidebar struct {
// contains filtered or unexported fields
}
Sidebar is the left-most panel showing topics and search.
func NewSidebar ¶
func NewSidebar() *Sidebar
func (*Sidebar) ActivateSearch ¶
func (s *Sidebar) ActivateSearch()
func (*Sidebar) ClickItem ¶
ClickItem selects a sidebar item by its rendered row offset (0-indexed from the first item). Section headers count as a row but are skipped for selection.
func (*Sidebar) DeactivateSearch ¶
func (s *Sidebar) DeactivateSearch()
func (*Sidebar) GetSearchQuery ¶
func (*Sidebar) GetSelectedID ¶
func (*Sidebar) GetSelectedIdx ¶
GetSelectedIdx returns the index of the currently selected item in the sidebar.
func (*Sidebar) IsSearchActive ¶
func (*Sidebar) SelectFirst ¶
func (s *Sidebar) SelectFirst()
SelectFirst selects the first non-section item (typically "All").
func (*Sidebar) SetFocused ¶
func (*Sidebar) SetItems ¶
func (s *Sidebar) SetItems(topicNames []string, instanceCountByTopic map[string]int, ungroupedCount int, sharedTopics map[string]bool, topicStatuses map[string]TopicStatus)
SetItems updates the sidebar items from the current topics. sharedTopics maps topic name → whether it has a shared worktree. topicStatuses maps topic name → running/notification status.
func (*Sidebar) SetRepoHovered ¶
SetRepoHovered sets whether the mouse is hovering over the repo button.
func (*Sidebar) SetRepoName ¶
SetRepoName sets the current repo name displayed at the bottom of the sidebar.
func (*Sidebar) SetSearchQuery ¶
type SidebarItem ¶
type SidebarItem struct {
Name string
ID string
IsSection bool
Count int
MatchCount int // search match count (-1 = not searching)
HasRunning bool // true if this topic has running instances
HasNotification bool // true if this topic has recently-finished instances
}
SidebarItem represents a selectable item in the sidebar.
type StatusFilter ¶
type StatusFilter int
StatusFilter determines which instances are shown based on their status.
const ( StatusFilterAll StatusFilter = iota // Show all instances StatusFilterActive // Show only non-paused instances )
type TabbedWindow ¶
type TabbedWindow struct {
// contains filtered or unexported fields
}
TabbedWindow has tabs at the top of a pane which can be selected. The tabs take up one rune of height.
func NewTabbedWindow ¶
func NewTabbedWindow(preview *PreviewPane, diff *DiffPane, git *GitPane) *TabbedWindow
func (*TabbedWindow) ContentScrollDown ¶
func (w *TabbedWindow) ContentScrollDown()
ContentScrollDown scrolls content without file navigation (for mouse wheel). No-op for git tab.
func (*TabbedWindow) ContentScrollUp ¶
func (w *TabbedWindow) ContentScrollUp()
ContentScrollUp scrolls content without file navigation (for mouse wheel). No-op for git tab.
func (*TabbedWindow) GetActiveTab ¶
func (w *TabbedWindow) GetActiveTab() int
GetActiveTab returns the currently active tab index.
func (*TabbedWindow) GetGitPane ¶
func (w *TabbedWindow) GetGitPane() *GitPane
GetGitPane returns the git pane for external control.
func (*TabbedWindow) GetPreviewSize ¶
func (w *TabbedWindow) GetPreviewSize() (width, height int)
func (*TabbedWindow) HandleTabClick ¶
func (w *TabbedWindow) HandleTabClick(localX, localY int) bool
HandleTabClick checks if a click at the given local coordinates (relative to the tabbed window's top-left) hits a tab header. Returns true and switches tabs if a tab was clicked.
func (*TabbedWindow) IsFocusMode ¶
func (w *TabbedWindow) IsFocusMode() bool
IsFocusMode returns whether the window is in focus/insert mode.
func (*TabbedWindow) IsInDiffTab ¶
func (w *TabbedWindow) IsInDiffTab() bool
IsInDiffTab returns true if the diff tab is currently active
func (*TabbedWindow) IsInGitTab ¶
func (w *TabbedWindow) IsInGitTab() bool
IsInGitTab returns true if the git tab is currently active
func (*TabbedWindow) IsPreviewInScrollMode ¶
func (w *TabbedWindow) IsPreviewInScrollMode() bool
IsPreviewInScrollMode returns true if the preview pane is in scroll mode
func (*TabbedWindow) ResetPreviewToNormalMode ¶
func (w *TabbedWindow) ResetPreviewToNormalMode(instance *session.Instance) error
ResetPreviewToNormalMode resets the preview pane to normal mode
func (*TabbedWindow) ScrollDown ¶
func (w *TabbedWindow) ScrollDown()
ScrollDown scrolls content. In preview tab, scrolls the preview. In diff tab, navigates to the next file if files exist, otherwise scrolls. No-op for git tab (lazygit handles its own scrolling).
func (*TabbedWindow) ScrollUp ¶
func (w *TabbedWindow) ScrollUp()
ScrollUp scrolls content. In preview tab, scrolls the preview. In diff tab, navigates to the previous file if files exist, otherwise scrolls. No-op for git tab (lazygit handles its own scrolling).
func (*TabbedWindow) SetActiveTab ¶
func (w *TabbedWindow) SetActiveTab(tab int)
SetActiveTab sets the active tab by index.
func (*TabbedWindow) SetFocusMode ¶
func (w *TabbedWindow) SetFocusMode(enabled bool)
SetFocusMode enables or disables the focus/insert mode visual indicator.
func (*TabbedWindow) SetGitContent ¶
func (w *TabbedWindow) SetGitContent(content string)
SetGitContent caches the git pane content to avoid re-rendering when unchanged.
func (*TabbedWindow) SetInstance ¶
func (w *TabbedWindow) SetInstance(instance *session.Instance)
func (*TabbedWindow) SetPreviewContent ¶
func (w *TabbedWindow) SetPreviewContent(content string)
SetPreviewContent sets the preview pane content directly from a pre-rendered string. Used by the embedded terminal in focus mode to bypass tmux capture-pane.
func (*TabbedWindow) SetSize ¶
func (w *TabbedWindow) SetSize(width, height int)
func (*TabbedWindow) String ¶
func (w *TabbedWindow) String() string
func (*TabbedWindow) Toggle ¶
func (w *TabbedWindow) Toggle()
func (*TabbedWindow) ToggleWithReset ¶
func (w *TabbedWindow) ToggleWithReset(instance *session.Instance) error
ToggleWithReset toggles the tab and resets preview pane to normal mode
func (*TabbedWindow) UpdateDiff ¶
func (w *TabbedWindow) UpdateDiff(instance *session.Instance)
func (*TabbedWindow) UpdatePreview ¶
func (w *TabbedWindow) UpdatePreview(instance *session.Instance) error
UpdatePreview updates the content of the preview pane. instance may be nil.
type TopicStatus ¶
TopicStatus holds status flags for a topic's instances.