Documentation
¶
Overview ¶
Package panes provides the individual UI pane components for NeuronCLI: the sidebar note list, the markdown editor/preview, and the search bar.
Index ¶
- type Editor
- func (e Editor) Init() tea.Cmd
- func (e *Editor) RefreshNote()
- func (e *Editor) SetFocused(focused bool)
- func (e *Editor) SetNote(note *notes.Note)
- func (e *Editor) SetSize(width, height int)
- func (e *Editor) SplashView(noteCount, tagCount int) string
- func (e Editor) Update(msg tea.Msg) (Editor, tea.Cmd)
- func (e Editor) View() string
- type NoteItem
- type SearchClearMsg
- type SearchPane
- type SearchQueryMsg
- type Sidebar
- func (s Sidebar) Init() tea.Cmd
- func (s *Sidebar) SelectNoteByID(id string)
- func (s Sidebar) SelectedNote() *notes.Note
- func (s *Sidebar) SetFocused(focused bool)
- func (s *Sidebar) SetNotes(noteSlice []*notes.Note)
- func (s *Sidebar) SetSize(width, height int)
- func (s Sidebar) Update(msg tea.Msg) (Sidebar, tea.Cmd)
- func (s Sidebar) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
Editor is the right-hand preview pane. It renders the selected note's content as formatted markdown inside a scrollable viewport.
func NewEditor ¶
NewEditor constructs an Editor with an initial glamour renderer. Call SetSize before the first render to give it accurate dimensions.
func (*Editor) RefreshNote ¶
func (e *Editor) RefreshNote()
RefreshNote force-re-renders the current note content into the viewport. Call this after the underlying file has been modified externally (e.g. paste).
func (*Editor) SetFocused ¶
func (*Editor) SplashView ¶
SplashView returns a premium splash screen shown on first launch.
type NoteItem ¶
NoteItem wraps *notes.Note to satisfy the list.DefaultItem interface.
func (NoteItem) Description ¶
Description returns a compact secondary line containing up to three tags and a human-readable relative timestamp, e.g. "#go #tui • 3h ago".
func (NoteItem) FilterValue ¶
type SearchClearMsg ¶
type SearchClearMsg struct{}
SearchClearMsg is emitted when the user presses Escape; restores the full list.
type SearchPane ¶
type SearchPane struct {
// contains filtered or unexported fields
}
SearchPane is the bottom search bar. Inactive it shows "/ to search"; active it captures input and emits SearchQueryMsg or SearchClearMsg.
func NewSearchPane ¶
func NewSearchPane(theme *styles.Theme) SearchPane
NewSearchPane creates a SearchPane with a styled textinput.
func (SearchPane) Init ¶
func (s SearchPane) Init() tea.Cmd
func (SearchPane) Query ¶
func (s SearchPane) Query() string
func (*SearchPane) SetActive ¶
func (s *SearchPane) SetActive(active bool)
func (*SearchPane) SetQuery ¶
func (s *SearchPane) SetQuery(q string)
func (*SearchPane) SetWidth ¶
func (s *SearchPane) SetWidth(w int)
func (SearchPane) Update ¶
func (s SearchPane) Update(msg tea.Msg) (SearchPane, tea.Cmd)
func (SearchPane) View ¶
func (s SearchPane) View() string
type SearchQueryMsg ¶
type SearchQueryMsg struct {
Query string
Live bool // true = real-time update while typing; false = confirmed with Enter
}
SearchQueryMsg is emitted when the user types (Live=true) or presses Enter (Live=false). When Live is false the app should move focus to the sidebar so the user can navigate the filtered results with arrow keys.
type Sidebar ¶
type Sidebar struct {
// contains filtered or unexported fields
}
Sidebar is the left-hand note list pane.
func NewSidebar ¶
NewSidebar constructs a Sidebar. Call SetSize before the first render.