Improve video carousel scrolling for a smoother user experience

Add console logs to the `CategoryRow` component in `netflix-grid.tsx` to debug and improve the infinite scrolling behavior of video carousels.

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/mZpi7Z1
This commit is contained in:
sebastjanartic 2025-08-29 10:59:22 +00:00
parent 8997338812
commit e23fa462eb

View File

@ -145,10 +145,13 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
let targetScroll;
console.log('Scroll debug:', { direction, currentScroll, maxScroll, scrollAmount });
if (direction === 'left') {
if (currentScroll <= 5) {
// Jump to end for infinite loop
targetScroll = maxScroll;
console.log('Jumping to end:', targetScroll);
} else {
targetScroll = Math.max(0, currentScroll - scrollAmount);
}
@ -156,6 +159,7 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
if (currentScroll >= maxScroll - 50) {
// Jump to beginning for infinite loop
targetScroll = 0;
console.log('Jumping to beginning:', targetScroll);
} else {
targetScroll = Math.min(maxScroll, currentScroll + scrollAmount);
}