Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: re-center the message suggestions for new threads #1025

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
5 changes: 4 additions & 1 deletion ui/admin/app/components/chat/MessagePane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export function MessagePane({
startScrollAt="bottom"
enableScrollTo="bottom"
enableScrollStick="bottom"
className={cn("h-full w-full relative", classNames.messageList)}
classNames={{
root: cn("h-full w-full relative", classNames.messageList),
viewport: cn(isEmpty && "flex flex-col justify-center"),
}}
>
{isEmpty ? (
<NoMessages />
Expand Down
16 changes: 14 additions & 2 deletions ui/admin/app/components/ui/scroll-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const ScrollArea = React.forwardRef<
startScrollAt?: "bottom";
enableScrollStick?: "bottom";
enableScrollTo?: "bottom";
classNames?: {
root?: string;
viewport?: string;
};
}
>((props, ref) => {
const {
Expand All @@ -23,6 +27,7 @@ const ScrollArea = React.forwardRef<
startScrollAt,
enableScrollTo,
enableScrollStick,
classNames = {},
...rootProps
} = props;

Expand Down Expand Up @@ -60,11 +65,18 @@ const ScrollArea = React.forwardRef<
return (
<ScrollAreaPrimitive.Root
ref={ref}
className={cn("relative overflow-hidden", className)}
className={cn(
"relative overflow-hidden",
className,
classNames.root
)}
{...rootProps}
>
<ScrollAreaPrimitive.Viewport
className="h-full w-full rounded-[inherit] max-h-[inherit]"
className={cn(
"h-full w-full rounded-[inherit] max-h-[inherit]",
classNames.viewport
)}
ref={initRef}
onScroll={(e) =>
setShouldStickToBottom(isScrolledToBottom(e.currentTarget))
Expand Down