Toast notifications.
show#
Shows a toast with text or options. You can also pass a single options object instead of message.
Parameters:
- message (
string) — message - options (
object) — object with the keys below- content (
object | string) — toast body (string, Node, or array); defaults tomessage - message (
string) — alias forcontent - duration (
number) — auto-hide delay in ms (default5000;0whenpersistent) - persistent (
boolean) — keep the toast until manually hidden (defaultfalse) - closeOnClick (
any) — hide when the toast is clicked (defaulttrue, forcedfalsewhen persistent) - spinner (
boolean) — show a spinner inside the toast (defaultfalse) - id (
string) — toast id used by laterhide({ id })calls (e.g.'loading','issues') - className (
string) — extra CSS class name(s) on the toast element - restoreIssues (
boolean) — restore a suspended AI issues toast after this toast hides
- content (
app.toast.show('Saved');
app.toast.show('Working…', { spinner: true, persistent: true });
hide#
Hides the current toast, optionally matching by id; respects loading depth. You can also pass an id string instead of an object.
Parameters:
- options (
object) — object with the keys below- id (
string) — toast id to hide (e.g.'loading','issues'); when omitted, hides the current toast
- id (
app.toast.hide();
app.toast.hide({ id: 'loading' });
showLoading#
Shows or updates a persistent loading toast with optional stop action.
Parameters:
- message (
string) — message
app.toast.showLoading('Processing…');
hideLoading#
Decrements loading depth and hides the loading toast when it reaches zero.
app.toast.hideLoading();
showIssues#
Shows a persistent AI issues toast with accept-all and reject-all actions.
Parameters:
- count (
number) — count - onAcceptAll (
function) — on accept all - onRejectAll (
function) — on reject all
app.toast.showIssues({ count: 3, onAcceptAll, onRejectAll });
syncIssues#
Updates the issues count in the visible issues toast or hides it when count is zero.
Parameters:
- count (
number) — count
app.toast.syncIssues(5);
hideIssues#
Clears issues state and hides the issues toast if visible.
app.toast.hideIssues();