Documentation
¶
Overview ¶
Package msg defines common Bubble Tea message types shared across packages, including toast notifications for temporary status displays.
Index ¶
- func Alert(source notify.SourceID, severity notify.Severity, title string) tea.Cmd
- func Blocked(reason string) tea.Cmd
- func ShowFlash(text string) tea.Cmd
- func ShowFlashFrom(source, text string) tea.Cmd
- func ShowToast(message string, duration time.Duration) tea.Cmd
- func ThemeChanged() tea.Cmd
- type FlashMsg
- type ThemeChangedMsg
- type ToastMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alert ¶ added in v1.2.0
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
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
ShowFlash returns a command showing a status flash from the system source.
func ShowFlashFrom ¶ added in v1.2.0
ShowFlashFrom returns a command showing a status flash marked with a particular notification source's glyph and hue.
func ThemeChanged ¶ added in v1.0.3
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).