Documentation
¶
Overview ¶
Package alert demonstrates pkg/alert in the standard modal pattern, alongside the lighter app.Info / app.Error statusbar messages.
A list of mock operations: enter runs the highlighted one. Successful operations report through the statusbar (app.Info) and auto-clear on the next keypress. Failures pop a modal alert with an error-tinted border that the user must dismiss before continuing — the right shape for "stop and acknowledge" feedback.
The modal uses autosize (Options.Autosize = true): the pane word-wraps its message against 80% of the terminal width, grows vertically up to 60% of the terminal height, and scrolls internally when content overflows — see the "Merge upstream (long stderr)" op for the overflow case. The caller drops the outer layout.Center wrapper and composes with just layout.Sized(&s.modal) inside the ZStack.
The result message uses a typed alert.DismissedMsg via tea.Cmd, the parent matches in its own Update to dismiss the modal, exactly the same pattern as pkg/confirm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.