Pre-alpha. No tagged release and no upgrade path between versions. Use for evaluation and development only, not production.
Core DevPre-alpha

SWC notifications

Workspace toasts are rendered by NotificationService (core/swc/src/services/notification.ts). They appear in the top-right stack (#sum-toast-stack), follow Sumeru sum-toast-* CSS, and need no extra library.

Use env.services.notification from any SWC component. Do not POST to removed /web/record/save routes for save feedback.

API

const n = this.env.services.notification;

n.show({ kind: "info", title: "Queued", body: "Export started." });
n.success("Saved", "Record saved successfully.");
n.error("Save failed", err.message);
n.warning(result.warning.title, result.warning.message, result.warning.details);
MethodKind class
show({ kind, title, body, details? }, timeoutMs?)sum-toast--${kind} (info if omitted)
success(title, body, details?)success
error(title, body, details?)error
warning(title, body, details?)warning
bootstrap(messages?)Replays window.__SWC_BOOTSTRAP__.toasts

kind values in CSS: success, info, warning, error. Markup uses .sum-toast-title, .sum-toast-body, optional .sum-toast-details, and .sum-toast-close.

Behaviour

  • Stack is position: fixed top-right with aria-live="polite".
  • Auto-dismiss after 6 seconds (override with timeoutMs on show). Hover pauses the timer.
  • Close (×) or timeout plays sum-toast-out, then the node is removed.
  • At most 5 live toasts; the oldest dismisses first.

CRUD vs validation

PathFeedback
Form save / delete / duplicateSuccess toast; RPC/network → error toast
Form required-field check (SwcError code validation)Inline .sum-flashnot a toast
Object buttons (header/footer)Success toast, unless the RPC result is {close}, {open}, or {redirect}
List bulk deleteSuccess or error toast; button disabled while in flight
List header object buttons (selection ≥ 2)Same as form object buttons; call may pass active_ids
Kanban quick-createSuccess toast; create/move RPC errors toast

Onchange warnings call notification.warning. Server flash toasts still work via bootstrap toasts (legacy HTML workspace ?msg= is separate — see HTTP routes).

What not to do

  • Do not document or rely on a separate toast.js script; SWC owns the stack.
  • Do not toast client validation — keep required-field errors on the form.
  • Mail/SMTP user notifications are a different stack and are not this API.

See also