Documentation
¶
Index ¶
- Constants
- func CalcDescriptionPadding(width int) int
- func CalcScrollbar(totalItems, visibleCount, scrollOffset, scrollAreaHeight int) (start, height int)
- func CalculateScrollOffset(currentOffset, selectedIndex, totalItems, visibleCount int) int
- func DefaultLookPath(file string) (string, error)
- func EstimateFilesVisibleCount(panelHeight int) int
- func EstimateSectionRenderCount(panelHeight int) int
- func EstimateSectionVisibleCount(panelHeight int) int
- func ScrollOffset(current, delta, totalItems, visibleCount int) int
- func ToggleCollapse(collapsed CollapsedPaths, path string)
- func Truncate(s string, maxLen int) string
- func TruncatePathMiddle(path string, maxWidth int) string
- type CheckUntrackedMsg
- type ClearStatusMsg
- type CollapsedPaths
- type CommitInfo
- type CommitListErrorMsg
- type CommitListMsg
- type DiffSource
- type ErrorMsg
- type FileNode
- type FilterLevel
- type GenerateCancelledMsg
- type GenerateErrorMsg
- type GenerateNeedsRetryMsg
- type GenerateParams
- type GenerateSuccessMsg
- type GenerateUIState
- type GenerateValidationFailedMsg
- type Keybinding
- type KeybindingRegistry
- type LLMChapter
- type LLMCommandResult
- type LLMHunkRef
- type LLMResponse
- type LLMSection
- type LookPathFunc
- type Model
- func (m Model) Commits() []CommitInfo
- func (m Model) FilesScrollOffset() int
- func (m Model) FilterLevel() FilterLevel
- func (m Model) FlattenedFilesCount() int
- func (m Model) FocusedPanel() Panel
- func (m Model) GenerateUIState() GenerateUIState
- func (m Model) Height() int
- func (m Model) Init() tea.Cmd
- func (m Model) IsGenerating() bool
- func (m Model) Ready() bool
- func (m Model) Review() *model.Review
- func (m Model) SectionScrollOffset() int
- func (m Model) Selected() int
- func (m Model) SelectedFile() int
- func (m Model) SetCancelFunc(cancel func()) Model
- func (m Model) SetFilesScrollOffset(offset int) Model
- func (m Model) SetGenerating(generating bool) Model
- func (m Model) SetSectionScrollOffset(offset int) Model
- func (m Model) SetSelectedDiffSource() Model
- func (m Model) SetShowCancelPrompt(show bool) Model
- func (m Model) SetUntrackedWarningState(files []string) Model
- func (m Model) ShowCancelPrompt() bool
- func (m Model) ShowHelp() bool
- func (m Model) StatusMsg() string
- func (m Model) TestFilter() TestFilter
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- func (m Model) ViewportYOffset() int
- func (m Model) Width() int
- func (m Model) WorkDir() string
- type ModelOption
- type Panel
- type ReviewClearedMsg
- type ReviewReceivedMsg
- type ScrollbarInfo
- type StageCompleteMsg
- type TestFilter
- type ValidationResult
- type WatchErrorMsg
Constants ¶
const DefaultReviewerInstructions = `` /* 370-byte string literal not displayed */
DefaultReviewerInstructions is the default content shown in the context input textarea. Users can edit or extend these instructions before generating a review.
Variables ¶
This section is empty.
Functions ¶
func CalcDescriptionPadding ¶
CalcDescriptionPadding returns the horizontal padding for the description pane. Uses capped linear scaling: padding grows with width but caps at a maximum.
func CalcScrollbar ¶
func CalcScrollbar(totalItems, visibleCount, scrollOffset, scrollAreaHeight int) (start, height int)
CalcScrollbar returns scrollbar start position and height.
func CalculateScrollOffset ¶
CalculateScrollOffset returns the scroll offset needed to keep selectedIndex visible.
func DefaultLookPath ¶
DefaultLookPath uses exec.LookPath to find commands on PATH
func EstimateFilesVisibleCount ¶
EstimateFilesVisibleCount estimates how many files fit in the panel. Each file takes 1 line. Subtract 1 for the position indicator at the bottom.
func EstimateSectionRenderCount ¶
EstimateSectionRenderCount estimates how many sections to render. Each section/chapter header takes 1 line (narratives are in Description panel).
func EstimateSectionVisibleCount ¶
EstimateSectionVisibleCount estimates how many sections fit in the panel. Each section/chapter header takes 1 line (narratives are in Description panel). Used for scroll triggering.
func ScrollOffset ¶
ScrollOffset adjusts an offset by delta, clamping to valid range. Used for mouse scroll handling in section and files panels.
func ToggleCollapse ¶
func ToggleCollapse(collapsed CollapsedPaths, path string)
func TruncatePathMiddle ¶
TruncatePathMiddle truncates a path by replacing middle directories with "..." Example: "src/components/auth/middleware/validate.ts" -> "src/.../validate.ts"
Types ¶
type CheckUntrackedMsg ¶
CheckUntrackedMsg delivers the result of checking for untracked files
type ClearStatusMsg ¶
type ClearStatusMsg struct{}
ClearStatusMsg is sent to clear the status bar message
type CollapsedPaths ¶
type CommitInfo ¶
CommitInfo holds metadata about a git commit
type CommitListErrorMsg ¶
type CommitListErrorMsg struct {
Err error
}
CommitListErrorMsg indicates failure to load commit list
type CommitListMsg ¶
type CommitListMsg struct {
Commits []CommitInfo
}
CommitListMsg delivers the list of recent commits
type DiffSource ¶
type DiffSource struct {
Label string
CommandHint string // Git command shown in parentheses (styled dimmer)
Command []string
NeedsCommit bool // true for "Specific commit"
NeedsCommitRange bool // true for "Commit range"
}
DiffSource represents a source of diff content for review generation
func DefaultDiffSources ¶
func DefaultDiffSources() []DiffSource
DefaultDiffSources returns the standard set of diff sources
type ErrorMsg ¶
type ErrorMsg struct {
Err error
}
ErrorMsg is sent when an error should be displayed in the status bar
type FileNode ¶
func BuildFileTree ¶
func Flatten ¶
func Flatten(root *FileNode, collapsed CollapsedPaths) []*FileNode
type FilterLevel ¶
type FilterLevel int
FilterLevel represents the importance filter threshold
const ( FilterLevelLow FilterLevel = iota // Show all hunks FilterLevelMedium // Show medium + high importance FilterLevelHigh // Show only high importance )
func (FilterLevel) Next ¶
func (f FilterLevel) Next() FilterLevel
func (FilterLevel) PassesFilter ¶
func (f FilterLevel) PassesFilter(importance string) bool
func (FilterLevel) String ¶
func (f FilterLevel) String() string
type GenerateCancelledMsg ¶
type GenerateCancelledMsg struct{}
GenerateCancelledMsg indicates user cancelled generation
type GenerateErrorMsg ¶
type GenerateErrorMsg struct {
Err error
}
GenerateErrorMsg indicates LLM generation failed
type GenerateNeedsRetryMsg ¶
type GenerateNeedsRetryMsg struct {
Hunks []diff.ParsedHunk
MissingIDs []string
Context string
}
GenerateNeedsRetryMsg indicates validation failed and retry is needed
type GenerateParams ¶
type GenerateParams struct {
DiffCommand []string
LLMCommand []string // Resolved LLM command to use
Context string
IsRetry bool
MissingIDs []string
ParsedHunks []diff.ParsedHunk // Set on retry to avoid re-parsing
}
GenerateParams holds parameters for review generation
type GenerateSuccessMsg ¶
type GenerateSuccessMsg struct{}
GenerateSuccessMsg signals that LLM generation completed successfully. The review is written to disk and will be delivered via the watcher.
type GenerateUIState ¶
type GenerateUIState int
GenerateUIState represents the current state of the generate flow
const ( GenerateUIStateNone GenerateUIState = iota GenerateUIStateSourcePicker GenerateUIStateCommitSelector GenerateUIStateCommitRangeStart GenerateUIStateCommitRangeEnd GenerateUIStateContextInput GenerateUIStateValidationError GenerateUIStateUntrackedWarning )
type GenerateValidationFailedMsg ¶
type GenerateValidationFailedMsg struct {
Hunks []diff.ParsedHunk
Missing []string
Duplicates []string
Invalid []string
Response *LLMResponse // The partial response for "proceed with partial" option
}
GenerateValidationFailedMsg indicates validation failed after retry
type Keybinding ¶
type Keybinding struct {
Key string
Description string
Context string // "global", "navigation", "files"
}
Keybinding represents a single keyboard shortcut
type KeybindingRegistry ¶
type KeybindingRegistry struct {
// contains filtered or unexported fields
}
KeybindingRegistry holds all registered keybindings
func NewKeybindingRegistry ¶
func NewKeybindingRegistry() *KeybindingRegistry
NewKeybindingRegistry creates an empty registry
func (*KeybindingRegistry) GetAll ¶
func (r *KeybindingRegistry) GetAll() []Keybinding
GetAll returns all registered keybindings
func (*KeybindingRegistry) GetByContext ¶
func (r *KeybindingRegistry) GetByContext(ctx string) []Keybinding
GetByContext returns keybindings for a specific context
func (*KeybindingRegistry) Register ¶
func (r *KeybindingRegistry) Register(binding Keybinding)
Register adds a keybinding to the registry
type LLMChapter ¶
type LLMChapter struct {
ID string `json:"id"`
Title string `json:"title"`
Sections []LLMSection `json:"sections"`
}
LLMChapter represents a logical grouping of related sections
type LLMCommandResult ¶
LLMCommandResult represents the result of resolving the LLM command
func ResolveLLMCommand ¶
func ResolveLLMCommand(cfg *config.Config, lookPath LookPathFunc) LLMCommandResult
ResolveLLMCommand determines which LLM command to use. If config has an explicit llmCommand, it validates that command exists. If no llmCommand is configured, it checks for claude on PATH.
type LLMHunkRef ¶
type LLMHunkRef struct {
ID string `json:"id"`
Importance string `json:"importance"`
IsTest *bool `json:"isTest,omitempty"`
}
LLMHunkRef references a hunk by ID with its classified importance
type LLMResponse ¶
type LLMResponse struct {
Title string `json:"title"`
Chapters []LLMChapter `json:"chapters"`
}
LLMResponse is the classification returned by the LLM
type LLMSection ¶
type LLMSection struct {
ID string `json:"id"`
Title string `json:"title"`
What string `json:"what"`
Why string `json:"why"`
Hunks []LLMHunkRef `json:"hunks"`
}
LLMSection represents a classified section from the LLM
type LookPathFunc ¶
LookPathFunc is a function type for looking up commands on PATH
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (Model) Commits ¶
func (m Model) Commits() []CommitInfo
Commits returns the loaded commit list (for testing)
func (Model) FilesScrollOffset ¶
func (Model) FilterLevel ¶
func (m Model) FilterLevel() FilterLevel
func (Model) FlattenedFilesCount ¶
func (Model) FocusedPanel ¶
func (Model) GenerateUIState ¶
func (m Model) GenerateUIState() GenerateUIState
func (Model) IsGenerating ¶
func (Model) SectionScrollOffset ¶
func (Model) SelectedFile ¶
func (Model) SetCancelFunc ¶
SetCancelFunc is a test helper to set a cancel function
func (Model) SetFilesScrollOffset ¶
SetFilesScrollOffset is a test helper to set the files scroll offset
func (Model) SetGenerating ¶
SetGenerating is a test helper to set the generating state
func (Model) SetSectionScrollOffset ¶
SetSectionScrollOffset is a test helper to set the section scroll offset
func (Model) SetSelectedDiffSource ¶
SetSelectedDiffSource is a test helper to set a default diff source
func (Model) SetShowCancelPrompt ¶
SetShowCancelPrompt is a test helper to set the cancel prompt state
func (Model) SetUntrackedWarningState ¶
SetUntrackedWarningState is a test helper to set the untracked warning state
func (Model) ShowCancelPrompt ¶
func (Model) TestFilter ¶
func (m Model) TestFilter() TestFilter
func (Model) ViewportYOffset ¶
type ModelOption ¶
type ModelOption func(*Model)
ModelOption configures a Model
func WithInitialReview ¶
func WithInitialReview(review *model.Review) ModelOption
WithInitialReview sets an initial review to display (bypasses watcher)
func WithLookPath ¶
func WithLookPath(lookPath LookPathFunc) ModelOption
WithLookPath sets a custom lookPath function (for testing)
type ReviewClearedMsg ¶
type ReviewClearedMsg struct{}
ReviewClearedMsg is sent when the review file is deleted
type ReviewReceivedMsg ¶
ReviewReceivedMsg is sent when a review file is created/updated
type ScrollbarInfo ¶
type ScrollbarInfo struct {
Start int // Line position where scrollbar starts (0-indexed from content top)
Height int // Number of lines the scrollbar occupies
}
ScrollbarInfo contains the position and size of a scrollbar
type StageCompleteMsg ¶
type StageCompleteMsg struct{}
StageCompleteMsg signals that git add completed successfully
type TestFilter ¶
type TestFilter int
const ( TestFilterAll TestFilter = iota // Show all hunks TestFilterExcluding // Exclude test hunks TestFilterOnly // Show only test hunks )
func (TestFilter) Next ¶
func (f TestFilter) Next() TestFilter
func (TestFilter) PassesFilter ¶
func (f TestFilter) PassesFilter(isTest *bool) bool
func (TestFilter) String ¶
func (f TestFilter) String() string
type ValidationResult ¶
type ValidationResult struct {
Valid bool
MissingIDs []string
DuplicateIDs []string
InvalidImportance []string
}
ValidationResult holds the results of classification validation
type WatchErrorMsg ¶
type WatchErrorMsg struct {
Err error
}
WatchErrorMsg is sent when file watching fails