diff --git a/frontend/app/generate/page.tsx b/frontend/app/generate/page.tsx index e2a3fa7..06438bd 100644 --- a/frontend/app/generate/page.tsx +++ b/frontend/app/generate/page.tsx @@ -47,7 +47,6 @@ function GenerateContent() { // UX 改善:追蹤分析狀態,避免輸入和結果不匹配 const [lastAnalyzedText, setLastAnalyzedText] = useState('') - const [isInitialLoad, setIsInitialLoad] = useState(true) // localStorage 快取函數 const saveAnalysisToCache = useCallback((cacheData: any) => { @@ -87,7 +86,6 @@ function GenerateContent() { setGrammarCorrection(cached.grammarCorrection || null) console.log('✅ 已恢復快取的分析結果') } - setIsInitialLoad(false) // 標記初始載入完成 }, [loadAnalysisFromCache]) @@ -164,9 +162,8 @@ function GenerateContent() { } saveAnalysisToCache(cacheData) - // 記錄此次分析的文本,並標記已完成初始化 + // 記錄此次分析的文本 setLastAnalyzedText(textInput) - setIsInitialLoad(false) } catch (error) { console.error('分析錯誤:', error) @@ -319,31 +316,6 @@ function GenerateContent() { {/* 分析結果區域 */} {sentenceAnalysis && (
- - {/* 狀態指示器 */} -
-
- - {textInput.trim() !== lastAnalyzedText ? - '⚠️ 顯示的是舊文本的分析結果' : - '✅ 當前文本的分析結果' - } - - - 「{lastAnalyzedText}」 - - {textInput.trim() !== lastAnalyzedText && ( - - 點擊「分析句子」查看新文本的分析 - - )} -
-
- {/* 語法修正面板 */} {grammarCorrection && grammarCorrection.hasErrors && (