From dbaa3dbd6dde22dbf5529354e72087362cfae233 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Fri, 29 Aug 2025 14:54:45 +0000 Subject: [PATCH] Improve navigation by allowing users to scroll through video categories Update the netflix-grid component to fix the scrolling logic for video categories. The scrolling direction has been reversed, and the current index logic is now correctly handling wrapping around the list of videos. 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/QCN70f2 --- client/src/components/netflix-grid.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index 27c2ad3..bda81db 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -143,10 +143,12 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { const scroll = (direction: 'left' | 'right') => { const totalVideos = category.videos.length; - if (direction === 'left') { - setCurrentIndex(prev => prev === 0 ? totalVideos - 1 : prev - 1); + if (direction === 'right') { + // Move one video forward (shift left to show next video) + setCurrentIndex(prev => (prev + 1) % totalVideos); } else { - setCurrentIndex(prev => prev === totalVideos - 1 ? 0 : prev + 1); + // Move one video backward (shift right to show previous video) + setCurrentIndex(prev => prev === 0 ? totalVideos - 1 : prev - 1); } };