-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[ui] Search results are overloading filter with sorted results #18053
[ui] Search results are overloading filter with sorted results #18053
Conversation
Ember Test Audit comparison
|
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.
Code changes LGTM, just missing a changelog entry and that missing property.
But I think there may be a challenge in terms of being able to get the list sorted by the original search score, since when we sort results there's no way to "unsort" them.
One approach I though was for a search to always reset the sort order to the fuzzy score, but that could be annoying? But also, that's kind of what I expect to happen? 😅
ui/app/controllers/jobs/index.js
Outdated
@@ -292,9 +295,24 @@ export default class IndexController extends Controller.extend( | |||
}); | |||
} | |||
|
|||
@computed('sortProperty', 'searchTerm') |
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.
@computed('sortProperty', 'searchTerm') | |
@computed('sortProperty', `sortDescending`, 'searchTerm') |
My worry here is that:
I think that would break the expected experience from #14872, so I'm apprehensive to apply it. |
Ah sorry, I think I didn't explain myself well. From your example the flow I was thinking would be like this:
So after a search users can sort results by whichever column they would like, but changing the search term resets the ordering to fuzzy score. |
Got it, so what I'm currently calling |
Hum...I think what's missing is a listener for changes to the search term that resets |
|
Wouldn't that be a new search? I think I would expect the table to reset to its original state (sorted by |
Yeah fair enough! That's actually the state I moved it to this morning, so I think I'll move forward with this. |
Bit of context here:
This PR attempts to both preserve the ability to sort after searching, and not overload results with searched-but-not-ordered filter results by creating a new getter() that checks to see if any sorting has been applied.