Documentation
¶
Index ¶
- Constants
- func FilterYAMLs(m ListModel) tea.Cmd
- func LoadYAML(md *yamldoc.YAMLDocument) tea.Cmd
- type Config
- type DocumentListRenderer
- type FetchedYAMLMsg
- type FilterState
- type FilteredYAMLMsg
- type KeyBinds
- type KeyHandler
- type ListModel
- func (m *ListModel) AddYAMLs(yamls ...*yamldoc.YAMLDocument)
- func (m ListModel) FilterApplied() bool
- func (m ListModel) IsLoading() bool
- func (m *ListModel) ResetFiltering()
- func (m *ListModel) SetSize(width, height int)
- func (m ListModel) Update(msg tea.Msg) (ListModel, tea.Cmd)
- func (m ListModel) View() string
- type PaginationRenderer
- type Section
- type SectionKey
- type ViewState
Constants ¶
const ( SectionDocuments = iota SectionFilter )
Variables ¶
This section is empty.
Functions ¶
func FilterYAMLs ¶
Types ¶
type Config ¶
type Config struct {
CommonModel *common.CommonModel
KeyBinds *KeyBinds
Compact bool
}
type DocumentListRenderer ¶
type DocumentListRenderer struct {
// contains filtered or unexported fields
}
DocumentListRenderer handles rendering of document lists.
func NewDocumentListRenderer ¶
func NewDocumentListRenderer(theme *themes.Theme, indent int, compact bool) *DocumentListRenderer
NewDocumentListRenderer creates a new document list renderer.
func (*DocumentListRenderer) GetItemHeight ¶
func (dlr *DocumentListRenderer) GetItemHeight() int
func (*DocumentListRenderer) RenderDocumentList ¶
func (dlr *DocumentListRenderer) RenderDocumentList(docs []*yamldoc.YAMLDocument, m ListModel) string
RenderDocumentList renders a list of documents with pagination and empty states.
func (*DocumentListRenderer) SetSize ¶
func (dlr *DocumentListRenderer) SetSize(width, height int)
type FetchedYAMLMsg ¶
type FetchedYAMLMsg *yamldoc.YAMLDocument
type FilterState ¶
type FilterState int
FilterState is the current filtering state in the file listing.
const ( Unfiltered FilterState = iota // No filter set. Filtering // User is actively setting a filter. FilterApplied // A filter is applied and user is not editing filter. )
type FilteredYAMLMsg ¶
type FilteredYAMLMsg []*yamldoc.YAMLDocument
type KeyBinds ¶
type KeyBinds struct {
Open *keys.KeyBind `json:"open,omitempty"`
Find *keys.KeyBind `json:"find,omitempty"`
Home *keys.KeyBind `json:"home,omitempty"`
End *keys.KeyBind `json:"end,omitempty"`
PageUp *keys.KeyBind `json:"pageUp,omitempty"`
PageDown *keys.KeyBind `json:"pageDown,omitempty"`
}
func (*KeyBinds) EnsureDefaults ¶
func (kb *KeyBinds) EnsureDefaults()
func (*KeyBinds) GetKeyBinds ¶
type KeyHandler ¶
type KeyHandler struct {
// contains filtered or unexported fields
}
KeyHandler provides key handling for list view.
func NewKeyHandler ¶
NewKeyHandler creates a new ListKeyHandler.
func (*KeyHandler) HandleDocumentBrowsing ¶
HandleDocumentBrowsing handles key events for document browsing in list view.
func (*KeyHandler) HandleFilteringMode ¶
HandleFilteringMode handles events when in filtering mode.
type ListModel ¶
type ListModel struct {
// The master set of yaml documents we're working with.
YAMLs []*yamldoc.YAMLDocument
ViewState ViewState
FilterState FilterState
ShowHelp bool
// contains filtered or unexported fields
}
func (*ListModel) AddYAMLs ¶
func (m *ListModel) AddYAMLs(yamls ...*yamldoc.YAMLDocument)
Adds yaml documents to the model.
func (ListModel) FilterApplied ¶
func (*ListModel) ResetFiltering ¶
func (m *ListModel) ResetFiltering()
type PaginationRenderer ¶
type PaginationRenderer struct {
// contains filtered or unexported fields
}
PaginationRenderer handles pagination display.
func NewPaginationRenderer ¶
func NewPaginationRenderer(theme *themes.Theme, width int) *PaginationRenderer
NewPaginationRenderer creates a new pagination renderer.
func (*PaginationRenderer) RenderPagination ¶
func (pr *PaginationRenderer) RenderPagination(paginatorModel *paginator.Model, totalPages int) string
RenderPagination renders pagination controls.