Add an Apple Watch app that can control the glasses

This commit is contained in:
James Babcock committed 2026-11-04 02:20:26 -08:00
1 parent c896ce9ac8
commit 2696f3b76c
46 files changed
+3877 -88

No files matched your search

+3 -3
View File
@@ -298,7 +298,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",
);
@@ -679,7 +679,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",
@@ -687,7 +687,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({
+16 -12
View File
@@ -209,8 +209,8 @@ 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),
@@ -272,17 +272,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;
@@ -360,7 +355,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),
@@ -603,12 +598,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
View File
@@ -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";
}