Create consistent UX flows for all application states: loading, error, empty, and success.
为应用的所有状态(加载、错误、空值、成功)创建一致的UX流程。
Output Components
输出组件
Every implementation includes: (1) Loading skeletons, (2) Error state with retry, (3) Empty state with action, (4) Success view, (5) Error boundary, (6) State management pattern (useState/XState/server).
Data Fetching Flow: Check loading → Handle error → Show empty → Display data
State Machine: XState for complex flows with multiple states and transitions
Optimistic Updates: Instant UI feedback with rollback on error
Progressive Loading: Show content incrementally as it loads
Always handle all states, prefer skeletons over spinners, provide retry mechanisms, use consistent error/empty UI, add ARIA live regions, implement error boundaries.