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