msg

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 3 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 msg defines common Bubble Tea message types shared across packages, including toast notifications for temporary status displays.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert added in v1.2.0

func Alert(source notify.SourceID, severity notify.Severity, title string) tea.Cmd

Alert returns a command filing a notification from a named source, for the producers whose event is not generic app chrome: a blocked action the user must act on, a merge that unwound itself, an agent that fell back. It is the source-aware sibling of ShowToast, which always speaks as `system`, and it goes down the same road — notify.PostMsg, answered by the app shell.

func Blocked added in v1.2.0

func Blocked(reason string) tea.Cmd

Blocked reports an action the app refused, with the reason. It is a warning from the `waiting` source because the user is the one who has to do something about it; the lease is explicit so a transient refusal does not sit sticky in the centre the way a genuinely waiting agent should.

func ShowFlash added in v1.2.0

func ShowFlash(text string) tea.Cmd

ShowFlash returns a command showing a status flash from the system source.

func ShowFlashFrom added in v1.2.0

func ShowFlashFrom(source, text string) tea.Cmd

ShowFlashFrom returns a command showing a status flash marked with a particular notification source's glyph and hue.

func ShowToast

func ShowToast(message string, duration time.Duration) tea.Cmd

ShowToast returns a command to show a toast message.

func ThemeChanged added in v1.0.3

func ThemeChanged() tea.Cmd

ThemeChanged returns a command that sends ThemeChangedMsg.

Types

type FlashMsg added in v1.2.0

type FlashMsg struct {
	// Text is the single line shown. It is truncated, never wrapped.
	Text string
	// Source names the notification source whose glyph and hue mark the line
	// (see internal/notify). Empty means the `system` source.
	Source string
	// IsError renders the line in the error hue, whatever the source is — the
	// same rule a toast applies to an error severity.
	IsError bool
}

FlashMsg shows a status flash. A new flash immediately replaces the one on screen: flashes never queue.

type ThemeChangedMsg added in v1.0.3

type ThemeChangedMsg struct{}

ThemeChangedMsg is sent when the active theme palette has changed (via preview, restore, confirmation, or project switch).

type ToastMsg

type ToastMsg struct {
	Message  string
	Duration time.Duration
	IsError  bool // true for error toasts (red), false for success (green)
}

ToastMsg displays a temporary message.

Jump to

Keyboard shortcuts

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