@agimon-ai/po-native 0.0.1-alpha.76 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-native",
3
- "version": "0.0.1-alpha.76",
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.196",
33
- "@agimon-ai/po-expo-signing": "0.0.1-alpha.76",
34
- "@agimon-ai/po-identity": "0.0.2-alpha.143",
35
- "@agimon-ai/po-native-components": "0.0.0-alpha.196",
36
- "@agimon-ai/po-native-dashboard": "0.0.0-alpha.68",
37
- "@agimon-ai/po-template-advanced": "0.0.0-alpha.196",
38
- "@agimon-ai/po-template-elegant": "0.0.0-alpha.196",
39
- "@agimon-ai/po-voice": "0.0.0-alpha.196",
40
- "@agimon-ai/po-web-components": "0.0.0-alpha.196",
41
- "@agimon-ai/po-web-dashboard": "0.0.0-alpha.196",
42
- "@agimon-ai/po-web-security": "0.0.0-alpha.196",
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",
@@ -1,4 +1,4 @@
1
- import { t, useT } 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
- return (
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,7 +238,7 @@ function SelfHostedAccountRoute({
235
238
  onBack,
236
239
  stack,
237
240
  }: AccountRouteProps & { page?: 'methods'; onBack: () => void }) {
238
- const t = useT();
241
+ useT();
239
242
  const [permission, requestPermission] = useCameraPermissions();
240
243
  const latest = useRef({ permission, requestPermission, onScan, onUseCloud, onForgetCloud });
241
244
  latest.current = { permission, requestPermission, onScan, onUseCloud, onForgetCloud };
@@ -259,7 +262,13 @@ function SelfHostedAccountRoute({
259
262
  now,
260
263
  },
261
264
  // Reached from hosted sign-in, the selected issuer is hosted Po Cloud: never restore it as an identity home.
262
- { firstRun, foreground: AppState.currentState === 'active', ...(page ? { page, restore: false } : {}) },
265
+ {
266
+ firstRun,
267
+ foreground: AppState.currentState === 'active',
268
+ t,
269
+ readLocale: currentLocale,
270
+ ...(page ? { page, restore: false } : {}),
271
+ },
263
272
  ),
264
273
  );
265
274
  useEffect(() => {
@@ -272,7 +281,7 @@ function SelfHostedAccountRoute({
272
281
  }, [flow]);
273
282
  const state = useStore(flow.state);
274
283
  const linkNotice = useStore(accountLinkNotice);
275
- const view = accountViewModel(state, { firstRun, linkNotice });
284
+ const view = accountViewModel(state, { firstRun, linkNotice, t });
276
285
  const error = view.signInUnavailable
277
286
  ? t(
278
287
  'native.account.signInUnreachable',
package/src/app/App.tsx CHANGED
@@ -38,6 +38,7 @@ import {
38
38
  SheetTitle,
39
39
  SheetBody,
40
40
  UsersIcon,
41
+ ReferenceChip,
41
42
  yieldSheets,
42
43
  } from '@agimon-ai/po-native-components';
43
44
  import {
@@ -62,6 +63,7 @@ import {
62
63
  webTabs,
63
64
  subscribeWebPluginRegistry,
64
65
  pluginSettingsPanels,
66
+ pluginSettingsSections,
65
67
  applySessionRemoved,
66
68
  applySessionUpsert,
67
69
  sessionMoveTarget,
@@ -84,6 +86,7 @@ import {
84
86
  liveSessionOptions,
85
87
  mentionableSessions,
86
88
  resolveSessionReference,
89
+ SESSION_REFERENCE_SCHEME,
87
90
  activityWaitingCount,
88
91
  sessionStoreFor,
89
92
  sessionModes,
@@ -187,6 +190,7 @@ import { ClientDevices } from '../screens/ClientDevices';
187
190
  import {
188
191
  ContributedSettingsScreen,
189
192
  sectionSummary,
193
+ settingsContributionCopy,
190
194
  useContributedSettings,
191
195
  useSettingsSections,
192
196
  } from '../screens/ContributedSettingsScreen';
@@ -197,6 +201,7 @@ import { HomeAppsSection, HomeAttentionScreen, HomeScreen, type HomeView } from
197
201
  import { HostDrawer, HostMenuButton } from '../screens/HostDrawer';
198
202
  import { FirstSessionWelcome } from '../screens/HostedOnboarding';
199
203
  import { ImagesScreen, imagesSummary, useImageSettings } from '../screens/ImagesScreen';
204
+ import { pluginPageOf } from '../screens/localPlugins';
200
205
  import { McpServersScreen, mcpServersSummary, useMcpServers } from '../screens/McpServersScreen';
201
206
  import { MetricsScreen, useMetrics } from '../screens/MetricsScreen';
202
207
  import { ALL_CATEGORIES, EXTERNAL_CATEGORY, PluginCatalogScreen } from '../screens/PluginCatalogScreen';
@@ -216,7 +221,7 @@ import {
216
221
  SettingsScreen,
217
222
  sentenceCase,
218
223
  } from '../screens/SettingsScreen';
219
- import { isCuratedPlugin, useCuratedPackages, usePluginMarketplace } from '../screens/usePluginMarketplace';
224
+ import { isCuratedPlugin, useCatalogLayers, usePluginMarketplace } from '../screens/usePluginMarketplace';
220
225
  import { workspacePageState } from '../screens/workspaceModel';
221
226
  import type { ProviderCandidate } from '../screens/WorkspaceProviders';
222
227
  import { WorkspaceProvidersSection } from '../screens/WorkspaceProvidersSection';
@@ -685,6 +690,38 @@ function LiveSessionScreen({
685
690
  );
686
691
  }
687
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
+ }
688
725
  function SessionTabTitle({ tab }: { tab: Pick<TransientTab, 'label' | 'translateLabel'> }) {
689
726
  const t = useT();
690
727
  return (
@@ -1034,32 +1071,55 @@ function SessionRoute({
1034
1071
  const resolveFileLink = useFileLinks(sessionId);
1035
1072
  // Message text, as in the cockpit: images load from the session's open folders, and a path a plugin
1036
1073
  // claims opens that plugin's file view in this session's stack.
1037
- const markdown = useMemo(
1038
- () => ({
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 {
1039
1095
  loadImage: (path: string) => loadSessionImage(sessionId, path),
1040
- onFileLink: (label: string, explicit = false) => {
1041
- // `@session:<token>` opens that session, found among the ones on this session's computer.
1042
- const mentioned = explicit
1043
- ? undefined
1044
- : resolveSessionReference(
1045
- label,
1046
- mentionableSessions(sessionsStore.state, workspacesStore.state.byId, sessionId, Date.now()),
1047
- );
1048
- if (mentioned !== undefined) {
1049
- const hostId = splitHostId(sessionId)?.hostId;
1050
- return () => openSession(hostId === undefined ? mentioned.id : qualifyHostId(hostId, mentioned.id));
1051
- }
1052
- const tab = explicit ? fileTabForPath(sessionId, label) : resolveFileLink(label);
1053
- if (tab === undefined) return undefined;
1054
- return () => {
1055
- openTransientTab(ownerSessionId, tab);
1056
- setActivityOpen(false);
1057
- inner.current?.navigate('ActivityDetail', { tabId: tab.id }, { pop: true });
1058
- };
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
+ );
1059
1120
  },
1060
- }),
1061
- [sessionId, ownerSessionId, resolveFileLink, openSession],
1062
- );
1121
+ };
1122
+ }, [sessionId, ownerSessionId, resolveFileLink, openSession]);
1063
1123
  const openTab = (tabId: string | null) => {
1064
1124
  setActivityOpen(false);
1065
1125
  if (!inner.current) return;
@@ -1372,12 +1432,13 @@ function SessionRoute({
1372
1432
  name="ActivityDetail"
1373
1433
  getId={({ params }) => params.tabId}
1374
1434
  options={({ route: detail }) => {
1375
- const tab = transientTabs.find((tab) => tab.id === detail.params.tabId);
1435
+ const tab =
1436
+ transientTabs.find((tab) => tab.id === detail.params.tabId) ??
1437
+ webTabs(ownerSessionId).find((tab) => tab.id === detail.params.tabId);
1376
1438
  return {
1377
1439
  title:
1378
- tab?.translateLabel?.(t) ??
1440
+ (tab && 'translateLabel' in tab ? tab.translateLabel?.(t) : undefined) ??
1379
1441
  tab?.label ??
1380
- webTabs(ownerSessionId).find((tab) => tab.id === detail.params.tabId)?.label ??
1381
1442
  t('native.app.activity', 'Activity'),
1382
1443
  // iOS 26 defaults to a whole-screen back swipe, which steals drags on Author canvases; keep the edge swipe.
1383
1444
  fullScreenGestureEnabled: false,
@@ -1487,12 +1548,16 @@ function SettingsRoute(
1487
1548
  const installedPlugins =
1488
1549
  settingsHost === undefined ? installedWebPlugins() : webPluginRegistryForHost(settingsHost).installedWebPlugins();
1489
1550
  // A curated plugin's pages live on its own Plugins screen, so Settings leaves them out.
1490
- const curated = useCuratedPackages(settingsHost);
1551
+ const catalog = useCatalogLayers(settingsHost);
1552
+ const curated = useMemo(() => catalog && new Set(catalog.flatMap((layer) => layer.packages)), [catalog]);
1491
1553
  const listed = (pluginId: string) => !isCuratedPlugin(pluginId, installedPlugins, curated);
1492
- const panels = useSettingsPanels(settingsHost).filter((panel) => listed(panel.pluginId));
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
+ );
1493
1559
  // A page about the person sits in the Global card, not among the computer's features.
1494
1560
  const globalPanels = props.phoneOnly ? [] : panels.filter((panel) => panel.menuGroup === 'global');
1495
- const panelGroups = useSettingsPanelGroups(props.phoneOnly ? props.computers : undefined);
1496
1561
  const sections = useSettingsSections('host', settingsHost).filter((section) => listed(section.pluginId));
1497
1562
  const sectionKeys = sections.flatMap((section) => section.fields.map(settingsKeyOf)).join('\n');
1498
1563
  const plugins = installedPlugins.length;
@@ -1546,23 +1611,21 @@ function SettingsRoute(
1546
1611
  );
1547
1612
  const appearance = useStore(appearanceStore, (state) => state);
1548
1613
  const teamName = hostedTeamName.data;
1549
- const openPanel = (id: string, owner = settingsHost) => {
1550
- const computer = props.computers?.find((candidate) => candidate.id === owner);
1551
- if (owner === undefined ? !allowed : computer?.online === false) {
1614
+ const openPanel = (id: string) => {
1615
+ const computer = props.computers?.find((candidate) => candidate.id === settingsHost);
1616
+ if (settingsHost === undefined ? !allowed : computer?.online === false) {
1552
1617
  Alert.alert(
1553
1618
  t('native.app.tab.settings', 'Settings'),
1554
1619
  computer ? t('native.app.computerOffline', '{name} is offline.', { name: computer.label }) : refused,
1555
1620
  );
1556
1621
  return;
1557
1622
  }
1558
- const panel = (owner === settingsHost ? panels : panelGroups.find((group) => group.hostId === owner)?.panels)?.find(
1559
- (candidate) => candidate.id === id,
1560
- );
1623
+ const panel = panels.find((candidate) => candidate.id === id);
1561
1624
  if (panel)
1562
1625
  navigation.navigate('SettingsPanel', {
1563
1626
  id,
1564
1627
  title: panel.label,
1565
- ...(owner === undefined ? {} : { hostId: owner }),
1628
+ ...(settingsHost === undefined ? {} : { hostId: settingsHost }),
1566
1629
  });
1567
1630
  };
1568
1631
  return (
@@ -1595,7 +1658,7 @@ function SettingsRoute(
1595
1658
  appearance={appearanceLabel(appearance)}
1596
1659
  {...(teamName ? { team: teamName } : {})}
1597
1660
  {...(images ? { images } : {})}
1598
- plugins={`${String(plugins)} installed`}
1661
+ plugins={t('native.app.pluginsInstalled', '{count} installed', { count: plugins })}
1599
1662
  sections={sections.map((section) => {
1600
1663
  const summary = sectionSummary(section, sectionValues);
1601
1664
  return { id: section.id, label: section.label, ...(summary === undefined ? {} : { summary }) };
@@ -1626,7 +1689,6 @@ function SettingsRoute(
1626
1689
  navigation.navigate(section, settingsHost === undefined ? undefined : { hostId: settingsHost });
1627
1690
  }}
1628
1691
  panels={panels.filter((panel) => panel.menuGroup !== 'global')}
1629
- panelGroups={panelGroups}
1630
1692
  onOpenPanel={openPanel}
1631
1693
  />
1632
1694
  );
@@ -1641,21 +1703,17 @@ function useSettingsPanels(hostId?: string) {
1641
1703
  useEffect(() => subscribeWebPluginRegistry(() => setVersion((value) => value + 1)), []);
1642
1704
  const installed =
1643
1705
  hostId === undefined ? pluginSettingsPanels() : webPluginRegistryForHost(hostId).pluginSettingsPanels();
1644
- return [...installed].sort(
1645
- (left, right) => (left.order ?? 0) - (right.order ?? 0) || left.id.localeCompare(right.id),
1646
- );
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') }));
1647
1709
  }
1648
1710
 
1649
- function useSettingsPanelGroups(computers: React.ComponentProps<typeof SettingsScreen>['computers']) {
1650
- const [, setVersion] = useState(0);
1651
- useEffect(() => subscribeWebPluginRegistry(() => setVersion((value) => value + 1)), []);
1652
- return (computers ?? []).map(({ id, label }) => ({
1653
- hostId: id,
1654
- label,
1655
- panels: [...webPluginRegistryForHost(id).pluginSettingsPanels()].sort(
1656
- (left, right) => (left.order ?? 0) - (right.order ?? 0) || left.id.localeCompare(right.id),
1657
- ),
1658
- }));
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 };
1659
1717
  }
1660
1718
 
1661
1719
  function SettingsPanelRoute({ route }: NativeStackScreenProps<Routes, 'SettingsPanel'>) {
@@ -1780,7 +1838,8 @@ function MetricsRoute({ route }: NativeStackScreenProps<Routes, 'SettingsMetrics
1780
1838
 
1781
1839
  function PluginsRoute({ navigation, route }: NativeStackScreenProps<Routes, 'SettingsPlugins'>) {
1782
1840
  const hostId = route.params?.hostId;
1783
- const market = usePluginMarketplace(hostId);
1841
+ const market = usePluginMarketplace(hostId, undefined, useLocalPluginSources(hostId));
1842
+ const listed = [...market.entries, ...market.localEntries];
1784
1843
  const [query, setQuery] = useState('');
1785
1844
  const [category, setCategory] = useState(ALL_CATEGORIES);
1786
1845
  useFocusEffect(
@@ -1792,8 +1851,8 @@ function PluginsRoute({ navigation, route }: NativeStackScreenProps<Routes, 'Set
1792
1851
  );
1793
1852
  return (
1794
1853
  <PluginCatalogScreen
1795
- plugins={filterEntries(market.entries, query, category, ALL_CATEGORIES, EXTERNAL_CATEGORY)}
1796
- categories={[...new Set(market.entries.filter((entry) => entry.source === 'po').map((entry) => entry.category))]}
1854
+ plugins={filterEntries(listed, query, category, ALL_CATEGORIES, EXTERNAL_CATEGORY)}
1855
+ categories={[...new Set(listed.filter((entry) => entry.source === 'po').map((entry) => entry.category))]}
1797
1856
  category={category}
1798
1857
  onCategoryChange={setCategory}
1799
1858
  query={query}
@@ -1823,9 +1882,10 @@ function PluginsRoute({ navigation, route }: NativeStackScreenProps<Routes, 'Set
1823
1882
 
1824
1883
  function PluginRoute({ navigation, route }: NativeStackScreenProps<Routes, 'SettingsPlugin'>) {
1825
1884
  const { id, hostId } = route.params;
1826
- const market = usePluginMarketplace(hostId);
1885
+ const local = useLocalPluginSources(hostId);
1886
+ const market = usePluginMarketplace(hostId, undefined, local);
1827
1887
  const [setupOpen, setSetupOpen] = useState(false);
1828
- const plugin = market.entries.find((entry) => entry.id === id);
1888
+ const plugin = [...market.entries, ...market.localEntries].find((entry) => entry.id === id);
1829
1889
  if (plugin === undefined) {
1830
1890
  return (
1831
1891
  <SectionPage>
@@ -1849,6 +1909,8 @@ function PluginRoute({ navigation, route }: NativeStackScreenProps<Routes, 'Sett
1849
1909
  const operation = market.installs[id];
1850
1910
  const installError = market.startErrors[id] ?? (operation?.state === 'failed' ? operation.error : undefined);
1851
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);
1852
1914
  return (
1853
1915
  <>
1854
1916
  <PluginDetailScreen
@@ -1858,6 +1920,23 @@ function PluginRoute({ navigation, route }: NativeStackScreenProps<Routes, 'Sett
1858
1920
  presets={market.summaries}
1859
1921
  {...(layer?.version === undefined ? {} : { version: layer.version })}
1860
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
+ })}
1861
1940
  {...(installError === undefined ? {} : { installError })}
1862
1941
  {...(operation?.clash === undefined ? {} : { clash: operation.clash })}
1863
1942
  onInstall={() => void market.join(plugin, '')}
@@ -2031,7 +2110,8 @@ function AppearanceRoute() {
2031
2110
  locales={nativeLocales()}
2032
2111
  onLocale={setLocalePick}
2033
2112
  repositories={repositories}
2034
- templates={catalog.templates.map(({ id, label, description, pluginId }) => ({
2113
+ templates={catalog.templates.map(({ id, label, description, pluginId, translateCopy }) => ({
2114
+ translateCopy,
2035
2115
  id,
2036
2116
  label,
2037
2117
  description,
@@ -3250,7 +3330,10 @@ function useHomeApps(
3250
3330
  return [
3251
3331
  {
3252
3332
  key,
3253
- title: data.title,
3333
+ title: t(
3334
+ `plugin.${splitHostId(fill.pluginId)?.localId ?? fill.pluginId}.dashboardTiles.${fill.id}.label`,
3335
+ data.title,
3336
+ ),
3254
3337
  size: data.size,
3255
3338
  Icon: data.icon as ComponentType<IconProps> | undefined,
3256
3339
  onOpen:
@@ -3414,7 +3497,7 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
3414
3497
  const multi = hostStates.length > 1;
3415
3498
  const [drawerOpen, setDrawerOpen] = useState(false);
3416
3499
  // Settings names a computer once any is paired, so its calls never ride the implicit session.
3417
- // With several and All hosts chosen, built-in settings stay phone-wide; plugin pages retain each host.
3500
+ // With several and All hosts chosen, no host is selected: Settings shows only this phone and the account.
3418
3501
  const settingsHost = multi ? scope?.host.id : hostStates[0]?.host.id;
3419
3502
  const settingsComputers =
3420
3503
  hostStates.length > 1
@@ -4123,7 +4206,14 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
4123
4206
  name="SettingsPanel"
4124
4207
  component={SettingsPanelRoute}
4125
4208
  options={({ route }) => ({
4126
- title: route.params.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
+ })(),
4127
4217
  headerBackTitle: settingsBack(),
4128
4218
  headerBackButtonDisplayMode: 'default',
4129
4219
  })}
@@ -4177,7 +4267,17 @@ export function App({ nativeHost }: { nativeHost?: (sessionId: string) => Native
4177
4267
  name="SettingsSection"
4178
4268
  component={ContributedSectionRoute}
4179
4269
  options={({ route }) => ({
4180
- title: route.params.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
+ })(),
4181
4281
  headerBackTitle: route.params.workspace ? workspacesBack() : settingsBack(),
4182
4282
  headerBackButtonDisplayMode: 'default',
4183
4283
  })}
@@ -1,22 +1,39 @@
1
- import { encodeBase64, t } from '@agimon-ai/po-core/native';
1
+ import { encodeBase64, t, useLocale } from '@agimon-ai/po-core/native';
2
2
  import {
3
3
  createStarterProfile,
4
4
  invokeModeAction,
5
5
  saveStarterAboutYou,
6
6
  STARTER_POS,
7
7
  type StarterPo,
8
+ subscribeWebPluginRegistry,
8
9
  waitForSession,
10
+ webPluginRegistryRevision,
9
11
  whenSessionReady,
10
12
  } from '@agimon-ai/po-web-dashboard/core';
11
13
  import { useFocusEffect } from '@react-navigation/native';
12
- import { useCallback, useState } from 'react';
13
- import { Image } from 'react-native';
14
+ import { type ReactNode, useCallback, useState, useSyncExternalStore } from 'react';
15
+ import { Image, View } from 'react-native';
14
16
 
15
- import { AboutYouStep, ChoosePoDeck, ConnectProviderStep, PO_ART } from '../screens/HostedOnboarding';
17
+ import { AboutYouStep, ChoosePoDeck, ConnectProviderStep, LanguagePicker, PO_ART } from '../screens/HostedOnboarding';
16
18
  import { apiTransportForHost } from '../services/apiTransport';
17
19
  import { openFirstSession } from '../services/hostActions';
18
20
  import { listProviders } from '../services/settingsApi';
19
21
  import { rememberFirstSessionWelcome } from './firstSteps';
22
+ import { nativeLocales, setLocalePick } from './locale';
23
+
24
+ const FILL = { flex: 1 } as const;
25
+
26
+ /** A first-run screen with the language switch over its top-right corner. Packs arrive with computers. */
27
+ export function WithOnboardingLanguage({ children }: { children: ReactNode }) {
28
+ useSyncExternalStore(subscribeWebPluginRegistry, webPluginRegistryRevision);
29
+ const locale = useLocale();
30
+ return (
31
+ <View style={FILL}>
32
+ {children}
33
+ <LanguagePicker locales={nativeLocales()} value={locale} onChange={setLocalePick} />
34
+ </View>
35
+ );
36
+ }
20
37
 
21
38
  /** Read when it is shown, so it follows the language. */
22
39
  const notListed = () =>
@@ -117,30 +134,39 @@ export function OnboardingRoute({
117
134
  };
118
135
 
119
136
  if (provider === 'checking') return null;
120
- if (provider === 'missing') return <ConnectProviderStep onConnect={onConnectProvider} />;
137
+ if (provider === 'missing')
138
+ return (
139
+ <WithOnboardingLanguage>
140
+ <ConnectProviderStep onConnect={onConnectProvider} />
141
+ </WithOnboardingLanguage>
142
+ );
121
143
  if (po === null)
122
144
  return (
123
- <ChoosePoDeck
124
- pos={STARTER_POS}
125
- {...(settingUpId === undefined ? {} : { settingUpId })}
126
- {...(failed === undefined ? {} : { failed })}
127
- onChoose={(chosen) => void choose(chosen)}
128
- />
145
+ <WithOnboardingLanguage>
146
+ <ChoosePoDeck
147
+ pos={STARTER_POS}
148
+ {...(settingUpId === undefined ? {} : { settingUpId })}
149
+ {...(failed === undefined ? {} : { failed })}
150
+ onChoose={(chosen) => void choose(chosen)}
151
+ />
152
+ </WithOnboardingLanguage>
129
153
  );
130
154
  return (
131
- <AboutYouStep
132
- po={po}
133
- name={name}
134
- interests={interests}
135
- busy={busy}
136
- {...(error === '' ? {} : { error })}
137
- onNameChange={setName}
138
- onInterestsChange={setInterests}
139
- onBack={() => {
140
- setError('');
141
- setPo(null);
142
- }}
143
- onContinue={() => void finish(po)}
144
- />
155
+ <WithOnboardingLanguage>
156
+ <AboutYouStep
157
+ po={po}
158
+ name={name}
159
+ interests={interests}
160
+ busy={busy}
161
+ {...(error === '' ? {} : { error })}
162
+ onNameChange={setName}
163
+ onInterestsChange={setInterests}
164
+ onBack={() => {
165
+ setError('');
166
+ setPo(null);
167
+ }}
168
+ onContinue={() => void finish(po)}
169
+ />
170
+ </WithOnboardingLanguage>
145
171
  );
146
172
  }
@@ -1,4 +1,4 @@
1
- import { t } from '@agimon-ai/po-core/native';
1
+ import { currentLocale, t } from '@agimon-ai/po-core/native';
2
2
  import type { WebPluginSlotProps } from '@agimon-ai/po-core/web';
3
3
  import {
4
4
  Badge,
@@ -32,7 +32,7 @@ import { StyleSheet } from 'react-native-unistyles';
32
32
  import { contextRows, type ContextRow } from './contextRows';
33
33
  /** The tilde is the whole caveat in one character: this is arithmetic, not a bill. */
34
34
  function tokens(value: number | null): string {
35
- return value === null ? '-' : `~${value.toLocaleString()}`;
35
+ return value === null ? '-' : `~${value.toLocaleString(currentLocale())}`;
36
36
  }
37
37
 
38
38
  function sentenceCase(name: string): string {
@@ -46,6 +46,7 @@ export interface AppearanceTemplate {
46
46
  id: string;
47
47
  label: string;
48
48
  description: string;
49
+ translateCopy?: (t: (key: string, fallback: string) => string) => { label: string; description: string };
49
50
  pluginId: string;
50
51
  }
51
52
 
@@ -173,10 +174,10 @@ export function AppearanceScreen(props: AppearanceScreenProps) {
173
174
  templates.map((template, index) => (
174
175
  <CardOption
175
176
  key={template.id}
176
- title={template.label}
177
+ title={template.translateCopy?.(t).label ?? template.label}
177
178
  detail={
178
179
  <View style={styles.detail}>
179
- <Text style={styles.dim}>{template.description}</Text>
180
+ <Text style={styles.dim}>{template.translateCopy?.(t).description ?? template.description}</Text>
180
181
  <Mono>{template.pluginId}</Mono>
181
182
  </View>
182
183
  }