Skip to content

fix(dashboard): Use index-based identification for collection filters#4428

Open
grolmus wants to merge 1 commit intovendurehq:masterfrom
grolmus:fix/oss-352-collection-filter-state
Open

fix(dashboard): Use index-based identification for collection filters#4428
grolmus wants to merge 1 commit intovendurehq:masterfrom
grolmus:fix/oss-352-collection-filter-state

Conversation

@grolmus
Copy link
Collaborator

@grolmus grolmus commented Feb 26, 2026

Summary

  • Fixed collection filters with the same type sharing state incorrectly
  • Changed onOperationValueChange to use index-based identification instead of code-based
  • Enabled the existing regression test for this issue

The bug was in configurable-operation-multi-selector.tsx where filters were identified by code, causing all filters of the same type to update when any one changed.

Test plan

  • Manually verified fix in dashboard (added 2 "Filter by product variant name" filters with different values)
  • CI runs issue-4327-collection-filter-state.spec.ts regression test

Fixes #4327

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
@vercel
Copy link

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vendure-storybook Ready Ready Preview, Comment Feb 26, 2026 2:13pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f1dec5 and ae0e8eb.

📒 Files selected for processing (2)
  • packages/dashboard/e2e/tests/regression/issue-4327-collection-filter-state.spec.ts
  • packages/dashboard/src/lib/components/shared/configurable-operation-multi-selector.tsx

📝 Walkthrough

Walkthrough

This 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 ConfigurableOperationMultiSelector component to use index-based identification instead of code-based identification when updating filter values. This ensures each filter instance maintains its own state regardless of type.

Suggested reviewers

  • michaelbromley
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: using index-based identification for collection filters instead of code-based identification.
Description check ✅ Passed The description includes a summary of changes, explains the bug fix, references the issue, includes a test plan with manual verification notes, and covers the key implementation details.
Linked Issues check ✅ Passed The code changes fully address issue #4327 by replacing code-based filter identification with index-based identification in onOperationValueChange and enabling the regression test.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing issue #4327: the index-based callback in configurable-operation-multi-selector.tsx and enabling the related regression test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard: Collection filters with same type share state incorrectly

1 participant