Skip to content

feat(ui): resolve select filterOptions in the list view where builder - #17536

Open
paulpopus wants to merge 2 commits into
mainfrom
feat/wherelistbuilder-now-respects-select-fields-filterOptions
Open

feat(ui): resolve select filterOptions in the list view where builder#17536
paulpopus wants to merge 2 commits into
mainfrom
feat/wherelistbuilder-now-respects-select-fields-filterOptions

Conversation

@paulpopus

@paulpopus paulpopus commented Jul 29, 2026

Copy link
Copy Markdown
Member

What

The list view where (filter) builder ignored a select field's filterOptions function. The filter value dropdown always showed the full static options list, even when filterOptions was defined to narrow or fetch that list dynamically (e.g. from the database).

Why

filterOptions was already resolved server-side for relationship fields, producing a Where query keyed by collection. select fields use filterOptions differently: it returns a filtered Option[] instead of a Where query. Because resolveAllFilterOptions only handled the relationship shape, select filtering was not used.

How

  • Extend resolveAllFilterOptions to also call a select field's filterOptions function, awaiting async implementations, and store the resulting Option[] in the same resolved map used for relationship fields.
  • Widen resolvedFilterOptions and filterOptions prop types from ResolvedFilterOptions to Option[] | ResolvedFilterOptions across the list view and where builder component chain, so both shapes can flow through unchanged.
  • In WhereBuilder/Condition, use the resolved Option[] for the filter value options when present, falling back to the field's static options otherwise.
  • In DefaultFilter, only pass the resolved value through to RelationshipFilter when it is a Where query, avoiding an Option[] being mistaken for relationship filter options.

@github-actions

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@paulpopus paulpopus changed the title feat(ui): resolve select filterOptions in the list view filter panel feat(ui): resolve select filterOptions in the list view where builder Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant