contacts

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContactSelectedMsg

type ContactSelectedMsg struct {
	UserId int64
}

ContactSelectedMsg is emitted when a contact is selected.

type Model

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

Model is the contact list component.

func New

func New(s *store.Store, tg *telegram.Client, r theme.Roles) Model

New creates a new contacts model.

func (*Model) ClickAt

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

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

func (Model) IsVisible

func (m Model) IsVisible() bool

IsVisible returns whether the contacts panel is visible.

func (*Model) LoadContacts

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

LoadContacts fetches the contact 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) SetVisible

func (m *Model) SetVisible(visible bool)

SetVisible shows or hides the contacts panel.

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 contacts list.

Jump to

Keyboard shortcuts

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