fix: hide thinking when identical to output + default collapsed
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 7s

This commit is contained in:
WangDL 2026-05-22 11:49:53 +08:00
parent 0789114e0a
commit 0fc2366eb9

View File

@ -207,8 +207,8 @@ function ChatPage() {
style={{ backgroundColor: msg.role === 'user' ? token.colorPrimary : token.colorSuccess, flexShrink: 0 }} />
<div style={{ maxWidth: '75%', minWidth: 0 }}>
{/* Thinking — auto expand during streaming */}
{msg.thinking && (
<Collapse size="small" ghost defaultActiveKey={msg.streaming ? ['thinking'] : []} items={[{
{msg.thinking && msg.thinking !== msg.content && (
<Collapse size="small" ghost defaultActiveKey={[]} items={[{
key: 'thinking', label: <Text style={{ fontSize: 12, color: token.colorTextSecondary }}><BulbOutlined /> {msg.streaming ? <LoadingOutlined style={{ marginLeft: 6, fontSize: 11 }} spin /> : null}</Text>,
children: <div style={{ fontSize: 13, color: token.colorTextSecondary, whiteSpace: 'pre-wrap', lineHeight: 1.7, maxHeight: 200, overflowY: 'auto', padding: '4px 0' }}>{msg.thinking}</div>,
}]} style={{ marginBottom: 8, background: 'transparent' }} />