Add product search and pagination - #461
Conversation
|
Warning Review limit reached
Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe home product flow now returns paginated results, supports debounced search and incremental loading, exposes refresh behavior, and surfaces API failures. Home and search widgets trigger pagination and render loading, empty, failure, and product-result states, with tests updated for the new contract. ChangesHome products and search
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
🧹 Nitpick comments (1)
lib/features/home/home_viewmodel.dart (1)
113-134: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winLoad-more failure can cause repeated failing requests.
On failure,
_hasMoreand_nextCursorare left unchanged and only a warning is logged. SinceHomeScreencallsloadMoreProducts()on every scroll notification whileextentAfter < 600, a user who keeps scrolling near the bottom will re-trigger the same failing page fetch repeatedly with no user-visible error. Consider surfacing a retriable error state and/or a short backoff so a failed page isn't hammered.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/features/home/home_viewmodel.dart` around lines 113 - 134, Update loadMoreProducts to handle failed page fetches with a retriable, user-visible error state or a short retry backoff, preventing repeated requests while the scroll position remains near the bottom. Apply this behavior in the result failure and exception paths while preserving successful pagination updates and request-sequence checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@lib/features/home/home_viewmodel.dart`:
- Around line 113-134: Update loadMoreProducts to handle failed page fetches
with a retriable, user-visible error state or a short retry backoff, preventing
repeated requests while the scroll position remains near the bottom. Apply this
behavior in the result failure and exception paths while preserving successful
pagination updates and request-sequence checks.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9f9be2a1-f58f-4e9e-b5d3-9c11b4b5abbb
📒 Files selected for processing (8)
lib/features/home/home_repository.dartlib/features/home/home_viewmodel.dartlib/features/home/widgets/dashboard.dartlib/features/home/widgets/dashboard_empty_widget.dartlib/features/home/widgets/home_screen.dartlib/features/search/widgets/search.darttest/home_repository_test.darttest/home_screen_mvp_test.dart
CherryCIC
left a comment
There was a problem hiding this comment.
I'm happy with this and it looks good.
A future iteration could be useful for also searching charities, but as a basic search this is looking great!
Thank you @yusuphjoluwasen
Summary
Summary by CodeRabbit
New Features
Bug Fixes