From d1c5f2e31cf2f0cdb60ccb6f2821fb6b37700d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E6=B2=9B=E8=BB=92?= Date: Sat, 20 Sep 2025 04:12:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=84=AA=E5=8C=96=E4=BE=8B?= =?UTF-8?q?=E5=8F=A5=E5=8F=A3=E8=AA=AA=E5=8A=9F=E8=83=BD=E8=A8=AD=E8=A8=88?= =?UTF-8?q?=E8=88=87=E7=94=A8=E6=88=B6=E9=AB=94=E9=A9=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## VoiceRecorder 組件改進 - 添加自定義說明文字 prop (instructionText) - 調整布局順序:圖片 → 說明 → 例句 - 統一圖片容器樣式與其他模式一致 ## 例句口說頁面優化 - 移除重複的例句和圖片顯示 - 簡化錄音完成回饋區域 - 移除不必要的目標單字和發音顯示 - 調整回饋訊息為分行顯示,提升可讀性 - 實現滿版寬度布局 ## 用戶體驗改進 - 消除重複內容,介面更簡潔 - 統一設計語言,視覺一致性更好 - 優化訊息層次,重點更突出 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- frontend/app/learn/page.tsx | 58 +++++---------------------- frontend/components/VoiceRecorder.tsx | 26 ++++++++---- 2 files changed, 29 insertions(+), 55 deletions(-) diff --git a/frontend/app/learn/page.tsx b/frontend/app/learn/page.tsx index 36ecd86..4ab6f01 100644 --- a/frontend/app/learn/page.tsx +++ b/frontend/app/learn/page.tsx @@ -937,42 +937,12 @@ export default function LearnPage() { - {/* Example Image */} - {currentCard.exampleImage && ( -
-
- Example illustration setModalImage(currentCard.exampleImage)} - /> -
-
- )} - -

- 請看例句圖片並大聲說出完整的例句: -

- -
- {/* Example Sentence */} -
-

例句

-
-

"{currentCard.example}"

-
- -
-
-

"{currentCard.exampleTranslation}"

-
- -
- -
+
{ // 簡化處理:直接顯示結果 handleSpeakingAnswer(currentCard.example) @@ -981,21 +951,13 @@ export default function LearnPage() {
{showResult && ( -
-

- 錄音完成!系統正在評估你的發音... +

+

+ 錄音完成! +

+

+ 系統正在評估你的發音...

-
-

- 目標單字:{currentCard.word} -

-

- 發音:{currentCard.pronunciation} -

-
- -
-
)}
diff --git a/frontend/components/VoiceRecorder.tsx b/frontend/components/VoiceRecorder.tsx index 9c72d95..c90e26c 100644 --- a/frontend/components/VoiceRecorder.tsx +++ b/frontend/components/VoiceRecorder.tsx @@ -24,6 +24,7 @@ export interface VoiceRecorderProps { targetText: string; targetTranslation?: string; exampleImage?: string; + instructionText?: string; onScoreReceived?: (score: PronunciationScore) => void; onRecordingComplete?: (audioBlob: Blob) => void; maxDuration?: number; @@ -35,6 +36,7 @@ export default function VoiceRecorder({ targetText, targetTranslation, exampleImage, + instructionText, onScoreReceived, onRecordingComplete, maxDuration = 30, // 30 seconds default @@ -245,13 +247,23 @@ export default function VoiceRecorder({ {/* Example Image */} {exampleImage && (
- Example context -
點擊圖片可放大查看
+
+ Example context +
+
+ )} + + {/* Instruction Text */} + {instructionText && ( +
+

+ {instructionText} +

)}