Stop roster hover and focus from moving the camera while Space Missions goes off

While Space Missions was going off (its Satellites restore still running,
the panel still shown), hovering or keyboard-focusing a roster row still
scheduled the roster preview, which flew the camera to that launch with
nothing left to end it. The preview is no longer scheduled once the layer
is going off, and one already pending is dropped. Selection, focus, replay
and stepping from the Data Layers row were already refused then.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-18 16:37:48 -08:00
1 parent 9ac937af82
commit 8675ead171
3 files changed
+35 -3

No files matched your search

+8 -2
View File
@@ -380,14 +380,20 @@ export function createPanel({ state: layerState, services, parts, source }) {
function scheduleMissionRosterPreview(index) {
const launch = layerState._launches[index];
if (!launch || layerState._selectedLaunchId) return;
// Once the layer is going off (its Satellites restore may still be
// running) hovering or focusing a roster row moves no camera.
if (!launch || layerState._selectedLaunchId || !layerState._enabled) return;
if (layerState._missionRosterHoverTimer)
clearTimeout(layerState._missionRosterHoverTimer);
layerState._hoveredRosterLaunchId = launch.id;
parts.overlays.syncMissionOverlayEntries();
layerState._missionRosterHoverTimer = setTimeout(() => {
layerState._missionRosterHoverTimer = null;
if (layerState._hoveredRosterLaunchId !== launch.id) return;
if (
layerState._hoveredRosterLaunchId !== launch.id ||
!layerState._enabled
)
return;
const currentLaunch = resolveMissionRosterPreviewLaunch(
layerState._launches,
launch.id,
+24
View File
@@ -9,6 +9,7 @@ function fixture() {
const state = createState({
services: { overlays: {}, render: {} },
});
state._enabled = true;
const calls = [];
const parts = {
overlays: {
@@ -194,3 +195,26 @@ test('the panel commands act on the selected mission', () => {
['select', null, undefined],
]);
});
test('a roster row hovered or focused while the layer goes off moves no camera', async () => {
const { state, panel, calls } = fixture();
state._launches = [launch('a'), launch('b')];
panel.createMissionPanel();
panel.renderMissionRoster();
// Hovered just before the layer goes off: the pending preview is dropped.
panel.commands.rosterPointerEnter(0);
state._enabled = false;
await new Promise((resolve) => setTimeout(resolve, 160));
// Hovered or focused after it went off, while the panel still shows.
panel.commands.rosterPointerEnter(1);
panel.commands.rosterFocus(1);
assert.equal(state._missionRosterHoverTimer, null, 'no preview is pending');
await new Promise((resolve) => setTimeout(resolve, 160));
assert.deepEqual(
calls.filter(([name]) => name === 'preview'),
[],
);
panel.clearMissionPanel();
});