tui

package
v0.0.0-...-204b530 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package tui is the bubbletea terminal UI for plient. It owns one State value and drives every mutation from a tea.Msg, so the iOS port has a single canonical list of events to mirror in its own state machine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model is the bubbletea state. Constructed by New; the SSE goroutine and REST client are owned by the model and shut down when the program exits.

func New

func New(c *api.Client) *Model

New builds an initial model. The SSE stream is not yet running; Init kicks it off and starts the initial REST fetches.

The broadcast verifier shares c's HTTP transport so connection pooling is reused across bearer-authenticated server calls and unauthenticated public actor-doc fetches. The bearer token lives on the api.Client, not the http.Client, so it does NOT leak onto fetches to third-party URLs.

func (*Model) Init

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

Init returns the startup commands: open SSE in a goroutine, fetch identity and contacts in parallel, and arm the SSE-receive ticker.

func (*Model) Update

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

Update is the single mutation point. Every external event — REST result, SSE event, keystroke — becomes a tea.Msg and lands here.

func (*Model) View

func (m *Model) View() string

View renders the three-pane layout: contacts (left), thread (right), compose (bottom), with a status hint at the very bottom. The settings pane takes over the whole screen when active.

Jump to

Keyboard shortcuts

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