Notifications and recovery

From dembrandt/dembrandt-skills · View interactive version

Notifications and recovery is an AI agent skill from the GitHub repository dembrandt/dembrandt-skills. Toasts, inline errors, banners and recovery paths. Use when designing error states, success confirmations, async feedback or in-place editing.

How to use this skill

Skill file

Notifications and Recovery

When something changes — success, failure, or anything in between — the user must know. And when something goes wrong, they must always have a path forward. A notification without a recovery action is just an apology.


Pattern Selection

| Pattern | When to use | Dismissal |

|---|---|---|

| Toast | Transient result of a user action (saved, sent, deleted) | Auto-dismiss 4–6s, manual close |

| Inline error | Field-level validation, form errors | Clears on correction |

| Alert banner | Persistent issue affecting the current context | Manual dismiss or resolved state |

| Modal / dialog | Blocking error requiring a decision before continuing | User action required |

| Empty state | No data yet — guide the user to the first action | Replaced by the first item |

| Skeleton / loading | Async content pending | Replaced by content |

| In-place confirmation | Inline edit saved, row updated, item toggled | Auto-clears after 2–3s |


Toast Notifications

Toasts confirm that a background action completed. They appear without interrupting the user's flow.

Placement: bottom-center or bottom-right. Never top-center — it competes with page content and navigation.

Duration: 4–6 seconds for information. Errors should persist until dismissed — the user needs time to read and act.

Anatomy:

[Icon] Message text                    [Action] [×]
✓ "Changes saved."
✓ "Message sent.  [Undo]"
✗ "Could not save. Check your connection.  [Retry]"  ← persists until dismissed

Never: multiple simultaneous toasts. Queue them; show one at a time.


Inline Errors

Inline errors appear adjacent to the element that caused them. They are the most contextual and actionable form of error feedback.

Form validation:

<label for="email">Email</label>
<input id="email" aria-describedby="email-error" aria-invalid="true">
<p id="email-error" role="alert">Enter a valid email address.</p>

In-place editing:


Alert Banners

Banners are persistent — they stay until the condition is resolved or the user dismisses them.

Use for:

Placement: top of the affected section, not the entire page unless the issue is truly global.

Anatomy:

[Icon] [Message — describes the issue and its scope] [Action] [×]

Recovery Patterns

Every error state must have a path forward. Design the recovery action at the same time as the error message.

Retry

For transient failures (network, timeout, rate limit):

"Could not load results."
[Try again]

Undo

For destructive or irreversible actions (delete, archive, send):

"Message sent.  [Undo]  ×"

Autosave and Draft Recovery

For long-form inputs (forms, documents, editors):

Graceful Degradation

When a feature fails but the rest of the product still works:


Loading and Skeleton States

Loading is not an error, but it is a state that needs design.

Skeleton screens reduce perceived wait time compared to spinners. Match the skeleton shape to the actual content layout.


The Notification Center

Toasts and banners are transient; a notification center is the persistent place a user goes to review and control what reaches them. Two things make it work.

Easy to reach, and easy to control. The user must get to their notification preferences with almost no digging (a bell icon → the center → settings). And keep the control model coarse — 1 to 3 categories at most, each with a simple level:

Don't build a wall of per-event toggles. Two real needs dominate: silence everything, or keep one or two categories. Design straight for those — a prominent "mute all" / "mark all read" plus 1–3 category switches.

Minimise reading. The center is scanned, not read. Group by category, lead each item with a recognisable icon and the entity/action (not a paragraph), show unread state clearly, and let the whole list be cleared in one action. Reading is time (see [[ui-density]]) — a notification center that demands careful reading defeats its purpose.

Notification Accessibility

<!-- Error: immediate announcement -->
<div role="alert">Could not save. Check your connection.</div>

<!-- Status: polite announcement -->
<div role="status" aria-live="polite">Changes saved.</div>

Review Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.