7.4 KiB
7.4 KiB
| 1 | ID | Title | Description | Acceptance | Test_Method | Tools | Dev_Status | Review1_Status | Regression_Status | Files | Dependencies | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | A1 | R63 执行合同建档与范围冻结 | 创建并校验 R63 通知中心体验增强执行合同 CSV,冻结范围:1) 后端新增 POST /api/notifications/mark-all-read;2) GET /api/notifications 增加 type 过滤;3) 前端通知页增加批量已读、类型筛选、深链补全;4) Topbar 铃铛增加最近 5 条通知下拉。不新增 Prisma 迁移,不新增 npm 依赖。 | issues/2026-04-14_r63-notification-ux.csv 列完整、Dependencies 为 JSON 数组字符串、A2-A6 范围与方案一致,且 Notes 明确唯一新增后端路由、无迁移、无新依赖与回滚路径。 | 命令:python3 /home/shunli/.codex/skills/plan/scripts/validate_issues_csv.py issues/2026-04-14_r63-notification-ux.csv。检查:1) 12 列完整;2) A2-A6 依赖链合理;3) Notes 明确无迁移、无新依赖、唯一新增后端路由与回滚路径。 | manual | DONE | DONE | DONE | issues/2026-04-14_r63-notification-ux.csv | [] | 回滚路径:删除本次 CSV 不影响业务。 |
| 3 | A2 | 后端通知列表类型过滤与批量已读 | 在 server/src/routes/notifications.js 为 GET /api/notifications 增加逗号分隔的 type 查询参数,并新增 POST /api/notifications/mark-all-read;保持 unreadCount 为全部未读总数,不受 type 过滤影响。扩展现有 notifications 单测覆盖类型过滤与批量已读幂等。 | 1) GET /api/notifications 支持 type=leave.approved,leave.rejected 过滤;2) total 跟随过滤结果;3) unreadCount 仍返回全部未读总数;4) POST /api/notifications/mark-all-read 返回 updatedCount:number 且重复调用幂等;5) node --check 与 notifications.test.js 通过。 | 命令:export PATH=/home/shunli/.nvm/versions/node/v22.20.0/bin:$PATH && cd server && node --check src/routes/notifications.js && npm test -- tests/unit/routes/notifications.test.js。业务:1) type=leave.approved 时仅返回对应类型;2) 调用 mark-all-read 后当前用户未读全部变为已读;3) 再次调用 updatedCount=0;4) unreadCount 不受 type 过滤影响。 | manual | DONE | DONE | DONE | server/src/routes/notifications.js|server/tests/unit/routes/notifications.test.js | ["A1"] | 回滚路径:移除 type 过滤与 mark-all-read 端点代码及相关测试。无 Prisma 迁移,无新依赖。唯一新增后端路由:POST /api/notifications/mark-all-read。 |
| 4 | A3 | 前端通知页批量已读、类型筛选与深链补全 | 在 client/src/pages/NotificationsPage.tsx 增加“全部标为已读”按钮、类型筛选下拉与完整深链映射;在 client/src/api/notifications.ts 增加 type 查询参数与 markAllNotificationsRead API。 | 1) 通知页可按审批待办/报销/请假/采购/差旅/资产/盘点过滤;2) 点击全部标为已读后出现成功 toast 并刷新列表与未读数;3) unreadCount=0 或请求中时按钮禁用;4) leave_request、purchase_request、travel_request、asset/asset_card、inventory_check 深链正确跳转;5) typecheck 与 build 通过。 | 命令:export PATH=/home/shunli/.nvm/versions/node/v22.20.0/bin:$PATH && cd client && npm run typecheck && npm run build。业务:1) /notifications 可见类型筛选与全部标为已读按钮;2) 切换类型后列表变化且分页回到第 1 页;3) 点击通知查看能跳到对应业务页面。 | manual | DONE | DONE | DONE | client/src/api/notifications.ts|client/src/pages/NotificationsPage.tsx|client/src/lib/notificationLinks.ts | ["A1","A2"] | 回滚路径:移除批量已读按钮、类型筛选、通知深链补全及对应 API 接口封装。无 Prisma 迁移,无新依赖。唯一新增后端路由:POST /api/notifications/mark-all-read。 |
| 5 | A4 | Topbar 铃铛通知下拉面板 | 在 client/src/components/navigation/Topbar.tsx 将铃铛改为下拉面板,展示最近 5 条通知、未读数、全部标为已读入口与查看全部链接;点击通知可标记已读后跳转目标页面。 | 1) 铃铛点击展开面板,外部点击或 ESC 可关闭;2) 面板展示最近 5 条通知、相对时间、未读蓝点与查看全部链接;3) 全部标为已读入口可刷新未读数与列表;4) 点击未读通知会先标已读再跳转目标页面;5) typecheck 与 build 通过。 | 命令:export PATH=/home/shunli/.nvm/versions/node/v22.20.0/bin:$PATH && cd client && npm run typecheck && npm run build。业务:1) 顶栏铃铛可展开最近 5 条通知下拉;2) 点击通知可跳转且面板关闭;3) 底部查看全部链接到 /notifications;4) 相对时间展示为刚刚/X 分钟前/X 小时前/X 天前/日期。 | manual | DONE | DONE | DONE | client/src/components/navigation/Topbar.tsx|client/src/api/notifications.ts|client/src/lib/notificationLinks.ts | ["A1","A2"] | 回滚路径:恢复铃铛为直接跳转 /notifications 的 Link,移除下拉面板与最近 5 条通知查询。无 Prisma 迁移,无新依赖。唯一新增后端路由:POST /api/notifications/mark-all-read。 |
| 6 | A5 | 测试与回归验证 | 执行 R63 后端 notifications 测试与前端 typecheck/build,确认批量已读、类型筛选与铃铛面板未引入回归。 | 1) server/src/routes/notifications.js 语法检查通过;2) notifications 路由单测通过;3) client typecheck/build 通过;4) 手工预期与 OpenClaw 场景一致:通知页可批量已读、类型筛选有效、铃铛面板可展开并跳转。 | 命令:export PATH=/home/shunli/.nvm/versions/node/v22.20.0/bin:$PATH && cd server && node --check src/routes/notifications.js && npm test -- tests/unit/routes/notifications.test.js && cd ../client && npm run typecheck && npm run build。业务:检查通知页与 Topbar 铃铛的核心路径均按预期工作。 | manual | DONE | DONE | DONE | server/src/routes/notifications.js|server/tests/unit/routes/notifications.test.js|client/src/api/notifications.ts|client/src/pages/NotificationsPage.tsx|client/src/components/navigation/Topbar.tsx|client/src/lib/notificationLinks.ts | ["A2","A3","A4"] | 回滚路径:若 post-check 失败,暂停提交并回退对应 R63 代码。无 Prisma 迁移,无新依赖。 |
| 7 | A6 | QA、状态回填与提交收口 | 在验证通过后回填 R63 CSV 状态,确认后端测试与前端构建全部通过,并完成 git commit 收口。 | 1) issues/2026-04-14_r63-notification-ux.csv 的 Dev_Status、Review1_Status、Regression_Status 均按实测结果回填;2) 所有验证命令通过;3) git commit 成功,提交信息为 R63 A1-A6:通知中心体验增强。 | 命令:1) python3 /home/shunli/.codex/skills/plan/scripts/validate_issues_csv.py issues/2026-04-14_r63-notification-ux.csv;2) export PATH=/home/shunli/.nvm/versions/node/v22.20.0/bin:$PATH && cd server && node --check src/routes/notifications.js && npm test -- tests/unit/routes/notifications.test.js && cd ../client && npm run typecheck && npm run build;3) git status 确认变更范围。业务:核对通知页与铃铛面板的最终行为与方案一致。 | manual | DONE | DONE | DONE | issues/2026-04-14_r63-notification-ux.csv|server/src/routes/notifications.js|server/tests/unit/routes/notifications.test.js|client/src/api/notifications.ts|client/src/pages/NotificationsPage.tsx|client/src/components/navigation/Topbar.tsx|client/src/lib/notificationLinks.ts | ["A5"] | 回滚路径:若验证失败则不提交,先修复后再回填状态。commit message:R63 A1-A6:通知中心体验增强。无 Prisma 迁移,无新依赖。 |