mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
fix(voice): keep the area in follow-ups on OSM places
osm_query handed its places to the analyst with no presentation, so "which of
those have emergency?" after "hospitals in Kathmandu" was answered as "anywhere
in the loaded data". The handoff now carries the scope the places were found
in ("inside Kathmandu" with its areaId, or "in view"), as an analyst count over
that area would.
This commit is contained in:
1 parent
451be8e3b7
commit
474cce51eb
5 files changed
+71
-9
No files matched your search
+15
-4
@@ -67,8 +67,9 @@ const EXAMPLES = Object.values(OSM_PRESETS)
|
||||
* @param {(enabled: boolean) => Promise<object>} deps.enableLayer
|
||||
* @param {Function} deps.search `/api/osm/features` client.
|
||||
* @param {() => void} [deps.onCredit] Registers the OpenStreetMap credit.
|
||||
* @param {(rows: object[]|null) => void} [deps.rememberResults] Hands the
|
||||
* listed places to analyst follow-ups; null forgets the previous set.
|
||||
* @param {(rows: object[]|null, presentation?: object) => void} [deps.rememberResults]
|
||||
* Hands the listed places, and the scope they were found in, to analyst
|
||||
* follow-ups; null forgets the previous set.
|
||||
* @param {(step: string, label?: string) => void} [deps.progress]
|
||||
* @param {object} args
|
||||
* @param {{isCurrent?: () => boolean, budgetMs?: number, signal?: AbortSignal}} [options]
|
||||
@@ -258,8 +259,18 @@ export async function osmQuery(
|
||||
}
|
||||
if (wasDisplaced()) return displaced();
|
||||
// These places are now "the last answer": follow-ups filter them and
|
||||
// "the second one" is the second row below.
|
||||
rememberResults(records);
|
||||
// "the second one" is the second row below. A follow-up keeps naming the
|
||||
// area they were found in, as an analyst count over that area would.
|
||||
rememberResults(
|
||||
records,
|
||||
area
|
||||
? {
|
||||
scopeLabel: `inside ${areaName}`,
|
||||
coverageScope: `area:${args.areaId}`,
|
||||
areaId: args.areaId,
|
||||
}
|
||||
: { scopeLabel: 'in view', coverageScope: 'view' },
|
||||
);
|
||||
const unnamed = `unnamed ${singularLabel(preset.label)}`;
|
||||
const referents = [
|
||||
...records.filter((r) => r.name),
|
||||
|
||||
Reference in new issue
Block a user