修复消息turn有时展开异常
This commit is contained in:
@@ -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 {
|
.select-none {
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
|
|||||||
@@ -119,14 +119,20 @@ export const ToolHeader = ({
|
|||||||
|
|
||||||
export type ToolContentProps = ComponentProps<typeof CollapsibleContent>
|
export type ToolContentProps = ComponentProps<typeof CollapsibleContent>
|
||||||
|
|
||||||
export const ToolContent = ({ className, ...props }: ToolContentProps) => (
|
export const ToolContent = ({
|
||||||
|
className,
|
||||||
|
children,
|
||||||
|
...props
|
||||||
|
}: ToolContentProps) => (
|
||||||
<CollapsibleContent
|
<CollapsibleContent
|
||||||
className={cn(
|
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
|
className
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
>
|
||||||
|
<div className="space-y-4 p-4">{children}</div>
|
||||||
|
</CollapsibleContent>
|
||||||
)
|
)
|
||||||
|
|
||||||
export type ToolInputProps = ComponentProps<"div"> & {
|
export type ToolInputProps = ComponentProps<"div"> & {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export function VirtualizedMessageThread<T>({
|
|||||||
key={virtualItem.key}
|
key={virtualItem.key}
|
||||||
ref={virtualizer.measureElement}
|
ref={virtualizer.measureElement}
|
||||||
data-index={virtualItem.index}
|
data-index={virtualItem.index}
|
||||||
className="absolute left-0 top-0 w-full"
|
className="absolute left-0 top-0 w-full bg-background"
|
||||||
style={{
|
style={{
|
||||||
transform: `translate3d(0, ${virtualItem.start}px, 0)`,
|
transform: `translate3d(0, ${virtualItem.start}px, 0)`,
|
||||||
willChange: "transform",
|
willChange: "transform",
|
||||||
|
|||||||
Reference in New Issue
Block a user