# [Enhancement] Add dynamic State/Province selection or autocomplete in Profile configuration #278

Closed
opened 2026-06-27 18:14:14 +00:00 by enjin2310 · 4 comments

Summary

The State/Province field in the user profile configuration lacks a functional selection list or autocomplete feature, making it difficult for users to input valid location data accurately.

Description

While configuring user data in the Profile section, the State/Province placeholder currently displays a static “-- Select --” option without any available entries or suggestions. This prevents users from completing their address properly and may lead to inconsistent or incomplete data.

Proposed Enhancement

Implement a dynamic selection or autocomplete system for the State/Province field:

  • Integrate a location API (e.g., Google Maps API, OpenStreetMap, or GeoNames) to fetch valid states/provinces based on the selected country.
  • Provide a country-dependent dropdown list that updates automatically when the user selects a country.
  • Include input validation to ensure standardized location data.

Expected Behavior

When the user selects a country or begins typing in the State/Province field:

  1. The system should display relevant suggestions or a dropdown list of valid states/provinces.
  2. The user can select from the list or continue typing to refine results.
  3. The field should validate the selection before saving.

Benefits

  • Improves data accuracy and consistency.
  • Enhances user experience by reducing manual effort.
  • Prevents invalid or incomplete location entries.
  • Aligns with modern UX standards for address forms.

Environment

Property Value
Application SpikerSoft Learning Platform
Module Profile Configuration
Environment Production
Browser Firefox
Operating System Windows 11
Version v2026.06.26a
Device Desktop PC

Steps to Reproduce

  1. Navigate to learn.spikersoft.com/profile.
  2. Locate the State/Province field under Mailing Address.
  3. Attempt to select or type a location.
  4. Observe that no suggestions or dropdown options appear.

Expected Result

The field should provide dynamic suggestions or a dropdown list of valid states/provinces based on the selected country.

Actual Result

The field only displays “-- Select --” with no available options or autocomplete functionality.

Evidence

  • Screenshot shows the Mailing Address section with the State/Province dropdown open and displaying only “-- Select --”.
  • Other fields (Street Address, City, Postal Code) are filled correctly, confirming the issue is isolated to the State/Province field.

Impact

  • Reduces data quality and consistency.
  • Increases user friction during profile setup.
  • May cause issues in location-based features or analytics.

Frequency

Always

Reproducibility

100%

Severity

Low

Notes

Integrating a location API or static dataset for country-specific regions would resolve the issue and enhance overall user experience.

## Summary The **State/Province** field in the user profile configuration lacks a functional selection list or autocomplete feature, making it difficult for users to input valid location data accurately. ## Description While configuring user data in the **Profile** section, the **State/Province** placeholder currently displays a static “-- Select --” option without any available entries or suggestions. This prevents users from completing their address properly and may lead to inconsistent or incomplete data. ### Proposed Enhancement Implement a **dynamic selection or autocomplete system** for the State/Province field: - Integrate a **location API** (e.g., Google Maps API, OpenStreetMap, or GeoNames) to fetch valid states/provinces based on the selected country. - Provide a **country-dependent dropdown list** that updates automatically when the user selects a country. - Include **input validation** to ensure standardized location data. ### Expected Behavior When the user selects a country or begins typing in the **State/Province** field: 1. The system should display relevant suggestions or a dropdown list of valid states/provinces. 2. The user can select from the list or continue typing to refine results. 3. The field should validate the selection before saving. ### Benefits - Improves data accuracy and consistency. - Enhances user experience by reducing manual effort. - Prevents invalid or incomplete location entries. - Aligns with modern UX standards for address forms. ## Environment | Property | Value | |-----------|--------| | Application | SpikerSoft Learning Platform | | Module | Profile Configuration | | Environment | Production | | Browser | Firefox | | Operating System | Windows 11 | | Version | v2026.06.26a | | Device | Desktop PC | ## Steps to Reproduce 1. Navigate to `learn.spikersoft.com/profile`. 2. Locate the **State/Province** field under **Mailing Address**. 3. Attempt to select or type a location. 4. Observe that no suggestions or dropdown options appear. ## Expected Result The field should provide dynamic suggestions or a dropdown list of valid states/provinces based on the selected country. ## Actual Result The field only displays “-- Select --” with no available options or autocomplete functionality. ## Evidence - Screenshot shows the **Mailing Address** section with the **State/Province** dropdown open and displaying only “-- Select --”. - Other fields (Street Address, City, Postal Code) are filled correctly, confirming the issue is isolated to the State/Province field. ## Impact - Reduces data quality and consistency. - Increases user friction during profile setup. - May cause issues in location-based features or analytics. ## Frequency Always ## Reproducibility 100% ## Severity Low ## Notes Integrating a location API or static dataset for country-specific regions would resolve the issue and enhance overall user experience.
Owner

Investigated against current code and production. The dynamic, country-filtered State/Province dropdown described in this enhancement request already exists and is fully wired up:

  • Frontend: app-address-section renders a mat-select populated from availableStates(), which ProfileComponent.loadStatesForCountry() refreshes via PostalCodeService.getStatesForCountry() whenever the Country field changes.
  • Backend: GET /api/PostalCodes/states/{countryCode} (GetStatesForCountryQueryHandler) queries a Mongo-backed PostalCodes collection seeded from GeoNames at startup (PostalCodeSeederService, with retry/backoff and a /healthz check).
  • Verified live against production: the /healthz "Postal Code Data" check is Healthy with 317,784 seeded records, and US, CA, and MX all return correct, populated state/province lists right now.

So I can't reproduce an empty dropdown for any of the common countries I tested. It's possible the country selected when this was filed has sparse/no admin1 (state-level) data in GeoNames — some smaller countries genuinely don't have state subdivisions in that dataset. Could you confirm which country you had selected when you saw the empty list? If it's a real GeoNames coverage gap for that country, the fix would be a narrower data-coverage ticket rather than the full autocomplete rebuild proposed here. The one piece of the original ask that's genuinely missing is type-ahead/autocomplete (today it's a standard dropdown, not filter-as-you-type) — happy to scope that separately as a smaller enhancement if still wanted.

Investigated against current code and production. The dynamic, country-filtered State/Province dropdown described in this enhancement request already exists and is fully wired up: - Frontend: `app-address-section` renders a `mat-select` populated from `availableStates()`, which `ProfileComponent.loadStatesForCountry()` refreshes via `PostalCodeService.getStatesForCountry()` whenever the Country field changes. - Backend: `GET /api/PostalCodes/states/{countryCode}` (`GetStatesForCountryQueryHandler`) queries a Mongo-backed `PostalCodes` collection seeded from GeoNames at startup (`PostalCodeSeederService`, with retry/backoff and a `/healthz` check). - Verified live against production: the `/healthz` "Postal Code Data" check is Healthy with 317,784 seeded records, and `US`, `CA`, and `MX` all return correct, populated state/province lists right now. So I can't reproduce an empty dropdown for any of the common countries I tested. It's possible the country selected when this was filed has sparse/no admin1 (state-level) data in GeoNames — some smaller countries genuinely don't have state subdivisions in that dataset. Could you confirm which country you had selected when you saw the empty list? If it's a real GeoNames coverage gap for that country, the fix would be a narrower data-coverage ticket rather than the full autocomplete rebuild proposed here. The one piece of the original ask that's genuinely missing is type-ahead/autocomplete (today it's a standard dropdown, not filter-as-you-type) — happy to scope that separately as a smaller enhancement if still wanted.
Owner

Investigated against current code and production. The dynamic, country-filtered State/Province dropdown described in this enhancement request already exists and is fully wired up:

  • Frontend: app-address-section renders a mat-select populated from availableStates(), which ProfileComponent.loadStatesForCountry() refreshes via PostalCodeService.getStatesForCountry() whenever the Country field changes.
  • Backend: GET /api/PostalCodes/states/{countryCode} (GetStatesForCountryQueryHandler) queries a Mongo-backed PostalCodes collection seeded from GeoNames at startup (PostalCodeSeederService, with retry/backoff and a /healthz check).
  • Verified live against production: the /healthz "Postal Code Data" check is Healthy with 317,784 seeded records, and US, CA, and MX all return correct, populated state/province lists right now.

So I can't reproduce an empty dropdown for any of the common countries I tested. It's possible the country selected when this was filed has sparse/no admin1 (state-level) data in GeoNames — some smaller countries genuinely don't have state subdivisions in that dataset. Could you confirm which country you had selected when you saw the empty list? If it's a real GeoNames coverage gap for that country, the fix would be a narrower data-coverage ticket rather than the full autocomplete rebuild proposed here. The one piece of the original ask that's genuinely missing is type-ahead/autocomplete (today it's a standard dropdown, not filter-as-you-type) — happy to scope that separately as a smaller enhancement if still wanted.

Investigated against current code and production. The dynamic, country-filtered State/Province dropdown described in this enhancement request already exists and is fully wired up: - Frontend: `app-address-section` renders a `mat-select` populated from `availableStates()`, which `ProfileComponent.loadStatesForCountry()` refreshes via `PostalCodeService.getStatesForCountry()` whenever the Country field changes. - Backend: `GET /api/PostalCodes/states/{countryCode}` (`GetStatesForCountryQueryHandler`) queries a Mongo-backed `PostalCodes` collection seeded from GeoNames at startup (`PostalCodeSeederService`, with retry/backoff and a `/healthz` check). - Verified live against production: the `/healthz` "Postal Code Data" check is Healthy with 317,784 seeded records, and `US`, `CA`, and `MX` all return correct, populated state/province lists right now. So I can't reproduce an empty dropdown for any of the common countries I tested. It's possible the country selected when this was filed has sparse/no admin1 (state-level) data in GeoNames — some smaller countries genuinely don't have state subdivisions in that dataset. Could you confirm which country you had selected when you saw the empty list? If it's a real GeoNames coverage gap for that country, the fix would be a narrower data-coverage ticket rather than the full autocomplete rebuild proposed here. The one piece of the original ask that's genuinely missing is type-ahead/autocomplete (today it's a standard dropdown, not filter-as-you-type) — happy to scope that separately as a smaller enhancement if still wanted.
Owner

Good news: the enhancement this ticket asks for already exists end-to-end and now works in production. The dropdown wiring was all in place (profile.component loads states on country change via a cached PostalCodeServiceGET /api/PostalCodes/states/{countryCode}address-section select) — the ticket predates the postal-data seed, when the endpoint had nothing to return, hence the empty "-- Select --". With the data seeded (317k records, #489's resolved half), verified live today: US → 53 entries, CA → 13, MX → 32, country-dependent as proposed.

Backend PR #249 fixes the two defects that remained: a blank entry at the top of the US list (GeoNames rows with missing admin names) and the query materializing ~40k rows per country to group in memory (now projected+deduped before fetch). 2 new xUnit tests.

Suggest closing on #249's merge. If you also want type-ahead autocomplete rather than the current dropdown, that'd be a small follow-up (mat-autocomplete over the same cached service) — say the word.

Good news: the enhancement this ticket asks for **already exists end-to-end and now works in production**. The dropdown wiring was all in place (`profile.component` loads states on country change via a cached `PostalCodeService` → `GET /api/PostalCodes/states/{countryCode}` → `address-section` select) — the ticket predates the postal-data seed, when the endpoint had nothing to return, hence the empty "-- Select --". With the data seeded (317k records, #489's resolved half), verified live today: **US → 53 entries, CA → 13, MX → 32**, country-dependent as proposed. **Backend PR #249** fixes the two defects that remained: a blank entry at the top of the US list (GeoNames rows with missing admin names) and the query materializing ~40k rows per country to group in memory (now projected+deduped before fetch). 2 new xUnit tests. Suggest closing on #249's merge. If you also want type-ahead autocomplete rather than the current dropdown, that'd be a small follow-up (mat-autocomplete over the same cached service) — say the word.
Owner

Board-sweep hygiene: spikerj verified the data live in prod (US 53/CA 13/MX 32) and conditioned closing on backend PR #249's merge — #249 (blank-name + projection fix) has merged. Applying the close.

Board-sweep hygiene: spikerj verified the data live in prod (US 53/CA 13/MX 32) and conditioned closing on backend PR #249's merge — #249 (blank-name + projection fix) has merged. Applying the close.
Sign in to join this conversation.