list

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SectionDocuments = iota
	SectionFilter
)

Variables

This section is empty.

Functions

func FilterYAMLs

func FilterYAMLs(m ListModel) tea.Cmd

func LoadYAML

func LoadYAML(md *yamls.Document) tea.Cmd

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(t *theme.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 []*yamls.Document, m ListModel) string

RenderDocumentList renders a list of documents with pagination and empty states.

type FetchedYAMLMsg

type FetchedYAMLMsg *yamls.Document

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 []*yamls.Document

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

func (kb *KeyBinds) GetKeyBinds() []keys.KeyBind

type KeyHandler

type KeyHandler struct {
	// contains filtered or unexported fields
}

KeyHandler provides key handling for list view.

func NewKeyHandler

func NewKeyHandler(kb *KeyBinds, ckb *common.KeyBinds, t *theme.Theme) *KeyHandler

NewKeyHandler creates a new ListKeyHandler.

func (*KeyHandler) HandleDocumentBrowsing

func (h *KeyHandler) HandleDocumentBrowsing(m ListModel, msg tea.KeyMsg) (ListModel, tea.Cmd)

HandleDocumentBrowsing handles key events for document browsing in list view.

func (*KeyHandler) HandleFilteringMode

func (h *KeyHandler) HandleFilteringMode(m ListModel, msg tea.Msg) (ListModel, tea.Cmd)

HandleFilteringMode handles events when in filtering mode.

type ListModel

type ListModel struct {

	// The master set of yaml documents we're working with.
	YAMLs []*yamls.Document

	ViewState ViewState

	FilterState FilterState

	ShowHelp bool
	// contains filtered or unexported fields
}

func NewModel

func NewModel(c Config) ListModel

func (*ListModel) AddYAMLs

func (m *ListModel) AddYAMLs(yaml ...*yamls.Document)

Adds yaml documents to the model.

func (ListModel) FilterApplied

func (m ListModel) FilterApplied() bool

func (ListModel) IsLoading

func (m ListModel) IsLoading() bool

Whether or not the spinner should be spinning.

func (*ListModel) ResetFiltering

func (m *ListModel) ResetFiltering()

func (*ListModel) SetSize

func (m *ListModel) SetSize(width, height int)

func (ListModel) Update

func (m ListModel) Update(msg tea.Msg) (ListModel, tea.Cmd)

func (ListModel) View

func (m ListModel) View() string

type PaginationRenderer

type PaginationRenderer struct {
	// contains filtered or unexported fields
}

PaginationRenderer handles pagination display.

func NewPaginationRenderer

func NewPaginationRenderer(t *theme.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.

type Section

type Section struct {
	// contains filtered or unexported fields
}

Section contains definitions and state information for displaying a tab and its contents in the file listing view.

type SectionKey

type SectionKey int

The types of documents we are currently showing to the user.

type ViewState

type ViewState int

ViewState is the high-level state of the file listing.

const (
	StateReady ViewState = iota
)

Jump to

Keyboard shortcuts

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