mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Take "from the map" off after "clear" only for the whole map
"clear flights from the map" no longer offers to turn Flights on. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
3d31126c72
commit
3a5b10a1f6
3 files changed
+16
-5
No files matched your search
@@ -7976,8 +7976,9 @@ the ones named, on Enter, or says no other layers are on; with a layer to
|
||||
keep that is not read, nothing is switched off and only Ask GEV is offered.
|
||||
While Space Missions is on, keeping either it or Satellites keeps both,
|
||||
since Space Missions draws through Satellites. "remove flights from the
|
||||
map" is "remove flights", after hide, remove, turn off or clear ("clear
|
||||
everything except flights from the map", "hide everything from the map";
|
||||
map" is "remove flights", after hide, remove or turn off, and after clear for the whole map
|
||||
("clear everything except flights from the map", "hide everything from the
|
||||
map";
|
||||
"show me the view from the map" is a question), a doubled verb ("hide hide everything") is read
|
||||
once, and a grid reference after "near" is the place ("flights near 14R PU
|
||||
2090 4906"). Following needs a callsign or ICAO address (letters and a digit), a
|
||||
|
||||
@@ -302,10 +302,11 @@ export function normalizeLine(text, { isRequest = isPlainRequest } = {}) {
|
||||
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 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).
|
||||
// "off" ("turn off the screen" is no layer switch), not after "show"
|
||||
// ("show me the view from the map" is a question), and after "clear"
|
||||
// only for the whole map.
|
||||
return read.replace(
|
||||
/^((?:turn|switch) off|hide|remove|disable|clear)\s+(\S.*?)\s+(?:from|off) (?:the )?(?:map|globe|screen|view)$/i,
|
||||
/^((?:turn|switch) off|hide|remove|disable|clear(?= (?:everything|all|every)\b))\s+(\S.*?)\s+(?:from|off) (?:the )?(?:map|globe|screen|view)$/i,
|
||||
'$1 $2',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -816,6 +816,15 @@ test('"except" leaves Satellites to switch off with Space Missions off', () => {
|
||||
['layer(satellites,off)'],
|
||||
text,
|
||||
);
|
||||
// "clear" takes the ending off only for the whole map: "clear flights
|
||||
// from the map" never offers to turn Flights on.
|
||||
assert.ok(
|
||||
!omnibar
|
||||
.rows('clear flights from the map', { places: [] })
|
||||
.rows.some((row) =>
|
||||
(row.steps || []).some((step) => step.kind === 'layer' && step.enabled),
|
||||
),
|
||||
);
|
||||
// After "show" the ending is part of what is asked.
|
||||
assert.equal(
|
||||
omnibar.rows('show me the view from the map', { places: [] }).defaultIndex,
|
||||
|
||||
Reference in new issue
Block a user