Read "from the map" only after hide, remove, turn off or clear

"show me the view from the map" is a question again, not a place search.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-18 19:45:38 -08:00
1 parent 06eb60faab
commit 3d31126c72
3 files changed
+12 -5

No files matched your search

+4 -3
View File
@@ -301,10 +301,11 @@ export function normalizeLine(text, { isRequest = isPlainRequest } = {}) {
.trim();
const read = polite !== line && polite && isRequest(polite) ? polite : line;
// "remove flights from the map", "clear everything except ships from the
// map": the map is where every layer is. Not the verb's own "off" ("turn
// off the screen" is no layer switch).
// map": the map is where every layer is taken from. Not the verb's own
// "off" ("turn off the screen" is no layer switch), and not after "show"
// ("show me the view from the map" is a question).
return read.replace(
/^((?:turn|switch) (?:on|off)|show|display|add|hide|remove|enable|disable|clear|toggle)\s+(\S.*?)\s+(?:from|off) (?:the )?(?:map|globe|screen|view)$/i,
/^((?:turn|switch) off|hide|remove|disable|clear)\s+(\S.*?)\s+(?:from|off) (?:the )?(?:map|globe|screen|view)$/i,
'$1 $2',
);
}
+5
View File
@@ -816,6 +816,11 @@ test('"except" leaves Satellites to switch off with Space Missions off', () => {
['layer(satellites,off)'],
text,
);
// After "show" the ending is part of what is asked.
assert.equal(
omnibar.rows('show me the view from the map', { places: [] }).defaultIndex,
-1,
);
// The whole map cleared "from the map" is the same plan, not a place.
for (const text of [
'hide everything from the map',