forked from Blendman974/faceclaw
Merge branch 'main' into rayneo-io-support
This commit is contained in:
commit
739e81c8a6
47 files changed
+3967
-90
No files matched your search
@@ -307,7 +307,7 @@ export const glassesBatteryVisibilitySetting = batteryVisibilitySetting(
|
||||
export const ringBatteryVisibilitySetting = batteryVisibilitySetting(
|
||||
"ringBatteryVisibility", "R1", "display.battery.ringVisibility",
|
||||
);
|
||||
/** The Wear OS watch; the indicator only exists while a watch is reachable. */
|
||||
/** The watch; the indicator only exists while a watch is reachable. */
|
||||
export const watchBatteryVisibilitySetting = batteryVisibilitySetting(
|
||||
"watchBatteryVisibility", "Watch", "display.battery.watchVisibility",
|
||||
);
|
||||
@@ -702,7 +702,7 @@ export const mirrorTouchSetting = new ConfigSettingBoolean({
|
||||
"Let touches on the phone's mirror act on the glasses UI: tap selects what it lands on, double-tap goes back, a hold opens the menu, swipes navigate.",
|
||||
});
|
||||
|
||||
// Wear OS watch remote (app/g2/wear-remote.ts, wear/). All three are read on
|
||||
// Watch remote (app/g2/wear-remote.ts, wear/, apple-watch/). All three are read on
|
||||
// every watch message, so a change applies immediately.
|
||||
export const watchRemoteEnabledSetting = new ConfigSettingBoolean({
|
||||
id: "watch-remote-enabled",
|
||||
@@ -710,7 +710,7 @@ export const watchRemoteEnabledSetting = new ConfigSettingBoolean({
|
||||
storageKey: "watch.remoteEnabled",
|
||||
defaultValue: true,
|
||||
description:
|
||||
"Accept input from the Faceclaw Wear OS app: spatial swipes, taps, holds, crown, voice queries and app commands. The ring's scheme is unaffected. Turn off to ignore the watch.",
|
||||
"Accept input from the Faceclaw watch app: spatial swipes, taps, holds, crown, voice queries and app commands. The ring's scheme is unaffected. Turn off to ignore the watch.",
|
||||
});
|
||||
|
||||
export const watchCanUnlockSetting = new ConfigSettingBoolean({
|
||||
@@ -722,6 +722,7 @@ export const watchCanUnlockSetting = new ConfigSettingBoolean({
|
||||
"Let the watch unlock the glasses' lock screen (which otherwise waits for the phone to be unlocked). Your watch is on your wrist; turn this off if you would rather it stay a phone-only unlock.",
|
||||
});
|
||||
|
||||
// Wear OS only: the Apple Watch's crown doesn't reach the app, so iOS doesn't offer this.
|
||||
export const watchCrownClockwiseNextSetting = new ConfigSettingBoolean({
|
||||
id: "watch-crown-clockwise-next",
|
||||
label: "Clockwise crown = next",
|
||||
@@ -731,6 +732,26 @@ export const watchCrownClockwiseNextSetting = new ConfigSettingBoolean({
|
||||
"Choose which crown direction moves to the next item. Off: clockwise moves to the previous item. On: clockwise moves to the next item.",
|
||||
});
|
||||
|
||||
// Apple Watch only: Wear OS has no sounds, and keeps its vibration setting on the watch.
|
||||
// The watch reads these from the mirrored state (apple-watch/Faceclaw/WatchPrefs.swift).
|
||||
export const watchVibrateOnInputSetting = new ConfigSettingBoolean({
|
||||
id: "watch-vibrate-on-input",
|
||||
label: "Vibrate on input",
|
||||
storageKey: "watch.vibrateOnInput",
|
||||
defaultValue: true,
|
||||
description:
|
||||
"Adds a slight vibration with each watch input",
|
||||
});
|
||||
|
||||
export const watchSoundEffectsSetting = new ConfigSettingBoolean({
|
||||
id: "watch-sound-effects",
|
||||
label: "Sound effects",
|
||||
storageKey: "watch.soundEffects",
|
||||
defaultValue: false,
|
||||
description:
|
||||
"On: each input gets its own watchOS feedback, a sound with a vibration (watchOS can't play one alone, so this vibrates even with Vibrate on input off). Off: a light tap for every input. Only Silent Mode on the watch guarantees no sound.",
|
||||
});
|
||||
|
||||
export const watchMirrorAssistantSetting = new ConfigSettingBoolean({
|
||||
id: "watch-mirror-assistant",
|
||||
label: "Mirror assistant to watch",
|
||||
|
||||
@@ -95,6 +95,8 @@ import {
|
||||
watchCrownClockwiseNextSetting,
|
||||
watchMirrorAssistantSetting,
|
||||
watchRemoteEnabledSetting,
|
||||
watchSoundEffectsSetting,
|
||||
watchVibrateOnInputSetting,
|
||||
} from "../dashboard-settings";
|
||||
import { wearBridge } from "../../native/wear-bridge";
|
||||
import { openSettingsSubMenu, SettingsPanelLayer, type SettingsSection } from "./settings-panel";
|
||||
@@ -210,11 +212,16 @@ function settingsSections(): SettingsSection[] {
|
||||
},
|
||||
{
|
||||
label: "Watch",
|
||||
// Wear OS remote (wear/); the status line above the items says whether
|
||||
// a watch running the companion app is currently reachable.
|
||||
// Watch remote (wear/, apple-watch/); the status line above the items says
|
||||
// whether a watch running the companion app is currently reachable.
|
||||
items: [
|
||||
toggleSettingMenuItem(watchRemoteEnabledSetting),
|
||||
toggleSettingMenuItem(watchCrownClockwiseNextSetting),
|
||||
...(global.isIOS ? [
|
||||
toggleSettingMenuItem(watchVibrateOnInputSetting),
|
||||
toggleSettingMenuItem(watchSoundEffectsSetting),
|
||||
] : [
|
||||
toggleSettingMenuItem(watchCrownClockwiseNextSetting),
|
||||
]),
|
||||
toggleSettingMenuItem(watchCanUnlockSetting),
|
||||
toggleSettingMenuItem(watchMirrorAssistantSetting),
|
||||
],
|
||||
@@ -273,17 +280,12 @@ function settingsSections(): SettingsSection[] {
|
||||
},
|
||||
];
|
||||
if (!global.isIOS) return sections;
|
||||
const deferred = new Set(["Watch"]);
|
||||
return sections.map(section => {
|
||||
if (section.label === "Developer") return { ...section, items: [enumSettingMenuItem(ringConnectionModeSetting),
|
||||
toggleSettingMenuItem(showBleBandwidthSetting)] };
|
||||
// No downloadable on-device models: iOS's on-device option is Apple's recognizer.
|
||||
if (section.label === "Voice") return { label: "Voice", items: [enumSettingMenuItem(wakeWordActionSetting),
|
||||
enumSettingMenuItem(voiceProviderSetting), toggleSettingMenuItem(saveTranscribeAudioSetting), ...whisperServerMenuItems()] };
|
||||
if (deferred.has(section.label)) return { label: section.label, items: [{
|
||||
label: "Not available on iOS yet", disabled: true, onSelect: () => {},
|
||||
description: `${section.label} integration has not been ported to iOS.`,
|
||||
}] };
|
||||
if (section.label === "Display") return { ...section, items: section.items.filter(item =>
|
||||
item.label !== screenTimeoutSetting.label) };
|
||||
return section;
|
||||
@@ -361,7 +363,7 @@ function batteryIndicatorsMenuItem(): MenuItem {
|
||||
return {
|
||||
label: "Battery indicators",
|
||||
description:
|
||||
"Top-bar battery indicators for the phone, Wear OS watch, glasses, and ring: their style, and whether each shows always, only when low, or never.",
|
||||
"Top-bar battery indicators for the phone, watch, glasses, and ring: their style, and whether each shows always, only when low, or never.",
|
||||
onSelect: (ctx) => {
|
||||
openSettingsSubMenu(ctx, "Battery indicators", [
|
||||
enumSettingMenuItem(batteryDisplayModeSetting),
|
||||
@@ -622,12 +624,21 @@ function renderWatchStatus(args: { image: GrayImage; x: number; y: number; width
|
||||
const font = getDefaultSmallFont();
|
||||
let status: string;
|
||||
if (!wearBridge.isAvailable()) {
|
||||
status = "Google Play services is unavailable on this phone, so no watch can connect.";
|
||||
status = global.isIOS
|
||||
? "This device can't pair with an Apple Watch."
|
||||
: "Google Play services is unavailable on this phone, so no watch can connect.";
|
||||
} else {
|
||||
const connection = wearBridge.getWatchConnection();
|
||||
status = connection.reachable
|
||||
? `Connected to ${connection.watchName || "a watch"}.`
|
||||
: "No watch connected. Install the Faceclaw watch app (wear/ in the source tree) on a Wear OS watch paired with this phone.";
|
||||
if (global.isIOS) {
|
||||
// iOS only says whether the app is installed; it may not be running.
|
||||
status = connection.reachable
|
||||
? "The Faceclaw app is installed on your Apple Watch."
|
||||
: "No watch connected. Install the Faceclaw watch app (apple-watch/ in the source tree) on an Apple Watch paired with this iPhone.";
|
||||
} else {
|
||||
status = connection.reachable
|
||||
? `Connected to ${connection.watchName || "a watch"}.`
|
||||
: "No watch connected. Install the Faceclaw watch app (wear/ in the source tree) on a Wear OS watch paired with this phone.";
|
||||
}
|
||||
}
|
||||
const lines = wrapText(font, status, width);
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
|
||||
+4
-4
@@ -2,9 +2,9 @@ import type { RingInput } from "../g2/ring-input";
|
||||
|
||||
/**
|
||||
* Where an input came from. The ring and the glasses' arms are the stock
|
||||
* sources; "watch" is the Wear OS remote, which components may treat with a
|
||||
* richer scheme (see isWatchInput) — the ring's semantics are never changed
|
||||
* by it.
|
||||
* sources; "watch" is the watch remote (Wear OS or Apple Watch), which
|
||||
* components may treat with a richer scheme (see isWatchInput) — the ring's
|
||||
* semantics are never changed by it.
|
||||
*/
|
||||
export type InputSource = "ring" | "left-arm" | "right-arm" | "watch";
|
||||
|
||||
@@ -80,7 +80,7 @@ export function makeInputEvent(payload: InputEventPayload): InputEvent {
|
||||
return { ...payload, timestampMs: Date.now() };
|
||||
}
|
||||
|
||||
/** True for input from the Wear OS remote (any type that carries a source). */
|
||||
/** True for input from the watch remote (any type that carries a source). */
|
||||
export function isWatchInput(event: InputEvent): boolean {
|
||||
return "source" in event && event.source === "watch";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user