components

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HorizontalLoader

func HorizontalLoader(width int, frame int, message string) string

HorizontalLoader creates a simple horizontal loading bar for inline use

func MatchesQuery

func MatchesQuery(text, query string) bool

MatchesQuery checks if a string matches the search query (case-insensitive)

Types

type Dialog

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

Dialog represents a modal dialog component

func NewDialog

func NewDialog() *Dialog

NewDialog creates a new dialog component

func (*Dialog) Hide

func (d *Dialog) Hide()

Hide hides the dialog

func (*Dialog) IsVisible

func (d *Dialog) IsVisible() bool

IsVisible returns whether the dialog is visible

func (*Dialog) ShowConfirm

func (d *Dialog) ShowConfirm(title, message, action string, ctx interface{})

ShowConfirm shows a confirmation dialog

func (*Dialog) ShowEditRequest

func (d *Dialog) ShowEditRequest(node *TreeNode)

ShowEditRequest shows an edit request dialog with existing values

func (*Dialog) ShowInput

func (d *Dialog) ShowInput(title, message, defaultValue, action string, ctx interface{})

ShowInput shows an input dialog

func (*Dialog) ShowKeyValue

func (d *Dialog) ShowKeyValue(title, defaultKey, defaultValue, action string, ctx interface{})

ShowKeyValue shows a key-value input dialog

func (*Dialog) ShowNewRequest

func (d *Dialog) ShowNewRequest(action string, node *TreeNode)

ShowNewRequest shows a new request dialog with method selector and URL

func (*Dialog) Update

func (d *Dialog) Update(msg tea.Msg) (*Dialog, tea.Cmd)

Update handles messages for the dialog

func (*Dialog) View

func (d *Dialog) View(screenWidth, screenHeight int) string

View renders the dialog

type DialogResultMsg

type DialogResultMsg struct {
	Action    string
	Confirmed bool
	Value     string
	Method    string // HTTP method for new request
	URL       string // URL endpoint for new request / Value for key-value dialogs
	Node      *TreeNode
	Context   interface{} // Generic context for callbacks
}

DialogResultMsg is sent when a dialog is completed

type DialogType

type DialogType int

DialogType represents the type of dialog

const (
	DialogInput DialogType = iota
	DialogConfirm
	DialogNewRequest
	DialogEditRequest
	DialogKeyValue // For key-value input (Request panel)
)

type Editor

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

Editor is a vim-like text editor component with line numbers

func NewEditor

func NewEditor(content string, syntaxType string) *Editor

NewEditor creates a new editor component

func (*Editor) CanRedo

func (e *Editor) CanRedo() bool

CanRedo returns true if there are states to redo

func (*Editor) CanUndo

func (e *Editor) CanUndo() bool

CanUndo returns true if there are states to undo

func (*Editor) EnableExternalEditor added in v1.2.0

func (e *Editor) EnableExternalEditor(enabled bool)

EnableExternalEditor enables external editor support for this editor

func (*Editor) FormatJSON

func (e *Editor) FormatJSON() tea.Cmd

FormatJSON formats the content as JSON with proper indentation

func (*Editor) GetContent

func (e *Editor) GetContent() string

GetContent returns the editor content as a single string

func (*Editor) GetCursorPosition

func (e *Editor) GetCursorPosition() (row, col int)

GetCursorPosition returns the current cursor row and column

func (*Editor) GetExternalEditorField added in v1.2.0

func (e *Editor) GetExternalEditorField() api.EditableField

GetExternalEditorField returns the field type for external editing

func (*Editor) GetMatchCount

func (e *Editor) GetMatchCount() (int, int)

GetMatchCount returns (currentMatch, totalMatches)

func (*Editor) GetMode

func (e *Editor) GetMode() EditorMode

GetMode returns the current editor mode

func (*Editor) GetPreviewContent

func (e *Editor) GetPreviewContent() string

GetPreviewContent returns content with variables replaced (for preview) System variables ($timestamp, $uuid, etc.) are always resolved in preview mode, even when no environment variables are set

func (*Editor) HasSearchQuery

func (e *Editor) HasSearchQuery() bool

HasSearchQuery returns true if there's an active search query

func (*Editor) IsExternalEditorEnabled added in v1.2.0

func (e *Editor) IsExternalEditorEnabled() bool

IsExternalEditorEnabled returns whether external editor is enabled

func (*Editor) IsPreviewMode

func (e *Editor) IsPreviewMode() bool

IsPreviewMode returns true if preview mode is active

func (*Editor) IsSearching

func (e *Editor) IsSearching() bool

IsSearching returns true if search input is visible

func (*Editor) SetContent

func (e *Editor) SetContent(content string)

SetContent sets the editor content

func (*Editor) SetCursorPosition

func (e *Editor) SetCursorPosition(row, col int)

SetCursorPosition sets the cursor to the specified row and column

func (*Editor) SetExternalEditorField added in v1.2.0

func (e *Editor) SetExternalEditorField(field api.EditableField)

SetExternalEditorField sets which field this editor represents for external editing

func (*Editor) SetHeight

func (e *Editor) SetHeight(h int)

SetHeight sets the visible height

func (*Editor) SetReadOnly

func (e *Editor) SetReadOnly(readOnly bool)

SetReadOnly sets whether the editor is read-only

func (*Editor) SetVariableValues

func (e *Editor) SetVariableValues(values map[string]string)

SetVariableValues sets the variable values for preview mode

func (*Editor) TogglePreviewMode

func (e *Editor) TogglePreviewMode()

TogglePreviewMode toggles the preview mode on/off

func (*Editor) Update

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

Update handles editor messages

func (*Editor) View

func (e *Editor) View(width, height int, active bool) string

View renders the editor

type EditorContentChangedMsg

type EditorContentChangedMsg struct {
	Content string
}

EditorContentChangedMsg is sent when editor content is modified

type EditorErrorType added in v1.2.0

type EditorErrorType string

EditorErrorType categorizes editor errors

const (
	EditorErrorNoEditor    EditorErrorType = "no_editor"
	EditorErrorNotFound    EditorErrorType = "not_found"
	EditorErrorTempFile    EditorErrorType = "temp_file"
	EditorErrorProcess     EditorErrorType = "process"
	EditorErrorReadContent EditorErrorType = "read_content"
)

type EditorFormatMsg

type EditorFormatMsg struct {
	Success bool
	Error   string
}

EditorFormatMsg is sent when JSON is formatted

type EditorMode

type EditorMode int

EditorMode represents the current editing mode

const (
	EditorNormalMode EditorMode = iota
	EditorInsertMode
)

type EditorQuitMsg

type EditorQuitMsg struct{}

EditorQuitMsg is sent when user presses Q in NORMAL mode to quit the app

type EditorState

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

EditorState represents a snapshot of editor state for undo/redo

type ExternalEditorErrorMsg added in v1.2.0

type ExternalEditorErrorMsg struct {
	// Field that was being edited
	Field api.EditableField

	// Err describes what went wrong
	Err error

	// ErrorType categorizes the error
	ErrorType EditorErrorType
}

ExternalEditorErrorMsg indicates editor could not be opened

type ExternalEditorFinishedMsg added in v1.2.0

type ExternalEditorFinishedMsg struct {
	// Field that was edited
	Field api.EditableField

	// Content is the new content (if successful)
	Content string

	// OriginalContent for comparison
	OriginalContent string

	// Changed indicates if content was modified
	Changed bool

	// Err is non-nil if an error occurred
	Err error

	// Duration is how long the editor was open
	Duration time.Duration
}

ExternalEditorFinishedMsg indicates editor has closed

type ExternalEditorRequestMsg added in v1.2.0

type ExternalEditorRequestMsg struct {
	// Field to edit (body or headers)
	Field api.EditableField

	// Content is the current content to edit
	Content string

	// ContentType is the detected or specified content type
	ContentType api.ContentType
}

ExternalEditorRequestMsg requests opening an external editor

type FormField

type FormField struct {
	Name        string
	Label       string
	Value       string
	Type        string   // "text", "checkbox", "radio"
	Options     []string // For radio buttons
	Placeholder string
	CursorPos   int // Cursor position for text fields
}

FormField represents a field in a form modal

type KeyBinding

type KeyBinding struct {
	Key  string
	Desc string
}

KeyBinding represents a single keybinding with its description

type KeyContext

type KeyContext string

KeyContext represents a context with its keybindings

const (
	ContextGlobal            KeyContext = "global"
	ContextNormalCollections KeyContext = "normal_collections"
	ContextNormalEnv         KeyContext = "normal_env"
	ContextNormalRequest     KeyContext = "normal_request"
	ContextNormalResponse    KeyContext = "normal_response"
	ContextSearchCollections KeyContext = "search_collections"
	ContextSearchEnv         KeyContext = "search_env"
	ContextInsert            KeyContext = "insert"
	ContextView              KeyContext = "view"
	ContextCommand           KeyContext = "command"
	ContextDialog            KeyContext = "dialog"
	ContextModal             KeyContext = "modal"
	// Request panel tab contexts
	ContextRequestParams  KeyContext = "request_params"
	ContextRequestAuth    KeyContext = "request_auth"
	ContextRequestHeaders KeyContext = "request_headers"
	ContextRequestBody    KeyContext = "request_body"
	ContextRequestScripts KeyContext = "request_scripts"
	// Response panel tab contexts
	ContextConsole KeyContext = "console"
	// Jump mode context
	ContextJump KeyContext = "jump"
)

type KeyGroup

type KeyGroup struct {
	Name     string
	Bindings []KeyBinding
}

KeyGroup represents a group of related keybindings

type KeyValuePair

type KeyValuePair struct {
	Key     string
	Value   string
	Enabled bool
}

KeyValuePair represents a key-value pair with enabled state

type Loader

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

Loader is an animated loading indicator component

func NewLoader

func NewLoader(style LoaderStyle, message string) *Loader

NewLoader creates a new loader component

func (*Loader) IsActive

func (l *Loader) IsActive() bool

IsActive returns whether the loader is active

func (*Loader) SetMessage

func (l *Loader) SetMessage(msg string)

SetMessage updates the loader message

func (*Loader) SetWidth

func (l *Loader) SetWidth(w int)

SetWidth sets the width for bar-style loaders

func (*Loader) Start

func (l *Loader) Start() tea.Cmd

Start begins the loader animation

func (*Loader) Stop

func (l *Loader) Stop()

Stop stops the loader animation

func (*Loader) Update

func (l *Loader) Update(msg tea.Msg) (*Loader, tea.Cmd)

Update handles loader animation

func (*Loader) View

func (l *Loader) View() string

View renders the loader

type LoaderStyle

type LoaderStyle int

LoaderStyle represents different loader animation styles

const (
	LoaderSpinner LoaderStyle = iota
	LoaderDots
	LoaderBar
	LoaderPulse
)

type LoaderTickMsg

type LoaderTickMsg time.Time

LoaderTickMsg is sent to animate the loader

type Modal struct {
	Title       string
	Message     string
	Type        ModalType
	Tag         string // Identifier for this modal
	Visible     bool
	Fields      []FormField
	FocusIndex  int
	ConfirmText string
	CancelText  string
	Width       int
	Height      int
}

Modal represents a modal dialog

func NewConfirmModal

func NewConfirmModal(title, message, tag string) *Modal

NewConfirmModal creates a confirmation modal

func NewFormModal

func NewFormModal(title, tag string, fields []FormField) *Modal

NewFormModal creates a form modal with multiple fields

func NewInputModal

func NewInputModal(title, label, placeholder, tag string) *Modal

NewInputModal creates a single input modal

func (*Modal) GetFieldValue

func (m *Modal) GetFieldValue(name string) string

GetFieldValue gets a field value by name

func (*Modal) Hide

func (m *Modal) Hide()

Hide hides the modal

func (*Modal) IsVisible

func (m *Modal) IsVisible() bool

IsVisible returns whether the modal is visible

func (*Modal) SetFieldValue

func (m *Modal) SetFieldValue(name, value string)

SetFieldValue sets a field value by name

func (*Modal) Show

func (m *Modal) Show()

Show displays the modal

func (*Modal) Update

func (m *Modal) Update(msg tea.Msg) (*Modal, tea.Cmd)

Update handles messages for the modal

func (*Modal) View

func (m *Modal) View(screenWidth, screenHeight int) string

View renders the modal

type ModalCloseMsg

type ModalCloseMsg struct {
	Result ModalResult
	Tag    string // Identifier for which modal closed
}

ModalCloseMsg is sent when a modal is closed

type ModalResult

type ModalResult struct {
	Confirmed bool
	Values    map[string]interface{}
}

ModalResult represents the result of a modal action

type ModalType

type ModalType int

ModalType represents the type of modal

const (
	ModalConfirm ModalType = iota
	ModalInput
	ModalForm
)

type NodeType

type NodeType int

NodeType represents the type of tree node

const (
	CollectionNode NodeType = iota
	FolderNode
	RequestNode
)

type SearchCloseMsg

type SearchCloseMsg struct {
	Canceled bool
}

SearchCloseMsg is sent when search is closed

type SearchInput

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

SearchInput represents a search input field

func NewSearchInput

func NewSearchInput() *SearchInput

NewSearchInput creates a new search input

func (*SearchInput) Clear

func (s *SearchInput) Clear()

Clear clears the search query

func (*SearchInput) GetQuery

func (s *SearchInput) GetQuery() string

GetQuery returns current search query

func (*SearchInput) Hide

func (s *SearchInput) Hide()

Hide hides the search input

func (*SearchInput) IsVisible

func (s *SearchInput) IsVisible() bool

IsVisible returns visibility state

func (*SearchInput) Show

func (s *SearchInput) Show()

Show displays the search input

func (*SearchInput) Update

func (s *SearchInput) Update(msg tea.Msg) (*SearchInput, tea.Cmd)

Update handles input messages

func (*SearchInput) View

func (s *SearchInput) View(width int) string

View renders the search input inline (for panel header)

func (*SearchInput) ViewBox

func (s *SearchInput) ViewBox(width int) string

ViewBox renders the search as a box at the top of content (legacy - use ViewCompact instead)

func (*SearchInput) ViewCompact

func (s *SearchInput) ViewCompact(width int, matchCount int, totalCount int) string

ViewCompact renders a compact inline search bar with match count (no border)

type SearchMatch

type SearchMatch struct {
	Row      int // Line number (0-indexed)
	ColStart int // Start column
	ColEnd   int // End column (exclusive)
}

SearchMatch represents a match position in the editor

type SearchUpdateMsg

type SearchUpdateMsg struct {
	Query string
}

SearchUpdateMsg is sent when search query changes

type Tab

type Tab struct {
	Name   string
	Active bool
}

Tab represents a single tab

type TabItem

type TabItem struct {
	Name     string
	Shortcut string // e.g., "Shift+1"
}

TabItem represents a tab with optional shortcut

type Table

type Table struct {
	Headers []string
	Rows    []KeyValuePair
	Cursor  int
	Editing bool
	EditCol int // 0 for key, 1 for value
}

Table represents an editable table component

func NewTable

func NewTable(headers []string) *Table

NewTable creates a new table

func (*Table) AddRow

func (t *Table) AddRow(key, value string)

AddRow adds a new row to the table (enabled by default)

func (*Table) AddRowWithState

func (t *Table) AddRowWithState(key, value string, enabled bool)

AddRowWithState adds a new row with specific enabled state

func (*Table) DeleteRow

func (t *Table) DeleteRow(index int)

DeleteRow removes a row from the table

func (*Table) FromMap

func (t *Table) FromMap(data map[string]string)

FromMap populates table from a map

func (*Table) GetRows

func (t *Table) GetRows() [][]string

GetRows returns all rows as a slice of string slices [key, value]

func (*Table) GetSelectedIndex

func (t *Table) GetSelectedIndex() int

GetSelectedIndex returns the current cursor position

func (*Table) MoveDown

func (t *Table) MoveDown()

MoveDown moves cursor down

func (*Table) MoveUp

func (t *Table) MoveUp()

MoveUp moves cursor up

func (*Table) RowCount

func (t *Table) RowCount() int

RowCount returns the number of rows in the table

func (*Table) ToMap

func (t *Table) ToMap() map[string]string

ToMap converts table rows to a map

func (*Table) ToggleCurrentEnabled

func (t *Table) ToggleCurrentEnabled()

ToggleCurrentEnabled toggles the enabled state of the current row

func (*Table) ToggleEdit

func (t *Table) ToggleEdit()

ToggleEdit toggles edit mode

func (*Table) ToggleEnabled

func (t *Table) ToggleEnabled(index int)

ToggleEnabled toggles the enabled state of a row

func (*Table) View

func (t *Table) View(width, height int) string

View renders the table

func (*Table) ViewSimple

func (t *Table) ViewSimple() string

ViewSimple renders a simple table view

type Tabs

type Tabs struct {
	Items       []string
	Shortcuts   []string // Keyboard shortcuts for each tab
	ActiveIndex int
}

Tabs represents a tab bar component

func NewTabs

func NewTabs(items []string) *Tabs

NewTabs creates a new tabs component

func NewTabsWithShortcuts

func NewTabsWithShortcuts(items []TabItem) *Tabs

NewTabsWithShortcuts creates a new tabs component with keyboard shortcuts

func (*Tabs) GetActive

func (t *Tabs) GetActive() string

GetActive returns the name of the active tab

func (*Tabs) Next

func (t *Tabs) Next()

Next moves to the next tab

func (*Tabs) Previous

func (t *Tabs) Previous()

Previous moves to the previous tab

func (*Tabs) SetActive

func (t *Tabs) SetActive(index int)

SetActive sets the active tab by index

func (*Tabs) View

func (t *Tabs) View(width int) string

View renders the tabs

func (*Tabs) ViewCompact

func (t *Tabs) ViewCompact(width int) string

ViewCompact renders tabs in a compact format with shortcuts

func (*Tabs) ViewSimple

func (t *Tabs) ViewSimple() string

ViewSimple renders tabs without styling (for mockup)

func (*Tabs) ViewWithBorder

func (t *Tabs) ViewWithBorder(width int) string

ViewWithBorder renders the tabs with a border

func (*Tabs) ViewWithShortcuts

func (t *Tabs) ViewWithShortcuts(width int) string

ViewWithShortcuts renders tabs with keyboard shortcuts displayed

type Tree

type Tree struct {
	Root []*TreeNode // Top-level nodes
	// contains filtered or unexported fields
}

Tree is the main tree view component

func NewTree

func NewTree(collections []*api.CollectionFile) *Tree

NewTree creates a new tree from collections

func (*Tree) Collapse

func (t *Tree) Collapse() bool

Collapse collapses the selected folder

func (*Tree) Down

func (t *Tree) Down()

Down moves cursor down

func (*Tree) Expand

func (t *Tree) Expand() bool

Expand expands the selected folder

func (*Tree) FindNodeByID

func (t *Tree) FindNodeByID(id string) *TreeNode

FindNodeByID searches the tree recursively for a node with the given ID

func (*Tree) GetExpandedFolders

func (t *Tree) GetExpandedFolders() []string

GetExpandedFolders returns a list of expanded folder names/IDs for session persistence

func (*Tree) GetHeight added in v1.1.0

func (t *Tree) GetHeight() int

GetHeight returns the visible height of the tree (number of visible rows).

func (*Tree) GetScrollOffset added in v1.1.0

func (t *Tree) GetScrollOffset() int

GetScrollOffset returns the current scroll offset.

func (*Tree) GetScrollPosition

func (t *Tree) GetScrollPosition() int

GetScrollPosition returns the current scroll offset for session persistence

func (*Tree) GetSelectedIndex

func (t *Tree) GetSelectedIndex() int

GetSelectedIndex returns the current cursor position for session persistence

func (*Tree) GetVisibleItems added in v1.1.0

func (t *Tree) GetVisibleItems() []*TreeNode

GetVisibleItems returns a copy of the currently visible tree nodes. Useful for jump mode to enumerate targets. Returns a copy to prevent external mutation of internal state.

func (*Tree) GoToFirst

func (t *Tree) GoToFirst()

GoToFirst jumps to the first item

func (*Tree) GoToLast

func (t *Tree) GoToLast()

GoToLast jumps to the last item

func (*Tree) HasSearchQuery

func (t *Tree) HasSearchQuery() bool

HasSearchQuery returns true if there's an active search query (not input visible)

func (*Tree) IsSearching

func (t *Tree) IsSearching() bool

IsSearching returns true if search is active

func (*Tree) Refresh

func (t *Tree) Refresh()

Refresh rebuilds visible list from current state

func (*Tree) RestoreState

func (t *Tree) RestoreState(state *TreeState)

RestoreState restores the tree state after reload

func (*Tree) SaveState

func (t *Tree) SaveState() *TreeState

SaveState captures the current state of the tree

func (*Tree) SelectIndex added in v1.1.0

func (t *Tree) SelectIndex(index int)

SelectIndex selects an item by its visual index in the visible items. This is used by jump mode to navigate directly to a target.

func (*Tree) Selected

func (t *Tree) Selected() *TreeNode

Selected returns the currently selected node

func (*Tree) SetExpandedFolders

func (t *Tree) SetExpandedFolders(folderIDs []string)

SetExpandedFolders expands folders matching the given IDs

func (*Tree) SetHeight

func (t *Tree) SetHeight(h int)

SetHeight sets the available height for the tree

func (*Tree) SetScrollPosition

func (t *Tree) SetScrollPosition(offset int)

SetScrollPosition sets the scroll offset from session state

func (*Tree) SetSelectedIndex

func (t *Tree) SetSelectedIndex(index int)

SetSelectedIndex sets the cursor position from session state

func (*Tree) Up

func (t *Tree) Up()

Up moves cursor up

func (*Tree) Update

func (t *Tree) Update(msg tea.Msg, allowNavigation bool) (*Tree, tea.Cmd)

Update handles messages and returns updated tree

func (*Tree) View

func (t *Tree) View(width, height int, active bool) string

View renders the tree to a string

func (*Tree) VisibleRange

func (t *Tree) VisibleRange() (start, end int)

VisibleRange returns the range of visible nodes

type TreeActionMsg

type TreeActionMsg struct {
	Action string    // "rename", "delete", "yank", "paste", "new_request", "new_folder", "duplicate"
	Node   *TreeNode // Target node
}

TreeActionMsg is sent for tree manipulation actions

type TreeDeleteMsg

type TreeDeleteMsg struct {
	Node *TreeNode
}

TreeDeleteMsg is sent when delete is requested

type TreeDuplicateMsg

type TreeDuplicateMsg struct {
	Node *TreeNode
}

TreeDuplicateMsg is sent to duplicate a node

type TreeEditRequestMsg

type TreeEditRequestMsg struct {
	Node *TreeNode
}

TreeEditRequestMsg is sent to edit a request

type TreeExpandMsg

type TreeExpandMsg struct {
	Node     *TreeNode
	Expanded bool
}

TreeExpandMsg is sent when a folder is expanded/collapsed

type TreeNewFolderMsg

type TreeNewFolderMsg struct {
	ParentNode *TreeNode // nil for root level
}

TreeNewFolderMsg is sent to create a new folder

type TreeNewRequestMsg

type TreeNewRequestMsg struct {
	ParentNode *TreeNode // nil for root level
}

TreeNewRequestMsg is sent to create a new request

type TreeNode

type TreeNode struct {
	ID         string      // Unique identifier
	Name       string      // Display name
	Type       NodeType    // Node type
	Children   []*TreeNode // Child nodes (empty for requests)
	Expanded   bool        // Whether folder is expanded
	HTTPMethod string      // HTTP method (only for RequestNode)
	URL        string      // Request URL (only for RequestNode)
	Depth      int         // Nesting level (0 = root)
	Parent     *TreeNode   // Reference to parent node
}

TreeNode represents a single node in the tree

type TreePasteMsg

type TreePasteMsg struct {
	TargetNode *TreeNode // Where to paste
}

TreePasteMsg is sent when paste is requested

type TreeRenameMsg

type TreeRenameMsg struct {
	Node *TreeNode
}

TreeRenameMsg is sent when renaming is initiated

type TreeSelectionMsg

type TreeSelectionMsg struct {
	Node *TreeNode
}

TreeSelectionMsg is sent when a request is selected

type TreeState

type TreeState struct {
	ExpandedNodes map[string]bool // Map of node IDs to expanded state
	SelectedID    string          // ID of selected node
	CursorPos     int             // Cursor position
	ScrollOffset  int             // Scroll offset
}

TreeState stores the state of the tree for restoration

type TreeYankMsg

type TreeYankMsg struct {
	Node *TreeNode
}

TreeYankMsg is sent when a node is yanked (copied)

type WhichKey

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

WhichKey manages keybinding hints display

func NewWhichKey

func NewWhichKey() *WhichKey

NewWhichKey creates a new WhichKey component

func (*WhichKey) GetContext

func (w *WhichKey) GetContext() KeyContext

GetContext returns the current context

func (*WhichKey) GetHintsForStatusBar

func (w *WhichKey) GetHintsForStatusBar(ctx KeyContext) string

GetHintsForStatusBar returns a compact hint string for the statusbar

func (*WhichKey) Hide

func (w *WhichKey) Hide()

Hide hides the WhichKey modal

func (*WhichKey) IsVisible

func (w *WhichKey) IsVisible() bool

IsVisible returns visibility state

func (*WhichKey) SetContext

func (w *WhichKey) SetContext(ctx KeyContext)

SetContext sets the current context

func (*WhichKey) Show

func (w *WhichKey) Show()

Show displays the WhichKey modal

func (*WhichKey) Toggle

func (w *WhichKey) Toggle()

Toggle toggles visibility

func (*WhichKey) Update

func (w *WhichKey) Update(msg tea.Msg) (*WhichKey, tea.Cmd)

Update handles messages

func (*WhichKey) View

func (w *WhichKey) View(screenWidth, screenHeight int) string

View renders the WhichKey modal

Jump to

Keyboard shortcuts

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