Files
OCR/openspec/changes/remove-unused-code/tasks.md
egg 940a406dce chore: backup before code cleanup
Backup commit before executing remove-unused-code proposal.
This includes all pending changes and new features.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 11:55:39 +08:00

1.7 KiB

Tasks: Remove Unused Code and Legacy Files

Phase 1: Backend Cleanup (無依賴,可直接刪除)

  • 1.1 確認 ocr_service_original.py 無任何引用
  • 1.2 刪除 backend/app/services/ocr_service_original.py
  • 1.3 確認 preprocessor.py 無任何引用
  • 1.4 刪除 backend/app/services/preprocessor.py
  • 1.5 確認 pdf_font_manager.py 無任何引用
  • 1.6 刪除 backend/app/services/pdf_font_manager.py
  • 1.7 測試後端服務啟動正常

Phase 2: Frontend Unused Components (無依賴,可直接刪除)

  • 2.1 確認 MarkdownPreview.tsx 無任何引用
  • 2.2 刪除 frontend/src/components/MarkdownPreview.tsx
  • 2.3 確認 ResultsTable.tsx 無任何引用
  • 2.4 刪除 frontend/src/components/ResultsTable.tsx
  • 2.5 測試前端編譯正常

Phase 3: Frontend API Migration (需先遷移再刪除)

  • 3.1 將 ExportRule 類型從 types/api.ts 遷移到 types/apiV2.ts
  • 3.2 在 services/apiV2.ts 中添加 export rules 相關 API 函數
  • 3.3 更新 SettingsPage.tsx 使用 apiV2 的 ExportRule
  • 3.4 更新 Layout.tsx 移除對 api.ts 的依賴
  • 3.5 確認 services/api.ts 無任何引用
  • 3.6 刪除 frontend/src/services/api.ts
  • 3.7 確認 types/api.ts 無任何引用
  • 3.8 刪除 frontend/src/types/api.ts
  • 3.9 測試前端所有功能正常

Phase 4: Verification

  • 4.1 運行後端測試 (如有)
  • 4.2 運行前端編譯 npm run build
  • 4.3 手動測試關鍵功能:
    • 登入/登出
    • 文件上傳
    • OCR 處理
    • 結果查看
    • 導出設定頁面
  • 4.4 確認無 console 錯誤或警告