AI Processing States
Patterns for communicating AI system status including loading, streaming, success, error, and fallback states.
State Overview
AI interactions move through a defined set of processing states. Each state provides clear visual feedback so users understand what the system is doing and what actions are available to them. Consistent state communication builds trust and reduces uncertainty during AI-powered workflows.
| State | Visual Indicator | Typical Duration | User Action Available |
|---|---|---|---|
| Idle | Static AI icon, input field enabled | Indefinite | Submit prompt, browse suggestions |
| Loading / Thinking | Animated shimmer, pulsing dot indicator | 1-5 seconds | Cancel request |
| Streaming | Progressive text reveal, typing cursor | 2-30 seconds | Stop generation, scroll |
| Success | Completed content with confidence badge | Persistent | Accept, edit, regenerate, dismiss |
| Error | Error icon, red-tinted container | Until dismissed or retried | Retry, modify prompt, dismiss |
| Timeout | Warning icon, muted container | Until user action | Retry, use fallback, cancel |
Loading / Thinking
Use skeleton screens when the shape of the expected content is predictable, such as a known card layout or list format. Use a spinner for short, indeterminate waits under two seconds. Use shimmer animations for longer waits where content structure is uncertain, as they communicate active progress without implying a specific layout.
Guidelines
- Do show a loading indicator within 200ms of the request being sent.
- Do include a brief contextual message such as "Analyzing your input..." rather than a generic "Loading...".
- Do provide a cancel button so users can abort long-running requests.
- Don't use multiple simultaneous loading animations in the same view.
- Don't block the entire interface while AI content is loading.
- Don't show a progress bar unless you can accurately estimate completion.
Streaming / Progressive
Progressive content reveal shows AI-generated text as it arrives, giving users immediate partial results and a sense of responsiveness. Text should appear in natural reading chunks rather than character-by-character to balance perceived speed with readability. Maintain a blinking cursor or subtle animation at the insertion point to indicate that more content is incoming.
Implementation Notes
Buffer incoming tokens and render in word or phrase groups to avoid layout thrashing. Ensure the scroll position follows the latest content unless the user has manually scrolled up. Provide a "Stop generating" control that is always visible during streaming. When streaming completes, smoothly transition the cursor away and enable action buttons such as copy, regenerate, and edit.
Success
When AI processing completes successfully, transition smoothly from the loading or streaming state to the final content display. Remove loading indicators, show the confidence badge, and enable all interaction controls. The transition should feel seamless rather than abrupt to maintain the user's reading flow.
Confirmation Patterns
- Display a brief success micro-animation (checkmark fade-in or subtle border flash) lasting no more than 300ms.
- Show the AI attribution badge immediately upon completion.
- Enable action buttons (accept, edit, regenerate, dismiss) as a group after the content is fully rendered.
- If the response includes a confidence score, display the corresponding confidence marker alongside the content.
- Preserve the response in a scrollable container so users can review the full output at their own pace.
Error & Retry
Error Messages
Error messages for AI failures should be concise, non-technical, and actionable. Clearly state what went wrong and what the user can do next. Avoid exposing internal error codes or stack traces. Use a red-tinted container with an error icon to visually distinguish error states from other content.
Retry Patterns
Provide a prominent retry button within the error container so users can re-attempt the request with a single click. For automatic retries, use exponential backoff starting at 1 second and capping at 30 seconds, with a maximum of 3 automatic attempts before requiring manual intervention. Always inform the user when automatic retries are happening and how many attempts remain.
Timeout & Fallback
| Scenario | Timeout Threshold | Fallback Behavior |
|---|---|---|
| Inline suggestion | 5 seconds | Dismiss suggestion silently, allow manual trigger |
| Chat response | 30 seconds | Show timeout message with retry and rephrase options |
| Bulk processing | 60 seconds | Return partial results with option to continue or cancel |
Graceful degradation ensures that timeouts never leave the user in a dead-end state. When a timeout occurs, preserve any partial results that were received and offer clear paths forward: retry the full request, work with partial results, or fall back to a non-AI workflow. Never discard user input when a timeout occurs.
State Transitions
State transitions should use consistent animation timing to create a predictable rhythm. Use 200ms ease-out for transitions into active states (Idle to Loading), 300ms ease-in-out for transitions between active states (Loading to Streaming), and 250ms ease-in for transitions to completion states (Streaming to Success or Error). Avoid instantaneous jumps between states as they feel jarring and can cause users to miss important status changes.