mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-14 15:22:21 +00:00
fix(street-level): links keep the recipient's preferences; aim under the screen centre
Review fixes for gekh's #1113 round: - a link runs show_street_level with origin 'programmatic', so its source switch and layer are not saved as the recipient's preferences; - with no place named, the action looks under the screen centre (aim 'screen-centre', armed false), keeps the sky refusal and leaves a link's armed point alone; - an armed OPEN aimed at the sky opens nothing instead of the far link point; - an imagery-stage failure is spoken as an error, missing imagery as missing (street.nearestOutcome); the card says "the view centre" in the interface language; - every photo the action opens reveals its panel, and revealPanel scrolls the panel into view in the phone sheet; - embed: EXPAND survives embed's own clean view, the lifted photo hides in cockpit, recording and scene playback, and a failed photo step closes the earlier photo before the view flies; - links pasted into an open tab run their street-level step after the restore settles; a superseded start link does not; - Mapillary's nearest search gives up after 12 s, body included.
This commit is contained in:
1 parent
3f55077c2c
commit
451f3e41cf
22 files changed
+716
-64
No files matched your search
@@ -536,6 +536,22 @@ test('labels are bounded and cleaned before they are spoken', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('the street-level card says "the view centre" in the interface language', () => {
|
||||
setLocale('de');
|
||||
try {
|
||||
const out = envelope('show_street_level', {
|
||||
ok: true,
|
||||
providerName: 'Mapillary',
|
||||
label: 'the view centre',
|
||||
atViewCentre: true,
|
||||
});
|
||||
assert.equal(out.display.lines[0], 'die Bildmitte');
|
||||
assert.match(out.say, /the view centre/, 'speech stays English');
|
||||
} finally {
|
||||
setLocale('en');
|
||||
}
|
||||
});
|
||||
|
||||
test('street-level speech names the source and the place, and says which step failed', () => {
|
||||
const ok = envelope('show_street_level', {
|
||||
ok: true,
|
||||
@@ -556,7 +572,8 @@ test('street-level speech names the source and the place, and says which step fa
|
||||
map: "Google Street View needs the Google 3D map, which isn't available.",
|
||||
key: 'Google Street View needs its key.',
|
||||
layer: "Couldn't turn on Street Level.",
|
||||
imagery: 'No Google Street View imagery near Nowhere.',
|
||||
// A service or viewer failure, not missing coverage.
|
||||
imagery: 'Google Street View could not open imagery near Nowhere.',
|
||||
};
|
||||
for (const [stage, say] of Object.entries(stages)) {
|
||||
const out = envelope('show_street_level', {
|
||||
@@ -570,6 +587,24 @@ test('street-level speech names the source and the place, and says which step fa
|
||||
assertSpeakable(out.say);
|
||||
assert.deepEqual(out.display.lines, ['detail']);
|
||||
}
|
||||
const empty = envelope('show_street_level', {
|
||||
ok: false,
|
||||
stage: 'imagery',
|
||||
noImagery: true,
|
||||
label: 'Nowhere',
|
||||
providerName: 'Mapillary',
|
||||
});
|
||||
assert.equal(empty.say, 'No Mapillary imagery near Nowhere.');
|
||||
const sky = envelope('show_street_level', {
|
||||
ok: false,
|
||||
stage: 'imagery',
|
||||
aim: 'sky',
|
||||
atViewCentre: true,
|
||||
label: 'the view centre',
|
||||
providerName: 'Mapillary',
|
||||
});
|
||||
assert.equal(sky.say, 'Aim the middle of the view at a street first.');
|
||||
assertSpeakable(sky.say);
|
||||
const armed = envelope('show_street_level', {
|
||||
ok: true,
|
||||
armed: true,
|
||||
|
||||
Reference in new issue
Block a user