Filtering, sorting and grouping of tables #220
Replies: 8 comments 6 replies
-
I added some comments to the HackMD document. |
Beta Was this translation helpful? Give feedback.
-
For a single filter, we're missing the concept of negation for some of the filter options. (E.g., there's no "does not end with"). Rather than go through piecemeal adding those options, I suggest taking out the "does not contain" negation, and somehow portraying (and giving the user the option to choose) the complement of a given filter. |
Beta Was this translation helpful? Give feedback.
-
For multiple filters, it's not clear to me whether the composition is intended to be
Note the parentheses. On the other hand, I might want to find pet-themed albums, but I don't want to be made sad by finding any albums where there could be a song about cats eating rats (because in this case I like rats). In that case, I need the filter:
Note the parentheses. I see how we might add negation and conjunction/disjunction features w.r.t. filtering later by extending the UI in the doc, but I'm not sure how it would be possible to add the concept of parentheses to an extension of the current UI. Even for the negation, conjunction, and disjunction concepts, I think the current UI might get pretty crowded. |
Beta Was this translation helpful? Give feedback.
-
One option is to have a "simple filter" on the side panel, and an "advanced filter" in a separate element that can be brought up (users should be familiar with that flow). It still leaves the question (to me) of whether the simple filters should be composed with "and" or "or", and how to handle general negation. But, a lot of complexity is removed by only allowing one or the other of "and" or "or". One option (Google's advanced search used to do this) is to treat commas within a given field as an "or", and treat separate fields as an "and". So, the first query above be:
is input as:
Unfortunately, this puts a lot of burden on the user in the case of the second query. Translating that one into the appropriate form goes from
to
The translation is completely unclear and "feels" illogical (though it has the exact same effect as the "human readable" SQL filter). Also, doing the actual translation required me to get out a pencil and paper, which is probably a bad sign. The plus side is that the change is very minor to the UI (we'd just need to let them put multiple values in a field separated with commas), and can logically (as long as we allow the negations to be in the field with the values) handle any possible combination of conjunctions, disjunctions, and negations of filter operations. |
Beta Was this translation helpful? Give feedback.
-
I don't think we can support "advanced" filtering (especially parenthetical expressions) using the current UI. If we want to support complex filtering, we need to use a query builder UI with autocomplete like @pavish used for his log management product. @pavish, maybe you could post some screenshots or a short video here? Here are the options I see: Re: (1), I'm not sure that our default filtering interface should be a query builder, unless it's really intuitive to use. Non-technical users are probably not as familiar with complex queries as programmers, and we should make it easy for them. I think designing a really great query builder will take time and is probably not the best use of time right now. I think we should go with (2). Airtable supports both And and Or queries, but they only let you select one of them which then applies to all the filters. You can see in the screenshots below that only the first "And"/"Or" has a dropdown next to it, and changing it changes the rest to the same thing. This seems like a good thing for us to do too. |
Beta Was this translation helpful? Give feedback.
-
I think we would need the option to group filters for the MVP, like Airtable does (in @kgodey 's screenshot). Based on the current design, we implicitly select the grouping as 'AND'. Giving an user additional option to change that seems like a good idea. I would consider this as a basic filter. For the advanced query, I agree that we'll need a proper query builder (I will add some references and also a recording of the query builders I've worked with in the past, later). But I don't think we need it right away, it could be an improvement for later. |
Beta Was this translation helpful? Give feedback.
-
Looks like we're all agreed on the filter design, let's finalize it. |
Beta Was this translation helpful? Give feedback.
-
@kgodey @pavish @mathemancer |
Beta Was this translation helpful? Give feedback.
-
The design specs for #160 are ready for review. Please add any comments or suggestions you might have related to the design solution or any edge cases that need to be considered that could impact the design.
@kgodey @pavish @mathemancer your review confirmation is needed, even without feedback.
Refer to the review guidelines for additional advice on providing feedback https://wiki.mathesar.org/en/design/process/review-guidelines
Find the specs document here:
https://hackmd.io/@mathesar/HyPeStDcO
The review should be completed by end of this week (Friday, 11th June) so please make sure to allocate the necessary time.
Beta Was this translation helpful? Give feedback.
All reactions