🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.9 KiB
1.9 KiB
Tasks: 簡化前端 OCR 配置選項
1. 前端清理
1.1 移除未使用的組件
- 1.1.1 刪除
frontend/src/components/OCRPresetSelector.tsx - 1.1.2 刪除
frontend/src/components/TableDetectionSelector.tsx
1.2 清理 TypeScript 類型定義
- 1.2.1 從
frontend/src/types/apiV2.ts移除以下類型:TableDetectionConfig(第 121-125 行)OCRPreset(第 131 行)TableParsingMode(第 140 行)OCRConfig(第 146-166 行)OCRPresetInfo(第 171-177 行)
- 1.2.2 從
ProcessingOptionsinterface 移除以下欄位:table_detectionocr_presetocr_config
1.3 清理 ProcessingPage
- 1.3.1 確認
frontend/src/pages/ProcessingPage.tsx中沒有引用已移除的類型或組件 - 1.3.2 移除相關的註解說明(如果有)- 保留說明性註解
2. 後端清理
2.1 清理 Schema 定義
- 2.1.1 從
backend/app/schemas/task.py移除未使用的 Enum 和 Model:TableDetectionConfigOCRPresetEnumTableParsingModeEnumOCRConfigOCR_PRESET_CONFIGS
- 2.1.2 從
ProcessingOptions移除以下欄位:table_detectionocr_presetocr_config
2.2 清理 API 端點邏輯
- 2.2.1 檢查
backend/app/routers/tasks.py中的start_task端點,移除對已刪除欄位的處理 - 2.2.2 更新
process_task_ocr函數簽名和呼叫
2.3 清理 Service 層
- 2.3.1 檢查
backend/app/services/ocr_service.py,確認沒有依賴已移除的配置項- 注意:ocr_service.py 保留這些參數作為可選項,使用預設值處理。這是正確的設計,保持後端彈性。
3. 驗證
- 3.1 確認 TypeScript 編譯無新錯誤(與本次變更相關的錯誤)
- 3.2 確認後端 API 仍正常運作(需手動測試)
- 3.3 測試上傳 -> 處理 -> 結果查看的完整流程(需手動測試)