feat: Filters + Boosts#450
Draft
jbottigliero wants to merge 2 commits into
Draft
Conversation
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 free
to 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.
The general approach here is to allow users to specify
data.attributes.globus.search.filtersas partialGFilterdefinitions, then using that object to generate a UI control. The UI control can then be further customized by providing auimember to the object. Theuimember has a few well-known properties (type,label, anddescription) the rest are spread down to the most relevant Mantine component rendered based on theGFilter.typemapping.value/valuesto act as constant filters.uishould allow for extending functionality in the future.Example 1:
match_any/match_all{ "field_name": "example_field", "type": "match_any" // or, "match_all" }<TagsInput />(https://v8.mantine.dev/core/tags-input/)Example 2:
range{ "field_name": "number_of_states_in_flow", "type": "range", }<RangeSlider>(https://v8.mantine.dev/core/range-slider/)In this case the default
<RangeSlider>min/maxare probably not representative of your data, so they are best provided using theuimember:{ "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.typeto a control. To allow further customization of the rendered control a more specificui.typecan be provided.{ "field_name": "number_of_states_in_flow", "type": "range", "ui": { "type": "date" } }<DatePicker>with atypeof"range"(https://v8.mantine.dev/dates/date-picker/#dates-range){ "field_name": "number_of_states_in_flow", "type": "range", "ui": { "type": "datetime" } }<DateTimePicker>components, one representing thefromvalue, the other thetovalue (https://v8.mantine.dev/dates/date-time-picker/)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.typeto control mapping could be seen as fairly generic and useful outside the context of this portal...