local-notifications
Schedules on-device reminders with expo-notifications: rows as truth, one idempotent sync, DST-safe triggers, Android channels. Use when adding a reminder, snooze or local notification. Not for remote push (push-notifications).
- License 许可
- MIT
- 最近更新
- 2026-10-22
- Stars
- ★ 13
- Forks
- 2
01 前言 Front Matter
- name
- local-notifications
- description
- Schedules on-device reminders with expo-notifications: rows as truth, one idempotent sync, DST-safe triggers, Android channels. Use when adding a reminder, snooze or local notification. Not for remote push (push-notifications).
02 资源文件 67
- 资产文件assets/shared.json457 B
- 脚本examples/create-root-kits.ts3.4 KB
- 脚本examples/migration-reminders.ts1.4 KB
- 脚本examples/sqlite-reminder-repository.ts4.6 KB
- 脚本examples/use-task-reminder-model.ts2.5 KB
- 参考文档references/checkers.md11.3 KB
- 参考文档references/expo-notifications-api.md10.0 KB
- 参考文档references/platform-behaviour.md8.5 KB
- 参考文档references/scheduling-model.md13.8 KB
- 参考文档references/taps-and-routing.md6.5 KB
- 参考文档references/testing-and-devices.md8.1 KB
- 脚本scripts/check-lib.mjs117.1 KB
- 脚本scripts/check-reminder-code.mjs22.7 KB
- 脚本scripts/check-reminder-logic.mjs6.0 KB
- 脚本scripts/lib/app-modules.mjs8.7 KB
- 脚本scripts/lib/reminder-checks.mjs14.8 KB
- 脚本scripts/lib/reminder-paths.mjs2.6 KB
- 脚本scripts/lib/source-scan.mjs35.1 KB
- 脚本scripts/selftest.mjs735 B
- 脚本templates/src/core/dates/date-key.test.ts3.2 KB
- 脚本templates/src/core/dates/date-key.ts2.6 KB
- 脚本templates/src/core/reminders/plan-reminders.test.ts6.5 KB
- 脚本templates/src/core/reminders/plan-reminders.ts8.9 KB
- 脚本templates/src/core/reminders/reconcile-reminders.test.ts2.1 KB
- 脚本templates/src/core/reminders/reconcile-reminders.ts1.8 KB
- 脚本templates/src/core/reminders/reminder-tap.test.ts1018 B
- 脚本templates/src/core/reminders/reminder-tap.ts1.6 KB
- 脚本templates/src/core/reminders/reminder.test.ts2.0 KB
- 脚本templates/src/core/reminders/reminder.ts3.6 KB
- 脚本templates/src/core/reminders/wall-clock.test.ts2.9 KB
- 脚本templates/src/core/reminders/wall-clock.ts2.0 KB
- 脚本templates/src/hooks/use-reminder-sync.test.ts2.6 KB
- 脚本templates/src/hooks/use-reminder-sync.ts1.3 KB
- 脚本templates/src/hooks/use-reminder-taps.test.ts2.8 KB
- 脚本templates/src/hooks/use-reminder-taps.ts1.7 KB
- 参考文档templates/src/i18n/catalogs/ar.json387 B
- 参考文档templates/src/i18n/catalogs/en.json333 B
- 脚本templates/src/services/local-notifications/expo-local-notifications-adapter.test.ts9.4 KB
- 脚本templates/src/services/local-notifications/expo-local-notifications-adapter.ts7.4 KB
- 脚本templates/src/services/local-notifications/fake-local-notifications.test.ts2.7 KB
- 脚本templates/src/services/local-notifications/fake-local-notifications.ts4.6 KB
- 脚本templates/src/services/local-notifications/local-notifications-port.test.ts573 B
- 脚本templates/src/services/local-notifications/local-notifications-port.ts4.9 KB
- 其他templates/src/services/local-notifications/local-notifications-root-kit.test.tsx4.5 KB
- 其他templates/src/services/local-notifications/local-notifications-root-kit.tsx2.7 KB
- 其他templates/src/services/local-notifications/reminder-sync-context.test.tsx1.2 KB
- 其他templates/src/services/local-notifications/reminder-sync-context.tsx1.4 KB
- 脚本templates/src/services/local-notifications/reminder-sync.test.ts9.5 KB
- 脚本templates/src/services/local-notifications/reminder-sync.ts9.9 KB
- 脚本templates/src/services/local-notifications/reminder-texts.test.ts1.8 KB
- 脚本templates/src/services/local-notifications/reminder-texts.ts2.9 KB
- 脚本templates/src/services/local-zone/fake-local-zone.test.ts658 B
- 脚本templates/src/services/local-zone/fake-local-zone.ts713 B
- 脚本templates/src/services/local-zone/local-zone-port.ts530 B
- 脚本templates/src/services/local-zone/system-local-zone-adapter.test.ts984 B
- 脚本templates/src/services/local-zone/system-local-zone-adapter.ts1.1 KB
- 脚本templates/test/reminders/reminder-rows.ts1.3 KB
- 脚本templates/test/reminders/rule-zone.ts2.0 KB
- 参考文档tests/bases/app/package.json250 B
- 脚本tests/bases/app/src/services/create-root-kits.ts918 B
- 参考文档tests/bases/app/tsconfig.json195 B
- 参考文档tests/fixtures/check-reminder-code/CASES.json18.7 KB
- 参考文档tests/fixtures/check-reminder-code/good/EXPECT.txt13 B
- 参考文档tests/fixtures/check-reminder-code/SUITE.json109 B
- 参考文档tests/fixtures/check-reminder-logic/CASES.json8.3 KB
- 参考文档tests/fixtures/check-reminder-logic/good/EXPECT.txt13 B
- 参考文档tests/fixtures/check-reminder-logic/SUITE.json109 B
03 SKILL.md 正文
Local notifications
Every on-device reminder in an Expo app is a database row; one idempotent sync turns the rows into the OS's pending notifications (one-shot triggers at instants resolved per day through the local zone, at most 50 nearest, on Android channels, with localized text), refills them on every return to the foreground, and opens the row's current screen when one is tapped, on iOS and Android alike; two checkers prove it on the app's own code.
Rules that must hold
- The database is the source of truth; the OS pending set is a cache. Reminders are rows
(
Reminder,src/core/reminders/reminder.ts); nothing readsgetAllScheduledNotificationsAsyncto decide what the person asked for. Why: iOS keeps only 64, OEM battery managers drop alarms, a restore or reinstall empties the set; only rows survive all of it. (schedule-api,cancel-all) - One idempotent sync is the only writer.
createReminderSync(reminder-sync.ts): channels, permission, rows,planReminders,reconcileReminders, cancel, schedule; runs never overlap (single flight). Features write the row, then callsync.request(). Why: a second writer makes the diff wrong for both and cannot be made idempotent. (sync-only-writer,reconcile-diff) - expo-notifications lives only in adapters. The local adapter
(
expo-local-notifications-adapter.ts) is the only file that schedules, lists or cancels; tests drive it throughjest.mock+jest.requireMock, never a value import (type-only imports are erased and allowed). Why: Jest never touches native code, and one file owns every platform difference. (sdk-import,schedule-api) - A recurring time is a wall-clock minute plus a rule, resolved per day through the zone.
instantOfWallClock(day, minuteOfDay, zone.offsetAt); days byaddDayson date keys; noDate.now(),new Date(or+ 86_400_000in reminder code (time comes fromClockPortandLocalZonePort). Why: a local day lasts 23, 24 or 25 hours; 09:00 stored as an instant is 08:00 all winter. (wall-clock,wall-clock-dst,plan-dst) - Every notification is a one-shot DATE trigger on an explicit channel. No DAILY, WEEKLY,
CALENDAR, TIME_INTERVAL or
repeats: true;channelIdon every trigger. Why: a repeating trigger cannot skip a done day, keeps one text for ever, and hides its next instant from the diff; without a channel Android posts to an unnamed fallback channel. (repeating-trigger,trigger-channel) - Identifiers encode reminder, instant and text, and the sync touches only its own.
reminder:<id>:<instant>:<hash of channel, title, body>; onlyREMINDER_ID_PREFIXidentifiers are cancelled; nevercancelAllScheduledNotificationsAsync. Why: the same input must be an empty diff, an edit must replace (iOS reports a pending date only as an interval), and other features' notifications are not this sync's. (plan-idempotent,plan-edit,reconcile-diff,cancel-all) - Plan the nearest 50 (never above 64), nothing in the past, and refill on every foreground.
maxPendingdefault 50,IOS_PENDING_LIMIT64, a 5-second lead (a pending occurrence inside it is kept:imminentIds);useReminderSyncruns on mount, on return to the foreground and on a language change. Why: iOS silently drops everything past the 64 soonest, rejects a past date (Android drops it silently), a sync in a reminder's last seconds must not cancel it, and a window runs out unless refilled. (plan-max-pending,plan-past,reconcile-diff,sync-on-foreground) - A bad row is rejected and recorded, never fatal; skip days and weekdays are honoured. Why: one
corrupt row must not silence every reminder, and "done for today" must hold. (
plan-reject,plan-skip) - Notification text comes from
t()at sync time, thet()the app shows.reminderTexts(t)builds the channels and texts of a run from onet(), whichuseReminderSync(sync, t)hands over (sync.request({ t })); the person's label goes in a*Textplaceholder (bidi-isolated). Why: a literal, or a template with words around its${}, is never translated; the text hash in each identifier re-plans every pending notification after a language switch; and a language read from module state in a child's effect is still the old one. (literal-text) - The permission is asked from a person's action, channels first.
sync.enable()from "Remind me": channels, then the prompt only while the OS still shows one, then a sync;blockedoffers the system Settings. Never in a layout, the root navigator, the entry or any effect (an effect runs on mount). Why: iOS asks once, an app targeting Android 12L or lower gets no prompt before a channel exists, and a launch prompt is refused more often. (permission-at-launch) - Exactly one foreground handler. One
setNotificationHandlercall: the local adapter's, or push-notifications' adapter's when push is adopted (the composition root then passesinstallForegroundHandler: falseto the local adapter). Why: on SDK 57 a notification that fires while the app is open is not shown without it, and a second call silently replaces the first. (foreground-handler) - A tap carries only
{ kind: 'reminder', reminderId }and opens a typed route.parseReminderTaptreats data as untrusted;useReminderTapsreads the launch tap (getLastNotificationResponse) and the listener, handles each identifier once, clears it, and the app'sopenReminderreads the row's subject again and maps it to a typed href (missing → home); no row stores a path. Why: a notification outlives routes and rows, a cold-start tap reaches no listener, and a stored path needs anas Hrefcast. (plan-data,tap-parse,tap-handling) - Android: inexact alarms by default, never
USE_EXACT_ALARM.SCHEDULE_EXACT_ALARMonly as a deliberate opt-in with its denial handled. Why: Play allowsUSE_EXACT_ALARMonly for alarm-clock, timer and calendar apps; Android 14 denies the exact-alarm grant by default. (exact-alarm)
Workflow
-
Read the reference for the task:
Task Read a new reminder kind, the sync, the window, DST or travel, restore, "fired at the wrong time" references/scheduling-model.md an expo-notifications call, trigger, handler, permission or channel detail references/expo-notifications-api.md iOS vs Android delivery, the 64 limit, exact alarms, Doze, OEMs, lock-screen privacy references/platform-behaviour.md tapping a reminder, cold start, coexisting with push, action buttons references/taps-and-routing.md tests, rule zones, device probes references/testing-and-devices.md a checker failure, configuration, NOT APPLICABLE references/checkers.md -
Check the prerequisites.
ClockPortwith its fake and the composition root (architecture-and-boundaries),Result(error-handling-typed-results),date-key.ts(seeded-determinism-and-golden-vectors; a synced copy is intemplates/src/core/dates/, copy it only when the app lacks it),useIsAppActive(react-components-and-hooks),t()and the catalogs (i18n-strings-and-catalogs). Install the SDK withnpx expo install expo-notificationsand add its config plugin with an Androidiconandcolor(expo-prebuild-and-config-plugins). -
Classify the SDK. Add
"expo-notifications": "LocalNotificationsPort"tovendorSdksincontracts/architecture.jsonandvendor('expo-notifications', 'LocalNotificationsPort')to the ESLintVENDOR_SDK_PATHS(architecture-and-boundaries, typescript-and-lint-rules). When push-notifications is adopted too, both adapters import the SDK, so the label names both ports:"LocalNotificationsPort/PushPort"in both places. -
Store the rows. Add the reminder tables in a forward-only migration and a repository whose
loadActiveReminders()returnsReminder[](recording malformed rows) andfindReminder(id)the row's subject ({ taskId }, null when gone), created inopenDeviceDataasremindersonAppDataover the one connection (examples/migration-reminders.ts, examples/sqlite-reminder-repository.ts; persistence-and-migrations owns the format). -
Copy the templates to the paths their first lines name, each with its test:
templates/src/core/reminders/(the pure planner),templates/src/services/local-zone/,templates/src/services/local-notifications/(port, adapter, fake, texts, sync, the root kit andreminder-sync-context.tsx),templates/src/hooks/(sync and tap hooks),templates/test/reminders/(rule zones, rows) and the catalog keys intemplates/src/i18n/catalogs/(merge into the app's catalogs; translate every locale). -
Register the root kit in app-startup-and-bootstrap's registry
src/services/create-root-kits.ts(examples/create-root-kits.ts), whichstartAppruns once after the data layer opened: create the notification and zone adapters (if push-notifications is adopted, passinstallForegroundHandler: falseto the local adapter, rule 11), the onereminderSyncoverdata.reminders.loadActiveReminders, and addcreateLocalNotificationsKit({ notifications, sync, hrefForReminder })to the list. The root files stay unchanged; the registry never opens the database. -
What the kit mounts: its provider (
ReminderSyncProvider, so models calluseReminderSyncService()) and its effects beside the root Stack, inside the navigator:useReminderSync(sync, t)with the shownt()anduseReminderTaps, whose taps navigate tohrefForReminder(id): the row's subject read again (findReminder), as a typed href, or home. -
Wire the actions: the "Remind me" press asks through permissions-and-system-prompts'
usePermissionGateoverpermissions.access.notifications(bound to this port, or to push's when push is adopted: one OS permission) and callssync.enable()fromonAllowed; every reminder write callssync.request()after it commits (examples/use-task-reminder-model.ts). Add anotificationsentry tocontracts/permissions.json(nopurposeKey; explain and settings copy keys;askedFrom= that model, whose sibling test names blocked and denied or declined; that skill's asking-flow section 12), or check-permissions fails. Without that skill, the press callssync.enable()andblockedoffersLinking.openSettings(). -
Test first for any rule change, then run
npx jest src/core/reminders src/services/local-notifications src/services/local-zone src/hooks --ci --maxWorkers=2andnpm run typecheck. -
Run the checks from the repo root:
node ${CLAUDE_SKILL_DIR}/scripts/check-reminder-code.mjs .andnode ${CLAUDE_SKILL_DIR}/scripts/check-reminder-logic.mjs .; fix everyFAILline (file, rule and fix are printed) and rerun until both printRESULT: PASS. -
Prove delivery on devices you named yourself: a reminder a minute ahead fires in the background and in the foreground, a tap opens the task on a warm and a cold start, the Android channel shows its name in Settings (references/testing-and-devices.md; e2e-maestro for the flow).
Definition of done
- [ ] Reminders are rows; nothing but
reminder-sync.tsschedules or cancels, and every reminder write callssync.request()after its commit. - [ ] expo-notifications is imported only by adapters and classified in
contracts/architecture.json. - [ ] Every notification is a one-shot DATE trigger with a
channelId; channels are created with translated names before the prompt and before scheduling. - [ ] The plan holds at most 50 nearest occurrences, none in the past; identifiers encode instant and
text; only
reminder:identifiers are ever cancelled. - [ ] The sync runs on mount, on every return to the foreground, on a language change, after a
restore and after
enable(); onesetNotificationHandlerexists. - [ ] The permission is asked only from the "Remind me" press (through
usePermissionGatewhen permissions-and-system-prompts is adopted, with itsnotificationscontract entry), never from an effect; a blocked state offers Settings. - [ ] The reminder repository is on
AppData; the one sync is created in the root-kit registry (run bystartApp) and provided once by the kit; the composition root opens no database. - [ ] A tap on a warm and on a cold start opens the typed route of the row's subject (home when it is gone); no reminder row stores a path.
- [ ]
USE_EXACT_ALARMis not declared; an exact-alarm opt-in handles its denial. - [ ] The tests in workflow step 9 and
npm run typecheckpass. - [ ]
node ${CLAUDE_SKILL_DIR}/scripts/check-reminder-code.mjs .printsRESULT: PASS(no SKIP lines; an app without the SDK or without local reminders printsNOT APPLICABLE: ...). - [ ]
node ${CLAUDE_SKILL_DIR}/scripts/check-reminder-logic.mjs .printsRESULT: PASS(same NOT APPLICABLE cases).
Anti-patterns
scheduleNotificationAsyncin a screen's handler "just for this one". The next sync cancels it or the diff double-schedules. Write the row,sync.request().- A DAILY trigger for "every day at 9". It fires on the day the task is already done and keeps the old language. Plan one-shots; the foreground sync refills.
fireAt = previous + 24 * 60 * 60 * 1000. An hour off twice a year.instantOfWallClockper day.- Storing
remindAtMsfor a recurring reminder. The instant drifts with every DST change and every flight. StoreminuteOfDayand the rule. identifier: \reminder-${task.id}``. Editing the time keeps the old trigger. Encode instant and text.cancelAllScheduledNotificationsAsync()before rescheduling. It also deletes other features' notifications and makes every sync a full rewrite. Let the diff cancel by identifier.- Reading pending notifications to show "your reminders". Capped at 64 and without fire dates on iOS. Show the rows.
- Asking for the permission in the root layout's effect. iOS asks once; the person has no reason yet. Ask from "Remind me".
- A second
setNotificationHandlerin the push code. The last call wins; one of them goes silent. - Putting
url: '/tasks/42'in the notification data. Stale after an update or a delete, and untrusted.{ kind: 'reminder', reminderId }, then read the row. - A
target: '/tasks/42'column androuter.navigate(row.target as Href). The cast hides a renamed route until someone taps. Store the subject (the task id) and map it to a typed href. - Only
addNotificationResponseReceivedListener. The tap that launched the app is lost. ReadgetLastNotificationResponse()too. - Declaring
USE_EXACT_ALARM"so it fires on time". Play rejects it for a task app; inexact is minutes, not hours. - Trusting an emulator for reboot, Doze or OEM survival. Prove those on real devices.
Files in this skill
| File | What it is | Read/run when |
|---|---|---|
| references/scheduling-model.md | The three layers, rows, the plan and window, identifiers, the diff and sync, when it runs, DST and travel, product shapes, restore, decisions | Workflow step 1; any reminder change |
| references/expo-notifications-api.md | The SDK 57 calls, what DATE becomes per platform (verified in source), the pending set, handler, permissions, channels, taps, what is not used | Workflow step 1; an SDK question |
| references/platform-behaviour.md | iOS vs Android: the 64 limit, prompt, channels, exact and inexact alarms, reboot, Doze, OEMs, lock-screen privacy, pitfalls table | Workflow step 1; a delivery bug |
| references/taps-and-routing.md | The tap data contract, flow, cold start, push coexistence contract, action buttons, tests | Workflow steps 1 and 7 |
| references/testing-and-devices.md | What each test proves, Jest recipes (rule zones, fakes, automock, hooks), named-device probes, what only real devices prove | Workflow steps 9 and 11 |
| references/checkers.md | Every rule of both checkers, the module contract, configuration keys, NOT APPLICABLE cases, troubleshooting | Workflow step 10, and when a check fails |
templates/src/core/reminders/ |
reminder.ts, wall-clock.ts, plan-reminders.ts, reconcile-reminders.ts, reminder-tap.ts and their tests (pure) |
Workflow step 5 |
templates/src/services/local-notifications/ |
The port (+test), the expo-notifications adapter (+test), the fake (+test), reminder-texts.ts (+test), reminder-sync.ts (+test), the root kit local-notifications-root-kit.tsx (+test) and reminder-sync-context.tsx (ReminderSyncProvider, useReminderSyncService, +test) |
Workflow steps 5-7 |
templates/src/services/local-zone/ |
LocalZonePort, the system adapter, the fake, their tests |
Workflow step 5 |
templates/src/hooks/ |
use-reminder-sync.ts, use-reminder-taps.ts and their tests |
Workflow steps 5 and 7 |
templates/test/reminders/ |
rule-zone.ts (zones as data), reminder-rows.ts (rows and plan input for tests) |
Workflow step 5 |
templates/src/i18n/catalogs/ |
en.json, ar.json: the channel and notification keys to merge into the app's catalogs |
Workflow step 5 |
templates/src/core/dates/ |
date-key.ts and its test (synced from seeded-determinism-and-golden-vectors; do not edit here) |
Workflow step 2, only when the app lacks it |
| examples/migration-reminders.ts | The reminder tables of a Tasks app | Workflow step 4 |
| examples/sqlite-reminder-repository.ts | loadActiveReminders (malformed rows recorded), findReminder (the subject), skipToday over the tables |
Workflow step 4 |
| examples/create-root-kits.ts | The root-kit registry with the reminders kit: the two adapters (and the handler option for push), the one sync over data.reminders, hrefForReminder (subject to typed href); no database open |
Workflow steps 6-7 |
| examples/use-task-reminder-model.ts | The "Remind me" model: the permission gate, enable() once allowed, request() after writes |
Workflow step 8 |
scripts/check-reminder-code.mjs |
Static rules: SDK in adapters, one writer, triggers and channels, one handler, no launch prompt, localized text, no wall clock, no USE_EXACT_ALARM, hooks mounted, the root kit registered |
Workflow step 10 |
scripts/check-reminder-logic.mjs |
Runs the app's pure reminder modules against DST, identifier, limit, lead, skip, reject, data, diff and tap vectors | Workflow step 10 |
scripts/lib/reminder-paths.mjs |
Folder resolution (remindersCoreDir, localNotificationsDir) and the applicability facts |
Never by hand |
scripts/lib/reminder-checks.mjs |
The behaviour vectors and rule zones check-reminder-logic runs | When a behaviour rule changes |
scripts/lib/app-modules.mjs |
Imports the app's pure TypeScript with tsconfig aliases (synced from the library; do not edit here) | Never by hand |
scripts/lib/source-scan.mjs |
Shared source helpers (synced from the library; do not edit here) | Never by hand |
scripts/check-lib.mjs |
Shared checker library (synced from the library; do not edit here) | Never by hand |
scripts/selftest.mjs |
Proves both checkers pass the templates and catch every planted bug | After changing a checker, a rule or a template |
assets/shared.json |
The synced files this skill declares | When a synced file is added |
tests/ |
bases/app/ (a minimal app that mounts the hooks) and fixtures/<checker>/ overlay cases on it plus the templates: good/, one bad-* per rule, pass-* (NOT APPLICABLE, push-only, USE_EXACT_ALARM under blockedPermissions, installed skills, type-only SDK imports, push owning the handler), error-no-src |
When adding a rule |
Related skills
push-notifications- remote push, tokens, its channels; the one foreground handler when adopted.permissions-and-system-prompts- the PermissionsPort and gate the notification ask goes through; its sheets.deep-links-and-universal-links- validating paths that arrive from outside the app.background-tasks- a best-effort background sync, never instead of the foreground one.dates-streaks-and-statistics- date keys, the clock, "your streak ends tonight" as a reminder row.persistence-and-migrations- the reminder tables and their migration.architecture-and-boundaries- ports, adapters, fakes, the composition root,vendorSdks.i18n-strings-and-catalogs- catalog keys,*Textplaceholders, translations.settings-and-preferences- a reminders on/off setting that deactivates rows and syncs.expo-prebuild-and-config-plugins- the expo-notifications plugin, icon, color, permissions.e2e-maestro- the schedule, background, tap flow on named devices.debug-menu-and-test-hooks- a hook that schedules a reminder a minute ahead for QA.privacy-and-store-declarations- reminders stay on the device; the permission in the declarations.app-startup-and-bootstrap- the root-kit registry and slots the kit plugs into (startAppruns the registry).
04 同仓库更多 Skills
demo
Planted skill folder (never scanned).
demo
Planted installed skill (its files must never be scanned).
web-support
Ships the web build of an Expo app: platform files, APIs missing in react-native-web, expo-sqlite headers. Use when adding web, a .web.tsx file or expo export --platform web. Not for responsive layout (adaptive-layout).
value-objects-money-and-units
Stores money as ISO 4217 minor units, quantities in canonical units, instants as epoch ms. Use when adding a price, currency, tax, split, unit or timestamp, or a total is a cent off. Not for calendar days (dates-streaks-and-statistics).
unit-and-component-tests
Sets up Jest, checks unit, component and route tests (RNTL 14, renderWithProviders, SDK mocks, fakes, fast-check, Stryker). Use when writing a test or mock, or Jest fails or flakes. Not for goldens (golden-and-snapshot-tests).
ui-states-and-feedback
Builds loading, empty, failed and offline states, delayed skeletons, toasts, banners, confirms, Undo. Use when a screen loads data, shows a spinner, toast, retry or delete prompt. Not for failure values (error-handling-typed-results).