merge dark mode and google OAuth (#35)

* feat(api): implement Google OAuth login and user management

- Added Google OpenID Connect login functionality, allowing users to authenticate using their Google accounts.
- Created new endpoints for Google login, including user registration and linking existing accounts.
- Introduced Google token verification logic and error handling for authentication failures.
- Updated environment configuration to include Google OAuth client IDs and verification settings.
- Enhanced user model to support OpenID and linked Google accounts.

This feature improves user experience by enabling seamless sign-in with Google, while maintaining security and integrity of user data.

* fix(auth): wire staging Google token verifier

* chore(deps): update expo to version 55.0.6 and adjust @expo/env dependency in pnpm-lock.yaml

* chore(deps): update Babel dependencies to version 7.29.7 in package-lock.json

* feat(auth): enhance phone login for China users

- Updated phone login functionality to support only mainland China (+86) mobile numbers.
- Added user prompts and descriptions for phone login, including confirmation and cancellation options.
- Adjusted translations for both English and Chinese to reflect the new phone login requirements.
- Updated Google OAuth client IDs in configuration files for production and staging environments.

* chore(deps): add peer flag to use-sync-external-store in package-lock.json

* chore(deps): add @emnapi/core and @emnapi/runtime to package-lock.json

* fix(app-expo): align Android native dependencies

* fix(app-expo): normalize lockfile for npm 10

* fix(config): update environment variable handling to use static access

- Introduced a static mapping for public environment variables to ensure proper access during the release bundle.
- Updated the `requirePublicEnv` and `optionalPublicEnv` functions to reference the new `PUBLIC_ENV` object instead of directly accessing `process.env`.
- Added comments to clarify the necessity of static access for certain environment variables.

* feat(app-expo): dark mode, FAQ i18n, eval ASR, and theme cleanup (#34)

* feat(app-expo): dark mode, FAQ i18n, version CI, and theme cleanup

Implement light/dark scene colors across chat, reading, and headers; remove
default/brand theme picker and ThemeVariablesProvider. Localize FAQ in-app,
fix dark-mode text visibility, and remove the unused /api/faqs endpoint.
Align About/version with Expo config and inject APP_VERSION in CI builds.

Also includes phone E164 auth/SMS updates, eval ASR page, and related API work.

* revert: remove phone E.164 changes from dark-mode branch

These auth/SMS internationalization updates were accidentally bundled into
the dark-mode commit; restore 11-digit CN phone flow and drop related API,
migration, and Expo UI work from this branch.

* fix: address PR review issues for dark mode and eval ASR

Use light foreground colors for sepia reading in dark mode, fix chat send
button contrast, stream-limit eval ASR uploads, restore LiveTester phone
validation, and remove unused AudioSegmenter code.

* fix(app-expo): improve chat send button contrast in light and dark mode

Add dedicated send button colors (accent fill in dark, primary fill in
light), use RNText to avoid NativeWind overrides, and restore dark labels
in light mode for readable composer actions.

---------

Co-authored-by: Kevin <kevin@brighteng.org>

---------

Co-authored-by: penghanyuan <penghanyuan@gmail.com>
Co-authored-by: Kevin <kevin@brighteng.org>
This commit is contained in:
Sully
2026-06-09 11:14:36 +08:00
committed by GitHub
parent 10d9e13f14
commit 105b50a277
105 changed files with 22363 additions and 6105 deletions

View File

@@ -21,6 +21,8 @@ type PrivacyAccessedAPIType = {
NSPrivacyAccessedAPITypeReasons: string[];
};
type ExpoPlugin = NonNullable<ExpoConfig['plugins']>[number];
const LOCALES: Record<string, LocaleMessages> = {
zh: { ...zh, permissions: permissionsZh },
en: { ...en, permissions: permissionsEn },
@@ -30,6 +32,8 @@ const SUPPORTED_LOCALES = ['zh', 'en'] as const;
const PRIMARY_LOCALE = process.env.EXPO_PUBLIC_PRIMARY_LOCALE ?? 'zh';
const API_BASE_URL = process.env.EXPO_PUBLIC_API_URL?.trim() ?? '';
const WS_BASE_URL = process.env.EXPO_PUBLIC_WS_URL?.trim() ?? '';
const GOOGLE_IOS_URL_SCHEME =
process.env.EXPO_PUBLIC_GOOGLE_IOS_URL_SCHEME?.trim() ?? '';
if (!API_BASE_URL || !WS_BASE_URL) {
throw new Error(
@@ -59,7 +63,10 @@ const ANDROID_PACKAGE = IS_STAGING
? 'org.brighteng.lifecho'
: 'com.anonymous.appexpo';
/** Home-screen label; varies by variant. */
const APP_DISPLAY_NAME = IS_STAGING ? 'Life Echo (Staging)' : 'Life Echo';
/** Native Xcode/Android project name — keep stable so ios/LifeEcho.xcworkspace always works. */
const NATIVE_PROJECT_NAME = 'Life Echo';
const PERMISSION_FALLBACKS: Record<PermissionKey, string> = {
microphone: 'Allow $(PRODUCT_NAME) to access your microphone.',
@@ -110,6 +117,27 @@ function getPermissionMessage(key: PermissionKey): string {
return localePermissions[key] ?? PERMISSION_FALLBACKS[key];
}
const PACKAGE_VERSION = (
require('./package.json') as { version: string }
).version;
/** Local SSOT: package.json. CI overrides via APP_VERSION / APP_BUILD_NUMBER. */
function resolveAppVersion(): string {
return process.env.APP_VERSION?.trim() || PACKAGE_VERSION;
}
function resolveBuildNumber(): string | undefined {
const raw = process.env.APP_BUILD_NUMBER?.trim();
return raw || undefined;
}
function resolveAndroidVersionCode(): number | undefined {
const build = resolveBuildNumber();
if (!build) return undefined;
const parsed = Number.parseInt(build, 10);
return Number.isFinite(parsed) ? parsed : undefined;
}
function mergePrivacyAccessedApiTypes(
existing: PrivacyAccessedAPIType[] = [],
required: PrivacyAccessedAPIType[] = [],
@@ -134,17 +162,30 @@ export default ({ config }: ConfigContext): ExpoConfig => {
const existingPrivacyAccessedApiTypes = (config?.ios?.privacyManifests
?.NSPrivacyAccessedAPITypes ?? []) as PrivacyAccessedAPIType[];
const appVersion = resolveAppVersion();
const buildNumber = resolveBuildNumber();
const androidVersionCode = resolveAndroidVersionCode();
const googleSignInPlugin: ExpoPlugin[] = GOOGLE_IOS_URL_SCHEME
? [
[
'@react-native-google-signin/google-signin',
{ iosUrlScheme: GOOGLE_IOS_URL_SCHEME },
] as ExpoPlugin,
]
: [];
return {
...config,
name: APP_DISPLAY_NAME,
name: NATIVE_PROJECT_NAME,
slug: 'life-echo',
version: '1.2.0',
version: appVersion,
orientation: 'portrait',
icon: './assets/images/icon.png',
scheme: 'lifeecho',
userInterfaceStyle: 'automatic',
ios: {
...config?.ios,
...(buildNumber ? { buildNumber } : {}),
icon: './assets/images/icon.png',
bundleIdentifier: IOS_BUNDLE_IDENTIFIER,
config: {
@@ -152,6 +193,7 @@ export default ({ config }: ConfigContext): ExpoConfig => {
},
infoPlist: {
...config?.ios?.infoPlist,
CFBundleDisplayName: APP_DISPLAY_NAME,
CFBundleAllowMixedLocalizations: true,
},
privacyManifests: {
@@ -164,6 +206,7 @@ export default ({ config }: ConfigContext): ExpoConfig => {
},
android: {
...config?.android,
...(androidVersionCode != null ? { versionCode: androidVersionCode } : {}),
/**
* `resize` → `adjustResize`:键盘顶起时缩小窗口,聊天输入框随内容上移。
* 与 `KeyboardAvoidingView` + `behavior="height"` 叠用会重复处理,易错位(见 Expo Keyboard 指南)。
@@ -179,6 +222,7 @@ export default ({ config }: ConfigContext): ExpoConfig => {
predictiveBackGestureEnabled: false,
},
plugins: [
...googleSignInPlugin,
// CI/local release: android/app/keystore.properties + store file → release signing; -PversionName/-PversionCode
'./plugins/withAndroidReleaseSigning',
[