Skip to content

An AI-powered search engine with a generative UI

Fix: Update auto-scroll threshold to improve user experience

Yoshiki Miuraa3f503b62409
diff --git a/components/chat.tsx b/components/chat.tsx
index 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.ts
index 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)