From 2da2e6299bb9ee1c05dbfa32bfc0532b2b8894c7 Mon Sep 17 00:00:00 2001 From: xiaosi <2652281683@qq.com> Date: Mon, 31 Aug 2026 15:01:07 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=A2=9E=E5=8A=A0=20useMonitorLive=20?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E4=B8=8E=E5=AE=9E=E7=8E=B0=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Monitor 直播会话逻辑抽离。 --- .../plans/2026-08-28-use-monitor-live.md | 25 +++++++++++ .../2026-08-28-use-monitor-live-design.md | 41 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 docs/superpowers/plans/2026-08-28-use-monitor-live.md create mode 100644 docs/superpowers/specs/2026-08-28-use-monitor-live-design.md diff --git a/docs/superpowers/plans/2026-08-28-use-monitor-live.md b/docs/superpowers/plans/2026-08-28-use-monitor-live.md new file mode 100644 index 0000000..368ed57 --- /dev/null +++ b/docs/superpowers/plans/2026-08-28-use-monitor-live.md @@ -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 diff --git a/docs/superpowers/specs/2026-08-28-use-monitor-live-design.md b/docs/superpowers/specs/2026-08-28-use-monitor-live-design.md new file mode 100644 index 0000000..a531434 --- /dev/null +++ b/docs/superpowers/specs/2026-08-28-use-monitor-live-design.md @@ -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