docs(SelectNext): add server-side search example (DS-4770) - #445
Conversation
📝 WalkthroughWalkthroughSelectNext now includes a ChangesSelectNext server search
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Select
participant useAsyncList
participant SWAPI
Select->>useAsyncList: Submit search or load-more request
useAsyncList->>SWAPI: Fetch people with query, page, and abort signal
SWAPI-->>useAsyncList: Return people or request error
useAsyncList-->>Select: Update items, loading state, or error state
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
Visit the preview URL for this PR (updated for commit ad54b84): https://react-koobiq-next--prs-445-ld14ydvd.web.app (expires Mon, 10 Aug 2026 13:30:57 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@packages/components/src/components/SelectNext/Select.stories.tsx`:
- Around line 602-606: Update the async list loader around the fetch request to
catch both rejected requests and non-OK responses, set hasMore to false before
rethrowing, and preserve the existing successful-load behavior. In the Select
story’s async-list rendering, use the error state to provide an error-specific
noItemsText so failures display the error/empty state instead of remaining
loading.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c3d178fa-a5a0-4686-b734-8b80e348f33d
📒 Files selected for processing (2)
packages/components/src/components/SelectNext/Select.mdxpackages/components/src/components/SelectNext/Select.stories.tsx
There was a problem hiding this comment.
🟡 Changes recommended
The new story’s retained/pinned option tracking can become stale when selection changes without a reload, leading to incorrect filtering behavior in the server-search example.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds a new SelectNext documentation example demonstrating server-side search backed by useAsyncList, including async loading, pagination (loadMore), selection persistence, and request cancellation via AbortSignal.
Changes:
- Added a new
ServerSearchStorybook story that fetches options from SWAPI, supports pagination, and retains selected items across searches. - Added a new “Server search” documentation section embedding the new story and explaining the approach.
File summaries
| File | Description |
|---|---|
| packages/components/src/components/SelectNext/Select.stories.tsx | Adds the ServerSearch example story implementing async server search + pagination with retained selections. |
| packages/components/src/components/SelectNext/Select.mdx | Documents server-side search behavior and embeds the new story. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@packages/components/src/components/SelectNext/Select.stories.tsx`:
- Line 671: Update the SelectNext story’s loading prop so the `Select` component
uses only `list.isLoading` and no longer treats `hasMore` as loading. Remove the
unused `hasMore`/`setHasMore` state from the story around `useAsyncList`, and
keep the pagination behavior driven by the existing `list` symbol without
showing loading text during idle pagination.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 7ec9fa45-5d41-40fa-a56e-884d1a315557
📒 Files selected for processing (1)
packages/components/src/components/SelectNext/Select.stories.tsx
Summary by CodeRabbit
New Features
Documentation