From 4e2ff6bd019ee3a48fc2b460c0ab1aae4a07421e Mon Sep 17 00:00:00 2001 From: Vishnu Date: Sat, 10 May 2025 19:36:36 +0530 Subject: [PATCH] Refactor logging in simulation handlers to use echo for improved status reporting; update Project component to reflect successful login with success message; enhance sidebar styles with text transformation. --- .../ui/simulation/simulationPlayer.tsx | 17 +++++++++++------ .../conveyor/actionHandler/useDefaultHandler.ts | 2 +- .../conveyor/actionHandler/useDelayHandler.ts | 2 +- .../conveyor/actionHandler/useDespawnHandler.ts | 2 +- .../conveyor/actionHandler/useSpawnHandler.ts | 2 +- .../conveyor/actionHandler/useSwapHandler.ts | 2 +- .../machine/actionHandler/useProcessHandler.ts | 2 +- .../actionHandler/usePickAndPlaceHandler.ts | 4 ++-- .../actionHandler/useRetrieveHandler.ts | 15 ++++++++------- .../actionHandler/useStoreHandler.ts | 2 +- .../vehicle/actionHandler/useTravelHandler.ts | 4 ++-- app/src/pages/Project.tsx | 2 +- app/src/styles/layout/sidebar.scss | 1 + 13 files changed, 32 insertions(+), 25 deletions(-) diff --git a/app/src/components/ui/simulation/simulationPlayer.tsx b/app/src/components/ui/simulation/simulationPlayer.tsx index 6ef8d2f..a2e05f9 100644 --- a/app/src/components/ui/simulation/simulationPlayer.tsx +++ b/app/src/components/ui/simulation/simulationPlayer.tsx @@ -42,19 +42,21 @@ const SimulationPlayer: React.FC = () => { if (isReset) { setTimeout(() => { setReset(false); - }, 0) + }, 0); } - }, [isReset, setReset]) + }, [isReset, setReset]); // Button functions const handleReset = () => { setReset(true); setIsPaused(false); setSpeed(1); + echo.info("Simulation RESET....."); setPlaySimulation(false); // local state reset }; const handlePlayStop = () => { setIsPaused(!isPaused); + echo.warn(`Simulation is ${isPaused ? "Resumed" : "Paused"}`); setPlaySimulation(!playSimulation); }; const handleExit = () => { @@ -62,6 +64,7 @@ const SimulationPlayer: React.FC = () => { setIsPlaying(false); setIsPaused(false); setActiveTool("cursor"); + echo.info("Exit Simulation"); }; // Slider functions starts @@ -282,10 +285,11 @@ const SimulationPlayer: React.FC = () => { {index < intervals.length - 1 && (
= ((index + 1) / totalSegments) * 100 + className={`line ${ + progress >= ((index + 1) / totalSegments) * 100 ? "filled" : "" - }`} + }`} >
)} @@ -324,8 +328,9 @@ const SimulationPlayer: React.FC = () => {