Skip to content

Commit b7a7638

Browse files
committed
bug fixes
1 parent c99b60e commit b7a7638

File tree

8 files changed

+65
-35
lines changed

8 files changed

+65
-35
lines changed

mobile/app.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = ({config}: ConfigContext): Partial<ExpoConfig> => {
2626
// icon: "./assets/app-icons/ic_launcher.png",
2727
package: "com.mentra.mentra",
2828
googleServicesFile: "./google-services.json",
29-
versionCode: 121,
29+
versionCode: 123,
3030
adaptiveIcon: {
3131
foregroundImage: "./assets/app-icons/ic_launcher_foreground.png",
3232
// backgroundImage: "./assets/app-icons/ic_launcher.png",
@@ -59,7 +59,7 @@ module.exports = ({config}: ConfigContext): Partial<ExpoConfig> => {
5959
icon: "./assets/app-icons/ic_launcher.png",
6060
supportsTablet: false,
6161
requireFullScreen: true,
62-
buildNumber: "121",
62+
buildNumber: "123",
6363
bundleIdentifier: "com.mentra.mentra",
6464
googleServicesFile: "./GoogleService-Info.plist",
6565
associatedDomains: ["applinks:apps.mentra.glass"],

mobile/modules/core/ios/Source/GlassesStore.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ class GlassesStore {
198198
if let mic = value as? String {
199199
apply("core", "micRanking", MicMap.map[mic] ?? MicMap.map["auto"]!)
200200
CoreManager.shared.setMicState(
201-
store.get("core", "should_send_pcm_data") as? Bool ?? false,
202-
store.get("core", "should_send_transcript") as? Bool ?? false,
201+
store.get("core", "shouldSendPcmData") as? Bool ?? false,
202+
store.get("core", "shouldSendTranscript") as? Bool ?? false,
203203
store.get("core", "bypass_vad") as? Bool ?? true
204204
)
205205
}
@@ -209,20 +209,18 @@ class GlassesStore {
209209
Bridge.log("GlassesStore: offline_captions_running changed to \(running)")
210210
// When offline captions are enabled, start the microphone for local transcription
211211
// When disabled, stop the microphone
212-
// set should_send_transcript to true if running is true, otherwise false
213-
let shouldSendTranscript = running
214212
CoreManager.shared.setMicState(
215-
store.get("core", "should_send_pcm_data") as? Bool ?? false,
216-
shouldSendTranscript,
213+
store.get("core", "shouldSendPcmData") as? Bool ?? false,
214+
running,
217215
store.get("core", "bypass_vad") as? Bool ?? true
218216
)
219217
}
220218

221219
case ("core", "enforce_local_transcription"):
222220
if let enabled = value as? Bool {
223221
CoreManager.shared.setMicState(
224-
store.get("core", "should_send_pcm_data") as? Bool ?? false,
225-
store.get("core", "should_send_transcript") as? Bool ?? false,
222+
store.get("core", "shouldSendPcmData") as? Bool ?? false,
223+
store.get("core", "shouldSendTranscript") as? Bool ?? false,
226224
store.get("core", "bypass_vad") as? Bool ?? true
227225
)
228226
}

mobile/src/app/applet/settings.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {focusEffectPreventBack, useNavigationHistory} from "@/contexts/Navigatio
2424
import {useAppTheme} from "@/contexts/ThemeContext"
2525
import {translate} from "@/i18n"
2626
import restComms from "@/services/RestComms"
27-
import {useApplets, useAppletStatusStore, useRefreshApplets, useStartApplet, useStopApplet} from "@/stores/applets"
27+
import {useApplets, useAppletStatusStore, useRefreshApplets, useStartApplet, useStopApplet, SYSTEM_APPS} from "@/stores/applets"
2828
import {ThemedStyle} from "@/theme"
2929
import {showAlert} from "@/utils/AlertUtils"
3030
import {askPermissionsUI} from "@/utils/PermissionsUtils"
@@ -220,7 +220,7 @@ export default function AppSettings() {
220220
name: appInfo?.name || appName,
221221
description: translate("appSettings:noDescription"),
222222
settings: [],
223-
uninstallable: true,
223+
uninstallable: !SYSTEM_APPS.includes(packageName),
224224
})
225225
setSettingsState({})
226226
setHasCachedSettings(false)
@@ -711,15 +711,15 @@ export default function AppSettings() {
711711
label={translate("appSettings:uninstall")}
712712
preset="destructive"
713713
onPress={() => {
714-
if (serverAppInfo?.uninstallable) {
714+
if (serverAppInfo?.uninstallable && !SYSTEM_APPS.includes(packageName)) {
715715
handleUninstallApp()
716716
} else {
717717
showAlert(translate("appSettings:cannotUninstall"), translate("appSettings:cannotUninstallMessage"), [
718718
{text: translate("common:ok"), style: "default"},
719719
])
720720
}
721721
}}
722-
disabled={!serverAppInfo?.uninstallable}
722+
disabled={!serverAppInfo?.uninstallable || SYSTEM_APPS.includes(packageName)}
723723
/>
724724

725725
{/* Bottom safe area padding */}

mobile/src/components/home/DeviceStatus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export const DeviceStatus = ({style}: {style?: ViewStyle}) => {
179179
onPress={handleConnectOrDisconnect}>
180180
<View className="flex-row items-center gap-2 flex-1">
181181
<ActivityIndicator size="small" color={theme.colors.foreground} />
182-
<Text className="text-secondary-foreground text-sm" text={translate("common:cancel")} />
182+
<Text className="text-secondary-foreground" style={{fontSize: 14}} text={translate("common:cancel")} />
183183
</View>
184184
</Button>
185185
)}

mobile/src/components/ignite/Button.tsx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -201,18 +201,22 @@ function OriginalButton(props: ButtonProps) {
201201
</View>
202202
)}
203203

204-
<Text
205-
tx={tx}
206-
text={text}
207-
txOptions={txOptions}
208-
style={[
209-
$textStyle(state),
210-
{textAlign: props.textAlignment === "left" ? "left" : "center"},
211-
!!LeftAccessory && {paddingLeft: 28},
212-
!!RightAccessory && {paddingRight: 28},
213-
]}>
214-
{children}
215-
</Text>
204+
{!tx && !text && children ? (
205+
children
206+
) : (
207+
<Text
208+
tx={tx}
209+
text={text}
210+
txOptions={txOptions}
211+
style={[
212+
$textStyle(state),
213+
{textAlign: props.textAlignment === "left" ? "left" : "center"},
214+
!!LeftAccessory && {paddingLeft: 28},
215+
!!RightAccessory && {paddingRight: 28},
216+
]}>
217+
{children}
218+
</Text>
219+
)}
216220

217221
{!!RightAccessory && (
218222
<View style={{position: "absolute", right: 0, alignItems: "center", justifyContent: "center"}}>
@@ -255,8 +259,8 @@ const $compactIconStyle: StyleProp<ViewStyle> = {
255259

256260
const $baseTextStyle: ThemedStyle<TextStyle> = ({colors}) => ({
257261
fontSize: 14,
258-
lineHeight: 20,
259262
textAlign: "center",
263+
textAlignVertical: "center",
260264
flexShrink: 1,
261265
flexGrow: 0,
262266
zIndex: 2,

mobile/src/components/ignite/Icon.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,22 +207,22 @@ export function Icon(props: IconProps) {
207207
const IconComponent = lucideIcons[name] as any
208208

209209
return (
210-
<View {...viewProps} style={$containerStyleOverride}>
210+
<View {...viewProps} style={[$containerStyleOverride, $iconCenterStyle]}>
211211
<IconComponent style={$imageStyle} size={size} color={color} fill={backgroundColor ?? "transparent"} />
212212
</View>
213213
)
214214
}
215215

216216
if (TablerIcon.glyphMap[name]) {
217217
return (
218-
<View {...viewProps} style={$containerStyleOverride}>
218+
<View {...viewProps} style={[$containerStyleOverride, $iconCenterStyle]}>
219219
<TablerIcon style={$textStyle} name={name} size={size} color={color} />
220220
</View>
221221
)
222222
}
223223

224224
return (
225-
<View {...viewProps} style={$containerStyleOverride}>
225+
<View {...viewProps} style={[$containerStyleOverride, $iconCenterStyle]}>
226226
<Image style={$imageStyle} source={iconRegistry[name] as any} />
227227
</View>
228228
)
@@ -237,6 +237,11 @@ export const iconRegistry = {
237237
...lucideIcons,
238238
}
239239

240+
const $iconCenterStyle: ViewStyle = {
241+
// justifyContent: "center",
242+
// alignItems: "center",
243+
}
244+
240245
const $imageStyleBase: ImageStyle = {
241246
resizeMode: "contain",
242247
}

mobile/src/components/miniapps/DualButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,15 @@ export const MiniAppMoreActionsSheet = forwardRef<BottomSheetModal, MiniAppMoreA
244244
<Text className="text-sm text-muted-foreground w-full text-center" tx="appInfo:settings" />
245245
</View>
246246

247-
{isUninstallable && (
247+
{/* Uninstall removed from 3-dot menu - users can uninstall from miniapp settings page */}
248+
{/* {isUninstallable && (
248249
<View className="flex-col gap-2 items-center w-1/4">
249250
<Button compactIcon onPress={handleUninstall} preset="alternate" className="rounded-2xl w-16 h-16">
250251
<Icon name="trash" color={theme.colors.destructive} size={size} />
251252
</Button>
252253
<Text className="text-sm text-muted-foreground w-full text-center" tx="appInfo:uninstall" />
253254
</View>
254-
)}
255+
)} */}
255256
</View>
256257

257258
<View className="flex-1" />

mobile/src/stores/applets.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import {
66
HardwareType,
77
} from "@/../../cloud/packages/types/src"
88
import {useMemo} from "react"
9+
import {Platform} from "react-native"
910
import {AsyncResult, result as Res, Result} from "typesafe-ts"
1011
import {create} from "zustand"
1112
import * as Sentry from "@sentry/react-native"
1213

1314
import {getCurrentRoute, push} from "@/contexts/NavigationHistoryContext"
1415
import {translate} from "@/i18n"
16+
import CoreModule from "core"
1517
import restComms from "@/services/RestComms"
1618
import STTModelManager from "@/services/STTModelManager"
1719
import {SETTINGS, useSetting, useSettingsStore} from "@/stores/settings"
@@ -82,6 +84,8 @@ export const storePackageName = "com.mentra.store"
8284
export const simulatedPackageName = "com.mentra.simulated"
8385
export const mirrorPackageName = "com.mentra.mirror"
8486
export const lmaInstallerPackageName = "com.mentra.lma_installer"
87+
export const mentraAiPackageName = "com.mentra.ai"
88+
export const notifyPackageName = "cloud.augmentos.notify"
8589

8690
export const uninstallAppUI = async (clientApp: ClientAppletInterface) => {
8791
console.log(`Uninstalling app: ${clientApp.packageName}`)
@@ -180,8 +184,8 @@ export const SYSTEM_APPS = [
180184
storePackageName,
181185
simulatedPackageName,
182186
mirrorPackageName,
183-
"com.mentra.ai",
184-
"com.mentra.notify",
187+
mentraAiPackageName,
188+
notifyPackageName
185189
]
186190

187191
// get offline applets:
@@ -249,6 +253,8 @@ const getOfflineApplets = async (): Promise<ClientAppletInterface[]> => {
249253
const modelAvailable = await STTModelManager.isModelAvailable()
250254
if (modelAvailable) {
251255
await storage.save(`${captionsPackageName}_running`, true)
256+
// ensure transcriber is initialized with the current model:
257+
await CoreModule.restartTranscriber()
252258
// tell the core:
253259
await useSettingsStore.getState().setSetting(SETTINGS.offline_captions_running.key, true)
254260
return undefined
@@ -577,6 +583,22 @@ export const useAppletStatusStore = create<AppStatusState>((set, get) => ({
577583
applet.hidden = state.getHiddenStatus(applet.packageName)
578584
}
579585

586+
// Platform-specific app filtering and routing
587+
applets = applets.filter((applet) => {
588+
// Notify is not supported on iOS yet - remove entirely
589+
if (Platform.OS === "ios" && applet.packageName === notifyPackageName) {
590+
return false
591+
}
592+
return true
593+
})
594+
for (const applet of applets) {
595+
if (applet.packageName === notifyPackageName) {
596+
// On Android, route to notification settings instead of generic webview settings
597+
applet.offline = true
598+
applet.offlineRoute = "/miniapps/settings/notifications"
599+
}
600+
}
601+
580602
set({apps: applets})
581603
},
582604

0 commit comments

Comments
 (0)