-
Notifications
You must be signed in to change notification settings - Fork 467
feat(web): add Load More button to OSS friends page for efficient loading #2137
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(web): add Load More button to OSS friends page for efficient loading #2137
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughImplements client-side pagination for the OSS friends list. Adds display limiting via constants and state, computes a displayedFriends subset, and extends FriendsSection to render a "Load more" button that increments the visible count. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/web/src/routes/_view/oss-friends.tsx (1)
60-64: Consider memoizingdisplayedFriendsfor consistency.The pagination logic is correct. However, for consistency with the memoized
filteredFriends, consider wrappingdisplayedFriendsinuseMemowith dependencies[isSearching, filteredFriends, displayCount].Apply this diff if you'd like to memoize the computation:
+ const isSearching = search.trim().length > 0; + + const displayedFriends = useMemo(() => { + return isSearching ? filteredFriends : filteredFriends.slice(0, displayCount); + }, [isSearching, filteredFriends, displayCount]); + - const isSearching = search.trim().length > 0; - const displayedFriends = isSearching - ? filteredFriends - : filteredFriends.slice(0, displayCount); const hasMore = !isSearching && displayCount < filteredFriends.length;
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/web/src/routes/_view/oss-friends.tsx(5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, usecn(import from@hypr/utils). It is similar toclsx. Always pass an array and split by logical grouping.
Usemotion/reactinstead offramer-motion.
Files:
apps/web/src/routes/_view/oss-friends.tsx
🧬 Code graph analysis (1)
apps/web/src/routes/_view/oss-friends.tsx (1)
packages/utils/src/cn.ts (1)
cn(20-22)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Redirect rules - hyprnote
- GitHub Check: fmt
- GitHub Check: ci
- GitHub Check: Header rules - hyprnote
- GitHub Check: Pages changed - hyprnote
- GitHub Check: Devin
🔇 Additional comments (4)
apps/web/src/routes/_view/oss-friends.tsx (4)
43-44: LGTM!The pagination constants are well-defined and match the PR requirements.
66-68: LGTM!The
handleLoadMorefunction correctly increments the display count using the functional update form.
78-82: LGTM!The props are correctly passed to
FriendsSectionto enable the load-more functionality.
136-144: LGTM!The function signature correctly extends the props with
hasMoreandonLoadMore, and follows the coding guideline to inline props rather than creating a separate interface.
Summary
Adds a "Load More" button to the OSS friends page for more efficient initial page loading. The page now shows 12 projects initially and loads 12 more each time the button is clicked. When the user starts searching, all matching results are shown immediately (pagination is bypassed).
Updates since last revision
from-stone-100 to-white) with matching hover statesReview & Testing Checklist for Human
displayCountstate persists (user sees where they left off). Confirm this is the desired behavior vs. resetting to 12.Notes