@agimon-ai/po-native 0.0.1-alpha.75 → 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/package.json +12 -12
- package/src/app/AccountRoute.tsx +11 -2
- package/src/app/App.tsx +29 -14
- package/src/app/useHome.ts +8 -4
- package/src/components/ActivitySheet.tsx +34 -25
- package/src/components/ConnectCard.tsx +1 -0
- 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/ContributedSettingsScreen.tsx +1 -0
- package/src/screens/HostDrawer.tsx +1 -0
- package/src/screens/McpServersScreen.tsx +3 -0
- package/src/screens/PairingScreen.tsx +1 -0
- package/src/screens/TeamView.tsx +1 -0
- package/src/services/nativePush/index.ts +4 -3
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.76",
|
|
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.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",
|
|
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 { t, useT } from '@agimon-ai/po-core/native';
|
|
2
2
|
import {
|
|
3
3
|
accountViewModel,
|
|
4
4
|
createHostedAccountFlow,
|
|
@@ -235,6 +235,7 @@ function SelfHostedAccountRoute({
|
|
|
235
235
|
onBack,
|
|
236
236
|
stack,
|
|
237
237
|
}: AccountRouteProps & { page?: 'methods'; onBack: () => void }) {
|
|
238
|
+
const t = useT();
|
|
238
239
|
const [permission, requestPermission] = useCameraPermissions();
|
|
239
240
|
const latest = useRef({ permission, requestPermission, onScan, onUseCloud, onForgetCloud });
|
|
240
241
|
latest.current = { permission, requestPermission, onScan, onUseCloud, onForgetCloud };
|
|
@@ -271,11 +272,19 @@ function SelfHostedAccountRoute({
|
|
|
271
272
|
}, [flow]);
|
|
272
273
|
const state = useStore(flow.state);
|
|
273
274
|
const linkNotice = useStore(accountLinkNotice);
|
|
275
|
+
const view = accountViewModel(state, { firstRun, linkNotice });
|
|
276
|
+
const error = view.signInUnavailable
|
|
277
|
+
? t(
|
|
278
|
+
'native.account.signInUnreachable',
|
|
279
|
+
"Po can't reach your sign-in server right now. You can still pair a computer without an account.",
|
|
280
|
+
)
|
|
281
|
+
: view.error;
|
|
274
282
|
return (
|
|
275
283
|
<>
|
|
276
284
|
<AccountPage
|
|
277
285
|
stack={stack}
|
|
278
|
-
{...
|
|
286
|
+
{...view}
|
|
287
|
+
error={error}
|
|
279
288
|
onDeviceName={flow.setDeviceName}
|
|
280
289
|
onIssuer={flow.setIssuerDraft}
|
|
281
290
|
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,
|
|
@@ -680,6 +685,14 @@ function LiveSessionScreen({
|
|
|
680
685
|
);
|
|
681
686
|
}
|
|
682
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
|
+
}
|
|
683
696
|
function SessionRoute({
|
|
684
697
|
route,
|
|
685
698
|
navigation,
|
|
@@ -715,6 +728,7 @@ function SessionRoute({
|
|
|
715
728
|
nativeHost?: (sessionId: string) => NativeSlotHost;
|
|
716
729
|
}) {
|
|
717
730
|
useRenderTrace('SessionRoute');
|
|
731
|
+
const t = useT();
|
|
718
732
|
const { sessionId: ownerSessionId } = route.params;
|
|
719
733
|
const focused = useIsFocused();
|
|
720
734
|
const [foreground, setForeground] = useState(AppState.currentState === 'active');
|
|
@@ -1269,7 +1283,7 @@ function SessionRoute({
|
|
|
1269
1283
|
// Background stack screens keep their tabs mounted; only the selected one shows the sheet.
|
|
1270
1284
|
conversationOpen: conversationOpen && tab.id === selectedTabId,
|
|
1271
1285
|
onConversationOpenChange: setConversationOpen,
|
|
1272
|
-
asideLabel: tab.label,
|
|
1286
|
+
asideLabel: ('translateLabel' in tab ? tab.translateLabel?.(t) : undefined) ?? tab.label,
|
|
1273
1287
|
}
|
|
1274
1288
|
: {})}
|
|
1275
1289
|
sessionId={sessionId}
|
|
@@ -1357,14 +1371,18 @@ function SessionRoute({
|
|
|
1357
1371
|
<SessionStack.Screen
|
|
1358
1372
|
name="ActivityDetail"
|
|
1359
1373
|
getId={({ params }) => params.tabId}
|
|
1360
|
-
options={({ route: detail }) =>
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
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
|
+
}}
|
|
1368
1386
|
listeners={({ route: detail }) => ({
|
|
1369
1387
|
beforeRemove: () => {
|
|
1370
1388
|
tabHeaders.current.delete(detail.params.tabId);
|
|
@@ -1392,14 +1410,11 @@ function SessionRoute({
|
|
|
1392
1410
|
);
|
|
1393
1411
|
let setTabHeader = tabHeaders.current.get(tab.id);
|
|
1394
1412
|
if (!setTabHeader) {
|
|
1395
|
-
const label = tab.label;
|
|
1396
1413
|
setTabHeader = (header) =>
|
|
1397
1414
|
child.setOptions({
|
|
1398
1415
|
headerTitle: () => (
|
|
1399
1416
|
<View style={styles.headerTitle}>
|
|
1400
|
-
<
|
|
1401
|
-
{label}
|
|
1402
|
-
</Text>
|
|
1417
|
+
<SessionTabTitle tab={tab} />
|
|
1403
1418
|
{header.subtitle ? (
|
|
1404
1419
|
<Text style={styles.headerStatus('quiet')} numberOfLines={1}>
|
|
1405
1420
|
{header.subtitle}
|
package/src/app/useHome.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hostRevisionTopic, subscribeHubRevision,
|
|
1
|
+
import { hostRevisionTopic, subscribeHubRevision, useT, type HomeRequest } from '@agimon-ai/po-core/native';
|
|
2
2
|
import {
|
|
3
3
|
pluginHomeContributions,
|
|
4
4
|
qualifyHostId,
|
|
@@ -48,6 +48,7 @@ export function useHome(
|
|
|
48
48
|
hostId?: string,
|
|
49
49
|
attention = false,
|
|
50
50
|
) {
|
|
51
|
+
const t = useT();
|
|
51
52
|
const revisionTopic = hostRevisionTopic('home', hostId);
|
|
52
53
|
const reader = attention ? (runtime?.attentionHome ?? runtime?.home) : runtime?.home;
|
|
53
54
|
const current = useStore(reader?.store ?? disconnected, (value) => value);
|
|
@@ -64,8 +65,10 @@ export function useHome(
|
|
|
64
65
|
...pluginHomeContributions({ scope: 'host' }),
|
|
65
66
|
...workspaces.flatMap((workspace) => pluginHomeContributions({ scope: 'workspace', workspaceId: workspace.id })),
|
|
66
67
|
];
|
|
67
|
-
return [
|
|
68
|
-
|
|
68
|
+
return [
|
|
69
|
+
...new Map(entries.map((item) => [JSON.stringify([item.pluginId, item.id, item.mount]), item])).values(),
|
|
70
|
+
].map((item) => ({ ...item, data: { ...item.data, label: item.data.translateLabel?.(t) ?? item.data.label } }));
|
|
71
|
+
}, [registryVersion, workspaces, t]);
|
|
69
72
|
const { source, workspaceId } = filter;
|
|
70
73
|
// The host still builds a full snapshot before paging. This bounds client reads, not host
|
|
71
74
|
// snapshot work; incremental snapshots need a separate protocol change.
|
|
@@ -136,6 +139,7 @@ export function useHomes(
|
|
|
136
139
|
hosts: readonly { hostId: string; label: string; runtime?: LiveRuntime }[],
|
|
137
140
|
attention = false,
|
|
138
141
|
) {
|
|
142
|
+
const t = useT();
|
|
139
143
|
// Callers rebuild the host array during render. Track connection identity, not array identity
|
|
140
144
|
// or runtime presence, so replacement connections retire their subscriptions and requests.
|
|
141
145
|
const previous = useRef(hosts);
|
|
@@ -221,7 +225,7 @@ export function useHomes(
|
|
|
221
225
|
...own.flatMap((workspace) => pluginHomeContributions({ scope: 'workspace', workspaceId: workspace.id })),
|
|
222
226
|
].map((item) => [JSON.stringify([item.pluginId, item.id, item.mount]), item]),
|
|
223
227
|
).values(),
|
|
224
|
-
];
|
|
228
|
+
].map((item) => ({ ...item, data: { ...item.data, label: item.data.translateLabel?.(t) ?? item.data.label } }));
|
|
225
229
|
const entries =
|
|
226
230
|
runtime && state.supported !== null
|
|
227
231
|
? Object.entries(byId).filter(([id]) => splitHostId(id)?.hostId === hostId)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useT } from '@agimon-ai/po-core/native';
|
|
2
2
|
import type { WebPluginSlotProps } from '@agimon-ai/po-core/web';
|
|
3
3
|
import {
|
|
4
4
|
ActivityIcon,
|
|
@@ -31,7 +31,7 @@ import { StyleSheet } from 'react-native-unistyles';
|
|
|
31
31
|
import type { ActivityLoadState } from '../app/liveRuntime';
|
|
32
32
|
import { ContextFace } from './ContextFace';
|
|
33
33
|
|
|
34
|
-
const faces = (): readonly { id: string; label: string }[] => [
|
|
34
|
+
const faces = (t: ReturnType<typeof useT>): readonly { id: string; label: string }[] => [
|
|
35
35
|
{ id: 'activity', label: t('native.activity.tab.activity', 'Activity') },
|
|
36
36
|
{ id: 'context', label: t('native.activity.tab.context', 'Context') },
|
|
37
37
|
];
|
|
@@ -56,6 +56,7 @@ export function useActivityBusy(sessionId: string): number {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function GroupCard({ group, slotProps }: { group: ActivityGroup; slotProps: WebPluginSlotProps }) {
|
|
59
|
+
const t = useT();
|
|
59
60
|
const slot = activityGroupSlot(group.name);
|
|
60
61
|
const name = group.label ?? sentenceCase(group.name);
|
|
61
62
|
// Inline with the name, as the cockpit card: strong at rest, yellow while its work runs.
|
|
@@ -92,7 +93,9 @@ function GroupCard({ group, slotProps }: { group: ActivityGroup; slotProps: WebP
|
|
|
92
93
|
<Fills slot={slot} slotProps={slotProps} />
|
|
93
94
|
</View>
|
|
94
95
|
) : (
|
|
95
|
-
<Text style={[styles.summary(group.active), styles.indent]}>
|
|
96
|
+
<Text style={[styles.summary(group.active), styles.indent]}>
|
|
97
|
+
{group.summary || t('native.activity.idle', 'Idle')}
|
|
98
|
+
</Text>
|
|
96
99
|
)}
|
|
97
100
|
</View>
|
|
98
101
|
);
|
|
@@ -107,12 +110,13 @@ function ActivityFace({
|
|
|
107
110
|
slotProps: WebPluginSlotProps;
|
|
108
111
|
scope?: string;
|
|
109
112
|
}) {
|
|
113
|
+
const t = useT();
|
|
110
114
|
const statuses = useStore(sessionStoreFor(sessionId), (state) => state.statuses);
|
|
111
115
|
const widgets = useStore(sessionStoreFor(sessionId), (state) => state.widgets);
|
|
112
116
|
// Only an offline reason shows here, so a status or timestamp change does not render the sheet.
|
|
113
117
|
const offlineReason = useStore(sessionsStore, (state) => {
|
|
114
118
|
const meta = state.byId[sessionId];
|
|
115
|
-
return meta?.attach === 'offline' ? meta.reason
|
|
119
|
+
return meta?.attach === 'offline' ? (meta.reason ?? '') : null;
|
|
116
120
|
});
|
|
117
121
|
const updateRequired = useStore(sessionsStore, (state) => state.updateRequired);
|
|
118
122
|
const groups = useActivityGroups(statuses, widgets, sessionId);
|
|
@@ -121,7 +125,9 @@ function ActivityFace({
|
|
|
121
125
|
<View style={styles.face}>
|
|
122
126
|
{scope === undefined ? null : <Text style={styles.scope}>{scope}</Text>}
|
|
123
127
|
{offlineReason !== null ? (
|
|
124
|
-
<Text style={updateRequired ? [styles.meta, styles.ask] : styles.meta}>
|
|
128
|
+
<Text style={updateRequired ? [styles.meta, styles.ask] : styles.meta}>
|
|
129
|
+
{offlineReason || t('native.activity.reconnecting', 'Reconnecting')}
|
|
130
|
+
</Text>
|
|
125
131
|
) : null}
|
|
126
132
|
{busy > 0 ? (
|
|
127
133
|
<View style={styles.banner} accessibilityLiveRegion="polite">
|
|
@@ -168,6 +174,7 @@ export interface ActivitySheetProps {
|
|
|
168
174
|
|
|
169
175
|
/** The cockpit's right rail as a phone sheet: host and plugin faces on a scrolling tab strip. */
|
|
170
176
|
export function ActivitySheet({ sessionId, open, onOpenChange, slotProps, load, onRetry, scope }: ActivitySheetProps) {
|
|
177
|
+
const t = useT();
|
|
171
178
|
const [face, setFace] = useState('activity');
|
|
172
179
|
const dockFaces = useDockFaces(sessionId).filter(
|
|
173
180
|
(entry) => entry.requiredMode === undefined || slotProps.activeModes?.includes(entry.requiredMode),
|
|
@@ -187,26 +194,28 @@ export function ActivitySheet({ sessionId, open, onOpenChange, slotProps, load,
|
|
|
187
194
|
contentContainerStyle={styles.tabs}
|
|
188
195
|
accessibilityRole="tablist"
|
|
189
196
|
>
|
|
190
|
-
{[...faces(), ...dockFaces
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
197
|
+
{[...faces(t), ...dockFaces.map((entry) => ({ ...entry, label: entry.translateLabel?.(t) ?? entry.label }))].map(
|
|
198
|
+
(entry) => {
|
|
199
|
+
const count = badges[entry.id] ?? 0;
|
|
200
|
+
return (
|
|
201
|
+
<Pressable
|
|
202
|
+
key={entry.id}
|
|
203
|
+
accessibilityRole="tab"
|
|
204
|
+
accessibilityState={{ selected: entry.id === resolvedFace }}
|
|
205
|
+
accessibilityLabel={
|
|
206
|
+
count > 0
|
|
207
|
+
? t('native.activity.tabNew', '{label}, {count} new', { label: entry.label, count: String(count) })
|
|
208
|
+
: entry.label
|
|
209
|
+
}
|
|
210
|
+
onPress={() => setFace(entry.id)}
|
|
211
|
+
style={styles.tab(entry.id === resolvedFace)}
|
|
212
|
+
>
|
|
213
|
+
<Text style={styles.tabText(entry.id === resolvedFace)}>{entry.label}</Text>
|
|
214
|
+
{count > 0 ? <TabBadge active>{count}</TabBadge> : null}
|
|
215
|
+
</Pressable>
|
|
216
|
+
);
|
|
217
|
+
},
|
|
218
|
+
)}
|
|
210
219
|
</ScrollView>
|
|
211
220
|
);
|
|
212
221
|
return (
|
|
@@ -109,6 +109,7 @@ export function ConnectCard({ onPair, busy = false, error, onCancel, cameraEnabl
|
|
|
109
109
|
invalid={Boolean(error)}
|
|
110
110
|
value={pasted}
|
|
111
111
|
onChangeText={setPasted}
|
|
112
|
+
// no-untranslated-jsx: ignore - URL syntax example, not translated prose
|
|
112
113
|
placeholder="https://..."
|
|
113
114
|
autoCapitalize="none"
|
|
114
115
|
autoCorrect={false}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useT } from '@agimon-ai/po-core/native';
|
|
1
2
|
import { fontOf, SheetHeader, SheetList, SheetTitle, Spinner } from '@agimon-ai/po-native-components';
|
|
2
3
|
import type { PiSessionHistoryItem } from '@agimon-ai/po-web-dashboard/types';
|
|
3
4
|
import { Pressable, Text, View } from 'react-native';
|
|
@@ -24,6 +25,7 @@ export function ResumeSheetView({
|
|
|
24
25
|
onResume: (id: string) => void;
|
|
25
26
|
formatDate?: (iso: string) => string;
|
|
26
27
|
}) {
|
|
28
|
+
const t = useT();
|
|
27
29
|
return (
|
|
28
30
|
<SheetList
|
|
29
31
|
data={threads ?? []}
|
|
@@ -35,7 +37,7 @@ export function ResumeSheetView({
|
|
|
35
37
|
ListHeaderComponent={
|
|
36
38
|
<>
|
|
37
39
|
<SheetHeader>
|
|
38
|
-
<SheetTitle>Resume a conversation</SheetTitle>
|
|
40
|
+
<SheetTitle>{t('native.resume.title', 'Resume a conversation')}</SheetTitle>
|
|
39
41
|
</SheetHeader>
|
|
40
42
|
{error ? (
|
|
41
43
|
<Text style={resumeSheetStyles.error} accessibilityRole="alert">
|
|
@@ -47,16 +49,20 @@ export function ResumeSheetView({
|
|
|
47
49
|
ListEmptyComponent={
|
|
48
50
|
threads === null && !error ? (
|
|
49
51
|
<View style={resumeSheetStyles.waiting}>
|
|
50
|
-
<Spinner size="small" color="dim" label=
|
|
52
|
+
<Spinner size="small" color="dim" label={t('native.resume.loading', 'Reading saved conversations')} />
|
|
51
53
|
</View>
|
|
52
54
|
) : threads !== null && threads.length === 0 ? (
|
|
53
|
-
<Text style={resumeSheetStyles.meta}>
|
|
55
|
+
<Text style={resumeSheetStyles.meta}>
|
|
56
|
+
{t('native.resume.empty', 'No saved conversations for this workspace yet.')}
|
|
57
|
+
</Text>
|
|
54
58
|
) : undefined
|
|
55
59
|
}
|
|
56
60
|
renderItem={({ item: thread, index }) => (
|
|
57
61
|
<Pressable
|
|
58
62
|
accessibilityRole="button"
|
|
59
|
-
accessibilityLabel={
|
|
63
|
+
accessibilityLabel={t('native.resume.thread', 'Resume {name}', {
|
|
64
|
+
name: thread.name || thread.firstMessage || t('native.common.untitled', 'Untitled'),
|
|
65
|
+
})}
|
|
60
66
|
accessibilityState={{ disabled: busy !== null }}
|
|
61
67
|
disabled={busy !== null}
|
|
62
68
|
onPress={() => onResume(thread.id)}
|
|
@@ -68,7 +74,7 @@ export function ResumeSheetView({
|
|
|
68
74
|
>
|
|
69
75
|
<View style={resumeSheetStyles.flex}>
|
|
70
76
|
<Text style={resumeSheetStyles.itemTitle} numberOfLines={1}>
|
|
71
|
-
{thread.name || thread.firstMessage || 'Untitled'}
|
|
77
|
+
{thread.name || thread.firstMessage || t('native.common.untitled', 'Untitled')}
|
|
72
78
|
</Text>
|
|
73
79
|
<Text style={resumeSheetStyles.meta} numberOfLines={1}>
|
|
74
80
|
{formatDate(thread.updatedAt)}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useT } from '@agimon-ai/po-core/native';
|
|
1
2
|
import { CheckIcon, ChevronRightIcon, fontOf, SheetList } from '@agimon-ai/po-native-components';
|
|
2
3
|
import type { ReactElement } from 'react';
|
|
3
4
|
import { Pressable, Text, View } from 'react-native';
|
|
@@ -83,6 +84,7 @@ export function SessionChoicesView({
|
|
|
83
84
|
/** Unsaved picks: a prompt arriving leaves the sheet open with a note. */
|
|
84
85
|
keep?: boolean;
|
|
85
86
|
}) {
|
|
87
|
+
const t = useT();
|
|
86
88
|
return (
|
|
87
89
|
<SheetList
|
|
88
90
|
listKey={title}
|
|
@@ -98,7 +100,7 @@ export function SessionChoicesView({
|
|
|
98
100
|
<View style={sessionChoicesStyles.head}>
|
|
99
101
|
<Pressable
|
|
100
102
|
accessibilityRole="button"
|
|
101
|
-
accessibilityLabel=
|
|
103
|
+
accessibilityLabel={t('native.sessionChoices.back', 'Back to session options')}
|
|
102
104
|
onPress={onBack}
|
|
103
105
|
disabled={!onBack}
|
|
104
106
|
style={[sessionChoicesStyles.back, !onBack && sessionChoicesStyles.hidden]}
|
|
@@ -112,7 +114,12 @@ export function SessionChoicesView({
|
|
|
112
114
|
</Text>
|
|
113
115
|
<View style={[sessionChoicesStyles.back, sessionChoicesStyles.hidden]} />
|
|
114
116
|
</View>
|
|
115
|
-
<View
|
|
117
|
+
<View
|
|
118
|
+
style={[
|
|
119
|
+
sessionChoicesStyles.controls,
|
|
120
|
+
title === t('native.sessionOptions.model', 'Model') && sessionChoicesStyles.searchGap,
|
|
121
|
+
]}
|
|
122
|
+
>
|
|
116
123
|
{header}
|
|
117
124
|
</View>
|
|
118
125
|
</>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useT } from '@agimon-ai/po-core/native';
|
|
1
2
|
import { fontOf } from '@agimon-ai/po-native-components';
|
|
2
3
|
import RenderHTML from '@native-html/render';
|
|
3
4
|
import { Component, useEffect, useMemo, useState, type ReactNode } from 'react';
|
|
@@ -34,6 +35,7 @@ class HtmlBoundary extends Component<{ children: ReactNode; onError?: (message:
|
|
|
34
35
|
}
|
|
35
36
|
/** Native semantic text layout, not a browser preview. No resource fetching, scripting, or link navigation. */
|
|
36
37
|
export function NativeAuthorHtmlView(props: NativeAuthorHtmlProps) {
|
|
38
|
+
const t = useT();
|
|
37
39
|
const { theme } = useUnistyles();
|
|
38
40
|
const [width, setWidth] = useState(0);
|
|
39
41
|
const [aborted, setAborted] = useState(props.signal?.aborted ?? false);
|
|
@@ -59,7 +61,10 @@ export function NativeAuthorHtmlView(props: NativeAuthorHtmlProps) {
|
|
|
59
61
|
return (
|
|
60
62
|
<View style={styles.root} onLayout={({ nativeEvent }) => setWidth(nativeEvent.layout.width)}>
|
|
61
63
|
<Text style={styles.hint}>
|
|
62
|
-
|
|
64
|
+
{t(
|
|
65
|
+
'native.author.htmlPreviewHint',
|
|
66
|
+
'Native text preview. Browser CSS, images, scripts and navigation are not supported.',
|
|
67
|
+
)}
|
|
63
68
|
</Text>
|
|
64
69
|
{content.error ? (
|
|
65
70
|
<Text accessibilityRole="alert" style={styles.error}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t } from '@agimon-ai/po-core/native';
|
|
1
|
+
import { t, useT } from '@agimon-ai/po-core/native';
|
|
2
2
|
import {
|
|
3
3
|
HTML_INSPECT_LIMITS,
|
|
4
4
|
htmlInspectRequest,
|
|
@@ -191,6 +191,7 @@ function capturePng(surface: { current: ComponentRef<typeof View> | null }): Pro
|
|
|
191
191
|
return captureRef(surface, { format: 'png', result: 'base64', quality: 1, handleGLSurfaceViewOnAndroid: true });
|
|
192
192
|
}
|
|
193
193
|
function HtmlPreview({ request, scripts }: { request: StoryRequest; scripts: boolean }) {
|
|
194
|
+
const t = useT();
|
|
194
195
|
const surface = useRef<ComponentRef<typeof View>>(null);
|
|
195
196
|
const web = useRef<WebViewHandle>(null);
|
|
196
197
|
const visible = useVisible();
|
|
@@ -294,7 +295,7 @@ function HtmlPreview({ request, scripts }: { request: StoryRequest; scripts: boo
|
|
|
294
295
|
void capture();
|
|
295
296
|
}}
|
|
296
297
|
>
|
|
297
|
-
Capture preview
|
|
298
|
+
{t('native.preview.capture', 'Capture preview')}
|
|
298
299
|
</Button>
|
|
299
300
|
</View>
|
|
300
301
|
) : null}
|
|
@@ -302,6 +303,7 @@ function HtmlPreview({ request, scripts }: { request: StoryRequest; scripts: boo
|
|
|
302
303
|
);
|
|
303
304
|
}
|
|
304
305
|
function RunnerTerminal({ request }: { request: TerminalRequest }) {
|
|
306
|
+
const t = useT();
|
|
305
307
|
const { theme } = useUnistyles();
|
|
306
308
|
const visible = useVisible();
|
|
307
309
|
const web = useRef<WebViewHandle>(null);
|
|
@@ -419,7 +421,7 @@ function RunnerTerminal({ request }: { request: TerminalRequest }) {
|
|
|
419
421
|
setRevision((value) => value + 1);
|
|
420
422
|
}}
|
|
421
423
|
>
|
|
422
|
-
Retry terminal
|
|
424
|
+
{t('native.terminal.retry', 'Retry terminal')}
|
|
423
425
|
</Button>
|
|
424
426
|
</View>
|
|
425
427
|
) : null}
|
|
@@ -330,6 +330,7 @@ export function ContributedSettingsScreen(props: ContributedSettingsScreenProps)
|
|
|
330
330
|
<FieldGroup fields={loose} props={props} />
|
|
331
331
|
{scope === 'repository' && repoRoot !== '' ? (
|
|
332
332
|
<Note>
|
|
333
|
+
{/* no-untranslated-jsx: ignore - Filesystem path, preserve the repository root */}
|
|
333
334
|
{t('native.appearance.savedTo', 'Saved to')} <Mono>{`${repoRoot}/.po/config.yaml`}</Mono>
|
|
334
335
|
</Note>
|
|
335
336
|
) : null}
|
|
@@ -75,6 +75,7 @@ export function HostDrawer({ open, onClose, hosts, scope, onScope, onAdd, onMana
|
|
|
75
75
|
<ScrollView contentContainerStyle={styles.content}>
|
|
76
76
|
{menu ? (
|
|
77
77
|
<>
|
|
78
|
+
{/* no-untranslated-jsx: ignore - Po brand name */}
|
|
78
79
|
<SectionLabel>Po</SectionLabel>
|
|
79
80
|
<View style={styles.menu}>{menu}</View>
|
|
80
81
|
<View style={styles.divider} />
|
|
@@ -233,6 +233,7 @@ function AddServerForm({
|
|
|
233
233
|
<Input
|
|
234
234
|
value={name}
|
|
235
235
|
onChangeText={setName}
|
|
236
|
+
// no-untranslated-jsx: ignore - Example server identifier
|
|
236
237
|
placeholder="linear"
|
|
237
238
|
invalid={nameError !== undefined}
|
|
238
239
|
accessibilityLabel={t('native.mcp.name.label', 'Name')}
|
|
@@ -251,6 +252,7 @@ function AddServerForm({
|
|
|
251
252
|
<Input
|
|
252
253
|
value={url}
|
|
253
254
|
onChangeText={setUrl}
|
|
255
|
+
// no-untranslated-jsx: ignore - Example MCP endpoint URL
|
|
254
256
|
placeholder="https://mcp.example.com/mcp"
|
|
255
257
|
invalid={urlError !== undefined}
|
|
256
258
|
accessibilityLabel={t('native.mcp.url.label', 'Server URL')}
|
|
@@ -270,6 +272,7 @@ function AddServerForm({
|
|
|
270
272
|
<Input
|
|
271
273
|
value={command}
|
|
272
274
|
onChangeText={setCommand}
|
|
275
|
+
// no-untranslated-jsx: ignore - Executable name
|
|
273
276
|
placeholder="npx"
|
|
274
277
|
accessibilityLabel={t('native.mcp.command.label', 'Command')}
|
|
275
278
|
autoCapitalize="none"
|
|
@@ -58,6 +58,7 @@ export function PairingScreen({ onPair, busy = false, error, cameraEnabled = tru
|
|
|
58
58
|
invalid={Boolean(error)}
|
|
59
59
|
value={pasted}
|
|
60
60
|
onChangeText={setPasted}
|
|
61
|
+
// no-untranslated-jsx: ignore - URL syntax example, not translated prose
|
|
61
62
|
placeholder="https://..."
|
|
62
63
|
autoCapitalize="none"
|
|
63
64
|
autoCorrect={false}
|
package/src/screens/TeamView.tsx
CHANGED
|
@@ -237,6 +237,7 @@ export function TeamView(p: TeamViewProps) {
|
|
|
237
237
|
<FieldRow
|
|
238
238
|
title={t('native.account.email', 'Email')}
|
|
239
239
|
value={email}
|
|
240
|
+
// no-untranslated-jsx: ignore - Example email address
|
|
240
241
|
placeholder="name@example.com"
|
|
241
242
|
onChangeText={setEmail}
|
|
242
243
|
last
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { currentLocale } from '@agimon-ai/po-core/native';
|
|
1
|
+
import { currentLocale, subscribeLocale, t } from '@agimon-ai/po-core/native';
|
|
2
2
|
import {
|
|
3
3
|
ApplicationReleaseType,
|
|
4
4
|
applicationId,
|
|
@@ -62,7 +62,6 @@ export function startNativePush(
|
|
|
62
62
|
method: 'POST',
|
|
63
63
|
target: NATIVE_PUSH_ROUTE,
|
|
64
64
|
headers: [['content-type', 'application/json']],
|
|
65
|
-
// ponytail: the language rides each re-registration (launch, foreground, token rotation).
|
|
66
65
|
body: JSON.stringify({ ...device, ...(hostRef ? { hostRef } : {}), locale: currentLocale() }),
|
|
67
66
|
}),
|
|
68
67
|
unregister: () => session.sealed({ method: 'DELETE', target: NATIVE_PUSH_ROUTE }),
|
|
@@ -86,7 +85,7 @@ export function startPushEnrollment(enrollment: PushEnrollment, requestPermissio
|
|
|
86
85
|
}
|
|
87
86
|
if (Platform.OS === 'android') {
|
|
88
87
|
await Notifications.setNotificationChannelAsync('po-notifications', {
|
|
89
|
-
name: 'Po notifications',
|
|
88
|
+
name: t('native.push.channel', 'Po notifications'),
|
|
90
89
|
importance: Notifications.AndroidImportance.DEFAULT,
|
|
91
90
|
});
|
|
92
91
|
if (!current(generation)) return;
|
|
@@ -142,6 +141,7 @@ export function startPushEnrollment(enrollment: PushEnrollment, requestPermissio
|
|
|
142
141
|
const foreground = AppState.addEventListener('change', (state) => {
|
|
143
142
|
if (state === 'active') void reconcile();
|
|
144
143
|
});
|
|
144
|
+
const locale = subscribeLocale(() => void reconcile());
|
|
145
145
|
void reconcile();
|
|
146
146
|
return {
|
|
147
147
|
stop() {
|
|
@@ -150,6 +150,7 @@ export function startPushEnrollment(enrollment: PushEnrollment, requestPermissio
|
|
|
150
150
|
epoch += 1;
|
|
151
151
|
tokens.remove();
|
|
152
152
|
foreground.remove();
|
|
153
|
+
locale();
|
|
153
154
|
},
|
|
154
155
|
};
|
|
155
156
|
}
|