mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +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
@@ -1164,11 +1164,16 @@ export function createAnalystEngine(providers) {
|
||||
* so a follow-up filters exactly what the user just heard about.
|
||||
* @param {string} layerKey Queryable layer the rows belong to.
|
||||
* @param {Array<object>} rows Records in that layer's analyst shape.
|
||||
* @param {{scope?: string}} [options]
|
||||
* @param {{scope?: string, presentation?: object|null}} [options]
|
||||
* `presentation` is how the set was scoped ("inside Kathmandu"), so a
|
||||
* follow-up names the same scope instead of "anywhere".
|
||||
*/
|
||||
remember(layerKey, rows, { scope = 'handoff' } = {}) {
|
||||
remember(layerKey, rows, { scope = 'handoff', presentation = null } = {}) {
|
||||
if (!ANALYST_LAYERS[layerKey] || !Array.isArray(rows)) return false;
|
||||
lastResult = {
|
||||
...(presentation
|
||||
? { presentation: structuredClone(presentation) }
|
||||
: {}),
|
||||
matched: [{ key: layerKey, rows: rows.slice() }],
|
||||
layerKeys: [layerKey],
|
||||
coverage: {
|
||||
|
||||
Reference in new issue
Block a user