mainui

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 41 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientCapabilities added in v1.5.0

func NewClientCapabilities(client fullClient) tab.ClientCapabilities

NewClientCapabilities records every capability of a fully authenticated client.

Types

type AppStateManager added in v0.6.2

type AppStateManager interface {
	LoadAppState() (save.AppState, error)
	SaveAppState(save.AppState) error
}

type ChannelHistory added in v1.0.0

type ChannelHistory interface {
	LoadHistory() ([]save.ChannelHistoryEntry, error)
	RecordChannel(login string) error
}

ChannelHistory tracks recently visited channels.

type ChatuinoServer added in v0.7.0

type ChatuinoServer interface {
	tab.APIClient
	RefreshToken(ctx context.Context, refreshToken string) (string, string, error)
	CheckLink(ctx context.Context, targetURL string) (server.CheckLinkResponse, error)
	GetLatestVersion(ctx context.Context) (string, error)
}

ChatuinoServer is the chatuino server API plus the endpoints only the shell calls: token refresh, link checking and the version check.

type CloseTabMessage added in v1.5.0

type CloseTabMessage struct {
	TabID string
}

CloseTabMessage closes a tab by stable identity. Unlike close-pane, this runs the tab's normal resource cleanup; unassigned-tab closure leaves panes alone.

type Root

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

func NewUI

func NewUI(
	ctx context.Context,
	messageLoggerChan chan<- *twitchirc.PrivateMessage,
	settings save.Settings,
	themes *save.ThemeManager,
	keymap save.KeyMap,
	accounts []save.Account,
	version string,
	serverAPI ChatuinoServer,
	clients map[string]tab.ClientCapabilities,
	accountProvider tab.AccountProvider,
	emoteCache tab.EmoteCache,
	badgeCache *badge.Cache,
	emoteReplacer tab.EmoteReplacer,
	badgeReplacer tab.BadgeReplacer,
	imageDisplayManager *kittyimg.DisplayManager,
	recentMessages tab.RecentMessageService,
	messageLogger tab.MessageLogger,
	pool tab.ConnectionPool,
	appStateManager AppStateManager,
	channelHistory ChannelHistory,
	initialState *save.AppState,
) *Root

NewUI creates the root Bubble Tea model. When initialState is non-nil the session runs in detached mode: the provided state is used instead of loading from disk and no state is persisted, allowing multiple independent instances.

func (*Root) Close added in v0.0.4

func (r *Root) Close()

Close cancels and drains chat-event preparation. Call it after Program.Run, including error/cancellation exits. Quit keys also close preparation promptly.

func (*Root) HasSessionLoaded added in v0.6.2

func (r *Root) HasSessionLoaded() bool

func (*Root) Init

func (r *Root) Init() tea.Cmd

func (*Root) IsDetached added in v1.2.0

func (r *Root) IsDetached() bool

IsDetached reports whether the session was started with explicit --tab flags and is therefore not loading or persisting state to disk.

func (*Root) TakeStateSnapshot

func (r *Root) TakeStateSnapshot() save.AppState

func (*Root) Update

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

func (*Root) View

func (r *Root) View() tea.View

type UpdateInfo added in v1.0.1

type UpdateInfo struct {
	CurrentVersion string
	LatestVersion  string
	HasUpdate      bool
}

UpdateInfo holds the result of a version check.

Jump to

Keyboard shortcuts

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