-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New filtering experience #5189
New filtering experience #5189
Conversation
return filterType && filterType in propertyFilterMapping ? propertyFilterMapping[filterType] : undefined | ||
} | ||
|
||
export function taxonomicFilterTypeToPropertyFilterType(filterType?: TaxonomicFilterGroupType): string | undefined { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor stylistic question: Why have a function do this every time with find, rather than reverse the mapping of propertyFilterMapping
once and just use object attributes directly? Wouldn't Object.fromEntries(Object.entries(propertyFilterMapping).map(([ k, v ]) => [v, k]))
accomplish that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would. Though this is running in onChange
handlers only, so the performance boost will be pretty tiny. I'll fix it in a follow up PR. Hope to get this in its current state in front of as many eyeballs as quickly as possible.
const [referenceElement, setReferenceElement] = useState<HTMLDivElement | null>(null) | ||
const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null) | ||
|
||
const { styles, attributes } = usePopper(referenceElement, popperElement, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Going forward will react-popper
replace antd Tooltips?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope so! Since react-popper
itself is just a hook, we need to build the actual popup component and its interactions with the rest of the app ourselves. This can get tricky. For example I already had to include some funky code to make sure that we can have multiple popups on the page at the same time, without interfering in each other's onClickOutside
logic. There will surely be more stuff like this to come.
Attached is a basic empty state focused on resetting the type-ahead field to its initial state. Clicking the button would reset the type-ahead input to have no value, and would reload the picker with its default parameters. Edit - just saw that we have a pretty good error state in there now. I think that could be enough to release as we mostly want to inform of the "no matches" case. Adding in the action to clear the parameters would be a "nice to have" change depending on our timeline. |
After testing this for a while I think it's a huge improvement. I don't have any feedback I would consider blocking at this point, but I did have some longer-term things to think about. "All" tab Consistent "show filter" placement |
@mariusandra One potential issue I just saw - we're skipping over the operator field when automatically changing |
c5d6924
to
67b54cc
Compare
I rebased with master (lost the commit history along the way 🤷, ask if you want it) and will stop adding things to this PR unless anyone finds critical bugs. Everything will still be behind a feature flag and I'd like to get this in front of as many internal eyeballs as possible, as quickly as possible. Regarding feedback:
|
Good questions. I was thinking it'd just be the tab groupps stacked in the same order, but then that begs the question "why do we have tabs?" Maybe we should go with this and see how users respond to the changes.
👍
Yeah it's just weird that we skip it in the order when we don't do that anywhere else. Jumping to the value field could be ok if the "is equal to" operator is our most common use case. The opposite case could also be true. Users could be annoyed if they always have to navigate through the operator to set a value.
👍 I am working on some ideas for this. I'll try to get that ready to inform a follow up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! UX-wise I only found a couple of bugs,
- The bug when you select a property value the other options disappear is still happening.
- There's some weird behavior when selecting values (see recording).
- Large values are not handled well.
@@ -120,7 +120,6 @@ export const personsModalLogic = kea<personsModalLogicType<PersonModalParams>>({ | |||
} | |||
}, | |||
loadPeople: async ({ peopleParams }, breakpoint) => { | |||
actions.setPeopleLoading(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Thanks! :)
() => [propertyDefinitionsModel.selectors.loaded], | ||
(propertiesLoaded): boolean => !propertiesLoaded, | ||
() => [featureFlagLogic.selectors.featureFlags, propertyDefinitionsModel.selectors.loaded], | ||
(featureFlags, loaded) => !featureFlags[FEATURE_FLAGS.TAXONOMIC_PROPERTY_FILTER] && !loaded, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Should the selector have a return type for clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type? Not sure * loaded
and * loading
kind of imply a yes/no
state IMO... and typegen also doesn't need an explicit type here, so 🤷
@@ -512,6 +512,53 @@ interface PropertyKeyInfoInterface { | |||
ellipsis?: boolean | |||
} | |||
|
|||
export function PropertyKeyTitle({ data }: { data: KeyMapping }): JSX.Element { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Does this need to be exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to import it in InfiniteList
. This all should get a good refactor though, including replacing the default popup library. Then I'd merge the PropertyKeyTitle
and PropertyKeyDescription
components as well.
Perfect! Thanks for the review and catching that bug reversal! I probably thought I was in a loader instead of being in a listener :/. I'll wait for the tests to pass and then merge this in. The the flag is enabled for the team. Tomorrow's focus: improving the property value select and fixing all other feedback... then asking for more of it. |
Changes
Everything here is behind feature flag
4267-taxonomic-property-filter
Continuation of #5098 - however considering how much the original PR and this one have diverged, I'd just merge this one into master instead.
TODO:
TaxonomicFilter
out ofTaxonomicPropertyFilter
, so it could be used also to select Events, Breakdowns, whatever.I'd like to merge this in before tackling the remaining issues.
Checklist