fix(geocode): match the nearby whole-name fallback exactly

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
quanticsoul4772andClaude Opus 5.5 committed 2026-10-25 18:55:35 -07:00
1 parent 734c74c325
commit 2c16dd6601
2 files changed
+34 -1

No files matched your search

+7 -1
View File
@@ -417,7 +417,13 @@ export async function geocodeKeylessWithOutcome(
if (biased === null) everyAskAnswered = false;
else if (queryRegion(trimmed)) {
feature = selectQualifiedFeature(biased, trimmed);
nearbyNameMatch = selectPhotonFeature(biased, normalizeToponym(trimmed));
// Exactly the whole query: "Springfield IL Auto" only starts with it.
const whole = normalizeToponym(trimmed);
nearbyNameMatch =
biased.find(
(candidate) =>
normalizeToponym(candidate?.properties?.name) === whole,
) ?? null;
} else {
feature = selectPhotonFeature(biased, normalizeToponym(trimmed));
}