@startsimpli/integrations 0.2.179 → 0.2.180
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 +3 -3
- package/src/__tests__/converse-handoff.test.ts +129 -0
- package/src/__tests__/converse-meeting.test.ts +41 -0
- package/src/__tests__/converse-relay.test.ts +19 -3
- package/src/__tests__/home-brief.test.tsx +12 -24
- package/src/__tests__/home-needs-your-call.test.tsx +13 -16
- package/src/__tests__/plan-shell.test.tsx +160 -0
- package/src/components/DocumentDetail.tsx +15 -4
- package/src/components/documentText.ts +24 -0
- package/src/components/index.ts +1 -0
- package/src/components/pages/LibraryPage.tsx +4 -0
- package/src/components/pages/PlanningPage.tsx +20 -10
- package/src/components/pages/TrackerPage.tsx +16 -3
- package/src/components/pages/home/DueSoonLine.tsx +28 -0
- package/src/components/pages/home/HomeBriefPage.tsx +19 -52
- package/src/components/pages/home/index.ts +1 -3
- package/src/components/pages/plan/ProjectsPage.tsx +54 -0
- package/src/components/pages/plan/TalkPage.tsx +48 -0
- package/src/components/pages/plan/TimelinePage.tsx +33 -0
- package/src/components/pages/plan/index.ts +6 -0
- package/src/corpus/converse/handle.ts +10 -3
- package/src/corpus/converse/handled-asks.ts +29 -0
- package/src/corpus/converse/handoff.ts +52 -0
- package/src/corpus/converse/index.ts +4 -2
- package/src/corpus/converse/meeting.ts +23 -7
- package/src/corpus/converse/relay.ts +8 -4
- package/src/corpus/converse/store.ts +2 -0
- package/src/corpus/converse/transcript.ts +9 -0
- package/src/corpus/converse/types.ts +14 -0
- package/src/corpus/index.ts +2 -0
- package/src/corpus/nav-copy.ts +31 -0
- package/src/corpus/view-text.ts +3 -2
- package/src/native/__tests__/design-screens.test.tsx +3 -2
- package/src/native/app/FoundryApp.tsx +1 -1
- package/src/native/app/__tests__/plan-talk-registry.test.tsx +74 -0
- package/src/native/app/briefingServices.ts +1 -0
- package/src/native/app/config/defaults.ts +8 -2
- package/src/native/app/config/types.ts +1 -1
- package/src/native/app/converseServices.ts +1 -0
- package/src/native/app/registry.tsx +26 -6
- package/src/native/app/services.ts +3 -2
- package/src/native/components/NoteDetailScreen.tsx +16 -4
- package/src/native/components/__tests__/notes-screens.test.tsx +8 -8
- package/src/native/converse/ConverseScreen.tsx +24 -5
- package/src/native/converse/__tests__/liveScreen.test.tsx +15 -2
- package/src/native/home/HomeScreen.tsx +20 -7
- package/src/native/home/controller.ts +15 -5
- package/src/native/home/tab.tsx +31 -6
- package/src/native/plan/NewProjectRow.tsx +30 -0
- package/src/native/plan/PlanTab.tsx +105 -0
- package/src/native/plan/ProjectTodos.tsx +24 -0
- package/src/native/plan/TimelineScreen.tsx +68 -0
- package/src/native/plan/__tests__/plan-tab.test.tsx +76 -0
- package/src/native/plan/index.ts +5 -0
- package/src/native/plan/timeline.ts +56 -0
- package/src/native/recording/__tests__/recorderAudio.test.ts +10 -2
- package/src/native/recording/recorderAudio.ts +6 -2
- package/src/native/screens/__tests__/tabs.test.tsx +13 -0
- package/src/native/screens/ask/AskScreen.tsx +4 -2
- package/src/native/screens/library/LibraryDetailScreen.tsx +11 -4
- package/src/native/screens/planning/PlanningScreens.tsx +30 -13
- package/src/native/screens/tabs.tsx +5 -4
- package/src/native/talk/TalkTab.tsx +62 -0
- package/src/native/talk/__tests__/talk-tab.test.tsx +57 -0
- package/src/native/tracker/TrackerListScreen.tsx +7 -3
- package/src/native/tracker/tab.tsx +33 -8
- package/src/components/pages/home/DueAcrossProjects.tsx +0 -76
- package/src/components/pages/home/RecentNotes.tsx +0 -69
|
@@ -115,7 +115,8 @@ export function createMeetingController<A = Blob>(options: {
|
|
|
115
115
|
});
|
|
116
116
|
if (out.audio_url) {
|
|
117
117
|
lastReply = { conversationId: out.conversation_id, turn: out.turn, replyText: out.reply_text, audioUrl: out.audio_url };
|
|
118
|
-
|
|
118
|
+
// A typed message speaks its reply even before Start: the person asked in text, but the screen is a voice one.
|
|
119
|
+
if (running || input.text) await playReply(lastReply);
|
|
119
120
|
} else {
|
|
120
121
|
lastReply = null;
|
|
121
122
|
set({ noAudio: out.audio_reason ?? 'no audio was produced' });
|
|
@@ -211,15 +212,30 @@ export function createMeetingController<A = Blob>(options: {
|
|
|
211
212
|
async sendText(text) {
|
|
212
213
|
const t = text.trim();
|
|
213
214
|
if (!t) return;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
// The microphone is still open here: stop listening before the reply plays (a phone cannot record and play in one session),
|
|
216
|
+
// and hold the loop (`gate`) until the reply is done, exactly like a relay message.
|
|
217
|
+
const done = turnChain.then(async () => {
|
|
218
|
+
if (running) listenAbort.abort();
|
|
219
|
+
await takeTurn({ text: t });
|
|
220
|
+
if (running && s.phase !== 'stopped') set({ phase: 'listening' });
|
|
221
|
+
else if (!running && (s.phase === 'thinking' || s.phase === 'speaking')) set({ phase: 'idle' });
|
|
222
|
+
});
|
|
223
|
+
gate = done.catch(() => undefined);
|
|
224
|
+
turnChain = gate;
|
|
225
|
+
await done;
|
|
218
226
|
},
|
|
219
227
|
dismissNotice() { set({ relayNotice: null }); },
|
|
220
228
|
async replay() {
|
|
221
|
-
if (lastReply)
|
|
222
|
-
|
|
229
|
+
if (!lastReply) return;
|
|
230
|
+
const reply = lastReply;
|
|
231
|
+
const done = turnChain.then(async () => {
|
|
232
|
+
if (running) listenAbort.abort();
|
|
233
|
+
await playReply(reply);
|
|
234
|
+
if (running) set({ phase: 'listening' });
|
|
235
|
+
});
|
|
236
|
+
gate = done.catch(() => undefined);
|
|
237
|
+
turnChain = gate;
|
|
238
|
+
await done;
|
|
223
239
|
},
|
|
224
240
|
async end() {
|
|
225
241
|
running = false;
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Both run as the person (their bearer), so a relay holding a token for the person's account reaches exactly their
|
|
8
8
|
* own conversations. A reply is a turn like any other: it is spoken (the recording is kept), saved, and numbered.
|
|
9
|
-
* `reply_id` makes a resend of the same message a no-op.
|
|
9
|
+
* `reply_id` makes a resend of the same message a no-op. A reply to a conversation the person has already ended is still
|
|
10
|
+
* delivered: it is appended to the thread (the conversation stays ended), and `onRelayReplyAfterEnd` lets the app tell them.
|
|
10
11
|
*/
|
|
11
12
|
import { createEntityConversationStore } from './store';
|
|
12
13
|
import { speakSide } from './speak';
|
|
@@ -25,6 +26,8 @@ export interface RelayReplyResult {
|
|
|
25
26
|
reply_text: string;
|
|
26
27
|
audio_url: string | null;
|
|
27
28
|
audio_reason: string | null;
|
|
29
|
+
/** True when the conversation had already ended: the person is told by push rather than seeing it arrive live. */
|
|
30
|
+
after_end?: boolean;
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
const resultOf = (id: string, t: ConverseTurn): RelayReplyResult => ({
|
|
@@ -45,7 +48,6 @@ export async function handleRelayReply(
|
|
|
45
48
|
const store = deps.store ?? createEntityConversationStore(deps.http, deps.ownerSub);
|
|
46
49
|
const record = await store.get(req.conversationId);
|
|
47
50
|
if (!record) throw new ConverseError('Not found.', 404);
|
|
48
|
-
if (record.status === 'ended') throw new ConverseError('That conversation has ended.', 409, 'ended');
|
|
49
51
|
const again = req.replyId ? record.turns.find((t) => t.turn_id === req.replyId) : undefined;
|
|
50
52
|
if (again) return resultOf(record.conversationId, again);
|
|
51
53
|
|
|
@@ -57,10 +59,12 @@ export async function handleRelayReply(
|
|
|
57
59
|
const turn: ConverseTurn = { n, turn_id: turnId, at: new Date(now).toISOString(), from: 'relay', user: { text: '' }, assistant };
|
|
58
60
|
await store.save({ ...record, turns: [...record.turns, turn] });
|
|
59
61
|
await clearRelayOrders(deps, record.conversationId).catch(() => undefined);
|
|
60
|
-
|
|
62
|
+
const afterEnd = record.status === 'ended';
|
|
63
|
+
if (afterEnd) await deps.onRelayReplyAfterEnd?.({ conversationId: record.conversationId, text }).catch(() => undefined);
|
|
64
|
+
return { ...resultOf(record.conversationId, turn), ...(afterEnd ? { after_end: true } : {}) };
|
|
61
65
|
}
|
|
62
66
|
|
|
63
|
-
const lastChange = (r: ConversationRecord) => r.endedAt
|
|
67
|
+
const lastChange = (r: ConversationRecord) => [r.endedAt, r.turns[r.turns.length - 1]?.at].filter(Boolean).sort().pop() ?? r.startedAt;
|
|
64
68
|
|
|
65
69
|
const threadTurn = (id: string, t: ConverseTurn): ConverseThreadTurn => ({
|
|
66
70
|
turn: t.n, turn_id: t.turn_id, at: t.at, who: t.from === 'relay' ? 'relay' : 'you',
|
|
@@ -27,6 +27,7 @@ function toRecord(entity: TenantEntity): ConversationRecord {
|
|
|
27
27
|
title: text(d.title),
|
|
28
28
|
turns: Array.isArray(d.turns) ? (d.turns as ConverseTurn[]) : [],
|
|
29
29
|
...(d.body ? { body: text(d.body) } : {}),
|
|
30
|
+
...(d.summary ? { summary: text(d.summary) } : {}),
|
|
30
31
|
...(d.asks ? { asks: list(d.asks) } : {}),
|
|
31
32
|
...(d.decisions ? { decisions: list(d.decisions) } : {}),
|
|
32
33
|
};
|
|
@@ -64,6 +65,7 @@ export function createEntityConversationStore(http: ConverseDeps['http'], ownerS
|
|
|
64
65
|
time_zone: record.timeZone ?? '',
|
|
65
66
|
turns: record.turns,
|
|
66
67
|
...(record.body !== undefined ? { body: record.body } : {}),
|
|
68
|
+
...(record.summary ? { summary: record.summary } : {}),
|
|
67
69
|
...(record.asks ? { asks: record.asks } : {}),
|
|
68
70
|
...(record.decisions ? { decisions: record.decisions } : {}),
|
|
69
71
|
},
|
|
@@ -20,3 +20,12 @@ export function titleFor(startedAt: string, firstWords: string): string {
|
|
|
20
20
|
const words = firstWords.replace(/\s+/g, ' ').trim().split(' ').slice(0, 7).join(' ');
|
|
21
21
|
return words ? `Conversation ${day}: ${words}` : `Conversation ${day}`;
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The asks as the summary a voice note would carry: a `## Next steps` list of bold bullets, which is the shape the
|
|
26
|
+
* to-do extraction reads (corpus/extract rulesExtract). Empty when there are no asks.
|
|
27
|
+
*/
|
|
28
|
+
export function renderNextSteps(asks: string[]): string {
|
|
29
|
+
if (!asks.length) return '';
|
|
30
|
+
return ['## Next steps', ...asks.map((a) => `- **${a.replace(/\*\*/g, '')}**`)].join('\n');
|
|
31
|
+
}
|
|
@@ -50,6 +50,8 @@ export interface ConversationRecord {
|
|
|
50
50
|
turns: ConverseTurn[];
|
|
51
51
|
/** Set at End: the transcript as a document, and what the handoff pulled out of it. */
|
|
52
52
|
body?: string;
|
|
53
|
+
/** The asks as a `## Next steps` list: what the to-do extraction (and every other reader of a note's summary) reads. */
|
|
54
|
+
summary?: string;
|
|
53
55
|
asks?: string[];
|
|
54
56
|
decisions?: string[];
|
|
55
57
|
}
|
|
@@ -132,6 +134,14 @@ export interface ConverseEndResult {
|
|
|
132
134
|
decisions: string[];
|
|
133
135
|
}
|
|
134
136
|
|
|
137
|
+
/** What End hands on once the record is saved. */
|
|
138
|
+
export interface ConverseHandoffInput {
|
|
139
|
+
/** The saved record: `id` is the document row, `body` the transcript. */
|
|
140
|
+
record: ConversationRecord;
|
|
141
|
+
asks: string[];
|
|
142
|
+
decisions: string[];
|
|
143
|
+
}
|
|
144
|
+
|
|
135
145
|
export interface ConverseDeps {
|
|
136
146
|
http: Pick<CorpusHttp, 'get'> & { post<T>(path: string, body?: unknown): Promise<T> };
|
|
137
147
|
ownerSub: string;
|
|
@@ -141,11 +151,15 @@ export interface ConverseDeps {
|
|
|
141
151
|
transcribe?: (input: { audio: Uint8Array; mimeType: string; hints: string[] }) => Promise<string>;
|
|
142
152
|
/** Pulls asks and decisions out of a finished conversation. Default: none. */
|
|
143
153
|
extract?: (input: { transcript: string }) => Promise<{ asks: string[]; decisions: string[] }>;
|
|
154
|
+
/** After End has saved: files the conversation like a voice note (under a project, asks as to-dos). Default: none. See ./handoff. */
|
|
155
|
+
handoff?: (input: ConverseHandoffInput) => Promise<void>;
|
|
144
156
|
store?: ConversationStore;
|
|
145
157
|
now?: () => number;
|
|
146
158
|
newId?: () => string;
|
|
147
159
|
/** How many earlier lines the brain sees. Default 24. */
|
|
148
160
|
historyLines?: number;
|
|
161
|
+
/** Called when the relay answers a conversation the person has already ended, so they can be told (a push). Errors are ignored. */
|
|
162
|
+
onRelayReplyAfterEnd?: (info: { conversationId: string; text: string }) => Promise<void>;
|
|
149
163
|
}
|
|
150
164
|
|
|
151
165
|
/** An error the route turns into a status; `code` lets the app choose its message. */
|
package/src/corpus/index.ts
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one-line, plain-language subtitle under every Tandem tab and sub-tab, and the
|
|
3
|
+
* labels of the four top-level tabs. One source for web and iPhone so the two never
|
|
4
|
+
* describe a screen in different words. Pure strings: safe in any bundle.
|
|
5
|
+
*/
|
|
6
|
+
export const TAB_COPY = {
|
|
7
|
+
today: { label: 'Today', subtitle: 'Your morning brief and what is due soon.' },
|
|
8
|
+
talk: { label: 'Talk', subtitle: 'Talk or type to Tandem: plans, questions, and notes. Asks you make become to-dos.' },
|
|
9
|
+
plan: { label: 'Plan', subtitle: 'Everything you owe, and what you are aiming for.' },
|
|
10
|
+
more: { label: 'More', subtitle: 'Library, Decisions, Connections, Admin.' },
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
export const PLAN_TABS = [
|
|
14
|
+
{ key: 'todos', label: 'To-dos', subtitle: 'The one list of everything you owe: add, tick off, filter.' },
|
|
15
|
+
{ key: 'timeline', label: 'Timeline', subtitle: 'What was created, finished and overdue over time.' },
|
|
16
|
+
{ key: 'projects', label: 'Projects', subtitle: 'Your projects and goals, with progress. Open one to see its to-dos.' },
|
|
17
|
+
] as const;
|
|
18
|
+
export type PlanTabKey = (typeof PLAN_TABS)[number]['key'];
|
|
19
|
+
|
|
20
|
+
export const MORE_ENTRIES = [
|
|
21
|
+
{ key: 'library', label: 'Library', subtitle: 'Everything Tandem has pulled in: documents, notes and recordings.' },
|
|
22
|
+
{ key: 'decisions', label: 'Decisions', subtitle: 'Questions your agents need you to answer.' },
|
|
23
|
+
{ key: 'connections', label: 'Connections', subtitle: 'The accounts and data sources Tandem reads from.' },
|
|
24
|
+
{ key: 'admin', label: 'Admin', subtitle: 'Records, organisation and build settings.' },
|
|
25
|
+
] as const;
|
|
26
|
+
|
|
27
|
+
export const TALK_MODES = [
|
|
28
|
+
{ key: 'talk', label: 'Talk', subtitle: TAB_COPY.talk.subtitle },
|
|
29
|
+
{ key: 'ask', label: 'Ask', subtitle: 'Ask a question and get an answer with the sources it came from.' },
|
|
30
|
+
] as const;
|
|
31
|
+
export type TalkMode = (typeof TALK_MODES)[number]['key'];
|
package/src/corpus/view-text.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* No React and no DOM in here: the native bundle imports it.
|
|
7
7
|
*/
|
|
8
|
-
import { summaryOf } from '../components/documentText';
|
|
8
|
+
import { summaryOf, withoutNextSteps } from '../components/documentText';
|
|
9
9
|
import type { AskResult, SourceDocument } from './types';
|
|
10
10
|
|
|
11
11
|
/** Markdown flattened to plain prose, for one-line previews, titles and labels. */
|
|
@@ -63,7 +63,8 @@ export function askFailureMessage(err: unknown): string {
|
|
|
63
63
|
* truncated heading and half a bold span are worse than plain prose.
|
|
64
64
|
*/
|
|
65
65
|
export function documentPreview(document: SourceDocument, length = 180): string {
|
|
66
|
-
|
|
66
|
+
// A note's Next steps are to-dos, which live only in Plan: never in a row's preview either.
|
|
67
|
+
const text = stripMarkdown(withoutNextSteps(summaryOf(document)).text || document.body || document.sections[0]?.text || '');
|
|
67
68
|
if (!text) return '';
|
|
68
69
|
return text.length > length ? `${text.slice(0, length).trim()}…` : text;
|
|
69
70
|
}
|
|
@@ -71,12 +71,13 @@ describe('To-dos', () => {
|
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
describe('Note detail', () => {
|
|
74
|
-
it('uses the scaffold: hero with the project tag, to-dos
|
|
74
|
+
it('uses the scaffold: hero with the project tag, a link to its to-dos in Plan, project section, delete in the footer', async () => {
|
|
75
75
|
const controller = createVoiceNotesController({ api: createFakeVoiceApi(), pollMs: 60_000 });
|
|
76
76
|
const r = render(<NoteDetailScreen controller={controller} noteId="n1" onBack={vi.fn()} />);
|
|
77
77
|
await settle(); await settle();
|
|
78
78
|
const text = allText(r);
|
|
79
|
-
expect(text.indexOf('Voice note')).toBeLessThan(text.indexOf('
|
|
79
|
+
expect(text.indexOf('Voice note')).toBeLessThan(text.indexOf('to-dos from this note'));
|
|
80
|
+
expect(maybeById(r, 'note-todos-in-plan')).toHaveLength(1);
|
|
80
81
|
expect(text).toContain('Project');
|
|
81
82
|
expect(text.indexOf('Project')).toBeLessThan(text.indexOf('Delete note'));
|
|
82
83
|
expect(maybeById(r, 'note-delete')).toHaveLength(1);
|
|
@@ -150,7 +150,7 @@ function Root({ config, device, registry }: { config: FoundryAppConfig; device:
|
|
|
150
150
|
const recordRef = useRef<ReactNode>(record);
|
|
151
151
|
recordRef.current = record;
|
|
152
152
|
const tabs = useMemo(
|
|
153
|
-
() => buildFoundryTabs({ config: appConfig, corpus: data.corpus, notes: data.notes, record: () => recordRef.current, member: data.member, itemsChanged: services.briefing?.itemsChanged, converse: services.converse?.controller ?? null, converseSpeed: services.converse?.speed ?? null, notify: services.notify, openUrl: data.openUrl ?? ((url) => Linking.openURL(url)) }, registry),
|
|
153
|
+
() => buildFoundryTabs({ config: appConfig, corpus: data.corpus, notes: data.notes, record: () => recordRef.current, member: data.member, itemsChanged: services.briefing?.itemsChanged, briefing: services.briefing ? { controller: services.briefing.controller, reply: services.briefing.reply } : null, strings, converse: services.converse?.controller ?? null, converseSpeed: services.converse?.speed ?? null, notify: services.notify, openUrl: data.openUrl ?? ((url) => Linking.openURL(url)) }, registry),
|
|
154
154
|
[appConfig, data, registry],
|
|
155
155
|
);
|
|
156
156
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
|
|
3
|
+
vi.mock('react-native', async () => ({ ...(await import('../../../../../ui-native/test/rn-stub')) }));
|
|
4
|
+
|
|
5
|
+
import { act, allText, maybeById, render } from '../../../../../ui-native/test/render';
|
|
6
|
+
import { planTabs } from '../../shell/overflow';
|
|
7
|
+
import type { TabContext } from '../../components/FoundryTabsShell';
|
|
8
|
+
import { createFakeNativeCorpusApi } from '../../corpus/fake';
|
|
9
|
+
import { createFakeVoiceApi } from '../../voice/fake';
|
|
10
|
+
import { createVoiceNotesController } from '../../voice/controller';
|
|
11
|
+
import { createFakeConnectionsApi } from '../../screens/connections/fake';
|
|
12
|
+
import { createFakeMcpTokensApi } from '../../screens/connect-claude/fake';
|
|
13
|
+
import { resolveFoundryApp } from '../config/validate';
|
|
14
|
+
import { buildFoundryTabs } from '../registry';
|
|
15
|
+
import { foundryStrings } from '../strings';
|
|
16
|
+
import { createBriefingController } from '../../briefing/controller';
|
|
17
|
+
|
|
18
|
+
const tick = () => act(async () => { await new Promise((res) => setTimeout(res, 50)); });
|
|
19
|
+
const ctx = (over: Partial<TabContext> = {}): TabContext => ({ tab: 't', active: true, route: null, push: () => {}, back: () => {}, openTab: () => {}, ...over });
|
|
20
|
+
|
|
21
|
+
// The shape of tandem-ios/foundry.config.json after the Plan/Talk cleanup.
|
|
22
|
+
const config = resolveFoundryApp({
|
|
23
|
+
app: { name: 'Tandem Go' }, tenant: { url: 'https://acme.example.com' }, maxVisibleTabs: 4,
|
|
24
|
+
features: { recording: true, notes: true, tracker: true, library: true, ask: true, planning: true, connections: true, connectClaude: true, briefing: true, converse: false, notifications: false },
|
|
25
|
+
tabs: [
|
|
26
|
+
{ screen: 'home', label: 'Today', options: { copy: 'today' } },
|
|
27
|
+
{ screen: 'talk' },
|
|
28
|
+
{ screen: 'plan' },
|
|
29
|
+
{ screen: 'notes', priority: 65 },
|
|
30
|
+
{ screen: 'library' },
|
|
31
|
+
{ screen: 'connections' },
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const deps = () => ({
|
|
36
|
+
config, corpus: createFakeNativeCorpusApi(), notes: createVoiceNotesController({ api: createFakeVoiceApi() }), record: () => null,
|
|
37
|
+
member: { connections: createFakeConnectionsApi(), mcpTokens: createFakeMcpTokensApi() },
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe('the Tandem Go tab set', () => {
|
|
41
|
+
it('has exactly Today, Talk and Plan in the bar, with More behind it holding the rest', () => {
|
|
42
|
+
const tabs = buildFoundryTabs(deps());
|
|
43
|
+
const { primary, overflow } = planTabs(tabs, config.maxVisibleTabs);
|
|
44
|
+
expect(primary.map((t) => t.label)).toEqual(['Today', 'Talk', 'Plan']);
|
|
45
|
+
expect(overflow.map((t) => t.label)).toEqual(expect.arrayContaining(['Library', 'Connections']));
|
|
46
|
+
for (const gone of ['To-dos', 'Planning', 'Ask', 'Converse', 'GO']) expect([...primary, ...overflow].map((t) => t.label)).not.toContain(gone);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('Today: the briefing card (moved here from GO), a due-soon line and the Talk entry, and no to-do rows', async () => {
|
|
50
|
+
const strings = foundryStrings(config);
|
|
51
|
+
const controller = createBriefingController({
|
|
52
|
+
api: { fetch: async () => { throw new Error('unused'); }, audioSource: async () => null } as never, player: { getState: () => ({}), subscribe: () => () => undefined } as never,
|
|
53
|
+
messages: { failed: strings.briefingFailed, empty: strings.briefingEmpty, textOnly: strings.briefingTextOnly, audioFailed: strings.briefingAudioFailed },
|
|
54
|
+
});
|
|
55
|
+
const tabs = buildFoundryTabs({ ...deps(), briefing: { controller, reply: null }, strings });
|
|
56
|
+
const home = tabs.find((t) => t.key === 'home')!;
|
|
57
|
+
const r = render(<>{home.render(ctx({ openTab: vi.fn() }))}</>);
|
|
58
|
+
await tick();
|
|
59
|
+
const text = allText(r);
|
|
60
|
+
expect(text).toContain('Today');
|
|
61
|
+
expect(r.root.findAllByProps({ testID: 'briefing-play' }).length).toBeGreaterThan(0);
|
|
62
|
+
expect(text).toContain('Your morning brief and what is due soon.');
|
|
63
|
+
expect(r.root.findAllByProps({ testID: 'home-talk' }).length).toBeGreaterThan(0);
|
|
64
|
+
expect(r.root.findAllByProps({ testID: 'home-due-soon' }).length).toBeGreaterThan(0);
|
|
65
|
+
expect(maybeById(r, 'home-record')).toHaveLength(0);
|
|
66
|
+
// Latest arrivals never list a to-do.
|
|
67
|
+
expect(r.root.findAllByProps({ testID: 'home-metric-commitment' }).length).toBeGreaterThan(0);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('the Talk tab is Ask alone without a meeting, and Plan is registered', () => {
|
|
71
|
+
const tabs = buildFoundryTabs(deps());
|
|
72
|
+
expect(tabs.map((t) => t.key)).toEqual(expect.arrayContaining(['talk', 'plan']));
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -61,6 +61,7 @@ export function createBriefing(deps: {
|
|
|
61
61
|
if (!rec) throw new Error('features.briefing.reply needs the recording bindings (features.recording on, device.recording supplied)');
|
|
62
62
|
// Its own recorder audio: an interruption here cancels nothing else, and a reply never reaches the upload queue.
|
|
63
63
|
const audio = createRecorderAudio({
|
|
64
|
+
kind: 'transient',
|
|
64
65
|
driver: rec.driver, session: rec.session, fs: { size: rec.fileSize }, poll: tick, sleep: wait, diag, onInterrupted: () => undefined,
|
|
65
66
|
});
|
|
66
67
|
const permissions = createPermissionFlow({ perms: rec.permissions, openSettings: rec.openSettings, log: diag.log });
|
|
@@ -10,11 +10,12 @@ export const DEFAULT_FEATURES: FoundryFeatures = {
|
|
|
10
10
|
export const SCREEN_FEATURE: Partial<Record<string, keyof FoundryFeatures>> = {
|
|
11
11
|
record: 'recording', notes: 'notes', tracker: 'tracker', library: 'library', ask: 'ask',
|
|
12
12
|
planning: 'planning', connections: 'connections', 'connect-claude': 'connectClaude', converse: 'converse', decisions: 'notifications',
|
|
13
|
+
plan: 'tracker',
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
/** Entity types a built-in screen shows (the `entity` screen names its own in `options.entityType`). */
|
|
16
17
|
export const SCREEN_ENTITY_TYPES: Record<string, string[]> = {
|
|
17
|
-
tracker: ['commitment'], notes: ['source_document'], library: ['source_document'], planning: ['focus'],
|
|
18
|
+
tracker: ['commitment'], notes: ['source_document'], library: ['source_document'], planning: ['focus'], plan: ['commitment', 'focus'],
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
export const DEFAULT_HOME_TYPES: FoundryHomeType[] = [
|
|
@@ -37,14 +38,19 @@ export const SCREEN_DEFAULTS: Record<string, { label: string; description?: stri
|
|
|
37
38
|
converse: { label: 'Converse', icon: 'mic', description: 'Talk it through with your assistant', priority: 85 },
|
|
38
39
|
decisions: { label: 'Decisions', icon: 'check', description: 'Questions waiting for you' },
|
|
39
40
|
entity: { label: 'Records', icon: 'list' },
|
|
41
|
+
plan: { label: 'Plan', icon: 'check', description: 'Everything you owe, and what you are aiming for', priority: 80 },
|
|
42
|
+
talk: { label: 'Talk', icon: 'mic', description: 'Talk or type to Tandem', priority: 90 },
|
|
40
43
|
};
|
|
41
44
|
|
|
45
|
+
/** Screens an app asks for by name: the grouped Plan and Talk tabs replace Tracker/Planning and Ask/Converse, so a default tab list must not carry both. */
|
|
46
|
+
const OPT_IN_SCREENS: readonly string[] = ['plan', 'talk'];
|
|
47
|
+
|
|
42
48
|
/** The tab each built-in screen takes when the config names no tabs. `record` keeps the key `go`. */
|
|
43
49
|
const DEFAULT_KEYS: Record<string, string> = { record: 'go' };
|
|
44
50
|
|
|
45
51
|
export function defaultTabs(features: FoundryFeatures): FoundryTabConfig[] {
|
|
46
52
|
const on = (screen: string) => { const f = SCREEN_FEATURE[screen]; return !f || features[f]; };
|
|
47
|
-
return BUILTIN_SCREENS.filter((s) => s !== 'entity' && on(s)).map((screen) => ({ key: DEFAULT_KEYS[screen] ?? screen, screen }));
|
|
53
|
+
return BUILTIN_SCREENS.filter((s) => s !== 'entity' && !OPT_IN_SCREENS.includes(s) && on(s)).map((screen) => ({ key: DEFAULT_KEYS[screen] ?? screen, screen }));
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
export function defaultBrandTagline(): string { return 'Your workspace'; }
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/** Screen kinds the shell ships. An app can add or override kinds through a screen registry. */
|
|
7
7
|
export const BUILTIN_SCREENS = [
|
|
8
|
-
'home', 'record', 'notes', 'tracker', 'library', 'ask', 'planning', 'connections', 'connect-claude', 'converse', 'decisions', 'entity',
|
|
8
|
+
'home', 'record', 'notes', 'tracker', 'library', 'ask', 'planning', 'connections', 'connect-claude', 'converse', 'decisions', 'entity', 'plan', 'talk',
|
|
9
9
|
] as const;
|
|
10
10
|
export type BuiltinScreen = (typeof BUILTIN_SCREENS)[number];
|
|
11
11
|
|
|
@@ -44,6 +44,7 @@ export function createConverse(deps: {
|
|
|
44
44
|
void speed.load();
|
|
45
45
|
let broken: (() => void) | null = null;
|
|
46
46
|
const audio = createRecorderAudio({
|
|
47
|
+
kind: 'transient',
|
|
47
48
|
driver: rec.driver, session: rec.session, fs: { size: rec.fileSize }, poll: tick, sleep: wait, diag,
|
|
48
49
|
onInterrupted: () => broken?.(),
|
|
49
50
|
onInterruptionEnded: () => undefined,
|
|
@@ -11,6 +11,13 @@ import { createConnectionsTab } from '../screens/connections/tab';
|
|
|
11
11
|
import { createPlanningTab } from '../screens/planning/tab';
|
|
12
12
|
import { askTab, libraryTab } from '../screens/tabs';
|
|
13
13
|
import { trackerTab } from '../tracker/tab';
|
|
14
|
+
import { planTab } from '../plan/PlanTab';
|
|
15
|
+
import { talkTab } from '../talk/TalkTab';
|
|
16
|
+
import { BriefingCard } from '../briefing/BriefingCard';
|
|
17
|
+
import type { BriefingController } from '../briefing/controller';
|
|
18
|
+
import type { BriefingReplyController } from '../briefing/reply';
|
|
19
|
+
import type { FoundryStrings } from './strings';
|
|
20
|
+
import { TAB_COPY } from '../../corpus/nav-copy';
|
|
14
21
|
import type { MeetingController } from '../../corpus/converse/meeting';
|
|
15
22
|
import { converseTab } from '../converse/tab';
|
|
16
23
|
import type { SpeedStore } from '../converse/speed';
|
|
@@ -44,6 +51,9 @@ export interface ScreenDeps {
|
|
|
44
51
|
/** Decisions and push; null when `features.notifications` is off. */
|
|
45
52
|
notify?: { decisions: DecisionsController; push: PushController } | null;
|
|
46
53
|
itemsChanged?: { subscribe(listener: () => void): () => void };
|
|
54
|
+
/** "What's on the plate" (the spoken briefing); null when `features.briefing` is off. Drawn on the Home tab. */
|
|
55
|
+
briefing?: { controller: BriefingController; reply: BriefingReplyController | null } | null;
|
|
56
|
+
strings?: FoundryStrings;
|
|
47
57
|
}
|
|
48
58
|
|
|
49
59
|
/** Builds one shell tab from its config entry. */
|
|
@@ -60,23 +70,33 @@ export interface ScreenRegistry {
|
|
|
60
70
|
const firstKey = (config: FoundryAppConfig, screen: string) => config.tabs.find((t) => t.screen === screen)?.key;
|
|
61
71
|
|
|
62
72
|
export const BUILTIN_FACTORIES: Record<string, ScreenFactory> = {
|
|
63
|
-
home: ({ config, corpus }, tab) => {
|
|
73
|
+
home: ({ config, corpus, briefing, strings }, tab) => {
|
|
64
74
|
const tabs: Record<string, string> = {};
|
|
65
75
|
for (const t of config.home.types) { const k = tabForEntityType(config, t.key); if (k) tabs[t.key] = k; }
|
|
66
|
-
|
|
76
|
+
// `options.copy: "today"` is the Today framing (title, one plain line, Talk and Plan entries); other apps keep the brand title.
|
|
77
|
+
const today = tab.options?.copy === 'today';
|
|
78
|
+
return homeTab({
|
|
79
|
+
api: corpus, brand: config.brand.name, tagline: config.brand.tagline, key: tab.key, label: tabLabel(tab), types: config.home.types, tabs,
|
|
80
|
+
talkKey: firstKey(config, 'talk') ?? firstKey(config, 'converse'), planKey: firstKey(config, 'plan'),
|
|
81
|
+
briefing: briefing && strings ? () => <BriefingCard controller={briefing.controller} reply={briefing.reply} strings={strings} /> : undefined,
|
|
82
|
+
copy: today ? TAB_COPY.today : undefined,
|
|
83
|
+
});
|
|
67
84
|
},
|
|
68
85
|
record: ({ record }, tab) => ({ key: tab.key, label: tabLabel(tab), safeArea: false, render: () => record() }),
|
|
69
|
-
notes: ({ notes, corpus }, tab) => {
|
|
86
|
+
notes: ({ config, notes, corpus }, tab) => {
|
|
87
|
+
const planKey = firstKey(config, 'plan');
|
|
70
88
|
if (!notes) throw new Error(`tab "${tab.key}": the notes screen needs a notes controller`);
|
|
71
89
|
return {
|
|
72
90
|
key: tab.key, label: tabLabel(tab), resetOnLeave: true,
|
|
73
|
-
render: ({ route, push, back }) => (route
|
|
74
|
-
? <NoteDetailScreen controller={notes} noteId={route.id} onBack={back} />
|
|
91
|
+
render: ({ route, push, back, openTab }) => (route
|
|
92
|
+
? <NoteDetailScreen controller={notes} noteId={route.id} onBack={back} onOpenPlan={planKey ? () => openTab(planKey) : undefined} />
|
|
75
93
|
: <NotesListScreen controller={notes} displays={corpus.schema?.displays} onOpen={(n) => push(n.id)} />),
|
|
76
94
|
};
|
|
77
95
|
},
|
|
78
96
|
tracker: ({ config, corpus, member, openUrl, itemsChanged }, tab) => trackerTab({ api: corpus, itemsChanged, key: tab.key, label: tabLabel(tab), notesKey: firstKey(config, 'notes'), memberConnections: member.connections, openUrl }),
|
|
79
|
-
|
|
97
|
+
plan: ({ config, corpus, member, openUrl, itemsChanged }, tab) => planTab({ api: corpus, key: tab.key, label: tabLabel(tab), notesKey: firstKey(config, 'notes'), documentTab: firstKey(config, 'library'), memberConnections: member.connections, openUrl, itemsChanged }),
|
|
98
|
+
talk: ({ config, corpus, converse, converseSpeed }, tab) => talkTab({ api: corpus, converse, speed: converseSpeed, key: tab.key, label: tabLabel(tab), libraryKey: firstKey(config, 'library') }),
|
|
99
|
+
library: ({ config, corpus }, tab) => libraryTab(corpus, { key: tab.key, label: tabLabel(tab), planKey: firstKey(config, 'plan') }),
|
|
80
100
|
ask: ({ corpus }, tab) => askTab(corpus, { key: tab.key, label: tabLabel(tab) }),
|
|
81
101
|
planning: ({ config, corpus }, tab) => createPlanningTab({ api: corpus, key: tab.key, label: tabLabel(tab), documentTab: firstKey(config, 'library') }),
|
|
82
102
|
connections: ({ config, member, openUrl }, tab) => createConnectionsTab({ api: member.connections, key: tab.key, label: tabLabel(tab), openUrl, returnTo: `${config.app.scheme}://${tab.key}` }),
|
|
@@ -135,10 +135,11 @@ export function createFoundryServices(deps: { config: FoundryAppConfig; device:
|
|
|
135
135
|
const notify = config.features.notifications ? createNotify({ config, device, session, diag, fake: Boolean(deps.fakeConverse), handleLink: (url) => handleLink(url) }) : null;
|
|
136
136
|
|
|
137
137
|
let open: (tab: string, id?: string) => void = () => undefined;
|
|
138
|
-
|
|
138
|
+
// The briefing lives on GO when the app has one, else on Home (Today): the morning notification lands there.
|
|
139
|
+
const goTab = (config.tabs.find((t) => t.screen === 'record') ?? config.tabs.find((t) => t.screen === 'home'))?.key;
|
|
139
140
|
const deepLink = createDeepLink({
|
|
140
141
|
openBriefing: () => {
|
|
141
|
-
// The morning notification: land on
|
|
142
|
+
// The morning notification: land on the briefing's tab and play today's briefing (a briefing already playing is left alone).
|
|
142
143
|
if (goTab) open(goTab);
|
|
143
144
|
const phase = briefing?.controller.getState().phase;
|
|
144
145
|
if (phase !== 'playing' && phase !== 'loading') void briefing?.controller.start();
|
|
@@ -12,6 +12,8 @@ export interface NoteDetailScreenProps {
|
|
|
12
12
|
controller: VoiceNotesController;
|
|
13
13
|
noteId: string;
|
|
14
14
|
onBack: () => void;
|
|
15
|
+
/** Open the Plan tab: a note's to-dos are listed there, never here. Omit and the line is plain text. */
|
|
16
|
+
onOpenPlan?: () => void;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
function ProjectPicker({ focuses, value, onPick }: { focuses: VoiceFocus[]; value: string | null; onPick: (id: string | null) => void }) {
|
|
@@ -25,7 +27,7 @@ function ProjectPicker({ focuses, value, onPick }: { focuses: VoiceFocus[]; valu
|
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/** One note: summary (per section when the note has them), to-dos, project, transcript, retry, delete. */
|
|
28
|
-
export function NoteDetailScreen({ controller, noteId, onBack }: NoteDetailScreenProps) {
|
|
30
|
+
export function NoteDetailScreen({ controller, noteId, onBack, onOpenPlan }: NoteDetailScreenProps) {
|
|
29
31
|
const state = useVoiceNotes(controller);
|
|
30
32
|
const theme = useTheme();
|
|
31
33
|
const haptic = useHaptics();
|
|
@@ -51,6 +53,7 @@ export function NoteDetailScreen({ controller, noteId, onBack }: NoteDetailScree
|
|
|
51
53
|
]);
|
|
52
54
|
const meta = [formatNoteDate(note.occurredAt), formatDuration(note.durationMs)].filter(Boolean).join(' · ');
|
|
53
55
|
const lead = noteLead(note);
|
|
56
|
+
const todoCount = sections.reduce((n, s) => n + s.items.length, 0);
|
|
54
57
|
|
|
55
58
|
return (
|
|
56
59
|
<DetailScreen
|
|
@@ -81,12 +84,21 @@ export function NoteDetailScreen({ controller, noteId, onBack }: NoteDetailScree
|
|
|
81
84
|
<View key={`${s.label}-${i}`} testID={`section-${i}`}>
|
|
82
85
|
<Section title={sections.length > 1 || s.label ? `${s.label || focusTitle(s.focusId)}${s.kind === 'personal' ? ' (personal)' : ''}` : 'Summary'} footer={sections.length > 1 && s.focusId ? `Filed under ${focusTitle(s.focusId)}` : undefined}>
|
|
83
86
|
{s.summary ? <View style={{ paddingVertical: theme.spacing.md, paddingRight: theme.spacing.xs }}><Text variant="body">{s.summary}</Text></View> : null}
|
|
84
|
-
{s.items.map((item, j) => (
|
|
85
|
-
<ListRow key={j} title={item} titleLines={4} leading={<Icon name="check" size={20} color={theme.colors.mutedForeground} />} />
|
|
86
|
-
))}
|
|
87
87
|
</Section>
|
|
88
88
|
</View>
|
|
89
89
|
))}
|
|
90
|
+
{todoCount > 0 ? (
|
|
91
|
+
<Section title="To-dos">
|
|
92
|
+
<ListRow
|
|
93
|
+
testID="note-todos-in-plan"
|
|
94
|
+
title={`${todoCount} to-do${todoCount === 1 ? '' : 's'} from this note`}
|
|
95
|
+
subtitle="They are in Plan, in the one list."
|
|
96
|
+
leading={<Icon name="check" size={20} color={theme.colors.mutedForeground} />}
|
|
97
|
+
onPress={onOpenPlan}
|
|
98
|
+
chevron={Boolean(onOpenPlan)}
|
|
99
|
+
/>
|
|
100
|
+
</Section>
|
|
101
|
+
) : null}
|
|
90
102
|
|
|
91
103
|
<Section title="Project">
|
|
92
104
|
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: theme.spacing.md, paddingVertical: theme.spacing.md, paddingRight: theme.spacing.xs }}>
|
|
@@ -135,22 +135,22 @@ describe('NoteDetailScreen delete (bd startsim-ij1lw.2)', () => {
|
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
describe('NoteDetailScreen', () => {
|
|
138
|
-
it('
|
|
138
|
+
it('shows the note summary but never its own to-do list: the to-dos are in Plan', async () => {
|
|
139
139
|
const { r } = await mountDetail('n1');
|
|
140
140
|
const text = allText(r);
|
|
141
|
-
expect(text).toContain('Finish exhibit list');
|
|
142
|
-
expect(text).toContain('Call Megan about the filing receipt');
|
|
143
|
-
expect(text).toContain('Move weekly report to Monday');
|
|
144
|
-
expect(text).toContain('Book the dentist');
|
|
145
141
|
expect(text).toContain('Finish the exhibit list before the hearing.');
|
|
142
|
+
expect(text).not.toContain('Call Megan about the filing receipt');
|
|
143
|
+
expect(text).not.toContain('Book the dentist');
|
|
144
|
+
expect(text).toContain('4 to-dos from this note');
|
|
145
|
+
expect(text).toContain('They are in Plan, in the one list.');
|
|
146
146
|
});
|
|
147
147
|
|
|
148
|
-
it('a note without sections
|
|
148
|
+
it('counts a note without sections from its summary bullets, and links into Plan', async () => {
|
|
149
149
|
const { r } = await mountDetail('n2', {
|
|
150
150
|
notes: [{ id: 'n2', title: 'Garage', status: 'ready', occurredAt: null, focusId: null, transcript: '', summary: 'Garage plans.\n\n## Next Steps\n- **Buy brackets** (Quinn)\n- **Cut shelves**' }],
|
|
151
151
|
});
|
|
152
|
-
expect(allText(r)).toContain('
|
|
153
|
-
expect(allText(r)).toContain('
|
|
152
|
+
expect(allText(r)).toContain('2 to-dos from this note');
|
|
153
|
+
expect(allText(r)).not.toContain('Buy brackets');
|
|
154
154
|
});
|
|
155
155
|
|
|
156
156
|
it('a note past the first page still opens (fetched by id)', async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { FlatList, Pressable, Text as RNText, View } from 'react-native';
|
|
2
|
+
import { FlatList, KeyboardAvoidingView, Platform, Pressable, Text as RNText, TextInput, View } from 'react-native';
|
|
3
3
|
import { Alert, Button, EmptyState, Header, MessageBubble, Spinner, useHaptics, useTheme } from '@startsimpli/ui-native';
|
|
4
4
|
import { useControllerState } from '../components/useControllerState';
|
|
5
5
|
import type { MeetingController } from '../../corpus/converse/meeting';
|
|
@@ -24,11 +24,13 @@ function useElapsed(on: boolean): number {
|
|
|
24
24
|
* Converse is a live meeting. One tap on Start; from then on it listens, notices when you stop talking, sends, speaks the
|
|
25
25
|
* reply and listens again until End. The reply text stays on screen and Replay says it again.
|
|
26
26
|
*/
|
|
27
|
-
export function ConverseScreen({ controller, speed }: { controller: MeetingController; speed?: SpeedStore }) {
|
|
27
|
+
export function ConverseScreen({ controller, speed, embedded }: { controller: MeetingController; speed?: SpeedStore; /** The Talk tab draws the title above this screen. */ embedded?: boolean }) {
|
|
28
28
|
const theme = useTheme();
|
|
29
29
|
const haptic = useHaptics();
|
|
30
30
|
const s = useControllerState({ getState: controller.getState, subscribe: (l: () => void) => controller.subscribe(l) });
|
|
31
31
|
const rate = useControllerState({ getState: speed ? speed.get : () => 1, subscribe: (l: () => void) => (speed ? speed.subscribe(l) : () => undefined) });
|
|
32
|
+
const [draft, setDraft] = useState('');
|
|
33
|
+
const send = () => { const t = draft.trim(); if (!t) return; setDraft(''); haptic('light', 'converse.send'); void controller.sendText(t); };
|
|
32
34
|
const list = useRef<FlatList<{ role: string; text: string }>>(null);
|
|
33
35
|
const active = s.phase === 'listening' || s.phase === 'thinking' || s.phase === 'speaking';
|
|
34
36
|
const busy = s.phase === 'ending';
|
|
@@ -36,8 +38,8 @@ export function ConverseScreen({ controller, speed }: { controller: MeetingContr
|
|
|
36
38
|
const color = s.phase === 'listening' ? theme.colors.destructive : s.phase === 'speaking' ? theme.colors.success ?? theme.colors.primary : theme.colors.primary;
|
|
37
39
|
|
|
38
40
|
return (
|
|
39
|
-
<
|
|
40
|
-
<Header large={!active && !busy} testID="converse-header" title="
|
|
41
|
+
<KeyboardAvoidingView style={{ flex: 1 }} behavior={Platform.OS === 'ios' ? 'padding' : undefined} testID="converse-screen">
|
|
42
|
+
{embedded ? null : <Header large={!active && !busy} testID="converse-header" title="Talk" subtitle={active ? 'Meeting in progress' : 'Talk it through'} />}
|
|
41
43
|
<FlatList
|
|
42
44
|
ref={list}
|
|
43
45
|
testID="converse-transcript"
|
|
@@ -87,6 +89,23 @@ export function ConverseScreen({ controller, speed }: { controller: MeetingContr
|
|
|
87
89
|
</RNText>
|
|
88
90
|
</>
|
|
89
91
|
)}
|
|
92
|
+
{/* Typing starts a conversation too: the Talk tab is start-talking OR a type box. */}
|
|
93
|
+
{active || embedded ? (
|
|
94
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: theme.spacing.sm, alignSelf: 'stretch' }}>
|
|
95
|
+
<TextInput
|
|
96
|
+
testID="converse-input"
|
|
97
|
+
value={draft}
|
|
98
|
+
onChangeText={setDraft}
|
|
99
|
+
onSubmitEditing={send}
|
|
100
|
+
returnKeyType="send"
|
|
101
|
+
placeholder="Or type here"
|
|
102
|
+
placeholderTextColor={theme.colors.mutedForeground}
|
|
103
|
+
accessibilityLabel="Type a message"
|
|
104
|
+
style={{ flex: 1, minHeight: 44, paddingHorizontal: theme.spacing.md, borderRadius: 22, borderWidth: 1, borderColor: theme.colors.border, color: theme.colors.foreground, fontSize: theme.fontSizes.lg }}
|
|
105
|
+
/>
|
|
106
|
+
<Button testID="converse-send" title="Send" variant="outline" disabled={!draft.trim()} onPress={send} />
|
|
107
|
+
</View>
|
|
108
|
+
) : null}
|
|
90
109
|
{speed ? (
|
|
91
110
|
<View testID="converse-speed" accessibilityLabel="Reply speed" style={{ flexDirection: 'row', alignItems: 'center', gap: theme.spacing.sm }}>
|
|
92
111
|
<RNText style={{ color: theme.colors.mutedForeground, fontSize: theme.fontSizes.sm }}>Speed</RNText>
|
|
@@ -110,6 +129,6 @@ export function ConverseScreen({ controller, speed }: { controller: MeetingContr
|
|
|
110
129
|
<Button testID="converse-end" title="End meeting" variant={active ? "destructive" : "outline"} size="lg" disabled={busy || (!active && s.phase !== 'stopped')} onPress={() => { haptic('warning', 'converse.end'); void controller.end(); }} />
|
|
111
130
|
</View>
|
|
112
131
|
</View>
|
|
113
|
-
</
|
|
132
|
+
</KeyboardAvoidingView>
|
|
114
133
|
);
|
|
115
134
|
}
|