Skip to content
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

PIA-1003: Sort and filter servers list by favorite and recommended #70

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

kp-laura-sempere
Copy link
Collaborator

This PR includes search, sort and filter functionatities:

  • Search regions by name or country
  • Recommended servers (based on latency)
  • Store last searched servers

@kp-laura-sempere kp-laura-sempere force-pushed the PIA-1003_regionslist_sorting branch 6 times, most recently from e1fb395 to e916d98 Compare February 1, 2024 12:58
@kp-laura-sempere kp-laura-sempere marked this pull request as ready for review February 1, 2024 12:58
Copy link
Collaborator

@kp-said-rehouni kp-said-rehouni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @kp-laura-sempere! Just a couple of comments that we can discuss tomorrow in a session.

}
}

extension Client: ClientType {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have not seen it being used and we already have ClientTypeImpl, do we need to make it conform to the procotol?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I created it to do the refresh latency but we are not using it.
I will remove it and then create a ticket to handle the refresh latency when needed

}
}

private func refreshRegionsList() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this ViewModel is probably doing many things, maybe we can break it down a bit, what do you think?

Copy link
Collaborator Author

@kp-laura-sempere kp-laura-sempere Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kp-said-rehouni ,
Yes, the thing is that we need to perform a lot of things from the regions list: add and remove to favorites, sorting by name and by recommended and search.
I created various UseCases to handle getting the servers list and also adding and removing from favorites. And this VM makes use of those use cases to do that. But in terms of sorting, filtering and searching (which it's another kind of filtering), not sure how we can split it out of this VM.
Do you have any suggestions? I will have another look and see if I can think of ways to do it

Copy link
Collaborator

@kp-said-rehouni kp-said-rehouni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great job @kp-laura-sempere!

@kp-laura-sempere kp-laura-sempere merged commit 0a2d002 into master Feb 5, 2024
1 check failed
@kp-laura-sempere kp-laura-sempere deleted the PIA-1003_regionslist_sorting branch February 5, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants