@agimon-ai/po-native 0.0.1-alpha.75 → 0.0.1-alpha.77
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/package.json +12 -12
- package/src/app/AccountRoute.tsx +22 -4
- package/src/app/App.tsx +189 -74
- package/src/app/OnboardingRoute.tsx +51 -25
- package/src/app/useHome.ts +8 -4
- package/src/components/ActivitySheet.tsx +34 -25
- package/src/components/ConnectCard.tsx +1 -0
- package/src/components/ContextFace.tsx +2 -2
- package/src/components/ResumeSheetView.tsx +11 -5
- package/src/components/SessionChoicesView.tsx +9 -2
- package/src/components/richActivity/NativeAuthorHtmlView.tsx +6 -1
- package/src/components/richActivity/createRichActivityRenderers.tsx +5 -3
- package/src/screens/AppearanceScreen.tsx +3 -2
- package/src/screens/ContributedSettingsScreen.tsx +25 -4
- package/src/screens/HostDrawer.tsx +1 -0
- package/src/screens/HostedOnboarding.tsx +56 -2
- package/src/screens/HostedOnboardingDesign.stories.tsx +49 -11
- package/src/screens/McpServersScreen.tsx +3 -0
- package/src/screens/PairingScreen.tsx +1 -0
- package/src/screens/PluginCatalogScreen.tsx +2 -0
- package/src/screens/PluginDetailScreen.tsx +51 -41
- package/src/screens/PluginMarketplaceDesign.stories.tsx +20 -0
- package/src/screens/SettingsDirectory.stories.tsx +270 -0
- package/src/screens/SettingsScreen.stories.tsx +0 -6
- package/src/screens/SettingsScreen.tsx +3 -23
- package/src/screens/TeamView.tsx +1 -0
- package/src/screens/homeModel.ts +2 -1
- package/src/screens/localPlugins.ts +46 -0
- package/src/screens/usePluginMarketplace.ts +34 -14
- package/src/services/hostActions/index.ts +13 -8
- package/src/services/nativePush/index.ts +4 -3
- package/src/services/pairing/index.ts +26 -13
- package/src/services/sessionProfiles/index.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-native",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.77",
|
|
4
4
|
"description": "Po for iOS and Android",
|
|
5
5
|
"homepage": "https://agimon.ai",
|
|
6
6
|
"bugs": {
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
33
|
-
"@agimon-ai/po-expo-signing": "0.0.1-alpha.
|
|
34
|
-
"@agimon-ai/po-identity": "0.0.2-alpha.
|
|
35
|
-
"@agimon-ai/po-native-components": "0.0.0-alpha.
|
|
36
|
-
"@agimon-ai/po-native-dashboard": "0.0.0-alpha.
|
|
37
|
-
"@agimon-ai/po-template-advanced": "0.0.0-alpha.
|
|
38
|
-
"@agimon-ai/po-template-elegant": "0.0.0-alpha.
|
|
39
|
-
"@agimon-ai/po-voice": "0.0.0-alpha.
|
|
40
|
-
"@agimon-ai/po-web-components": "0.0.0-alpha.
|
|
41
|
-
"@agimon-ai/po-web-dashboard": "0.0.0-alpha.
|
|
42
|
-
"@agimon-ai/po-web-security": "0.0.0-alpha.
|
|
32
|
+
"@agimon-ai/po-core": "0.0.0-alpha.197",
|
|
33
|
+
"@agimon-ai/po-expo-signing": "0.0.1-alpha.77",
|
|
34
|
+
"@agimon-ai/po-identity": "0.0.2-alpha.144",
|
|
35
|
+
"@agimon-ai/po-native-components": "0.0.0-alpha.197",
|
|
36
|
+
"@agimon-ai/po-native-dashboard": "0.0.0-alpha.69",
|
|
37
|
+
"@agimon-ai/po-template-advanced": "0.0.0-alpha.197",
|
|
38
|
+
"@agimon-ai/po-template-elegant": "0.0.0-alpha.197",
|
|
39
|
+
"@agimon-ai/po-voice": "0.0.0-alpha.197",
|
|
40
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.197",
|
|
41
|
+
"@agimon-ai/po-web-dashboard": "0.0.0-alpha.197",
|
|
42
|
+
"@agimon-ai/po-web-security": "0.0.0-alpha.197",
|
|
43
43
|
"@better-auth/expo": "1.7.12",
|
|
44
44
|
"@config-plugins/react-native-webrtc": "15.0.2",
|
|
45
45
|
"@earendil-works/chord": "1.6.1",
|
package/src/app/AccountRoute.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t } from '@agimon-ai/po-core/native';
|
|
1
|
+
import { currentLocale, t, useT } from '@agimon-ai/po-core/native';
|
|
2
2
|
import {
|
|
3
3
|
accountViewModel,
|
|
4
4
|
createHostedAccountFlow,
|
|
@@ -29,6 +29,7 @@ import { apiTransportForHost } from '../services/apiTransport';
|
|
|
29
29
|
import { type CloudHostRecord, ensureCloudHost, loadCloudHosts } from '../services/cloudHosts';
|
|
30
30
|
import { associateHostAccount, loadHosts } from '../services/deviceTrust';
|
|
31
31
|
import { setCloudProviderKey } from './cloudRuntime';
|
|
32
|
+
import { WithOnboardingLanguage } from './OnboardingRoute';
|
|
32
33
|
|
|
33
34
|
interface AccountRouteProps {
|
|
34
35
|
firstRun?: boolean;
|
|
@@ -208,7 +209,7 @@ function HostedAccountRoute({
|
|
|
208
209
|
return () => flow.dispose();
|
|
209
210
|
}, [flow]);
|
|
210
211
|
const state = useStore(flow.state);
|
|
211
|
-
|
|
212
|
+
const page = (
|
|
212
213
|
<AccountPage
|
|
213
214
|
stack={stack}
|
|
214
215
|
// Outside first run, hosted sign-in starts at the email page.
|
|
@@ -222,6 +223,8 @@ function HostedAccountRoute({
|
|
|
222
223
|
}}
|
|
223
224
|
/>
|
|
224
225
|
);
|
|
226
|
+
// First-run sign-in fills the screen, so it carries the language switch as the onboarding steps do.
|
|
227
|
+
return firstRun && !stack ? <WithOnboardingLanguage>{page}</WithOnboardingLanguage> : page;
|
|
225
228
|
}
|
|
226
229
|
|
|
227
230
|
/** A self-hosted identity home: sign-in, device trust, approval, recovery, hub links and Po Cloud. */
|
|
@@ -235,6 +238,7 @@ function SelfHostedAccountRoute({
|
|
|
235
238
|
onBack,
|
|
236
239
|
stack,
|
|
237
240
|
}: AccountRouteProps & { page?: 'methods'; onBack: () => void }) {
|
|
241
|
+
useT();
|
|
238
242
|
const [permission, requestPermission] = useCameraPermissions();
|
|
239
243
|
const latest = useRef({ permission, requestPermission, onScan, onUseCloud, onForgetCloud });
|
|
240
244
|
latest.current = { permission, requestPermission, onScan, onUseCloud, onForgetCloud };
|
|
@@ -258,7 +262,13 @@ function SelfHostedAccountRoute({
|
|
|
258
262
|
now,
|
|
259
263
|
},
|
|
260
264
|
// Reached from hosted sign-in, the selected issuer is hosted Po Cloud: never restore it as an identity home.
|
|
261
|
-
{
|
|
265
|
+
{
|
|
266
|
+
firstRun,
|
|
267
|
+
foreground: AppState.currentState === 'active',
|
|
268
|
+
t,
|
|
269
|
+
readLocale: currentLocale,
|
|
270
|
+
...(page ? { page, restore: false } : {}),
|
|
271
|
+
},
|
|
262
272
|
),
|
|
263
273
|
);
|
|
264
274
|
useEffect(() => {
|
|
@@ -271,11 +281,19 @@ function SelfHostedAccountRoute({
|
|
|
271
281
|
}, [flow]);
|
|
272
282
|
const state = useStore(flow.state);
|
|
273
283
|
const linkNotice = useStore(accountLinkNotice);
|
|
284
|
+
const view = accountViewModel(state, { firstRun, linkNotice, t });
|
|
285
|
+
const error = view.signInUnavailable
|
|
286
|
+
? t(
|
|
287
|
+
'native.account.signInUnreachable',
|
|
288
|
+
"Po can't reach your sign-in server right now. You can still pair a computer without an account.",
|
|
289
|
+
)
|
|
290
|
+
: view.error;
|
|
274
291
|
return (
|
|
275
292
|
<>
|
|
276
293
|
<AccountPage
|
|
277
294
|
stack={stack}
|
|
278
|
-
{...
|
|
295
|
+
{...view}
|
|
296
|
+
error={error}
|
|
279
297
|
onDeviceName={flow.setDeviceName}
|
|
280
298
|
onIssuer={flow.setIssuerDraft}
|
|
281
299
|
onEmail={flow.setEmail}
|
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,
|
|
@@ -33,6 +38,7 @@ import {
|
|
|
33
38
|
SheetTitle,
|
|
34
39
|
SheetBody,
|
|
35
40
|
UsersIcon,
|
|
41
|
+
ReferenceChip,
|
|
36
42
|
yieldSheets,
|
|
37
43
|
} from '@agimon-ai/po-native-components';
|
|
38
44
|
import {
|
|
@@ -57,6 +63,7 @@ import {
|
|
|
57
63
|
webTabs,
|
|
58
64
|
subscribeWebPluginRegistry,
|
|
59
65
|
pluginSettingsPanels,
|
|
66
|
+
pluginSettingsSections,
|
|
60
67
|
applySessionRemoved,
|
|
61
68
|
applySessionUpsert,
|
|
62
69
|
sessionMoveTarget,
|
|
@@ -79,6 +86,7 @@ import {
|
|
|
79
86
|
liveSessionOptions,
|
|
80
87
|
mentionableSessions,
|
|
81
88
|
resolveSessionReference,
|
|
89
|
+
SESSION_REFERENCE_SCHEME,
|
|
82
90
|
activityWaitingCount,
|
|
83
91
|
sessionStoreFor,
|
|
84
92
|
sessionModes,
|
|
@@ -182,6 +190,7 @@ import { ClientDevices } from '../screens/ClientDevices';
|
|
|
182
190
|
import {
|
|
183
191
|
ContributedSettingsScreen,
|
|
184
192
|
sectionSummary,
|
|
193
|
+
settingsContributionCopy,
|
|
185
194
|
useContributedSettings,
|
|
186
195
|
useSettingsSections,
|
|
187
196
|
} from '../screens/ContributedSettingsScreen';
|
|
@@ -192,6 +201,7 @@ import { HomeAppsSection, HomeAttentionScreen, HomeScreen, type HomeView } from
|
|
|
192
201
|
import { HostDrawer, HostMenuButton } from '../screens/HostDrawer';
|
|
193
202
|
import { FirstSessionWelcome } from '../screens/HostedOnboarding';
|
|
194
203
|
import { ImagesScreen, imagesSummary, useImageSettings } from '../screens/ImagesScreen';
|
|
204
|
+
import { pluginPageOf } from '../screens/localPlugins';
|
|
195
205
|
import { McpServersScreen, mcpServersSummary, useMcpServers } from '../screens/McpServersScreen';
|
|
196
206
|
import { MetricsScreen, useMetrics } from '../screens/MetricsScreen';
|
|
197
207
|
import { ALL_CATEGORIES, EXTERNAL_CATEGORY, PluginCatalogScreen } from '../screens/PluginCatalogScreen';
|
|
@@ -211,7 +221,7 @@ import {
|
|
|
211
221
|
SettingsScreen,
|
|
212
222
|
sentenceCase,
|
|
213
223
|
} from '../screens/SettingsScreen';
|
|
214
|
-
import { isCuratedPlugin,
|
|
224
|
+
import { isCuratedPlugin, useCatalogLayers, usePluginMarketplace } from '../screens/usePluginMarketplace';
|
|
215
225
|
import { workspacePageState } from '../screens/workspaceModel';
|
|
216
226
|
import type { ProviderCandidate } from '../screens/WorkspaceProviders';
|
|
217
227
|
import { WorkspaceProvidersSection } from '../screens/WorkspaceProvidersSection';
|
|
@@ -680,6 +690,46 @@ function LiveSessionScreen({
|
|
|
680
690
|
);
|
|
681
691
|
}
|
|
682
692
|
|
|
693
|
+
/** An `@session:<token>` in a message from `senderId`: that session's name as a chip, or the token once it is gone. */
|
|
694
|
+
function SessionReference({
|
|
695
|
+
reference,
|
|
696
|
+
senderId,
|
|
697
|
+
onOpen,
|
|
698
|
+
onLongPress,
|
|
699
|
+
}: {
|
|
700
|
+
reference: string;
|
|
701
|
+
senderId: string;
|
|
702
|
+
onOpen: (sessionId: string) => void;
|
|
703
|
+
onLongPress?: () => void;
|
|
704
|
+
}) {
|
|
705
|
+
const t = useT();
|
|
706
|
+
// One string, so a store update that leaves this session alone does not re-render the chip.
|
|
707
|
+
const target = useStore(sessionsStore, (state) => {
|
|
708
|
+
const mentioned = resolveSessionReference(
|
|
709
|
+
reference,
|
|
710
|
+
mentionableSessions(state, workspacesStore.state.byId, senderId, Date.now()),
|
|
711
|
+
);
|
|
712
|
+
return mentioned === undefined ? '' : `${mentioned.id}\n${mentioned.name}`;
|
|
713
|
+
});
|
|
714
|
+
if (target === '') return `@${reference}`;
|
|
715
|
+
const [id, name] = target.split('\n') as [string, string];
|
|
716
|
+
return (
|
|
717
|
+
<ReferenceChip
|
|
718
|
+
label={name.trim() || t('native.app.untitled', 'Untitled')}
|
|
719
|
+
reference={`@${reference}`}
|
|
720
|
+
onOpen={() => onOpen(id)}
|
|
721
|
+
onLongPress={onLongPress}
|
|
722
|
+
/>
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
function SessionTabTitle({ tab }: { tab: Pick<TransientTab, 'label' | 'translateLabel'> }) {
|
|
726
|
+
const t = useT();
|
|
727
|
+
return (
|
|
728
|
+
<Text style={styles.headerName} numberOfLines={1}>
|
|
729
|
+
{tab.translateLabel?.(t) ?? tab.label}
|
|
730
|
+
</Text>
|
|
731
|
+
);
|
|
732
|
+
}
|
|
683
733
|
function SessionRoute({
|
|
684
734
|
route,
|
|
685
735
|
navigation,
|
|
@@ -715,6 +765,7 @@ function SessionRoute({
|
|
|
715
765
|
nativeHost?: (sessionId: string) => NativeSlotHost;
|
|
716
766
|
}) {
|
|
717
767
|
useRenderTrace('SessionRoute');
|
|
768
|
+
const t = useT();
|
|
718
769
|
const { sessionId: ownerSessionId } = route.params;
|
|
719
770
|
const focused = useIsFocused();
|
|
720
771
|
const [foreground, setForeground] = useState(AppState.currentState === 'active');
|
|
@@ -1020,32 +1071,55 @@ function SessionRoute({
|
|
|
1020
1071
|
const resolveFileLink = useFileLinks(sessionId);
|
|
1021
1072
|
// Message text, as in the cockpit: images load from the session's open folders, and a path a plugin
|
|
1022
1073
|
// claims opens that plugin's file view in this session's stack.
|
|
1023
|
-
const markdown = useMemo(
|
|
1024
|
-
|
|
1074
|
+
const markdown = useMemo(() => {
|
|
1075
|
+
const hostId = splitHostId(sessionId)?.hostId;
|
|
1076
|
+
const openMentioned = (id: string) => openSession(hostId === undefined ? id : qualifyHostId(hostId, id));
|
|
1077
|
+
const onFileLink = (label: string, explicit = false) => {
|
|
1078
|
+
// `@session:<token>` opens that session, found among the ones on this session's computer.
|
|
1079
|
+
const mentioned = explicit
|
|
1080
|
+
? undefined
|
|
1081
|
+
: resolveSessionReference(
|
|
1082
|
+
label,
|
|
1083
|
+
mentionableSessions(sessionsStore.state, workspacesStore.state.byId, sessionId, Date.now()),
|
|
1084
|
+
);
|
|
1085
|
+
if (mentioned !== undefined) return () => openMentioned(mentioned.id);
|
|
1086
|
+
const tab = explicit ? fileTabForPath(sessionId, label) : resolveFileLink(label);
|
|
1087
|
+
if (tab === undefined) return undefined;
|
|
1088
|
+
return () => {
|
|
1089
|
+
openTransientTab(ownerSessionId, tab);
|
|
1090
|
+
setActivityOpen(false);
|
|
1091
|
+
inner.current?.navigate('ActivityDetail', { tabId: tab.id }, { pop: true });
|
|
1092
|
+
};
|
|
1093
|
+
};
|
|
1094
|
+
return {
|
|
1025
1095
|
loadImage: (path: string) => loadSessionImage(sessionId, path),
|
|
1026
|
-
onFileLink
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1096
|
+
onFileLink,
|
|
1097
|
+
// A reference draws as a chip: a session by its live name, a file a plugin claims by its basename.
|
|
1098
|
+
renderReference: (reference: string, options?: { onLongPress?: () => void }) => {
|
|
1099
|
+
if (reference.startsWith(SESSION_REFERENCE_SCHEME))
|
|
1100
|
+
return (
|
|
1101
|
+
<SessionReference
|
|
1102
|
+
reference={reference}
|
|
1103
|
+
senderId={sessionId}
|
|
1104
|
+
onOpen={openMentioned}
|
|
1105
|
+
onLongPress={options?.onLongPress}
|
|
1106
|
+
/>
|
|
1107
|
+
);
|
|
1108
|
+
// Never the explicit path: a generic file preview would claim `space:` before po-space does.
|
|
1109
|
+
const open = onFileLink(reference);
|
|
1110
|
+
if (open === undefined) return undefined;
|
|
1111
|
+
const path = reference.slice(reference.indexOf(':') + 1);
|
|
1112
|
+
return (
|
|
1113
|
+
<ReferenceChip
|
|
1114
|
+
label={path.split('/').at(-1) || path}
|
|
1115
|
+
reference={`@${reference}`}
|
|
1116
|
+
onOpen={open}
|
|
1117
|
+
onLongPress={options?.onLongPress}
|
|
1118
|
+
/>
|
|
1119
|
+
);
|
|
1045
1120
|
},
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
);
|
|
1121
|
+
};
|
|
1122
|
+
}, [sessionId, ownerSessionId, resolveFileLink, openSession]);
|
|
1049
1123
|
const openTab = (tabId: string | null) => {
|
|
1050
1124
|
setActivityOpen(false);
|
|
1051
1125
|
if (!inner.current) return;
|
|
@@ -1269,7 +1343,7 @@ function SessionRoute({
|
|
|
1269
1343
|
// Background stack screens keep their tabs mounted; only the selected one shows the sheet.
|
|
1270
1344
|
conversationOpen: conversationOpen && tab.id === selectedTabId,
|
|
1271
1345
|
onConversationOpenChange: setConversationOpen,
|
|
1272
|
-
asideLabel: tab.label,
|
|
1346
|
+
asideLabel: ('translateLabel' in tab ? tab.translateLabel?.(t) : undefined) ?? tab.label,
|
|
1273
1347
|
}
|
|
1274
1348
|
: {})}
|
|
1275
1349
|
sessionId={sessionId}
|
|
@@ -1357,14 +1431,19 @@ function SessionRoute({
|
|
|
1357
1431
|
<SessionStack.Screen
|
|
1358
1432
|
name="ActivityDetail"
|
|
1359
1433
|
getId={({ params }) => params.tabId}
|
|
1360
|
-
options={({ route: detail }) =>
|
|
1361
|
-
|
|
1362
|
-
transientTabs.find((tab) => tab.id === detail.params.tabId)
|
|
1363
|
-
webTabs(ownerSessionId).find((tab) => tab.id === detail.params.tabId)
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1434
|
+
options={({ route: detail }) => {
|
|
1435
|
+
const tab =
|
|
1436
|
+
transientTabs.find((tab) => tab.id === detail.params.tabId) ??
|
|
1437
|
+
webTabs(ownerSessionId).find((tab) => tab.id === detail.params.tabId);
|
|
1438
|
+
return {
|
|
1439
|
+
title:
|
|
1440
|
+
(tab && 'translateLabel' in tab ? tab.translateLabel?.(t) : undefined) ??
|
|
1441
|
+
tab?.label ??
|
|
1442
|
+
t('native.app.activity', 'Activity'),
|
|
1443
|
+
// iOS 26 defaults to a whole-screen back swipe, which steals drags on Author canvases; keep the edge swipe.
|
|
1444
|
+
fullScreenGestureEnabled: false,
|
|
1445
|
+
};
|
|
1446
|
+
}}
|
|
1368
1447
|
listeners={({ route: detail }) => ({
|
|
1369
1448
|
beforeRemove: () => {
|
|
1370
1449
|
tabHeaders.current.delete(detail.params.tabId);
|
|
@@ -1392,14 +1471,11 @@ function SessionRoute({
|
|
|
1392
1471
|
);
|
|
1393
1472
|
let setTabHeader = tabHeaders.current.get(tab.id);
|
|
1394
1473
|
if (!setTabHeader) {
|
|
1395
|
-
const label = tab.label;
|
|
1396
1474
|
setTabHeader = (header) =>
|
|
1397
1475
|
child.setOptions({
|
|
1398
1476
|
headerTitle: () => (
|
|
1399
1477
|
<View style={styles.headerTitle}>
|
|
1400
|
-
<
|
|
1401
|
-
{label}
|
|
1402
|
-
</Text>
|
|
1478
|
+
<SessionTabTitle tab={tab} />
|
|
1403
1479
|
{header.subtitle ? (
|
|
1404
1480
|
<Text style={styles.headerStatus('quiet')} numberOfLines={1}>
|
|
1405
1481
|
{header.subtitle}
|
|
@@ -1472,12 +1548,16 @@ function SettingsRoute(
|
|
|
1472
1548
|
const installedPlugins =
|
|
1473
1549
|
settingsHost === undefined ? installedWebPlugins() : webPluginRegistryForHost(settingsHost).installedWebPlugins();
|
|
1474
1550
|
// A curated plugin's pages live on its own Plugins screen, so Settings leaves them out.
|
|
1475
|
-
const
|
|
1551
|
+
const catalog = useCatalogLayers(settingsHost);
|
|
1552
|
+
const curated = useMemo(() => catalog && new Set(catalog.flatMap((layer) => layer.packages)), [catalog]);
|
|
1476
1553
|
const listed = (pluginId: string) => !isCuratedPlugin(pluginId, installedPlugins, curated);
|
|
1477
|
-
|
|
1554
|
+
// An opted-in page moves to its plugin's screen, but only once the catalog says which screen that is.
|
|
1555
|
+
const local = useLocalPluginSources(settingsHost);
|
|
1556
|
+
const panels = local.panels.filter((panel) =>
|
|
1557
|
+
panel.pluginPage?.trim() ? pluginPageOf(panel, local.installed, catalog) === undefined : listed(panel.pluginId),
|
|
1558
|
+
);
|
|
1478
1559
|
// A page about the person sits in the Global card, not among the computer's features.
|
|
1479
1560
|
const globalPanels = props.phoneOnly ? [] : panels.filter((panel) => panel.menuGroup === 'global');
|
|
1480
|
-
const panelGroups = useSettingsPanelGroups(props.phoneOnly ? props.computers : undefined);
|
|
1481
1561
|
const sections = useSettingsSections('host', settingsHost).filter((section) => listed(section.pluginId));
|
|
1482
1562
|
const sectionKeys = sections.flatMap((section) => section.fields.map(settingsKeyOf)).join('\n');
|
|
1483
1563
|
const plugins = installedPlugins.length;
|
|
@@ -1531,23 +1611,21 @@ function SettingsRoute(
|
|
|
1531
1611
|
);
|
|
1532
1612
|
const appearance = useStore(appearanceStore, (state) => state);
|
|
1533
1613
|
const teamName = hostedTeamName.data;
|
|
1534
|
-
const openPanel = (id: string
|
|
1535
|
-
const computer = props.computers?.find((candidate) => candidate.id ===
|
|
1536
|
-
if (
|
|
1614
|
+
const openPanel = (id: string) => {
|
|
1615
|
+
const computer = props.computers?.find((candidate) => candidate.id === settingsHost);
|
|
1616
|
+
if (settingsHost === undefined ? !allowed : computer?.online === false) {
|
|
1537
1617
|
Alert.alert(
|
|
1538
1618
|
t('native.app.tab.settings', 'Settings'),
|
|
1539
1619
|
computer ? t('native.app.computerOffline', '{name} is offline.', { name: computer.label }) : refused,
|
|
1540
1620
|
);
|
|
1541
1621
|
return;
|
|
1542
1622
|
}
|
|
1543
|
-
const panel =
|
|
1544
|
-
(candidate) => candidate.id === id,
|
|
1545
|
-
);
|
|
1623
|
+
const panel = panels.find((candidate) => candidate.id === id);
|
|
1546
1624
|
if (panel)
|
|
1547
1625
|
navigation.navigate('SettingsPanel', {
|
|
1548
1626
|
id,
|
|
1549
1627
|
title: panel.label,
|
|
1550
|
-
...(
|
|
1628
|
+
...(settingsHost === undefined ? {} : { hostId: settingsHost }),
|
|
1551
1629
|
});
|
|
1552
1630
|
};
|
|
1553
1631
|
return (
|
|
@@ -1580,7 +1658,7 @@ function SettingsRoute(
|
|
|
1580
1658
|
appearance={appearanceLabel(appearance)}
|
|
1581
1659
|
{...(teamName ? { team: teamName } : {})}
|
|
1582
1660
|
{...(images ? { images } : {})}
|
|
1583
|
-
plugins={
|
|
1661
|
+
plugins={t('native.app.pluginsInstalled', '{count} installed', { count: plugins })}
|
|
1584
1662
|
sections={sections.map((section) => {
|
|
1585
1663
|
const summary = sectionSummary(section, sectionValues);
|
|
1586
1664
|
return { id: section.id, label: section.label, ...(summary === undefined ? {} : { summary }) };
|
|
@@ -1611,7 +1689,6 @@ function SettingsRoute(
|
|
|
1611
1689
|
navigation.navigate(section, settingsHost === undefined ? undefined : { hostId: settingsHost });
|
|
1612
1690
|
}}
|
|
1613
1691
|
panels={panels.filter((panel) => panel.menuGroup !== 'global')}
|
|
1614
|
-
panelGroups={panelGroups}
|
|
1615
1692
|
onOpenPanel={openPanel}
|
|
1616
1693
|
/>
|
|
1617
1694
|
);
|
|
@@ -1626,21 +1703,17 @@ function useSettingsPanels(hostId?: string) {
|
|
|
1626
1703
|
useEffect(() => subscribeWebPluginRegistry(() => setVersion((value) => value + 1)), []);
|
|
1627
1704
|
const installed =
|
|
1628
1705
|
hostId === undefined ? pluginSettingsPanels() : webPluginRegistryForHost(hostId).pluginSettingsPanels();
|
|
1629
|
-
return [...installed]
|
|
1630
|
-
(left, right) => (left.order ?? 0) - (right.order ?? 0) || left.id.localeCompare(right.id)
|
|
1631
|
-
|
|
1706
|
+
return [...installed]
|
|
1707
|
+
.sort((left, right) => (left.order ?? 0) - (right.order ?? 0) || left.id.localeCompare(right.id))
|
|
1708
|
+
.map((panel) => ({ ...panel, ...settingsContributionCopy(panel, 'settingsPanels') }));
|
|
1632
1709
|
}
|
|
1633
1710
|
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
hostId:
|
|
1639
|
-
|
|
1640
|
-
panels: [...webPluginRegistryForHost(id).pluginSettingsPanels()].sort(
|
|
1641
|
-
(left, right) => (left.order ?? 0) - (right.order ?? 0) || left.id.localeCompare(right.id),
|
|
1642
|
-
),
|
|
1643
|
-
}));
|
|
1711
|
+
/** What one computer's registry offers the Plugins screen as private plugins; never another computer's. */
|
|
1712
|
+
function useLocalPluginSources(hostId?: string) {
|
|
1713
|
+
const panels = useSettingsPanels(hostId);
|
|
1714
|
+
const installed =
|
|
1715
|
+
hostId === undefined ? installedWebPlugins('host') : webPluginRegistryForHost(hostId).installedWebPlugins('host');
|
|
1716
|
+
return { panels, installed };
|
|
1644
1717
|
}
|
|
1645
1718
|
|
|
1646
1719
|
function SettingsPanelRoute({ route }: NativeStackScreenProps<Routes, 'SettingsPanel'>) {
|
|
@@ -1765,7 +1838,8 @@ function MetricsRoute({ route }: NativeStackScreenProps<Routes, 'SettingsMetrics
|
|
|
1765
1838
|
|
|
1766
1839
|
function PluginsRoute({ navigation, route }: NativeStackScreenProps<Routes, 'SettingsPlugins'>) {
|
|
1767
1840
|
const hostId = route.params?.hostId;
|
|
1768
|
-
const market = usePluginMarketplace(hostId);
|
|
1841
|
+
const market = usePluginMarketplace(hostId, undefined, useLocalPluginSources(hostId));
|
|
1842
|
+
const listed = [...market.entries, ...market.localEntries];
|
|
1769
1843
|
const [query, setQuery] = useState('');
|
|
1770
1844
|
const [category, setCategory] = useState(ALL_CATEGORIES);
|
|
1771
1845
|
useFocusEffect(
|
|
@@ -1777,8 +1851,8 @@ function PluginsRoute({ navigation, route }: NativeStackScreenProps<Routes, 'Set
|
|
|
1777
1851
|
);
|
|
1778
1852
|
return (
|
|
1779
1853
|
<PluginCatalogScreen
|
|
1780
|
-
plugins={filterEntries(
|
|
1781
|
-
categories={[...new Set(
|
|
1854
|
+
plugins={filterEntries(listed, query, category, ALL_CATEGORIES, EXTERNAL_CATEGORY)}
|
|
1855
|
+
categories={[...new Set(listed.filter((entry) => entry.source === 'po').map((entry) => entry.category))]}
|
|
1782
1856
|
category={category}
|
|
1783
1857
|
onCategoryChange={setCategory}
|
|
1784
1858
|
query={query}
|
|
@@ -1808,9 +1882,10 @@ function PluginsRoute({ navigation, route }: NativeStackScreenProps<Routes, 'Set
|
|
|
1808
1882
|
|
|
1809
1883
|
function PluginRoute({ navigation, route }: NativeStackScreenProps<Routes, 'SettingsPlugin'>) {
|
|
1810
1884
|
const { id, hostId } = route.params;
|
|
1811
|
-
const
|
|
1885
|
+
const local = useLocalPluginSources(hostId);
|
|
1886
|
+
const market = usePluginMarketplace(hostId, undefined, local);
|
|
1812
1887
|
const [setupOpen, setSetupOpen] = useState(false);
|
|
1813
|
-
const plugin = market.entries.find((entry) => entry.id === id);
|
|
1888
|
+
const plugin = [...market.entries, ...market.localEntries].find((entry) => entry.id === id);
|
|
1814
1889
|
if (plugin === undefined) {
|
|
1815
1890
|
return (
|
|
1816
1891
|
<SectionPage>
|
|
@@ -1834,6 +1909,8 @@ function PluginRoute({ navigation, route }: NativeStackScreenProps<Routes, 'Sett
|
|
|
1834
1909
|
const operation = market.installs[id];
|
|
1835
1910
|
const installError = market.startErrors[id] ?? (operation?.state === 'failed' ? operation.error : undefined);
|
|
1836
1911
|
const openPresets = () => navigation.navigate('SettingsPresets', { hostId });
|
|
1912
|
+
// Pages open through the same Settings panel route, so they keep that route's transport and its host.
|
|
1913
|
+
const pages = local.panels.filter((panel) => pluginPageOf(panel, local.installed, market.layers) === id);
|
|
1837
1914
|
return (
|
|
1838
1915
|
<>
|
|
1839
1916
|
<PluginDetailScreen
|
|
@@ -1843,6 +1920,23 @@ function PluginRoute({ navigation, route }: NativeStackScreenProps<Routes, 'Sett
|
|
|
1843
1920
|
presets={market.summaries}
|
|
1844
1921
|
{...(layer?.version === undefined ? {} : { version: layer.version })}
|
|
1845
1922
|
adds={[]}
|
|
1923
|
+
{...(pages.length === 0
|
|
1924
|
+
? {}
|
|
1925
|
+
: {
|
|
1926
|
+
settings: (
|
|
1927
|
+
<>
|
|
1928
|
+
{pages.map((panel, index) => (
|
|
1929
|
+
<NavRow
|
|
1930
|
+
key={panel.id}
|
|
1931
|
+
title={sentenceCase(panel.label)}
|
|
1932
|
+
value={sentenceCase(panel.detail)}
|
|
1933
|
+
last={index === pages.length - 1}
|
|
1934
|
+
onPress={() => navigation.navigate('SettingsPanel', { id: panel.id, title: panel.label, hostId })}
|
|
1935
|
+
/>
|
|
1936
|
+
))}
|
|
1937
|
+
</>
|
|
1938
|
+
),
|
|
1939
|
+
})}
|
|
1846
1940
|
{...(installError === undefined ? {} : { installError })}
|
|
1847
1941
|
{...(operation?.clash === undefined ? {} : { clash: operation.clash })}
|
|
1848
1942
|
onInstall={() => void market.join(plugin, '')}
|
|
@@ -2016,7 +2110,8 @@ function AppearanceRoute() {
|
|
|
2016
2110
|
locales={nativeLocales()}
|
|
2017
2111
|
onLocale={setLocalePick}
|
|
2018
2112
|
repositories={repositories}
|
|
2019
|
-
templates={catalog.templates.map(({ id, label, description, pluginId }) => ({
|
|
2113
|
+
templates={catalog.templates.map(({ id, label, description, pluginId, translateCopy }) => ({
|
|
2114
|
+
translateCopy,
|
|
2020
2115
|
id,
|
|
2021
2116
|
label,
|
|
2022
2117
|
description,
|
|
@@ -3235,7 +3330,10 @@ function useHomeApps(
|
|
|
3235
3330
|
return [
|
|
3236
3331
|
{
|
|
3237
3332
|
key,
|
|
3238
|
-
title:
|
|
3333
|
+
title: t(
|
|
3334
|
+
`plugin.${splitHostId(fill.pluginId)?.localId ?? fill.pluginId}.dashboardTiles.${fill.id}.label`,
|
|
3335
|
+
data.title,
|
|
3336
|
+
),
|
|
3239
3337
|
size: data.size,
|
|
3240
3338
|
Icon: data.icon as ComponentType<IconProps> | undefined,
|
|
3241
3339
|
onOpen:
|
|
@@ -3399,7 +3497,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
3399
3497
|
const multi = hostStates.length > 1;
|
|
3400
3498
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
3401
3499
|
// Settings names a computer once any is paired, so its calls never ride the implicit session.
|
|
3402
|
-
// With several and All hosts chosen,
|
|
3500
|
+
// With several and All hosts chosen, no host is selected: Settings shows only this phone and the account.
|
|
3403
3501
|
const settingsHost = multi ? scope?.host.id : hostStates[0]?.host.id;
|
|
3404
3502
|
const settingsComputers =
|
|
3405
3503
|
hostStates.length > 1
|
|
@@ -4108,7 +4206,14 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
4108
4206
|
name="SettingsPanel"
|
|
4109
4207
|
component={SettingsPanelRoute}
|
|
4110
4208
|
options={({ route }) => ({
|
|
4111
|
-
title:
|
|
4209
|
+
title: (() => {
|
|
4210
|
+
const panel = (
|
|
4211
|
+
route.params.hostId === undefined
|
|
4212
|
+
? pluginSettingsPanels()
|
|
4213
|
+
: webPluginRegistryForHost(route.params.hostId).pluginSettingsPanels()
|
|
4214
|
+
).find((entry) => entry.id === route.params.id);
|
|
4215
|
+
return panel ? settingsContributionCopy(panel, 'settingsPanels').label : route.params.title;
|
|
4216
|
+
})(),
|
|
4112
4217
|
headerBackTitle: settingsBack(),
|
|
4113
4218
|
headerBackButtonDisplayMode: 'default',
|
|
4114
4219
|
})}
|
|
@@ -4162,7 +4267,17 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
|
|
|
4162
4267
|
name="SettingsSection"
|
|
4163
4268
|
component={ContributedSectionRoute}
|
|
4164
4269
|
options={({ route }) => ({
|
|
4165
|
-
title:
|
|
4270
|
+
title: (() => {
|
|
4271
|
+
const scope = route.params.workspace ? 'workspace' : 'host';
|
|
4272
|
+
const section = (
|
|
4273
|
+
route.params.hostId === undefined
|
|
4274
|
+
? pluginSettingsSections(scope)
|
|
4275
|
+
: webPluginRegistryForHost(route.params.hostId).pluginSettingsSections(scope)
|
|
4276
|
+
).find((entry) => entry.id === route.params.id);
|
|
4277
|
+
return section
|
|
4278
|
+
? sentenceCase(settingsContributionCopy(section, 'settingsSections').label)
|
|
4279
|
+
: route.params.title;
|
|
4280
|
+
})(),
|
|
4166
4281
|
headerBackTitle: route.params.workspace ? workspacesBack() : settingsBack(),
|
|
4167
4282
|
headerBackButtonDisplayMode: 'default',
|
|
4168
4283
|
})}
|