From 260331d5db8443ea5955037fab1f871c65b7d379 Mon Sep 17 00:00:00 2001 From: draexon Date: Wed, 29 Jul 2026 10:32:00 +0530 Subject: [PATCH] fix: resolve merged PR build break (dup types, missing forwardRef wiring) --- frontend/src/components/EarthTwin.tsx | 43 ++++----------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/frontend/src/components/EarthTwin.tsx b/frontend/src/components/EarthTwin.tsx index bba3a7f..f363258 100644 --- a/frontend/src/components/EarthTwin.tsx +++ b/frontend/src/components/EarthTwin.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useRef, useState, useCallback, useImperativeHandle, forwardRef } from 'react'; -import { prefersReducedMotion } from './SatelliteSpotlight/GlowEffect'; import { useUIStore } from '@/store/uiStore'; import { MaterialIcon } from './MaterialIcon'; import { SpotlightManager } from './SatelliteSpotlight/SpotlightManager'; @@ -18,36 +17,6 @@ import { } from '../utils/bookmarkHelpers'; -interface CatalogObject { - id: number; - name: string; - catalog_number: string; - classification: 'PAYLOAD' | 'DEBRIS' | 'ROCKET_BODY' | 'UNKNOWN'; - epoch: string | null; - inclination: number | null; - eccentricity: number | null; - semimajor_axis: number | null; - raan: number | null; - arg_of_perigee: number | null; - mean_anomaly: number | null; - mean_motion: number | null; - period: number | null; - has_tle: boolean; - updated_at: string | null; -} - -interface CollisionRisk { - id: number; - object_a: { name: string; catalog_number: string } | null; - object_b: { name: string; catalog_number: string } | null; - probability: number; - miss_distance_m: number; - relative_velocity_kms: number; - risk_level: string; - tca: string; -} - - function keplerToLatLonAlt(obj: CatalogObject, timeOffsetSec: number = 0): { lat: number; lon: number; alt: number } | null { if (obj.semimajor_axis == null || obj.inclination == null || obj.raan == null || @@ -125,17 +94,17 @@ export const EarthTwin = forwardRef((_props, ref) => { const tooltipRef = useRef(null); const { activeSector, setSelectedSatelliteId } = useUIStore(); const [useFallback, setUseFallback] = useState(true); + const [hoveredObject, setHoveredObject] = useState(null); + const [tooltipPos, setTooltipPos] = useState({ x: 0, y: 0 }); + const [viewerInstance, setViewerInstance] = useState(null); + const [containerEl, setContainerEl] = useState(null); + const [datasetVersion, setDatasetVersion] = useState(0); // Set by flyToSatellite(), consumed by SpotlightManager to lock its // selection/info-card onto a satellite chosen from outside the globe // (e.g. the Satellite of the Day card's "View on Globe" button). The // nonce forces the effect to re-fire even if the same satellite is // requested twice in a row. const [focusRequest, setFocusRequest] = useState<{ catalogNumber: string; nonce: number } | null>(null); - const [hoveredObject, setHoveredObject] = useState(null); - const [tooltipPos, setTooltipPos] = useState({ x: 0, y: 0 }); - const [viewerInstance, setViewerInstance] = useState(null); - const [containerEl, setContainerEl] = useState(null); - const [datasetVersion, setDatasetVersion] = useState(0); const [showLegend, setShowLegend] = useState(true); const [showDensity, setShowDensity] = useState(false); const [showRiskOverlay, setShowRiskOverlay] = useState(false); @@ -356,7 +325,7 @@ export const EarthTwin = forwardRef((_props, ref) => { const pos = keplerToLatLonAlt(obj); if (pos) { const destination = Cesium.Cartesian3.fromDegrees(pos.lon, pos.lat, pos.alt * 1000 + 2000000); - viewer.camera.flyTo({ destination, duration: prefersReducedMotion() ? 0 : 1.5 }); + viewer.camera.flyTo({ destination, duration: 1.5 }); } // SpotlightManager owns actual selection state; this just tells it