forked from Blendman974/faceclaw
[verified] merge upstream c162c8e6 into all-features
This commit is contained in:
commit
5790e98d27
176 files changed
+5311
-2307
No files matched your search
@@ -31,7 +31,7 @@ import { LIST_ROW_TEXT_INSET, lineStep } from "./metrics";
|
||||
import { Layer, type LayerContext } from "./layers";
|
||||
import { GrayImage } from "~/graphics/image";
|
||||
import type { DataCollectionLevel } from "../analytics/analytics-store";
|
||||
import { IOS_PRIVACY_SUMMARY } from "../analytics/privacy-disclosure";
|
||||
import { ANDROID_PRIVACY_SUMMARY, IOS_PRIVACY_SUMMARY } from "../analytics/privacy-disclosure";
|
||||
|
||||
export type NightscoutSettings = {
|
||||
siteUrl: string;
|
||||
@@ -657,18 +657,36 @@ export const statusBarVisibilitySetting = new ConfigSettingEnum<StatusBarVisibil
|
||||
});
|
||||
|
||||
/**
|
||||
* Whether the foreground window gets a rounded border with a popup app
|
||||
* switcher (geometry.ts windowFramed); without one, a line divides the
|
||||
* window from the status bar.
|
||||
* Which lines the shell draws round the foreground window with a bottom or
|
||||
* popup app switcher: a rounded border all round it (geometry.ts
|
||||
* windowFramed), only a straight line between it and the status bar, or
|
||||
* none at all.
|
||||
*/
|
||||
export const windowBorderSetting = new ConfigSettingBoolean({
|
||||
export type WindowBorder = "all" | "status" | "none";
|
||||
|
||||
const WINDOW_BORDER_LABELS: Record<WindowBorder, string> = {
|
||||
all: "All around",
|
||||
status: "Status line",
|
||||
none: "None",
|
||||
};
|
||||
|
||||
// Until 2026-11-09 this was a toggle that only a popup app switcher had,
|
||||
// between the rounded border and the status line; a bottom row's windows
|
||||
// always had the border.
|
||||
function legacyWindowBorder(): WindowBorder {
|
||||
return appSwitcherPositionSetting.get() === "popup" && !getBooleanSetting("display.windowBorder", true) ? "status" : "all";
|
||||
}
|
||||
|
||||
export const windowBorderSetting = new ConfigSettingEnumWithLegacy<WindowBorder>({
|
||||
id: "window-border",
|
||||
label: "Window border",
|
||||
storageKey: "display.windowBorder",
|
||||
defaultValue: true,
|
||||
label: "Border",
|
||||
storageKey: "display.border",
|
||||
defaultValue: "all",
|
||||
values: ["all", "status", "none"],
|
||||
formatValue: (value) => WINDOW_BORDER_LABELS[value] ?? value,
|
||||
description:
|
||||
"Draw a rounded border around the window. Without it, a line separates the window from the status bar. Available with a popup app switcher. Changing it reopens open apps in the new size.",
|
||||
});
|
||||
"All around draws a rounded border around the window. Status line draws only a straight line between the window and the status bar. None draws no lines. Available with the app switcher at the bottom or as a popup. Open apps reopen at their new size when a change resizes windows.",
|
||||
}, legacyWindowBorder);
|
||||
|
||||
export const brightnessSetting = new ConfigSettingEnum<BrightnessSetting>({
|
||||
id: "brightness",
|
||||
@@ -866,6 +884,21 @@ 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.",
|
||||
});
|
||||
|
||||
/** Which input device the touchpad on the phone's main screen imitates. */
|
||||
export type PhoneInputStyle = "watch" | "ring";
|
||||
|
||||
export const phoneInputStyleSetting = new ConfigSettingEnum<PhoneInputStyle>({
|
||||
id: "phone-input-style",
|
||||
label: "Phone input style",
|
||||
storageKey: "phone.inputStyle",
|
||||
defaultValue: "watch",
|
||||
values: ["watch", "ring"],
|
||||
formatValue: (value) => (value === "ring" ? "Ring" : "Watch"),
|
||||
description:
|
||||
"Which device the touchpad on the phone's main screen imitates. Watch: swipes navigate, tap selects, double-tap or two fingers goes back, a hold opens the menu. " +
|
||||
"Ring: vertical swipes scroll; tap, double-tap and hold are the ring's click, double-click and long-press.",
|
||||
});
|
||||
|
||||
// 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({
|
||||
@@ -974,7 +1007,7 @@ const DATA_COLLECTION_LABELS: Record<DataCollectionLevel, string> = {
|
||||
// What each level collects is set out in app/analytics/analytics-store.ts and
|
||||
// the privacy policy (PRIVACY); keep these in step with both.
|
||||
const DATA_COLLECTION_SUMMARIES: Record<DataCollectionLevel, string> = {
|
||||
none: "Disable all data sharing",
|
||||
none: "No Faceclaw statistics",
|
||||
minimal: "Version, devices, and connection reliability statistics",
|
||||
full: "More detailed usage data",
|
||||
};
|
||||
@@ -993,7 +1026,7 @@ export const dataCollectionSetting = new ConfigSettingEnum<DataCollectionLevel>(
|
||||
values: ["none", "minimal", "full"],
|
||||
formatValue: (value) => DATA_COLLECTION_LABELS[value],
|
||||
description:
|
||||
(global.isIOS ? IOS_PRIVACY_SUMMARY + " " : "") +
|
||||
(global.isIOS ? IOS_PRIVACY_SUMMARY : ANDROID_PRIVACY_SUMMARY) + " " +
|
||||
"Optional statistics Faceclaw may send its developers once a day, to help fix problems and improve the " +
|
||||
"app. None: no Faceclaw statistics are stored or sent. Minimal: the app version, which devices are " +
|
||||
"paired and in use, and how reliable the connection to them is. Full: also settings chosen from fixed " +
|
||||
@@ -1129,20 +1162,16 @@ export const wakeWordActionSetting = new ConfigSettingEnum<WakeWordAction>({
|
||||
description: "What saying \"Hey Even\" does: start voice input, just turn the screen on, or nothing.",
|
||||
});
|
||||
|
||||
export const saveTranscribeAudioSetting = new ConfigSettingBoolean({
|
||||
id: "save-transcribe-audio",
|
||||
label: "Save Transcribe audio",
|
||||
storageKey: "voice.saveTranscribeAudio",
|
||||
defaultValue: true,
|
||||
description: "Record each Transcribe session's audio as a WAV file in Downloads (about 2 MB per minute), named like its transcript. Recordings are kept until you delete them.",
|
||||
});
|
||||
|
||||
export const saveVoiceRecordingsSetting = new ConfigSettingBoolean({
|
||||
id: "save-voice-recordings",
|
||||
label: "Save voice recordings",
|
||||
storageKey: "developer.saveVoiceRecordings",
|
||||
/**
|
||||
* Toggled from the Transcribe and Translate apps' menus. One setting for
|
||||
* both: they share the mic stream, so its audio is either being saved or not.
|
||||
*/
|
||||
export const saveRecordingSetting = new ConfigSettingBoolean({
|
||||
id: "save-recording",
|
||||
label: "Save Recording",
|
||||
storageKey: "voice.saveRecording",
|
||||
defaultValue: false,
|
||||
description: "Keep a copy of captured voice audio on the phone, for debugging transcription problems.",
|
||||
description: "Record the audio of Transcribe and Translate sessions as WAV files in Downloads (about 2 MB per minute), named after the app and the session's start time. Recordings are kept until you delete them.",
|
||||
});
|
||||
|
||||
export const assistantSkipConfirmationSetting = new ConfigSettingBoolean({
|
||||
@@ -1922,26 +1951,29 @@ export class EditTextSettingLayer implements Layer {
|
||||
const font = getDefaultSmallFont();
|
||||
// Sized to the hosting stack (full lens in the dashboard window, app
|
||||
// viewport in the settings app).
|
||||
const { width, height } = ctx.stack.getBaseSize();
|
||||
const { width, height, padding } = ctx.stack.getBaseSize();
|
||||
const image = new GrayImage(width, height, 0);
|
||||
const step = lineStep(font);
|
||||
image.drawText(font, 22, 16, this.setting.glassesEditTitle, 220);
|
||||
const messageTop = 24 + 2 * font.lineHeight;
|
||||
const message = wrapText(font, "Look at the phone app to type a value.", width - 48);
|
||||
// A text column inside the padding suggested for each window edge.
|
||||
const x = padding.left;
|
||||
const textWidth = width - padding.left - padding.right;
|
||||
image.drawText(font, x, padding.top, this.setting.glassesEditTitle, 220);
|
||||
const messageTop = padding.top + 8 + 2 * font.lineHeight;
|
||||
const message = wrapText(font, "Look at the phone app to type a value.", textWidth);
|
||||
for (let index = 0; index < message.length; index++) {
|
||||
image.drawText(font, 22, messageTop + index * step, message[index]!, 200);
|
||||
image.drawText(font, x, messageTop + index * step, message[index]!, 200);
|
||||
}
|
||||
const valueY = messageTop + (message.length + 2) * step;
|
||||
image.drawText(font, 22, valueY, truncateSetting(this.setting.inputKind === "password" ? this.setting.displayValue() : this.setting.get(), 52), 220);
|
||||
image.drawText(font, x, valueY, truncateSetting(this.setting.inputKind === "password" ? this.setting.displayValue() : this.setting.get(), 52), 220);
|
||||
const error = this.setting.validationError();
|
||||
const errorLines = error ? wrapText(font, error, width - 48) : [];
|
||||
const errorLines = error ? wrapText(font, error, textWidth) : [];
|
||||
errorLines.forEach((line, index) =>
|
||||
image.drawText(font, 22, messageTop + (message.length + 4 + index) * step, line, 180));
|
||||
image.drawText(font, x, messageTop + (message.length + 4 + index) * step, line, 180));
|
||||
// The back hint at the bottom, unless a short window (the RayNeo iO's)
|
||||
// leaves it no room under the value and error.
|
||||
const contentBottom = errorLines.length ? messageTop + (message.length + 4 + errorLines.length) * step : valueY + step;
|
||||
const hintY = height - 24 - font.lineHeight;
|
||||
if (hintY >= contentBottom) image.drawText(font, 22, hintY, `${GESTURE_DOUBLE_CLICK} back`, 110);
|
||||
const hintY = height - padding.bottom - font.lineHeight;
|
||||
if (hintY >= contentBottom) image.drawText(font, x, hintY, `${GESTURE_DOUBLE_CLICK} back`, 110);
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user