sessions

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatMsg added in v0.0.57

type ChatMsg struct {
	SessionID string
}

ChatMsg signals that a session should be opened for chat

type CloseMsg added in v0.0.119

type CloseMsg struct{}

CloseMsg signals that the browser should close and return to its parent view.

type DeleteConfirmMsg

type DeleteConfirmMsg struct {
	SessionID string
}

DeleteConfirmMsg signals a delete was confirmed

type InspectMsg

type InspectMsg struct {
	SessionID string
}

InspectMsg signals that a session should be inspected

type KeyMap

type KeyMap struct {
	Quit       key.Binding
	Up         key.Binding
	Down       key.Binding
	PageUp     key.Binding
	PageDown   key.Binding
	GoToTop    key.Binding
	GoToBottom key.Binding
	Select     key.Binding
	Inspect    key.Binding
	Delete     key.Binding
	Search     key.Binding
	Sort       key.Binding
	Filter     key.Binding
	ToggleFTS  key.Binding
}

KeyMap defines keybindings for the sessions browser

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default keybindings

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

FullHelp returns keybindings for the full help view

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp returns keybindings for the short help view

type Model

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

Model is the sessions browser model

func New

func New(store session.Store, width, height int, styles *ui.Styles) *Model

New creates a new sessions browser model

func (*Model) ChatSessionID added in v0.0.57

func (m *Model) ChatSessionID() string

ChatSessionID returns the session ID the user wants to chat with, if any. Check this after the TUI exits to determine if chat should be launched.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init initializes the model

func (*Model) SetEmbedded added in v0.0.119

func (m *Model) SetEmbedded(embedded bool)

SetEmbedded enables parent-managed close behavior for embedded browsers.

func (*Model) SetPreferredSessionID added in v0.0.119

func (m *Model) SetPreferredSessionID(sessionID string)

SetPreferredSessionID selects a session after the next refresh, if present.

func (*Model) Update

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

Update handles messages

func (*Model) View

func (m *Model) View() tea.View

View renders the model

type RefreshMsg

type RefreshMsg struct{}

RefreshMsg signals the list should be refreshed

type SortOrder

type SortOrder int

SortOrder defines how sessions are sorted

const (
	SortNewest SortOrder = iota
	SortOldest
	SortStatus
	SortModel
)

func (SortOrder) String

func (s SortOrder) String() string

type StatusFilter

type StatusFilter int

StatusFilter defines which session statuses to show

const (
	StatusAll StatusFilter = iota
	StatusActive
	StatusComplete
	StatusError
)

func (StatusFilter) String

func (s StatusFilter) String() string

Jump to

Keyboard shortcuts

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