hore(review): tighten pre-merge audit cleanup
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
This commit is contained in:
@@ -6,8 +6,12 @@ import * as THREE from "three";
|
||||
import type { OrbitControls as OrbitControlsImpl } from "three-stdlib";
|
||||
import { EditorMap } from "@/components/editor/scene/EditorMap";
|
||||
import { FlyController } from "@/controls/editor/FlyController";
|
||||
import type { CinematicDefinition } from "@/types/cinematics/cinematics";
|
||||
import type { MapNode, TransformMode, SceneData } from "@/types/editor/editor";
|
||||
import type {
|
||||
EditorCinematicPreviewRequest,
|
||||
MapNode,
|
||||
TransformMode,
|
||||
SceneData,
|
||||
} from "@/types/editor/editor";
|
||||
|
||||
const EDITOR_CAMERA_HOME_POSITION = new THREE.Vector3(0, 50, 100);
|
||||
const EDITOR_CAMERA_HOME_TARGET = new THREE.Vector3(0, 0, 0);
|
||||
@@ -23,11 +27,6 @@ function isEditableShortcutTarget(target: EventTarget | null): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
export interface EditorCinematicPreviewRequest {
|
||||
id: string;
|
||||
cinematic: CinematicDefinition;
|
||||
}
|
||||
|
||||
interface EditorSceneProps {
|
||||
sceneData: SceneData;
|
||||
selectedNodeIndex: number | null;
|
||||
|
||||
@@ -3,6 +3,7 @@ import { useGLTF } from "@react-three/drei";
|
||||
import { Component, useEffect, useMemo, useRef, type ReactNode } from "react";
|
||||
import * as THREE from "three";
|
||||
import { useLoggedGLTF } from "@/hooks/three/useLoggedGLTF";
|
||||
import { logger } from "@/utils/core/Logger";
|
||||
|
||||
interface SkyModelProps {
|
||||
fallbackModelScale?: number | undefined;
|
||||
@@ -20,6 +21,8 @@ interface SkyModelContentProps {
|
||||
interface SkyModelErrorBoundaryProps {
|
||||
children: ReactNode;
|
||||
fallback: ReactNode;
|
||||
label: string;
|
||||
modelPath: string;
|
||||
}
|
||||
|
||||
interface SkyModelErrorBoundaryState {
|
||||
@@ -43,6 +46,17 @@ class SkyModelErrorBoundary extends Component<
|
||||
return { hasError: true };
|
||||
}
|
||||
|
||||
componentDidCatch(error: Error): void {
|
||||
logger.warn(
|
||||
"SkyModel",
|
||||
`${this.props.label} model failed; using fallback`,
|
||||
{
|
||||
error,
|
||||
modelPath: this.props.modelPath,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
render(): ReactNode {
|
||||
if (this.state.hasError) {
|
||||
return this.props.fallback;
|
||||
@@ -63,7 +77,12 @@ export function SkyModel({
|
||||
<color attach="background" args={[fallbackColor]} />
|
||||
) : null;
|
||||
const fallback = fallbackModelPath ? (
|
||||
<SkyModelErrorBoundary key={fallbackModelPath} fallback={colorFallback}>
|
||||
<SkyModelErrorBoundary
|
||||
key={fallbackModelPath}
|
||||
fallback={colorFallback}
|
||||
label="Fallback sky"
|
||||
modelPath={fallbackModelPath}
|
||||
>
|
||||
<SkyModelContent
|
||||
modelPath={fallbackModelPath}
|
||||
scale={fallbackModelScale}
|
||||
@@ -74,7 +93,12 @@ export function SkyModel({
|
||||
);
|
||||
|
||||
return (
|
||||
<SkyModelErrorBoundary key={modelPath} fallback={fallback}>
|
||||
<SkyModelErrorBoundary
|
||||
key={modelPath}
|
||||
fallback={fallback}
|
||||
label="Primary sky"
|
||||
modelPath={modelPath}
|
||||
>
|
||||
<SkyModelContent modelPath={modelPath} scale={scale} />
|
||||
</SkyModelErrorBoundary>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user