diff --git a/gui/public/i18n/en/translation.ftl b/gui/public/i18n/en/translation.ftl
index e91247bac8..f05f0d6afd 100644
--- a/gui/public/i18n/en/translation.ftl
+++ b/gui/public/i18n/en/translation.ftl
@@ -584,6 +584,8 @@ settings-general-tracker_mechanics-trackers_over_usb = Trackers over USB
settings-general-tracker_mechanics-trackers_over_usb-description =
Enables receiving HID tracker data over USB. Make sure connected trackers have connection over HID enabled!
settings-general-tracker_mechanics-trackers_over_usb-enabled-label = Allow HID trackers to connect directly over USB
+settings-general-tracker_mechanics-timeout_duration = Timeout duration
+settings-general-tracker_mechanics-timeout_duration-description = How long until a tracker is marked as 'disconnected' when the connection is lost.
settings-stay_aligned = Stay Aligned
settings-stay_aligned-description = Stay Aligned reduces drift by gradually adjusting your trackers to match your relaxed poses.
diff --git a/gui/src/components/commons/Input.tsx b/gui/src/components/commons/Input.tsx
index ba93fc99b3..8f83084a65 100644
--- a/gui/src/components/commons/Input.tsx
+++ b/gui/src/components/commons/Input.tsx
@@ -37,6 +37,7 @@ export const InputInside = forwardRef<
value,
error,
variant = 'primary',
+ ...props
},
ref
) {
@@ -100,6 +101,7 @@ export const InputInside = forwardRef<
value={computedValue} // Do we want that behaviour ?
disabled={disabled}
ref={ref}
+ {...props}
/>
{type === 'password' && (
({
disabled,
variant = 'primary',
rules,
+ ...props
}: {
rules?: UseControllerProps
>['rules'];
control: Control;
@@ -157,6 +160,7 @@ export const Input = ({
onChange={onChange}
ref={ref}
name={name}
+ {...props}
/>
)}
/>
diff --git a/gui/src/components/settings/pages/GeneralSettings.tsx b/gui/src/components/settings/pages/GeneralSettings.tsx
index d9907ce0f2..3e034ce6e6 100644
--- a/gui/src/components/settings/pages/GeneralSettings.tsx
+++ b/gui/src/components/settings/pages/GeneralSettings.tsx
@@ -15,10 +15,12 @@ import {
SteamVRTrackersSettingT,
TapDetectionSettingsT,
HIDSettingsT,
+ TimeoutSettingsT,
} from 'solarxr-protocol';
import { useConfig } from '@/hooks/config';
import { useWebsocketAPI } from '@/hooks/websocket-api';
import { useLocaleConfig } from '@/i18n/config';
+import { Input } from '@/components/commons/Input';
import { CheckBox } from '@/components/commons/Checkbox';
import { SteamIcon } from '@/components/commons/icon/SteamIcon';
import { WrenchIcon } from '@/components/commons/icon/WrenchIcons';
@@ -108,6 +110,9 @@ export type SettingsForm = {
hidSettings: {
trackersOverHID: boolean;
};
+ timeout: {
+ duration: number;
+ };
};
const defaultValues: SettingsForm = {
@@ -164,6 +169,7 @@ const defaultValues: SettingsForm = {
resetsSettings: defaultResetSettings,
stayAligned: defaultStayAlignedSettings,
hidSettings: { trackersOverHID: false },
+ timeout: { duration: 3.0 },
};
const settingsAtom = atom(new SettingsResponseT());
@@ -301,6 +307,10 @@ export function GeneralSettings() {
hidSettings.trackersOverHid = values.hidSettings.trackersOverHID;
settings.hidSettings = hidSettings;
+ const timeout = new TimeoutSettingsT();
+ timeout.duration = values.timeout.duration;
+ settings.timeout = timeout;
+
if (values.resetsSettings) {
settings.resetsSettings = loadResetSettings(values.resetsSettings);
}
@@ -419,6 +429,12 @@ export function GeneralSettings() {
};
}
+ if (settings.timeout) {
+ formData.timeout = {
+ duration: settings.timeout.duration,
+ };
+ }
+
reset({ ...getValues(), ...formData });
}, [settings]);
@@ -455,7 +471,10 @@ export function GeneralSettings() {
setHandsWarning(false);
}}
/>
-