1.4 KiB
1.4 KiB
T013 — 結果分頁與貼文時間
Status:
doneMilestone:M1Est. change:~180 lines
Goal
完成後,所選 run 只載入目前結果頁,列與明細正確顯示貼文時間/未知及掃入時間。
Depends on
- T012
Inputs
- 讀取 / 依賴:
- 檔案:
apps/web/src/pages/ScoutPage.tsx、apps/web/src/lib/time.ts - 既有能力 / API:ScoutRepo.listRunPosts、Pager、formatLocalDateTime
- Spec 段落:§4 流程 E、§9 #7–#9
- 檔案:
Outputs
程式變更(預期路徑)
| 路徑 | 動作 | 說明 |
|---|---|---|
apps/web/src/pages/ScoutPage.tsx |
edit | 將 client pageSlice 換成 result page fetch;顯示 posted_at/unknown/created_at。 |
apps/web/src/pages/ScoutPage.test.tsx |
edit | 驗證時間文案、未知置底契約與翻結果頁。 |
行為變更
- 結果預設每頁 8;前端不重排 server 的 score 順序;換頁選第一筆。
API / 契約(若有)
- posted_at 為貼文時間,created_at 只能標為掃入時間。
Out of scope
- 不處理 live HTTP mapping,不新增相關性排序切換。
Acceptance
- 每列與明細必有貼文時間或「貼文時間未知」。
- 指令:
cd apps/web && npm test -- src/pages/ScoutPage.test.tsx
驗收結果:npm run build、ScoutPage 2 tests passed。
Notes
不得因 JavaScript ns 精度在前端重新排序 server page。