aadeshkulkarni / figuringout

Blogging + Social Media + AI | Opensource | Javascript | ReactJS | HonoJS | Prisma
https://figuringout.life
MIT License
91 stars 91 forks source link

Enhancement | End of Infinite Scrolling #104

Closed aadeshkulkarni closed 3 months ago

aadeshkulkarni commented 3 months ago

Where ?

Current

When user is scrolling to the end of the infinite scroll, no notification to indicate that they've reached the end of the feed.

Expectation

At the very end, the app should state, that it does not have any more blogs to show.

You can be creative with the message.

Here are some message options (feel free to ignore them and use yours):

Kunall-singh commented 3 months ago

Here's my approach to achieve the enhancement

To implement an end-of-feed message, I will use the react-infinite-scroll-component library. I will initialize the state to track the list of blogs and whether more blogs are available. I will use the InfiniteScroll component from the library to fetch additional blogs when the user scrolls to the bottom. The component will display a creative message when there are no more blogs to load. but if we don't want to use external library, then the code will look something like this, I will manage the state to track the list of blogs and whether more blogs are available. I will write a function to fetch additional blogs and add a scroll event listener to detect when the user has reached the bottom of the page. Upon reaching the end, I will display a creative message indicating no more blogs are available.

Also we can use lazy loading. Using lazy loading will enhance performance by reducing initial load times and conserving bandwidth. It will also improve memory usage, making the application more responsive and efficient, especially for users on lower-end devices or with limited internet speed. Lazy loading ensures a seamless user experience by loading content incrementally as needed.

Please let me know which approach you want and can I start working on this issue. also your views on using lazy loading. @aadeshkulkarni

aadeshkulkarni commented 3 months ago

@Kunall-singh -Infinite scrolling has already been implemented (refer issue: #95) and it is working seamlessly at the moment.

As part of this issue, the only enhancement needed is to add a message if user reaches the end of the scroll. That's it.

Kunall-singh commented 3 months ago

I apologize for the misunderstanding regarding the enhancement. Here is a prototype of what I have done so far to achieve this enhancement. You can see the details in the attached video.

Also, please let me know if the confetti effect looks subtle or if any adjustments are needed.

https://github.com/aadeshkulkarni/medium-app/assets/107796595/7a35b578-f299-49e3-a3c8-0c683214aa2b

aadeshkulkarni commented 3 months ago

Looks good. Please raise a PR, linking this issue to it.