Skip to content

fix: improve pre-filled address formatting#18898

Open
JASSBR wants to merge 1 commit intotwentyhq:mainfrom
JASSBR:fix/address-formatting
Open

fix: improve pre-filled address formatting#18898
JASSBR wants to merge 1 commit intotwentyhq:mainfrom
JASSBR:fix/address-formatting

Conversation

@JASSBR
Copy link

@JASSBR JASSBR commented Mar 24, 2026

Summary

  • Changed address field separator from "," to ", " in joinAddressFieldValues.ts
  • Addresses now display as "123 Main St, New York, NY" instead of "123 Main St,New York,NY"
  • Updated corresponding test expectations

Test plan

  • Open a record with address fields
  • Verify address displays with proper spacing after commas
  • Verify editing an address field preserves formatting
  • Run joinAddressFieldValues and formatAddressDisplay tests

Fixes #18860

Add space after comma separator in address field values for
proper formatting (e.g. "New York, NY" instead of "New York,NY").

Fixes twentyhq#18860
Copilot AI review requested due to automatic review settings March 24, 2026 10:02
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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.

Copilot wasn't able to review any files in this pull request.


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

Comment on lines 9 to +12
return subFields
.map((subField) => fieldValue[subField])
.filter(isNonEmptyString)
.join(',');
.join(', ');
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

This change only adds a space after commas in the joined display string. The linked issue (#18860) describes duplicated city/country (etc.) remaining in Address 1 after selecting a suggestion, which is a different problem (data normalization/prefill mapping) and likely won’t be resolved by changing the join separator. Either adjust the PR description/issue linkage, or add the logic that strips city/state/postcode/country from addressStreet1 when populating the structured subfields.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

Welcome!

Hello there, congrats on your first PR! We're excited to have you contributing to this project.
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.

Generated by 🚫 dangerJS against b5c6c03

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

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.

Pre-filled addresses are not well formatted

2 participants