Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Issue #220 #236

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Fix: Issue #220 #236

wants to merge 9 commits into from

Conversation

teamomiamigo
Copy link
Collaborator

@teamomiamigo teamomiamigo commented Feb 22, 2025

WHAT WAS CHANGED
API Batch Fetching

  • added a new method in api_calls.ts that accepts limit and skip parameters to allow to fetch only 20 notes per call

Pagination Logic in HomeScreen

  • replaced the original fetchMessages logic with a new fetchNotes function that calculates the proper skip value based on the current page

SwipeListView Pagination

  • enhanced the SwipeListView components in the renderList by adding onEndReached, onEndReachedThreshold, and ListFooterComponenet to trigger and display loading for additional batches when the user scrolls to the end

WHY IT WAS CHANGED
the homepage was experiencing significant performance issues by rendering all notes at once. By implementing batch rendering, we greatly enhance the app's responsiveness and overall user experience.

Screen.Recording.2025-02-22.at.2.11.24.PM.mov

@teamomiamigo teamomiamigo self-assigned this Feb 22, 2025
@teamomiamigo teamomiamigo linked an issue Feb 22, 2025 that may be closed by this pull request
8 tasks
Copy link
Collaborator

@rcAsironman rcAsironman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@teamomiamigo Good work! It is functioning as expected. However, I will attach a prototype that you can use to increase the size of the "Load More" button. Additionally, when there are no more notes to display, show a message in gray color, such as "No more notes." Also, in your code, there are some comments generated by GPT. Please remove or rewrite them in your own words.

IMG_0574

@teamomiamigo
Copy link
Collaborator Author

@rcAsironman sounds good! I will get this fixed and send in an update of my progress!

Copy link
Collaborator

@ademDurakovic ademDurakovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall good work when ran the batch processing works fine. just clean up a few things that I left and I think it'll be good to go!

});

//Ensure the Lottie animation appears
await waitFor(() => {
expect(getByTestId("no-results-animation")).toBeTruthy();
});
});


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure to add a test case for the "no more notes to be loaded" message when all notes have been fetched by the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize Homepage Performance Using Batch Rendering
3 participants