Skip to content

feat: Filters + Boosts#450

Draft
jbottigliero wants to merge 2 commits into
v2from
feat-filters
Draft

feat: Filters + Boosts#450
jbottigliero wants to merge 2 commits into
v2from
feat-filters

Conversation

@jbottigliero

@jbottigliero jbottigliero commented Apr 15, 2026

Copy link
Copy Markdown
Member

The general approach here is to allow users to specify data.attributes.globus.search.filters as partial GFilter definitions, then using that object to generate a UI control. The UI control can then be further customized by providing a ui member to the object. The ui member has a few well-known properties (type, label, and description) the rest are spread down to the most relevant Mantine component rendered based on the GFilter.type mapping.

  • This leaves room to allow users to hard-code value/values to act as constant filters.
  • Splitting ui should allow for extending functionality in the future.

Example 1: match_any / match_all

{
  "field_name": "example_field",
  "type": "match_any" // or, "match_all"
}
Screen Cast 2026-04-15 at 1 26 43 PM

Example 2: range

{
  "field_name": "number_of_states_in_flow",
  "type": "range",
}

In this case the default <RangeSlider> min/max are probably not representative of your data, so they are best provided using the ui member:

{
  "field_name": "number_of_states_in_flow",
  "type": "range",
  "ui": {
     "min": 1000,
     "max": 10000,
     "step": 500
   }
}

Example 2B: Dates + Date Time Fields

Dates and Date Time fields are examples of data types that are not suitable for just a simple of GFilter.type to a control. To allow further customization of the rendered control a more specific ui.type can be provided.

{
  "field_name": "number_of_states_in_flow",
  "type": "range",
  "ui": {
     "type": "date"
   }
}
{
  "field_name": "number_of_states_in_flow",
  "type": "range",
  "ui": {
     "type": "datetime"
   }
}
Screen.Cast.2026-04-15.at.1.28.03.PM.mp4

All of this "works", but before I go much further I'm trying to determine if there is a better way to document and enforce this functionality (thinking along the lines of "previewing"/Storybook); This GFilter.type to control mapping could be seen as fairly generic and useful outside the context of this portal...

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.

1 participant