forked from Blendman974/faceclaw
EvenHub app uses logo; move login from the Settings app into the EvenHub app
This commit is contained in:
1 parent
83e0fa919f
commit
deac81f98f
15 files changed
+443
-90
No files matched your search
@@ -167,6 +167,7 @@ export class ConfigSettingEnum<TValue extends string, TId extends string = strin
|
||||
type ConfigSettingStringOptions<TId extends string> = ConfigSettingOptions<string, TId> & {
|
||||
editorTitle?: string;
|
||||
glassesEditTitle?: string;
|
||||
inputKind?: "text" | "email" | "password";
|
||||
normalize?: (value: string | null | undefined) => string;
|
||||
};
|
||||
|
||||
@@ -182,12 +183,14 @@ export function getStringSettingById(id: string): ConfigSettingString | null {
|
||||
export class ConfigSettingString<TId extends string = string> extends ConfigSetting<string, TId> {
|
||||
readonly editorTitle: string;
|
||||
readonly glassesEditTitle: string;
|
||||
readonly inputKind: "text" | "email" | "password";
|
||||
private readonly normalizer: (value: string | null | undefined) => string;
|
||||
|
||||
constructor(options: ConfigSettingStringOptions<TId>) {
|
||||
super(options);
|
||||
this.editorTitle = options.editorTitle ?? options.label;
|
||||
this.glassesEditTitle = options.glassesEditTitle ?? `Edit ${options.label}`;
|
||||
this.inputKind = options.inputKind ?? "text";
|
||||
this.normalizer = options.normalize ?? ((value) => value ?? "");
|
||||
stringSettingsById.set(this.id, this);
|
||||
}
|
||||
@@ -497,31 +500,6 @@ export const mapboxApiKeySetting = new ConfigSettingString({
|
||||
description: "Mapbox public token (pk. prefix), used by the Navigate app for maps, geocoding, and directions.",
|
||||
});
|
||||
|
||||
export const evenHubEmailSetting = new ConfigSettingString({
|
||||
id: "evenhub-email",
|
||||
label: "Even account email",
|
||||
storageKey: "integrations.evenhub.email",
|
||||
defaultValue: "",
|
||||
editorTitle: "Even Realities account email",
|
||||
glassesEditTitle: "Edit Even email",
|
||||
normalize: (value) => (value ?? "").replace(/[\x00-\x1f]+/g, "").trim(),
|
||||
formatValue: emptySettingDisplay,
|
||||
description: "Email for the Even account used to browse and download public EvenHub apps.",
|
||||
});
|
||||
|
||||
export const evenHubPasswordSetting = new ConfigSettingString({
|
||||
id: "evenhub-password",
|
||||
label: "Even account password",
|
||||
storageKey: "integrations.evenhub.password",
|
||||
defaultValue: "",
|
||||
editorTitle: "Even Realities account password",
|
||||
glassesEditTitle: "Edit Even password",
|
||||
normalize: (value) => (value ?? "").replace(/[\x00-\x1f]+/g, ""),
|
||||
formatValue: (value) => (value ? "(set)" : "(not set)"),
|
||||
description:
|
||||
"Password used to mint a short-lived Even API session. Faceclaw stores it in the same private settings store as other API credentials and never logs it.",
|
||||
});
|
||||
|
||||
/**
|
||||
* Staging buffer for the Terminal app's "Add connection" flow: the worker
|
||||
* asks the shell to open the phone text editor on this setting, the user
|
||||
|
||||
@@ -27,8 +27,6 @@ import {
|
||||
assistantSkipConfirmationSetting,
|
||||
batteryDisplayModeSetting,
|
||||
brightnessSetting,
|
||||
evenHubEmailSetting,
|
||||
evenHubPasswordSetting,
|
||||
elevenLabsApiKeySetting,
|
||||
mapboxApiKeySetting,
|
||||
openAiApiKeySetting,
|
||||
@@ -134,13 +132,6 @@ function settingsSections(): SettingsSection[] {
|
||||
textSettingMenuItem(roamApiTokenSetting),
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "EvenHub",
|
||||
items: [
|
||||
textSettingMenuItem(evenHubEmailSetting),
|
||||
textSettingMenuItem(evenHubPasswordSetting),
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Developer",
|
||||
items: [
|
||||
|
||||
@@ -29,6 +29,12 @@ export type LayerActions = {
|
||||
requestRender: () => void;
|
||||
disconnect: () => Promise<void> | void;
|
||||
startTextSettingEdit: (setting: ConfigSettingString) => Promise<void> | void;
|
||||
/** Open one phone form for multiple related settings (for example email + password). */
|
||||
startTextSettingsEdit: (
|
||||
settings: readonly ConfigSettingString[],
|
||||
title: string,
|
||||
onFinish?: () => void,
|
||||
) => Promise<void> | void;
|
||||
endTextSettingEdit: () => Promise<void> | void;
|
||||
/**
|
||||
* Start push-to-talk voice capture with the provider chosen in settings.
|
||||
@@ -50,6 +56,7 @@ export const noopLayerActions: LayerActions = {
|
||||
requestRender: () => {},
|
||||
disconnect: () => {},
|
||||
startTextSettingEdit: () => {},
|
||||
startTextSettingsEdit: () => {},
|
||||
endTextSettingEdit: () => {},
|
||||
startVoiceCapture: () => {},
|
||||
stopVoiceCapture: () => {},
|
||||
|
||||
Reference in new issue
Block a user