thread-master/docs/product/scout-topic-quality/tasks/T012-scout-run-browser.md

57 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# T012 — 批次列表與獨立分頁
> Status: `done`
> Milestone: `M1`
> Est. change: `~180 lines`
## Goal
完成後Scout 頁面從 listRuns 瀏覽真正批次,批次頁碼不再由全量 posts 前端分組產生。
## Depends on
- T011
## Inputs
- 讀取 / 依賴:
- 檔案:`apps/web/src/pages/ScoutPage.tsx`
- 既有能力 / APIPager、ScoutRepo.listRuns
- Spec 段落§4 流程 D、§9 #10#13
## Outputs
### 程式變更(預期路徑)
| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/web/src/pages/ScoutPage.tsx` | edit | 移除 runGroups 主路徑,加入 run page state、載入、選取與 run metadata。 |
| `apps/web/src/pages/ScoutPage.test.tsx` | edit | 驗證第 1 頁載入、翻批次頁、選 run 與結果頁重設。 |
### 行為變更
- 批次預設每頁 10依 server 順序顯示;切換 run 保留批次頁碼。
### API / 契約(若有)
- 只呼叫 listRuns({page,pageSize}),不得先抓全部 posts。
## Out of scope
- 不在本 task 實作結果時間卡片或 job 完成提示。
## Acceptance
- [x] 批次 total 使用 pagination.total非目前 list.length。
- [ ] 指令:
```bash
cd apps/web && npm test -- src/pages/ScoutPage.test.tsx
```
驗收結果:`npm run build`、ScoutPage 2 tests passed。
## Notes
保留 homework 流程,但不再用 homework 推導新 run。