Documentation
¶
Index ¶
- func Help(km KeyMap) string
- func IsImageFile(ext string) bool
- type Bookmark
- type CommandEntry
- type CommandPalette
- func (p *CommandPalette) Close()
- func (p *CommandPalette) Execute() tea.Msg
- func (p *CommandPalette) HandleOpenInput(idx *index.Index) tea.Msg
- func (p *CommandPalette) IsActive() bool
- func (p *CommandPalette) MoveDown()
- func (p *CommandPalette) MoveUp()
- func (p *CommandPalette) Open()
- func (p *CommandPalette) RegisterCommand(cmd CommandEntry)
- func (p *CommandPalette) RegisterCommands(idx *index.Index, links *index.LinkGraph)
- func (p *CommandPalette) SetInput(s string)
- func (p CommandPalette) View() string
- type FileListModel
- func (m *FileListModel) ClearFilter()
- func (m *FileListModel) MoveDown()
- func (m *FileListModel) MoveUp()
- func (m *FileListModel) SelectByPath(relPath string)
- func (m *FileListModel) Selected() *index.FileEntry
- func (m *FileListModel) SelectedVisible() *index.FileEntry
- func (m *FileListModel) SetFilter(query string)
- func (m *FileListModel) StartFilter()
- func (m *FileListModel) ToggleDir()
- func (m FileListModel) View() string
- type FileSelectedMsg
- type HistoryEntry
- type ImageRenderer
- type KeyMap
- type LinkFollowMsg
- type LinkNavigator
- func (n *LinkNavigator) Back() *HistoryEntry
- func (n *LinkNavigator) BacklinksAt(path string) []index.Link
- func (n *LinkNavigator) CloseLinks()
- func (n *LinkNavigator) Current() *HistoryEntry
- func (n *LinkNavigator) Forward() *HistoryEntry
- func (n *LinkNavigator) IsShowingLinks() bool
- func (n *LinkNavigator) LinkMoveDown()
- func (n *LinkNavigator) LinkMoveUp()
- func (n *LinkNavigator) LinkOverlayView() string
- func (n *LinkNavigator) LinkSelect() (string, string)
- func (n *LinkNavigator) LinksAt(path string) []index.Link
- func (n *LinkNavigator) Navigate(path string, scroll int)
- func (n *LinkNavigator) ShowLinks(path string) (target, fragment string)
- type LinkSelectMsg
- type Model
- type NavigateMsg
- type Panel
- type PanelSelectMsg
- type PanelType
- type PreviewLoadedMsg
- type PreviewModel
- func (m *PreviewModel) CursorDown()
- func (m *PreviewModel) CursorTo(line int)
- func (m *PreviewModel) CursorUp()
- func (m *PreviewModel) EnterSearchMode()
- func (m *PreviewModel) EnterVisualMode()
- func (m *PreviewModel) ExitSearchMode()
- func (m *PreviewModel) ExitVisualMode()
- func (m *PreviewModel) NextMatch()
- func (m *PreviewModel) PrevMatch()
- func (m *PreviewModel) ScrollDown(lines int)
- func (m *PreviewModel) ScrollToBottom()
- func (m *PreviewModel) ScrollUp(lines int)
- func (m *PreviewModel) SearchBackspace()
- func (m *PreviewModel) SearchHistoryDown()
- func (m *PreviewModel) SearchHistoryUp()
- func (m *PreviewModel) SearchInput(r rune)
- func (m *PreviewModel) SelectedSourceLines() (startLine, endLine int)
- func (m *PreviewModel) SetContent(path, content string)
- func (m *PreviewModel) SetSourceInfo(lineCount int, isCode bool)
- func (m *PreviewModel) ToggleReadingGuide()
- func (m *PreviewModel) ToggleSearchRegex()
- func (m PreviewModel) View() string
- func (m *PreviewModel) VisualCursorDown()
- func (m *PreviewModel) VisualCursorUp()
- type RemoteInfo
- type SidePanelModel
- func (m *SidePanelModel) AddBookmark(bm Bookmark)
- func (m *SidePanelModel) MoveDown()
- func (m *SidePanelModel) MoveUp()
- func (m *SidePanelModel) RemoveBookmark(idx int)
- func (m *SidePanelModel) Select() *PanelSelectMsg
- func (m *SidePanelModel) SetBacklinks(links []index.Link)
- func (m *SidePanelModel) SetGitInfo(repoRoot, filePath string)
- func (m *SidePanelModel) SetTOC(entries []TOCEntry)
- func (m *SidePanelModel) SetTOCFromMarkdown(source string)
- func (m *SidePanelModel) Toggle(pt PanelType)
- func (m *SidePanelModel) Type() PanelType
- func (m *SidePanelModel) TypeName() string
- func (m SidePanelModel) View() string
- func (m *SidePanelModel) Visible() bool
- type StatusBarModel
- type StatusMsg
- type TOCEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsImageFile ¶
IsImageFile returns whether the given extension is a supported image format.
Types ¶
type CommandEntry ¶
type CommandEntry struct {
Name string
Description string
Action func() tea.Msg // returns a message to dispatch
}
CommandEntry represents an entry in the command palette.
type CommandPalette ¶
type CommandPalette struct {
// contains filtered or unexported fields
}
CommandPalette manages the colon-mode command interface.
func NewCommandPalette ¶
func NewCommandPalette() CommandPalette
NewCommandPalette creates a command palette with default commands.
func (*CommandPalette) Close ¶
func (p *CommandPalette) Close()
Close deactivates the command palette.
func (*CommandPalette) Execute ¶
func (p *CommandPalette) Execute() tea.Msg
Execute runs the selected command and returns its message.
func (*CommandPalette) HandleOpenInput ¶
func (p *CommandPalette) HandleOpenInput(idx *index.Index) tea.Msg
HandleOpenInput handles the "open" command with fuzzy file matching.
func (*CommandPalette) IsActive ¶
func (p *CommandPalette) IsActive() bool
IsActive returns whether the palette is open.
func (*CommandPalette) MoveDown ¶
func (p *CommandPalette) MoveDown()
MoveDown moves the cursor down in the palette.
func (*CommandPalette) MoveUp ¶
func (p *CommandPalette) MoveUp()
MoveUp moves the cursor up in the palette.
func (*CommandPalette) RegisterCommand ¶
func (p *CommandPalette) RegisterCommand(cmd CommandEntry)
RegisterCommand adds a command to the palette.
func (*CommandPalette) RegisterCommands ¶
func (p *CommandPalette) RegisterCommands(idx *index.Index, links *index.LinkGraph)
RegisterCommands sets up the standard command set for the TUI.
func (*CommandPalette) SetInput ¶
func (p *CommandPalette) SetInput(s string)
SetInput updates the filter input.
func (CommandPalette) View ¶
func (p CommandPalette) View() string
View renders the command palette overlay.
type FileListModel ¶
type FileListModel struct {
// contains filtered or unexported fields
}
FileListModel manages the file list panel with fuzzy filtering.
func NewFileListModel ¶
func NewFileListModel(idx *index.Index) FileListModel
NewFileListModel creates a file list panel.
func (*FileListModel) ClearFilter ¶
func (m *FileListModel) ClearFilter()
ClearFilter exits filter mode and resets the list.
func (*FileListModel) SelectByPath ¶
func (m *FileListModel) SelectByPath(relPath string)
SelectByPath positions the cursor on the file with the given relative path. It expands any collapsed parent directories so the file is visible.
func (*FileListModel) Selected ¶
func (m *FileListModel) Selected() *index.FileEntry
Selected returns the currently selected entry from filtered list.
func (*FileListModel) SelectedVisible ¶
func (m *FileListModel) SelectedVisible() *index.FileEntry
SelectedVisible returns the entry for the current cursor in tree mode.
func (*FileListModel) SetFilter ¶
func (m *FileListModel) SetFilter(query string)
SetFilter updates the fuzzy filter query and refilters.
func (*FileListModel) StartFilter ¶
func (m *FileListModel) StartFilter()
StartFilter enters filter mode.
func (*FileListModel) ToggleDir ¶
func (m *FileListModel) ToggleDir()
ToggleDir collapses or expands the directory at the cursor.
type FileSelectedMsg ¶
Message types for inter-component communication.
type HistoryEntry ¶
HistoryEntry records a navigation event for back/forward.
type ImageRenderer ¶
type ImageRenderer struct{}
ImageRenderer handles image file display in the TUI. Uses a text-based info card because terminal image protocols (Kitty, iTerm2) are incompatible with Bubble Tea's alt-screen rendering — they cause duplication on resize and can't be scrolled or clipped to pane bounds.
func NewImageRenderer ¶
func NewImageRenderer() *ImageRenderer
NewImageRenderer creates an image renderer.
func (*ImageRenderer) Render ¶
func (r *ImageRenderer) Render(path string) string
Render returns a text-based info card for the image file.
type KeyMap ¶
type KeyMap struct {
Quit key.Binding
Up key.Binding
Down key.Binding
Enter key.Binding
Back key.Binding
Tab key.Binding
Search key.Binding
Help key.Binding
Follow key.Binding
Backlinks key.Binding
TOC key.Binding
Bookmark key.Binding
Command key.Binding
CopyLink key.Binding
GitInfo key.Binding
Copy key.Binding
Reload key.Binding
HalfUp key.Binding
HalfDown key.Binding
}
KeyMap defines all keybindings for the TUI.
type LinkFollowMsg ¶
LinkFollowMsg is sent when the user follows a link.
type LinkNavigator ¶
type LinkNavigator struct {
// contains filtered or unexported fields
}
LinkNavigator manages link following with history.
func NewLinkNavigator ¶
func NewLinkNavigator(graph *index.LinkGraph) *LinkNavigator
NewLinkNavigator creates a link navigator backed by a link graph.
func (*LinkNavigator) Back ¶
func (n *LinkNavigator) Back() *HistoryEntry
Back returns the previous history entry, or nil if at the beginning.
func (*LinkNavigator) BacklinksAt ¶
func (n *LinkNavigator) BacklinksAt(path string) []index.Link
BacklinksAt returns files linking to the given path.
func (*LinkNavigator) CloseLinks ¶
func (n *LinkNavigator) CloseLinks()
CloseLinks dismisses the link selection overlay.
func (*LinkNavigator) Current ¶
func (n *LinkNavigator) Current() *HistoryEntry
Current returns the current history entry, or nil if empty.
func (*LinkNavigator) Forward ¶
func (n *LinkNavigator) Forward() *HistoryEntry
Forward returns the next history entry, or nil if at the end.
func (*LinkNavigator) IsShowingLinks ¶
func (n *LinkNavigator) IsShowingLinks() bool
IsShowingLinks returns whether the link selection overlay is visible.
func (*LinkNavigator) LinkMoveDown ¶
func (n *LinkNavigator) LinkMoveDown()
LinkMoveDown moves the cursor down in the link selection overlay.
func (*LinkNavigator) LinkMoveUp ¶
func (n *LinkNavigator) LinkMoveUp()
LinkMoveUp moves the cursor up in the link selection overlay.
func (*LinkNavigator) LinkOverlayView ¶
func (n *LinkNavigator) LinkOverlayView() string
LinkOverlayView renders the link selection overlay.
func (*LinkNavigator) LinkSelect ¶
func (n *LinkNavigator) LinkSelect() (string, string)
LinkSelect returns the currently selected link target and fragment, then closes the overlay.
func (*LinkNavigator) LinksAt ¶
func (n *LinkNavigator) LinksAt(path string) []index.Link
LinksAt returns the forward links from the current file.
func (*LinkNavigator) Navigate ¶
func (n *LinkNavigator) Navigate(path string, scroll int)
Navigate pushes a new entry onto the history stack.
func (*LinkNavigator) ShowLinks ¶
func (n *LinkNavigator) ShowLinks(path string) (target, fragment string)
ShowLinks opens the link selection overlay for the given file. If there is exactly one link, it returns the target directly. Returns the single target or empty string if overlay is shown.
type LinkSelectMsg ¶
type LinkSelectMsg struct {
Target string
}
LinkSelectMsg is sent when the user picks a link from the overlay.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root Bubble Tea model for the TUI.
func New ¶
func New(cfg *config.Config, idx *index.Index, links *index.LinkGraph, plugins *plugin.Registry) *Model
New creates a new root TUI model.
func (*Model) SelectFile ¶
SelectFile pre-selects a file by relative path on startup. In single-file mode (1 non-dir entry), hides the file list and focuses the preview pane for full-width content viewing. The preview auto-loads via Init(). Must be called before Run().
func (*Model) SetRemoteInfo ¶
func (m *Model) SetRemoteInfo(info *RemoteInfo)
SetRemoteInfo updates the remote connection display state. Safe to call from any goroutine.
type NavigateMsg ¶
type NavigateMsg struct {
}
type PanelSelectMsg ¶
type PanelSelectMsg struct {
Path string // for backlinks/bookmarks: file to navigate to
Line int // for TOC: line to scroll to
Scroll int // for bookmarks: scroll position to restore
}
PanelSelectMsg is sent when the user selects an item in a side panel.
type PreviewLoadedMsg ¶
type PreviewModel ¶
type PreviewModel struct {
// contains filtered or unexported fields
}
PreviewModel renders file content in the preview pane.
func (*PreviewModel) CursorDown ¶
func (m *PreviewModel) CursorDown()
CursorDown moves the cursor down one line, scrolling when hitting the scrolloff margin.
func (*PreviewModel) CursorTo ¶
func (m *PreviewModel) CursorTo(line int)
CursorTo moves the cursor to a specific line, adjusting scroll.
func (*PreviewModel) CursorUp ¶
func (m *PreviewModel) CursorUp()
CursorUp moves the cursor up one line, scrolling when hitting the scrolloff margin.
func (*PreviewModel) EnterSearchMode ¶
func (m *PreviewModel) EnterSearchMode()
EnterSearchMode activates search input in the preview pane.
func (*PreviewModel) EnterVisualMode ¶
func (m *PreviewModel) EnterVisualMode()
EnterVisualMode starts line selection at the current cursor position.
func (*PreviewModel) ExitSearchMode ¶
func (m *PreviewModel) ExitSearchMode()
ExitSearchMode deactivates search input but keeps match highlights.
func (*PreviewModel) ExitVisualMode ¶
func (m *PreviewModel) ExitVisualMode()
ExitVisualMode clears selection.
func (*PreviewModel) NextMatch ¶
func (m *PreviewModel) NextMatch()
NextMatch advances to the next search match.
func (*PreviewModel) PrevMatch ¶
func (m *PreviewModel) PrevMatch()
PrevMatch goes to the previous search match.
func (*PreviewModel) ScrollDown ¶
func (m *PreviewModel) ScrollDown(lines int)
ScrollDown scrolls the preview down.
func (*PreviewModel) ScrollToBottom ¶
func (m *PreviewModel) ScrollToBottom()
ScrollToBottom scrolls to the end of content.
func (*PreviewModel) ScrollUp ¶
func (m *PreviewModel) ScrollUp(lines int)
ScrollUp scrolls the preview up.
func (*PreviewModel) SearchBackspace ¶
func (m *PreviewModel) SearchBackspace()
SearchBackspace removes the last character from the search query.
func (*PreviewModel) SearchHistoryDown ¶
func (m *PreviewModel) SearchHistoryDown()
SearchHistoryDown cycles to the next (more recent) search query.
func (*PreviewModel) SearchHistoryUp ¶
func (m *PreviewModel) SearchHistoryUp()
SearchHistoryUp cycles to the previous search query.
func (*PreviewModel) SearchInput ¶
func (m *PreviewModel) SearchInput(r rune)
SearchInput appends a character to the search query and recomputes matches.
func (*PreviewModel) SelectedSourceLines ¶
func (m *PreviewModel) SelectedSourceLines() (startLine, endLine int)
SelectedSourceLines returns the 1-based source line range for the visual selection. For code files (1:1 mapping), this is exact. For markdown, it's approximate.
func (*PreviewModel) SetContent ¶
func (m *PreviewModel) SetContent(path, content string)
SetContent updates the preview with rendered content.
func (*PreviewModel) SetSourceInfo ¶
func (m *PreviewModel) SetSourceInfo(lineCount int, isCode bool)
SetSourceInfo stores metadata about the source file for line mapping.
func (*PreviewModel) ToggleReadingGuide ¶
func (m *PreviewModel) ToggleReadingGuide()
ToggleReadingGuide toggles the full-row cursor highlight.
func (*PreviewModel) ToggleSearchRegex ¶
func (m *PreviewModel) ToggleSearchRegex()
ToggleSearchRegex toggles between substring and regex search modes.
func (PreviewModel) View ¶
func (m PreviewModel) View() string
View renders the preview content with line numbers.
func (*PreviewModel) VisualCursorDown ¶
func (m *PreviewModel) VisualCursorDown()
VisualCursorDown moves the visual cursor down.
func (*PreviewModel) VisualCursorUp ¶
func (m *PreviewModel) VisualCursorUp()
VisualCursorUp moves the visual cursor up.
type RemoteInfo ¶
type RemoteInfo struct {
Display string // "user@host:/path"
State string // "Connected", "Reconnecting", "Disconnected"
LastSync string // "5s ago", "syncing..."
}
RemoteInfo holds remote connection display state for the TUI.
type SidePanelModel ¶
type SidePanelModel struct {
// contains filtered or unexported fields
}
SidePanelModel manages the optional side panel (TOC, backlinks, etc.).
func NewSidePanelModel ¶
func NewSidePanelModel() SidePanelModel
NewSidePanelModel creates a side panel model.
func (*SidePanelModel) AddBookmark ¶
func (m *SidePanelModel) AddBookmark(bm Bookmark)
AddBookmark adds a bookmark.
func (*SidePanelModel) MoveDown ¶
func (m *SidePanelModel) MoveDown()
MoveDown moves the panel cursor down.
func (*SidePanelModel) RemoveBookmark ¶
func (m *SidePanelModel) RemoveBookmark(idx int)
RemoveBookmark removes a bookmark by index.
func (*SidePanelModel) Select ¶
func (m *SidePanelModel) Select() *PanelSelectMsg
Select returns information about the currently selected item.
func (*SidePanelModel) SetBacklinks ¶
func (m *SidePanelModel) SetBacklinks(links []index.Link)
SetBacklinks updates the backlinks list from the link graph.
func (*SidePanelModel) SetGitInfo ¶
func (m *SidePanelModel) SetGitInfo(repoRoot, filePath string)
SetGitInfo updates the git info panel content.
func (*SidePanelModel) SetTOC ¶
func (m *SidePanelModel) SetTOC(entries []TOCEntry)
SetTOC updates the table of contents entries.
func (*SidePanelModel) SetTOCFromMarkdown ¶
func (m *SidePanelModel) SetTOCFromMarkdown(source string)
SetTOCFromMarkdown extracts headings from raw markdown source and updates TOC.
func (*SidePanelModel) Toggle ¶
func (m *SidePanelModel) Toggle(pt PanelType)
Toggle switches between showing and hiding the given panel type.
func (*SidePanelModel) Type ¶
func (m *SidePanelModel) Type() PanelType
Type returns the current panel type.
func (*SidePanelModel) TypeName ¶
func (m *SidePanelModel) TypeName() string
TypeName returns a display name for the current panel type.
func (*SidePanelModel) Visible ¶
func (m *SidePanelModel) Visible() bool
Visible returns whether the side panel is currently shown.
type StatusBarModel ¶
type StatusBarModel struct {
// contains filtered or unexported fields
}
StatusBarModel renders the bottom status bar.
func NewStatusBarModel ¶
func NewStatusBarModel() StatusBarModel
NewStatusBarModel creates a status bar.
func (*StatusBarModel) SetFile ¶
func (m *StatusBarModel) SetFile(path string)
SetFile updates the displayed file path.
func (*StatusBarModel) SetMessage ¶
func (m *StatusBarModel) SetMessage(msg string)
SetMessage sets a temporary status message.
func (*StatusBarModel) SetMode ¶
func (m *StatusBarModel) SetMode(mode string)
SetMode sets the current input mode display.