Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request enhances the server location selection UI by ensuring that duplicate city names within the same country are uniquely identified. It introduces a copyWith method to the Location_ class and updates the grouping logic to append unique indices to duplicate city names.
Changes:
- Added
copyWithmethod toLocation_class for creating modified location copies - Enhanced
_groupLocationsByCountryto detect and uniquely label duplicate city names within each country using a two-pass algorithm
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lib/core/models/available_servers.dart | Added copyWith method to allow modifying the city field of Location_ objects |
| lib/features/vpn/server_selection.dart | Updated grouping logic to detect duplicate cities and append unique indices to their names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
atavism
added a commit
that referenced
this pull request
Feb 20, 2026
* If number if city name is multiple times * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: atavism <atavism@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the handling and display of server locations by introducing a method to create modified copies of
Location_objects and improving the grouping logic for locations by country and city. The main goal is to ensure that duplicate city names within the same country are uniquely identified in the UI.Enhancements to location grouping and uniqueness:
Added a
copyWithmethod to theLocation_class, allowing for easy creation of modified copies of location objects, specifically to update thecityfield while retaining other properties.Updated the
_groupLocationsByCountrymethod to:copyWithmethod, ensuring city names are unique in the grouped results.