queue

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package queue renders the queued messages overlay above the composer and lets the user inspect, navigate, and remove queued messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Theme theme.Theme
	Tier  theme.Tier
	// contains filtered or unexported fields
}

Model manages queued messages and the overlay presentation.

func New

func New(t theme.Theme, tier theme.Tier) Model

New returns an empty queue model.

func (Model) Active

func (m Model) Active() bool

Active reports whether the overlay is currently open.

func (*Model) Close

func (m *Model) Close()

Close dismisses the overlay.

func (Model) Cursor added in v0.1.2

func (m Model) Cursor() int

Cursor reports the index of the selected item, or -1 when the queue is empty. -1 is the pinned empty-queue sentinel; callers guard on idx < 0 before indexing.

func (*Model) DeleteSelected

func (m *Model) DeleteSelected() (string, bool)

DeleteSelected removes the currently highlighted item from the queue and returns it.

func (*Model) Down

func (m *Model) Down()

Down moves the selection to the next queued item.

func (Model) Height

func (m Model) Height() int

Height returns the total number of terminal rows claimed by the overlay.

func (*Model) InsertAt added in v0.1.2

func (m *Model) InsertAt(i int, text string)

InsertAt puts text back at index i, clamping i into [0, len(items)]. It is the undo for a DeleteSelected whose send then failed.

func (Model) Items

func (m Model) Items() []string

Items returns a copy of the current queue items.

func (Model) Len

func (m Model) Len() int

Len returns the count of items in the queue.

func (*Model) Open

func (m *Model) Open(items []string)

Open activates the overlay.

func (*Model) SetItems

func (m *Model) SetItems(items []string)

SetItems syncs the queue overlay items with the screen queue slice.

func (*Model) SetWidth

func (m *Model) SetWidth(w int)

SetWidth updates the available width for framing and truncation.

func (*Model) Up

func (m *Model) Up()

Up moves the selection to the previous queued item.

func (Model) View

func (m Model) View() string

View renders the queued messages overlay box.

Jump to

Keyboard shortcuts

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