fix(floating-ai): replace ScrollArea with div for message container in FloatingChat
This commit is contained in:
@@ -11,7 +11,6 @@ import {
|
|||||||
} from '@/context/FloatingChatContext';
|
} from '@/context/FloatingChatContext';
|
||||||
import { useAIChat, type ChatContext } from '@/hooks/useAIChat';
|
import { useAIChat, type ChatContext } from '@/hooks/useAIChat';
|
||||||
import { ChatMarkdown } from '@/components/ai/AIChatPanel';
|
import { ChatMarkdown } from '@/components/ai/AIChatPanel';
|
||||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
|
||||||
import { Skeleton } from '@/components/ui/skeleton';
|
import { Skeleton } from '@/components/ui/skeleton';
|
||||||
|
|
||||||
function FloatingChatInner() {
|
function FloatingChatInner() {
|
||||||
@@ -160,11 +159,11 @@ function FloatingChatInner() {
|
|||||||
animate={{ opacity: 1, height: 'auto', scale: 1 }}
|
animate={{ opacity: 1, height: 'auto', scale: 1 }}
|
||||||
exit={{ opacity: 0, height: 0, scale: 0.97 }}
|
exit={{ opacity: 0, height: 0, scale: 0.97 }}
|
||||||
transition={{ type: 'spring', stiffness: 400, damping: 30 }}
|
transition={{ type: 'spring', stiffness: 400, damping: 30 }}
|
||||||
className="rounded-2xl overflow-hidden"
|
className="rounded-2xl"
|
||||||
>
|
>
|
||||||
<ScrollArea
|
<div
|
||||||
className="max-h-[300px]"
|
ref={scrollRef}
|
||||||
viewportRef={scrollRef}
|
className="max-h-[300px] overflow-y-auto rounded-2xl [&::-webkit-scrollbar]:w-2.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-border"
|
||||||
>
|
>
|
||||||
<div className="flex flex-col gap-2.5 p-3">
|
<div className="flex flex-col gap-2.5 p-3">
|
||||||
{messages.map((msg) => {
|
{messages.map((msg) => {
|
||||||
@@ -221,7 +220,7 @@ function FloatingChatInner() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</ScrollArea>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
|
|||||||
Reference in New Issue
Block a user