-
Notifications
You must be signed in to change notification settings - Fork 20
feat: VNDA productListingPage default sorting param #1481
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
Conversation
WalkthroughProduct listing loader updated to accept an optional Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Loader as productListingPage.searchLoader
participant Cache
Client->>Loader: Request (includes URL sort?)
note right of Loader `#dfefff`: Sort resolution
Loader->>Loader: read URL sort param
alt URL sort present
Loader->>Loader: use URL sort
else URL sort missing
Loader->>Loader: use props.sort if provided
else props.sort missing
Loader->>Loader: use default VNDA_SORT_OPTIONS[0]
end
note right of Loader `#fff5df`: Cache key serialization uses props.sort as an additional fallback before URL sort (per change)
Loader->>Cache: compute cacheKey (serializes sort per new fallback order)
Loader->>Client: Return results
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 |
Tagging OptionsShould a new tag be published when this PR is merged?
|
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
vnda/loaders/productListingPage.ts(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
vnda/loaders/productListingPage.ts (2)
wake/loaders/productListingPage.ts (1)
Sort(41-48)vnda/utils/client/types.ts (1)
Sort(3-3)
🔇 Additional comments (2)
vnda/loaders/productListingPage.ts (2)
50-53: LGTM!The optional
sortproperty is properly typed and documented, allowing loaders to set a default sort option.
104-105: LGTM!The fallback chain correctly prioritizes URL parameters over props, allowing user-initiated sorts to override component defaults.
Adds a Sort property to VNDA productListingPage Loader, allowing commerces to set default order option on their pages.
Summary by CodeRabbit
New Features
Refactor