fix: streaming display - hide text during tool use, truncate thinking, collapse by default
This commit is contained in:
parent
469a8a9cfc
commit
a17c37a7b3
@ -354,12 +354,12 @@ export default function ChatPanel({ chatId, projectId }: Props) {
|
|||||||
<span className="animate-pulse">●</span>
|
<span className="animate-pulse">●</span>
|
||||||
</div>
|
</div>
|
||||||
{streaming.thinking && (
|
{streaming.thinking && (
|
||||||
<details className="ml-5 mb-1" open>
|
<details className="ml-5 mb-1">
|
||||||
<summary className="text-xs text-[var(--muted)] cursor-pointer hover:text-[var(--fg)]">
|
<summary className="text-xs text-[var(--muted)] cursor-pointer hover:text-[var(--fg)]">
|
||||||
💭 Размышления
|
💭 Размышления ({streaming.thinking.length} символов)
|
||||||
</summary>
|
</summary>
|
||||||
<div className="mt-1 text-xs text-[var(--muted)] whitespace-pre-wrap bg-white/5 rounded p-2 max-h-[200px] overflow-y-auto">
|
<div className="mt-1 text-xs text-[var(--muted)] whitespace-pre-wrap bg-white/5 rounded p-2 max-h-[200px] overflow-y-auto">
|
||||||
{streaming.thinking}
|
{streaming.thinking.length > 500 ? '…' + streaming.thinking.slice(-500) : streaming.thinking}
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
)}
|
)}
|
||||||
@ -372,8 +372,8 @@ export default function ChatPanel({ chatId, projectId }: Props) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{streaming.text && (
|
{streaming.text && !streaming.tools.some(t => t.status === "running") && (
|
||||||
<div className="ml-5 whitespace-pre-wrap">{streaming.text}</div>
|
<div className="ml-5 whitespace-pre-wrap">{streaming.text.length > 500 ? '…' + streaming.text.slice(-500) : streaming.text}</div>
|
||||||
)}
|
)}
|
||||||
{!streaming.text && streaming.tools.length === 0 && !streaming.thinking && (
|
{!streaming.text && streaming.tools.length === 0 && !streaming.thinking && (
|
||||||
<div className="ml-5 text-[var(--muted)] italic">Думает...</div>
|
<div className="ml-5 text-[var(--muted)] italic">Думает...</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user