2 changed files with 66 additions and 0 deletions
@ -0,0 +1,25 @@ |
|||||
|
# useMonitorLive 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:** 抽出直播会话逻辑。 |
||||
|
|
||||
|
**Spec:** `docs/superpowers/specs/2026-08-28-use-monitor-live-design.md` |
||||
|
|
||||
|
### Task 1 |
||||
|
|
||||
|
Create `src/composables/useMonitorLive.js`;迁入 `live` reactive、`livePhaseText`、`canFullscreenLive`、`toggleLive`/`fullscreenLive`/`openLive`/`refreshPlayURL`/`scheduleLiveHeartbeat`/`closeLive`。 |
||||
|
|
||||
|
注入:`getDockId`(或 `getRecord`+推导)、`ui`、`getLivePlayer`。 |
||||
|
|
||||
|
MonitorView 删除对应块;保留 `detailLiveView` computed 组装(可用 composable 返回值);模板事件不变。 |
||||
|
|
||||
|
Commit: `refactor: 抽取 useMonitorLive 直播会话逻辑` |
||||
|
|
||||
|
### Task 2 冒烟(Main) |
||||
|
|
||||
|
页面加载无 error;toggle 按钮存在;可 evaluate closeLive 无抛错。 |
||||
|
|
||||
|
## 约束 |
||||
|
|
||||
|
跳过全量测试;精确 git add;中文 commit |
||||
@ -0,0 +1,41 @@ |
|||||
|
# useMonitorLive 设计 |
||||
|
|
||||
|
## 目标 |
||||
|
|
||||
|
抽出 Monitor 直播会话:`live` 状态、`openLive`/`closeLive`/`toggleLive`/`fullscreenLive`、heartbeat、playUrl 刷新与衍生文案。 |
||||
|
|
||||
|
## 契约 |
||||
|
|
||||
|
```js |
||||
|
const { |
||||
|
live, |
||||
|
livePhaseText, |
||||
|
canFullscreenLive, |
||||
|
detailLiveView partial fields OR expose live + helpers, |
||||
|
toggleLive, |
||||
|
fullscreenLive, |
||||
|
closeLive, |
||||
|
openLive, |
||||
|
} = useMonitorLive({ |
||||
|
getDockId: () => /* 当前直播目标 dockId */, |
||||
|
ui, |
||||
|
getLivePlayer: () => detailPanelRef.value?.livePlayerRef, |
||||
|
}) |
||||
|
``` |
||||
|
|
||||
|
页面继续组装 `detailLiveView`(可把 phaseText/canFullscreen/playUrl 从 composable 取)。 |
||||
|
|
||||
|
## 非目标 |
||||
|
|
||||
|
- 不改 LivePlayer / API 形状 |
||||
|
- 不迁详情面板 |
||||
|
|
||||
|
## 实现 |
||||
|
|
||||
|
1. `src/composables/useMonitorLive.js` |
||||
|
2. MonitorView 接线;`onUnmounted` 仍 `closeLive()` |
||||
|
3. Commit: `refactor: 抽取 useMonitorLive 直播会话逻辑` |
||||
|
|
||||
|
## 约束 |
||||
|
|
||||
|
精确 git add;中文 commit |
||||
Loading…
Reference in new issue