# 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`

- [x] Add `generationStatus`, `generationError`, `generationHintIndex`, and `lastSubmitSource` refs.
- [x] Add local timers for rotating hints, 8-second slow state, and 20-second very-slow state.
- [x] Add `startGenerationFeedback`, `clearGenerationFeedbackTimers`, `markGenerationStreaming`, and `markGenerationFailed` helpers.
- [x] Clear timers on success, failure, returning home, and component unmount.

### Task 2: Update Generation Flow

**Files:**
- Modify: `mini-program/src/pages/main/ScriptView.vue`

- [x] Call `startGenerationFeedback()` when `submitWish` enters `viewState = 'generating'`.
- [x] Call `markGenerationStreaming()` in the stream `onDelta` callback before pushing typewriter text.
- [x] On failure, keep `viewState = 'generating'` and show a failure state instead of immediately returning home with only a toast.
- [x] Add `retryGeneration()` and `returnToEdit()` actions for the failure state.

### Task 3: Update Generation Screen UI

**Files:**
- Modify: `mini-program/src/pages/main/ScriptView.vue`

- [x] Replace static `心愿实现中……` copy with computed `generationTitle`.
- [x] Add thinking dots when no stream output has arrived.
- [x] Add a secondary hint line under the main loading copy.
- [x] Add failure actions `再试一次` and `返回修改` when `generationStatus === 'failed'`.

### Task 4: Add Themed Animations

**Files:**
- Modify: `mini-program/src/pages/main/ScriptView.vue`

- [x] Animate `.loading-orbit` with a gentle breathing pulse.
- [x] Animate `.loading-orbit::after` as the small orbiting light.
- [x] Add animated thinking dots inside the system bubble.
- [x] 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`

- [x] Mini-program build passes.
- [x] Diff check reports no new whitespace errors.
