diff --git a/app/g2/dashboard-controller.ts b/app/g2/dashboard-controller.ts index 5ba35a8b..4bd52ef1 100644 --- a/app/g2/dashboard-controller.ts +++ b/app/g2/dashboard-controller.ts @@ -58,7 +58,7 @@ import { type InProcessAppOptions, type InProcessWindow } from "../ui/shell/in-p import { loadPersistedOpenApps, savePersistedOpenApps } from "../ui/shell/open-apps-persistence"; import { appViewportRect, SIDEBAR_WIDTH, sidebarStripVisible, type WindowHeightMode } from "../ui/shell/geometry"; import { type LayerActions } from "../ui/layers"; -import { assistantAllowProactiveSetting, assistantBackendSetting, assistantBridgeHostSetting, assistantBridgePortSetting, assistantBridgeTokenSetting, brightnessSetting, brightnessSettingToLevel, displayModeSetting, elevenLabsApiKeySetting, getStringSettingById, openAiApiKeySetting, nightscoutApiTokenSetting, firmwareDebugFlagsSetting, lockScreenEnabledSetting, nightscoutSiteUrlSetting, onAnySettingChanged, previewColorSetting, saveVoiceRecordingsSetting, sonioxApiKeySetting, screenTimeoutSetting, screenTimeoutSettingToMs, suspendEvenHubWhenScreenOffSetting, verticalPositionSetting, voiceProviderSetting, wakeWordActionSetting, type ConfigSettingString } from "../ui/dashboard-settings"; +import { assistantAllowProactiveSetting, assistantBackendSetting, assistantBridgeHostSetting, assistantBridgePortSetting, assistantBridgeTokenSetting, brightnessSetting, brightnessSettingToLevel, displayModeSetting, elevenLabsApiKeySetting, getStringSettingById, openAiApiKeySetting, nightscoutApiTokenSetting, firmwareDebugFlagsSetting, lockScreenEnabledSetting, nightscoutSiteUrlSetting, onAnySettingChanged, previewColorSetting, ringConnectionModeSetting, saveVoiceRecordingsSetting, sonioxApiKeySetting, screenTimeoutSetting, screenTimeoutSettingToMs, suspendEvenHubWhenScreenOffSetting, verticalPositionSetting, voiceProviderSetting, wakeWordActionSetting, type ConfigSettingString } from "../ui/dashboard-settings"; import { isIgnoringBatteryOptimizations, requestIgnoreBatteryOptimizations } from "../native/battery-optimization"; import { getInstalledEvenHubAppById, @@ -981,8 +981,13 @@ class DashboardController { this.refreshEvenAppStatus(); this.setPhase("connecting"); this.setStatus("Connecting to the glasses..."); + // "Only via glasses" (the default) means the phone never opens its own + // link to the ring: the glasses relay its gestures to us anyway, and the + // direct link is currently unreliable. An empty address disables every + // direct-ring code path in the communicator. + const ringAddress = ringConnectionModeSetting.get() === "direct" ? addresses.ring : ""; this.appendLog( - `Using configured arms: R=${addresses.right} L=${addresses.left}${addresses.ring ? ` ring=${addresses.ring}` : ""}`, + `Using configured arms: R=${addresses.right} L=${addresses.left}${ringAddress ? ` ring=${ringAddress}` : ""}`, ); let communicator: FaceclawCommunicatorBridge | null = null; @@ -999,7 +1004,7 @@ class DashboardController { communicator = new FaceclawCommunicatorBridge({ right: addresses.right, left: addresses.left, - ring: addresses.ring, + ring: ringAddress, }); this.communicator = communicator; this.offLog = communicator.onLog((line) => { diff --git a/app/ui/dashboard-settings.ts b/app/ui/dashboard-settings.ts index 6a723296..d2ae86d4 100644 --- a/app/ui/dashboard-settings.ts +++ b/app/ui/dashboard-settings.ts @@ -390,6 +390,19 @@ export const suspendEvenHubWhenScreenOffSetting = new ConfigSettingBoolean({ description: "Suspend the EvenHub session while the display is off. This significantly improves battery life, but increases the latency of waking the screen.", }); +export type RingConnectionMode = "glasses" | "direct"; + +export const ringConnectionModeSetting = new ConfigSettingEnum({ + id: "ring-connection-mode", + label: "Ring connection", + storageKey: "developer.ringConnectionMode", + defaultValue: "glasses", + values: ["glasses", "direct"], + formatValue: (value) => (value === "direct" ? "Direct" : "Only via glasses"), + description: + "How R1 ring input reaches the phone. Only via glasses: the ring's own link to the glasses carries its gestures, and the phone never opens a Bluetooth connection to the ring. Direct: also connect to the ring from the phone (currently unreliable). Takes effect on the next connection to the glasses.", +}); + export type VoiceProvider = "onboard" | "elevenlabs" | "whisper" | "soniox"; const voiceProviderLabels: Record = { diff --git a/app/ui/dashboard/settings-menus.ts b/app/ui/dashboard/settings-menus.ts index 45464c61..a66cf2cf 100644 --- a/app/ui/dashboard/settings-menus.ts +++ b/app/ui/dashboard/settings-menus.ts @@ -41,6 +41,7 @@ import { mirrorTouchSetting, openAiApiKeySetting, previewColorSetting, + ringConnectionModeSetting, roamApiTokenSetting, roamGraphNameSetting, sonioxApiKeySetting, @@ -176,6 +177,9 @@ function settingsSections(): SettingsSection[] { { label: "Developer", items: [ + // Whether the phone opens its own BLE link to the R1 ring; the + // glasses relay ring gestures either way. Applied at connect time. + enumSettingMenuItem(ringConnectionModeSetting), toggleSettingMenuItem(saveVoiceRecordingsSetting), toggleSettingMenuItem(firmwareDebugFlagsSetting), toggleSettingMenuItem(suspendEvenHubWhenScreenOffSetting),