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

feat(mobile): entry list by feed or category; pagination #2717

Merged
merged 6 commits into from
Feb 11, 2025

Conversation

hyoban
Copy link
Member

@hyoban hyoban commented Feb 10, 2025

Description

PR Type

  • Feature
  • Bugfix
  • Hotfix
  • Other (please describe):

Screenshots (if UI change)

Demo Video (if new feature)

ScreenRecording_02-11-2025.00-40-50_1.MP4

Linked Issues

Additional context

Changelog

  • I have updated the changelog/next.md with my changes.

Copy link

vercel bot commented Feb 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
follow ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 4:40pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
follow-external-ssr ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2025 4:40pm

@follow-reviewer-bot
Copy link

Suggested PR Title:

refactor: streamline entry list management and views

Change Summary:
This PR refactors the entry list management in the mobile app by removing unused views, introducing a new useSelectedView function for better state handling, and integrating infinite scrolling capabilities. It also modifies various components to utilize the new hooks and improves data fetching efficiency with useInfiniteQuery.

Code Review:

Code Review

Issues Requiring Change Requests:

  1. File: apps/mobile/src/store/entry/hooks.ts

    • Line: 6
    • Issue: The getNextPageParam method in the useInfiniteQuery configuration uses inboxId || listId to determine the key for fetching the next page, but this approach might not account for cases where both inboxId and listId are undefined or handled inconsistently. This could potentially cause issues with pagination logic.
    • Change Request: Add a more explicit condition to handle cases where both inboxId and listId are undefined to ensure proper pagination behavior. Also, consider adding test cases for this scenario.
  2. File: apps/mobile/src/store/entry/store.ts

    • Line: 159
    • Issue: The new resetByView method modifies entryIdByView in a way that might not clean up or reset the associated state for views that are no longer used. This could lead to stale or unused state lingering in the store.
    • Change Request: Add logic to clean up unused views or provide documentation/comments explaining how unused views are handled to prevent state bloat.
  3. File: apps/mobile/src/modules/entry-list/entry-list.tsx

    • Line: 108
    • Issue: The ListFooterComponent uses isFetchingNextPage to decide when to show a skeleton component. However, there is no fallback or timeout logic if isFetchingNextPage remains true in edge cases (e.g., network errors or unexpected API delays).
    • Change Request: Add a fallback mechanism or timeout logic to handle scenarios where isFetchingNextPage remains true for too long to improve the user experience.
  4. File: apps/mobile/src/modules/feed-drawer/atoms.ts

    • Line: 142
    • Issue: The useFetchEntriesControls hook relies on getFetchEntryPayload, but there is no validation or error handling in case the payload is malformed or incomplete. This could cause runtime errors if unexpected data is passed.
    • Change Request: Add validation and error handling for the getFetchEntryPayload output within the useFetchEntriesControls implementation to ensure robustness.
  5. File: apps/mobile/src/constants/views.tsx

    • Line: Removed lines (48–65)
    • Issue: The removal of the Audios and Notifications views from the views array may have implications for other parts of the app that expect those values to be present. If these views are referenced elsewhere, it could lead to runtime errors.
    • Change Request: Verify that the removed views (Audios and Notifications) are not used elsewhere in the application. If they are, update the corresponding references or provide a migration plan to remove their dependencies.

If these issues are addressed, the updates will be more reliable and robust.

@hyoban hyoban marked this pull request as draft February 10, 2025 15:57
@hyoban hyoban changed the title feat(mobile): entry list pagination support, remove deprecated views feat(mobile): entry list pagination support, entry list by feed Feb 10, 2025
@hyoban hyoban changed the title feat(mobile): entry list pagination support, entry list by feed feat(mobile): entry list by feed or category; pagination Feb 10, 2025
@hyoban hyoban marked this pull request as ready for review February 10, 2025 16:42
@hyoban hyoban merged commit a63bb82 into dev Feb 11, 2025
11 checks passed
@hyoban hyoban deleted the feat/mobile-entry-pagination branch February 11, 2025 01:04
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.

1 participant