fix(cctv): address review of #1543 (horizon test, resume guard, no per-frame allocation, mobile sheet)

- frames.test: viewerAt uses Cesium's default far (5e8) so the below-horizon
  test fails without occluder.isPointVisible
- cctvControls: install the resume observer for a still-only panel too
- cctvPresentation: panelShown also requires the Cameras sheet on phones;
  the observer watches body class/data-mobile-sheet
- frames.projectionInView: shared horizonOccluder + scratch sphere/array
This commit is contained in:
Byrd-IT authored and brandonabyrd committed 2026-11-18 17:13:06 -06:00
1 parent 0151c178a4
commit 9a3fc84935
6 files changed
+110 -25

No files matched your search

+10 -1
View File
@@ -73,7 +73,10 @@ export class CctvControls {
if (state) this._renderCctvState(state);
if (this._cctvChip) this._publishCctvChip({});
});
if (this._cctvVideo && typeof MutationObserver !== 'undefined') {
if (
(this._cctvVideo || this._cctvFrame) &&
typeof MutationObserver !== 'undefined'
) {
this._videoVisibilityObserver = new MutationObserver(() =>
this._renderCctvState(this._cctvState),
);
@@ -82,6 +85,12 @@ export class CctvControls {
attributes: true,
attributeFilter: ['class', 'hidden'],
});
// On phones the panel is on screen only while the Cameras sheet is open.
if (typeof document !== 'undefined' && document.body)
this._videoVisibilityObserver.observe(document.body, {
attributes: true,
attributeFilter: ['class', 'data-mobile-sheet'],
});
this.listen(document, 'visibilitychange', () =>
this._renderCctvState(this._cctvState),
);