@agimon-ai/po-native 0.0.1-alpha.39 → 0.0.1-alpha.40

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.39",
3
+ "version": "0.0.1-alpha.40",
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.159",
33
- "@agimon-ai/po-expo-signing": "0.0.1-alpha.39",
34
- "@agimon-ai/po-identity": "0.0.2-alpha.106",
35
- "@agimon-ai/po-native-components": "0.0.0-alpha.159",
36
- "@agimon-ai/po-native-dashboard": "0.0.0-alpha.31",
37
- "@agimon-ai/po-template-advanced": "0.0.0-alpha.159",
38
- "@agimon-ai/po-template-elegant": "0.0.0-alpha.159",
39
- "@agimon-ai/po-voice": "0.0.0-alpha.159",
40
- "@agimon-ai/po-web-components": "0.0.0-alpha.159",
41
- "@agimon-ai/po-web-dashboard": "0.0.0-alpha.159",
42
- "@agimon-ai/po-web-security": "0.0.0-alpha.159",
32
+ "@agimon-ai/po-core": "0.0.0-alpha.160",
33
+ "@agimon-ai/po-expo-signing": "0.0.1-alpha.40",
34
+ "@agimon-ai/po-identity": "0.0.2-alpha.107",
35
+ "@agimon-ai/po-native-components": "0.0.0-alpha.160",
36
+ "@agimon-ai/po-native-dashboard": "0.0.0-alpha.32",
37
+ "@agimon-ai/po-template-advanced": "0.0.0-alpha.160",
38
+ "@agimon-ai/po-template-elegant": "0.0.0-alpha.160",
39
+ "@agimon-ai/po-voice": "0.0.0-alpha.160",
40
+ "@agimon-ai/po-web-components": "0.0.0-alpha.160",
41
+ "@agimon-ai/po-web-dashboard": "0.0.0-alpha.160",
42
+ "@agimon-ai/po-web-security": "0.0.0-alpha.160",
43
43
  "@better-auth/expo": "1.7.12",
44
44
  "@config-plugins/react-native-webrtc": "15.0.2",
45
45
  "@earendil-works/chord": "1.5.1",
@@ -35,9 +35,7 @@ function activity(offline: boolean): HomeActivityModel {
35
35
  },
36
36
  ];
37
37
  return {
38
- summary: offline
39
- ? 'Po is working on one thing. One thing would like your eye, whenever you are ready.'
40
- : 'Po is working on one thing. 2 things would like your eye, whenever you are ready.',
38
+ summary: 'Po is working on one thing. One thing would like your eye, whenever you are ready.',
41
39
  activity: offline ? today.slice(0, 1) : today,
42
40
  earlier: false,
43
41
  waiting: [
@@ -45,22 +43,11 @@ function activity(offline: boolean): HomeActivityModel {
45
43
  id: 'notes',
46
44
  name: 'notes',
47
45
  detail: 'Waiting for your input',
46
+ waited: '8m',
48
47
  actor: { name: 'Ponytail' },
49
48
  host: 'MacBook Pro',
50
49
  target: { sessionId: 'mbp/notes' },
51
50
  },
52
- ...(offline
53
- ? []
54
- : [
55
- {
56
- id: 'nightly',
57
- name: 'Nightly build',
58
- detail: 'Workflows · the test step exited with code 1',
59
- failed: true,
60
- host: 'Studio Mac',
61
- target: { sessionId: 'studio/garden', destination: 'workflows' },
62
- },
63
- ]),
64
51
  ],
65
52
  coverage: offline
66
53
  ? 'Each item shows its latest state. MacBook Pro: Checked 2 of 2 sources at 09:41. Studio Mac: Tasks and Workflows could not be read. Sessions are still shown.'
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Design target for the phone's Home: the cockpit's Home activity timeline (web story
3
3
  * `HomeActivity` in po-web-dashboard) on one column, rendered by the real HomeScreen.
4
- * Waiting on you comes first, as on the cockpit's narrow layout; then Coming up, then Today.
4
+ * Waiting on you comes first while something waits, as on the cockpit's narrow layout; then Coming up, then Today.
5
5
  * Approved baselines: .build/style-review/approved/native/home/. Runtime code never imports this file.
6
6
  */
7
7
  import type { WebTemplateRailWorkspace } from '@agimon-ai/po-core/native';
@@ -45,8 +45,8 @@ const today: HomeActivityItem[] = [
45
45
  id: 'ios',
46
46
  at: '09:54',
47
47
  name: 'ios',
48
- outcome: 'Done · waiting for you',
49
- tone: 'green',
48
+ outcome: 'Waiting for your input',
49
+ tone: 'magenta',
50
50
  actor: ponytail,
51
51
  branch: 'main',
52
52
  target: { sessionId: 'ios' },
@@ -65,8 +65,8 @@ const today: HomeActivityItem[] = [
65
65
  id: 'polo',
66
66
  at: '09:49',
67
67
  name: 'polo',
68
- outcome: 'Done · waiting for you',
69
- tone: 'green',
68
+ outcome: 'Waiting for your input',
69
+ tone: 'magenta',
70
70
  actor: polo,
71
71
  branch: 'main',
72
72
  target: { sessionId: 'polo' },
@@ -93,18 +93,44 @@ const today: HomeActivityItem[] = [
93
93
  },
94
94
  ];
95
95
 
96
+ // Only what the person can answer: questions first, then a session that could not start.
96
97
  const waiting: HomeWaitingItem[] = [
97
98
  {
98
- id: 'deploy',
99
- name: 'Preview deploy',
100
- detail: 'Workflows · the test step exited with code 1',
99
+ id: 'ios',
100
+ name: 'ios',
101
+ detail: 'Waiting for your input',
102
+ waited: '6m',
103
+ actor: ponytail,
104
+ target: { sessionId: 'ios' },
105
+ },
106
+ {
107
+ id: 'polo',
108
+ name: 'polo',
109
+ detail: 'Waiting for your input',
110
+ waited: '11m',
111
+ actor: polo,
112
+ target: { sessionId: 'polo' },
113
+ },
114
+ {
115
+ id: 'billing-fix',
116
+ name: 'billing-fix',
117
+ detail: 'Session setup failed',
118
+ waited: '3h 00m',
101
119
  failed: true,
102
- target: { sessionId: 'desktop', destination: 'workflows' },
120
+ target: { sessionId: 'ios' },
103
121
  },
104
- { id: 'polo', name: 'polo', detail: 'Done, waiting for you · 10m', actor: polo, target: { sessionId: 'polo' } },
105
- { id: 'ios', name: 'ios', detail: 'Done, waiting for you · 5m', actor: ponytail, target: { sessionId: 'ios' } },
106
122
  ];
107
123
 
124
+ /** Twelve agents asking at once: the list shows its first page of 5 and the pager. */
125
+ const manyWaiting: HomeWaitingItem[] = Array.from({ length: 12 }, (_, index) => ({
126
+ id: `agent-${String(index)}`,
127
+ name: `agent-${String(index + 1)}`,
128
+ detail: 'Waiting for your input',
129
+ waited: `${String(2 + index * 4)}m`,
130
+ actor: index % 2 === 0 ? ponytail : polo,
131
+ target: { sessionId: `agent-${String(index)}` },
132
+ }));
133
+
108
134
  const upcoming = [
109
135
  { id: 'review', at: '11:00', title: 'Review changes' },
110
136
  { id: 'ship', at: 'Thu 14:30', title: 'Ship release notes' },
@@ -210,7 +236,11 @@ export const AllCaughtUp = {
210
236
  summary: 'Po has things in hand. Nothing needs you right now.',
211
237
  activity: today
212
238
  .filter((row) => row.tone !== 'red' && !row.outcome.startsWith('Running'))
213
- .map((row) => ({ ...row, outcome: row.actor ? 'Done · waiting for you' : 'Finished' })),
239
+ .map((row) => ({
240
+ ...row,
241
+ tone: 'green' as const,
242
+ outcome: row.actor ? 'Done · waiting for you' : 'Finished',
243
+ })),
214
244
  earlier: false,
215
245
  waiting: [],
216
246
  coverage: CHECKED,
@@ -243,7 +273,7 @@ export const PartialCoverage = {
243
273
  summary: 'Po finished 3 things today. 2 things would like your eye, whenever you are ready.',
244
274
  activity: today.slice(0, 5),
245
275
  earlier: false,
246
- waiting: waiting.slice(1),
276
+ waiting: waiting.slice(0, 2),
247
277
  coverage:
248
278
  'Each item shows its latest state. Checked 2 of 3 sources on this computer at 09:59. Workflows could not be read, so its items may be missing.',
249
279
  }}
@@ -259,7 +289,7 @@ export const Loading = {
259
289
  />
260
290
  ),
261
291
  };
262
- /** A busy day: 19 rows, so Today shows its first page of 8 and the pager. */
292
+ /** A busy day: 19 rows and 12 asks, so each list shows its first page and the pager. */
263
293
  export const BusyDay = {
264
294
  render: () => (
265
295
  <Home
@@ -267,7 +297,7 @@ export const BusyDay = {
267
297
  height={1500}
268
298
  activity={{
269
299
  ...populated,
270
- summary: 'Po finished 19 things today. One thing would like your eye, whenever you are ready.',
300
+ summary: 'Po finished 19 things today. 12 things would like your eye, whenever you are ready.',
271
301
  activity: [
272
302
  today[0]!,
273
303
  ...Array.from({ length: 18 }, (_, index): HomeActivityItem => ({
@@ -280,7 +310,7 @@ export const BusyDay = {
280
310
  target: { sessionId: `review-${String(index)}` },
281
311
  })),
282
312
  ],
283
- waiting: waiting.slice(0, 1),
313
+ waiting: manyWaiting,
284
314
  }}
285
315
  />
286
316
  ),
@@ -16,7 +16,10 @@ import {
16
16
  Spinner,
17
17
  } from '@agimon-ai/po-native-components';
18
18
  import {
19
+ pageOf,
20
+ TODAY_PAGE_SIZE,
19
21
  useRenderTrace,
22
+ WAITING_PAGE_SIZE,
20
23
  type HomeActivityItem,
21
24
  type HomeActivityModel,
22
25
  type HomeTarget,
@@ -33,9 +36,6 @@ import { RestoreCard, type RestoreCardProps } from '../components/RestoreCard';
33
36
  import { TAB_BAR_CLEARANCE } from '../components/TabBar';
34
37
  import { homeSummary, keepEqual, type HomeAttentionRow } from './homeModel';
35
38
 
36
- /** Rows per page of the Today timeline, the same as the web Home. */
37
- const PAGE_SIZE = 8;
38
-
39
39
  export interface HomeView {
40
40
  /** The cockpit's Home model: summary, what waits, today's latest states and coverage. */
41
41
  activity?: HomeActivityModel;
@@ -205,6 +205,7 @@ const HomeHeader = memo(function HomeHeader({
205
205
  );
206
206
  });
207
207
 
208
+ /** What the person can answer, a page at a time; nothing while nothing waits. */
208
209
  const HomeWaitingOn = memo(function HomeWaitingOn({
209
210
  view,
210
211
  onOpen,
@@ -212,24 +213,47 @@ const HomeWaitingOn = memo(function HomeWaitingOn({
212
213
  view: HomeViewStore;
213
214
  onOpen: (target: HomeTarget) => void;
214
215
  }) {
215
- const { loading, waiting } = useStore(
216
- view,
217
- (state) => ({ loading: state.loading === true, waiting: state.activity?.waiting ?? [] }),
218
- equalSelection,
219
- );
216
+ const waiting = useStore(view, (state) => state.activity?.waiting ?? [], equalSelection);
217
+ const [requestedPage, setPage] = useState(0);
218
+ if (waiting.length === 0) return null;
219
+ const { page, pages, first, shown } = pageOf(waiting, requestedPage, WAITING_PAGE_SIZE);
220
220
  return (
221
221
  <View style={styles.section}>
222
- <SectionLabel>Waiting on you</SectionLabel>
222
+ <View style={styles.sectionHead}>
223
+ <SectionLabel>Waiting on you</SectionLabel>
224
+ <Text style={styles.progress} accessibilityLabel={`${String(waiting.length)} waiting`}>
225
+ {String(waiting.length)}
226
+ </Text>
227
+ </View>
223
228
  <Panel>
224
- {loading ? (
225
- <View style={styles.loading}>
226
- <Spinner label="Checking what waits on you" />
229
+ {shown.map((row) => (
230
+ <WaitingRow key={row.id} row={row} onOpen={onOpen} />
231
+ ))}
232
+ {pages > 1 ? (
233
+ <View style={styles.pager}>
234
+ <Button
235
+ testID="home-waiting-previous"
236
+ variant="ghost"
237
+ size="sm"
238
+ disabled={page === 0}
239
+ onPress={() => setPage(page - 1)}
240
+ >
241
+ Previous
242
+ </Button>
243
+ <Button
244
+ testID="home-waiting-next"
245
+ variant="ghost"
246
+ size="sm"
247
+ disabled={page === pages - 1}
248
+ onPress={() => setPage(page + 1)}
249
+ >
250
+ Next
251
+ </Button>
252
+ <Text style={styles.pageCount} accessibilityLiveRegion="polite">
253
+ {first + 1}–{first + shown.length} of {waiting.length}
254
+ </Text>
227
255
  </View>
228
- ) : waiting.length === 0 ? (
229
- <Text style={styles.calm}>Nothing needs you right now.</Text>
230
- ) : (
231
- waiting.map((row) => <WaitingRow key={row.id} row={row} onOpen={onOpen} />)
232
- )}
256
+ ) : null}
233
257
  </Panel>
234
258
  </View>
235
259
  );
@@ -250,13 +274,16 @@ function WaitingRow({ row, onOpen }: { row: HomeWaitingItem; onOpen: (target: Ho
250
274
  title={row.name}
251
275
  description={
252
276
  <View style={styles.detail}>
253
- <Text style={styles.outcome(row.failed === true)}>{row.detail}</Text>
277
+ <Text numberOfLines={2} style={styles.outcome(row.failed === true)}>
278
+ {row.detail}
279
+ </Text>
254
280
  {row.host !== undefined ? <HostTag label={row.host} /> : null}
255
281
  </View>
256
282
  }
283
+ trailing={row.waited !== undefined ? <Text style={styles.quiet}>{row.waited}</Text> : undefined}
257
284
  onPress={() => onOpen(row.target)}
258
285
  disclosure
259
- accessibilityLabel={`Open ${row.name}`}
286
+ accessibilityLabel={`Open ${row.name}, ${row.detail}`}
260
287
  />
261
288
  );
262
289
  }
@@ -281,11 +308,7 @@ const HomeToday = memo(function HomeToday({
281
308
  equalSelection,
282
309
  );
283
310
  const [requestedPage, setPage] = useState(0);
284
- const pages = Math.max(1, Math.ceil(rows.length / PAGE_SIZE));
285
- // Rows come and go live, so a page past the end shows the last one.
286
- const page = Math.min(requestedPage, pages - 1);
287
- const first = page * PAGE_SIZE;
288
- const shown = rows.slice(first, first + PAGE_SIZE);
311
+ const { page, pages, first, shown } = pageOf(rows, requestedPage, TODAY_PAGE_SIZE);
289
312
  const showEarlier = earlier && onShowEarlier !== undefined;
290
313
  return (
291
314
  <>
@@ -603,13 +626,6 @@ const styles = StyleSheet.create((theme, rt) => {
603
626
  outcome: (failed: boolean) => ({ ...small, color: failed ? theme.colors.red : theme.colors.text }),
604
627
  branch: { ...small, fontFamily: fontOf(theme.fontFamily.mono), color: theme.colors.dim },
605
628
  quiet: { ...small, color: theme.colors.dim },
606
- calm: {
607
- fontFamily: sans,
608
- fontSize: theme.fontSize.base,
609
- lineHeight: theme.lineHeightRelaxed.base,
610
- color: theme.colors.dim,
611
- padding: theme.spacing(4),
612
- },
613
629
  loading: { padding: theme.spacing(4) },
614
630
  pager: {
615
631
  flexDirection: 'row',