@agimon-ai/po-native 0.0.1-alpha.74 → 0.0.1-alpha.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +110 -149
- package/package.json +14 -14
- package/src/adapters/remoteHttp.ts +8 -4
- package/src/app/AccountRoute.tsx +26 -6
- package/src/app/App.tsx +295 -149
- package/src/app/GrantNotices.tsx +7 -2
- package/src/app/HostsRoutes.tsx +55 -17
- package/src/app/OnboardingRoute.tsx +15 -4
- package/src/app/SessionSharingRoute.tsx +25 -13
- package/src/app/TeamRoute.tsx +19 -6
- package/src/app/cloudRuntime.ts +30 -17
- package/src/app/homeState.ts +7 -3
- package/src/app/hostRuntimes.ts +22 -4
- package/src/app/liveRuntime.ts +22 -9
- package/src/app/locale.ts +57 -0
- package/src/app/pickSettingsAvatar.ts +7 -5
- package/src/app/railWorkspaces.ts +8 -2
- package/src/app/useHome.ts +9 -5
- package/src/components/ActivitySheet.tsx +57 -32
- package/src/components/ConnectCard.tsx +26 -12
- package/src/components/ContextFace.tsx +39 -16
- package/src/components/DashboardTiles.tsx +6 -2
- package/src/components/GrantNotice.tsx +10 -6
- package/src/components/RestoreCard.tsx +7 -5
- package/src/components/ResumeSheetView.tsx +11 -5
- package/src/components/SessionChoicesView.tsx +9 -2
- package/src/components/SessionOptionsSheet.tsx +75 -35
- package/src/components/SessionSheets.tsx +69 -39
- package/src/components/SocialSignInButton.tsx +2 -1
- package/src/components/TabBar.tsx +7 -1
- package/src/components/WakePeriodView.tsx +11 -7
- package/src/components/contextRows.ts +6 -1
- package/src/components/richActivity/AuthorMediaHost.tsx +13 -5
- package/src/components/richActivity/AuthorVideoTransport.tsx +20 -10
- package/src/components/richActivity/ImageViewer.tsx +5 -1
- package/src/components/richActivity/McpAppChrome.tsx +14 -11
- package/src/components/richActivity/McpAppView.tsx +25 -15
- package/src/components/richActivity/NativeAuthorCaptureSurface.tsx +3 -1
- package/src/components/richActivity/NativeAuthorHtmlView.tsx +6 -1
- package/src/components/richActivity/createRichActivityRenderers.tsx +19 -10
- package/src/screens/AccountScreen.tsx +268 -163
- package/src/screens/AppearanceScreen.tsx +84 -24
- package/src/screens/ClientDevices.tsx +8 -4
- package/src/screens/ClientDevicesView.tsx +55 -20
- package/src/screens/ContributedSettingsScreen.tsx +35 -12
- package/src/screens/GitRemoteScreen.tsx +60 -28
- package/src/screens/GlobalSettings.tsx +41 -16
- package/src/screens/HomeScreen.tsx +84 -56
- package/src/screens/HostDrawer.tsx +36 -10
- package/src/screens/HostedOnboarding.tsx +87 -43
- package/src/screens/HostsView.tsx +173 -58
- package/src/screens/ImagesScreen.tsx +33 -11
- package/src/screens/McpServersScreen.tsx +79 -38
- package/src/screens/MetricsScreen.tsx +147 -63
- package/src/screens/PairingScreen.tsx +13 -10
- package/src/screens/PluginCatalogScreen.tsx +93 -34
- package/src/screens/PluginDetailScreen.tsx +127 -42
- package/src/screens/PluginOnboardingScreen.tsx +42 -21
- package/src/screens/PresetsScreen.tsx +68 -27
- package/src/screens/ProvidersScreen.tsx +129 -53
- package/src/screens/RemoteControlScreen.tsx +69 -26
- package/src/screens/SessionListScreen.tsx +19 -7
- package/src/screens/SessionSharingView.tsx +59 -30
- package/src/screens/SettingsFields.tsx +20 -9
- package/src/screens/SettingsScreen.stories.tsx +2 -0
- package/src/screens/SettingsScreen.tsx +84 -41
- package/src/screens/TeamView.tsx +95 -44
- package/src/screens/WorkspaceProviders.tsx +36 -15
- package/src/screens/WorkspaceProvidersSection.tsx +36 -11
- package/src/screens/WorkspaceScreen.tsx +20 -13
- package/src/screens/WorkspaceSettingsScreen.tsx +177 -63
- package/src/screens/homeModel.ts +78 -30
- package/src/screens/pluginModel.tsx +5 -2
- package/src/screens/usePluginMarketplace.ts +3 -1
- package/src/services/apiTransport/index.ts +19 -5
- package/src/services/calendarTargets/index.ts +5 -1
- package/src/services/cloudHosts/index.ts +8 -4
- package/src/services/deviceTrust/index.ts +73 -34
- package/src/services/hostActions/index.ts +13 -6
- package/src/services/hostLinkBroker/index.ts +36 -16
- package/src/services/nativeAudio/index.ts +10 -4
- package/src/services/nativePush/index.ts +5 -2
- package/src/services/pairing/index.ts +28 -13
- package/src/services/settingsApi/index.ts +9 -5
- package/src/services/workspaceProviders/index.ts +13 -6
package/src/app/App.tsx
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { WORKFLOW_STEP_SESSION_PROVENANCE } from '@agimon-ai/po-core/hubChannel';
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
t,
|
|
4
|
+
useT,
|
|
5
|
+
type NativeTemplateSessionsActions,
|
|
6
|
+
type NativeTemplateSessionsProps,
|
|
7
|
+
} from '@agimon-ai/po-core/native';
|
|
3
8
|
import { NATIVE_PAIRING_LINK_PREFIX } from '@agimon-ai/po-core/remoteContract';
|
|
4
9
|
import type {
|
|
5
10
|
ComposerCapture,
|
|
@@ -285,6 +290,7 @@ import { HostBackdrop, useBackdropFills } from './HostBackdrop';
|
|
|
285
290
|
import { createHostRuntimes, type HostRuntimes, type HostRuntimeState } from './hostRuntimes';
|
|
286
291
|
import { AddHostRoute, applyAccountEvictions, HostsRoute, LinkHostsRoute } from './HostsRoutes';
|
|
287
292
|
import { type LiveRuntime } from './liveRuntime';
|
|
293
|
+
import { loadLocale, localeStore, nativeLocales, setLocalePick } from './locale';
|
|
288
294
|
import {
|
|
289
295
|
bundledNativeTemplateScreen,
|
|
290
296
|
NativeTemplateBoundary,
|
|
@@ -357,7 +363,8 @@ const SessionStack = createNativeStackNavigator<SessionRoutes>();
|
|
|
357
363
|
const BACKDROP_SCENE_PERCENT = 70;
|
|
358
364
|
const Stack = createNativeStackNavigator<Routes>();
|
|
359
365
|
const Tab = createBottomTabNavigator<TabRoutes>();
|
|
360
|
-
const
|
|
366
|
+
const hostOwnershipPending = () =>
|
|
367
|
+
t('native.app.hostOwnershipPending', 'Host-scoped Home and settings actions are not available yet.');
|
|
361
368
|
/** The longest the first frame waits for installed plugins to come back from disk. */
|
|
362
369
|
const BOOT_HOLD_MS = 1500;
|
|
363
370
|
/** The phone's hosted Po Cloud team name, which Settings shows as its Team row. */
|
|
@@ -369,12 +376,16 @@ setUiTraceSink((records) => {
|
|
|
369
376
|
|
|
370
377
|
const disconnectedBadge = new Store<HomeReadState>({ supported: null, loading: false });
|
|
371
378
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
379
|
+
// Labels read at render, so they follow the current language.
|
|
380
|
+
const TAB_ITEMS: Readonly<Record<keyof TabRoutes, () => Omit<TabBarItem, 'key' | 'badge'>>> = {
|
|
381
|
+
Home: () => ({ label: t('native.app.tab.home', 'Home'), Icon: HomeIcon }),
|
|
382
|
+
Sessions: () => ({ label: t('native.app.tab.sessions', 'Sessions'), Icon: MessageIcon }),
|
|
383
|
+
Settings: () => ({ label: t('native.app.tab.settings', 'Settings'), Icon: GearIcon }),
|
|
376
384
|
};
|
|
377
385
|
|
|
386
|
+
const settingsBack = () => t('native.app.tab.settings', 'Settings');
|
|
387
|
+
const workspacesBack = () => t('native.settings.workspaces', 'Workspaces');
|
|
388
|
+
|
|
378
389
|
/** The Po tab bar in bottom-tabs' slot. Home's badge counts sessions waiting for the person. */
|
|
379
390
|
function PoTabBar({ state, navigation, runtime }: BottomTabBarProps & { runtime?: LiveRuntime }) {
|
|
380
391
|
const supported = useStore(runtime?.home.store ?? disconnectedBadge, (value) => value.supported);
|
|
@@ -388,7 +399,7 @@ function PoTabBar({ state, navigation, runtime }: BottomTabBarProps & { runtime?
|
|
|
388
399
|
);
|
|
389
400
|
const items = state.routes.map((route) => ({
|
|
390
401
|
key: route.name,
|
|
391
|
-
...TAB_ITEMS[route.name as keyof TabRoutes],
|
|
402
|
+
...TAB_ITEMS[route.name as keyof TabRoutes](),
|
|
392
403
|
...(route.name === 'Home' ? { badge: waiting } : {}),
|
|
393
404
|
}));
|
|
394
405
|
return (
|
|
@@ -488,7 +499,7 @@ function HostDrawerRoute({
|
|
|
488
499
|
{team.data ? (
|
|
489
500
|
<RailItem
|
|
490
501
|
icon={UsersIcon}
|
|
491
|
-
label=
|
|
502
|
+
label={t('native.settings.team', 'Team')}
|
|
492
503
|
testID="team-open"
|
|
493
504
|
onPress={() => {
|
|
494
505
|
props.onClose();
|
|
@@ -520,7 +531,7 @@ function useOpenSession(): (sessionId: string) => void {
|
|
|
520
531
|
(sessionId: string) =>
|
|
521
532
|
navigation.navigate('Session', {
|
|
522
533
|
sessionId,
|
|
523
|
-
title: sessionsStore.state.byId[sessionId]?.summary.name || 'Session',
|
|
534
|
+
title: sessionsStore.state.byId[sessionId]?.summary.name || t('native.app.session', 'Session'),
|
|
524
535
|
}),
|
|
525
536
|
[navigation],
|
|
526
537
|
);
|
|
@@ -533,7 +544,7 @@ function useOpenWorkspace(hostId?: string): (workspaceId: string) => void {
|
|
|
533
544
|
const workspaceId = splitHostId(id) || hostId === undefined ? id : qualifyHostId(hostId, id);
|
|
534
545
|
navigation.navigate('Workspace', {
|
|
535
546
|
workspaceId,
|
|
536
|
-
title: workspacesStore.state.byId[workspaceId]?.name || 'Workspace',
|
|
547
|
+
title: workspacesStore.state.byId[workspaceId]?.name || t('native.app.workspace', 'Workspace'),
|
|
537
548
|
});
|
|
538
549
|
},
|
|
539
550
|
[navigation, hostId],
|
|
@@ -558,7 +569,7 @@ function useSessionList(hosts: readonly HostRuntimeState[]): SessionSummary[] {
|
|
|
558
569
|
return [
|
|
559
570
|
{
|
|
560
571
|
id,
|
|
561
|
-
title: summary.name || 'Session',
|
|
572
|
+
title: summary.name || t('native.app.session', 'Session'),
|
|
562
573
|
preview:
|
|
563
574
|
workspaces.find((workspace) => workspace.id === summary.workspaceId)?.kind === 'session'
|
|
564
575
|
? undefined
|
|
@@ -603,7 +614,7 @@ function LiveSessionScreen({
|
|
|
603
614
|
// screen came back into focus. A dialog an options sheet claimed is that sheet's own step.
|
|
604
615
|
useEffect(() => {
|
|
605
616
|
if (askId === undefined) return undefined;
|
|
606
|
-
yieldSheets('Po needs your answer below. Close this sheet to reply.');
|
|
617
|
+
yieldSheets(t('native.app.answerBelow', 'Po needs your answer below. Close this sheet to reply.'));
|
|
607
618
|
return () => yieldSheets(undefined);
|
|
608
619
|
}, [askId]);
|
|
609
620
|
const raw = useStore(store, (state) => (ownDialog ? state.entries : undefined));
|
|
@@ -624,8 +635,8 @@ function LiveSessionScreen({
|
|
|
624
635
|
options:
|
|
625
636
|
ownDialog.method === 'confirm'
|
|
626
637
|
? [
|
|
627
|
-
{ id: 'yes', label: 'Yes' },
|
|
628
|
-
{ id: 'no', label: 'No' },
|
|
638
|
+
{ id: 'yes', label: t('native.common.yes', 'Yes') },
|
|
639
|
+
{ id: 'no', label: t('native.common.no', 'No') },
|
|
629
640
|
]
|
|
630
641
|
: ownDialog.options.map((option) => ({ id: option, label: option })),
|
|
631
642
|
};
|
|
@@ -645,7 +656,7 @@ function LiveSessionScreen({
|
|
|
645
656
|
else answerDialogValue(askId, optionId, sessionId);
|
|
646
657
|
}),
|
|
647
658
|
onCancel: (askId: string) => reply(askId, () => cancelDialog(askId, sessionId)),
|
|
648
|
-
...(unsent === ask.id ? { promptError: 'Not sent. Reconnect and try again.' } : {}),
|
|
659
|
+
...(unsent === ask.id ? { promptError: t('native.app.notSent', 'Not sent. Reconnect and try again.') } : {}),
|
|
649
660
|
dialogValue: draft.value,
|
|
650
661
|
onDialogValueChange: (value: string) => updateDialogDraft(sessionId, ownDialog, { value }),
|
|
651
662
|
promptInput: {
|
|
@@ -674,6 +685,14 @@ function LiveSessionScreen({
|
|
|
674
685
|
);
|
|
675
686
|
}
|
|
676
687
|
|
|
688
|
+
function SessionTabTitle({ tab }: { tab: Pick<TransientTab, 'label' | 'translateLabel'> }) {
|
|
689
|
+
const t = useT();
|
|
690
|
+
return (
|
|
691
|
+
<Text style={styles.headerName} numberOfLines={1}>
|
|
692
|
+
{tab.translateLabel?.(t) ?? tab.label}
|
|
693
|
+
</Text>
|
|
694
|
+
);
|
|
695
|
+
}
|
|
677
696
|
function SessionRoute({
|
|
678
697
|
route,
|
|
679
698
|
navigation,
|
|
@@ -709,6 +728,7 @@ function SessionRoute({
|
|
|
709
728
|
nativeHost?: (sessionId: string) => NativeSlotHost;
|
|
710
729
|
}) {
|
|
711
730
|
useRenderTrace('SessionRoute');
|
|
731
|
+
const t = useT();
|
|
712
732
|
const { sessionId: ownerSessionId } = route.params;
|
|
713
733
|
const focused = useIsFocused();
|
|
714
734
|
const [foreground, setForeground] = useState(AppState.currentState === 'active');
|
|
@@ -843,7 +863,9 @@ function SessionRoute({
|
|
|
843
863
|
style={styles.headerAvatar}
|
|
844
864
|
accessible={canOpenProfile}
|
|
845
865
|
accessibilityRole={canOpenProfile ? 'button' : undefined}
|
|
846
|
-
accessibilityLabel={
|
|
866
|
+
accessibilityLabel={
|
|
867
|
+
canOpenProfile ? t('native.app.openProfile', 'Open profile for {agent}', { agent }) : undefined
|
|
868
|
+
}
|
|
847
869
|
importantForAccessibility={canOpenProfile ? 'auto' : 'no-hide-descendants'}
|
|
848
870
|
accessibilityElementsHidden={!canOpenProfile}
|
|
849
871
|
disabled={!canOpenProfile}
|
|
@@ -898,10 +920,10 @@ function SessionRoute({
|
|
|
898
920
|
size="icon"
|
|
899
921
|
accessibilityLabel={
|
|
900
922
|
waiting > 0
|
|
901
|
-
?
|
|
923
|
+
? t('native.app.activity.waiting', 'Activity, {count} waiting for you', { count: String(waiting) })
|
|
902
924
|
: busy
|
|
903
|
-
? 'Activity, work running'
|
|
904
|
-
: 'Activity'
|
|
925
|
+
? t('native.app.activity.running', 'Activity, work running')
|
|
926
|
+
: t('native.app.activity', 'Activity')
|
|
905
927
|
}
|
|
906
928
|
onPress={() => setActivityOpen(true)}
|
|
907
929
|
>
|
|
@@ -962,7 +984,9 @@ function SessionRoute({
|
|
|
962
984
|
setWaking(true);
|
|
963
985
|
setWakeError(undefined);
|
|
964
986
|
void onWake(sessionId, { silent: true })
|
|
965
|
-
.catch((error: unknown) =>
|
|
987
|
+
.catch((error: unknown) =>
|
|
988
|
+
setWakeError(messageOf(error, t('native.app.wakeFailed', 'Po could not wake this session.'))),
|
|
989
|
+
)
|
|
966
990
|
.finally(() => setWaking(false));
|
|
967
991
|
}, [
|
|
968
992
|
focused,
|
|
@@ -987,7 +1011,9 @@ function SessionRoute({
|
|
|
987
1011
|
setWaking(true);
|
|
988
1012
|
setWakeError(undefined);
|
|
989
1013
|
onWake(sessionId)
|
|
990
|
-
.catch((error: unknown) =>
|
|
1014
|
+
.catch((error: unknown) =>
|
|
1015
|
+
setWakeError(messageOf(error, t('native.app.wakeFailed', 'Po could not wake this session.'))),
|
|
1016
|
+
)
|
|
991
1017
|
.finally(() => setWaking(false));
|
|
992
1018
|
};
|
|
993
1019
|
// Dictation and rewind hand text to the composer through the session. Only requests that arrive
|
|
@@ -1118,7 +1144,7 @@ function SessionRoute({
|
|
|
1118
1144
|
openSettings: (section) => {
|
|
1119
1145
|
const owner = splitHostId(sessionId)?.hostId;
|
|
1120
1146
|
if (!owner && !allowGlobalActions) {
|
|
1121
|
-
Alert.alert('Settings',
|
|
1147
|
+
Alert.alert(t('native.app.tab.settings', 'Settings'), hostOwnershipPending());
|
|
1122
1148
|
return;
|
|
1123
1149
|
}
|
|
1124
1150
|
if (section === 'providers') navigation.navigate('SettingsProviders', owner ? { hostId: owner } : undefined);
|
|
@@ -1257,7 +1283,7 @@ function SessionRoute({
|
|
|
1257
1283
|
// Background stack screens keep their tabs mounted; only the selected one shows the sheet.
|
|
1258
1284
|
conversationOpen: conversationOpen && tab.id === selectedTabId,
|
|
1259
1285
|
onConversationOpenChange: setConversationOpen,
|
|
1260
|
-
asideLabel: tab.label,
|
|
1286
|
+
asideLabel: ('translateLabel' in tab ? tab.translateLabel?.(t) : undefined) ?? tab.label,
|
|
1261
1287
|
}
|
|
1262
1288
|
: {})}
|
|
1263
1289
|
sessionId={sessionId}
|
|
@@ -1318,8 +1344,12 @@ function SessionRoute({
|
|
|
1318
1344
|
size="icon"
|
|
1319
1345
|
accessibilityLabel={
|
|
1320
1346
|
elsewhere > 0
|
|
1321
|
-
?
|
|
1322
|
-
|
|
1347
|
+
? elsewhere === 1
|
|
1348
|
+
? t('native.app.back.waitingOne', 'Back, 1 other session waiting for you')
|
|
1349
|
+
: t('native.app.back.waitingMany', 'Back, {count} other sessions waiting for you', {
|
|
1350
|
+
count: String(elsewhere),
|
|
1351
|
+
})
|
|
1352
|
+
: t('native.common.back', 'Back')
|
|
1323
1353
|
}
|
|
1324
1354
|
onPress={() => navigation.goBack()}
|
|
1325
1355
|
>
|
|
@@ -1341,14 +1371,18 @@ function SessionRoute({
|
|
|
1341
1371
|
<SessionStack.Screen
|
|
1342
1372
|
name="ActivityDetail"
|
|
1343
1373
|
getId={({ params }) => params.tabId}
|
|
1344
|
-
options={({ route: detail }) =>
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1374
|
+
options={({ route: detail }) => {
|
|
1375
|
+
const tab = transientTabs.find((tab) => tab.id === detail.params.tabId);
|
|
1376
|
+
return {
|
|
1377
|
+
title:
|
|
1378
|
+
tab?.translateLabel?.(t) ??
|
|
1379
|
+
tab?.label ??
|
|
1380
|
+
webTabs(ownerSessionId).find((tab) => tab.id === detail.params.tabId)?.label ??
|
|
1381
|
+
t('native.app.activity', 'Activity'),
|
|
1382
|
+
// iOS 26 defaults to a whole-screen back swipe, which steals drags on Author canvases; keep the edge swipe.
|
|
1383
|
+
fullScreenGestureEnabled: false,
|
|
1384
|
+
};
|
|
1385
|
+
}}
|
|
1352
1386
|
listeners={({ route: detail }) => ({
|
|
1353
1387
|
beforeRemove: () => {
|
|
1354
1388
|
tabHeaders.current.delete(detail.params.tabId);
|
|
@@ -1366,21 +1400,21 @@ function SessionRoute({
|
|
|
1366
1400
|
<EmptyState
|
|
1367
1401
|
size="page"
|
|
1368
1402
|
tone="error"
|
|
1369
|
-
title=
|
|
1370
|
-
description=
|
|
1371
|
-
|
|
1403
|
+
title={t('native.app.activityGone', 'This activity is no longer available')}
|
|
1404
|
+
description={t(
|
|
1405
|
+
'native.app.activityGone.hint',
|
|
1406
|
+
'It closed or finished. The conversation keeps everything it produced.',
|
|
1407
|
+
)}
|
|
1408
|
+
action={{ label: t('native.common.goBack', 'Go back'), onAction: () => child.goBack() }}
|
|
1372
1409
|
/>
|
|
1373
1410
|
);
|
|
1374
1411
|
let setTabHeader = tabHeaders.current.get(tab.id);
|
|
1375
1412
|
if (!setTabHeader) {
|
|
1376
|
-
const label = tab.label;
|
|
1377
1413
|
setTabHeader = (header) =>
|
|
1378
1414
|
child.setOptions({
|
|
1379
1415
|
headerTitle: () => (
|
|
1380
1416
|
<View style={styles.headerTitle}>
|
|
1381
|
-
<
|
|
1382
|
-
{label}
|
|
1383
|
-
</Text>
|
|
1417
|
+
<SessionTabTitle tab={tab} />
|
|
1384
1418
|
{header.subtitle ? (
|
|
1385
1419
|
<Text style={styles.headerStatus('quiet')} numberOfLines={1}>
|
|
1386
1420
|
{header.subtitle}
|
|
@@ -1446,7 +1480,10 @@ function SettingsRoute(
|
|
|
1446
1480
|
const chosen = props.computers?.find(({ id }) => id === settingsHost);
|
|
1447
1481
|
// A named computer replaces the implicit current session; a computer offline answers nothing.
|
|
1448
1482
|
const allowed = settingsHost !== undefined ? chosen?.online !== false : props.allowGlobalActions;
|
|
1449
|
-
const refused =
|
|
1483
|
+
const refused =
|
|
1484
|
+
chosen && !chosen.online
|
|
1485
|
+
? t('native.app.computerOffline', '{name} is offline.', { name: chosen.label })
|
|
1486
|
+
: hostOwnershipPending();
|
|
1450
1487
|
const installedPlugins =
|
|
1451
1488
|
settingsHost === undefined ? installedWebPlugins() : webPluginRegistryForHost(settingsHost).installedWebPlugins();
|
|
1452
1489
|
// A curated plugin's pages live on its own Plugins screen, so Settings leaves them out.
|
|
@@ -1512,7 +1549,10 @@ function SettingsRoute(
|
|
|
1512
1549
|
const openPanel = (id: string, owner = settingsHost) => {
|
|
1513
1550
|
const computer = props.computers?.find((candidate) => candidate.id === owner);
|
|
1514
1551
|
if (owner === undefined ? !allowed : computer?.online === false) {
|
|
1515
|
-
Alert.alert(
|
|
1552
|
+
Alert.alert(
|
|
1553
|
+
t('native.app.tab.settings', 'Settings'),
|
|
1554
|
+
computer ? t('native.app.computerOffline', '{name} is offline.', { name: computer.label }) : refused,
|
|
1555
|
+
);
|
|
1516
1556
|
return;
|
|
1517
1557
|
}
|
|
1518
1558
|
const panel = (owner === settingsHost ? panels : panelGroups.find((group) => group.hostId === owner)?.panels)?.find(
|
|
@@ -1564,7 +1604,7 @@ function SettingsRoute(
|
|
|
1564
1604
|
const section = sections.find((candidate) => candidate.id === id);
|
|
1565
1605
|
if (section === undefined) return;
|
|
1566
1606
|
if (!allowed) {
|
|
1567
|
-
Alert.alert('Settings', refused);
|
|
1607
|
+
Alert.alert(t('native.app.tab.settings', 'Settings'), refused);
|
|
1568
1608
|
return;
|
|
1569
1609
|
}
|
|
1570
1610
|
navigation.navigate('SettingsSection', {
|
|
@@ -1580,7 +1620,7 @@ function SettingsRoute(
|
|
|
1580
1620
|
return;
|
|
1581
1621
|
}
|
|
1582
1622
|
if (!allowed) {
|
|
1583
|
-
Alert.alert('Settings', refused);
|
|
1623
|
+
Alert.alert(t('native.app.tab.settings', 'Settings'), refused);
|
|
1584
1624
|
return;
|
|
1585
1625
|
}
|
|
1586
1626
|
navigation.navigate(section, settingsHost === undefined ? undefined : { hostId: settingsHost });
|
|
@@ -1628,9 +1668,9 @@ function SettingsPanelRoute({ route }: NativeStackScreenProps<Routes, 'SettingsP
|
|
|
1628
1668
|
<EmptyState
|
|
1629
1669
|
size="page"
|
|
1630
1670
|
tone="error"
|
|
1631
|
-
title=
|
|
1632
|
-
description=
|
|
1633
|
-
action={{ label: 'Go back', onAction: () => navigation.goBack() }}
|
|
1671
|
+
title={t('native.app.pageMissing', 'This page is not installed')}
|
|
1672
|
+
description={t('native.app.pageMissing.hint', 'The plugin that adds it is off or not on this computer.')}
|
|
1673
|
+
action={{ label: t('native.common.goBack', 'Go back'), onAction: () => navigation.goBack() }}
|
|
1634
1674
|
/>
|
|
1635
1675
|
);
|
|
1636
1676
|
const Panel = panel.component;
|
|
@@ -1688,9 +1728,9 @@ function McpServersRoute({ route }: NativeStackScreenProps<Routes, 'SettingsMcp'
|
|
|
1688
1728
|
}
|
|
1689
1729
|
|
|
1690
1730
|
const WORKSPACE_PAGES = {
|
|
1691
|
-
defaults: { route: 'SettingsWorkspaceDefaults', title: 'Defaults' },
|
|
1692
|
-
git: { route: 'SettingsWorkspaceGit', title: 'Git remote' },
|
|
1693
|
-
mcp: { route: 'SettingsWorkspaceMcp', title: 'MCP servers' },
|
|
1731
|
+
defaults: { route: 'SettingsWorkspaceDefaults', title: () => t('native.app.workspace.defaults', 'Defaults') },
|
|
1732
|
+
git: { route: 'SettingsWorkspaceGit', title: () => t('native.app.workspace.git', 'Git remote') },
|
|
1733
|
+
mcp: { route: 'SettingsWorkspaceMcp', title: () => t('native.settings.mcpServers', 'MCP servers') },
|
|
1694
1734
|
} as const;
|
|
1695
1735
|
|
|
1696
1736
|
function WorkspaceSettingsRoute({ route }: NativeStackScreenProps<Routes, 'SettingsWorkspaces'>) {
|
|
@@ -1712,7 +1752,7 @@ function WorkspaceSettingsRoute({ route }: NativeStackScreenProps<Routes, 'Setti
|
|
|
1712
1752
|
return;
|
|
1713
1753
|
}
|
|
1714
1754
|
const { route: name, title } = WORKSPACE_PAGES[page.page];
|
|
1715
|
-
navigation.navigate(name, { repositoryId: repository.id, repoRoot: repository.path, title, ...host });
|
|
1755
|
+
navigation.navigate(name, { repositoryId: repository.id, repoRoot: repository.path, title: title(), ...host });
|
|
1716
1756
|
}}
|
|
1717
1757
|
/>
|
|
1718
1758
|
);
|
|
@@ -1789,10 +1829,16 @@ function PluginRoute({ navigation, route }: NativeStackScreenProps<Routes, 'Sett
|
|
|
1789
1829
|
if (plugin === undefined) {
|
|
1790
1830
|
return (
|
|
1791
1831
|
<SectionPage>
|
|
1792
|
-
<Group label=
|
|
1832
|
+
<Group label={t('native.app.plugin', 'Plugin')}>
|
|
1793
1833
|
<StateRow
|
|
1794
|
-
title={
|
|
1795
|
-
|
|
1834
|
+
title={
|
|
1835
|
+
market.status === 'loading'
|
|
1836
|
+
? t('native.app.plugin.reading', 'Reading the catalog')
|
|
1837
|
+
: t('native.app.plugin.missing', "This plugin isn't here")
|
|
1838
|
+
}
|
|
1839
|
+
description={
|
|
1840
|
+
market.error ?? t('native.app.plugin.missing.hint', 'It is not in the catalog on this computer.')
|
|
1841
|
+
}
|
|
1796
1842
|
onRetry={() => void market.reload()}
|
|
1797
1843
|
/>
|
|
1798
1844
|
</Group>
|
|
@@ -1823,7 +1869,11 @@ function PluginRoute({ navigation, route }: NativeStackScreenProps<Routes, 'Sett
|
|
|
1823
1869
|
onTogglePreset={(preset, on) => void (on ? market.join(plugin, preset) : market.leave(id, [preset]))}
|
|
1824
1870
|
onOpenPreset={openPresets}
|
|
1825
1871
|
onManageDomains={() =>
|
|
1826
|
-
navigation.navigate('SettingsPanel', {
|
|
1872
|
+
navigation.navigate('SettingsPanel', {
|
|
1873
|
+
id: 'plugins',
|
|
1874
|
+
title: t('native.app.plugin.domains', 'Codex and Claude plugins'),
|
|
1875
|
+
hostId,
|
|
1876
|
+
})
|
|
1827
1877
|
}
|
|
1828
1878
|
/>
|
|
1829
1879
|
{/* ponytail: no plugin ships a `.native` onboarding yet, so the sheet always says to finish on the web.
|
|
@@ -1864,18 +1914,25 @@ function PresetsRoute({ route }: NativeStackScreenProps<Routes, 'SettingsPresets
|
|
|
1864
1914
|
onStartCreate={() => setDraft({ name: '' })}
|
|
1865
1915
|
onCreate={() => {
|
|
1866
1916
|
const name = draft?.name.trim() ?? '';
|
|
1867
|
-
if (name === '') return setDraft({ name: '', error: 'Give it a name.' });
|
|
1917
|
+
if (name === '') return setDraft({ name: '', error: t('native.app.preset.nameRequired', 'Give it a name.') });
|
|
1868
1918
|
void market.create(name).then((result) => setDraft(result.ok ? undefined : { name, error: result.error }));
|
|
1869
1919
|
}}
|
|
1870
1920
|
onCancelCreate={() => setDraft(undefined)}
|
|
1871
1921
|
onOpenPreset={(preset) =>
|
|
1872
1922
|
Alert.alert(preset.name, preset.description || undefined, [
|
|
1873
|
-
...(preset.isDefault
|
|
1923
|
+
...(preset.isDefault
|
|
1924
|
+
? []
|
|
1925
|
+
: [
|
|
1926
|
+
{
|
|
1927
|
+
text: t('native.app.preset.makeDefault', 'Make default'),
|
|
1928
|
+
onPress: () => void market.makeDefault(preset.name),
|
|
1929
|
+
},
|
|
1930
|
+
]),
|
|
1874
1931
|
...(preset.inherited
|
|
1875
1932
|
? []
|
|
1876
1933
|
: [
|
|
1877
1934
|
{
|
|
1878
|
-
text: 'Delete',
|
|
1935
|
+
text: t('native.common.delete', 'Delete'),
|
|
1879
1936
|
style: 'destructive' as const,
|
|
1880
1937
|
onPress: () =>
|
|
1881
1938
|
void market.remove(preset.name).then((result) => {
|
|
@@ -1883,7 +1940,7 @@ function PresetsRoute({ route }: NativeStackScreenProps<Routes, 'SettingsPresets
|
|
|
1883
1940
|
}),
|
|
1884
1941
|
},
|
|
1885
1942
|
]),
|
|
1886
|
-
{ text: 'Cancel', style: 'cancel' as const },
|
|
1943
|
+
{ text: t('native.common.cancel', 'Cancel'), style: 'cancel' as const },
|
|
1887
1944
|
])
|
|
1888
1945
|
}
|
|
1889
1946
|
{...(blocked === undefined ? {} : { blocked })}
|
|
@@ -1903,9 +1960,9 @@ function ContributedSectionRoute({ route, navigation }: NativeStackScreenProps<R
|
|
|
1903
1960
|
<EmptyState
|
|
1904
1961
|
size="page"
|
|
1905
1962
|
tone="error"
|
|
1906
|
-
title=
|
|
1907
|
-
description=
|
|
1908
|
-
action={{ label: 'Go back', onAction: () => navigation.goBack() }}
|
|
1963
|
+
title={t('native.app.pageMissing', 'This page is not installed')}
|
|
1964
|
+
description={t('native.app.pageMissing.hint', 'The plugin that adds it is off or not on this computer.')}
|
|
1965
|
+
action={{ label: t('native.common.goBack', 'Go back'), onAction: () => navigation.goBack() }}
|
|
1909
1966
|
/>
|
|
1910
1967
|
);
|
|
1911
1968
|
return <ContributedSection section={section} workspace={workspace} hostId={hostId} />;
|
|
@@ -1956,6 +2013,7 @@ function AppearanceRoute() {
|
|
|
1956
2013
|
hostId,
|
|
1957
2014
|
);
|
|
1958
2015
|
useSyncExternalStore(subscribeWebPluginRegistry, webPluginRegistryRevision);
|
|
2016
|
+
const locale = useStore(localeStore, (pick) => pick);
|
|
1959
2017
|
const mount =
|
|
1960
2018
|
model.target === 'global'
|
|
1961
2019
|
? ({ scope: 'host' } as const)
|
|
@@ -1969,6 +2027,9 @@ function AppearanceRoute() {
|
|
|
1969
2027
|
<AppearanceScreen
|
|
1970
2028
|
theme={theme}
|
|
1971
2029
|
onTheme={setAppearance}
|
|
2030
|
+
{...(locale === undefined ? {} : { locale })}
|
|
2031
|
+
locales={nativeLocales()}
|
|
2032
|
+
onLocale={setLocalePick}
|
|
1972
2033
|
repositories={repositories}
|
|
1973
2034
|
templates={catalog.templates.map(({ id, label, description, pluginId }) => ({
|
|
1974
2035
|
id,
|
|
@@ -1986,7 +2047,8 @@ function RemoteControlRoute({ route }: NativeStackScreenProps<Routes, 'SettingsR
|
|
|
1986
2047
|
}
|
|
1987
2048
|
|
|
1988
2049
|
/** The selected `native.template` session list, or the built-in one when none is chosen, installed, or healthy. */
|
|
1989
|
-
const
|
|
2050
|
+
const notYetVisible = () =>
|
|
2051
|
+
t('native.app.notYetVisible', 'The session was created but has not appeared yet; it will show up in the list.');
|
|
1990
2052
|
|
|
1991
2053
|
/** The Sessions tab: the title's action belongs to whichever list is showing, so it lives here. */
|
|
1992
2054
|
/**
|
|
@@ -2037,7 +2099,12 @@ function SessionsTab({
|
|
|
2037
2099
|
const sessions = useSessionList(hostStates);
|
|
2038
2100
|
const [headerAction, setHeaderAction] = useState<ReactNode>(null);
|
|
2039
2101
|
return (
|
|
2040
|
-
<TabPage
|
|
2102
|
+
<TabPage
|
|
2103
|
+
title={t('native.app.tab.sessions', 'Sessions')}
|
|
2104
|
+
rail
|
|
2105
|
+
action={pairing ? null : headerAction}
|
|
2106
|
+
hostMenu={hostMenu}
|
|
2107
|
+
>
|
|
2041
2108
|
{pairing ?? (
|
|
2042
2109
|
<SessionsRoute
|
|
2043
2110
|
sessions={sessions}
|
|
@@ -2100,7 +2167,7 @@ function SessionsRoute({
|
|
|
2100
2167
|
async (owner: string, localId: string): Promise<string | undefined> => {
|
|
2101
2168
|
const hostId = splitHostId(owner)?.hostId;
|
|
2102
2169
|
const sessionId = hostId === undefined ? localId : qualifyHostId(hostId, localId);
|
|
2103
|
-
if (!(await waitForSession(sessionId))) return
|
|
2170
|
+
if (!(await waitForSession(sessionId))) return notYetVisible();
|
|
2104
2171
|
setNewSession(null);
|
|
2105
2172
|
setResume(null);
|
|
2106
2173
|
onOpen(sessionId);
|
|
@@ -2115,7 +2182,9 @@ function SessionsRoute({
|
|
|
2115
2182
|
? allowGlobalActions
|
|
2116
2183
|
: hostStates.some(({ host, status }) => host.id === owner && status === 'connected');
|
|
2117
2184
|
};
|
|
2118
|
-
const unavailable = {
|
|
2185
|
+
const unavailable = {
|
|
2186
|
+
error: t('native.app.computerUnavailable', 'This computer is unavailable. Last known sessions are read-only.'),
|
|
2187
|
+
};
|
|
2119
2188
|
/** A Po Cloud host answers over cookie-admitted HTTP, not the sealed hub routes. */
|
|
2120
2189
|
const cloudHostFor = (id: string): CloudHostRecord | undefined => {
|
|
2121
2190
|
const owner = splitHostId(id)?.hostId;
|
|
@@ -2127,13 +2196,13 @@ function SessionsRoute({
|
|
|
2127
2196
|
const createCoordinator = async (workspaceId?: string, explicitHostId?: string) => {
|
|
2128
2197
|
const workspaceHostId = workspaceId === undefined ? undefined : splitHostId(workspaceId)?.hostId;
|
|
2129
2198
|
if (workspaceHostId && explicitHostId && workspaceHostId !== explicitHostId)
|
|
2130
|
-
return { error: 'The workspace belongs to another computer.' };
|
|
2199
|
+
return { error: t('native.app.workspaceElsewhere', 'The workspace belongs to another computer.') };
|
|
2131
2200
|
const hostId =
|
|
2132
2201
|
workspaceHostId ??
|
|
2133
2202
|
explicitHostId ??
|
|
2134
2203
|
actionHostId ??
|
|
2135
2204
|
(hostStates.length === 1 ? hostStates[0]?.host.id : undefined);
|
|
2136
|
-
if (!hostId) return { error:
|
|
2205
|
+
if (!hostId) return { error: hostOwnershipPending() };
|
|
2137
2206
|
const owner = workspaceId ?? qualifyHostId(hostId, 'home');
|
|
2138
2207
|
if (!canMutate(owner)) return unavailable;
|
|
2139
2208
|
const cloud = cloudHostFor(owner);
|
|
@@ -2227,7 +2296,7 @@ function SessionsRoute({
|
|
|
2227
2296
|
return Promise.resolve({
|
|
2228
2297
|
error: `"${name}" is a group on more than one computer. Change it from Po on each computer.`,
|
|
2229
2298
|
});
|
|
2230
|
-
return allowGlobalActions ? run() : Promise.resolve({ error:
|
|
2299
|
+
return allowGlobalActions ? run() : Promise.resolve({ error: hostOwnershipPending() });
|
|
2231
2300
|
};
|
|
2232
2301
|
const sharingAvailable =
|
|
2233
2302
|
sharing !== null &&
|
|
@@ -2243,7 +2312,10 @@ function SessionsRoute({
|
|
|
2243
2312
|
const summary = sessionsStore.state.byId[sessionId]?.summary;
|
|
2244
2313
|
const hostId = splitHostId(sessionId)?.hostId ?? actionHostId;
|
|
2245
2314
|
if (!summary?.workspaceId || !hostId) {
|
|
2246
|
-
Alert.alert(
|
|
2315
|
+
Alert.alert(
|
|
2316
|
+
t('native.app.sharingUnavailable', 'Sharing unavailable'),
|
|
2317
|
+
t('native.app.sharingUnavailable.message', 'This session has no workspace or connected computer.'),
|
|
2318
|
+
);
|
|
2247
2319
|
return;
|
|
2248
2320
|
}
|
|
2249
2321
|
const host = hostStates.find((entry) => entry.host.id === hostId)?.host;
|
|
@@ -2251,8 +2323,8 @@ function SessionsRoute({
|
|
|
2251
2323
|
sessionId,
|
|
2252
2324
|
workspaceId: summary.workspaceId,
|
|
2253
2325
|
hostId,
|
|
2254
|
-
name: summary.name || 'Untitled',
|
|
2255
|
-
hostName: host?.displayName ?? 'This computer',
|
|
2326
|
+
name: summary.name || t('native.app.untitled', 'Untitled'),
|
|
2327
|
+
hostName: host?.displayName ?? t('native.app.thisComputer', 'This computer'),
|
|
2256
2328
|
});
|
|
2257
2329
|
},
|
|
2258
2330
|
renameSession(sessionId, name) {
|
|
@@ -2274,7 +2346,7 @@ function SessionsRoute({
|
|
|
2274
2346
|
? sessionMoveTarget(summary, workspacesStore.state.byId, workspacesStore.state.order)
|
|
2275
2347
|
: undefined;
|
|
2276
2348
|
if (!target || target.blocked || !target.destinations.some((workspace) => workspace.id === workspaceId))
|
|
2277
|
-
return { error: 'This session cannot move to that workspace now.' };
|
|
2349
|
+
return { error: t('native.app.moveBlocked', 'This session cannot move to that workspace now.') };
|
|
2278
2350
|
const result = await moveSession(sessionId, workspaceId);
|
|
2279
2351
|
if ('error' in result) return result;
|
|
2280
2352
|
if (result.session) applySessionUpsert({ session: result.session }, splitHostId(sessionId)?.hostId);
|
|
@@ -2284,7 +2356,7 @@ function SessionsRoute({
|
|
|
2284
2356
|
restartSession(sessionId) {
|
|
2285
2357
|
if (!canMutate(sessionId)) return;
|
|
2286
2358
|
void restartSession(sessionId).then((result) => {
|
|
2287
|
-
if (result && 'error' in result) Alert.alert('Restart failed', result.error);
|
|
2359
|
+
if (result && 'error' in result) Alert.alert(t('native.app.restartFailed', 'Restart failed'), result.error);
|
|
2288
2360
|
});
|
|
2289
2361
|
},
|
|
2290
2362
|
async removeSession(sessionId) {
|
|
@@ -2296,7 +2368,7 @@ function SessionsRoute({
|
|
|
2296
2368
|
const pending = cloud ? deleteCloudSession(cloud, sessionId) : stopSession(sessionId);
|
|
2297
2369
|
applySessionRemoved({ sessionId });
|
|
2298
2370
|
const result = await pending.catch((error: unknown) => ({
|
|
2299
|
-
error: error instanceof Error ? error.message : 'Could not remove the session.',
|
|
2371
|
+
error: error instanceof Error ? error.message : t('native.app.removeFailed', 'Could not remove the session.'),
|
|
2300
2372
|
}));
|
|
2301
2373
|
if (result !== undefined && previous && sessionsStore.state.byId[sessionId] === undefined)
|
|
2302
2374
|
applySessionUpsert({ session: previous });
|
|
@@ -2337,7 +2409,7 @@ function SessionsRoute({
|
|
|
2337
2409
|
return undefined;
|
|
2338
2410
|
},
|
|
2339
2411
|
async addWorkspace({ name, path, instructions }) {
|
|
2340
|
-
if (actionHostId === undefined) return { error:
|
|
2412
|
+
if (actionHostId === undefined) return { error: hostOwnershipPending() };
|
|
2341
2413
|
const hostId = actionHostId;
|
|
2342
2414
|
const result = await admitWorkspace(
|
|
2343
2415
|
{
|
|
@@ -2355,10 +2427,10 @@ function SessionsRoute({
|
|
|
2355
2427
|
discoverWorkspaces: (path) =>
|
|
2356
2428
|
actionHostId !== undefined
|
|
2357
2429
|
? discoverWorkspaces(path, actionHostId)
|
|
2358
|
-
: Promise.resolve({ error:
|
|
2430
|
+
: Promise.resolve({ error: hostOwnershipPending() }),
|
|
2359
2431
|
async addDeclaredWorkspaces(input) {
|
|
2360
2432
|
if (actionHostId === undefined)
|
|
2361
|
-
return { results: input.names.map((name) => ({ name, error:
|
|
2433
|
+
return { results: input.names.map((name) => ({ name, error: hostOwnershipPending() })) };
|
|
2362
2434
|
const hostId = actionHostId;
|
|
2363
2435
|
const { results } = await admitDeclaredWorkspaces(input, hostId);
|
|
2364
2436
|
return {
|
|
@@ -2373,7 +2445,7 @@ function SessionsRoute({
|
|
|
2373
2445
|
listDirectory: (path) =>
|
|
2374
2446
|
actionHostId !== undefined
|
|
2375
2447
|
? listDirectory(path, actionHostId)
|
|
2376
|
-
: Promise.resolve({ error:
|
|
2448
|
+
: Promise.resolve({ error: hostOwnershipPending() }),
|
|
2377
2449
|
setSessionGroups: (id, groups) =>
|
|
2378
2450
|
canMutate(id)
|
|
2379
2451
|
? withSummaryChange(
|
|
@@ -2388,7 +2460,8 @@ function SessionsRoute({
|
|
|
2388
2460
|
async removePendingSetup(sessionId, setupId) {
|
|
2389
2461
|
if (!canMutate(sessionId)) return unavailable;
|
|
2390
2462
|
const summary = sessionsStore.state.byId[sessionId]?.summary;
|
|
2391
|
-
if (summary?.workspaceId === undefined)
|
|
2463
|
+
if (summary?.workspaceId === undefined)
|
|
2464
|
+
return { error: t('native.app.noWorkspace', 'This session belongs to no workspace.') };
|
|
2392
2465
|
const setup = summary.pendingSetups?.find((entry) => entry.id === setupId);
|
|
2393
2466
|
// The package that reserved the setup owns its route; the owning computer's registry and transport carry it.
|
|
2394
2467
|
const owner = splitHostId(sessionId)?.hostId;
|
|
@@ -2403,7 +2476,8 @@ function SessionsRoute({
|
|
|
2403
2476
|
fills.map((fill) => fill.data),
|
|
2404
2477
|
setup,
|
|
2405
2478
|
);
|
|
2406
|
-
if (action === undefined)
|
|
2479
|
+
if (action === undefined)
|
|
2480
|
+
return { error: t('native.app.setupNoRemover', 'No installed package can remove this setup.') };
|
|
2407
2481
|
return action.remove(
|
|
2408
2482
|
{ workspaceId: summary.workspaceId, sessionId, setupId },
|
|
2409
2483
|
owner === undefined ? requestWithStepUp : apiTransportForHost(owner),
|
|
@@ -2426,7 +2500,7 @@ function SessionsRoute({
|
|
|
2426
2500
|
if (!canMutate(owner)) return unavailable.error;
|
|
2427
2501
|
const creation = creations.current.get(target) ?? { pending: false };
|
|
2428
2502
|
creations.current.set(target, creation);
|
|
2429
|
-
if (creation.pending) return 'Session creation is already pending.';
|
|
2503
|
+
if (creation.pending) return t('native.app.creationPending', 'Session creation is already pending.');
|
|
2430
2504
|
creation.pending = true;
|
|
2431
2505
|
try {
|
|
2432
2506
|
const cloud = cloudHostFor(owner);
|
|
@@ -2450,7 +2524,7 @@ function SessionsRoute({
|
|
|
2450
2524
|
}
|
|
2451
2525
|
return await openWhenListed(owner, creation.sessionId);
|
|
2452
2526
|
} catch (error) {
|
|
2453
|
-
return messageOf(error, 'The session could not be opened. Try again.');
|
|
2527
|
+
return messageOf(error, t('native.app.openFailed', 'The session could not be opened. Try again.'));
|
|
2454
2528
|
} finally {
|
|
2455
2529
|
creation.pending = false;
|
|
2456
2530
|
}
|
|
@@ -2461,7 +2535,7 @@ function SessionsRoute({
|
|
|
2461
2535
|
? hostId
|
|
2462
2536
|
? apiTransportForHost(hostId)(input, init)
|
|
2463
2537
|
: requestWithStepUp(input, init)
|
|
2464
|
-
: Promise.resolve(Response.json({ error:
|
|
2538
|
+
: Promise.resolve(Response.json({ error: hostOwnershipPending() }, { status: 409 })),
|
|
2465
2539
|
};
|
|
2466
2540
|
};
|
|
2467
2541
|
|
|
@@ -2476,7 +2550,7 @@ function SessionsRoute({
|
|
|
2476
2550
|
<Button
|
|
2477
2551
|
variant="ghost"
|
|
2478
2552
|
size="icon"
|
|
2479
|
-
accessibilityLabel=
|
|
2553
|
+
accessibilityLabel={t('native.app.newSession', 'New session')}
|
|
2480
2554
|
onPress={beginFallbackSession}
|
|
2481
2555
|
disabled={hostStates.length === 0 || (hostStates.length === 1 && hostStates[0]!.status !== 'connected')}
|
|
2482
2556
|
>
|
|
@@ -2540,7 +2614,7 @@ function SessionsRoute({
|
|
|
2540
2614
|
<Sheet open={choosingGeneralHost} onOpenChange={setChoosingGeneralHost}>
|
|
2541
2615
|
<SheetContent>
|
|
2542
2616
|
<SheetHeader>
|
|
2543
|
-
<SheetTitle>Start a session on</SheetTitle>
|
|
2617
|
+
<SheetTitle>{t('native.app.startSessionOn', 'Start a session on')}</SheetTitle>
|
|
2544
2618
|
</SheetHeader>
|
|
2545
2619
|
<SheetBody>
|
|
2546
2620
|
{hostStates.map(({ host, status }) => (
|
|
@@ -2607,7 +2681,13 @@ function pluginCompatibilityNotices(hostStates: readonly HostRuntimeState[]) {
|
|
|
2607
2681
|
? [
|
|
2608
2682
|
{
|
|
2609
2683
|
id: host.id,
|
|
2610
|
-
message:
|
|
2684
|
+
message: t(
|
|
2685
|
+
'native.app.updateForPlugins',
|
|
2686
|
+
'Update Po to use all plugins from {name}. Other features still work.',
|
|
2687
|
+
{
|
|
2688
|
+
name: hostDisplayName(host),
|
|
2689
|
+
},
|
|
2690
|
+
),
|
|
2611
2691
|
},
|
|
2612
2692
|
]
|
|
2613
2693
|
: [],
|
|
@@ -2630,12 +2710,15 @@ function useOpenAttention() {
|
|
|
2630
2710
|
if (!row.sessionId) return;
|
|
2631
2711
|
const session = sessionsStore.state.byId[row.sessionId]?.summary;
|
|
2632
2712
|
if (!session) {
|
|
2633
|
-
Alert.alert(
|
|
2713
|
+
Alert.alert(
|
|
2714
|
+
t('native.app.workGone', 'This work is no longer available'),
|
|
2715
|
+
t('native.app.workGone.message', 'Refresh Home to see the latest work.'),
|
|
2716
|
+
);
|
|
2634
2717
|
return;
|
|
2635
2718
|
}
|
|
2636
2719
|
navigation.navigate('Session', {
|
|
2637
2720
|
sessionId: session.id,
|
|
2638
|
-
title: session.name || 'Session',
|
|
2721
|
+
title: session.name || t('native.app.session', 'Session'),
|
|
2639
2722
|
...(row.destination ? { activity: row.destination } : {}),
|
|
2640
2723
|
});
|
|
2641
2724
|
},
|
|
@@ -3035,9 +3118,9 @@ function PluginPageRoute({
|
|
|
3035
3118
|
<EmptyState
|
|
3036
3119
|
size="page"
|
|
3037
3120
|
tone="error"
|
|
3038
|
-
title=
|
|
3039
|
-
description=
|
|
3040
|
-
action={{ label: 'Go back', onAction: () => navigation.goBack() }}
|
|
3121
|
+
title={t('native.app.pageMissing', 'This page is not installed')}
|
|
3122
|
+
description={t('native.app.pageMissing.hint', 'The plugin that adds it is off or not on this computer.')}
|
|
3123
|
+
action={{ label: t('native.common.goBack', 'Go back'), onAction: () => navigation.goBack() }}
|
|
3041
3124
|
/>
|
|
3042
3125
|
);
|
|
3043
3126
|
const props = {
|
|
@@ -3066,10 +3149,10 @@ function PluginPageRoute({
|
|
|
3066
3149
|
if (result.workspace) applyWorkspaceUpsert({ workspace: result.workspace }, pageHostId);
|
|
3067
3150
|
if (result.session) applySessionUpsert({ session: result.session }, pageHostId);
|
|
3068
3151
|
const sessionId = qualifyHostId(pageHostId, result.sessionId);
|
|
3069
|
-
if (!(await waitForSession(sessionId))) return
|
|
3152
|
+
if (!(await waitForSession(sessionId))) return notYetVisible();
|
|
3070
3153
|
navigation.navigate('Session', {
|
|
3071
3154
|
sessionId,
|
|
3072
|
-
title: sessionsStore.state.byId[sessionId]?.summary.name || 'Session',
|
|
3155
|
+
title: sessionsStore.state.byId[sessionId]?.summary.name || t('native.app.session', 'Session'),
|
|
3073
3156
|
});
|
|
3074
3157
|
return undefined;
|
|
3075
3158
|
},
|
|
@@ -3245,9 +3328,9 @@ function ConnectFirst({ restore }: { restore?: { onRestore: () => void; busy: bo
|
|
|
3245
3328
|
<EmptyState
|
|
3246
3329
|
size="page"
|
|
3247
3330
|
icon={<HomeIcon size={24} />}
|
|
3248
|
-
title=
|
|
3249
|
-
description=
|
|
3250
|
-
action={{ label: 'Go to Home', onAction: () => tabs.navigate('Home') }}
|
|
3331
|
+
title={t('native.app.notConnected', 'Not connected yet')}
|
|
3332
|
+
description={t('native.app.notConnected.hint', 'Connect this phone to Po from Home.')}
|
|
3333
|
+
action={{ label: t('native.app.goHome', 'Go to Home'), onAction: () => tabs.navigate('Home') }}
|
|
3251
3334
|
/>
|
|
3252
3335
|
);
|
|
3253
3336
|
}
|
|
@@ -3255,9 +3338,13 @@ function ConnectFirst({ restore }: { restore?: { onRestore: () => void; busy: bo
|
|
|
3255
3338
|
<EmptyState
|
|
3256
3339
|
size="page"
|
|
3257
3340
|
tone="error"
|
|
3258
|
-
title=
|
|
3259
|
-
description=
|
|
3260
|
-
action={{
|
|
3341
|
+
title={t('native.app.unreachable', 'Not connected right now')}
|
|
3342
|
+
description={t('native.app.unreachable.hint', 'This phone is paired, but Po on your computer is not reachable.')}
|
|
3343
|
+
action={{
|
|
3344
|
+
label: t('native.app.restoreConnection', 'Restore connection'),
|
|
3345
|
+
onAction: restore.onRestore,
|
|
3346
|
+
loading: restore.busy,
|
|
3347
|
+
}}
|
|
3261
3348
|
/>
|
|
3262
3349
|
);
|
|
3263
3350
|
}
|
|
@@ -3371,6 +3458,9 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3371
3458
|
useEffect(loadSentFromPhone, []);
|
|
3372
3459
|
useEffect(loadFirstSessionWelcome, []);
|
|
3373
3460
|
useEffect(loadAppearance, []);
|
|
3461
|
+
useEffect(loadLocale, []);
|
|
3462
|
+
// Titles and labels read the language at render; a new pick redraws them.
|
|
3463
|
+
useStore(localeStore, (pick) => pick);
|
|
3374
3464
|
useEffect(loadOtherWorkspacesOpen, []);
|
|
3375
3465
|
useEffect(loadSessionView, []);
|
|
3376
3466
|
useEffect(() => {
|
|
@@ -3421,13 +3511,25 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3421
3511
|
const apply = (action: () => Promise<void>) => {
|
|
3422
3512
|
void action().catch((error: unknown) => {
|
|
3423
3513
|
if (mounted)
|
|
3424
|
-
Alert.alert(
|
|
3514
|
+
Alert.alert(
|
|
3515
|
+
t('native.app.updateUnavailable', 'Update unavailable'),
|
|
3516
|
+
messageOf(error, t('native.app.updateUnavailable.message', 'Your current version is still installed.')),
|
|
3517
|
+
);
|
|
3425
3518
|
});
|
|
3426
3519
|
};
|
|
3427
|
-
Alert.alert(
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3520
|
+
Alert.alert(
|
|
3521
|
+
t('native.app.updateAvailable', 'Po update available'),
|
|
3522
|
+
t('native.app.updateAvailable.message', 'An update from {name} is ready.', {
|
|
3523
|
+
name: host.displayName || host.label,
|
|
3524
|
+
}),
|
|
3525
|
+
[
|
|
3526
|
+
{
|
|
3527
|
+
text: t('native.app.update.nextStart', 'Next app start'),
|
|
3528
|
+
onPress: () => apply(choice.installOnNextStart),
|
|
3529
|
+
},
|
|
3530
|
+
{ text: t('native.app.update.now', 'Install now'), onPress: () => apply(choice.installNow) },
|
|
3531
|
+
],
|
|
3532
|
+
);
|
|
3431
3533
|
},
|
|
3432
3534
|
});
|
|
3433
3535
|
hosts.current = manager;
|
|
@@ -3466,7 +3568,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3466
3568
|
followAccountRemovals(manager);
|
|
3467
3569
|
} catch (error) {
|
|
3468
3570
|
if (!mounted) return;
|
|
3469
|
-
const message = messageOf(error, 'Could not load saved hosts.');
|
|
3571
|
+
const message = messageOf(error, t('native.app.hostsLoadFailed', 'Could not load saved hosts.'));
|
|
3470
3572
|
setPairingError(message);
|
|
3471
3573
|
setSettingsError(message);
|
|
3472
3574
|
setPhase('pairing');
|
|
@@ -3491,7 +3593,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3491
3593
|
const sessionId = qualifyHostId(hostRef, localId);
|
|
3492
3594
|
navigation.navigate('Session', {
|
|
3493
3595
|
sessionId,
|
|
3494
|
-
title: sessionsStore.state.byId[sessionId]?.summary.name || 'Session',
|
|
3596
|
+
title: sessionsStore.state.byId[sessionId]?.summary.name || t('native.app.session', 'Session'),
|
|
3495
3597
|
});
|
|
3496
3598
|
},
|
|
3497
3599
|
});
|
|
@@ -3501,7 +3603,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3501
3603
|
const focusSession = useCallback((sessionId: string | null) => hosts.current?.open(sessionId), []);
|
|
3502
3604
|
const connectCloud = useCallback(async (host: CloudHostRecord) => {
|
|
3503
3605
|
const manager = hosts.current;
|
|
3504
|
-
if (!manager) throw new Error('Po is still starting. Try again in a moment.');
|
|
3606
|
+
if (!manager) throw new Error(t('native.app.starting', 'Po is still starting. Try again in a moment.'));
|
|
3505
3607
|
// The manager keeps a running cloud host; asking again for the same record would only restart it.
|
|
3506
3608
|
if (manager.snapshot().some((state) => state.host.id === host.id && state.runtime)) return;
|
|
3507
3609
|
// Choosing Po Cloud is the moment to ask for notifications; saved cloud hosts reconnect silently.
|
|
@@ -3539,7 +3641,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3539
3641
|
if (!mounted()) return;
|
|
3540
3642
|
const host = await loadHost(session.hostId);
|
|
3541
3643
|
if (!mounted()) return;
|
|
3542
|
-
if (!host) throw new Error('Pairing did not leave a trusted host.');
|
|
3644
|
+
if (!host) throw new Error(t('native.app.pairingNoHost', 'Pairing did not leave a trusted host.'));
|
|
3543
3645
|
await manager.connect(host, session, true);
|
|
3544
3646
|
if (active()) {
|
|
3545
3647
|
setPhase('ready');
|
|
@@ -3547,7 +3649,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3547
3649
|
}
|
|
3548
3650
|
})()
|
|
3549
3651
|
.catch((error: unknown) => {
|
|
3550
|
-
if (active()) setPairingError(messageOf(error, 'Pairing failed.'));
|
|
3652
|
+
if (active()) setPairingError(messageOf(error, t('native.app.pairingFailed', 'Pairing failed.')));
|
|
3551
3653
|
})
|
|
3552
3654
|
.finally(() => {
|
|
3553
3655
|
if (pairing.current !== controller || hosts.current !== manager) return;
|
|
@@ -3584,7 +3686,8 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3584
3686
|
void manager
|
|
3585
3687
|
.connect(savedHost)
|
|
3586
3688
|
.catch((error: unknown) => {
|
|
3587
|
-
if (hosts.current === manager)
|
|
3689
|
+
if (hosts.current === manager)
|
|
3690
|
+
setRestoreReason(messageOf(error, t('native.app.reconnectFailed', 'Could not reconnect.')));
|
|
3588
3691
|
})
|
|
3589
3692
|
.finally(() => {
|
|
3590
3693
|
if (hosts.current === manager) setRestoring(false);
|
|
@@ -3597,7 +3700,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3597
3700
|
);
|
|
3598
3701
|
const wakeSession = useCallback(async (sessionId: string, options?: { silent?: boolean }) => {
|
|
3599
3702
|
const runtime = hosts.current?.forSession(sessionId);
|
|
3600
|
-
if (!runtime) throw new Error('Po on your computer is not connected.');
|
|
3703
|
+
if (!runtime) throw new Error(t('native.app.notConnectedError', 'Po on your computer is not connected.'));
|
|
3601
3704
|
if (options) await runtime.wake(sessionId, options);
|
|
3602
3705
|
else await runtime.wake(sessionId);
|
|
3603
3706
|
}, []);
|
|
@@ -3617,14 +3720,17 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3617
3720
|
})
|
|
3618
3721
|
.catch((error: unknown) => {
|
|
3619
3722
|
if (hosts.current !== manager) return;
|
|
3620
|
-
const message = messageOf(
|
|
3723
|
+
const message = messageOf(
|
|
3724
|
+
error,
|
|
3725
|
+
t('native.app.forgetFailed', 'Could not forget host. Your local keys were kept.'),
|
|
3726
|
+
);
|
|
3621
3727
|
setSettingsError(message);
|
|
3622
3728
|
setRestoreReason(message);
|
|
3623
3729
|
});
|
|
3624
3730
|
}, []);
|
|
3625
3731
|
const forget = useCallback(() => {
|
|
3626
3732
|
if (savedHost) forgetHost(savedHost.id);
|
|
3627
|
-
else setSettingsError(
|
|
3733
|
+
else setSettingsError(hostOwnershipPending());
|
|
3628
3734
|
}, [savedHost, forgetHost]);
|
|
3629
3735
|
|
|
3630
3736
|
const navigationTheme = useMemo(
|
|
@@ -3643,7 +3749,8 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3643
3749
|
);
|
|
3644
3750
|
// Saved hosts reconnect behind Home rather than a full-screen wait, so pairing a new code stays one tap away.
|
|
3645
3751
|
const offline = phase !== 'ready';
|
|
3646
|
-
const hostMenuLabel =
|
|
3752
|
+
const hostMenuLabel =
|
|
3753
|
+
hostStates.length > 0 ? (scope ? hostDisplayName(scope.host) : t('native.app.allHosts', 'All hosts')) : undefined;
|
|
3647
3754
|
const hostMenu = useMemo(
|
|
3648
3755
|
() =>
|
|
3649
3756
|
hostMenuLabel === undefined ? undefined : (
|
|
@@ -3754,7 +3861,9 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3754
3861
|
void hosts.current
|
|
3755
3862
|
?.connect(host)
|
|
3756
3863
|
.catch((error: unknown) =>
|
|
3757
|
-
setSettingsError(
|
|
3864
|
+
setSettingsError(
|
|
3865
|
+
messageOf(error, t('native.app.reconnectFailed', 'Could not reconnect.')),
|
|
3866
|
+
),
|
|
3758
3867
|
);
|
|
3759
3868
|
},
|
|
3760
3869
|
}))}
|
|
@@ -3771,11 +3880,11 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3771
3880
|
</Tab.Screen>
|
|
3772
3881
|
<Tab.Screen name="Settings">
|
|
3773
3882
|
{() => (
|
|
3774
|
-
<TabPage title=
|
|
3883
|
+
<TabPage title={t('native.app.tab.settings', 'Settings')} hostMenu={hostMenu}>
|
|
3775
3884
|
{offline ? (
|
|
3776
3885
|
<>
|
|
3777
3886
|
<Button variant="outline" onPress={() => navigation.navigate('SettingsAccount')}>
|
|
3778
|
-
Account
|
|
3887
|
+
{t('native.settings.account', 'Account')}
|
|
3779
3888
|
</Button>
|
|
3780
3889
|
<ConnectFirst
|
|
3781
3890
|
{...(savedHost
|
|
@@ -3801,7 +3910,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3801
3910
|
</Tab.Navigator>
|
|
3802
3911
|
)}
|
|
3803
3912
|
</Stack.Screen>
|
|
3804
|
-
<Stack.Screen name="Hosts" options={{ title: 'Hosts' }}>
|
|
3913
|
+
<Stack.Screen name="Hosts" options={{ title: t('native.app.screen.hosts', 'Hosts') }}>
|
|
3805
3914
|
{() => (
|
|
3806
3915
|
<HostsRoute
|
|
3807
3916
|
states={hostStates}
|
|
@@ -3812,7 +3921,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3812
3921
|
/>
|
|
3813
3922
|
)}
|
|
3814
3923
|
</Stack.Screen>
|
|
3815
|
-
<Stack.Screen name="ComputerDetail" options={{ title: 'Computer' }}>
|
|
3924
|
+
<Stack.Screen name="ComputerDetail" options={{ title: t('native.app.screen.computer', 'Computer') }}>
|
|
3816
3925
|
{({ route }) => (
|
|
3817
3926
|
<HostsRoute
|
|
3818
3927
|
states={hostStates}
|
|
@@ -3824,7 +3933,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3824
3933
|
/>
|
|
3825
3934
|
)}
|
|
3826
3935
|
</Stack.Screen>
|
|
3827
|
-
<Stack.Screen name="AddHost" options={{ title: 'Add host' }}>
|
|
3936
|
+
<Stack.Screen name="AddHost" options={{ title: t('native.app.screen.addHost', 'Add host') }}>
|
|
3828
3937
|
{() => (
|
|
3829
3938
|
<AddHostRoute
|
|
3830
3939
|
connect={{ onPair: pair, busy: pairingBusy, error: pairingError, onCancel: cancelPairing }}
|
|
@@ -3832,7 +3941,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3832
3941
|
/>
|
|
3833
3942
|
)}
|
|
3834
3943
|
</Stack.Screen>
|
|
3835
|
-
<Stack.Screen name="LinkHosts" options={{ title: 'Link hosts' }}>
|
|
3944
|
+
<Stack.Screen name="LinkHosts" options={{ title: t('native.app.screen.linkHosts', 'Link hosts') }}>
|
|
3836
3945
|
{() => <LinkHostsRoute states={hostStates} onDone={() => navigation.goBack()} />}
|
|
3837
3946
|
</Stack.Screen>
|
|
3838
3947
|
<Stack.Screen name="HomeAttention" options={{ headerShown: false }}>
|
|
@@ -3849,7 +3958,10 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3849
3958
|
name="Page"
|
|
3850
3959
|
options={({ route }) => ({
|
|
3851
3960
|
title: route.params.title,
|
|
3852
|
-
headerBackTitle:
|
|
3961
|
+
headerBackTitle:
|
|
3962
|
+
route.params.pageItemId === undefined
|
|
3963
|
+
? t('native.app.tab.home', 'Home')
|
|
3964
|
+
: t('native.app.back.conversation', 'Conversation'),
|
|
3853
3965
|
})}
|
|
3854
3966
|
>
|
|
3855
3967
|
{({ route }) => (
|
|
@@ -3870,11 +3982,20 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3870
3982
|
<WorkspaceRoute
|
|
3871
3983
|
workspaceId={route.params.workspaceId}
|
|
3872
3984
|
hostStates={hostStates}
|
|
3873
|
-
onReconnect={(saved) =>
|
|
3985
|
+
onReconnect={(saved) =>
|
|
3986
|
+
void hosts.current
|
|
3987
|
+
?.connect(saved)
|
|
3988
|
+
.catch((error: unknown) =>
|
|
3989
|
+
console.warn('Workspace host did not reconnect:', messageOf(error, 'unreachable')),
|
|
3990
|
+
)
|
|
3991
|
+
}
|
|
3874
3992
|
/>
|
|
3875
3993
|
)}
|
|
3876
3994
|
</Stack.Screen>
|
|
3877
|
-
<Stack.Screen
|
|
3995
|
+
<Stack.Screen
|
|
3996
|
+
name="CalendarDetail"
|
|
3997
|
+
options={{ title: t('native.app.screen.eventDetails', 'Event details') }}
|
|
3998
|
+
>
|
|
3878
3999
|
{({ route }) => (
|
|
3879
4000
|
<PluginPageRoute
|
|
3880
4001
|
pageId={route.params.pageId}
|
|
@@ -3884,7 +4005,10 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3884
4005
|
/>
|
|
3885
4006
|
)}
|
|
3886
4007
|
</Stack.Screen>
|
|
3887
|
-
<Stack.Screen
|
|
4008
|
+
<Stack.Screen
|
|
4009
|
+
name="ProviderApproval"
|
|
4010
|
+
options={{ title: t('native.app.screen.approveProvider', 'Approve provider') }}
|
|
4011
|
+
>
|
|
3888
4012
|
{({ route }) => (
|
|
3889
4013
|
<WorkspaceProvidersSection
|
|
3890
4014
|
workspaceId={route.params.workspaceId}
|
|
@@ -3917,7 +4041,10 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3917
4041
|
/>
|
|
3918
4042
|
)}
|
|
3919
4043
|
</Stack.Screen>
|
|
3920
|
-
<Stack.Screen
|
|
4044
|
+
<Stack.Screen
|
|
4045
|
+
name="SettingsTeam"
|
|
4046
|
+
options={{ title: t('native.settings.team', 'Team'), headerBackTitle: settingsBack() }}
|
|
4047
|
+
>
|
|
3921
4048
|
{({ navigation: screen }) => (
|
|
3922
4049
|
<TeamRoute
|
|
3923
4050
|
onLeft={(issuer) => {
|
|
@@ -3928,7 +4055,10 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3928
4055
|
/>
|
|
3929
4056
|
)}
|
|
3930
4057
|
</Stack.Screen>
|
|
3931
|
-
<Stack.Screen
|
|
4058
|
+
<Stack.Screen
|
|
4059
|
+
name="SettingsAccount"
|
|
4060
|
+
options={{ title: t('native.settings.account', 'Account'), headerBackTitle: settingsBack() }}
|
|
4061
|
+
>
|
|
3932
4062
|
{({ navigation: screen }) => (
|
|
3933
4063
|
<AccountRoute
|
|
3934
4064
|
stack={screen}
|
|
@@ -3942,14 +4072,14 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3942
4072
|
<Stack.Screen
|
|
3943
4073
|
name="SettingsDevices"
|
|
3944
4074
|
component={DevicesRoute}
|
|
3945
|
-
options={{ title: 'Devices', headerBackTitle:
|
|
4075
|
+
options={{ title: t('native.settings.devices', 'Devices'), headerBackTitle: settingsBack() }}
|
|
3946
4076
|
/>
|
|
3947
4077
|
<Stack.Screen
|
|
3948
4078
|
name="SettingsProviders"
|
|
3949
4079
|
component={ProvidersRoute}
|
|
3950
4080
|
options={{
|
|
3951
|
-
title: 'Providers',
|
|
3952
|
-
headerBackTitle:
|
|
4081
|
+
title: t('native.settings.providers', 'Providers'),
|
|
4082
|
+
headerBackTitle: settingsBack(),
|
|
3953
4083
|
headerBackButtonDisplayMode: 'default',
|
|
3954
4084
|
}}
|
|
3955
4085
|
/>
|
|
@@ -3957,8 +4087,8 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3957
4087
|
name="SettingsMcp"
|
|
3958
4088
|
component={McpServersRoute}
|
|
3959
4089
|
options={{
|
|
3960
|
-
title: 'MCP servers',
|
|
3961
|
-
headerBackTitle:
|
|
4090
|
+
title: t('native.settings.mcpServers', 'MCP servers'),
|
|
4091
|
+
headerBackTitle: settingsBack(),
|
|
3962
4092
|
headerBackButtonDisplayMode: 'default',
|
|
3963
4093
|
}}
|
|
3964
4094
|
/>
|
|
@@ -3966,8 +4096,8 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3966
4096
|
name="SettingsRemote"
|
|
3967
4097
|
component={RemoteControlRoute}
|
|
3968
4098
|
options={{
|
|
3969
|
-
title: 'Remote control',
|
|
3970
|
-
headerBackTitle:
|
|
4099
|
+
title: t('native.settings.remoteControl', 'Remote control'),
|
|
4100
|
+
headerBackTitle: settingsBack(),
|
|
3971
4101
|
headerBackButtonDisplayMode: 'default',
|
|
3972
4102
|
}}
|
|
3973
4103
|
/>
|
|
@@ -3975,8 +4105,8 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3975
4105
|
name="SettingsWorkspaces"
|
|
3976
4106
|
component={WorkspaceSettingsRoute}
|
|
3977
4107
|
options={{
|
|
3978
|
-
title: 'Workspaces',
|
|
3979
|
-
headerBackTitle:
|
|
4108
|
+
title: t('native.settings.workspaces', 'Workspaces'),
|
|
4109
|
+
headerBackTitle: settingsBack(),
|
|
3980
4110
|
headerBackButtonDisplayMode: 'default',
|
|
3981
4111
|
}}
|
|
3982
4112
|
/>
|
|
@@ -3984,8 +4114,8 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3984
4114
|
name="SettingsAppearance"
|
|
3985
4115
|
component={AppearanceRoute}
|
|
3986
4116
|
options={{
|
|
3987
|
-
title: 'Appearance',
|
|
3988
|
-
headerBackTitle:
|
|
4117
|
+
title: t('native.settings.appearance', 'Appearance'),
|
|
4118
|
+
headerBackTitle: settingsBack(),
|
|
3989
4119
|
headerBackButtonDisplayMode: 'default',
|
|
3990
4120
|
}}
|
|
3991
4121
|
/>
|
|
@@ -3994,45 +4124,61 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3994
4124
|
component={SettingsPanelRoute}
|
|
3995
4125
|
options={({ route }) => ({
|
|
3996
4126
|
title: route.params.title,
|
|
3997
|
-
headerBackTitle:
|
|
4127
|
+
headerBackTitle: settingsBack(),
|
|
3998
4128
|
headerBackButtonDisplayMode: 'default',
|
|
3999
4129
|
})}
|
|
4000
4130
|
/>
|
|
4001
4131
|
<Stack.Screen
|
|
4002
4132
|
name="SettingsImages"
|
|
4003
4133
|
component={ImagesRoute}
|
|
4004
|
-
options={{
|
|
4134
|
+
options={{
|
|
4135
|
+
title: t('native.settings.images', 'Images'),
|
|
4136
|
+
headerBackTitle: settingsBack(),
|
|
4137
|
+
headerBackButtonDisplayMode: 'default',
|
|
4138
|
+
}}
|
|
4005
4139
|
/>
|
|
4006
4140
|
<Stack.Screen
|
|
4007
4141
|
name="SettingsPlugins"
|
|
4008
4142
|
component={PluginsRoute}
|
|
4009
|
-
options={{
|
|
4143
|
+
options={{
|
|
4144
|
+
title: t('native.settings.plugins', 'Plugins'),
|
|
4145
|
+
headerBackTitle: settingsBack(),
|
|
4146
|
+
headerBackButtonDisplayMode: 'default',
|
|
4147
|
+
}}
|
|
4010
4148
|
/>
|
|
4011
4149
|
<Stack.Screen
|
|
4012
4150
|
name="SettingsPlugin"
|
|
4013
4151
|
component={PluginRoute}
|
|
4014
4152
|
options={({ route }) => ({
|
|
4015
4153
|
title: route.params.title,
|
|
4016
|
-
headerBackTitle: 'Plugins',
|
|
4154
|
+
headerBackTitle: t('native.settings.plugins', 'Plugins'),
|
|
4017
4155
|
headerBackButtonDisplayMode: 'default',
|
|
4018
4156
|
})}
|
|
4019
4157
|
/>
|
|
4020
4158
|
<Stack.Screen
|
|
4021
4159
|
name="SettingsPresets"
|
|
4022
4160
|
component={PresetsRoute}
|
|
4023
|
-
options={{
|
|
4161
|
+
options={{
|
|
4162
|
+
title: t('native.app.screen.presets', 'Presets'),
|
|
4163
|
+
headerBackTitle: t('native.common.back', 'Back'),
|
|
4164
|
+
headerBackButtonDisplayMode: 'default',
|
|
4165
|
+
}}
|
|
4024
4166
|
/>
|
|
4025
4167
|
<Stack.Screen
|
|
4026
4168
|
name="SettingsMetrics"
|
|
4027
4169
|
component={MetricsRoute}
|
|
4028
|
-
options={{
|
|
4170
|
+
options={{
|
|
4171
|
+
title: t('native.settings.metrics', 'Metrics'),
|
|
4172
|
+
headerBackTitle: settingsBack(),
|
|
4173
|
+
headerBackButtonDisplayMode: 'default',
|
|
4174
|
+
}}
|
|
4029
4175
|
/>
|
|
4030
4176
|
<Stack.Screen
|
|
4031
4177
|
name="SettingsSection"
|
|
4032
4178
|
component={ContributedSectionRoute}
|
|
4033
4179
|
options={({ route }) => ({
|
|
4034
4180
|
title: route.params.title,
|
|
4035
|
-
headerBackTitle: route.params.workspace ?
|
|
4181
|
+
headerBackTitle: route.params.workspace ? workspacesBack() : settingsBack(),
|
|
4036
4182
|
headerBackButtonDisplayMode: 'default',
|
|
4037
4183
|
})}
|
|
4038
4184
|
/>
|
|
@@ -4042,7 +4188,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
4042
4188
|
component={WorkspaceDefaultsRoute}
|
|
4043
4189
|
options={({ route }) => ({
|
|
4044
4190
|
title: route.params.title,
|
|
4045
|
-
headerBackTitle:
|
|
4191
|
+
headerBackTitle: workspacesBack(),
|
|
4046
4192
|
headerBackButtonDisplayMode: 'default',
|
|
4047
4193
|
})}
|
|
4048
4194
|
/>
|
|
@@ -4051,7 +4197,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
4051
4197
|
component={WorkspaceGitRoute}
|
|
4052
4198
|
options={({ route }) => ({
|
|
4053
4199
|
title: route.params.title,
|
|
4054
|
-
headerBackTitle:
|
|
4200
|
+
headerBackTitle: workspacesBack(),
|
|
4055
4201
|
headerBackButtonDisplayMode: 'default',
|
|
4056
4202
|
})}
|
|
4057
4203
|
/>
|
|
@@ -4060,7 +4206,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
4060
4206
|
component={WorkspaceMcpRoute}
|
|
4061
4207
|
options={({ route }) => ({
|
|
4062
4208
|
title: route.params.title,
|
|
4063
|
-
headerBackTitle:
|
|
4209
|
+
headerBackTitle: workspacesBack(),
|
|
4064
4210
|
headerBackButtonDisplayMode: 'default',
|
|
4065
4211
|
})}
|
|
4066
4212
|
/>
|