Skip to content

Conversation

@pbennett1-godaddy
Copy link
Contributor

Summary

This pull request makes several improvements to the checkout address form and its supporting data, mainly focusing on enabling address autocomplete for US addresses, cleaning up temporary code comments, and correcting region data for several countries. The most significant changes are grouped below by theme.

Checkout Address Form Improvements (address-form.tsx):

  • Re-enabled address autocomplete for US addresses using the AutoComplete component, which is now conditionally shown based on the session's enableAddressAutocomplete flag. This includes wiring up useAddressMatches, debounced input, and handling selection events. [1] [2] [3] [4] [5] [6]
  • Restored imports and logic for address completeness and matching, and removed temporary comments that previously disabled these features. [1] [2] [3]
  • Improved form field reset logic: when changing the country, now resets AddressLine1, AdminArea1, AdminArea2, and PostalCode fields to empty strings, ensuring form consistency. Also resets PostalCode when the region changes. [1] [2]
  • Added accessibility improvements such as tabIndex={0} and aria-required to relevant form fields. [1] [2] [3]
  • Removed temporary comments for suggested address display and validation error display, cleaning up the code and preparing for future enhancements. [1] [2]

Region Data Corrections (country-region-data.ts):

  • Updated region data for several countries by replacing "undefined" string values with undefined (actual JavaScript value), improving type consistency and downstream usage. This affects Cook Islands, Falkland Islands, Faroe Islands, French Guiana, French Polynesia, French Southern and Antarctic Lands, Gibraltar, Guadeloupe, Guam, and others. [1] [2] [3] [4] [5]
  • Removed the region "Marga-Marga" from Chile's region list, likely correcting a data issue.

These changes collectively improve the user experience in the checkout flow, especially for US addresses, and ensure more accurate and consistent region data for global addresses.

Changeset

  • Changeset added (docs)

Test Plan

- Tracking field additions
- draftOrder and draftOrderTotals refactor
- Address autocomplete options
- fix country & region matching
@pbennett1-godaddy pbennett1-godaddy self-assigned this Oct 28, 2025
@pbennett1-godaddy pbennett1-godaddy requested a review from a team as a code owner October 28, 2025 18:12
@pbennett1-godaddy pbennett1-godaddy requested review from Copilot and wcole1-godaddy and removed request for a team October 28, 2025 18:12
Copy link

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 synchronizes the latest changes to the checkout library, primarily focusing on enabling address autocomplete for US addresses and cleaning up region data. The changes improve the checkout address form by restoring address autocomplete functionality, correcting country region data, and enhancing form field reset logic when countries or regions change.

Key Changes:

  • Re-enabled US address autocomplete using the AutoComplete component with debounced input and selection handling
  • Corrected region data by replacing "undefined" string values with actual undefined values across multiple countries
  • Improved form reset logic to clear address fields when changing countries or regions

Reviewed Changes

Copilot reviewed 77 out of 78 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/react/src/components/checkout/address/address-form.tsx Restored address autocomplete for US addresses and improved country/region change handling
packages/react/src/components/checkout/address/country-region-data.ts Fixed region data by replacing string "undefined" with undefined values and removed invalid region
packages/react/src/types.ts Consolidated type definitions and removed unused DraftOrderTotalsQuery
packages/react/src/lib/godaddy/queries.ts Removed redundant query definitions (DraftOrderTotalsQuery, DraftOrderShippingQuery)
packages/react/src/lib/godaddy/godaddy.ts Updated to use environment-based host selection and consolidated queries
packages/react/src/tracking/tracking-provider.tsx Added support for custom tracking properties
Multiple localization files Added missing translations for accessibility labels and error messages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pbennett1-godaddy pbennett1-godaddy added the javascript Pull requests that update Javascript code label Oct 28, 2025
@wcole1-godaddy wcole1-godaddy merged commit 0e07815 into main Oct 30, 2025
3 checks passed
@wcole1-godaddy wcole1-godaddy deleted the sync-latest-checkout-lib-changes branch October 30, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants