chatlist

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatListFilteredMsg

type ChatListFilteredMsg struct {
	Query string
}

ChatListFilteredMsg is emitted when the chat list filter changes.

type ChatSelectedMsg

type ChatSelectedMsg struct {
	ChatId int64
}

ChatSelectedMsg is emitted when the user selects a chat.

type Model

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

Model is the chat list component.

func New

func New(s *store.Store, tg *telegram.Client, th *theme.Theme) Model

New creates a new chat list model.

func (*Model) ActiveChatId

func (m *Model) ActiveChatId() int64

ActiveChatId returns the currently selected chat ID.

func (*Model) ClickAt

func (m *Model) ClickAt(localY int) (chatID int64, ok bool)

ClickAt selects the chat shown at the given local row (inside the panel border) and returns its ID. ok is false when the row has no chat.

func (Model) Init

func (m Model) Init() tea.Cmd

Init loads the initial chat list.

func (*Model) ScrollBy

func (m *Model) ScrollBy(n int)

ScrollBy moves the selection by n items (negative scrolls up).

func (*Model) SetFocused

func (m *Model) SetFocused(focused bool)

SetFocused sets focus state.

func (*Model) SetSize

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

SetSize sets the component dimensions.

func (Model) Update

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

Update handles messages.

func (Model) View

func (m Model) View() string

View renders the chat list.

Jump to

Keyboard shortcuts

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