An AI-powered search engine with a generative UI
TypeScript generative-aigenerative-uinextjsollamareactsearxngshadcn-uitailwindcsstavilytypescriptupstashvercel-ai-sdk
Fix: Update auto-scroll threshold to improve user experience
Yoshiki Miuraa3f503b62409
diff --git a/components/chat.tsx b/components/chat.tsxindex f52731df..e46b06cb 100644--- a/components/chat.tsx+++ b/components/chat.tsx@@ -71,7 +71,7 @@ export function Chat({dependency: messages.length,isStreaming: status === 'streaming',scrollContainer: scrollContainerRef,- threshold: 50+ threshold: 70})useEffect(() => {diff --git a/lib/hooks/use-auto-scroll.ts b/lib/hooks/use-auto-scroll.tsindex 3549d9bd..95446ad2 100644--- a/lib/hooks/use-auto-scroll.ts+++ b/lib/hooks/use-auto-scroll.ts@@ -36,7 +36,7 @@ export function useAutoScroll({isLoading,isStreaming,scrollContainer,- threshold = 60+ threshold = 70}: UseAutoScrollOptions): UseAutoScrollReturn {const anchorRef = useRef<HTMLDivElement>(null)const [isAutoScroll, setIsAutoScroll] = useState(true)