## Existing Code Insights
### Reusable Assets
- `ws.py` `ConnectionManager.broadcast()` — already wired for multi-client broadcast; `preview_update` messages can use this
- `UDPSender` (wired in `main.py`) — available as `app.state.udp_sender` or module-level ref; Phase 5 calls `send()` from the tick handler
- `show_store.load(show_id)` — async, used in `shows.py` and `timeline.py`; ws.py can call this on `load` message
- `lightsync/frontend/timeline/timeline.js` `this.tracks` — the live track data (including blocks) is already in the browser; preview can read `timeline.tracks` directly to know which blocks are active at `audio.currentTime`
### Established Patterns
- WebSocket message protocol: `{"type": "...", ...}` — extend with `{"type": "preview_update", "device_id": "...", "animation": "chase", "color": [0, 255, 180]}`
- Server-side per-connection state pattern already used in `ws.py` (`current_file`, `beats`, `last_beat_reported`)
- CSS: `--accent` (cyan), `--bg` (near-black), `--border` (dimmed cyan); panel borders `1px solid var(--border)`
- Panel strip pattern from Phase 4: `` horizontal row — preview strip follows same structure
### Integration Points
- `ws.py` websocket_endpoint function — add cue scheduler loop inside the `tick` branch; needs `show` loaded per-connection
- `main.py` — `app.state.udp_sender` already initialized; access from ws.py via `websocket.app.state.udp_sender`
- `index.html` layout — preview panel slot between `.timeline-container` and `.transport-bar`
- `app.js` WebSocket `onmessage` handler — add `preview_update` case to update the preview canvas
## Specific Ideas
- Terminal aesthetic carries forward: preview strips should look like terminal status bars — flat rectangles, color fill, device name label in monospace uppercase, no rounded corners.
- The "lights dark" / "no active block" state should show the device label with a dim inactive indicator — consistent with the rest of the UI's use of `--text-dim`.
## Deferred Ideas
- Per-LED frame simulation in the preview (see what the chase animation actually looks like moving) — v2 or Phase 6+
- Preview panel as a standalone full-screen mode — out of scope
- Keyboard shortcut customization UI — out of scope for v1
---
*Phase: 05-live-show-execution*
*Context gathered: 2026-04-07*