Documentation
¶
Overview ¶
Package screen provides a unified screen management system for modal overlays.
Index ¶
- Variables
- func CompressCommitFileTree(node *CommitFileTreeNode)
- func DefaultSpinnerFrames() []string
- func SetIconProvider(provider iconProvider)
- func SetIconProviderFunc(fn DeviconFunc)
- func SortCommitFileTree(node *CommitFileTreeNode)
- type ChecklistItem
- type ChecklistScreen
- type CommandPaletteScreen
- type CommitFileTreeNode
- type CommitFilesScreen
- func (s *CommitFilesScreen) ApplyFilter()
- func (s *CommitFilesScreen) GetSelectedNode() *CommitFileTreeNode
- func (s *CommitFilesScreen) RebuildFlat()
- func (s *CommitFilesScreen) SearchNext(forward bool)
- func (s *CommitFilesScreen) SetTheme(thm *theme.Theme)
- func (s *CommitFilesScreen) ToggleCollapse(path string)
- func (s *CommitFilesScreen) Type() Type
- func (s *CommitFilesScreen) Update(msg tea.KeyMsg) (Screen, tea.Cmd)
- func (s *CommitFilesScreen) View() string
- type CommitMeta
- type CommitScreen
- type ConfirmScreen
- type DeviconFunc
- type HelpScreen
- type InfoScreen
- type InputScreen
- func (s *InputScreen) SetCheckbox(label string, defaultChecked bool)
- func (s *InputScreen) SetHistory(history []string)
- func (s *InputScreen) SetValidation(fn func(string) string)
- func (s *InputScreen) Type() Type
- func (s *InputScreen) Update(msg tea.KeyMsg) (Screen, tea.Cmd)
- func (s *InputScreen) View() string
- type IssueSelectionScreen
- type ListSelectionScreen
- type LoadingScreen
- func (s *LoadingScreen) LoadingBorderColours() []lipgloss.Color
- func (s *LoadingScreen) SetSpinnerFrames(frames []string)
- func (s *LoadingScreen) SetTheme(thm *theme.Theme)
- func (s *LoadingScreen) Tick()
- func (s *LoadingScreen) Type() Type
- func (s *LoadingScreen) Update(msg tea.KeyMsg) (Screen, tea.Cmd)
- func (s *LoadingScreen) View() string
- type Manager
- type NoteViewScreen
- type PRSelectionScreen
- type PaletteItem
- type Screen
- type SelectionItem
- type TaskboardItem
- type TaskboardScreen
- type TextareaScreen
- type TrustScreen
- type Type
- type UIIcon
- type WelcomeScreen
Constants ¶
This section is empty.
Variables ¶
var LoadingTips = []string{
"Press '?' to view the help guide anytime.",
"Use '/' to search in almost any list view.",
"Press 'c' to create a worktree from a branch, PR, or issue.",
"Use 'D' to delete a worktree (and optionally its branch).",
"Press 'g' to open LazyGit in the current worktree.",
"Switch between panes using '1', '2', or '3'.",
"Zoom into a pane with '='.",
"Press ':' or 'Ctrl+P' to open the Command Palette.",
"Use 'r' to refresh the worktree list manually.",
"Press 's' to cycle sorting modes.",
"Use 'o' to open the related PR/MR in your browser.",
"Press 'R' to fetch all remotes.",
"Use 'S' to synchronise with upstream (pull then push).",
"Press 'P' to push to the upstream branch.",
"Use 'p' to fetch PR/MR status from GitHub or GitLab.",
"Press 'f' to filter the focused pane.",
"Use Tab to cycle to the next pane.",
"Press 'A' to absorb a worktree into main (merge + delete).",
"Use 'X' to prune merged worktrees automatically.",
"Press '!' to run an arbitrary command in the selected worktree.",
"Use 'm' to rename a worktree.",
"In the Status pane, press 'e' to open a file in your editor.",
"In the Status pane, press 's' to stage or unstage files.",
"In the Log pane, press 'C' to cherry-pick a commit to another worktree.",
"Press Enter on a worktree to jump there and cd into it.",
"Generate shell completions with: lazyworktree --completion <shell>.",
}
LoadingTips is a list of helpful tips shown during loading.
Functions ¶
func CompressCommitFileTree ¶
func CompressCommitFileTree(node *CommitFileTreeNode)
CompressCommitFileTree compresses single-child directory chains.
func DefaultSpinnerFrames ¶
func DefaultSpinnerFrames() []string
DefaultSpinnerFrames returns the text-only spinner frames.
func SetIconProvider ¶
func SetIconProvider(provider iconProvider)
SetIconProvider sets the global icon provider.
func SetIconProviderFunc ¶
func SetIconProviderFunc(fn DeviconFunc)
SetIconProviderFunc sets the function used to get file icons.
func SortCommitFileTree ¶
func SortCommitFileTree(node *CommitFileTreeNode)
SortCommitFileTree sorts nodes: directories first, then files, alphabetically.
Types ¶
type ChecklistItem ¶
ChecklistItem represents a single item with a checkbox state.
type ChecklistScreen ¶
type ChecklistScreen struct {
// Data fields
Items []ChecklistItem
Filtered []ChecklistItem
// UI state
FilterInput textinput.Model
FilterActive bool
Cursor int
ScrollOffset int
Width int
Height int
Title string
Placeholder string
NoResults string
Thm *theme.Theme
// Callbacks
OnSubmit func([]ChecklistItem) tea.Cmd
OnCancel func() tea.Cmd
}
ChecklistScreen lets the user select multiple items from a list via checkboxes.
func NewChecklistScreen ¶
func NewChecklistScreen(items []ChecklistItem, title, placeholder, noResults string, maxWidth, maxHeight int, thm *theme.Theme) *ChecklistScreen
NewChecklistScreen builds a checklist screen with 80% of screen size.
func (*ChecklistScreen) SelectedItems ¶
func (s *ChecklistScreen) SelectedItems() []ChecklistItem
SelectedItems returns all checked items.
func (*ChecklistScreen) Update ¶
Update handles keyboard input for the checklist screen. Returns nil to signal the screen should close.
func (*ChecklistScreen) View ¶
func (s *ChecklistScreen) View() string
View renders the checklist screen.
type CommandPaletteScreen ¶
type CommandPaletteScreen struct {
Items []PaletteItem
Filtered []PaletteItem
FilterInput textinput.Model
FilterActive bool
Cursor int
ScrollOffset int
Width int
Height int
Thm *theme.Theme
// Callbacks
OnSelect func(actionID string) tea.Cmd
OnCancel func() tea.Cmd
}
CommandPaletteScreen is the command picker modal.
func NewCommandPaletteScreen ¶
func NewCommandPaletteScreen(items []PaletteItem, maxWidth, maxHeight int, thm *theme.Theme) *CommandPaletteScreen
NewCommandPaletteScreen builds a command palette screen.
func (*CommandPaletteScreen) Type ¶
func (s *CommandPaletteScreen) Type() Type
Type returns the screen type identifier.
func (*CommandPaletteScreen) View ¶
func (s *CommandPaletteScreen) View() string
View renders the command palette.
type CommitFileTreeNode ¶
type CommitFileTreeNode struct {
Path string
File *models.CommitFile // nil for directories
Children []*CommitFileTreeNode
Compression int // Number of compressed path segments
Depth int // Cached depth for rendering
}
CommitFileTreeNode represents a node in the commit file tree.
func BuildCommitFileTree ¶
func BuildCommitFileTree(files []models.CommitFile) *CommitFileTreeNode
BuildCommitFileTree constructs a tree from a flat list of commit files.
func (*CommitFileTreeNode) IsDir ¶
func (n *CommitFileTreeNode) IsDir() bool
IsDir returns true if this node is a directory.
type CommitFilesScreen ¶
type CommitFilesScreen struct {
CommitSHA string
WorktreePath string
Files []models.CommitFile
AllFiles []models.CommitFile // Original unfiltered files
Tree *CommitFileTreeNode
TreeFlat []*CommitFileTreeNode
CollapsedDirs map[string]bool
Cursor int
ScrollOffset int
Width int
Height int
Thm *theme.Theme
ShowIcons bool
// Commit metadata
Meta CommitMeta
// Filter/search support
FilterInput textinput.Model
ShowingFilter bool
FilterQuery string
ShowingSearch bool
SearchQuery string
// Callbacks
OnShowFileDiff func(filename string) tea.Cmd
OnShowCommitDiff func() tea.Cmd
OnClose func() tea.Cmd
}
CommitFilesScreen displays files changed in a commit as a collapsible tree. Note: Uses CommitMeta from commit.go for metadata display.
func NewCommitFilesScreen ¶
func NewCommitFilesScreen(sha, wtPath string, files []models.CommitFile, meta CommitMeta, maxWidth, maxHeight int, thm *theme.Theme, showIcons bool) *CommitFilesScreen
NewCommitFilesScreen creates a commit files tree screen.
func (*CommitFilesScreen) ApplyFilter ¶
func (s *CommitFilesScreen) ApplyFilter()
ApplyFilter filters the files list and rebuilds the tree.
func (*CommitFilesScreen) GetSelectedNode ¶
func (s *CommitFilesScreen) GetSelectedNode() *CommitFileTreeNode
GetSelectedNode returns the currently selected node.
func (*CommitFilesScreen) RebuildFlat ¶
func (s *CommitFilesScreen) RebuildFlat()
RebuildFlat rebuilds the flat list from the tree respecting collapsed state.
func (*CommitFilesScreen) SearchNext ¶
func (s *CommitFilesScreen) SearchNext(forward bool)
SearchNext finds the next match for the search query.
func (*CommitFilesScreen) SetTheme ¶
func (s *CommitFilesScreen) SetTheme(thm *theme.Theme)
SetTheme updates the screen's theme.
func (*CommitFilesScreen) ToggleCollapse ¶
func (s *CommitFilesScreen) ToggleCollapse(path string)
ToggleCollapse toggles the collapse state of a directory.
func (*CommitFilesScreen) Type ¶
func (s *CommitFilesScreen) Type() Type
Type returns TypeCommitFiles to identify this screen.
func (*CommitFilesScreen) View ¶
func (s *CommitFilesScreen) View() string
View renders the commit files screen.
type CommitMeta ¶
type CommitMeta struct {
SHA string
Author string
Email string
Date string
Subject string
Body []string
}
CommitMeta holds metadata for a commit.
type CommitScreen ¶
type CommitScreen struct {
Meta CommitMeta
Stat string
Diff string
UseDelta bool
Viewport viewport.Model
Thm *theme.Theme
}
CommitScreen displays metadata, stats, and diff details for a single commit.
func NewCommitScreen ¶
func NewCommitScreen(meta CommitMeta, stat, diff string, useDelta bool, thm *theme.Theme) *CommitScreen
NewCommitScreen configures the commit detail viewer for the selected SHA.
func (*CommitScreen) SetTheme ¶
func (s *CommitScreen) SetTheme(thm *theme.Theme)
SetTheme updates the theme for this screen.
type ConfirmScreen ¶
type ConfirmScreen struct {
Message string
SelectedButton int // 0 = Confirm, 1 = Cancel
Thm *theme.Theme
// Callbacks
OnConfirm func() tea.Cmd
OnCancel func() tea.Cmd
}
ConfirmScreen displays a modal confirmation prompt with Accept/Cancel buttons.
func NewConfirmScreen ¶
func NewConfirmScreen(message string, thm *theme.Theme) *ConfirmScreen
NewConfirmScreen creates a confirm screen preloaded with a message.
func NewConfirmScreenWithDefault ¶
func NewConfirmScreenWithDefault(message string, defaultButton int, thm *theme.Theme) *ConfirmScreen
NewConfirmScreenWithDefault creates a confirmation modal with a specified default button.
func (*ConfirmScreen) SetTheme ¶
func (s *ConfirmScreen) SetTheme(thm *theme.Theme)
SetTheme updates the theme for this screen.
func (*ConfirmScreen) Update ¶
Update processes keyboard events for the confirmation dialog. Returns nil to signal that the screen should be closed.
func (*ConfirmScreen) View ¶
func (s *ConfirmScreen) View() string
View renders the confirmation UI box with focused button highlighting.
type DeviconFunc ¶
DeviconFunc is a function type for getting file icons.
var IconProviderFunc DeviconFunc
IconProviderFunc allows injecting the devicon lookup function.
type HelpScreen ¶
type HelpScreen struct {
Viewport viewport.Model
Width int
Height int
FullText []string
SearchInput textinput.Model
Searching bool
SearchQuery string
Thm *theme.Theme
ShowIcons bool
}
HelpScreen renders searchable documentation for the app controls.
func NewHelpScreen ¶
func NewHelpScreen(maxWidth, maxHeight int, customCommands map[string]*config.CustomCommand, thm *theme.Theme, showIcons bool) *HelpScreen
NewHelpScreen initializes help content with the available screen size.
func (*HelpScreen) SetSize ¶
func (s *HelpScreen) SetSize(maxWidth, maxHeight int)
SetSize updates the help screen dimensions (useful on terminal resize).
func (*HelpScreen) Type ¶
func (s *HelpScreen) Type() Type
Type returns TypeHelp to identify this screen.
func (*HelpScreen) View ¶
func (s *HelpScreen) View() string
View renders the help content and search input inside the viewport.
type InfoScreen ¶
InfoScreen displays a modal message with an OK button.
func NewInfoScreen ¶
func NewInfoScreen(message string, thm *theme.Theme) *InfoScreen
NewInfoScreen creates an informational modal with an OK button.
func (*InfoScreen) SetTheme ¶
func (s *InfoScreen) SetTheme(thm *theme.Theme)
SetTheme updates the theme for this screen.
func (*InfoScreen) Update ¶
Update processes keyboard events for the info dialog. Returns nil to signal that the screen should be closed.
func (*InfoScreen) View ¶
func (s *InfoScreen) View() string
View renders the informational UI box with a single OK button.
type InputScreen ¶
type InputScreen struct {
// Core fields
Prompt string
Placeholder string
Value string
Input textinput.Model
ErrorMsg string
Thm *theme.Theme
ShowIcons bool
// Validation
Validate func(string) string
// Callbacks
OnSubmit func(value string, checked bool) tea.Cmd
OnCancel func() tea.Cmd
OnCheckboxToggle func(checked bool) tea.Cmd
// Checkbox support
CheckboxEnabled bool
CheckboxChecked bool
CheckboxFocused bool
CheckboxLabel string
// History navigation (bash-style up/down)
History []string
HistoryIndex int // -1 = not browsing
OriginalInput string // Store original input when browsing history
// contains filtered or unexported fields
}
InputScreen displays a modal input prompt with optional validation, history navigation, and checkbox support.
func NewInputScreen ¶
func NewInputScreen(prompt, placeholder, value string, thm *theme.Theme, showIcons bool) *InputScreen
NewInputScreen creates an input screen with the given parameters.
func (*InputScreen) SetCheckbox ¶
func (s *InputScreen) SetCheckbox(label string, defaultChecked bool)
SetCheckbox enables a checkbox with the given label and default state.
func (*InputScreen) SetHistory ¶
func (s *InputScreen) SetHistory(history []string)
SetHistory enables bash-style history navigation with up/down arrows.
func (*InputScreen) SetValidation ¶
func (s *InputScreen) SetValidation(fn func(string) string)
SetValidation sets a validation function that returns an error message.
type IssueSelectionScreen ¶
type IssueSelectionScreen struct {
Issues []*models.IssueInfo
Filtered []*models.IssueInfo
FilterInput textinput.Model
FilterActive bool
Cursor int
ScrollOffset int
Width int
Height int
Thm *theme.Theme
ShowIcons bool
OnSelect func(*models.IssueInfo) tea.Cmd
OnCancel func() tea.Cmd
}
IssueSelectionScreen lets the user pick an issue from a filtered list.
func NewIssueSelectionScreen ¶
func NewIssueSelectionScreen(issues []*models.IssueInfo, maxWidth, maxHeight int, thm *theme.Theme, showIcons bool) *IssueSelectionScreen
NewIssueSelectionScreen builds an issue selection screen with 80% of screen size.
func (*IssueSelectionScreen) Selected ¶
func (s *IssueSelectionScreen) Selected() (*models.IssueInfo, bool)
Selected returns the currently selected issue, if any.
func (*IssueSelectionScreen) Type ¶
func (s *IssueSelectionScreen) Type() Type
Type returns the screen type.
func (*IssueSelectionScreen) Update ¶
Update handles keyboard input and returns nil to signal the screen should close.
func (*IssueSelectionScreen) View ¶
func (s *IssueSelectionScreen) View() string
View renders the issue selection screen.
type ListSelectionScreen ¶
type ListSelectionScreen struct {
// Data fields
Items []SelectionItem
Filtered []SelectionItem
// UI state
FilterInput textinput.Model
FilterActive bool
Cursor int
ScrollOffset int
Width int
Height int
Title string
Placeholder string
NoResults string
Thm *theme.Theme
// Callbacks
OnSelect func(SelectionItem) tea.Cmd
OnCancel func() tea.Cmd
OnCursorChange func(SelectionItem) // For live preview
// Special key handlers (for CI checks)
OnCtrlV func(SelectionItem) tea.Cmd // Ctrl+V handler (e.g., view logs)
OnCtrlR func(SelectionItem) tea.Cmd // Ctrl+R handler (e.g., restart)
OnEnter func(SelectionItem) tea.Cmd // Enter handler (overrides OnSelect if set)
FooterHint string
}
ListSelectionScreen lets the user pick from a list of options.
func NewListSelectionScreen ¶
func NewListSelectionScreen(items []SelectionItem, title, placeholder, noResults string, maxWidth, maxHeight int, initialID string, thm *theme.Theme) *ListSelectionScreen
NewListSelectionScreen builds a list selection screen with 80% of screen size.
func (*ListSelectionScreen) Selected ¶
func (s *ListSelectionScreen) Selected() (SelectionItem, bool)
Selected returns the currently selected item, if any.
func (*ListSelectionScreen) Type ¶
func (s *ListSelectionScreen) Type() Type
Type returns the screen type.
func (*ListSelectionScreen) Update ¶
Update handles keyboard input and returns nil to signal the screen should close.
func (*ListSelectionScreen) View ¶
func (s *ListSelectionScreen) View() string
View renders the list selection screen.
type LoadingScreen ¶
type LoadingScreen struct {
Message string
FrameIdx int
BorderColorIdx int
Tip string
Thm *theme.Theme
SpinnerFrames []string
ShowIcons bool
}
LoadingScreen displays a modal with a spinner and a random tip.
func NewLoadingScreen ¶
func NewLoadingScreen(message string, thm *theme.Theme, spinnerFrames []string) *LoadingScreen
NewLoadingScreen creates a loading modal with the given message. spinnerFrames should be provided by the caller; if nil, text fallback is used.
func (*LoadingScreen) LoadingBorderColours ¶
func (s *LoadingScreen) LoadingBorderColours() []lipgloss.Color
LoadingBorderColours exposes the border colours for tests.
func (*LoadingScreen) SetSpinnerFrames ¶
func (s *LoadingScreen) SetSpinnerFrames(frames []string)
SetSpinnerFrames updates the spinner frames.
func (*LoadingScreen) SetTheme ¶
func (s *LoadingScreen) SetTheme(thm *theme.Theme)
SetTheme updates the theme for this screen.
func (*LoadingScreen) Tick ¶
func (s *LoadingScreen) Tick()
Tick advances the loading animation (spinner frame and border colour).
func (*LoadingScreen) View ¶
func (s *LoadingScreen) View() string
View renders the loading modal with spinner, message, and a random tip.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles screen state and provides a stack-based interface for modal overlays.
func (*Manager) Pop ¶
Pop removes the current screen and restores the previous one. Returns the screen that was removed, or nil if no screen was active.
func (*Manager) Set ¶
Set replaces the current screen without affecting the stack. This is useful for replacing the current screen without pushing/popping.
func (*Manager) StackDepth ¶
StackDepth returns the number of screens in the stack (excluding current).
type NoteViewScreen ¶ added in v1.37.0
type NoteViewScreen struct {
Title string
Content string
Viewport viewport.Model
Width int
Height int
Thm *theme.Theme
OnEdit func() tea.Cmd
OnEditExternal func() tea.Cmd
OnClose func() tea.Cmd
}
NoteViewScreen displays rendered worktree notes in a pager-like modal.
func NewNoteViewScreen ¶ added in v1.37.0
func NewNoteViewScreen(title, content string, maxWidth, maxHeight int, thm *theme.Theme) *NoteViewScreen
NewNoteViewScreen creates a scrollable notes viewer modal.
func (*NoteViewScreen) Resize ¶ added in v1.37.0
func (s *NoteViewScreen) Resize(maxWidth, maxHeight int)
Resize updates modal and viewport dimensions based on terminal size.
func (*NoteViewScreen) SetTheme ¶ added in v1.37.0
func (s *NoteViewScreen) SetTheme(thm *theme.Theme)
SetTheme updates the screen theme.
func (*NoteViewScreen) Type ¶ added in v1.37.0
func (s *NoteViewScreen) Type() Type
Type returns the screen type.
func (*NoteViewScreen) Update ¶ added in v1.37.0
Update handles navigation, close, and edit actions.
func (*NoteViewScreen) View ¶ added in v1.37.0
func (s *NoteViewScreen) View() string
View renders the notes viewer modal.
type PRSelectionScreen ¶
type PRSelectionScreen struct {
// Data fields
PRs []*models.PRInfo
Filtered []*models.PRInfo
// UI state
FilterInput textinput.Model
FilterActive bool
Cursor int
ScrollOffset int
Width int
Height int
Thm *theme.Theme
ShowIcons bool
// AttachedBranches maps branch names to worktree names for branches already checked out
AttachedBranches map[string]string
// StatusMessage shows temporary feedback (e.g., when trying to select attached PR)
StatusMessage string
// Callbacks
OnSelect func(*models.PRInfo) tea.Cmd
OnCancel func() tea.Cmd
}
PRSelectionScreen lets the user pick a PR from a filtered list.
func NewPRSelectionScreen ¶
func NewPRSelectionScreen(prs []*models.PRInfo, maxWidth, maxHeight int, thm *theme.Theme, showIcons bool) *PRSelectionScreen
NewPRSelectionScreen builds a PR selection screen with 80% of screen size.
func (*PRSelectionScreen) Selected ¶
func (s *PRSelectionScreen) Selected() (*models.PRInfo, bool)
Selected returns the currently selected PR, if any.
func (*PRSelectionScreen) Type ¶
func (s *PRSelectionScreen) Type() Type
Type returns the screen type.
func (*PRSelectionScreen) Update ¶
Update handles updates for the PR selection screen. Returns nil to signal the screen should close.
func (*PRSelectionScreen) View ¶
func (s *PRSelectionScreen) View() string
View renders the PR selection screen.
type PaletteItem ¶
type PaletteItem struct {
ID string
Label string
Description string
IsSection bool // Non-selectable section headers
IsMRU bool // Recently used items
Shortcut string // Keyboard shortcut display (e.g., "g")
Icon string // Category icon (Nerd Font)
}
PaletteItem represents a command in the palette.
type Screen ¶
type Screen interface {
// Update processes a key message and returns the updated screen and any command.
// Returning nil for the Screen signals that this screen should be closed.
Update(msg tea.KeyMsg) (Screen, tea.Cmd)
// View renders the screen's content.
View() string
// Type returns the screen's type identifier.
Type() Type
}
Screen represents a modal screen overlay that can handle input and render itself.
type SelectionItem ¶
SelectionItem represents a single item in a list selection.
type TaskboardItem ¶ added in v1.37.0
type TaskboardItem struct {
ID string
WorktreePath string
WorktreeName string
Text string
Checked bool
IsSection bool
SectionLabel string
OpenCount int
DoneCount int
TotalCount int
}
TaskboardItem represents a task row or a section header in the taskboard.
type TaskboardScreen ¶ added in v1.37.0
type TaskboardScreen struct {
Items []TaskboardItem
Filtered []TaskboardItem
FilterInput textinput.Model
FilterActive bool
Cursor int
ScrollOffset int
Width int
Height int
Title string
NoResults string
Thm *theme.Theme
OnToggle func(itemID string) tea.Cmd
OnClose func() tea.Cmd
OnAdd func(worktreePath string) tea.Cmd
DefaultWorktreePath string
}
TaskboardScreen displays worktree tasks grouped by worktree.
func NewTaskboardScreen ¶ added in v1.37.0
func NewTaskboardScreen(items []TaskboardItem, title string, maxWidth, maxHeight int, thm *theme.Theme) *TaskboardScreen
NewTaskboardScreen creates a grouped taskboard modal.
func (*TaskboardScreen) Resize ¶ added in v1.37.0
func (s *TaskboardScreen) Resize(maxWidth, maxHeight int)
Resize updates modal dimensions from terminal size.
func (*TaskboardScreen) SetItems ¶ added in v1.37.0
func (s *TaskboardScreen) SetItems(items []TaskboardItem, preferredID string)
SetItems replaces taskboard items and keeps filter/query state.
func (*TaskboardScreen) Type ¶ added in v1.37.0
func (s *TaskboardScreen) Type() Type
Type returns the screen type.
func (*TaskboardScreen) View ¶ added in v1.37.0
func (s *TaskboardScreen) View() string
View renders the taskboard modal.
type TextareaScreen ¶ added in v1.35.0
type TextareaScreen struct {
Prompt string
Placeholder string
Input textarea.Model
ErrorMsg string
Thm *theme.Theme
ShowIcons bool
// Validation
Validate func(string) string
// Callbacks
OnSubmit func(value string) tea.Cmd
OnCancel func() tea.Cmd
// contains filtered or unexported fields
}
TextareaScreen displays a modal multiline input.
func NewTextareaScreen ¶ added in v1.35.0
func NewTextareaScreen(prompt, placeholder, value string, maxWidth, maxHeight int, thm *theme.Theme, showIcons bool) *TextareaScreen
NewTextareaScreen creates a multiline input modal sized relative to the terminal.
func (*TextareaScreen) SetValidation ¶ added in v1.35.0
func (s *TextareaScreen) SetValidation(fn func(string) string)
SetValidation sets a validation function that returns an error message.
func (*TextareaScreen) Type ¶ added in v1.35.0
func (s *TextareaScreen) Type() Type
Type returns the screen type.
func (*TextareaScreen) Update ¶ added in v1.35.0
Update handles keyboard input for the textarea screen. Returns nil to signal the screen should be closed.
func (*TextareaScreen) View ¶ added in v1.35.0
func (s *TextareaScreen) View() string
View renders the multiline input screen.
type TrustScreen ¶
type TrustScreen struct {
FilePath string
Commands []string
Viewport viewport.Model
Thm *theme.Theme
// Callbacks
OnTrust func() tea.Cmd // Called when user trusts the commands
OnBlock func() tea.Cmd // Called when user blocks/skips the commands
OnCancel func() tea.Cmd // Called when user cancels the operation
}
TrustScreen surfaces trust warnings and records commands for a path.
func NewTrustScreen ¶
func NewTrustScreen(filePath string, commands []string, thm *theme.Theme) *TrustScreen
NewTrustScreen warns the user when a repo config has changed or is untrusted.
func (*TrustScreen) SetTheme ¶
func (s *TrustScreen) SetTheme(thm *theme.Theme)
SetTheme updates the theme for this screen.
func (*TrustScreen) Update ¶
Update handles trust decisions and delegates viewport input updates. Returns nil to signal that the screen should be closed.
func (*TrustScreen) View ¶
func (s *TrustScreen) View() string
View renders the trust warning content inside a styled box.
type Type ¶
type Type int
Type identifies the kind of screen being displayed.
type UIIcon ¶
type UIIcon int
UIIcon identifies UI-specific icons.
const ( UIIconHelpTitle UIIcon = iota UIIconStatusPane UIIconLogPane UIIconCommitTree UIIconWorktreeActions UIIconBranchNaming UIIconViewingTools UIIconRepoOps UIIconBackgroundRefresh UIIconFilterSearch UIIconStatusIndicators UIIconStatusClean UIIconStatusDirty UIIconShellCompletion UIIconConfiguration UIIconIconConfiguration UIIconTip UIIconPRSelect UIIconIssueSelect UIIconCICheck UIIconListSelect )
UIIcon constants.
type WelcomeScreen ¶
type WelcomeScreen struct {
CurrentDir string
WorktreeDir string
Thm *theme.Theme
// Callbacks
OnRefresh func() tea.Cmd // Called when user presses 'r' to refresh
OnQuit func() tea.Cmd // Called when user wants to quit
}
WelcomeScreen shows the initial instructions when no worktrees are open.
func NewWelcomeScreen ¶
func NewWelcomeScreen(currentDir, worktreeDir string, thm *theme.Theme) *WelcomeScreen
NewWelcomeScreen builds the greeting screen shown when no worktrees exist.
func (*WelcomeScreen) SetTheme ¶
func (s *WelcomeScreen) SetTheme(thm *theme.Theme)
SetTheme updates the theme for this screen.
func (*WelcomeScreen) Update ¶
Update processes keyboard events for the welcome screen. Returns nil to signal that the screen should be closed.
func (*WelcomeScreen) View ¶
func (s *WelcomeScreen) View() string
View renders the welcome dialog with guidance and action buttons.