Merge pull request #103 from YishenTu/main

Fix UI/UX issues and improve scroll behavior
This commit is contained in:
Philipp Schmid
2025-06-16 15:31:07 +02:00
committed by GitHub
6 changed files with 46 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ volumes:
services: services:
langgraph-redis: langgraph-redis:
image: docker.io/redis:6 image: docker.io/redis:6
container_name: langgraph-redis
healthcheck: healthcheck:
test: redis-cli ping test: redis-cli ping
interval: 5s interval: 5s
@@ -11,6 +12,7 @@ services:
retries: 5 retries: 5
langgraph-postgres: langgraph-postgres:
image: docker.io/postgres:16 image: docker.io/postgres:16
container_name: langgraph-postgres
ports: ports:
- "5433:5432" - "5433:5432"
environment: environment:
@@ -27,6 +29,7 @@ services:
interval: 5s interval: 5s
langgraph-api: langgraph-api:
image: gemini-fullstack-langgraph image: gemini-fullstack-langgraph
container_name: langgraph-api
ports: ports:
- "8123:8000" - "8123:8000"
depends_on: depends_on:

View File

@@ -54,9 +54,9 @@ export default function App() {
title: "Reflection", title: "Reflection",
data: event.reflection.is_sufficient data: event.reflection.is_sufficient
? "Search successful, generating final answer." ? "Search successful, generating final answer."
: `Need more information, searching for ${event.reflection.follow_up_queries.join( : `Need more information, searching for ${event.reflection.follow_up_queries?.join(
", " ", "
)}`, ) || "additional information"}`,
}; };
} else if (event.finalize_answer) { } else if (event.finalize_answer) {
processedEvent = { processedEvent = {

View File

@@ -252,9 +252,9 @@ export function ChatMessagesView({
}; };
return ( return (
<div className="flex flex-col h-full"> <div className="flex flex-col h-full overflow-hidden">
<ScrollArea className="flex-grow" ref={scrollAreaRef}> <ScrollArea className="flex-1 min-h-0" ref={scrollAreaRef}>
<div className="p-4 md:p-6 space-y-2 max-w-4xl mx-auto pt-16"> <div className="p-4 md:p-6 pb-2 space-y-2 max-w-4xl mx-auto">
{messages.map((message, index) => { {messages.map((message, index) => {
const isLast = index === messages.length - 1; const isLast = index === messages.length - 1;
return ( return (

View File

@@ -49,7 +49,7 @@ export const InputForm: React.FC<InputFormProps> = ({
return ( return (
<form <form
onSubmit={handleInternalSubmit} onSubmit={handleInternalSubmit}
className={`flex flex-col gap-2 p-3 `} className={`flex flex-col gap-2 p-3 pb-4`}
> >
<div <div
className={`flex flex-row items-center justify-between text-white rounded-3xl rounded-bl-sm ${ className={`flex flex-row items-center justify-between text-white rounded-3xl rounded-bl-sm ${

View File

@@ -17,6 +17,7 @@ function ScrollArea({
<ScrollAreaPrimitive.Viewport <ScrollAreaPrimitive.Viewport
data-slot="scroll-area-viewport" data-slot="scroll-area-viewport"
className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1" className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
style={{ overscrollBehavior: 'none' }}
> >
{children} {children}
</ScrollAreaPrimitive.Viewport> </ScrollAreaPrimitive.Viewport>
@@ -38,16 +39,16 @@ function ScrollBar({
className={cn( className={cn(
"flex touch-none p-px transition-colors select-none", "flex touch-none p-px transition-colors select-none",
orientation === "vertical" && orientation === "vertical" &&
"h-full w-2.5 border-l border-l-transparent", "h-full w-1.5 border-l border-l-transparent",
orientation === "horizontal" && orientation === "horizontal" &&
"h-2.5 flex-col border-t border-t-transparent", "h-1.5 flex-col border-t border-t-transparent",
className className
)} )}
{...props} {...props}
> >
<ScrollAreaPrimitive.ScrollAreaThumb <ScrollAreaPrimitive.ScrollAreaThumb
data-slot="scroll-area-thumb" data-slot="scroll-area-thumb"
className="bg-border relative flex-1 rounded-full" className="bg-neutral-600/30 relative flex-1 rounded-full"
/> />
</ScrollAreaPrimitive.ScrollAreaScrollbar> </ScrollAreaPrimitive.ScrollAreaScrollbar>
) )

View File

@@ -116,6 +116,13 @@
} }
body { body {
@apply bg-background text-foreground; @apply bg-background text-foreground;
/* Prevent scroll bounce/overscroll on mobile */
overscroll-behavior: none;
-webkit-overflow-scrolling: touch;
}
html {
/* Prevent scroll bounce on the entire page */
overscroll-behavior: none;
} }
} }
@@ -150,5 +157,31 @@
animation: fadeInUpSmooth 0.3s ease-out forwards; animation: fadeInUpSmooth 0.3s ease-out forwards;
} }
/* Prevent scroll bounce on scroll areas */
[data-radix-scroll-area-viewport] {
overscroll-behavior: none !important;
-webkit-overflow-scrolling: touch;
}
/* Hide any white space that might appear during scroll bounce */
[data-radix-scroll-area-viewport]::-webkit-scrollbar {
width: 0px;
background: transparent;
}
/* Subtle scroll bar styling */
[data-slot="scroll-area-scrollbar"] {
opacity: 0.3;
transition: opacity 0.2s ease;
}
[data-slot="scroll-area"]:hover [data-slot="scroll-area-scrollbar"] {
opacity: 0.6;
}
[data-slot="scroll-area-thumb"] {
background-color: rgb(115 115 115 / 0.2) !important;
}
/* Ensure your body or html has a dark background if not already set, e.g.: */ /* Ensure your body or html has a dark background if not already set, e.g.: */
/* body { background-color: #0c0c0d; } */ /* This is similar to neutral-950 */ /* body { background-color: #0c0c0d; } */ /* This is similar to neutral-950 */