Skip to content

[fix] correct city names in address autocomplete dropdown#28

Closed
ruchirx wants to merge 2 commits intomainfrom
ruchirx/fix-address-suggestions
Closed

[fix] correct city names in address autocomplete dropdown#28
ruchirx wants to merge 2 commits intomainfrom
ruchirx/fix-address-suggestions

Conversation

@ruchirx
Copy link

@ruchirx ruchirx commented Mar 4, 2026

Summary

  • Google Places Autocomplete secondaryText returns Census Designated Place (CDP) names like "Briarcliff, TX" instead of the USPS postal city "Austin, TX" for addresses in those areas
  • After fetching autocomplete suggestions, we now also fetch addressComponents via Place Details for each suggestion (in parallel) to get the correct locality
  • Uses the same city extraction logic as parseAddress (locality > sublocality > administrative_area_level_2)
  • Corrections are cached by placeId to avoid redundant fetches

Test plan

  • Search "6200 Hilltop Plateau Dr" — dropdown should show "Austin, TX" not "Briarcliff, TX"
  • Search a normal Austin address (e.g. "1100 Congress Ave") — should still show "Austin, TX"
  • Select an address — input field and final parsed result should have correct city
  • Verify no visual flicker (suggestions appear with correct city, not wrong-then-corrected)

🤖 Generated with Claude Code

Autocomplete secondaryText uses CDPs (e.g. "Briarcliff, TX") instead of
postal cities (e.g. "Austin, TX"). Fetch addressComponents via Place
Details for each suggestion to get the correct locality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include rabbit in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 977bf900-c0d2-408a-8f23-24211b2810a9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ruchirx/fix-address-suggestions

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

Place Details returns the same CDP name as autocomplete. Switch to the
Geocoding API which normalizes addresses to USPS postal cities
(e.g. "Austin" instead of "Briarcliff").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ruchirx ruchirx closed this Mar 4, 2026
@ruchirx ruchirx deleted the ruchirx/fix-address-suggestions branch March 4, 2026 22:47
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.

1 participant