fix(codeBlock): 修复代码块抖动的问题
This commit is contained in:
parent
9758ae8a3a
commit
e3b54e8301
|
|
@ -263,8 +263,9 @@ function ToolCall({
|
|||
language?: BundledLanguage;
|
||||
expanded?: boolean;
|
||||
}) => {
|
||||
// Always start collapsed in thinking blocks; user must explicitly expand.
|
||||
const shouldShowCodeBlock = expanded;
|
||||
// During streaming, never render code block content in thinking area.
|
||||
// Code is only available for expand/collapse after streaming is complete.
|
||||
const shouldShowCodeBlock = !isLoading && expanded;
|
||||
|
||||
return (
|
||||
<div className="space-y-1">
|
||||
|
|
@ -462,8 +463,10 @@ function ToolCall({
|
|||
<Button
|
||||
className="h-7 px-3 text-xs"
|
||||
variant="ghost"
|
||||
disabled={isLoading}
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
if (isLoading) return;
|
||||
setIsCommandExpanded((prev) => !prev);
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue