event.preventDefault()}
+ >
+ {!visual.active && (
+
+ Joystick area
+ Touch and hold to use the joystick
+
+ )}
+ {visual.active && (
+ <>
+
+
+ >
+ )}
+
+ );
+}
diff --git a/webui/src/components/MobileControls/MobileAuxButton.jsx b/webui/src/components/MobileControls/MobileAuxButton.jsx
new file mode 100644
index 00000000..9ca6528b
--- /dev/null
+++ b/webui/src/components/MobileControls/MobileAuxButton.jsx
@@ -0,0 +1,20 @@
+// Hold-to-run aux motor button for mobile controls.
+export default function MobileAuxButton({ id, label, values, color, disabled, onPress, onRelease }) {
+ return (
+ event.preventDefault()}
- >
- {!visual.active && (
-
- Joystick area
- Touch and hold to use the joystick
-
- )}
- {visual.active && (
- <>
-
-
- >
- )}
-
- );
-}
+// Mobile controls layout and interaction wiring.
+import { useCallback, useEffect, useRef } from 'react';
+import { useControlSystem } from '../../controls/index.js';
+import { clampUnit } from '../../controls/controlMath.js';
+import DriveDockAction, { useDriveDockState } from '../DriveDockAction/index.jsx';
+import NightVisionControl from '../NightVisionControl.jsx';
+import HornControl from '../HornControl.jsx';
+import CameraTiltControl from '../CameraTiltControl.jsx';
+import FloatingJoystick from './FloatingJoystick.jsx';
+import MobileAuxButton from './MobileAuxButton.jsx';
+import {
+ SOURCE,
+ JOYSTICK_RADIUS,
+ JOYSTICK_SMOOTHING,
+ AUX_ZERO,
+ AUX_ALL_FORWARD,
+ AUX_ALL_BACKWARD,
+} from './constants.js';
function MobileJoystickPanel({ layout }) {
const {
@@ -140,9 +31,7 @@ function MobileJoystickPanel({ layout }) {
const smoothedVectorRef = useRef({ x: 0, y: 0, boost: false });
useEffect(() => {
- if (disabled) {
- smoothedVectorRef.current = { x: 0, y: 0, boost: false };
- }
+ if (disabled) smoothedVectorRef.current = { x: 0, y: 0, boost: false };
}, [disabled]);
const handleMove = useCallback(
@@ -198,32 +87,10 @@ function MobileJoystickPanel({ layout }) {
/>
) : null}
- {/* Panic stop button can be re-enabled here if needed */}
-
);
}
-function MobileAuxButton({ id, label, values, color, disabled, onPress, onRelease }) {
- return (
-