insightsengineering / teal.slice

Reproducible slice module for teal applications
https://insightsengineering.github.io/teal.slice/
Other
11 stars 5 forks source link

[Feature Request]: Allowing out of bound value input in range selection UI #319

Open lcd2yyz opened 1 year ago

lcd2yyz commented 1 year ago

Feature description

Relates to https://github.com/insightsengineering/teal.slice/pull/289 and https://github.com/insightsengineering/teal.slice/pull/316#issuecomment-1574575689

Currently behavior of our range selector UI: when user manually enters a value smaller/larger than the actual min/max of the data, the range value automatically snaps back to the min/max.

User should be allowed to specify any numerical value, including out-of-bound values, and expect the slider to apply that the chosen range selection for all subsequent analysis/reports.

chlebowa commented 1 year ago

Before we start on this, let us consider that removing out of bounds values from the selection is the behavior of all FilterState classes. Should this behavior be removed for all data types or only numeric variables?

lcd2yyz commented 1 year ago

Good question. I can only think of numerical variables that might require use of oob values - but in addition to the range slider, I would also consider date/datetime be a numerical values, so behaviour should be applied to date/datetime filter states classes.

Do you have more examples of other filter state classes that might need to consider this?

m7pr commented 1 year ago

during the refinement we agreed that this card should only consider numeric input and should not focus on anything else

chlebowa commented 1 year ago

Based on unit tests, we expect ChoicesFilerState to set selection to intersection of selected and choices, so I wouldn't touch those, personally.

during the refinement we agreed that this card should only consider numeric input and should not focus on anything else

There are distant plans to reorganize FilterState subclasses into range-based (numbers, dates, date-times) and selection-based (factors, logicals, anything with a low number of unique values). Unless they have been scrapped or put off indefinitely, I would like to repeat that discussion (which I missed) in this context.

It makes sense to me that dates and date-times allow out of bounds selections as well.