mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
fix(voice): resolve area names to the place they name
Three resolver fixes from checking the review focus:
- A natural region named like a country or state no longer hides it.
"India" was the peninsula, "Japan" an island group, "Florida" the
peninsula and "Punjab" a desert, so bare "Punjab" never asked which one.
The region still answers when asked for by level, and when no unit truly
has the name ("Great Britain" finds the United Kingdom only by alias).
- Same-named units get their own candidate: "Washington" offered WA and DC
with one id, so either choice was DC and a DC lookup overwrote a stored
Washington State. Ids now carry the region code, and choices show it.
- A bundled unit that only shares the name ("Azad Kashmir" for "Kashmir")
no longer ends the search; the outline ladder still looks, and the
mismatch is kept if it finds nothing. Retired zones stay refused.
This commit is contained in:
1 parent
d18fdfa47f
commit
552f3de3ff
4 files changed
+143
-14
No files matched your search
@@ -103,7 +103,7 @@ test('every emitted area candidate round-trips through the production schema', a
|
||||
true,
|
||||
);
|
||||
}
|
||||
assert.equal(ambiguous.candidates[0].candidateId.length, 41);
|
||||
assert.equal(ambiguous.candidates[0].candidateId.length, 44);
|
||||
const grammar = new RegExp(candidateSchema.pattern, 'u');
|
||||
for (const malformed of [
|
||||
'ne:state:bad slug',
|
||||
|
||||
@@ -80,7 +80,9 @@ function candidateLines(candidates) {
|
||||
? t(LEVEL_WORDS[candidate.level])
|
||||
: candidate.level
|
||||
: null;
|
||||
const detail = [level, candidate?.country].filter(Boolean).join(', ');
|
||||
const detail = [level, candidate?.region, candidate?.country]
|
||||
.filter(Boolean)
|
||||
.join(', ');
|
||||
return `${i + 1} · ${spokenLabel(candidate?.name || 'Unnamed', 40)}${detail ? ` — ${detail}` : ''}`;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user