6e5a379bef
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1.7 KiB
1.7 KiB
Mini Program Script Generation Feedback Design
Goal
Improve the mini-program 心愿实现中 screen so users can clearly tell that generation is running, understand long waits, and recover gently if the AI stream fails or produces no output.
Approved Approach
Use option A: add a scene-friendly loading state with phased guidance and a graceful failure panel.
Behavior
When script generation starts:
- The page stays on the current
心愿实现中screen. - The existing chat bubble and orbit motif remain.
- The orbit gets breathing/rotating animation and small star-dot motion.
- A rotating hint line appears while no stream text has arrived.
- If no stream text arrives after about 8 seconds, show a gentle slow-wait message.
- If no stream text arrives after about 20 seconds, show a warmer network-slow message, while still waiting for the stream.
- Once stream text arrives, switch to the existing typewriter text output.
- If the call fails or returns empty output, keep the user on the generation screen and show a soft failure state with
再试一次and返回修改.
Implementation Notes
Only mini-program/src/pages/main/ScriptView.vue needs to change.
Add a small local generation feedback state:
generationStatus:idle | waiting | slow | verySlow | streaming | failedgenerationError: user-facing failure copy- timers for rotating hints and long-wait thresholds
Do not change backend API calls or stream protocol. streamAiScene remains the source of stream output. Existing useTypewriterStream continues to render text progressively after the first output arrives.
Validation
Run:
cd mini-program
npm run build:mp-weixin
Expected result: build succeeds with no new errors.