Documentation
¶
Index ¶
- type ContentSource
- type FileWithDiffMsg
- type LaunchAIMsg
- type Mode
- type Model
- func (m Model) AICommandName() string
- func (m Model) ActiveSource() ContentSource
- func (m Model) Blur() Model
- func (m Model) ContentView() string
- func (m Model) CurrentPath() string
- func (m Model) Focus() (Model, tea.Cmd)
- func (m Model) HasActiveSearch() bool
- func (m Model) HasMultipleSources() bool
- func (m Model) Init() tea.Cmd
- func (m Model) IsTerminalRunning() bool
- func (m Model) Mode() Mode
- func (m Model) ScrollPercent() float64
- func (m *Model) SetGitProvider(provider git.Provider)
- func (m *Model) SetMode(mode Mode)
- func (m Model) SetSize(width, height int) Model
- func (m Model) SourcesInfo() []SourceInfo
- func (m Model) TitleInfo() (title string, scrollPercent float64)
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- type OpenFileMsg
- type SetModeMsg
- type SourceInfo
- type SwitchSourceMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentSource ¶
type ContentSource int
ContentSource identifies a source of content in the panel. This prepares for future split-panel support while currently only one source is displayed at a time.
const ( SourceNone ContentSource = iota SourceFile // File viewer or diff SourceAI // AI terminal )
type FileWithDiffMsg ¶
FileWithDiffMsg is sent after checking if a file has a diff.
type LaunchAIMsg ¶
LaunchAIMsg requests launching the AI assistant.
type Model ¶
type Model struct {
components.Base
// contains filtered or unexported fields
}
Model is the content pane component that routes between different views.
func (Model) AICommandName ¶
AICommandName returns the capitalized AI command name (e.g., "Claude", "Aider").
func (Model) ActiveSource ¶
func (m Model) ActiveSource() ContentSource
ActiveSource returns the currently active content source.
func (Model) ContentView ¶
ContentView returns just the inner content without any title or border. This is used by app.go to wrap content with the new border system.
func (Model) CurrentPath ¶
CurrentPath returns the current file path (if any).
func (Model) HasActiveSearch ¶
HasActiveSearch returns whether the viewer has an active search.
func (Model) HasMultipleSources ¶
HasMultipleSources returns true if both file and AI content are available.
func (Model) IsTerminalRunning ¶
IsTerminalRunning returns true if the terminal is running a process.
func (Model) ScrollPercent ¶
ScrollPercent returns the scroll position of the current view.
func (*Model) SetGitProvider ¶
SetGitProvider sets the git provider for diff functionality.
func (Model) SourcesInfo ¶
func (m Model) SourcesInfo() []SourceInfo
SourcesInfo returns information about all available content sources. This enables the dual-header display showing both file and AI titles. Returns a slice of SourceInfo for sources that have content.
type OpenFileMsg ¶
type OpenFileMsg struct {
Path string
}
OpenFileMsg requests opening a file in the viewer.
type SourceInfo ¶
type SourceInfo struct {
Source ContentSource
Title string // Display title (filename or AI command name)
ScrollPercent float64 // -1 for terminals
IsRunning bool // For AI: whether process is running
IsActive bool // Whether this source is currently displayed
}
SourceInfo contains information about a content source for header display.
type SwitchSourceMsg ¶
type SwitchSourceMsg struct {
Source ContentSource
}
SwitchSourceMsg requests switching to a different content source. Used when clicking on headers in the dual-header display.