-
Notifications
You must be signed in to change notification settings - Fork 117
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 filter system #2769
New filter system #2769
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
I removed |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2769 +/- ##
=============================================
+ Coverage 65.40% 65.64% +0.23%
- Complexity 4936 5064 +128
=============================================
Files 531 550 +19
Lines 20308 20618 +310
Branches 1163 1157 -6
=============================================
+ Hits 13283 13534 +251
- Misses 6353 6411 +58
- Partials 672 673 +1
Continue to review full report at Codecov.
|
src/main/java/com/faforever/client/vault/replay/LiveReplayFilterController.java
Outdated
Show resolved
Hide resolved
8b8cf17
to
105403f
Compare
f7ad132
to
d32ea26
Compare
d32ea26
to
97e5fb3
Compare
Looking good with the structure. One thing I don't quite understand though is what are the FilterNames used for? And what is the idea behind the primary and secondary filters? |
Filter names are necessary because different places use a specific set of filters where the same data type will be filtered. They will also be displayed in the order you specify. The feature is that you don't need to duplicate an extra class to create a new set of filters of the same type.
Primary filters are always visible, we filter some properties that are often used. |
Got it so the names are mostly there to differentiate between the primary and secondary filters. Also we should make sure to differentiate these filters enough from the filters in the query package that are used for the api. As things are named right now they might be easy to confuse, or question why both exist. |
I did not complicate everything and removed the concepts of "primary" and "secondary" filters. All the specified filters are always visible |
I think it would be nice to add a counter of how many elements are hidden for each filter. I can make it optional. This complicates the code. I won't do it |
I will also replace |
96246de
to
874d5dc
Compare
I did not expect the PR to be big. :) |
6d7d9a4
to
7a4b529
Compare
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 will review this more in depth over the weekend but had some high level thoughts.
For the country filters is there anyway you think to limit the countries shown only to those where players are actually in the list?
I noticed that the filtering is all done in the application thread I wonder if there is a way to move some of the heavy lifting the a background thread.
I am still not convinced of the need for the FilterNames especially since it looks like each class that uses them creates a custom implementation for them anyway so it isn't like there is any unity between them especially with the filterBuilder which makes it easier. As it is now I would assume that any filter can take any of the filter names but that isn't the case. Because of that I think it might be better to just construct the filters in place and add them without the filter names but I could be convinced otherwise if there is a good reason I am not seeing. And at most it looks like you are just using the names to bind the preferences which can still be done at construction. Also I think it is just better for these filter controller to be a bit more static since the pieces they are made of are very modular to anyway.
And yeah in depth PRs like this one have a way of growing ha XD
Also for records I would just make the closing bracket on the same line
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.
Overall looking good just a few minor things.
Also I had changed the name of some methods but then realized they were overriding abstract ones. Thought I removed all those comments but you can ignore them if I forgot to remove them.
src/main/java/com/faforever/client/chat/ChatUserListController.java
Outdated
Show resolved
Hide resolved
public void setDefaultPredicate(Predicate<T> defaultPredicate) { | ||
this.defaultPredicate = defaultPredicate; | ||
predicateProperty.setValue(defaultPredicate); | ||
} |
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.
Maybe check if the current predicate is the old default before overwriting
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 is no need. I do not see that it is possible to call the method twice.
src/main/java/com/faforever/client/filter/AbstractFilterController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/faforever/client/filter/AbstractFilterController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/faforever/client/filter/AbstractFilterNodeController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/faforever/client/filter/FilterMultiCheckboxController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/faforever/client/filter/FilterMultiCheckboxController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/faforever/client/filter/FilterMultiCheckboxController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/faforever/client/filter/MutableListFilterController.java
Outdated
Show resolved
Hide resolved
Done.
I created a local class. He works. I will add it.
Could you point out where processing the heavy code? To be continued... |
a9ccea0
to
fbffaa6
Compare
6c8d646
to
23cf2eb
Compare
I can't find it anymore so it is all good. Do you have anything more you wanted to do with this? |
The only thing I did not have time to do. I can do this in a separate PR in the future. |
Works for me |
Great work on this @Marc-Spector, I love it! |
Closes #2767
Closes #1946