Uh oh!
There was an error while loading. Please reload this page.
feat(fields): MultiSelectField per-option visibleWhen cascading + dependsOn gating (#2715) - #2717
Merged
Merged
Conversation
…endsOn gating (#2715) Closes the parity gap #2709 opened: when a `select` + `multiple` (and the `multiselect` type) began delegating to the multi-value chip picker, that picker did not implement the ADR-0058 per-option `visibleWhen` cascading / `dependsOn` gating the single `SelectField` has, so a multi-select with dependent options showed the unfiltered set. - Extract `useCascadingOptions` — the shared hook resolving per-option `visibleWhen` filtering, `dependsOn` gating, and the live `dependentValues` + predicate-scope wiring — and route both `SingleSelectField` and `MultiSelectField` through it (no duplicated resolver). - `MultiSelectField` narrows its offered chips against the live record + `current_user`, gates behind a "select the parent first" hint while a `dependsOn` field is empty, and surfaces a legible empty state. - Cascade-clear prunes only the now-invalid selections (array analogue of the single select's clear), keeping still-offered ones. - Tests mirror `SelectField.cascade.test.tsx`; README + changeset updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes#2715.
What
Gives the multi-value chip picker (
MultiSelectField) the same per-optionvisibleWhencascading anddependsOngating the singleSelectFieldalready has (ADR-0058). This closes the parity gap #2709 opened: once aselect+multiple(and themultiselecttype) started delegating to the chip picker, a multi-select whose options depend on a sibling field or the current user showed the unfiltered option set.Changes
useCascadingOptions(packages/fields/src/widgets/useCascadingOptions.ts) — the shared hook that resolves per-optionvisibleWhenfiltering,dependsOngating, and thedependentValues+ predicate-scope wiring. BothSingleSelectFieldandMultiSelectFieldnow route through it instead of duplicating the resolver.MultiSelectField: narrows offered chips against the live record +current_user; gates behind a "select the parent first" hint while adependsOnfield is empty; surfaces a legible empty state instead of a bare chip row. Adds deterministic testids (multiselect-empty-*,multiselect-option-*).visibleWhenkeeps its label, not a bare id).@object-ui/fieldsminor).Acceptance (from the issue)
SelectFieldandMultiSelectField(extracted hook, no duplication).MultiSelectFieldappliesvisibleWhenfiltering +dependsOngating (empty/gated hint) like single select.SelectField.cascade.test.tsxfor the multi case.Tests
MultiSelectField.cascade.test.tsx(gating, per-element cascade clear, role/context gating) — mirrorsSelectField.cascade.test.tsx.MultiSelectField.cascade+SelectField.cascade+standard-widgets(the feat(fields): select+multiple → multi-value chip picker; restore fields/core lint gates #2709 delegation tests) + coreoptionRules— 49 passed.tsc --noEmitclean across@object-ui/fields(deps built);eslint0 errors.🤖 Generated with Claude Code