ui

package
v1.0.0-rc.7 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ui is the fullscreen Bubble Tea interface: status bar, message viewport, input line. Scrollback lives in the viewport (not the terminal's), so paging keys and spoiler re-rendering are handled here.

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 Bubble Tea root model.

func New

func New(chat *client.Client, opts Options) Model

New builds the UI over a running chat client.

func (Model) Denied

func (m Model) Denied() string

Denied returns the server's entry-gate notice (supporter-only, under 18, e-mail not validated, banned) as terminal text when that is why the client stopped, else "". main prints it after the program exits: the notice is the whole answer and nothing in the TUI can act on it.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) SignedOut

func (m Model) SignedOut() bool

SignedOut reports whether the client stopped because the site refused the remember cookie. main reads it after the program exits.

func (Model) Update

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

Update implements tea.Model.

func (Model) View

func (m Model) View() tea.View

View implements tea.Model. The alt screen is declared here rather than as a program option: that is how v2 owns terminal modes.

type Options

type Options struct {
	// Channel is the name shown in the status bar and placeholder.
	Channel string
	// Quiet suppresses the terminal bell on mentions and DMs.
	Quiet bool
	// Theme colors the screen; the zero value means theme.Default().
	Theme theme.Theme
	// Splash is the opening animation; nil plays none.
	Splash splash.Effect
}

Options configures the UI beyond the client it wraps.

Jump to

Keyboard shortcuts

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