3 changed files with 81 additions and 24 deletions
@ -0,0 +1,22 @@ |
|||
# useCommandProgress 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:** 抽出指令进度状态机与 `runCommand`。 |
|||
|
|||
**Spec:** `docs/superpowers/specs/2026-08-28-use-command-progress-design.md` |
|||
|
|||
### Task 1 |
|||
|
|||
- Create `src/composables/useCommandProgress.js` |
|||
- Modify `MonitorView.vue`:删除 `COMMAND_STATUS`~`runCommand` 块,改为 composable 调用;保留 Escape/`onUnmounted` 对 `closeCommandProgress` 的调用;`detailActions.statusText` 仍绑 `buttonStatusText` |
|||
|
|||
Commit: `refactor: 抽取 useCommandProgress 指令进度逻辑` |
|||
|
|||
### Task 2 冒烟(Main) |
|||
|
|||
evaluate `startCommandProgress` 或打开浮层;关闭有效。 |
|||
|
|||
## 约束 |
|||
|
|||
不改后台;精确 git add;中文 commit;跳过全量测试 |
|||
@ -0,0 +1,42 @@ |
|||
# useCommandProgress 设计 |
|||
|
|||
## 目标 |
|||
|
|||
把 MonitorView 内指令进度状态机(`COMMAND_STATUS`、`commandProgress`、轮询、起停、按钮状态文案)抽到 `src/composables/useCommandProgress.js`。`runCommand` 一并迁入,依赖通过参数注入。 |
|||
|
|||
## 非目标 |
|||
|
|||
- 不改 CommandProgressFloat UI |
|||
- 不改 devices.sendCommand API |
|||
- 不抽直播 / 地图 |
|||
|
|||
## 契约 |
|||
|
|||
```js |
|||
const { |
|||
commandProgress, |
|||
commandProgressTerminalLabel, |
|||
buttonStatusText, |
|||
startCommandProgress, |
|||
closeCommandProgress, |
|||
runCommand, |
|||
} = useCommandProgress({ |
|||
getRecord: () => record.value, |
|||
ui, |
|||
devices, |
|||
reload, |
|||
}) |
|||
``` |
|||
|
|||
- Escape / `onUnmounted` 仍由页面调 `closeCommandProgress` |
|||
- 轮询仍用 `request` + `urls.COMMAND` |
|||
|
|||
## 实现 |
|||
|
|||
1. 新建 composable;MonitorView 删除内联命令块并接线 |
|||
2. Commit: `refactor: 抽取 useCommandProgress 指令进度逻辑` |
|||
3. 冒烟:打开浮层(evaluate start 或 mock 下发)+ 关闭 |
|||
|
|||
## 约束 |
|||
|
|||
精确 git add;中文 commit;新建 `src/composables/` |
|||
Loading…
Reference in new issue