-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix #6070: hierarchical sorting #7163
Conversation
@moellep This is a bit hacky. Interested to see your feedback. Map seemed like the best structure in JavaScript to contain the sortColumns, but required encoding/decoding for requests |
I'm getting errors when I try to perform certain sorts. For example, select csx, add fccd_intersection, nanop_setup, detectors. The clear sort, sort fccd_intersection, sort nano_setup, sort detectors, see error.
I also got this error but I couldn't figure out how to reproduce. Looks like it is a known error so maybe you could backtrack from the stack trace with guesses to figure out how it happened.
|
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.
Haven't reviewed fully but one comment on using a 2d array instead of a string for the encoded values.
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 can get the "FieldPath cannot be constructed with empty string" error by selecting "Clear Sort" and letting the UI refresh without selecting a new sort field.
For the sorting behavior, I think it is confusing to select a column and not have it become the primary sort. For example, if I'm viewing the list and it is already sorted by "start", and I select "acquire period", it doesn't change the sorting. It does do that if I select "Clear Sort" first and then select "acquire period" but I don't think that is very intuitive.
Instead, you could remove the "Clear Sort" button and keep track of the last 3 sort columns, applied in order. For example, I view the page initially, and it is sorted by "start" by default. Then I select "acquire period" and it sorts by "acquire period", "start". Then I select "sequence id" and it sorts by "sequence id", "acquire period", "start". If you select a forth column, then only the last three selected columns would be used for sorting.
This seems to be some kind of restriction with Mongo sort. https://jira.mongodb.org/browse/SERVER-826 Any suggestions on how to handle this? I guess we could check the type of data in each column and only allow one array type column to be added to sort. |
Interesting. For now let's just not allow sorting of any array field and see if anyone asks for it. |
Ready for re-review. I went back and forth on whether to remove the "Clear Sort" button but I did remove it. |
I find I can get the sorting in an odd state, where selecting "acquire period" doesn't always sort the same. If I open the CHX page, and sort a few times on "acquire period", it behaves as expected, where empty fields either appear at the top or the bottom of the sort. But if I open a fresh CHX page and then sort on "T_sample_", "acquire period", "T_yoke", and then back to "acquire period", it always keeps the empty rows at the top of the sorted list even if I keep selecting "acquire period". |
Thanks for catching that. When reversing the order of a column that was already being sorted on, it was remaining at the same sort priority. It makes more sense to make that column become priority again. Should be fixed. |
Taking screenshots for the report got me thinking about whether it would be nice to have some visual indicator of sort order. Currently a user has to remember which column they clicked most recently, or study the column values. I think color gradient of the arrows would work, with the most saturated color being the top priority. Or just an indicator on the top priority column. On the other hand, sort order isn't preserved in appState so maybe it's unlikely that a user would forget which column they clicked last. |
Yes, I like the color saturation idea - show the top priority darker than the sub priorities. |
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.
Worked well. Some final style comments.
No description provided.