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

+8 -1
View File
@@ -277,9 +277,16 @@ export function _renderCctvState(state) {
// A background tab or a collapsed panel shows nothing, so neither plays the
// video nor fetches the still; the observer and the visibilitychange listener
// render again when the panel is shown.
// On phones the panel also belongs to one sheet: the shell hides it unless
// data-mobile-sheet is 'cameras'.
const body = typeof document !== 'undefined' ? document.body : null;
const sheetClosed =
!!body?.classList?.contains('mobile-shell') &&
body.getAttribute('data-mobile-sheet') !== 'cameras';
const panelShown =
!(typeof document !== 'undefined' && document.hidden) &&
!this._cctvPanel?.classList?.contains('collapsed');
!this._cctvPanel?.classList?.contains('collapsed') &&
!sheetClosed;
if (this._cctvVideo) {
const visible = liveIntent && panelShown;
if (!visible || this._cctvVideoCameraId !== activeId) {