Implement infinite scroll for learning paths#382
Conversation
There was a problem hiding this comment.
Thank you for the PR!
However, there are a few architectural issues with this implementation that need to be addressed:
- Horizontal vs Vertical Observer Placement: The LearningPaths component is a horizontal carousel. Placing the IntersectionObserver anchor div below the carousel means it will trigger immediately as soon as the section comes into vertical view, instantly loading the paths and completely defeating the purpose of lazy scrolling. For a horizontal carousel, the observer target needs to be placed inside the scrollable flex container at the very right end.
- Issue Linking: Please update the PR description to explicitly link the correct issue number (Fixes #(issue)) so it is tracked correctly.
Could you please update the observer logic to trigger based on the horizontal scroll position within the carousel container?
|
Hi @Aditya948351, thank you for pointing that out! That makes total sense—since the layout flows horizontally, a standard vertical bottom anchor would trip instantly.I have refactored the layout logic inside LearningPaths.tsx. The IntersectionObserver element anchor has been moved directly inside the horizontal carousel flexbox row at the far right end. It now monitors tracking intersections along the x-axis loop context parameters safely.I have also updated the PR description header block to link directly with issue #372. Could you please take another look? Thank you! |
There was a problem hiding this comment.
Reviewed the updated changes! The IntersectionObserver logic looks functional for lazy loading the horizontal carousel items. @nancy-verma780 Approved!
Description
Fixes # (issue)
Type of change
How Has This Been Tested?
Checklist: