chore: 清理剪辑模板编辑器生成视频死代码 + 重命名为剪辑模板 #1472

Merged
xiaoxia merged 3 commits from chore/cleanup-template-editor-generation into develop 2026-08-23 23:06:28 +08:00
Owner

任务一:清理剪辑模板编辑器的生成视频死代码

删除的文件

  • editing-planner/components/GenerationProgressModal.tsx
  • editing-planner/components/GenerationHistoryModal.tsx
  • editing-planner/components/generation-progress-modal/ 整个目录(6个文件)
  • 对应测试文件 GenerationProgressModal.test.tsxGenerationHistoryModal.test.tsx

删除的 API 函数

  • generateEditPlan — POST /templates/{id}/editor/generate
  • getGenerationStatus — GET /templates/{id}/editor/generation-status
  • getEditPlanGenerations — GET /templates/{id}/editor/generations

同时删除了 types.ts 中仅被这三个函数使用的类型:

  • GenerateResponse
  • EditPlanGeneration
  • GenerationStatusResponse

清理的测试引用

  • EditingPlanner.test.tsx:移除 mock 和组件 mock
  • GeneratePage.test.tsx:移除 mock 中的三个函数
  • smoke.test.tsx:移除两个组件 import
  • edit-plans.test.ts:移除三个函数 import 和 describe 块

未动

  • PreviewPlayer.tsx 和 generation/preview.ts(智能剪辑 Step6 封面预览)
  • getGenerationTaskResults(智能剪辑轮询使用)

任务二:剪辑编辑器 → 剪辑模板

只改用户可见文案,不改变量名/组件名/路由/API路径:

  • config/navigation.ts 两处菜单 label
  • pages/templates/hooks/useTemplateLibrary.ts 注释

验证

  • TypeScript
  • ESLint (max-warnings 0)
  • Prettier
  • 相关单元测试
  • 全局搜索确认无残留引用
## 任务一:清理剪辑模板编辑器的生成视频死代码 ### 删除的文件 - `editing-planner/components/GenerationProgressModal.tsx` - `editing-planner/components/GenerationHistoryModal.tsx` - `editing-planner/components/generation-progress-modal/` 整个目录(6个文件) - 对应测试文件 `GenerationProgressModal.test.tsx`、`GenerationHistoryModal.test.tsx` ### 删除的 API 函数 - `generateEditPlan` — POST /templates/{id}/editor/generate - `getGenerationStatus` — GET /templates/{id}/editor/generation-status - `getEditPlanGenerations` — GET /templates/{id}/editor/generations 同时删除了 types.ts 中仅被这三个函数使用的类型: - `GenerateResponse` - `EditPlanGeneration` - `GenerationStatusResponse` ### 清理的测试引用 - `EditingPlanner.test.tsx`:移除 mock 和组件 mock - `GeneratePage.test.tsx`:移除 mock 中的三个函数 - `smoke.test.tsx`:移除两个组件 import - `edit-plans.test.ts`:移除三个函数 import 和 describe 块 ### 未动 - PreviewPlayer.tsx 和 generation/preview.ts(智能剪辑 Step6 封面预览) - getGenerationTaskResults(智能剪辑轮询使用) ## 任务二:剪辑编辑器 → 剪辑模板 只改用户可见文案,不改变量名/组件名/路由/API路径: - `config/navigation.ts` 两处菜单 label - `pages/templates/hooks/useTemplateLibrary.ts` 注释 ## 验证 - TypeScript ✅ - ESLint ✅ (max-warnings 0) - Prettier ✅ - 相关单元测试 ✅ - 全局搜索确认无残留引用
xiaoxia added 1 commit 2026-08-23 22:50:24 +08:00
chore: 清理剪辑模板编辑器生成视频死代码 + 重命名剪辑编辑器为剪辑模板
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 48s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m34s
AI Code Review / AI Code Review (pull_request) Successful in 1m36s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m53s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m54s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m35s
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
cfc65f09e3
- 删除 GenerationProgressModal/GenerationHistoryModal 组件及 generation-progress-modal/ 目录
- 删除 editPlans.ts 中无人调用的 generateEditPlan/getGenerationStatus/getEditPlanGenerations
- 删除 types.ts 中对应的 GenerateResponse/EditPlanGeneration/GenerationStatusResponse 类型
- 清理相关测试文件和 mock 引用
- 用户可见文案 '剪辑编辑器' 统一替换为 '剪辑模板'
- 不改变量名、组件名、路由路径和 API 路径
xiaoxia added 1 commit 2026-08-23 22:52:56 +08:00
chore(api): 清理模板编辑器生成视频死代码
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 42s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m48s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m48s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m52s
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build API Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
02796937f3
删除模板编辑器(剪辑模板)的生成视频接口和连带死代码,生成功能统一由
智能剪辑 /generation/* 路由承载。

删除文件:
- apps/api/app/api/routes/templates_editor/generation.py
  (POST /generate, GET /generation-status, GET /generations)
- apps/api/app/api/routes/templates_editor/_fallback.py
  (4个自动兜底函数,仅被 generation.py 调用)
- tests/unit/test_generate_title_and_cover.py
- tests/unit/test_unified_render_reuse.py
- tests/unit/test_fallback_user_assets.py

修改文件:
- __init__.py: 移除 generation_router 导入和注册
- dependencies.py: 移除 _check_queue_limits 及 task_enqueue 独占导入
- schemas.py: 移除 ClipStatusItem/EditPlanGenerate*/EditPlanGenerationsResponse
  及 GenerationTaskResponse 独占导入

不动的文件:
- generation_tasks.py / generation_preview.py / generation_cover.py
  (智能剪辑 /generation/* 路由,正在使用)
xiaoxia added 1 commit 2026-08-23 22:54:59 +08:00
chore: retrigger CI
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 43s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m39s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m43s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 2m1s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m58s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 41s
AI Code Review / AI Code Review (pull_request) Successful in 2m58s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 3m8s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 2m45s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 2m41s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m56s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 4m9s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 3m33s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 6m46s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m21s
CI/CD Pipeline / CI Gate (pull_request) Successful in 6s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 40s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 1m32s
1035c349d7
Collaborator

代码审查结果 - PR #1472

⚠️ 问题(0个需要修改)

💡 建议(2个可选)

  1. apps/api/app/api/routes/templates_editor/schemas.py 第8行:建议确认 Dict 类型在文件剩余部分是否仍被使用。虽然删除的 Schema 中使用了 Dict,但如果文件中其他未展示的 Schema(如 AI 推荐、导出配置等)仍依赖 typing.Dict,删除该导入会导致 NameError。建议全局搜索确认或保留导入。
  2. apps/api/app/api/routes/templates_editor/_fallback.py (已删除):业务逻辑确认。该文件删除了自动填充素材(_auto_fallback_assign_assets)和自动复制片段配置(_auto_fallback_copy_template_clips)的逻辑。请务必确认新的 /generation/tasks 体系已在其他位置(如 Worker 或新的 Service 层)实现了等效的自动兜底机制,否则用户在生成视频时可能因缺少素材或片段配置而遇到流程阻断或体验下降。

格式检查通过 | 逻辑审查通过 | 性能无明显影响


🤖 由 AI 代码审查机器人自动生成 | 2026-08-23 14:57:56 | 模型:

## 代码审查结果 - PR #1472 ### ⚠️ 问题(0个需要修改) 无 ### 💡 建议(2个可选) 1. **apps/api/app/api/routes/templates_editor/schemas.py 第8行**:建议确认 `Dict` 类型在文件剩余部分是否仍被使用。虽然删除的 Schema 中使用了 `Dict`,但如果文件中其他未展示的 Schema(如 AI 推荐、导出配置等)仍依赖 `typing.Dict`,删除该导入会导致 `NameError`。建议全局搜索确认或保留导入。 2. **apps/api/app/api/routes/templates_editor/_fallback.py (已删除)**:业务逻辑确认。该文件删除了自动填充素材(`_auto_fallback_assign_assets`)和自动复制片段配置(`_auto_fallback_copy_template_clips`)的逻辑。请务必确认新的 `/generation/tasks` 体系已在其他位置(如 Worker 或新的 Service 层)实现了等效的自动兜底机制,否则用户在生成视频时可能因缺少素材或片段配置而遇到流程阻断或体验下降。 --- ✅ 格式检查通过 | ✅ 逻辑审查通过 | ✅ 性能无明显影响 --- <sub>🤖 由 AI 代码审查机器人自动生成 | 2026-08-23 14:57:56 | 模型: </sub> <!-- AI_CODE_REVIEW_AUTO_COMMENT -->

🚀 预览环境已部署

项目 详情
PR号 #1472
预览链接 https://pr-1472.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1472 | | 预览链接 | [https://pr-1472.preview.xiaoxiajianji.com](https://pr-1472.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
xiaoxia merged commit bbf27ec3f6 into develop 2026-08-23 23:06:28 +08:00

🗑️ 预览环境已清理

PR #1472 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1472 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Sign in to join this conversation.