Documentation
¶
Index ¶
- type CodeEditor
- func (ce CodeEditor) GetCategory() int
- func (ce CodeEditor) GetFocusedField() int
- func (ce CodeEditor) GetTags() []int
- func (ce CodeEditor) GetValues() (title, language, description, code string)
- func (ce CodeEditor) IsCancelFocused() bool
- func (ce CodeEditor) IsOnTextInput() bool
- func (ce CodeEditor) IsSaveFocused() bool
- func (ce *CodeEditor) NextField() tea.Cmd
- func (ce *CodeEditor) PrevField() tea.Cmd
- func (ce *CodeEditor) SetCategory(id int, name string)
- func (ce *CodeEditor) SetTags(ids []int, names []string)
- func (ce *CodeEditor) SetValues(title, language, description, code string)
- func (ce *CodeEditor) Update(msg tea.Msg) (CodeEditor, tea.Cmd)
- func (ce CodeEditor) View() string
- type CodeViewer
- type ConfirmDialog
- type FocusChangedMsg
- type FormView
- type HelpItem
- type HelpSection
- type HelpView
- type MenuItem
- type MenuView
- type SearchableTableView
- func (stv SearchableTableView) GetSearchQuery() string
- func (stv SearchableTableView) IsSearchActive() bool
- func (stv SearchableTableView) SelectedRow() table.Row
- func (stv *SearchableTableView) SetRows(rows []table.Row)
- func (stv *SearchableTableView) ToggleSearch()
- func (stv *SearchableTableView) Update(msg tea.Msg) (SearchableTableView, tea.Cmd)
- func (stv SearchableTableView) View() string
- type SelectorView
- func (sv SelectorView) GetSelectedID() int
- func (sv SelectorView) GetSelectedIDs() []int
- func (sv SelectorView) IsSelected(id int) bool
- func (sv *SelectorView) SetRows(rows []table.Row)
- func (sv *SelectorView) SetSelected(ids []int)
- func (sv *SelectorView) ToggleSelection(id int)
- func (sv *SelectorView) Update(msg tea.Msg) (SelectorView, tea.Cmd)
- func (sv *SelectorView) UpdateCheckboxDisplay()
- func (sv SelectorView) View() string
- type TabModel
- type TabStyles
- type TableView
- type Tabs
- type ViewportResizeMsg
- type ViewportTab
- func (v *ViewportTab) ClearMessages()
- func (v *ViewportTab) GotoBottom()
- func (v *ViewportTab) GotoTop()
- func (v ViewportTab) HandleResize(msg ViewportResizeMsg) (ViewportTab, tea.Cmd)
- func (v ViewportTab) Height() int
- func (v ViewportTab) Init() tea.Cmd
- func (v ViewportTab) IsReady() bool
- func (v ViewportTab) RenderMessages() string
- func (v ViewportTab) ScrollPercent() float64
- func (v *ViewportTab) SetContent(content string)
- func (v *ViewportTab) SetError(msg string)
- func (v *ViewportTab) SetSuccess(msg string)
- func (v *ViewportTab) SetYOffset(offset int)
- func (v ViewportTab) TotalLines() int
- func (v ViewportTab) UpdateViewport(msg tea.Msg) (ViewportTab, tea.Cmd)
- func (v ViewportTab) View() string
- func (v ViewportTab) Width() int
- func (v ViewportTab) YOffset() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeEditor ¶
type CodeEditor struct {
// contains filtered or unexported fields
}
CodeEditor provides a multi-input form for creating/editing code snippets.
func NewCodeEditor ¶
func NewCodeEditor(width, height int) CodeEditor
NewCodeEditor creates a new code editor form.
func (CodeEditor) GetCategory ¶
func (ce CodeEditor) GetCategory() int
GetCategory returns the category ID.
func (CodeEditor) GetFocusedField ¶
func (ce CodeEditor) GetFocusedField() int
GetFocusedField returns the currently focused field index.
func (CodeEditor) GetValues ¶
func (ce CodeEditor) GetValues() (title, language, description, code string)
GetValues returns all field values.
func (CodeEditor) IsCancelFocused ¶
func (ce CodeEditor) IsCancelFocused() bool
IsCancelFocused returns true if Cancel button is focused.
func (CodeEditor) IsOnTextInput ¶
func (ce CodeEditor) IsOnTextInput() bool
IsOnTextInput returns true if focus is on a text input field (not buttons).
func (CodeEditor) IsSaveFocused ¶
func (ce CodeEditor) IsSaveFocused() bool
IsSaveFocused returns true if Save button is focused.
func (*CodeEditor) NextField ¶
func (ce *CodeEditor) NextField() tea.Cmd
NextField moves focus to the next input field.
func (*CodeEditor) PrevField ¶
func (ce *CodeEditor) PrevField() tea.Cmd
PrevField moves focus to the previous input field.
func (*CodeEditor) SetCategory ¶
func (ce *CodeEditor) SetCategory(id int, name string)
SetCategory sets the category for the snippet.
func (*CodeEditor) SetTags ¶
func (ce *CodeEditor) SetTags(ids []int, names []string)
SetTags sets the tags for the snippet.
func (*CodeEditor) SetValues ¶
func (ce *CodeEditor) SetValues(title, language, description, code string)
SetValues populates the editor with existing snippet data.
func (*CodeEditor) Update ¶
func (ce *CodeEditor) Update(msg tea.Msg) (CodeEditor, tea.Cmd)
Update handles input for the code editor.
type CodeViewer ¶
type CodeViewer struct {
// contains filtered or unexported fields
}
CodeViewer displays a snippet's code with syntax highlighting and line numbers.
func NewCodeViewer ¶
func NewCodeViewer(title, language, description, code string, width int) CodeViewer
NewCodeViewer creates a new code viewer.
type ConfirmDialog ¶
type ConfirmDialog struct {
// contains filtered or unexported fields
}
func NewConfirmDialog ¶
func NewConfirmDialog(title, message, warning string) ConfirmDialog
func (ConfirmDialog) IsYes ¶
func (c ConfirmDialog) IsYes() bool
func (*ConfirmDialog) SelectNo ¶
func (c *ConfirmDialog) SelectNo()
func (*ConfirmDialog) SelectYes ¶
func (c *ConfirmDialog) SelectYes()
func (ConfirmDialog) View ¶
func (c ConfirmDialog) View() string
type FocusChangedMsg ¶
type FocusChangedMsg struct {
FocusedField int
FieldLine int // Approximate line number of the field
}
FocusChangedMsg is sent when focus changes to request viewport scroll.
type FormView ¶
type FormView struct {
// contains filtered or unexported fields
}
func NewFormView ¶
type HelpSection ¶
type HelpView ¶
type HelpView struct {
// contains filtered or unexported fields
}
func NewHelpView ¶
func NewHelpView(title string, sections []HelpSection) HelpView
type MenuView ¶
type MenuView struct {
// contains filtered or unexported fields
}
func NewMenuView ¶
func (MenuView) GetSelection ¶
type SearchableTableView ¶
type SearchableTableView struct {
// contains filtered or unexported fields
}
SearchableTableView is a table component with integrated search functionality. It provides real-time filtering as the user types.
func NewSearchableTableView ¶
func NewSearchableTableView(columns []table.Column, title, emptyMsg, actionHint string, height int) SearchableTableView
NewSearchableTableView creates a new searchable table view.
func (SearchableTableView) GetSearchQuery ¶
func (stv SearchableTableView) GetSearchQuery() string
GetSearchQuery returns the current search query.
func (SearchableTableView) IsSearchActive ¶
func (stv SearchableTableView) IsSearchActive() bool
IsSearchActive returns whether search mode is active.
func (SearchableTableView) SelectedRow ¶
func (stv SearchableTableView) SelectedRow() table.Row
SelectedRow returns the currently selected row.
func (*SearchableTableView) SetRows ¶
func (stv *SearchableTableView) SetRows(rows []table.Row)
SetRows sets all rows and resets search filter.
func (*SearchableTableView) ToggleSearch ¶
func (stv *SearchableTableView) ToggleSearch()
ToggleSearch enables/disables search mode.
func (*SearchableTableView) Update ¶
func (stv *SearchableTableView) Update(msg tea.Msg) (SearchableTableView, tea.Cmd)
Update handles messages and updates state.
func (SearchableTableView) View ¶
func (stv SearchableTableView) View() string
View renders the searchable table.
type SelectorView ¶
type SelectorView struct {
// contains filtered or unexported fields
}
SelectorView provides a searchable selection interface for categories or tags. Can be used for single selection (category) or multi-selection (tags).
func NewSelectorView ¶
func NewSelectorView(title, subtitle string, multiSelect bool, width, height int) SelectorView
NewSelectorView creates a new selector view. multiSelect: true for tags (can select multiple), false for category (single selection)
func (SelectorView) GetSelectedID ¶
func (sv SelectorView) GetSelectedID() int
GetSelectedID returns the currently focused ID (single-select only)
func (SelectorView) GetSelectedIDs ¶
func (sv SelectorView) GetSelectedIDs() []int
GetSelectedIDs returns all selected IDs (multi-select only)
func (SelectorView) IsSelected ¶
func (sv SelectorView) IsSelected(id int) bool
IsSelected checks if an ID is selected
func (*SelectorView) SetRows ¶
func (sv *SelectorView) SetRows(rows []table.Row)
SetRows sets the data rows for the selector.
func (*SelectorView) SetSelected ¶
func (sv *SelectorView) SetSelected(ids []int)
SetSelected pre-selects items (for editing existing snippet)
func (*SelectorView) ToggleSelection ¶
func (sv *SelectorView) ToggleSelection(id int)
ToggleSelection toggles the selection state of the current row (multi-select only)
func (*SelectorView) Update ¶
func (sv *SelectorView) Update(msg tea.Msg) (SelectorView, tea.Cmd)
Update handles input for the selector.
func (*SelectorView) UpdateCheckboxDisplay ¶
func (sv *SelectorView) UpdateCheckboxDisplay()
UpdateCheckboxDisplay updates the checkbox column for all rows
type TabStyles ¶
type TabStyles struct {
InactiveTabBorder lipgloss.Border
ActiveTabBorder lipgloss.Border
Doc lipgloss.Style
HighlightColor lipgloss.AdaptiveColor
InactiveTab lipgloss.Style
ActiveTab lipgloss.Style
Window lipgloss.Style
ContentPadding lipgloss.Style
ModeIndicator lipgloss.Style
InteractiveMode lipgloss.Style
}
TabStyles contains all styling configuration for the tabs component.
func DefaultTabStyles ¶
func DefaultTabStyles() *TabStyles
DefaultTabStyles creates the default styling configuration.
type TableView ¶
type TableView struct {
// contains filtered or unexported fields
}
TableView represents a reusable table component with actions
func NewTableView ¶
NewTableView creates a new table view
func (*TableView) SelectedRow ¶
type Tabs ¶
type Tabs struct {
// contains filtered or unexported fields
}
Tabs represents the main tabbed interface component.
func (*Tabs) EnableDebug ¶
func (*Tabs) SetLabelWidth ¶
type ViewportResizeMsg ¶
ViewportResizeMsg is sent to tabs when viewport dimensions change
type ViewportTab ¶
type ViewportTab struct {
// contains filtered or unexported fields
}
ViewportTab provides viewport management and message handling for tabs. Embed this in your tab structs to get scrolling and message functionality.
func (*ViewportTab) ClearMessages ¶
func (v *ViewportTab) ClearMessages()
ClearMessages clears both error and success messages.
func (*ViewportTab) GotoBottom ¶
func (v *ViewportTab) GotoBottom()
GotoBottom scrolls to the bottom of the viewport.
func (*ViewportTab) GotoTop ¶
func (v *ViewportTab) GotoTop()
GotoTop scrolls to the top of the viewport.
func (ViewportTab) HandleResize ¶
func (v ViewportTab) HandleResize(msg ViewportResizeMsg) (ViewportTab, tea.Cmd)
HandleResize handles viewport resize messages. Call this at the start of your Update method.
func (ViewportTab) IsReady ¶
func (v ViewportTab) IsReady() bool
IsReady returns true if viewport is initialized.
func (ViewportTab) RenderMessages ¶
func (v ViewportTab) RenderMessages() string
RenderMessages returns formatted error/success messages.
func (ViewportTab) ScrollPercent ¶
func (v ViewportTab) ScrollPercent() float64
ScrollPercent returns the current scroll percentage (0-1).
func (*ViewportTab) SetContent ¶
func (v *ViewportTab) SetContent(content string)
SetContent sets the viewport content.
func (*ViewportTab) SetError ¶
func (v *ViewportTab) SetError(msg string)
SetError sets an error message to display.
func (*ViewportTab) SetSuccess ¶
func (v *ViewportTab) SetSuccess(msg string)
SetSuccess sets a success message to display.
func (*ViewportTab) SetYOffset ¶
func (v *ViewportTab) SetYOffset(offset int)
SetYOffset sets the vertical scroll offset.
func (ViewportTab) TotalLines ¶
func (v ViewportTab) TotalLines() int
TotalLines returns the total number of lines in the content. Note: This is an approximation based on scroll percent.
func (ViewportTab) UpdateViewport ¶
func (v ViewportTab) UpdateViewport(msg tea.Msg) (ViewportTab, tea.Cmd)
UpdateViewport updates the viewport for scrolling. Call this at the end of your Update method to handle scroll keys.
func (ViewportTab) View ¶
func (v ViewportTab) View() string
View returns the viewport view or loading message.
func (ViewportTab) YOffset ¶
func (v ViewportTab) YOffset() int
YOffset returns the current vertical scroll offset.