0.8.0.0
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
# Implementation Plan: 为始祖添加父母时的代数重新计算提醒
|
||||
|
||||
## Overview
|
||||
|
||||
本实现计划将分步骤实现代数重新计算警告功能,从工具函数开始,然后创建对话框组件,最后集成到各个入口点。
|
||||
|
||||
## Tasks
|
||||
|
||||
- [x] 1. 扩展代数工具函数
|
||||
- [x] 1.1 在 lib/generation-utils.ts 中添加 isFirstGenerationMember 函数
|
||||
- 实现检查成员是否为第1代的逻辑
|
||||
- 处理边界情况(generation 为 undefined 或无效值)
|
||||
- _Requirements: 1.1, 1.2, 1.3, 1.4_
|
||||
|
||||
- [x] 1.2 在 lib/generation-utils.ts 中添加 shouldShowGenerationWarning 函数
|
||||
- 实现判断是否需要显示警告的逻辑
|
||||
- 只对 father/mother 关系类型返回 true
|
||||
- _Requirements: 1.3, 2.1_
|
||||
|
||||
- [ ]* 1.3 编写属性测试验证第1代成员检测
|
||||
- **Property 1: 第1代成员检测正确性**
|
||||
- **Validates: Requirements 1.1, 1.2, 1.3, 1.4**
|
||||
|
||||
- [x] 2. 创建 GenerationWarningDialog 组件
|
||||
- [x] 2.1 创建 components/tree/generation-warning-dialog.tsx 文件
|
||||
- 使用 AlertDialog 组件作为基础
|
||||
- 实现警告内容展示
|
||||
- 实现确认和取消按钮
|
||||
- _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6_
|
||||
|
||||
- [x] 3. Checkpoint - 确保基础组件完成
|
||||
- 确保所有测试通过,如有问题请询问用户
|
||||
|
||||
- [x] 4. 集成到成员页面
|
||||
- [x] 4.1 修改 app/members/page.tsx 中的 MemberCard 组件
|
||||
- 添加警告对话框状态管理
|
||||
- 修改 handleAddMember 函数添加第1代检测
|
||||
- 集成 GenerationWarningDialog 组件
|
||||
- _Requirements: 4.1, 4.2, 4.3, 4.4_
|
||||
|
||||
- [x] 5. 集成到族谱页面
|
||||
- [x] 5.1 修改 components/tree/d3-org-chart-flow.tsx 组件
|
||||
- 添加警告对话框状态管理
|
||||
- 修改右键菜单的 handleAddMember 函数
|
||||
- 集成 GenerationWarningDialog 组件
|
||||
- _Requirements: 5.1, 5.2, 5.3, 5.4_
|
||||
|
||||
- [x] 5.2 修改 components/tree/family-node.tsx 组件
|
||||
- 添加警告对话框状态管理
|
||||
- 修改右键菜单的添加父母逻辑
|
||||
- 集成 GenerationWarningDialog 组件
|
||||
- _Requirements: 5.1, 5.2, 5.3, 5.4_
|
||||
|
||||
- [x] 6. 集成到添加关系对话框
|
||||
- [x] 6.1 修改 components/tree/add-relation-dialog.tsx 组件
|
||||
- 添加警告对话框状态管理
|
||||
- 在关联已有成员前检测是否需要警告
|
||||
- 在创建新成员前检测是否需要警告
|
||||
- _Requirements: 6.1, 6.2, 6.3, 6.4_
|
||||
|
||||
- [x] 7. Final Checkpoint - 确保所有集成完成
|
||||
- 确保所有测试通过,如有问题请询问用户
|
||||
- 验证成员页面、族谱页面、添加关系对话框三个入口点都能正确显示警告
|
||||
|
||||
## Notes
|
||||
|
||||
- Tasks marked with `*` are optional and can be skipped for faster MVP
|
||||
- Each task references specific requirements for traceability
|
||||
- Checkpoints ensure incremental validation
|
||||
- Property tests validate universal correctness properties
|
||||
- 本功能主要是前端 UI 改动,后端 API 已经实现了代数重新计算逻辑
|
||||
Reference in New Issue
Block a user