Skip to content

feat(gui): 左侧栏评审进度面板 - #42

Open
Nicholas023 wants to merge 4 commits into
mainfrom
feat/progress-panel
Open

Nicholas023 wants to merge 4 commits into
mainfrom
feat/progress-panel

Conversation

@Nicholas023

Copy link
Copy Markdown
Owner

问题

一次 scan 跑了 14 分钟,界面上只有一个不会动的「评审中」。原因是内核拉起时 stdio: 'ignore',它写的每一行进度都被丢弃了。

做法

层 改动
内核 每次阶段/轮次变化写 <pluginRoot>/progress/<taskId>.json(原子写,失败不影响评审)
宿主 GET /api/code-review/progress、POST /api/code-review/cancel(走 webServer,与 mac-tunnel 同一套路由机制)
客户端 注册 sidebar.panellist 侧栏入口 + 对应 main 面板,3 秒轮询,运行中的条目带「取消」按钮

为什么不用 remote/typert

本机的 mac-tunnel / dsh-opencode-ip-guard 已经证明 webServer 路由足够且最简单:不需要生成描述符,也不引入依赖。

验证

  • 11 个新测试(写入/读取/裁剪/合并任务卡终态/路径清洗)
  • 全套 502 通过
  • 构建:客户端 bundle 27.0 KB

待实机验证

合并后需要重启 DSH,左侧栏才会出现「代码审查」入口。

本 PR 由 DeepSeek Harness 辅助创建

A scan could run for 14 minutes with nothing on screen but a frozen
"reviewing": the kernel is spawned with stdio "ignore", so every progress
line it writes was discarded.

- kernel writes <pluginRoot>/progress/<taskId>.json on each stage/round
- host serves GET /api/code-review/progress and POST /api/code-review/cancel
  over webServer, the same route mechanism mac-tunnel uses here
- client registers a sidebar.panellist entry plus the matching main panel,
  polling every 3s; running items get a Cancel button

11 new tests. Full suite: 502 passed.
…he panel

The panel shipped in the previous commit showed six phantom tasks named
dcr-e2e-repo / scan-1 / e2e-task, all stuck on "writing report" with a
cancel button. They were written by the test suite: executeTask fell back to
resolveDshRoot() and every e2e test therefore wrote into the real ~/.dsh.

executeTask now writes progress only when the caller passes dshRoot; the
kernel passes it, tests do not. Verified empirically: 502 tests, progress
dir still empty afterwards.

The panel itself is redrawn: neutral rgba palette, one card per task with
status / target / detail / action rows, live elapsed time, three items,
and a dashed empty state instead of a blank page.
…porting"

Without it a finished task kept its last progress file at stage=reporting,
so the panel can only tell it is done by looking the task card up. If the
card is gone (as with the six phantom test rows) the item looks like it is
still running and keeps offering a cancel button.
Feedback from the first real look:
 - an absolute report path is unreadable by eye, so it needs a copy button;
 - the result should be readable in place instead of opening a file;
 - green/yellow/red for done/running/failed rather than one grey dot.

GET /api/code-review/report?taskId= serves the findings of a finished task,
guarded to an absolute .json path recorded on its own task card, so it never
becomes a general file reader. The panel expands inline, and every font size
is now em-relative so it follows the host base size instead of fighting it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant