Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(office): a camera drag that starts on a floating label turns instead of sliding

rubenluetke10-beep84e105752c06
diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeCameraRig.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeCameraRig.tsx
index 151644fa46..9f38863026 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeCameraRig.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeCameraRig.tsx
@@ -151,9 +151,12 @@ export function OfficeCameraRig({ layout, overview }: { layout: OfficeLayout; ov
// turns Shift+left into a pan, which slid the view off a running character
// while the follow kept dragging it back. Flipping the left button to "pan"
// for that press makes the controls' own Shift inversion land on "rotate".
- // (Capture phase: this runs before the controls read the button.)
+ // (Capture phase: this runs before the controls read the button.) It listens
+ // where the controls listen, not on the canvas: a press that started on a
+ // floating label skipped it and kept the last Shift press's "pan", so a
+ // plain drag slid the view while the follow dragged it back.
useEffect(() => {
- const el = gl.domElement;
+ const el = connected ?? gl.domElement;
const down = (event: PointerEvent) => {
const c = controls.current;
const sprintDrag = event.shiftKey && !event.ctrlKey && !event.metaKey;
@@ -162,7 +165,7 @@ export function OfficeCameraRig({ layout, overview }: { layout: OfficeLayout; ov
};
el.addEventListener("pointerdown", down, true);
return () => el.removeEventListener("pointerdown", down, true);
- }, [gl]);
+ }, [connected, gl]);
// A drag turns the camera and nothing else. R3F still delivers a click when
// the press ends on the object it started on, so a small turn over the