Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/components/chat/ChatPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@ export function ChatPanel({
return (
<div className="h-full flex flex-col bg-background">
{/* Messages */}
<ScrollArea className="flex-1">
<div className="p-3 space-y-3">
<ScrollArea className="flex-1" scrollbar="both">
<div className="px-4 py-3 space-y-3">
{loadingHistory && (
<div className="flex items-center gap-2 text-xs text-muted-foreground">
<Loader2 className="w-3 h-3 animate-spin" />
Expand Down
38 changes: 24 additions & 14 deletions frontend/src/components/ui/scroll-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,32 @@ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"

import { cn } from "@/lib/utils"

type ScrollbarMode = "vertical" | "horizontal" | "both"

const ScrollArea = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
>(({ className, children, ...props }, ref) => (
<ScrollAreaPrimitive.Root
ref={ref}
className={cn("relative overflow-hidden", className)}
{...props}
>
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
{children}
</ScrollAreaPrimitive.Viewport>
<ScrollBar />
<ScrollAreaPrimitive.Corner />
</ScrollAreaPrimitive.Root>
))
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & {
scrollbar?: ScrollbarMode
}
>(({ className, children, scrollbar = "vertical", ...props }, ref) => {
const showVertical = scrollbar === "vertical" || scrollbar === "both"
const showHorizontal = scrollbar === "horizontal" || scrollbar === "both"

return (
<ScrollAreaPrimitive.Root
ref={ref}
className={cn("relative overflow-hidden", className)}
{...props}
>
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
{children}
</ScrollAreaPrimitive.Viewport>
{showVertical && <ScrollBar orientation="vertical" />}
{showHorizontal && <ScrollBar orientation="horizontal" />}
<ScrollAreaPrimitive.Corner />
</ScrollAreaPrimitive.Root>
)
})
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName

const ScrollBar = React.forwardRef<
Expand Down
Loading