๐จ AVA Dashboard WebUI โ Design Spec
OPS-021 โ Web interface cho phรฉp quแบฃn lรฝ stories, chat per-story, configure pipeline, approve/reject phases
๐ฏ Mแปฅc tiรชu
Rio cรณ thแป quแบฃn lรฝ toร n bแป story pipeline tแปซ browser โ khรดng cแบงn Discord, khรดng cแบงn CLI.
- Thรชm/xรณa stories
- Chat vแปi AVA per-story (full OpenClaw WebUI)
- Configure voice, concept, mood, pipeline options
- Approve / backward / forward mแปi phase
- Xem real-time pipeline progress
Status
๐ก Design PhasePages
6Timeline
7-11 daysDeploy
Cloudflare Pages๐๏ธ Architecture
Connection Options
| Option A | Cloudflare Tunnel | CF Worker โ Tunnel โ Mac mini (production) |
| Option B | Direct LAN | Frontend served locally (development) |
๐ฑ 6 UI Pages
1. ๐ Home
Prompt bar + recent activity. Gรต text โ auto-route tแปi tool/story phรน hแปฃp.
2. ๐ฅ Inbox
Story milestone feed + notifications. Click โ story detail.
3. ๐ Hubs
Channel workspaces. Mแปi YouTube channel = 1 Hub (own context, files, system prompt).
4. ๐ Stories
List within Hub + CRUD (thรชm/xรณa/archive stories).
5. ๐ Story Detail
Visual pipeline + chat + phase control. Core page.
6. โ๏ธ Settings
Global config, API keys, model preferences.
๐ Stories List
Features
- List tแบฅt cแบฃ stories (active / archived / published)
- Filter by: status, genre, date
- Sort by: updated, created, phase
- [+ New Story] โ modal tแบกo story (title, genre, archetype, source)
- [๐๏ธ Delete] โ confirm dialog, soft-delete + archive
- Click card โ Story Detail page
๐ Story Detail โ Split Layout
Left Panel โ Pipeline Phases
- Visual progress tree (Phase 0-10)
- Status icons: โ done / ๐ running / โณ waiting / โ failed / ๐ blocked
- Scene loop: expandable per-scene status
- Click phase โ view gate tokens, auditor scores, timestamps
Right Panel โ Chat Session
- Dedicated OpenClaw session per story
- Streaming responses, markdown, code blocks
- Context auto-loaded: bible, scenes, config
- History preserved across page visits
- Quick commands:
/status/approve/cost
๐ฌ Chat Session Integration
Session Architecture
Story STO-006 โ OpenClaw session key: "ava:story:STO-006"
โโโ Context auto-loaded: bible, scene specs, gate status
โโโ Model: configurable per-story (default: claude-sonnet-4.6)
โโโ History: persistent in OpenClaw sessions/
Chat Features (match OpenClaw WebUI)
| Feature | Description |
|---|---|
| Streaming | Real-time token display |
| Markdown | Code blocks, tables, lists |
| History | Scroll back through conversation |
| Context | AVA knows story, phase, gate status |
| Tool results | Show tool calls inline |
| Commands | /status /approve /reject /config /cost /preview |
WebSocket Protocol
Client โ Server: { type: "message", storyId: "STO-006", text: "..." }
Server โ Client: { type: "chunk", text: "..." } // streaming
Server โ Client: { type: "tool_call", name: "..." }
Server โ Client: { type: "tool_result", content: "..." }
Server โ Client: { type: "done", messageId: "..." }
Server โ Client: { type: "phase_update", phase: 5, status: "running" }
โ๏ธ Pipeline Config
Dropdown Sources
| Dropdown | Source |
|---|---|
| Genre | GENRE_REGISTRY keys from config.py |
| Archetype | ARCHETYPE_REGISTRY, filtered by compatible genres |
| Voice | Fish Audio voices + preview button |
| Style/LUT | pipeline/assets/luts/ directory |
| Mood curve | Interactive drag-points โ emotional_curve in genre config |
๐ฎ Phase Control
| Action | Button | Effect | Conditions |
|---|---|---|---|
| Approve | โ Approve | Advance โ next phase | Current phase complete, gate PASS |
| Back | โ Back | Regress โ previous phase | Any time (confirm required) |
| Forward | โถ Forward | Skip ahead | Admin override, double-confirm |
| Abort | ๐ Abort | Stop โ BLOCKED | Any time |
| Retry | ๐ Retry | Re-run current phase | On failure/block |
API Example
// Rio clicks [โ
Approve] on Phase 3
POST /api/stories/STO-006/gate
{ "action": "approve", "phase": 3, "note": "Bible looks good" }
โ { "success": true, "gate_token": "G3_abc...", "next_phase": 4 }
// Rio clicks [โ Back] from Phase 5 to 4
POST /api/stories/STO-006/gate
{ "action": "regress", "to_phase": 4, "note": "Scene specs need revision" }
๐ Genspark Workflows Integration
Concept
Lแบฅy cแบฃm hแปฉng tแปซ Genspark Workflows (visual no-code pipeline builder). AVA ฤรฃ cรณ pipeline code โ ta build visual interface lรชn trรชn pipeline cรณ sแบตn, khรดng build lแบกi.
Mapping Genspark โ AVA
| Genspark Concept | AVA Equivalent | Implementation |
|---|---|---|
| Workflows (visual steps) | Pipeline Phase View | Vertical step flow, click โ detail panel |
| Hub (project workspace) | Channel Workspace | Mแปi YouTube channel = 1 Hub (own context/files) |
| Templates | Story Templates | "Quick Revenge", "Hidden Identity" pre-configs |
| Natural Language Create | Smart Story Creation | "Tแบกo story revenge vแป..." โ auto-fill config |
| Inbox | Story Milestone Feed | Milestone notifications + click to detail |
| "Test run" | Manual trigger 1 phase | Run single phase on demand |
| "Turn on" | Toggle Auto mode | Switch Guided โ Auto |
Hub per Channel
๐ Family Revenge Stories
Brand rules, voice config, 50+ audience presets, revenge/healing templates
๐ข Active๐ The Love Compass
Different brand, audience, tone. Navy/gold palette, psychology content
๐ก PlannedWorkflow Templates
๐ Quick Revenge Story
Research โ Bible โ 25 Scenes โ Voice โ Visual โ Render โ Upload
Genre: revenge, Archetype: betrayed_victim, Dark mood
๐ Hidden Identity Story
Research โ Bible (2-layer villain) โ Earned backstory โ Scenes โ Render
Genre: hidden_identity, 2-layer villain, Earned backstory
๐ Custom Template
Drag & drop phases, custom genre/archetype/curve
Full configuration, no presets
Natural Language Creation
Rio gรต: "Tแบกo story revenge vแป bร ngoแบกi bแป con rแป phแบฃn bแปi, 25 scenes, dark mood"
โ Dashboard auto-fills:
Genre: revenge
Archetype: betrayed_victim
Scene count: 25
Mood: dark
Voice: calm storyteller
โ [Review & Create]
๐ง Tech Stack
| Layer | Technology | Rationale |
|---|---|---|
| Frontend | Next.js 15 + React 19 | SSR, RSC, great DX |
| Styling | Tailwind CSS + shadcn/ui | Fast, consistent dark theme |
| Chat UI | Custom (OpenClaw patterns) | Streaming, markdown, tools |
| State | Zustand + React Query | Lightweight cache + real-time |
| WebSocket | CF Durable Objects | Per-story persistent connections |
| Backend | Cloudflare Workers | Edge compute, low latency |
| Tunnel | cloudflared | Secure Mac mini โ CF |
| Auth | Cloudflare Access (Zero Trust) | SSO, no exposed ports |
| DB | PostgreSQL via tunnel | Existing data, no migration |
| Deploy | wrangler pages deploy | Already in codebase |
๐ API Endpoints
โโ STORIES โโ
GET /api/stories # List all stories
POST /api/stories # Create new story
GET /api/stories/:id # Detail + phase status
DELETE /api/stories/:id # Soft-delete
PATCH /api/stories/:id/config # Update pipeline config
โโ GATES โโ
POST /api/stories/:id/gate # approve / back / forward
GET /api/stories/:id/gates # All gate tokens
GET /api/stories/:id/events # Event log (JSONL)
GET /api/stories/:id/cost # Cost report
โโ CHAT โโ
WS /api/stories/:id/chat # WebSocket session
GET /api/stories/:id/chat/history # Chat history
โโ CONFIG โโ
GET /api/config/genres # GENRE_REGISTRY
GET /api/config/archetypes # ARCHETYPE_REGISTRY
GET /api/config/voices # Available voices
GET /api/config/styles # Visual styles + LUTs
๐ Implementation Timeline โ 7-11 Days
-
Phase 1 โ Foundation (1-2 days)
Next.js setup + Tailwind + shadcn. CF Pages deploy (empty shell). CF Tunnel setup. Basic auth via CF Access. -
Phase 2 โ Stories CRUD (1-2 days)
Stories list page. Create modal. Delete/archive. Story detail (phase progress). -
Phase 3 โ Pipeline Config (1 day)
Config page. Genre/archetype dropdowns. Voice selector + preview. Emotional curve editor. Quality sliders. -
Phase 4 โ Phase Control (1-2 days)
Approve/Back/Forward buttons. Gate status display. Event log viewer. Cost tracker. Real-time updates. -
Phase 5 โ Chat Session (2-3 days)
Per-story chat UI. WebSocket to OpenClaw. Streaming. Markdown + code. History. Quick commands. -
Phase 6 โ Polish (1 day)
Dark theme. Mobile responsive. Loading states. Error handling. Keyboard shortcuts.
โ Open Questions cho Rio
1. Auth
Cloudflare Access (recommended) hay custom login?
2. Domain
dashboard.ava-project.com hay tรชn khรกc?
3. Multi-user
Chแป Rio access hay cแบงn role system (viewer/editor/admin)?
4. Chat model
Default model cho story chat sessions? Sonnet hay Opus?
5. CF Account
ฤรฃ cรณ Cloudflare account chฦฐa? Free plan ฤแปง.
6. Real-time
WebSocket live updates hay polling ฤแปง?
AVA Dashboard WebUI โ Design Spec v1.0
Last updated: 2026-03-24 | OPS-021