Skip to content

[P3][icebox] MultiSelectField: support per-option visibleWhen cascading (parity with single SelectField) #2715

Description

@os-zhuang

Context

#2709 made a select field/param declared multiple: true render the multi-value chip picker (MultiSelectField) by delegating inside SelectField. That fixed the real bug (multiple values were unstorable in the single-value dropdown).

Known gap: the chip picker does not implement the per-option visibleWhen CEL cascading / dependsOn gating that single SelectField has (ADR-0058). So a multi-select whose options depend on a sibling field or the current user would show the unfiltered option set. Single selects are unaffected.

Why this is icebox (not urgent)

Multi-select combined with per-option cascading is not a combination in use today — and the pre-#2709 behavior was strictly worse (a multi-value field that couldn't hold multiple values at all). This is a completeness follow-up, to be picked up only when a real multi-select-with-dependent-options need appears.

Scope (when actioned)

  • Share the option-resolution logic (resolveVisibleOptions / isOptionGroupGated / resolveDependsOnFields from @object-ui/core) between SelectField and MultiSelectField (extract a small hook/util rather than duplicating).
  • MultiSelectField applies visibleWhen filtering + dependsOn gating (empty/gated hint) like single select.
  • Cascade-clear: drop selected values no longer offered when the parent changes.
  • Tests mirroring SelectField.cascade.test.tsx for the multi case.

Acceptance

  • A multiple select with dependsOn + per-option visibleWhen narrows its offered chips identically to the single select, and clears now-invalid selections.

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions