@agimon-ai/po-native 0.0.1-alpha.46 → 0.0.1-alpha.48

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.
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-native",
3
- "version": "0.0.1-alpha.46",
3
+ "version": "0.0.1-alpha.48",
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.166",
33
- "@agimon-ai/po-expo-signing": "0.0.1-alpha.46",
34
- "@agimon-ai/po-identity": "0.0.2-alpha.113",
35
- "@agimon-ai/po-native-components": "0.0.0-alpha.166",
36
- "@agimon-ai/po-native-dashboard": "0.0.0-alpha.38",
37
- "@agimon-ai/po-template-advanced": "0.0.0-alpha.166",
38
- "@agimon-ai/po-template-elegant": "0.0.0-alpha.166",
39
- "@agimon-ai/po-voice": "0.0.0-alpha.166",
40
- "@agimon-ai/po-web-components": "0.0.0-alpha.166",
41
- "@agimon-ai/po-web-dashboard": "0.0.0-alpha.166",
42
- "@agimon-ai/po-web-security": "0.0.0-alpha.166",
32
+ "@agimon-ai/po-core": "0.0.0-alpha.168",
33
+ "@agimon-ai/po-expo-signing": "0.0.1-alpha.48",
34
+ "@agimon-ai/po-identity": "0.0.2-alpha.115",
35
+ "@agimon-ai/po-native-components": "0.0.0-alpha.168",
36
+ "@agimon-ai/po-native-dashboard": "0.0.0-alpha.40",
37
+ "@agimon-ai/po-template-advanced": "0.0.0-alpha.168",
38
+ "@agimon-ai/po-template-elegant": "0.0.0-alpha.168",
39
+ "@agimon-ai/po-voice": "0.0.0-alpha.168",
40
+ "@agimon-ai/po-web-components": "0.0.0-alpha.168",
41
+ "@agimon-ai/po-web-dashboard": "0.0.0-alpha.168",
42
+ "@agimon-ai/po-web-security": "0.0.0-alpha.168",
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",
package/src/app/App.tsx CHANGED
@@ -694,6 +694,9 @@ function SessionRoute({
694
694
  useRenderTrace('SessionRoute');
695
695
  const { sessionId: ownerSessionId } = route.params;
696
696
  const [selectedTabId, setSelectedTabId] = useState<string | null>(null);
697
+ // The aside conversation sheet belongs to the tab that opened it, so switching tabs closes it.
698
+ const [conversationOpen, setConversationOpen] = useState(false);
699
+ useEffect(() => setConversationOpen(false), [selectedTabId]);
697
700
  const transientTabs = useTransientTabs(ownerSessionId);
698
701
  const selectedTab =
699
702
  transientTabs.find((tab) => tab.id === selectedTabId) ??
@@ -1038,6 +1041,8 @@ function SessionRoute({
1038
1041
  [sessionId]: (current[sessionId] ?? []).filter((item) => item.source !== source || item.id !== id),
1039
1042
  }));
1040
1043
  };
1044
+ const isAside = (tab?: TransientTab | ReturnType<typeof webTabs>[number]) =>
1045
+ tab !== undefined && 'composerAside' in tab && tab.composerAside === true;
1041
1046
  const renderScreen = (
1042
1047
  tab?: TransientTab | ReturnType<typeof webTabs>[number],
1043
1048
  setTabHeader?: (header: TabHeader) => void,
@@ -1058,10 +1063,27 @@ function SessionRoute({
1058
1063
  draftStore={drafts}
1059
1064
  {...(tab
1060
1065
  ? {
1061
- panel: <tab.panel {...slotProps} setTabHeader={setTabHeader} />,
1066
+ panel: isAside(tab) ? (
1067
+ <tab.panel
1068
+ {...slotProps}
1069
+ setTabHeader={setTabHeader}
1070
+ openConversation={() => setConversationOpen(true)}
1071
+ />
1072
+ ) : (
1073
+ <tab.panel {...slotProps} setTabHeader={setTabHeader} />
1074
+ ),
1062
1075
  retainComposer: tab.retainComposer === true && !(tab.targetSessionId && summary?.dormant),
1063
1076
  }
1064
1077
  : {})}
1078
+ {...(tab && isAside(tab)
1079
+ ? {
1080
+ composerAside: true,
1081
+ // Background stack screens keep their tabs mounted; only the selected one shows the sheet.
1082
+ conversationOpen: conversationOpen && tab.id === selectedTabId,
1083
+ onConversationOpenChange: setConversationOpen,
1084
+ asideLabel: tab.label,
1085
+ }
1086
+ : {})}
1065
1087
  sessionId={sessionId}
1066
1088
  statuses={statuses}
1067
1089
  sessionToolRenderer={sessionToolRenderer}
@@ -1,8 +1,9 @@
1
- import { Button, fontOf, Panel } from '@agimon-ai/po-native-components';
2
- import { Text } from 'react-native';
3
- import { StyleSheet } from 'react-native-unistyles';
1
+ import { CtaCard } from '@agimon-ai/po-native-components';
4
2
 
5
- /** Gentle account ask, not a failure alarm. Mockup fidelity awaits human approval. */
3
+ import renewArtwork from '../../assets/cta-renew.png';
4
+ import signInArtwork from '../../assets/cta-sign-in.png';
5
+
6
+ /** Gentle account ask, not a failure alarm. */
6
7
  export function GrantNotice({
7
8
  busy = false,
8
9
  notice,
@@ -13,57 +14,27 @@ export function GrantNotice({
13
14
  onRenew: () => void;
14
15
  }) {
15
16
  return (
16
- <Panel style={styles.panel}>
17
- <Text accessibilityRole="header" style={styles.title}>
18
- Shared work is waiting
19
- </Text>
20
- <Text style={styles.body}>
21
- The part on another host is paused. Work here can continue. Renew its permission whenever you are ready.
22
- </Text>
23
- {notice ? (
24
- <Text accessibilityLiveRegion="polite" style={styles.body}>
25
- {notice}
26
- </Text>
27
- ) : null}
28
- <Button variant="secondary" size="lg" disabled={busy} onPress={onRenew}>
29
- {busy ? 'Renewing permission' : 'Renew permission'}
30
- </Button>
31
- </Panel>
17
+ <CtaCard
18
+ artwork={renewArtwork}
19
+ title="Shared work is paused"
20
+ description="The part on another host needs its permission renewed. Work here carries on."
21
+ action="Renew permission"
22
+ loading={busy}
23
+ notice={notice}
24
+ onAction={onRenew}
25
+ />
32
26
  );
33
27
  }
34
28
 
35
- /** Storyboard v4's Home ask while this phone has paired computers but no account. Never a failure. */
29
+ /** Home ask while this phone has paired computers but no account. Never a failure. */
36
30
  export function SignInAsk({ onSignIn }: { onSignIn: () => void }) {
37
31
  return (
38
- <Panel style={styles.panel}>
39
- <Text accessibilityRole="header" style={styles.title}>
40
- Your Po Cloud sessions can live here too
41
- </Text>
42
- <Text style={styles.body}>Sign in whenever you are ready. Paired computers keep working.</Text>
43
- <Button variant="secondary" size="lg" onPress={onSignIn}>
44
- Sign in with Po
45
- </Button>
46
- </Panel>
32
+ <CtaCard
33
+ artwork={signInArtwork}
34
+ title="Your cloud sessions, here too"
35
+ description="Sign in to Po Cloud. Paired computers stay as they are."
36
+ action="Sign in with Po"
37
+ onAction={onSignIn}
38
+ />
47
39
  );
48
40
  }
49
- const styles = StyleSheet.create((theme) => ({
50
- panel: {
51
- padding: theme.spacing(4),
52
- gap: theme.spacing(3),
53
- borderColor: theme.colors['edge-magenta'],
54
- backgroundColor: theme.colors['tint-magenta'],
55
- },
56
- title: {
57
- fontFamily: fontOf(theme.fontFamily.sans),
58
- fontSize: theme.fontSize.lg,
59
- lineHeight: theme.lineHeight.lg,
60
- fontWeight: theme.fontWeight.semibold,
61
- color: theme.colors.magenta,
62
- },
63
- body: {
64
- fontFamily: fontOf(theme.fontFamily.sans),
65
- fontSize: theme.fontSize.base,
66
- lineHeight: theme.lineHeight.base,
67
- color: theme.colors.text,
68
- },
69
- }));
@@ -3,6 +3,7 @@
3
3
  * the whole screen instead of sharing it with the composer. "Ask Po" in the canvas tool bar opens the
4
4
  * conversation as a sheet at a medium detent, so the canvas stays in view above it. The footer keeps a
5
5
  * one-line field for commenting on the file without marking it; Review & send joins it once there are marks.
6
+ * A text document works the same way: the reading page fills the screen and the footer field opens the sheet.
6
7
  * Mockup only: nothing here is wired, and runtime code never imports it.
7
8
  */
8
9
  import {
@@ -12,6 +13,7 @@ import {
12
13
  ChevronRightIcon,
13
14
  CloseIcon,
14
15
  EditIcon,
16
+ FileIcon,
15
17
  fontOf,
16
18
  HandIcon,
17
19
  type IconProps,
@@ -30,6 +32,9 @@ import { StyleSheet } from 'react-native-unistyles';
30
32
  import { type DesignScheme, PhoneFrame } from './designFrame';
31
33
 
32
34
  const FILE = 'landing-hero.png';
35
+ const TEXT_FILE = 'release-notes.md';
36
+
37
+ type Kind = 'image' | 'text';
33
38
 
34
39
  const MARKS = [
35
40
  { id: 'm1', x: 0.5, y: 0.2, label: '1', description: 'Shorten the headline to one line.' },
@@ -56,7 +61,7 @@ const RUNNING: readonly TimelineEntry[] = [
56
61
  ];
57
62
 
58
63
  /** The authoring header as po-author draws it on the phone: back, the file, and what is marked. */
59
- function Header({ marked }: { marked: boolean }) {
64
+ function Header({ marked, kind }: { marked: boolean; kind: Kind }) {
60
65
  return (
61
66
  <View style={styles.header}>
62
67
  <View style={styles.back}>
@@ -66,16 +71,32 @@ function Header({ marked }: { marked: boolean }) {
66
71
  </View>
67
72
  <View style={styles.headerText}>
68
73
  <Text style={styles.title} numberOfLines={1}>
69
- {FILE}
74
+ {kind === 'text' ? TEXT_FILE : FILE}
70
75
  </Text>
71
76
  <Text style={styles.subtitle} numberOfLines={1}>
72
- {marked ? 'Image · 2 marks, not sent' : 'Image · no marks'}
77
+ {kind === 'text' ? 'Markdown · 48 lines' : marked ? 'Image · 2 marks, not sent' : 'Image · no marks'}
73
78
  </Text>
74
79
  </View>
75
80
  </View>
76
81
  );
77
82
  }
78
83
 
84
+ /** A text document's reading page, filling the screen now that the composer has moved into the sheet. */
85
+ function TextPage() {
86
+ return (
87
+ <ScrollView style={styles.flex} contentContainerStyle={styles.reading}>
88
+ <Text style={styles.docTitle}>Release notes</Text>
89
+ <Text style={styles.docHeading}>What changed</Text>
90
+ <Text style={styles.docBody}>
91
+ Authoring keeps the conversation beside the canvas. The page gets the whole screen, and Po is one tap away.
92
+ </Text>
93
+ <Text style={styles.docHeading}>Fixed</Text>
94
+ <Text style={styles.docBody}>Long session names wrap onto two lines instead of cutting off mid-word.</Text>
95
+ <Text style={styles.docBody}>The status line keeps to one row on narrow phones.</Text>
96
+ </ScrollView>
97
+ );
98
+ }
99
+
79
100
  /** A stand-in page for the image, drawn in theme colours, with the person's marks on it. */
80
101
  function Canvas({ marked }: { marked: boolean }) {
81
102
  return (
@@ -150,17 +171,18 @@ function Toolkit() {
150
171
  * Comment without marking: the field opens the conversation with the keyboard up and the file attached.
151
172
  * Review & send appears only once there are marks to explain.
152
173
  */
153
- function Footer({ marked }: { marked: boolean }) {
174
+ function Footer({ marked, kind }: { marked: boolean; kind: Kind }) {
175
+ const file = kind === 'text' ? TEXT_FILE : FILE;
154
176
  return (
155
177
  <View style={styles.footer}>
156
178
  <Pressable
157
179
  accessibilityRole="button"
158
- accessibilityLabel={`Ask Po about ${FILE}`}
180
+ accessibilityLabel={`Ask Po about ${file}`}
159
181
  accessibilityHint="Opens the conversation with this file attached"
160
182
  style={styles.field}
161
183
  >
162
184
  <Text style={styles.placeholder} numberOfLines={1}>
163
- Ask Po about this image
185
+ {kind === 'text' ? 'Ask Po about this document' : 'Ask Po about this image'}
164
186
  </Text>
165
187
  </Pressable>
166
188
  {marked ? (
@@ -173,7 +195,7 @@ function Footer({ marked }: { marked: boolean }) {
173
195
  }
174
196
 
175
197
  /** The conversation at a medium detent; the canvas above stays undimmed and live. */
176
- function ConversationSheet({ running }: { running: boolean }) {
198
+ function ConversationSheet({ running, kind }: { running: boolean; kind: Kind }) {
177
199
  return (
178
200
  <View style={styles.sheet}>
179
201
  <View style={styles.grabber} />
@@ -191,9 +213,9 @@ function ConversationSheet({ running }: { running: boolean }) {
191
213
  <View style={styles.dock}>
192
214
  {/* Says what the message carries, since the composer no longer sits on the file it is about. */}
193
215
  <View style={styles.about}>
194
- <ImageIcon size={14} color="dim" />
216
+ {kind === 'text' ? <FileIcon size={14} color="dim" /> : <ImageIcon size={14} color="dim" />}
195
217
  <Text style={styles.aboutText} numberOfLines={1}>
196
- About {FILE}
218
+ About {kind === 'text' ? TEXT_FILE : FILE}
197
219
  </Text>
198
220
  </View>
199
221
  <Composer
@@ -213,22 +235,25 @@ function Authoring({
213
235
  marked = true,
214
236
  sheet = false,
215
237
  running = false,
238
+ kind = 'image',
216
239
  }: {
217
240
  scheme?: DesignScheme;
218
241
  marked?: boolean;
219
242
  sheet?: boolean;
220
243
  running?: boolean;
244
+ kind?: Kind;
221
245
  }) {
246
+ const hasMarks = marked && kind === 'image';
222
247
  return (
223
248
  <PhoneFrame scheme={scheme}>
224
249
  <View style={styles.screen}>
225
- <Header marked={marked} />
226
- <Canvas marked={marked} />
250
+ <Header marked={hasMarks} kind={kind} />
251
+ {kind === 'text' ? <TextPage /> : <Canvas marked={hasMarks} />}
227
252
  <View style={styles.tools}>
228
- <Toolkit />
229
- <Footer marked={marked} />
253
+ {kind === 'image' ? <Toolkit /> : null}
254
+ <Footer marked={hasMarks} kind={kind} />
230
255
  </View>
231
- {sheet ? <ConversationSheet running={running} /> : null}
256
+ {sheet ? <ConversationSheet running={running} kind={kind} /> : null}
232
257
  </View>
233
258
  </PhoneFrame>
234
259
  );
@@ -252,6 +277,11 @@ export const Sheet = { render: () => <Authoring sheet scheme="dark" /> };
252
277
  export const SheetLight = { render: () => <Authoring sheet scheme="light" /> };
253
278
  /** Po editing while the sheet is up; the composer steers or stops. */
254
279
  export const SheetRunning = { render: () => <Authoring sheet running scheme="dark" /> };
280
+ /** A text document: the reading page fills the screen and the same footer field opens the conversation. */
281
+ export const TextDocument = { render: () => <Authoring kind="text" scheme="dark" /> };
282
+ export const TextDocumentLight = { render: () => <Authoring kind="text" scheme="light" /> };
283
+ /** The text document with the conversation sheet up. */
284
+ export const TextDocumentSheet = { render: () => <Authoring kind="text" sheet scheme="dark" /> };
255
285
 
256
286
  const styles = StyleSheet.create((theme) => {
257
287
  const sans = fontOf(theme.fontFamily.sans);
@@ -263,6 +293,10 @@ const styles = StyleSheet.create((theme) => {
263
293
  });
264
294
  return {
265
295
  flex: { flex: 1 },
296
+ reading: { gap: theme.spacing(3), paddingHorizontal: theme.spacing(5), paddingVertical: theme.spacing(4) },
297
+ docTitle: { ...text('lg', theme.colors.hi), fontWeight: theme.fontWeight.semibold },
298
+ docHeading: { ...text('base', theme.colors.hi), fontWeight: theme.fontWeight.semibold },
299
+ docBody: text('base', theme.colors.text),
266
300
  screen: { flex: 1, backgroundColor: theme.colors.bg },
267
301
  header: {
268
302
  flexDirection: 'row',
@@ -19,7 +19,7 @@ const ASK = {
19
19
  ],
20
20
  };
21
21
 
22
- const meta = {
22
+ export const meta = {
23
23
  title: 'Native/Screens/Session',
24
24
  component: SessionScreen,
25
25
  tags: ['style-system', 'mockup', 'native'],
@@ -227,3 +227,29 @@ export const WorkflowParent = { render: () => <WorkflowFocusTarget state="parent
227
227
  export const WorkflowStep = { render: () => <WorkflowFocusTarget state="step" /> };
228
228
  export const WorkflowApproval = { render: () => <WorkflowFocusTarget state="approval" /> };
229
229
  export const WorkflowHistory = { render: () => <WorkflowFocusTarget state="history" /> };
230
+
231
+ // Embedded PNG, no host or network access. Existing conversation fixtures stay unchanged.
232
+ const AVATAR =
233
+ 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAABaCAIAAACwpMoFAAAAvklEQVR42u3RMRGAMBBFwaijpkZE6qsRETmRgQ4qanT8m515Ct6Ob5caNywALMACLMACLMACDFiABViABViABRiwACsQ+F1TjQMMWIAFWIAFWIAFGLAAC7AAC7AACzBgAVYi8DNLjQMMWIAFWIAFWIAFGLAAC7AAC7AACzBgAVYi8LpuNQ4wYAEWYAEWYAEWYMACLMACLMACLMCABViJwMdZahxgwAIswAIswAIswIAFWIAFWIAFWIABC7AC+wHcDRCDtrTwhwAAAABJRU5ErkJggg==';
234
+ const AVATAR_ENTRIES: TimelineEntry[] = [
235
+ {
236
+ id: 'avatar',
237
+ role: 'assistant',
238
+ text: 'The recorded profile image.',
239
+ author: { name: 'Bea', initials: 'BE', icon: AVATAR },
240
+ },
241
+ {
242
+ id: 'missing-avatar',
243
+ role: 'assistant',
244
+ text: 'A profile without an image keeps its initials.',
245
+ author: { name: 'Reviewer', initials: 'RE' },
246
+ },
247
+ {
248
+ id: 'failed-avatar',
249
+ role: 'assistant',
250
+ text: 'An unreadable image falls back to initials.',
251
+ author: { name: 'Ponytail', initials: 'PO', icon: 'data:image/png;base64,invalid' },
252
+ },
253
+ ];
254
+ export const AvatarsDark = { render: () => <Full scheme="dark" entries={AVATAR_ENTRIES} /> };
255
+ export const AvatarsLight = { render: () => <Full scheme="light" entries={AVATAR_ENTRIES} /> };