Toast

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 to message
    • message (string) — alias for content
    • duration (number) — auto-hide delay in ms (default 5000; 0 when persistent)
    • persistent (boolean) — keep the toast until manually hidden (default false)
    • closeOnClick (any) — hide when the toast is clicked (default true, forced false when persistent)
    • spinner (boolean) — show a spinner inside the toast (default false)
    • id (string) — toast id used by later hide({ 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
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
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();