Handle a stalled request without erasing the user prompt
A recoverable failure needs both explanation and retained input. A loading state should end on success, failure or timeout.
Start here
This example uses the sample details below. Replace them with your own facts before applying the instructions.
- Chat submit can time out; draft text exists locally.
Start with the facts
Chat submit can time out; draft text exists locally. Keep a small reproducible example and the expected behavior. Remove secrets from the code or error message before requesting help.
Spot the problem
The wording or action to avoid is: “Clear the input and display an unexplained spinner forever.” A recoverable failure needs both explanation and retained input. A loading state should end on success, failure or timeout.
Make the correction
Preserve the draft, show a recoverable error and allow a deliberate retry after the request state is resolved.
Check before using the result
Simulate a rejected request and confirm the prompt remains available and duplicate submissions are not triggered accidentally.
Worked example and reusable input
Use the stated inputs to reproduce checked local outputs. Replace sample facts when applying a brief to your own work.
TASK Handle a stalled request without erasing the user prompt SAMPLE INPUT — replace with your actual facts Chat submit can time out; draft text exists locally. AVOID Clear the input and display an unexplained spinner forever. CORRECTED APPROACH Preserve the draft, show a recoverable error and allow a deliberate retry after the request state is resolved. ACCEPTANCE CHECK Simulate a rejected request and confirm the prompt remains available and duplicate submissions are not triggered accidentally.
Key takeaways
- A recoverable failure needs both explanation and retained input. A loading state should end on success, failure or timeout.
- Simulate a rejected request and confirm the prompt remains available and duplicate submissions are not triggered accidentally.