1. 排行榜悬浮窗关闭后小按钮消失问题 - 修复面板居中模式关闭时按钮位置错误 - 保存并恢复按钮的居中状态 2. 首页tag按钮按素材数量排序 - 添加按素材数量降序排序逻辑 3. 上传弹窗输入框浅色模式文字不可见 - 添加 text-slate-900 确保浅色模式下文字可见 - 添加 placeholder 样式确保占位符正确显示
4.9 KiB
4.9 KiB
Implementation Plan
BUG修复和新功能 - 2025年12月
-
1. 修复favicon.ico 404错误
-
1.1 创建或复制favicon.ico文件到public目录
- 使用项目logo生成favicon
- 确保文件格式正确(ICO格式,包含16x16和32x32尺寸)
- Requirements: 1.1, 1.2
-
-
2. 修复PSD标签按钮样式问题
-
2.1 修改Tag组件零素材状态样式
- 修改
components/ui/Tag.tsx - 确保零素材时文字颜色对比度足够
- 适配浅色和深色模式
- Requirements: 2.1, 2.2, 2.3
- 修改
-
2.2 编写Tag组件属性测试
- Property 1: Tag组件零素材状态文字可见性
- Validates: Requirements 2.1, 2.2, 2.3
-
-
3. 修复筛选框"全部"按钮数量统计
-
3.1 修改筛选字段API统计逻辑
- 修改
app/api/home-filter-fields/route.ts - 统计该字段有非空值的素材数量
- 而非系统总素材数
- Requirements: 4.1, 4.2
- 修改
-
3.2 编写统计逻辑属性测试
- Property 4: 筛选字段"全部"按钮统计准确性
- Property 5: 筛选统计实时更新
- Validates: Requirements 4.1, 4.2, 4.3, 4.4
-
-
4. 修复管理员素材删除权限
-
4.1 修改素材删除API权限验证
- 修改
app/api/materials/[id]/route.ts - 添加素材归属验证逻辑
- 管理员只能删除自己上传的素材
- 超级管理员可删除任意素材
- Requirements: 3.1, 3.2, 3.3, 3.4
- 修改
-
4.2 编写权限验证属性测试
- Property 2: 管理员素材删除权限验证
- Property 3: 超级管理员删除权限
- Validates: Requirements 3.1, 3.2, 3.3
-
-
5. Checkpoint - 确保BUG修复测试通过
- Ensure all tests pass, ask the user if questions arise.
-
6. 删除AI工作流预制模板
- 6.1 从预制模板配置中移除ai-material
- 修改
lib/upload-template-presets.ts - 修改
lib/system-integrity.ts - 修改相关测试文件
- Requirements: 8.1, 8.2
- 修改
- 6.2 创建AI模板素材迁移脚本
- 创建
scripts/migrate-ai-to-other-template.ts - 将使用AI模板的素材迁移到other-material
- Requirements: 8.3
- 创建
- 6.3 编写模板移除属性测试
- 创建
lib/__tests__/template-migration.test.ts - Property 12: AI模板移除
- Property 13: AI模板素材迁移
- Validates: Requirements 8.2, 8.3
- 创建
- 6.1 从预制模板配置中移除ai-material
-
7. 新增音频素材模板
- 7.1 添加音频素材预制模板配置
- 修改
lib/upload-template-presets.ts添加audio-material - 修改
lib/system-integrity.ts更新模板列表 - 字段:productModel, categoryName, sceneName, audioDuration, audioFormat
- Requirements: 7.1, 7.2
- 修改
- 7.2 音频文件上传已支持
- 系统已支持 MP3, WAV, FLAC, AAC, OGG, M4A 格式
- Requirements: 7.3, 7.4
- 7.3 编写音频功能属性测试
- 在
lib/__tests__/template-migration.test.ts中添加 - Property 10: 音频格式支持
- Property 11: 音频元数据显示
- Validates: Requirements 7.3, 7.4
- 在
- 7.1 添加音频素材预制模板配置
-
8. Checkpoint - 确保模板修改测试通过
- 所有测试通过
-
9. 新增个人中心浏览历史功能
- 9.1 创建BrowseHistory数据库表
- 修改
prisma/schema.prisma - 添加 BrowseHistory 模型
- Requirements: 5.1
- 修改
- 9.2 创建浏览历史API
- 创建
app/api/user/history/route.ts - GET: 获取浏览历史列表
- POST: 记录浏览行为
- DELETE: 清除历史记录
- Requirements: 5.1, 5.3, 5.4
- 创建
- 9.3 在素材详情页记录浏览历史
- 修改
app/share/[id]/page.tsx - 用户查看时自动记录
- Requirements: 5.1
- 修改
- 9.4 在个人中心添加浏览历史Tab
- 修改
app/profile/page.tsx - 添加浏览历史入口和列表展示
- Requirements: 5.2, 5.5
- 修改
- 9.5 编写浏览历史属性测试
- 创建
lib/__tests__/browse-history.test.ts - Property 6: 浏览历史记录创建
- Property 7: 浏览历史排序
- Property 8: 浏览历史自动清理
- Validates: Requirements 5.1, 5.3, 5.4
- 创建
- 9.1 创建BrowseHistory数据库表
-
10. 新增榜单作者作品链接
- 10.1 创建作者作品页面
- 创建
app/author/[authorName]/page.tsx - 展示该作者的所有素材
- 处理空状态
- Requirements: 6.3, 6.4
- 创建
- 10.2 修改榜单组件添加作者链接
- 修改
components/RankingPanel.tsx - 修改
components/MaterialPreviewModal.tsx - 将作者名改为可点击链接
- Requirements: 6.1, 6.2
- 修改
- 10.3 编写作者作品属性测试
- 创建
lib/__tests__/author-works.test.ts - Property 9: 作者作品列表过滤
- Validates: Requirements 6.3
- 创建
- 10.1 创建作者作品页面
-
11. Final Checkpoint - 确保所有测试通过
- 所有693个测试通过
-
12. 部署到生产环境
- 运行数据库迁移
- 执行AI模板素材迁移脚本
- 部署新代码
- 验证所有功能正常