Documentation
¶
Index ¶
- Constants
- func AppHeader() string
- func BuildViewportContent(reviewResponse string, chatHistory []ChatMessage, renderer *Renderer, ...) string
- func CalculateViewportHeight(height int, state State, hasYankFeedback bool) int
- func ClearYankFeedbackCmd(duration time.Duration) tea.Cmd
- func CollectIntent(interactive bool) (*appcontext.Intent, error)
- func GetSelectedFile(l list.Model) (string, bool)
- func HelpFooter() string
- func NavigatePromptHistory(history []string, currentIndex int, direction int) ([]string, int, string)
- func NewFileListModel(reviewCtx *appcontext.ReviewContext, pruningFiles map[string]bool) list.Model
- func RenderBox(content string) string
- func RenderCompactHelp(state string) string
- func RenderDivider(width int) string
- func RenderError(text string) string
- func RenderHelp(text string) string
- func RenderLoadingDots(tick int) string
- func RenderProgress(current, total int) string
- func RenderPrompt() string
- func RenderSearchInput(query string, matchCount, currentMatch int, mode SearchMode) string
- func RenderSecretWarning(secrets []SecretInfo) string
- func RenderSubtitle(text string) string
- func RenderSuccess(text string) string
- func RenderTitle(text string) string
- func RenderTokenUsage(prompt, completion, total int32) string
- func RenderWarning(text string) string
- func Run(reviewCtx *appcontext.ReviewContext, appInstance *app.App, sessionID string, ...) error
- func RunSimple(ctx context.Context, w io.Writer, reviewCtx *appcontext.ReviewContext, ...) error
- func ScrollToCurrentMatch(vp *viewport.Model, search *SearchState)
- func SendChatMessage(ctx context.Context, appInstance *app.App, sessionID, question string) tea.Cmd
- func SendMessageCmd(message string, sendFunc func(string) tea.Msg) tea.Cmd
- func UpdateFileListModel(l list.Model, reviewCtx *appcontext.ReviewContext, ...) list.Model
- func UpdatePromptHistory(history []string, question string) []string
- func UpdateViewportWithSearch(vp *viewport.Model, rawContent string, search *SearchState)
- func YankLastResponse(reviewResponse string, chatHistory []ChatMessage) tea.Cmd
- func YankReview(reviewResponse string, chatHistory []ChatMessage) tea.Cmd
- type ChatErrorMsg
- type ChatMessage
- type ChatResponseMsg
- type ChatRole
- type FileListItem
- type HelpOverlay
- type KeyMap
- type Model
- type PruneFileMsg
- type QuitMsg
- type Renderer
- type ReviewCompleteMsg
- type ReviewErrorMsg
- type ReviewStartMsg
- type SearchMatch
- type SearchMode
- type SearchState
- func (s *SearchState) CurrentMatchLine() int
- func (s *SearchState) FilterContent(content string) string
- func (s *SearchState) FilteredLineIndex(originalLine int) int
- func (s *SearchState) HighlightContent(content string) string
- func (s *SearchState) MatchCount() int
- func (s *SearchState) MatchStatus() string
- func (s *SearchState) NextMatch()
- func (s *SearchState) PrevMatch()
- func (s *SearchState) Reset()
- func (s *SearchState) Search(content string)
- func (s *SearchState) ToggleMode()
- type SecretInfo
- type State
- type StreamChunkMsg
- type StreamDoneMsg
- type StreamStartMsg
- type TickMsg
- type YankFeedbackMsg
- type YankMsg
- type YankType
Constants ¶
const ( YankFeedbackDuration = 2 * time.Second PruneErrorFeedbackDuration = 3 * time.Second YankChordTimeout = 300 * time.Millisecond )
UI feedback durations
const PruneFilePromptTemplate = `` /* 137-byte string literal not displayed */
PruneFilePromptTemplate is the template for file summarization prompts
Variables ¶
This section is empty.
Functions ¶
func BuildViewportContent ¶
func BuildViewportContent(reviewResponse string, chatHistory []ChatMessage, renderer *Renderer, width int) string
BuildViewportContent builds the viewport content from review response and chat history
func CalculateViewportHeight ¶
CalculateViewportHeight calculates the dynamic viewport height based on UI state
func ClearYankFeedbackCmd ¶
ClearYankFeedbackCmd creates a command to clear yank feedback after a delay
func CollectIntent ¶
func CollectIntent(interactive bool) (*appcontext.Intent, error)
CollectIntent collects user intent using a huh form Returns nil if skipped (non-interactive mode)
func GetSelectedFile ¶
GetSelectedFile returns the currently selected file path
func NavigatePromptHistory ¶
func NavigatePromptHistory(history []string, currentIndex int, direction int) ([]string, int, string)
NavigatePromptHistory navigates through prompt history Returns updated history, new index, and the prompt at that index (empty if new prompt)
func NewFileListModel ¶
func NewFileListModel(reviewCtx *appcontext.ReviewContext, pruningFiles map[string]bool) list.Model
NewFileListModel creates a new file list model from ReviewContext pruningFiles may be nil if pruning state is not needed
func RenderCompactHelp ¶
RenderCompact renders a compact version of the help for the footer
func RenderLoadingDots ¶
RenderLoadingDots renders animated loading dots
func RenderProgress ¶
RenderProgress renders a simple progress indicator
func RenderSearchInput ¶
func RenderSearchInput(query string, matchCount, currentMatch int, mode SearchMode) string
RenderSearchInput renders the search input bar
func RenderSecretWarning ¶
func RenderSecretWarning(secrets []SecretInfo) string
RenderSecretWarning renders a warning about detected secrets
func RenderTokenUsage ¶
RenderTokenUsage renders token usage information
func Run ¶
func Run(reviewCtx *appcontext.ReviewContext, appInstance *app.App, sessionID string, p *preset.Preset) error
Run starts the Bubbletea program
func RunSimple ¶
func RunSimple(ctx context.Context, w io.Writer, reviewCtx *appcontext.ReviewContext, appInstance *app.App, sessionID string, p *preset.Preset) error
RunSimple runs a simple non-interactive review using coordinator
func ScrollToCurrentMatch ¶
func ScrollToCurrentMatch(vp *viewport.Model, search *SearchState)
ScrollToCurrentMatch scrolls the viewport to show the current search match
func SendChatMessage ¶
SendChatMessage sends a follow-up question using coordinator
func SendMessageCmd ¶
SendMessageCmd creates a command to send a message to the LLM
func UpdateFileListModel ¶
func UpdateFileListModel(l list.Model, reviewCtx *appcontext.ReviewContext, pruningFiles map[string]bool) list.Model
UpdateFileListModel updates the file list model with current pruned state pruningFiles may be nil if pruning state is not needed
func UpdatePromptHistory ¶
UpdatePromptHistory adds a question to prompt history, avoiding duplicates
func UpdateViewportWithSearch ¶
func UpdateViewportWithSearch(vp *viewport.Model, rawContent string, search *SearchState)
UpdateViewportWithSearch updates the viewport with search highlighting
func YankLastResponse ¶
func YankLastResponse(reviewResponse string, chatHistory []ChatMessage) tea.Cmd
YankLastResponse yanks only the last/most recent assistant response
func YankReview ¶
func YankReview(reviewResponse string, chatHistory []ChatMessage) tea.Cmd
YankReview yanks the entire review content to clipboard
Types ¶
type ChatErrorMsg ¶
type ChatErrorMsg struct {
Err error
}
ChatErrorMsg contains an error from a chat interaction
type ChatMessage ¶
ChatMessage represents a message in the chat history
type ChatResponseMsg ¶
type ChatResponseMsg struct {
Response string
}
ChatResponseMsg contains a response to a follow-up question
type FileListItem ¶
type FileListItem struct {
Path string
Size int
Pruned bool
Pruning bool // Whether file is currently being pruned
}
FileListItem represents an item in the file list
func (FileListItem) Description ¶
func (f FileListItem) Description() string
Description returns the description (file size)
func (FileListItem) FilterValue ¶
func (f FileListItem) FilterValue() string
FilterValue returns the value to filter by
func (FileListItem) Title ¶
func (f FileListItem) Title() string
Title returns the display title for the item
type HelpOverlay ¶
type HelpOverlay struct {
// contains filtered or unexported fields
}
HelpOverlay renders the help overlay with all keybindings
func NewHelpOverlay ¶
func NewHelpOverlay(width, height int) *HelpOverlay
NewHelpOverlay creates a new help overlay
type KeyMap ¶
type KeyMap struct {
// Global
Quit key.Binding
ForceQuit key.Binding
// Navigation (reviewing mode)
Up key.Binding
Down key.Binding
Top key.Binding
Bottom key.Binding
HalfPageDown key.Binding
HalfPageUp key.Binding
PageDown key.Binding
PageUp key.Binding
// Search
Search key.Binding
NextMatch key.Binding
PrevMatch key.Binding
ToggleMode key.Binding
SearchEnter key.Binding
SearchEsc key.Binding
// Help
Help key.Binding
// Chat
EnterChat key.Binding
ExitChat key.Binding
SendMessage key.Binding
PrevPrompt key.Binding
NextPrompt key.Binding
CancelRequest key.Binding
ToggleWebSearch key.Binding
// Yank
YankReview key.Binding
YankLast key.Binding
// File list
FileList key.Binding
FileListPrune key.Binding
SelectFile key.Binding
Back key.Binding
}
KeyMap defines all keybindings for the TUI
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the application state for Bubbletea
func NewModel ¶
func NewModel(reviewCtx *appcontext.ReviewContext, appInstance *app.App, sessionID string, p *preset.Preset) *Model
NewModel creates a new application model
type PruneFileMsg ¶
PruneFileMsg contains the result of pruning a file
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer handles markdown rendering
func NewRenderer ¶
NewRenderer creates a new markdown renderer
type ReviewCompleteMsg ¶
type ReviewCompleteMsg struct {
Response string
}
ReviewCompleteMsg contains the completed review response
type ReviewErrorMsg ¶
type ReviewErrorMsg struct {
Err error
}
ReviewErrorMsg contains an error from the review process
type SearchMatch ¶
type SearchMatch struct {
Line int // Line number (0-indexed)
StartCol int // Start column in the line
EndCol int // End column in the line
LineText string // The full line text
MatchText string // The matched text
}
SearchMatch represents a match in the content
type SearchMode ¶
type SearchMode int
SearchMode represents the search behavior
const ( SearchModeHighlight SearchMode = iota // Highlight matches, show all content SearchModeFilter // Show only lines with matches )
type SearchState ¶
type SearchState struct {
Active bool
Query string
Mode SearchMode
Matches []SearchMatch
CurrentMatch int
}
SearchState holds the current search state
func (*SearchState) CurrentMatchLine ¶
func (s *SearchState) CurrentMatchLine() int
CurrentMatchLine returns the line number of the current match
func (*SearchState) FilterContent ¶
func (s *SearchState) FilterContent(content string) string
FilterContent returns only lines containing matches
func (*SearchState) FilteredLineIndex ¶
func (s *SearchState) FilteredLineIndex(originalLine int) int
FilteredLineIndex translates an original line number to its index in the filtered view. Returns -1 if the line is not in the filtered set.
func (*SearchState) HighlightContent ¶
func (s *SearchState) HighlightContent(content string) string
HighlightContent highlights all matches in the content
func (*SearchState) MatchCount ¶
func (s *SearchState) MatchCount() int
MatchCount returns the number of matches
func (*SearchState) MatchStatus ¶
func (s *SearchState) MatchStatus() string
MatchStatus returns a string describing the current match status
func (*SearchState) PrevMatch ¶
func (s *SearchState) PrevMatch()
PrevMatch moves to the previous match
func (*SearchState) Search ¶
func (s *SearchState) Search(content string)
Search performs a case-insensitive search and returns matches
func (*SearchState) ToggleMode ¶
func (s *SearchState) ToggleMode()
ToggleMode switches between highlight and filter modes
type SecretInfo ¶
SecretInfo contains information about a detected secret
type StreamChunkMsg ¶
type StreamChunkMsg struct {
Chunk string
}
StreamChunkMsg contains a chunk of streamed response
type StreamDoneMsg ¶
type StreamDoneMsg struct {
FullResponse string
}
StreamDoneMsg signals that streaming is complete
type StreamStartMsg ¶
StreamStartMsg signals that streaming has started and provides channels
type YankFeedbackMsg ¶
type YankFeedbackMsg struct{}
YankFeedbackMsg signals that yank feedback should be cleared