Read "from the map" after any switch or clear verb, before anything else

"clear everything except flights from the map" and "hide everything
from the map" now read as they do without the ending, instead of only
offering Ask GEV or a place search.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-18 19:10:54 -08:00
1 parent 81192cfa50
commit cd5a4443a2
4 files changed
+27 -14

No files matched your search

+7
View File
@@ -292,6 +292,13 @@ export function normalizeLine(text, { isRequest = isPlainRequest } = {}) {
/^((?:turn|switch) (?:on|off)|show|hide|remove|enable|disable|clear|go to|fly to)\s+\1\b/i,
'$1',
);
// "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).
line = line.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,
'$1 $2',
);
// "please" is dropped only around a request: "Please Touch Museum",
// "Kindly Lane" and "Pretty Please" are names.
const polite = line