fix(dashboard): Use index-based identification for collection filters#4428
fix(dashboard): Use index-based identification for collection filters#4428grolmus wants to merge 1 commit intovendurehq:masterfrom
Conversation
Collection filters with the same type were sharing state incorrectly. The onOperationValueChange function compared filters by code, causing all filters of the same type to update when any one changed. Changed to index-based identification to match the pattern already used by onCombinationModeChange. Fixes vendurehq#4327
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis pull request addresses a state management bug in collection filters where multiple filters of the same type incorrectly shared synchronized values. The fix involves two key changes: (1) activating a regression test in the test suite that validates the independent state of multiple same-type filters, and (2) refactoring the Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
Hey @grolmus, nice fix! The logic change is correct and clean. The dashboard e2e failure is a small casing issue in the test. The In - has: page.getByText('Term', { exact: true }),
+ has: page.getByText('term', { exact: true }),That should get CI green. 🙂 |
biggamesmallworld
left a comment
There was a problem hiding this comment.
LGTM — the index-based fix is correct and consistent with the existing patterns in the component. The test casing issue has been identified and a fix provided in the comments.
Summary
onOperationValueChangeto use index-based identification instead of code-basedThe bug was in
configurable-operation-multi-selector.tsxwhere filters were identified bycode, causing all filters of the same type to update when any one changed.Test plan
issue-4327-collection-filter-state.spec.tsregression testFixes #4327