From 182e8c7d1a982e5b504e03c9e5f2dc695fedaf69 Mon Sep 17 00:00:00 2001
From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com>
Date: Wed, 17 Dec 2025 23:16:41 -0800
Subject: [PATCH] feat: restore WASD nav, improved plant geometry visibility
---
frontend/src/pages/Facility3DViewerPage.tsx | 27 +++++++++++++++++----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/frontend/src/pages/Facility3DViewerPage.tsx b/frontend/src/pages/Facility3DViewerPage.tsx
index 1f42ab6..f09050e 100644
--- a/frontend/src/pages/Facility3DViewerPage.tsx
+++ b/frontend/src/pages/Facility3DViewerPage.tsx
@@ -114,8 +114,9 @@ function PlantInstances({ positions, onPlantClick, visMode }: {
}
}}
>
-
-
+ {/* Bushy Top */}
+
+
{plants.map((pos, i) => {
let color = COLORS.VEG;
@@ -138,11 +139,13 @@ function PlantInstances({ positions, onPlantClick, visMode }: {
break;
}
+ // Lift plant slightly to sit ON shelf, not IN it
return (
);
})}
@@ -189,6 +192,19 @@ function FacilityScene({ data, onSelectPlant, targetView, setControls, visMode }
}
}, [targetView]);
+ // RESTORED: Keyboard Event Listeners for WASD
+ useEffect(() => {
+ const handleDown = (e: KeyboardEvent) => setKeysPressed(k => ({ ...k, [e.code]: true }));
+ const handleUp = (e: KeyboardEvent) => setKeysPressed(k => ({ ...k, [e.code]: false }));
+
+ window.addEventListener('keydown', handleDown);
+ window.addEventListener('keyup', handleUp);
+ return () => {
+ window.removeEventListener('keydown', handleDown);
+ window.removeEventListener('keyup', handleUp);
+ };
+ }, []);
+
useFrame((_, delta) => {
if (!controlsRef.current) return;
const speed = 20 * delta;
@@ -310,8 +326,9 @@ function FacilityScene({ data, onSelectPlant, targetView, setControls, visMode }
castShadow
receiveShadow
>
+ {/* Shelf - Lighter for visibility */}
-
+
))}
@@ -365,7 +382,7 @@ function FacilityScene({ data, onSelectPlant, targetView, setControls, visMode }
return (
<>
-
+ {/* Increased brightness */}