dramaling-vocab-learning/frontend/lib/utils
鄭沛軒 7aa4f3e1fc refactor: 統一CEFR工具函數,移除重複代碼
## 重構內容
- 建立統一的 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>
2025-10-01 03:04:14 +08:00
..
cefrUtils.ts refactor: 統一CEFR工具函數,移除重複代碼 2025-10-01 03:04:14 +08:00
cn.ts feat: 建立企業級Learn功能前端架構 2025-09-27 17:37:45 +08:00
masteryCalculator.ts feat: 實現純CEFR字符串智能複習系統和完整四情境對照表 2025-09-25 21:05:54 +08:00