Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2.7 KiB
Mini Program Script Generation Feedback Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Add animated progress, long-wait guidance, and graceful failure recovery to the mini-program 心愿实现中 screen.
Architecture: Keep all AI stream calls unchanged and add a small local feedback state in ScriptView.vue. The screen uses timer thresholds to distinguish normal waiting, slow waiting, very slow waiting, streaming output, and failure.
Tech Stack: Vue 3 single-file component, uni-app mini-program build, existing useTypewriterStream composable.
Task 1: Add Generation Feedback State
Files:
-
Modify:
mini-program/src/pages/main/ScriptView.vue -
Add
generationStatus,generationError,generationHintIndex, andlastSubmitSourcerefs. -
Add local timers for rotating hints, 8-second slow state, and 20-second very-slow state.
-
Add
startGenerationFeedback,clearGenerationFeedbackTimers,markGenerationStreaming, andmarkGenerationFailedhelpers. -
Clear timers on success, failure, returning home, and component unmount.
Task 2: Update Generation Flow
Files:
-
Modify:
mini-program/src/pages/main/ScriptView.vue -
Call
startGenerationFeedback()whensubmitWishentersviewState = 'generating'. -
Call
markGenerationStreaming()in the streamonDeltacallback before pushing typewriter text. -
On failure, keep
viewState = 'generating'and show a failure state instead of immediately returning home with only a toast. -
Add
retryGeneration()andreturnToEdit()actions for the failure state.
Task 3: Update Generation Screen UI
Files:
-
Modify:
mini-program/src/pages/main/ScriptView.vue -
Replace static
心愿实现中……copy with computedgenerationTitle. -
Add thinking dots when no stream output has arrived.
-
Add a secondary hint line under the main loading copy.
-
Add failure actions
再试一次and返回修改whengenerationStatus === 'failed'.
Task 4: Add Themed Animations
Files:
-
Modify:
mini-program/src/pages/main/ScriptView.vue -
Animate
.loading-orbitwith a gentle breathing pulse. -
Animate
.loading-orbit::afteras the small orbiting light. -
Add animated thinking dots inside the system bubble.
-
Style the failure copy and actions in the current purple/gold theme.
Task 5: Validate
Commands:
-
cd mini-program && npm run build:mp-weixin -
git diff --check -
Mini-program build passes.
-
Diff check reports no new whitespace errors.