Status: v1 decision log.
Studio needs a small non-blocking message surface for short-lived feedback.
- Use
toastas the public Studio term. - Use
useToast()as the frontend API name. - Toasts are transient, non-blocking messages.
- Dialogs stay blocking; toasts do not replace dialogs.
- Persistent system items are future notifications, not v1 toasts.
- Toasts render in the bottom-right corner.
- Toasts stack newest-first.
- Newest toast appears closest to the bottom-right edge; older toasts move upward.
- Toasts auto-dismiss by default.
- Toasts can be manually dismissed.
- Manual dismissal means the user closes the toast; v1 does not expose programmatic close handles.
- V1 toast types are
info,success,warning, anddanger. - V1 toast requests require
title. - V1 toast requests may include
content,type, andduration. - Empty
titleis invalid. - Empty
contentis allowed. typedefaults toinfo.durationis milliseconds.- Missing
durationuses the Studio default duration. - Default duration is
4000ms. duration: 0means sticky until dismissed.- Negative
durationis invalid. - V1 toasts do not include actions.
- If a message needs required user action, use a dialog.
useToast()exposesshow,success,error,warning, andinfo.showaccepts the full toast request shape.success,error,warning, andinfoare convenience methods for common toast types.errorcreates adangertoast.- Server responses may include a single toast intent in v1.
- Server
toastis best-effort and must not change API request semantics. - Use
dygo.Toastas the public SDK type name. - Server response envelopes should use a single
toastfield in v1. - Success responses put
toastbesidedata. - Error responses put
toastinside the existingerrorenvelope. - Do not add
toastsarrays in v1. - Duplicate identical toasts are allowed in v1.
- Toasts are not persisted.
- Toasts are not written to Activity.
type StudioToastType = "info" | "success" | "warning" | "danger"
type StudioToastRequest = {
title: string
content?: string
type?: StudioToastType
duration?: number
}
type UseToast = {
show(request: StudioToastRequest): void
success(title: string, content?: string): void
error(title: string, content?: string): void
warning(title: string, content?: string): void
info(title: string, content?: string): void
}type ToastType string
const (
ToastInfo ToastType = "info"
ToastSuccess ToastType = "success"
ToastWarning ToastType = "warning"
ToastDanger ToastType = "danger"
)
type Toast struct {
Title string `json:"title"`
Content string `json:"content,omitempty"`
Type ToastType `json:"type,omitempty"`
Duration *int `json:"duration,omitempty"`
}