修复消息turn有时展开异常

This commit is contained in:
xintaofei
2026-03-24 21:36:00 +08:00
parent 0d16d82eb9
commit 7d1db72b3e
3 changed files with 24 additions and 4 deletions

View File

@@ -231,6 +231,20 @@
}
/* Tool collapsible: fade-in on expand (height must change instantly for virtualizer) */
.tool-collapsible-content[data-state="open"] > * {
animation: tool-content-fade 150ms ease-out;
}
@keyframes tool-content-fade {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.select-none {
-webkit-user-select: none;
-moz-user-select: none;

View File

@@ -119,14 +119,20 @@ export const ToolHeader = ({
export type ToolContentProps = ComponentProps<typeof CollapsibleContent>
export const ToolContent = ({ className, ...props }: ToolContentProps) => (
export const ToolContent = ({
className,
children,
...props
}: ToolContentProps) => (
<CollapsibleContent
className={cn(
"data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
"tool-collapsible-content overflow-hidden text-popover-foreground outline-none",
className
)}
{...props}
/>
>
<div className="space-y-4 p-4">{children}</div>
</CollapsibleContent>
)
export type ToolInputProps = ComponentProps<"div"> & {

View File

@@ -74,7 +74,7 @@ export function VirtualizedMessageThread<T>({
key={virtualItem.key}
ref={virtualizer.measureElement}
data-index={virtualItem.index}
className="absolute left-0 top-0 w-full"
className="absolute left-0 top-0 w-full bg-background"
style={{
transform: `translate3d(0, ${virtualItem.start}px, 0)`,
willChange: "transform",