Documentation
¶
Overview ¶
Package tui provides the terminal user interface for Chief. It includes the main Bubble Tea application, dashboard views, log viewer, PRD picker, help overlay, and consistent styling.
Index ¶
- Constants
- Variables
- func GetActivityStyle(state AppState) lipgloss.Style
- func GetStateStyle(state AppState) lipgloss.Style
- func GetStatusIcon(passed, inProgress bool) string
- type App
- func (a *App) DisableRetry()
- func (a *App) GetCompletionPercentage() float64
- func (a *App) GetElapsedTime() time.Duration
- func (a *App) GetIteration() int
- func (a *App) GetLastActivity() string
- func (a *App) GetPRD() *prd.PRD
- func (a *App) GetSelectedStory() *prd.UserStory
- func (a *App) GetState() AppState
- func (a App) Init() tea.Cmd
- func (a *App) SetCompletionCallback(fn func(prdName string))
- func (a *App) SetVerbose(v bool)
- func (a App) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (a App) View() string
- type AppState
- type AutoActionState
- type BranchWarning
- func (b *BranchWarning) AddInputChar(ch rune)
- func (b *BranchWarning) CancelEditMode()
- func (b *BranchWarning) DeleteInputChar()
- func (b *BranchWarning) GetDialogContext() DialogContext
- func (b *BranchWarning) GetSelectedOption() BranchWarningOption
- func (b *BranchWarning) GetSuggestedBranch() string
- func (b *BranchWarning) IsEditMode() bool
- func (b *BranchWarning) MoveDown()
- func (b *BranchWarning) MoveUp()
- func (b *BranchWarning) Render() string
- func (b *BranchWarning) Reset()
- func (b *BranchWarning) SetContext(currentBranch, prdName, worktreePath string)
- func (b *BranchWarning) SetDialogContext(ctx DialogContext)
- func (b *BranchWarning) SetSize(width, height int)
- func (b *BranchWarning) StartEditMode()
- type BranchWarningOption
- type CleanConfirmation
- type CleanOption
- type CleanResult
- type CompletionScreen
- func (c *CompletionScreen) Branch() string
- func (c *CompletionScreen) Configure(prdName string, completed, total int, branch string, commitCount int, ...)
- func (c *CompletionScreen) HasBranch() bool
- func (c *CompletionScreen) HasConfetti() bool
- func (c *CompletionScreen) IsAutoActionRunning() bool
- func (c *CompletionScreen) PRDName() string
- func (c *CompletionScreen) Render() string
- func (c *CompletionScreen) SetPRError(errMsg string)
- func (c *CompletionScreen) SetPRInProgress()
- func (c *CompletionScreen) SetPRSuccess(url, title string)
- func (c *CompletionScreen) SetPushError(errMsg string)
- func (c *CompletionScreen) SetPushInProgress()
- func (c *CompletionScreen) SetPushSuccess()
- func (c *CompletionScreen) SetSize(width, height int)
- func (c *CompletionScreen) Tick()
- func (c *CompletionScreen) TickConfetti()
- type Confetti
- type DialogContext
- type DiffViewer
- func (d *DiffViewer) Load()
- func (d *DiffViewer) LoadForStory(storyID, title string)
- func (d *DiffViewer) PageDown()
- func (d *DiffViewer) PageUp()
- func (d *DiffViewer) Render() string
- func (d *DiffViewer) ScrollDown()
- func (d *DiffViewer) ScrollToBottom()
- func (d *DiffViewer) ScrollToTop()
- func (d *DiffViewer) ScrollUp()
- func (d *DiffViewer) SetBaseDir(dir string)
- func (d *DiffViewer) SetSize(width, height int)
- type FirstTimeSetup
- type FirstTimeSetupResult
- type FirstTimeSetupStep
- type HelpOverlay
- type LaunchEditMsg
- type LaunchInitMsg
- type LogEntry
- type LogViewer
- func (l *LogViewer) AddEvent(event loop.Event)
- func (l *LogViewer) Clear()
- func (l *LogViewer) IsAutoScrolling() bool
- func (l *LogViewer) PageDown()
- func (l *LogViewer) PageUp()
- func (l *LogViewer) Render() string
- func (l *LogViewer) ScrollDown()
- func (l *LogViewer) ScrollToBottom()
- func (l *LogViewer) ScrollToTop()
- func (l *LogViewer) ScrollUp()
- func (l *LogViewer) SetSize(width, height int)
- type LoopEventMsg
- type LoopFinishedMsg
- type MergeResult
- type PRDCompletedMsg
- type PRDEntry
- type PRDPicker
- func (p *PRDPicker) AddInputChar(ch rune)
- func (p *PRDPicker) CanClean() bool
- func (p *PRDPicker) CanMerge() bool
- func (p *PRDPicker) CancelCleanConfirmation()
- func (p *PRDPicker) CancelInputMode()
- func (p *PRDPicker) CleanConfirmMoveDown()
- func (p *PRDPicker) CleanConfirmMoveUp()
- func (p *PRDPicker) ClearCleanResult()
- func (p *PRDPicker) ClearMergeResult()
- func (p *PRDPicker) DeleteInputChar()
- func (p *PRDPicker) GetCleanConfirmation() *CleanConfirmation
- func (p *PRDPicker) GetCleanOption() CleanOption
- func (p *PRDPicker) GetInputValue() string
- func (p *PRDPicker) GetSelectedEntry() *PRDEntry
- func (p *PRDPicker) HasCleanConfirmation() bool
- func (p *PRDPicker) HasCleanResult() bool
- func (p *PRDPicker) HasMergeResult() bool
- func (p *PRDPicker) IsEmpty() bool
- func (p *PRDPicker) IsInputMode() bool
- func (p *PRDPicker) MoveDown()
- func (p *PRDPicker) MoveUp()
- func (p *PRDPicker) Refresh()
- func (p *PRDPicker) Render() string
- func (p *PRDPicker) SetCleanResult(result *CleanResult)
- func (p *PRDPicker) SetCurrentPRD(name string)
- func (p *PRDPicker) SetManager(manager *loop.Manager)
- func (p *PRDPicker) SetMergeResult(result *MergeResult)
- func (p *PRDPicker) SetSize(width, height int)
- func (p *PRDPicker) StartCleanConfirmation()
- func (p *PRDPicker) StartInputMode()
- type PRDUpdateMsg
- type Particle
- type PostExitAction
- type ProgressUpdateMsg
- type QuitConfirmOption
- type QuitConfirmation
- type SettingsItem
- type SettingsItemType
- type SettingsOverlay
- func (s *SettingsOverlay) AddEditChar(ch rune)
- func (s *SettingsOverlay) ApplyToConfig(cfg *config.Config)
- func (s *SettingsOverlay) CancelEdit()
- func (s *SettingsOverlay) ConfirmEdit()
- func (s *SettingsOverlay) DeleteEditChar()
- func (s *SettingsOverlay) DismissGHError()
- func (s *SettingsOverlay) GetSelectedItem() *SettingsItem
- func (s *SettingsOverlay) HasGHError() bool
- func (s *SettingsOverlay) IsEditing() bool
- func (s *SettingsOverlay) LoadFromConfig(cfg *config.Config)
- func (s *SettingsOverlay) MoveDown()
- func (s *SettingsOverlay) MoveUp()
- func (s *SettingsOverlay) Render() string
- func (s *SettingsOverlay) RevertToggle()
- func (s *SettingsOverlay) SetGHError(msg string)
- func (s *SettingsOverlay) SetSize(width, height int)
- func (s *SettingsOverlay) StartEditing()
- func (s *SettingsOverlay) ToggleBool() (key string, newVal bool)
- type Shortcut
- type ShortcutCategory
- type StoryTiming
- type TabBar
- type TabEntry
- type ViewMode
- type WorktreeSpinner
- func (w *WorktreeSpinner) AdvanceStep()
- func (w *WorktreeSpinner) Cancel()
- func (w *WorktreeSpinner) Configure(prdName, branchName, defaultBranch, worktreePath, setupCommand string)
- func (w *WorktreeSpinner) GetCurrentStep() WorktreeSpinnerStep
- func (w *WorktreeSpinner) HasError() bool
- func (w *WorktreeSpinner) HasSetupCommand() bool
- func (w *WorktreeSpinner) IsCancelled() bool
- func (w *WorktreeSpinner) IsDone() bool
- func (w *WorktreeSpinner) Render() string
- func (w *WorktreeSpinner) SetError(err string)
- func (w *WorktreeSpinner) SetSize(width, height int)
- func (w *WorktreeSpinner) Tick()
- type WorktreeSpinnerStep
Constants ¶
const ( IconPassed = "✓" IconInProgress = "●" IconPending = "○" IconFailed = "✗" IconPaused = "◐" )
Status icons
Variables ¶
var ( // Primary colors PrimaryColor = lipgloss.Color("#00D7FF") // Cyan - primary brand, in-progress states SuccessColor = lipgloss.Color("#5AF78E") // Green - passed, complete states WarningColor = lipgloss.Color("#F3F99D") // Yellow - paused, warning states ErrorColor = lipgloss.Color("#FF5C57") // Red - failed, error states MutedColor = lipgloss.Color("#6C7086") // Gray - pending, muted text BorderColor = lipgloss.Color("#45475A") // Dark gray - borders, dividers // Text colors TextColor = lipgloss.Color("#CDD6F4") // Light gray - primary text TextMutedColor = lipgloss.Color("#6C7086") // Muted text TextBrightColor = lipgloss.Color("#FFFFFF") // Bright white - emphasis // Background colors BgColor = lipgloss.Color("#1E1E2E") // Dark background BgSelectedColor = lipgloss.Color("#313244") // Selected item background BgHighlightColor = lipgloss.Color("#45475A") // Highlight background )
Color palette - consistent colors used throughout the TUI
var ( // Shortcut key style ShortcutKeyStyle = lipgloss.NewStyle(). Foreground(PrimaryColor). Bold(true) // Shortcut description style ShortcutDescStyle = lipgloss.NewStyle(). Foreground(MutedColor) )
Footer styles
var ( // Panel with focus/active state PanelActiveStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(PrimaryColor). Padding(0, 1) // Panel title style PanelTitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(PrimaryColor) )
Panel styles
var ( // State badge styles (with bold for headers) StateReadyStyle = lipgloss.NewStyle().Bold(true).Foreground(MutedColor) StateRunningStyle = lipgloss.NewStyle().Bold(true).Foreground(PrimaryColor) StatePausedStyle = lipgloss.NewStyle().Bold(true).Foreground(WarningColor) StateStoppedStyle = lipgloss.NewStyle().Bold(true).Foreground(MutedColor) StateCompleteStyle = lipgloss.NewStyle().Bold(true).Foreground(SuccessColor) StateErrorStyle = lipgloss.NewStyle().Bold(true).Foreground(ErrorColor) )
Status badge styles - colored badges for state indicators
var ( // Subtitle style SubtitleStyle = lipgloss.NewStyle(). Foreground(MutedColor) // Description text style DescriptionStyle = lipgloss.NewStyle(). Foreground(TextColor) )
Title and label styles
var ( ActivityRunningStyle = lipgloss.NewStyle().Foreground(PrimaryColor).Padding(0, 1) ActivityErrorStyle = lipgloss.NewStyle().Foreground(ErrorColor).Padding(0, 1) ActivityCompleteStyle = lipgloss.NewStyle().Foreground(SuccessColor).Padding(0, 1) ActivityMutedStyle = lipgloss.NewStyle().Foreground(MutedColor).Padding(0, 1) )
Activity line styles
var ( DividerStyle = lipgloss.NewStyle(). Foreground(BorderColor) // Thick divider (for section separators) ThickDividerStyle = lipgloss.NewStyle(). Foreground(BorderColor). Bold(true) )
Divider styles
var ( // TabStyle - inactive tab with rounded border TabStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(BorderColor). Padding(0, 1) // TabActiveStyle - active/viewed tab with primary color border and background TabActiveStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(PrimaryColor). Background(BgSelectedColor). Bold(true). Padding(0, 1) // TabRunningStyle - running state with primary color border TabRunningStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(PrimaryColor). Padding(0, 1) // TabErrorStyle - error state with error color border TabErrorStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ErrorColor). Padding(0, 1) // TabNewStyle - "+ New" button with muted styling TabNewStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(MutedColor). Foreground(MutedColor). Padding(0, 1) )
Tab bar styles
var ( // Header border/divider HeaderBorderStyle = lipgloss.NewStyle(). Foreground(BorderColor) )
Header styles
var ( // Progress percentage style ProgressPercentStyle = lipgloss.NewStyle(). Foreground(MutedColor) )
Progress bar styles
var ( // Unselected/normal item style UnselectedStyle = lipgloss.NewStyle(). Foreground(TextColor) )
Selection styles
Functions ¶
func GetActivityStyle ¶
GetActivityStyle returns the appropriate style for activity line based on state.
func GetStateStyle ¶
GetStateStyle returns the appropriate style for an app state.
func GetStatusIcon ¶
GetStatusIcon returns the appropriate icon for a story's status.
Types ¶
type App ¶
type App struct {
// Post-exit action - what to do after TUI exits
PostExitAction PostExitAction
PostExitPRD string // PRD name for post-exit action
// contains filtered or unexported fields
}
App is the main Bubble Tea model for the Chief TUI.
func NewAppWithOptions ¶
NewAppWithOptions creates a new App with the given PRD and options. If maxIter <= 0, it will be calculated dynamically based on remaining stories.
func (*App) DisableRetry ¶
func (a *App) DisableRetry()
DisableRetry disables automatic retry on Claude crashes.
func (*App) GetCompletionPercentage ¶
GetCompletionPercentage returns the percentage of completed stories.
func (*App) GetElapsedTime ¶
GetElapsedTime returns the elapsed time since the loop started.
func (*App) GetIteration ¶
GetIteration returns the current iteration count.
func (*App) GetLastActivity ¶
GetLastActivity returns the last activity message.
func (*App) GetSelectedStory ¶
GetSelectedStory returns the currently selected story.
func (*App) SetCompletionCallback ¶
SetCompletionCallback sets a callback that is called when any PRD completes.
func (*App) SetVerbose ¶
SetVerbose enables or disables verbose mode (raw Claude output in log).
type AutoActionState ¶
type AutoActionState int
AutoActionState represents the progress of an auto-action (push or PR).
const ( AutoActionIdle AutoActionState = iota // Not configured or not started AutoActionInProgress // Currently running AutoActionSuccess // Completed successfully AutoActionError // Failed with error )
type BranchWarning ¶
type BranchWarning struct {
// contains filtered or unexported fields
}
BranchWarning manages the branch warning dialog state.
func NewBranchWarning ¶
func NewBranchWarning() *BranchWarning
NewBranchWarning creates a new branch warning dialog.
func (*BranchWarning) AddInputChar ¶
func (b *BranchWarning) AddInputChar(ch rune)
AddInputChar adds a character to the branch name.
func (*BranchWarning) CancelEditMode ¶
func (b *BranchWarning) CancelEditMode()
CancelEditMode exits edit mode.
func (*BranchWarning) DeleteInputChar ¶
func (b *BranchWarning) DeleteInputChar()
DeleteInputChar removes the last character from the branch name.
func (*BranchWarning) GetDialogContext ¶
func (b *BranchWarning) GetDialogContext() DialogContext
GetDialogContext returns the current dialog context.
func (*BranchWarning) GetSelectedOption ¶
func (b *BranchWarning) GetSelectedOption() BranchWarningOption
GetSelectedOption returns the currently selected option.
func (*BranchWarning) GetSuggestedBranch ¶
func (b *BranchWarning) GetSuggestedBranch() string
GetSuggestedBranch returns the branch name (may be edited by user).
func (*BranchWarning) IsEditMode ¶
func (b *BranchWarning) IsEditMode() bool
IsEditMode returns true if the branch name is being edited.
func (*BranchWarning) Render ¶
func (b *BranchWarning) Render() string
Render renders the branch warning dialog.
func (*BranchWarning) SetContext ¶
func (b *BranchWarning) SetContext(currentBranch, prdName, worktreePath string)
SetContext sets the branch, PRD context, and worktree path for the warning.
func (*BranchWarning) SetDialogContext ¶
func (b *BranchWarning) SetDialogContext(ctx DialogContext)
SetDialogContext sets which context mode the dialog should display.
func (*BranchWarning) SetSize ¶
func (b *BranchWarning) SetSize(width, height int)
SetSize sets the dialog dimensions.
func (*BranchWarning) StartEditMode ¶
func (b *BranchWarning) StartEditMode()
StartEditMode enters edit mode for the branch name.
type BranchWarningOption ¶
type BranchWarningOption int
BranchWarningOption represents the user's choice in the branch warning dialog.
const ( BranchOptionCreateWorktree BranchWarningOption = iota // Create worktree + branch BranchOptionCreateBranch // Create branch only (no worktree) BranchOptionContinue // Continue on current branch / run in same directory BranchOptionCancel // Cancel )
type CleanConfirmation ¶
type CleanConfirmation struct {
EntryName string // Name of the PRD being cleaned
Branch string // Branch name to display
WorktreeDir string // Worktree path to display
SelectedIdx int // Selected option index (0-2)
}
CleanConfirmation holds the state of the clean confirmation dialog.
type CleanOption ¶
type CleanOption int
CleanOption represents the user's choice in the clean confirmation dialog.
const ( CleanOptionRemoveAll CleanOption = iota // Remove worktree + delete branch CleanOptionWorktreeOnly // Remove worktree only (keep branch) CleanOptionCancel // Cancel )
type CleanResult ¶
type CleanResult struct {
Success bool // Whether the clean succeeded
Message string // Success or error message
}
CleanResult holds the result of a clean operation for display.
type CompletionScreen ¶
type CompletionScreen struct {
// contains filtered or unexported fields
}
CompletionScreen manages the completion screen state shown when a PRD finishes.
func NewCompletionScreen ¶
func NewCompletionScreen() *CompletionScreen
NewCompletionScreen creates a new completion screen.
func (*CompletionScreen) Branch ¶
func (c *CompletionScreen) Branch() string
Branch returns the branch shown on the completion screen.
func (*CompletionScreen) Configure ¶
func (c *CompletionScreen) Configure(prdName string, completed, total int, branch string, commitCount int, hasAutoActions bool, totalDuration time.Duration, storyTimings []StoryTiming)
Configure sets up the completion screen with PRD completion data.
func (*CompletionScreen) HasBranch ¶
func (c *CompletionScreen) HasBranch() bool
HasBranch returns true if the completion screen has a branch set.
func (*CompletionScreen) HasConfetti ¶
func (c *CompletionScreen) HasConfetti() bool
HasConfetti returns true if confetti is still animating.
func (*CompletionScreen) IsAutoActionRunning ¶
func (c *CompletionScreen) IsAutoActionRunning() bool
IsAutoActionRunning returns true if any auto-action is currently in progress.
func (*CompletionScreen) PRDName ¶
func (c *CompletionScreen) PRDName() string
PRDName returns the PRD name shown on the completion screen.
func (*CompletionScreen) Render ¶
func (c *CompletionScreen) Render() string
Render renders the completion screen with confetti background.
func (*CompletionScreen) SetPRError ¶
func (c *CompletionScreen) SetPRError(errMsg string)
SetPRError marks the PR creation as failed with an error message.
func (*CompletionScreen) SetPRInProgress ¶
func (c *CompletionScreen) SetPRInProgress()
SetPRInProgress marks the PR creation as in progress.
func (*CompletionScreen) SetPRSuccess ¶
func (c *CompletionScreen) SetPRSuccess(url, title string)
SetPRSuccess marks the PR creation as successful.
func (*CompletionScreen) SetPushError ¶
func (c *CompletionScreen) SetPushError(errMsg string)
SetPushError marks the push as failed with an error message.
func (*CompletionScreen) SetPushInProgress ¶
func (c *CompletionScreen) SetPushInProgress()
SetPushInProgress marks the push as in progress.
func (*CompletionScreen) SetPushSuccess ¶
func (c *CompletionScreen) SetPushSuccess()
SetPushSuccess marks the push as successful.
func (*CompletionScreen) SetSize ¶
func (c *CompletionScreen) SetSize(width, height int)
SetSize sets the screen dimensions.
func (*CompletionScreen) Tick ¶
func (c *CompletionScreen) Tick()
Tick advances the spinner animation frame.
func (*CompletionScreen) TickConfetti ¶
func (c *CompletionScreen) TickConfetti()
TickConfetti advances the confetti animation by one frame.
type Confetti ¶
type Confetti struct {
// contains filtered or unexported fields
}
Confetti manages a collection of animated confetti particles.
func NewConfetti ¶
NewConfetti creates a new confetti system with particles spread across the screen.
func (*Confetti) HasParticles ¶
HasParticles returns true if there are still active particles.
func (*Confetti) Render ¶
Render draws all particles onto a character grid and returns it as a string.
type DialogContext ¶
type DialogContext int
DialogContext determines which set of options to show.
const ( // DialogProtectedBranch: on a protected branch (main/master) DialogProtectedBranch DialogContext = iota // DialogAnotherPRDRunning: another PRD is already running in the same directory DialogAnotherPRDRunning // DialogNoConflicts: not protected, nothing else running in same dir DialogNoConflicts )
type DiffViewer ¶
type DiffViewer struct {
// contains filtered or unexported fields
}
DiffViewer displays git diffs with syntax highlighting and scrolling.
func NewDiffViewer ¶
func NewDiffViewer(baseDir string) *DiffViewer
NewDiffViewer creates a new diff viewer.
func (*DiffViewer) Load ¶
func (d *DiffViewer) Load()
Load fetches the latest git diff for the full branch.
func (*DiffViewer) LoadForStory ¶
func (d *DiffViewer) LoadForStory(storyID, title string)
LoadForStory fetches the git diff for a specific story's commit. If no commit is found, it shows a "not committed yet" message.
func (*DiffViewer) ScrollToBottom ¶
func (d *DiffViewer) ScrollToBottom()
ScrollToBottom scrolls to the bottom.
func (*DiffViewer) SetBaseDir ¶
func (d *DiffViewer) SetBaseDir(dir string)
SetBaseDir updates the base directory used for loading diffs.
func (*DiffViewer) SetSize ¶
func (d *DiffViewer) SetSize(width, height int)
SetSize sets the viewport dimensions.
type FirstTimeSetup ¶
type FirstTimeSetup struct {
// contains filtered or unexported fields
}
FirstTimeSetup is a TUI for first-time project setup.
func NewFirstTimeSetup ¶
func NewFirstTimeSetup(baseDir string, showGitignore bool) *FirstTimeSetup
NewFirstTimeSetup creates a new first-time setup TUI.
func (FirstTimeSetup) GetResult ¶
func (f FirstTimeSetup) GetResult() FirstTimeSetupResult
GetResult returns the setup result.
type FirstTimeSetupResult ¶
type FirstTimeSetupResult struct {
PRDName string
AddedGitignore bool
Cancelled bool
PushOnComplete bool
CreatePROnComplete bool
}
FirstTimeSetupResult contains the result of the first-time setup flow.
func RunFirstTimeSetup ¶
func RunFirstTimeSetup(baseDir string, showGitignore bool) (FirstTimeSetupResult, error)
RunFirstTimeSetup runs the first-time setup TUI and returns the result.
type FirstTimeSetupStep ¶
type FirstTimeSetupStep int
FirstTimeSetupStep represents the current step in the setup flow.
const ( StepGitignore FirstTimeSetupStep = iota StepPRDName StepPostCompletion StepGHError )
type HelpOverlay ¶
type HelpOverlay struct {
// contains filtered or unexported fields
}
HelpOverlay manages the help overlay state.
func (*HelpOverlay) GetCategories ¶
func (h *HelpOverlay) GetCategories() []ShortcutCategory
GetCategories returns the shortcut categories for the current view.
func (*HelpOverlay) SetSize ¶
func (h *HelpOverlay) SetSize(width, height int)
SetSize sets the overlay dimensions.
func (*HelpOverlay) SetViewMode ¶
func (h *HelpOverlay) SetViewMode(mode ViewMode)
SetViewMode sets the current view mode for context-aware shortcuts.
type LaunchEditMsg ¶
type LaunchEditMsg struct {
Name string
}
LaunchEditMsg signals the TUI should exit to launch the edit flow.
type LaunchInitMsg ¶
type LaunchInitMsg struct {
Name string
}
LaunchInitMsg signals the TUI should exit to launch the init flow.
type LogEntry ¶
type LogEntry struct {
Type loop.EventType
Text string
Tool string
ToolInput map[string]interface{}
StoryID string
FilePath string // For Read tool results, stores the file path for syntax highlighting
// contains filtered or unexported fields
}
LogEntry represents a single entry in the log viewer.
type LogViewer ¶
type LogViewer struct {
// contains filtered or unexported fields
}
LogViewer manages the log viewport state.
func (*LogViewer) IsAutoScrolling ¶
IsAutoScrolling returns whether auto-scroll is enabled.
func (*LogViewer) ScrollDown ¶
func (l *LogViewer) ScrollDown()
ScrollDown scrolls down by one line.
func (*LogViewer) ScrollToBottom ¶
func (l *LogViewer) ScrollToBottom()
ScrollToBottom (exported) scrolls to the bottom.
type LoopEventMsg ¶
LoopEventMsg wraps a loop event for the Bubble Tea model.
type LoopFinishedMsg ¶
LoopFinishedMsg is sent when the loop finishes (complete, paused, stopped, or error).
type MergeResult ¶
type MergeResult struct {
Success bool // Whether the merge succeeded
Message string // Success message or error summary
Conflicts []string // Conflicting file list (empty on success)
Branch string // The branch that was merged
}
MergeResult holds the result of a merge operation for display.
type PRDCompletedMsg ¶
type PRDCompletedMsg struct {
PRDName string
}
PRDCompletedMsg is sent when any PRD completes all stories.
type PRDEntry ¶
type PRDEntry struct {
Name string // Directory name (e.g., "main", "feature-x")
Path string // Full path to prd.json
PRD *prd.PRD // Loaded PRD data
LoadError error // Error if PRD couldn't be loaded
Completed int // Number of completed stories
Total int // Total number of stories
InProgress bool // Whether any story is in progress
LoopState loop.LoopState // Current loop state from manager
Iteration int // Current iteration if running
Branch string // Git branch for this PRD (empty = no branch)
WorktreeDir string // Worktree directory (empty = current directory)
Orphaned bool // True if worktree exists on disk but no running PRD tracks it
}
PRDEntry represents a PRD in the picker list.
type PRDPicker ¶
type PRDPicker struct {
// contains filtered or unexported fields
}
PRDPicker manages the PRD picker modal state.
func NewPRDPicker ¶
NewPRDPicker creates a new PRD picker.
func (*PRDPicker) AddInputChar ¶
AddInputChar adds a character to the input.
func (*PRDPicker) CanClean ¶
CanClean returns true if the selected entry is a non-running PRD with a worktree.
func (*PRDPicker) CanMerge ¶
CanMerge returns true if the selected entry is a completed PRD with a branch set.
func (*PRDPicker) CancelCleanConfirmation ¶
func (p *PRDPicker) CancelCleanConfirmation()
CancelCleanConfirmation closes the clean confirmation dialog.
func (*PRDPicker) CancelInputMode ¶
func (p *PRDPicker) CancelInputMode()
CancelInputMode exits input mode without creating a PRD.
func (*PRDPicker) CleanConfirmMoveDown ¶
func (p *PRDPicker) CleanConfirmMoveDown()
CleanConfirmMoveDown moves the selection down in the clean confirmation dialog.
func (*PRDPicker) CleanConfirmMoveUp ¶
func (p *PRDPicker) CleanConfirmMoveUp()
CleanConfirmMoveUp moves the selection up in the clean confirmation dialog.
func (*PRDPicker) ClearCleanResult ¶
func (p *PRDPicker) ClearCleanResult()
ClearCleanResult clears any displayed clean result.
func (*PRDPicker) ClearMergeResult ¶
func (p *PRDPicker) ClearMergeResult()
ClearMergeResult clears any displayed merge result.
func (*PRDPicker) DeleteInputChar ¶
func (p *PRDPicker) DeleteInputChar()
DeleteInputChar removes the last character from the input.
func (*PRDPicker) GetCleanConfirmation ¶
func (p *PRDPicker) GetCleanConfirmation() *CleanConfirmation
GetCleanConfirmation returns the current clean confirmation state.
func (*PRDPicker) GetCleanOption ¶
func (p *PRDPicker) GetCleanOption() CleanOption
GetCleanOption returns the selected clean option.
func (*PRDPicker) GetInputValue ¶
GetInputValue returns the current input value.
func (*PRDPicker) GetSelectedEntry ¶
GetSelectedEntry returns the currently selected PRD entry.
func (*PRDPicker) HasCleanConfirmation ¶
HasCleanConfirmation returns true if the clean confirmation dialog is active.
func (*PRDPicker) HasCleanResult ¶
HasCleanResult returns true if there is a clean result to display.
func (*PRDPicker) HasMergeResult ¶
HasMergeResult returns true if there is a merge result to display.
func (*PRDPicker) IsInputMode ¶
IsInputMode returns true if the picker is in input mode for new PRD name.
func (*PRDPicker) Refresh ¶
func (p *PRDPicker) Refresh()
Refresh reloads the list of PRDs from the .chief/prds/ directory.
func (*PRDPicker) SetCleanResult ¶
func (p *PRDPicker) SetCleanResult(result *CleanResult)
SetCleanResult sets the clean result for display.
func (*PRDPicker) SetCurrentPRD ¶
SetCurrentPRD sets the current PRD name for highlighting.
func (*PRDPicker) SetManager ¶
SetManager sets the loop manager reference.
func (*PRDPicker) SetMergeResult ¶
func (p *PRDPicker) SetMergeResult(result *MergeResult)
SetMergeResult sets the merge result for display.
func (*PRDPicker) StartCleanConfirmation ¶
func (p *PRDPicker) StartCleanConfirmation()
StartCleanConfirmation opens the clean confirmation dialog for the selected entry.
func (*PRDPicker) StartInputMode ¶
func (p *PRDPicker) StartInputMode()
StartInputMode enters input mode for creating a new PRD.
type PRDUpdateMsg ¶
PRDUpdateMsg is sent when the PRD file changes.
type Particle ¶
type Particle struct {
// contains filtered or unexported fields
}
Particle represents a single confetti particle.
type PostExitAction ¶
type PostExitAction int
PostExitAction represents an action to take after the TUI exits.
const ( PostExitNone PostExitAction = iota PostExitInit PostExitEdit )
type ProgressUpdateMsg ¶
type ProgressUpdateMsg struct {
Entries map[string][]prd.ProgressEntry
}
ProgressUpdateMsg is sent when progress.md changes.
type QuitConfirmOption ¶
type QuitConfirmOption int
QuitConfirmOption represents the user's choice in the quit confirmation dialog.
const ( QuitOptionQuit QuitConfirmOption = iota // Quit and stop loop QuitOptionCancel // Cancel )
type QuitConfirmation ¶
type QuitConfirmation struct {
// contains filtered or unexported fields
}
QuitConfirmation manages the quit confirmation dialog state.
func NewQuitConfirmation ¶
func NewQuitConfirmation() *QuitConfirmation
NewQuitConfirmation creates a new quit confirmation dialog.
func (*QuitConfirmation) GetSelected ¶
func (q *QuitConfirmation) GetSelected() QuitConfirmOption
GetSelected returns the currently selected option.
func (*QuitConfirmation) MoveDown ¶
func (q *QuitConfirmation) MoveDown()
MoveDown moves selection down.
func (*QuitConfirmation) Render ¶
func (q *QuitConfirmation) Render() string
Render renders the quit confirmation dialog.
func (*QuitConfirmation) Reset ¶
func (q *QuitConfirmation) Reset()
Reset resets the dialog state to defaults.
func (*QuitConfirmation) SetSize ¶
func (q *QuitConfirmation) SetSize(width, height int)
SetSize sets the dialog dimensions.
type SettingsItem ¶
type SettingsItem struct {
Section string
Label string
Key string // config key for identification
Type SettingsItemType
BoolVal bool
StringVal string
}
SettingsItem represents a single editable setting.
type SettingsItemType ¶
type SettingsItemType int
SettingsItemType represents the type of a settings item.
const ( SettingsItemBool SettingsItemType = iota SettingsItemString )
type SettingsOverlay ¶
type SettingsOverlay struct {
// contains filtered or unexported fields
}
SettingsOverlay manages the settings modal overlay state.
func NewSettingsOverlay ¶
func NewSettingsOverlay() *SettingsOverlay
NewSettingsOverlay creates a new settings overlay.
func (*SettingsOverlay) AddEditChar ¶
func (s *SettingsOverlay) AddEditChar(ch rune)
AddEditChar adds a character to the edit buffer.
func (*SettingsOverlay) ApplyToConfig ¶
func (s *SettingsOverlay) ApplyToConfig(cfg *config.Config)
ApplyToConfig writes the current settings values back to a config.
func (*SettingsOverlay) CancelEdit ¶
func (s *SettingsOverlay) CancelEdit()
CancelEdit discards the edit buffer.
func (*SettingsOverlay) ConfirmEdit ¶
func (s *SettingsOverlay) ConfirmEdit()
ConfirmEdit saves the edit buffer to the selected item.
func (*SettingsOverlay) DeleteEditChar ¶
func (s *SettingsOverlay) DeleteEditChar()
DeleteEditChar removes the last character from the edit buffer.
func (*SettingsOverlay) DismissGHError ¶
func (s *SettingsOverlay) DismissGHError()
DismissGHError clears the GH CLI error.
func (*SettingsOverlay) GetSelectedItem ¶
func (s *SettingsOverlay) GetSelectedItem() *SettingsItem
GetSelectedItem returns the currently selected settings item.
func (*SettingsOverlay) HasGHError ¶
func (s *SettingsOverlay) HasGHError() bool
HasGHError returns true if a GH CLI error is being displayed.
func (*SettingsOverlay) IsEditing ¶
func (s *SettingsOverlay) IsEditing() bool
IsEditing returns true if a string value is being edited.
func (*SettingsOverlay) LoadFromConfig ¶
func (s *SettingsOverlay) LoadFromConfig(cfg *config.Config)
LoadFromConfig populates settings items from a config.
func (*SettingsOverlay) MoveDown ¶
func (s *SettingsOverlay) MoveDown()
MoveDown moves the selection down.
func (*SettingsOverlay) Render ¶
func (s *SettingsOverlay) Render() string
Render renders the settings overlay.
func (*SettingsOverlay) RevertToggle ¶
func (s *SettingsOverlay) RevertToggle()
RevertToggle reverts the last toggle (used when validation fails).
func (*SettingsOverlay) SetGHError ¶
func (s *SettingsOverlay) SetGHError(msg string)
SetGHError sets the GH CLI error message.
func (*SettingsOverlay) SetSize ¶
func (s *SettingsOverlay) SetSize(width, height int)
SetSize sets the overlay dimensions.
func (*SettingsOverlay) StartEditing ¶
func (s *SettingsOverlay) StartEditing()
StartEditing begins inline editing of the selected string value.
func (*SettingsOverlay) ToggleBool ¶
func (s *SettingsOverlay) ToggleBool() (key string, newVal bool)
ToggleBool toggles the selected boolean value. Returns the key and new value for the caller to act on.
type ShortcutCategory ¶
ShortcutCategory represents a category of keyboard shortcuts.
type StoryTiming ¶
StoryTiming records the duration of a completed story.
type TabBar ¶
type TabBar struct {
// contains filtered or unexported fields
}
TabBar manages the always-visible PRD tab bar.
func (*TabBar) Refresh ¶
func (t *TabBar) Refresh()
Refresh reloads the list of PRDs from the .chief/prds/ directory.
func (*TabBar) RenderCompact ¶
RenderCompact renders a compact version of the tab bar for narrow terminals.
func (*TabBar) SetActiveByName ¶
SetActiveByName sets the active tab by PRD name.
type TabEntry ¶
type TabEntry struct {
Name string // Directory name (e.g., "main", "feature-x")
Path string // Full path to prd.json
Branch string // Git branch name (e.g., "chief/auth"), empty if none
LoopState loop.LoopState // Current loop state from manager
Completed int // Number of completed stories
Total int // Total number of stories
Iteration int // Current iteration if running
IsActive bool // Whether this is the currently viewed PRD
}
TabEntry represents a PRD tab in the tab bar.
type WorktreeSpinner ¶
type WorktreeSpinner struct {
// contains filtered or unexported fields
}
WorktreeSpinner manages the worktree setup spinner overlay state.
func NewWorktreeSpinner ¶
func NewWorktreeSpinner() *WorktreeSpinner
NewWorktreeSpinner creates a new worktree setup spinner.
func (*WorktreeSpinner) AdvanceStep ¶
func (w *WorktreeSpinner) AdvanceStep()
AdvanceStep marks the current step as complete and moves to the next.
func (*WorktreeSpinner) Cancel ¶
func (w *WorktreeSpinner) Cancel()
Cancel marks the spinner as cancelled.
func (*WorktreeSpinner) Configure ¶
func (w *WorktreeSpinner) Configure(prdName, branchName, defaultBranch, worktreePath, setupCommand string)
Configure sets up the spinner with the given parameters.
func (*WorktreeSpinner) GetCurrentStep ¶
func (w *WorktreeSpinner) GetCurrentStep() WorktreeSpinnerStep
GetCurrentStep returns the current step.
func (*WorktreeSpinner) HasError ¶
func (w *WorktreeSpinner) HasError() bool
HasError returns true if there is an error.
func (*WorktreeSpinner) HasSetupCommand ¶
func (w *WorktreeSpinner) HasSetupCommand() bool
HasSetupCommand returns true if a setup command is configured.
func (*WorktreeSpinner) IsCancelled ¶
func (w *WorktreeSpinner) IsCancelled() bool
IsCancelled returns true if the user cancelled.
func (*WorktreeSpinner) IsDone ¶
func (w *WorktreeSpinner) IsDone() bool
IsDone returns true if all steps are complete.
func (*WorktreeSpinner) Render ¶
func (w *WorktreeSpinner) Render() string
Render renders the spinner overlay.
func (*WorktreeSpinner) SetError ¶
func (w *WorktreeSpinner) SetError(err string)
SetError sets an error on the current step.
func (*WorktreeSpinner) SetSize ¶
func (w *WorktreeSpinner) SetSize(width, height int)
SetSize sets the spinner dimensions.
func (*WorktreeSpinner) Tick ¶
func (w *WorktreeSpinner) Tick()
Tick advances the spinner animation frame.
type WorktreeSpinnerStep ¶
type WorktreeSpinnerStep int
WorktreeSpinnerStep represents a step in the worktree setup process.
const ( SpinnerStepCreateBranch WorktreeSpinnerStep = iota SpinnerStepCreateWorktree SpinnerStepRunSetup SpinnerStepDone )