[PR #26240] Fix array-only filtering in List Operator picker; remove file children fallback and align child types. #31366

Closed
opened 2026-02-21 20:49:19 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/26240

State: closed
Merged: Yes


Fixed #26239

Changes:

- Remove fallback that repopulates default file children when filtered empty in findExceptVarInObject, so File and its non-matching children do not leak into the picker.
- Make display phase use filtered children instead of hardcoded FILE_STRUCT when rendering object/file children in VarReferenceVars.
- Align file sub-variable types between filtering and rendering via FILE_STRUCT as the single source of truth.
- Add isSupportFileVar={false} to list-operator’s VarReferencePicker to avoid selecting File root; users can still select eligible array children.
- Map VarType.array* to Type.array in varTypeToStructType to correctly represent arrays in structured panels.
- Remove stray debug logs.

Files:

- app/components/workflow/nodes/_base/components/variable/utils.ts
- app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx
- app/components/workflow/nodes/list-operator/panel.tsx

Rationale:

- Ensures filterVar semantics are respected; only eligible array types remain visible.
- Eliminates inconsistency between filtering and display phases.

Risk:

- Low; affects only variable picker UI. Panels expecting File will continue to show file and its children if their filter allows them.

Validation:

- List Operator shows only arrays; File root and default children no longer appear unless there are array children.
**Original Pull Request:** https://github.com/langgenius/dify/pull/26240 **State:** closed **Merged:** Yes --- Fixed #26239 ### Changes: - Remove fallback that repopulates default file children when filtered empty in findExceptVarInObject, so File and its non-matching children do not leak into the picker. - Make display phase use filtered children instead of hardcoded FILE_STRUCT when rendering object/file children in VarReferenceVars. - Align file sub-variable types between filtering and rendering via FILE_STRUCT as the single source of truth. - Add isSupportFileVar={false} to list-operator’s VarReferencePicker to avoid selecting File root; users can still select eligible array children. - Map VarType.array* to Type.array in varTypeToStructType to correctly represent arrays in structured panels. - Remove stray debug logs. ### Files: - app/components/workflow/nodes/_base/components/variable/utils.ts - app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx - app/components/workflow/nodes/list-operator/panel.tsx ### Rationale: - Ensures filterVar semantics are respected; only eligible array types remain visible. - Eliminates inconsistency between filtering and display phases. ### Risk: - Low; affects only variable picker UI. Panels expecting File will continue to show file and its children if their filter allows them. ### Validation: - List Operator shows only arrays; File root and default children no longer appear unless there are array children.
yindo added the pull-request label 2026-02-21 20:49:19 -05:00
yindo closed this issue 2026-02-21 20:49:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#31366