fix(ui): P0 切换空线程不显示错误横幅
thread.error 在 useStream 切换 threadId 时不会自动清除, 导致切换到空新对话时残留旧线程的 error 触发红色错误横幅。 修复:activeMessages.length === 0 时抑制错误横幅, 空线程不可能有工具执行异常,无需展示该提示。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
ac1eaf63c3
commit
671e708bb5
@@ -435,8 +435,8 @@ export function ChatMessages({
|
|||||||
));
|
));
|
||||||
})()}
|
})()}
|
||||||
|
|
||||||
{/* Thread error banner */}
|
{/* Thread error banner — only show when there are messages (suppress stale error on empty thread switch) */}
|
||||||
{!!thread.error && !thread.isLoading && (
|
{!!thread.error && !thread.isLoading && activeMessages.length > 0 && (
|
||||||
<div className="rounded-xl border border-red-300 dark:border-red-800 bg-red-50 dark:bg-red-950/30 px-4 py-4 flex flex-col gap-3 my-2">
|
<div className="rounded-xl border border-red-300 dark:border-red-800 bg-red-50 dark:bg-red-950/30 px-4 py-4 flex flex-col gap-3 my-2">
|
||||||
<div className="flex items-start gap-2.5">
|
<div className="flex items-start gap-2.5">
|
||||||
<AlertTriangle className="size-4 shrink-0 text-red-500 dark:text-red-400 mt-0.5" />
|
<AlertTriangle className="size-4 shrink-0 text-red-500 dark:text-red-400 mt-0.5" />
|
||||||
|
|||||||
Reference in New Issue
Block a user