From 375a1ba0c3f10811951768c984fc6c6e31003706 Mon Sep 17 00:00:00 2001 From: Poovizhi99 Date: Mon, 13 Oct 2025 16:26:36 +0530 Subject: [PATCH] updated loading page in new window --- .../layout/scenes/ComparisonScene.tsx | 6 ------ app/src/components/templates/LoadingPage.tsx | 6 +++++- .../components/ui/compareVersion/Button.tsx | 1 - .../ui/compareVersion/ComparisonResult.tsx | 19 ------------------- .../ui/compareVersion/NewWindowScene.tsx | 4 ++-- app/src/modules/builder/builder.tsx | 9 ++++++--- app/src/modules/scene/scene.tsx | 2 +- app/src/styles/layout/_loading.scss | 4 ++-- package-lock.json | 6 ++++++ 9 files changed, 22 insertions(+), 35 deletions(-) create mode 100644 package-lock.json diff --git a/app/src/components/layout/scenes/ComparisonScene.tsx b/app/src/components/layout/scenes/ComparisonScene.tsx index ac0c4db..8a476fe 100644 --- a/app/src/components/layout/scenes/ComparisonScene.tsx +++ b/app/src/components/layout/scenes/ComparisonScene.tsx @@ -39,12 +39,6 @@ export interface CompareProduct { simulationTime?: number; simulationCost?: number; efficiencyScore?: number; - // totalCost: number; - // revenueGenerated: number; - // costPerUnit: number; - //workingDaysPerYear: number; - //shiftLength: number; - //shiftsPerDay: number; }; } export const createCompareProduct = ( diff --git a/app/src/components/templates/LoadingPage.tsx b/app/src/components/templates/LoadingPage.tsx index ca34a89..4912a52 100644 --- a/app/src/components/templates/LoadingPage.tsx +++ b/app/src/components/templates/LoadingPage.tsx @@ -27,7 +27,11 @@ const LoadingPage: React.FC = ({ const content = (
diff --git a/app/src/components/ui/compareVersion/Button.tsx b/app/src/components/ui/compareVersion/Button.tsx index 5a09448..7729adf 100644 --- a/app/src/components/ui/compareVersion/Button.tsx +++ b/app/src/components/ui/compareVersion/Button.tsx @@ -30,7 +30,6 @@ const Button = () => { }; const handleOpenInNewWindow = () => { - // setLoadingProgress(0); setCreateNewWindow(true); }; diff --git a/app/src/components/ui/compareVersion/ComparisonResult.tsx b/app/src/components/ui/compareVersion/ComparisonResult.tsx index b2b86a1..5fd585a 100644 --- a/app/src/components/ui/compareVersion/ComparisonResult.tsx +++ b/app/src/components/ui/compareVersion/ComparisonResult.tsx @@ -142,25 +142,6 @@ const ComparisonResult = () => { (compareProductsData[1]?.simulationData?.machineIdleTime ?? 0))) * 100; - const product1IdlePercentage = - ((comparedProducts[0]?.simulationData?.machineIdleTime ?? 0) / - ((compareProductsData[0]?.simulationData?.machineActiveTime ?? 0) + - (compareProductsData[0]?.simulationData?.machineIdleTime ?? 0))) * - 100; - console.log( - "product1IdlePercentage: ", - compareProductsData[0]?.simulationData?.machineIdleTime - ); - const product2IdlePercentage = - ((comparedProducts[1]?.simulationData?.machineIdleTime ?? 0) / - ((compareProductsData[1]?.simulationData?.machineActiveTime ?? 0) + - (compareProductsData[1]?.simulationData?.machineIdleTime ?? 0))) * - 100; - console.log( - "product2IdlePercentage: ", - compareProductsData[1]?.simulationData?.machineIdleTime - ); - return (
Performance Comparison
diff --git a/app/src/components/ui/compareVersion/NewWindowScene.tsx b/app/src/components/ui/compareVersion/NewWindowScene.tsx index d2522da..a889c39 100644 --- a/app/src/components/ui/compareVersion/NewWindowScene.tsx +++ b/app/src/components/ui/compareVersion/NewWindowScene.tsx @@ -24,13 +24,13 @@ const NewWindowScene = () => { > {/* Wait a tick to access child window */} - { + {loadingProgress > 0 && ( - } + )}
(null); const { toggleView } = useToggleView(); - const { toolMode, setToolMode } = useToolMode(); + const { setToolMode } = useToolMode(); const { setRoofVisibility } = useRoofVisibility(); const { setWallVisibility } = useWallVisibility(); const { setShadows } = useShadows(); const { setRenderDistance } = useRenderDistance(); - const { limitDistance, setLimitDistance } = useLimitDistance(); + const { setLimitDistance } = useLimitDistance(); const { projectId } = useParams(); const { scene: storeScene, camera: storeCamera, controls: storeControls } = useSceneContext(); const { setHoveredPoint, setHoveredLine } = useBuilderStore(); @@ -58,6 +58,7 @@ export default function Builder() { storeScene.current = scene; storeCamera.current = camera; storeControls.current = controls as CameraControls; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [scene, camera, controls]); useEffect(() => { @@ -67,6 +68,7 @@ export default function Builder() { gl.domElement.style.cursor = "default"; setToolMode("cursor"); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [toggleView, gl]); useEffect(() => { @@ -80,7 +82,8 @@ export default function Builder() { setRenderDistance(data.renderDistance); setLimitDistance(data.limitDistance); }); - }, [projectId, toolMode]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [projectId]); useFrame(() => { if (csgRef.current) { diff --git a/app/src/modules/scene/scene.tsx b/app/src/modules/scene/scene.tsx index c4939be..c2c8f28 100644 --- a/app/src/modules/scene/scene.tsx +++ b/app/src/modules/scene/scene.tsx @@ -1,5 +1,5 @@ import { useEffect, useMemo } from "react"; -import { Canvas, useThree } from "@react-three/fiber"; +import { Canvas } from "@react-three/fiber"; import { KeyboardControls } from "@react-three/drei"; import { useSceneContext } from "./sceneContext"; diff --git a/app/src/styles/layout/_loading.scss b/app/src/styles/layout/_loading.scss index c26cffd..424f4a5 100644 --- a/app/src/styles/layout/_loading.scss +++ b/app/src/styles/layout/_loading.scss @@ -19,8 +19,8 @@ position: fixed; top: 0; right: 0; - height: 10px; - width: 10px; + height: 100vh; + width: 100vw; } .loading-container { diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..fd879bc --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "Dwinzo_Demo", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}