Skip to content

Commit 413f694

Browse files
committed
fix(dashboard): polish request observability
1 parent ef17098 commit 413f694

6 files changed

Lines changed: 923 additions & 388 deletions

File tree

src/components/dashboard/geo-points-map-island.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ interface GeoPointsMapIslandProps {
2626
selectedCountryCode?: string | null;
2727
onCountrySelect?: (countryCode: string | null) => void;
2828
collapseOverlappingPointColors?: boolean;
29+
pointCrossfadeEnabled?: boolean;
2930
}
3031

3132
const DEFAULT_MAP_HEIGHT_CLASS = "h-[460px]";

src/components/dashboard/geo-points-map.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ interface GeoPointsMapProps {
5050
selectedCountryCode?: string | null;
5151
onCountrySelect?: (countryCode: string | null) => void;
5252
collapseOverlappingPointColors?: boolean;
53+
pointCrossfadeEnabled?: boolean;
5354
}
5455

5556
interface ClusteredGeoPoint {
@@ -515,6 +516,7 @@ export function GeoPointsMap({
515516
selectedCountryCode,
516517
onCountrySelect,
517518
collapseOverlappingPointColors = false,
519+
pointCrossfadeEnabled = true,
518520
}: GeoPointsMapProps) {
519521
const { resolvedTheme } = useTheme();
520522
const isMobile = useIsMobile();
@@ -649,6 +651,15 @@ export function GeoPointsMap({
649651
const mapRef = useRef<MapRef | null>(null);
650652

651653
useEffect(() => {
654+
if (!pointCrossfadeEnabled) {
655+
hasClusterCrossfadeInitialized.current = true;
656+
incomingClustersRef.current = clusteredPoints;
657+
setIncomingClusters(clusteredPoints);
658+
setOutgoingClusters([]);
659+
setClusterFadeProgress(1);
660+
return;
661+
}
662+
652663
if (!hasClusterCrossfadeInitialized.current) {
653664
hasClusterCrossfadeInitialized.current = true;
654665
incomingClustersRef.current = clusteredPoints;
@@ -679,7 +690,7 @@ export function GeoPointsMap({
679690
return () => {
680691
controls.stop();
681692
};
682-
}, [clusteredPoints]);
693+
}, [clusteredPoints, pointCrossfadeEnabled]);
683694

684695
const incomingAlpha = Math.round(
685696
MAP_POINT_ALPHA_VISIBLE * clusterFadeProgress,

0 commit comments

Comments
 (0)