Skip to content

Commit bea4ad1

Browse files
committed
fix(frontend): 优化思考过程展示与快捷问题
- 更新快捷问题文案 - 思考内容改为累加显示(不再覆盖) - 添加 whitespace-pre-line 优化换行展示
1 parent 7e48a19 commit bea4ad1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

front/src/pages/AIChat.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ interface Message {
1717
}
1818

1919
const quickQuestions = [
20-
'帮我写一篇关于机器学习的笔记',
21-
'总结一下今天要复习的内容',
22-
'RAG 是什么?',
20+
'帮我解释一下量子计算',
21+
'写一首关于春天的诗',
22+
'推荐几本提升思维的书',
2323
]
2424

2525
export default function AIChat() {
@@ -109,7 +109,7 @@ export default function AIChat() {
109109
onThinking: (stage, content) => {
110110
if (!steps.includes(stage)) steps.push(stage)
111111
setCurrentSteps([...steps])
112-
setCurrentThinking(content || '')
112+
setCurrentThinking(prev => prev ? `${prev}\n${content}` : (content || ''))
113113
},
114114
onResponse: (content, sessionId) => {
115115
if (!hasResponseStarted) {
@@ -231,7 +231,7 @@ export default function AIChat() {
231231
</button>
232232
{showThinking && currentThinking && (
233233
<div className="px-4 pb-3">
234-
<p className="text-xs text-[var(--color-text-secondary)] leading-relaxed">{currentThinking}</p>
234+
<p className="text-xs text-[var(--color-text-secondary)] leading-relaxed whitespace-pre-line">{currentThinking}</p>
235235
</div>
236236
)}
237237
</div>
@@ -277,7 +277,7 @@ export default function AIChat() {
277277
</button>
278278
{showThinking && currentThinking && (
279279
<div className="px-4 pb-3">
280-
<p className="text-xs text-[var(--color-text-secondary)] leading-relaxed">{currentThinking}</p>
280+
<p className="text-xs text-[var(--color-text-secondary)] leading-relaxed whitespace-pre-line">{currentThinking}</p>
281281
</div>
282282
)}
283283
</div>

0 commit comments

Comments
 (0)