Skip to content

Comments

City Names#8484

Merged
atavism merged 3 commits intomainfrom
jigar/city-names
Feb 19, 2026
Merged

City Names#8484
atavism merged 3 commits intomainfrom
jigar/city-names

Conversation

@jigar-f
Copy link
Contributor

@jigar-f jigar-f commented Feb 19, 2026

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 copyWith method to the Location_ class, allowing for easy creation of modified copies of location objects, specifically to update the city field while retaining other properties.

  • Updated the _groupLocationsByCountry method to:

    • Group locations by country and count occurrences of each city within a country.
    • Append a unique index to duplicate city names within the same country (e.g., "Paris - 1", "Paris - 2") by using the new copyWith method, ensuring city names are unique in the grouped results.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 copyWith method to Location_ class for creating modified location copies
  • Enhanced _groupLocationsByCountry to 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.

atavism and others added 2 commits February 19, 2026 10:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@atavism atavism merged commit e8f27eb into main Feb 19, 2026
9 checks passed
@atavism atavism deleted the jigar/city-names branch February 19, 2026 18:56
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>
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