Skip to content

Commit b021dd2

Browse files
authored
Merge b951dd9 into b48c72c
2 parents b48c72c + b951dd9 commit b021dd2

190 files changed

Lines changed: 884 additions & 148 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/android/app/src/main/java/ai/openclaw/app/ui/MobileUiTokens.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import androidx.compose.ui.text.font.FontFamily
1111
import androidx.compose.ui.text.font.FontWeight
1212
import androidx.compose.ui.unit.sp
1313

14-
// ---------------------------------------------------------------------------
15-
// MobileColors – semantic color tokens with light + dark variants
16-
// ---------------------------------------------------------------------------
17-
1814
internal data class MobileColors(
1915
val surface: Color,
2016
val surfaceStrong: Color,
@@ -108,9 +104,6 @@ internal object MobileColorsAccessor {
108104
@Composable get() = LocalMobileColors.current
109105
}
110106

111-
// ---------------------------------------------------------------------------
112-
// Backward-compatible top-level accessors (composable getters)
113-
// ---------------------------------------------------------------------------
114107
// These allow existing call sites to keep using `mobileSurface`, `mobileText`, etc.
115108
// without converting every file at once. Each resolves to the themed value.
116109

@@ -149,10 +142,6 @@ internal val mobileBackgroundGradient: Brush
149142
)
150143
}
151144

152-
// ---------------------------------------------------------------------------
153-
// Typography tokens (theme-independent)
154-
// ---------------------------------------------------------------------------
155-
156145
internal val mobileFontFamily =
157146
FontFamily(
158147
Font(resId = R.font.manrope_400_regular, weight = FontWeight.Normal),

ui/public/sw.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// OpenClaw Control – Service Worker
2-
// Handles offline caching and push notifications.
3-
41
const CACHE_PREFIX = "openclaw-control-";
52
const EMBEDDED_CACHE_VERSION = "__OPENCLAW_CONTROL_UI_BUILD_ID__";
63
const URL_CACHE_VERSION = new URL(self.location.href).searchParams
@@ -13,7 +10,6 @@ const CACHE_VERSION =
1310
const CACHE_NAME = `${CACHE_PREFIX}${CACHE_VERSION}`;
1411
const CONTROL_CACHE_LIMIT = 3;
1512

16-
// Minimal app-shell files to precache.
1713
const PRECACHE_URLS = ["./"];
1814

1915
self.addEventListener("install", (event) => {

ui/src/i18n/lib/lit-controller.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ReactiveController, ReactiveControllerHost } from "lit";
22
import { i18n } from "./translate.ts";
33

4+
/** Subscribes a Lit host to the shared i18n manager for locale-change updates. */
45
export class I18nController implements ReactiveController {
56
private host: ReactiveControllerHost;
67
private unsubscribe?: () => void;

ui/src/i18n/lib/registry.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type LazyLocaleRegistration = {
88
loader: () => Promise<LocaleModule>;
99
};
1010

11+
/** Built-in locale loaded synchronously and used as fallback for missing strings. */
1112
export const DEFAULT_LOCALE: Locale = "en";
1213

1314
const LAZY_LOCALES: readonly LazyLocale[] = [
@@ -106,8 +107,10 @@ const LAZY_LOCALE_REGISTRY: Record<LazyLocale, LazyLocaleRegistration> = {
106107
},
107108
};
108109

110+
/** Locales exposed in UI settings and accepted by the i18n manager. */
109111
export const SUPPORTED_LOCALES: ReadonlyArray<Locale> = [DEFAULT_LOCALE, ...LAZY_LOCALES];
110112

113+
/** Type guard for persisted, browser-reported, or user-selected locale ids. */
111114
export function isSupportedLocale(value: string | null | undefined): value is Locale {
112115
return value !== null && value !== undefined && SUPPORTED_LOCALES.includes(value as Locale);
113116
}
@@ -116,6 +119,7 @@ function isLazyLocale(locale: Locale): locale is LazyLocale {
116119
return LAZY_LOCALES.includes(locale as LazyLocale);
117120
}
118121

122+
/** Maps a browser language tag to the closest supported UI locale. */
119123
export function resolveNavigatorLocale(navLang: string): Locale {
120124
if (navLang.startsWith("zh")) {
121125
return navLang === "zh-TW" || navLang === "zh-HK" ? "zh-TW" : "zh-CN";
@@ -171,6 +175,7 @@ export function resolveNavigatorLocale(navLang: string): Locale {
171175
return DEFAULT_LOCALE;
172176
}
173177

178+
/** Dynamically imports a non-English translation map when first selected. */
174179
export async function loadLazyLocaleTranslation(locale: Locale): Promise<TranslationMap | null> {
175180
if (!isLazyLocale(locale)) {
176181
return null;

ui/src/i18n/lib/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export type TranslationMap = { [key: string]: string | TranslationMap };
22

3+
/** Locale ids supported by the bundled UI translation registry. */
34
export type Locale =
45
| "en"
56
| "zh-CN"
@@ -21,6 +22,7 @@ export type Locale =
2122
| "nl"
2223
| "fa";
2324

25+
/** Full i18n configuration shape used by tests and future configuration surfaces. */
2426
export interface I18nConfig {
2527
locale: Locale;
2628
fallbackLocale: Locale;

ui/src/i18n/locales/ar.ts

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/locales/de.ts

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/locales/es.ts

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/locales/fa.ts

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/i18n/locales/fr.ts

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)