## 重構內容 - 建立統一的 lib/utils/cefrUtils.ts 工具函數庫 - 移除 app/generate/page.tsx 中重複的 CEFR 轉換邏輯 - 移除 components/ClickableTextV2.tsx 中重複的比較函數 - 統一 CEFR_LEVELS 常數定義和類型安全 ## 改善效果 - 減少60+行重複代碼 - 提升代碼維護性和一致性 - 增強TypeScript類型安全 - 實現單一真實來源原則 (Single Source of Truth) ## 包含的工具函數 - cefrToNumeric: 字串轉數字 - numericToCefr: 數字轉字串 - compareCEFRLevels: 等級比較 - getLevelIndex: 獲取索引 - getTargetLearningRange: 學習範圍建議 - isValidCEFRLevel: 等級驗證 ## 額外新增 - frontend-code-analysis-report.md: 前端程式碼診斷報告 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| cefrUtils.ts | ||
| cn.ts | ||
| masteryCalculator.ts | ||