Move the imagery box preview into the recent imagery renderer

The box selection tool no longer builds Cesium entities itself: its fill
and dashed outline live in createImageryBoxPreview in the recent imagery
rendering module, and the tool takes the preview as a dependency. The
cockpit contact card reads the nearest contact's position with the geo
helpers. Both files leave the allow-list.

Tests now inject the preview with the Cesium double, check that a second
destroy returns the same promise, and pin the nose-relative bearing to a
known contact.
This commit is contained in:
Sameh Khamis committed 2026-11-07 03:11:51 -08:00
1 parent 6ee3bb2f7d
commit d928c30337
7 files changed
+153 -87

No files matched your search

+3 -1
View File
@@ -13,6 +13,7 @@ import {
SPLIT_PUBLISH_MS,
createRecentImageryLayer,
} from './index.js';
import { createImageryBoxPreview } from './rendering.js';
import {
BOX,
CANDIDATES,
@@ -1399,7 +1400,8 @@ test('with SELECT BOX armed, Escape clears the preview first and the next Escape
const cancels = [];
const tool = initImageryBoxTool({
viewer: fakes.viewer,
cesium: fakes.cesium,
createPreview: (viewer, dragBox) =>
createImageryBoxPreview(viewer, dragBox, { cesium: fakes.cesium }),
pickWorld: fakes.pickWorld,
documentRef: fakes.documentRef,
onBox: (box) => f.layer.setBox(box),