From 89973388123d93bb0cc46cce3319e750b2b83974 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Fri, 29 Aug 2025 10:57:39 +0000 Subject: [PATCH] Improve scrolling behavior in video category rows for smoother navigation Adjusted scroll thresholds in `netflix-grid.tsx` to prevent premature infinite loop behavior on category rows, enhancing user experience. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/P3O2FU7 --- client/src/components/netflix-grid.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index 32ce139..4337471 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -146,14 +146,14 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { let targetScroll; if (direction === 'left') { - if (currentScroll <= 0) { + if (currentScroll <= 5) { // Jump to end for infinite loop targetScroll = maxScroll; } else { targetScroll = Math.max(0, currentScroll - scrollAmount); } } else { - if (currentScroll >= maxScroll - 10) { + if (currentScroll >= maxScroll - 50) { // Jump to beginning for infinite loop targetScroll = 0; } else { @@ -178,10 +178,10 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { const maxScroll = scrollRef.current.scrollWidth - scrollRef.current.clientWidth; const scrollAmount = direction === 'left' ? -3 : 3; // Faster scroll - if (direction === 'left' && currentScroll <= 0) { + if (direction === 'left' && currentScroll <= 5) { // Jump to end for infinite loop scrollRef.current.scrollLeft = maxScroll; - } else if (direction === 'right' && currentScroll >= maxScroll - 5) { + } else if (direction === 'right' && currentScroll >= maxScroll - 50) { // Jump to beginning for infinite loop scrollRef.current.scrollLeft = 0; } else {