mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
Fix the follow-up review findings in import, layers, startup and engines
- KML/KMZ import: a per-file canvas budget and cache for ground overlays, limits on rings and vertices of raised polygons, overlays across 360° and near the poles, degenerate holes, polar and single-latitude fills, absolute overlays at their altitude, overlay order by drawOrder as on Cesium, and pins on tiles keep their measured height. - Points on the surface: OSM Places and Street Level cones share the surface sampler and sit on the terrain before they are measured, within a sampling budget per pass; Cockpit's contact-dot bank keeps the dot atlas, and a failed fleet model loads again after a pause. - Startup: the loading screen lifts after the share-link view is restored, the retry screen names the failed engine and takes focus, and the fallback toast stays for 6 s. - Engines: an engine switch lands a running camera flight at its destination (camera.completeFlight on both engines), the sighting card leaves focus on the engine picker after a switch, and a Cesium model error stays with the instance that failed. - The MCP panel builds again: its wind-mesh alias resolves to the stub. - QA: the wildlife switch waits for the camera to rest, GBFS --w2 says it needs the dev server, and test fixtures are shared instead of copied.
This commit is contained in:
1 parent
0ef29781e5
commit
60fb8fee07
82 files changed
+2363
-1574
No files matched your search
@@ -1295,12 +1295,13 @@ export class ShellFacade {
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a temporary toast notification for 2 seconds.
|
||||
* Displays a temporary toast notification.
|
||||
* @param {string} message - Text to show in the toast.
|
||||
* @param {number} [durationMs=2000] How long the notice stays visible.
|
||||
* @returns {void}
|
||||
*/
|
||||
_showToast(message) {
|
||||
return this._feedback._showToast(message);
|
||||
_showToast(message, durationMs) {
|
||||
return this._feedback._showToast(message, durationMs);
|
||||
}
|
||||
|
||||
/** One 3D toggle drives BOTH aircraft layers (commercial + military) so all planes flip together. */
|
||||
|
||||
@@ -374,9 +374,9 @@ export class ShellFeedback {
|
||||
this._loadingFeedbackTicker = null;
|
||||
}
|
||||
|
||||
_showToast(message) {
|
||||
_showToast(message, durationMs) {
|
||||
if (this.destroyed) return;
|
||||
this._toast.show(message);
|
||||
this._toast.show(message, durationMs);
|
||||
}
|
||||
destroy() {
|
||||
if (this.destroyed) return;
|
||||
|
||||
@@ -436,14 +436,27 @@ html:not([lang='en']):not(:lang(zh)):not(:lang(ja))
|
||||
animation: pulse 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
/* A start error is steady text, not pulsing progress. */
|
||||
.loader-status[role='alert'] {
|
||||
color: var(--text-primary);
|
||||
animation: none;
|
||||
}
|
||||
|
||||
/* After a failed globe switch: start an engine again without a reload. */
|
||||
.engine-switch-retry {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.engine-switch-retry p {
|
||||
flex-basis: 100%;
|
||||
font-size: 12px;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.engine-switch-retry button {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 11px;
|
||||
|
||||
+3
-3
@@ -25,11 +25,11 @@ export function createToast({
|
||||
store.publishToast({ ...store.toast, visible: false });
|
||||
};
|
||||
return {
|
||||
/** @param {string} message */
|
||||
show(message) {
|
||||
/** @param {string} message @param {number} [dwellMs] */
|
||||
show(message, dwellMs = durationMs) {
|
||||
store.publishToast({ text: message, visible: true, shown: ++shown });
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(hide, durationMs);
|
||||
timer = setTimeout(hide, dwellMs);
|
||||
},
|
||||
/** Hide the toast now and drop the timer. */
|
||||
hide,
|
||||
|
||||
@@ -7,6 +7,8 @@ import { createApp, nextTick } from 'vue';
|
||||
import { createPinia } from 'pinia';
|
||||
import { useStatusStore } from './stores/status.js';
|
||||
import { createToast } from './toast.js';
|
||||
import { ShellFeedback } from './shellFeedback.js';
|
||||
import { ShellFacade } from './shellFacade.js';
|
||||
import SceneChromeView from './views/SceneChromeView.vue';
|
||||
|
||||
function fixture(t) {
|
||||
@@ -77,3 +79,21 @@ test('a repeated message is written again so the live region announces it', asyn
|
||||
assert.ok(toast().firstChild !== first, 'the repeat is a new text node');
|
||||
assert.equal(toast().classList.contains('visible'), true);
|
||||
});
|
||||
|
||||
test('an engine failure can stay readable longer than an ordinary shell toast', async (t) => {
|
||||
const { store, toast } = fixture(t);
|
||||
const feedback = new ShellFeedback({ readLayers: () => [], store });
|
||||
t.after(() => feedback.destroy());
|
||||
const shell = { _feedback: feedback };
|
||||
ShellFacade.prototype._showToast.call(shell, 'Engine failed', 6000);
|
||||
t.mock.timers.tick(2000);
|
||||
await nextTick();
|
||||
assert.equal(toast().classList.contains('visible'), true);
|
||||
t.mock.timers.tick(4000);
|
||||
await nextTick();
|
||||
assert.equal(toast().classList.contains('visible'), false);
|
||||
ShellFacade.prototype._showToast.call(shell, 'Link copied');
|
||||
t.mock.timers.tick(2000);
|
||||
await nextTick();
|
||||
assert.equal(toast().classList.contains('visible'), false);
|
||||
});
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ENGINE_NAMES } from '../../app/engineChoice.js';
|
||||
import { msg, t } from '../../i18n/index.js';
|
||||
import { vPanelState } from '../rail/panelState.js';
|
||||
import UiButton from '../kit/UiButton.vue';
|
||||
@@ -19,8 +20,6 @@ import VoiceControl from './panels/VoiceControl.vue';
|
||||
// button calls the Display controls' owner, a chip the map source controls.
|
||||
const display = useDisplayStore();
|
||||
const { style, mapSource, mapSourceControls, globeEngine } = storeToRefs(display);
|
||||
// Product names, as the picker's options show them.
|
||||
const ENGINE_NAMES = { cesium: 'Cesium', navara: 'Navara', 'navara-hd': 'Navara HD' };
|
||||
// LocationControls publishes the location tray; pills call the controls,
|
||||
// and the search field keeps their listeners.
|
||||
const { view: loc, controls: locationControls } = storeToRefs(useLocationStore());
|
||||
@@ -120,9 +119,7 @@ function selectMapSource(chip) {
|
||||
{{ t('Globe Engine') }}
|
||||
<UiSelect id="globe-engine" class="gev-field gev-field--compact" translate="no" :model-value="globeEngine.kind" :aria-disabled="String(globeEngine.busy)" :aria-busy="String(globeEngine.busy)"
|
||||
@update:model-value="!globeEngine.busy && globeEngine.select($event)">
|
||||
<option value="cesium">Cesium</option>
|
||||
<option value="navara">Navara</option>
|
||||
<option value="navara-hd">Navara HD</option>
|
||||
<option v-for="(name, kind) in ENGINE_NAMES" :key="kind" :value="kind">{{ name }}</option>
|
||||
</UiSelect>
|
||||
</label>
|
||||
<span id="globe-engine-status" role="status">{{ globeEngine.busy ? t('Initializing systems...') : ENGINE_NAMES[globeEngine.kind] }}</span>
|
||||
|
||||
@@ -195,7 +195,7 @@ export function createWildlifeSightingCard({
|
||||
position({ allowPan: metadata?.explicitSelection === true });
|
||||
if (moving) startFrameUpdates();
|
||||
// Focus the container so keyboard navigation starts inside the card.
|
||||
if (fresh)
|
||||
if (metadata?.explicitSelection === true)
|
||||
host
|
||||
.querySelector('[data-wildlife-sighting-card]')
|
||||
?.focus?.({ preventScroll: true });
|
||||
|
||||
@@ -836,3 +836,35 @@ test('remounting a selected sighting does not pan the new engine', async (contex
|
||||
await settle();
|
||||
assert.equal(pans, 0);
|
||||
});
|
||||
|
||||
test('remounting a selected sighting leaves keyboard focus where it is', async (context) => {
|
||||
const f = fixture(context);
|
||||
await f.click();
|
||||
f.card.destroy();
|
||||
// The engine switch is made from the Globe Engine picker.
|
||||
const picker = document.body.appendChild(document.createElement('select'));
|
||||
picker.focus();
|
||||
const ui = createUiRuntime();
|
||||
const card = createWildlifeSightingCard({
|
||||
layer: f.layer,
|
||||
ui,
|
||||
engine: f.engine,
|
||||
documentRef: document,
|
||||
windowRef: f.windowRef,
|
||||
now: () => NOW,
|
||||
project: () => ({ x: 100, y: 100 }),
|
||||
pan: () => true,
|
||||
});
|
||||
context.after(() => {
|
||||
card.destroy();
|
||||
ui.destroy();
|
||||
});
|
||||
await settle();
|
||||
assert.ok(f.cardElement(), 'the carried selection opens the card');
|
||||
// A primitive: the reporter would print two DOM elements very slowly.
|
||||
assert.equal(
|
||||
document.activeElement === picker,
|
||||
true,
|
||||
`focus moved to ${document.activeElement?.tagName}`,
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user