panes

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

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

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

func NewEditor(theme *styles.Theme) Editor

NewEditor constructs an Editor with an initial glamour renderer. Call SetSize before the first render to give it accurate dimensions.

func (Editor) Init

func (e Editor) Init() tea.Cmd

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 (e *Editor) SetFocused(focused bool)

func (*Editor) SetNote

func (e *Editor) SetNote(note *notes.Note)

func (*Editor) SetSize

func (e *Editor) SetSize(width, height int)

func (*Editor) SplashView

func (e *Editor) SplashView(noteCount, tagCount int) string

SplashView returns a premium splash screen shown on first launch.

func (Editor) Update

func (e Editor) Update(msg tea.Msg) (Editor, tea.Cmd)

func (Editor) View

func (e Editor) View() string

type NoteItem

type NoteItem struct {
	Note *notes.Note
}

NoteItem wraps *notes.Note to satisfy the list.DefaultItem interface.

func (NoteItem) Description

func (n NoteItem) Description() string

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

func (n NoteItem) FilterValue() string

func (NoteItem) Title

func (n NoteItem) Title() string

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 struct {
	// contains filtered or unexported fields
}

Sidebar is the left-hand note list pane.

func NewSidebar

func NewSidebar(theme *styles.Theme, version string) Sidebar

NewSidebar constructs a Sidebar. Call SetSize before the first render.

func (Sidebar) Init

func (s Sidebar) Init() tea.Cmd

func (*Sidebar) SelectNoteByID

func (s *Sidebar) SelectNoteByID(id string)

func (Sidebar) SelectedNote

func (s Sidebar) SelectedNote() *notes.Note

func (*Sidebar) SetFocused

func (s *Sidebar) SetFocused(focused bool)

func (*Sidebar) SetNotes

func (s *Sidebar) SetNotes(noteSlice []*notes.Note)

func (*Sidebar) SetSize

func (s *Sidebar) SetSize(width, height int)

func (Sidebar) Update

func (s Sidebar) Update(msg tea.Msg) (Sidebar, tea.Cmd)

func (Sidebar) View

func (s Sidebar) View() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL