@startsimpli/integrations 0.2.194 → 0.2.195

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": "@startsimpli/integrations",
3
- "version": "0.2.194",
3
+ "version": "0.2.195",
4
4
  "description": "Provider-agnostic types, API clients, hooks, and UI primitives for email + calendar integrations across StartSimpli apps, plus foundry customer email (subpath ./comms).",
5
5
  "license": "MIT",
6
6
  "homepage": "https://startsimpli.com",
@@ -51,8 +51,8 @@
51
51
  "@startsimpli/ui-native": ">=0.1.12",
52
52
  "react-native-safe-area-context": ">=4.0.0",
53
53
  "@startsimpli/auth": "^0.4.53",
54
- "@startsimpli/utils": "^0.4.20",
55
- "@startsimpli/ui": "^0.4.189"
54
+ "@startsimpli/ui": "^0.4.189",
55
+ "@startsimpli/utils": "^0.4.20"
56
56
  },
57
57
  "peerDependenciesMeta": {
58
58
  "react": {
@@ -99,8 +99,8 @@
99
99
  "react-native": "0.85.3",
100
100
  "react-native-safe-area-context": "~5.7.0",
101
101
  "@startsimpli/llm": "0.4.31",
102
- "@startsimpli/ui-native": "0.1.15",
103
102
  "@startsimpli/ui": "0.4.189",
103
+ "@startsimpli/ui-native": "0.1.15",
104
104
  "@startsimpli/auth": "0.4.53",
105
105
  "@startsimpli/utils": "0.4.20"
106
106
  },
@@ -52,6 +52,14 @@ const type = (text: string) => {
52
52
  };
53
53
 
54
54
  describe('the one converse screen', () => {
55
+ it('an empty thread offers a few things to say, and tapping one fills the input; Done is a real button', () => {
56
+ setup();
57
+ const hint = screen.getByTestId('converse-suggestions');
58
+ fireEvent.click(within(hint).getByRole('button', { name: 'What is due today?' }));
59
+ expect((screen.getByLabelText('Type a message') as HTMLInputElement).value).toBe('What is due today?');
60
+ expect(screen.getByRole('button', { name: 'Done' }).className).toContain('border');
61
+ });
62
+
55
63
  it('has an input, a small mic and Send, and no Talk/Ask toggle and no start button', () => {
56
64
  setup();
57
65
  expect(screen.getByLabelText('Type a message')).toBeTruthy();
@@ -144,7 +144,7 @@ describe('LibraryPage — filtering and paging are SERVER round trips', () => {
144
144
  });
145
145
  render(<LibraryPage api={api} scope={SCOPE} />);
146
146
 
147
- await screen.findByText('Library');
147
+ await screen.findByText('All documents');
148
148
  await user.type(screen.getByRole('searchbox'), 'renewal');
149
149
  await user.click(screen.getByRole('button', { name: 'Search' }));
150
150
 
@@ -208,7 +208,7 @@ describe('LibraryPage — filtering and paging are SERVER round trips', () => {
208
208
  };
209
209
  render(<LibraryPage api={api} scope={SCOPE} />);
210
210
 
211
- await screen.findByText('Library');
211
+ await screen.findByText('All documents');
212
212
  await user.type(screen.getByRole('searchbox'), 'renewal');
213
213
  await user.click(screen.getByRole('button', { name: 'Search' }));
214
214
 
@@ -38,7 +38,7 @@ describe('DecisionsPage', () => {
38
38
  const c = client({ pending: vi.fn(async () => []) });
39
39
  render(<DecisionsPage client={c} />);
40
40
  await screen.findByTestId('decisions-empty');
41
- fireEvent.click(await screen.findByLabelText(/push notifications/i));
41
+ fireEvent.click(await screen.findByLabelText(/notify me on my phone/i));
42
42
  expect(c.setPush).toHaveBeenCalledWith(false);
43
43
  });
44
44
  });
@@ -132,6 +132,8 @@ export function ConnectionsPage(props: ConnectionsPageProps) {
132
132
  ))}
133
133
  </section>
134
134
 
135
+ {/* Nothing to offer is no section: a heading over a blank gap reads as a broken page. */}
136
+ {(personal ? connectableEntries(catalog, connections) : catalog).length > 0 || (personal && !loading && catalog.length === 0) ? (
135
137
  <section className={cn.section}>
136
138
  <h2 className={cn.heading}>
137
139
  {personal ? 'Connect your own account' : 'Available connectors'}
@@ -164,6 +166,7 @@ export function ConnectionsPage(props: ConnectionsPageProps) {
164
166
  />
165
167
  ))}
166
168
  </section>
169
+ ) : null}
167
170
 
168
171
  {/* THE OTHER HALF OF THE ALLOWLIST (bd startsim-768w.22.25.8): who has
169
172
  actually connected. Its own component, and deliberately not folded into
@@ -193,10 +193,18 @@ export function ConversePage({ client, classNames, meeting, createIO, savedLink
193
193
  />
194
194
  <button type="submit" className={cx('secondary')} disabled={!draft.trim()}>Send</button>
195
195
  </form>
196
- <div className="flex flex-wrap items-center gap-3 text-xs">
197
- <button type="button" className="underline opacity-70" onClick={() => void onDone()} disabled={busy || (!ctl.current)}>Done</button>
196
+ {lines.length === 0 ? (
197
+ <div className="flex flex-wrap items-center gap-2 text-sm" data-testid="converse-suggestions">
198
+ <span className={cx('muted')}>Try:</span>
199
+ {['What is due today?', 'Add a to-do: call the vendor', 'What am I waiting on?'].map((s) => (
200
+ <button key={s} type="button" className="rounded-full border border-gray-300 bg-white px-3 py-1 text-gray-700 hover:border-gray-400" onClick={() => setDraft(s)}>{s}</button>
201
+ ))}
202
+ </div>
203
+ ) : null}
204
+ <div className="flex flex-wrap items-center gap-3 text-sm">
205
+ <button type="button" className={cx('secondary')} title="Save this conversation" onClick={() => void onDone()} disabled={busy || (!ctl.current)}>Done</button>
198
206
  <label className={cx('muted')} htmlFor="converse-speed">Speed</label>
199
- <select id="converse-speed" className="rounded border px-1 py-0.5 text-xs" value={speed} onChange={(e) => onSpeed(normalizeSpeed(e.target.value))} data-testid="converse-speed" aria-label="Speech speed">
207
+ <select id="converse-speed" className="rounded-md border border-gray-300 bg-white px-2 py-1 text-sm text-gray-800" value={speed} onChange={(e) => onSpeed(normalizeSpeed(e.target.value))} data-testid="converse-speed" aria-label="Speech speed">
200
208
  {SPEEDS.map((v) => <option key={v} value={v}>{v}x</option>)}
201
209
  </select>
202
210
  </div>
@@ -61,14 +61,20 @@ export function DecisionsPage({ client, classNames, focus }: DecisionsPageProps)
61
61
  const ordered = (rows ?? []).slice().sort((a, b) => Number(b.id === focus) - Number(a.id === focus));
62
62
  return (
63
63
  <div className={cx('root')}>
64
+ {error ? <div className={cx('error')} role="alert">{error}</div> : null}
65
+ {rows && !rows.length ? (
66
+ <div className="rounded-xl border border-gray-200 bg-white p-6 text-center" data-testid="decisions-empty">
67
+ <p className="font-medium text-gray-900">Nothing is waiting on you.</p>
68
+ <p className={cx('muted')}>When an agent needs your call, it shows up here.</p>
69
+ </div>
70
+ ) : null}
71
+ {ordered.map((row) => <DecisionCard key={row.id} row={row} client={client} cx={cx} onDone={load} />)}
64
72
  {push !== null ? (
65
- <label className={cx('muted')}>
66
- <input type="checkbox" checked={push} onChange={(e) => { const v = e.target.checked; setPush(v); client.setPush(v).catch(() => setPush(!v)); }} /> Send me push notifications
73
+ <label className="mt-2 flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-4 py-3 text-sm text-gray-800">
74
+ <input type="checkbox" className="h-4 w-4 accent-indigo-600" checked={push} onChange={(e) => { const v = e.target.checked; setPush(v); client.setPush(v).catch(() => setPush(!v)); }} />
75
+ <span>Notify me on my phone when a decision is waiting</span>
67
76
  </label>
68
77
  ) : null}
69
- {error ? <div className={cx('error')} role="alert">{error}</div> : null}
70
- {rows && !rows.length ? <p className={cx('muted')} data-testid="decisions-empty">Nothing is waiting on you.</p> : null}
71
- {ordered.map((row) => <DecisionCard key={row.id} row={row} client={client} cx={cx} onDone={load} />)}
72
78
  </div>
73
79
  );
74
80
  }
@@ -342,6 +342,8 @@ export function LibraryPage({
342
342
  .map(([name]) => name);
343
343
  }, [applied, filters, query]);
344
344
 
345
+ const hasFilters = Boolean(filters.source || filters.partyId || filters.occurredAfter || filters.occurredBefore);
346
+
345
347
  if (loadError) {
346
348
  return <p className={cn.error} role="alert">{loadError}</p>;
347
349
  }
@@ -355,10 +357,10 @@ export function LibraryPage({
355
357
  className="flex flex-wrap items-end gap-2"
356
358
  onSubmit={(event) => { event.preventDefault(); update({ search: draftSearch || undefined }); }}
357
359
  >
358
- <label className="flex flex-col gap-1">
360
+ <label className="flex min-w-0 flex-1 flex-col gap-1">
359
361
  <span className="text-xs font-medium text-gray-700">Search</span>
360
362
  <input
361
- className={cn.input}
363
+ className={`${cn.input} w-full`}
362
364
  type="search"
363
365
  value={draftSearch}
364
366
  placeholder="Search everything pulled in"
@@ -366,6 +368,12 @@ export function LibraryPage({
366
368
  />
367
369
  </label>
368
370
 
371
+ <button type="submit" className={cn.button}>Search</button>
372
+
373
+ {/* The rest of the filters fold away: a phone should see the search box first, not a form a third of the screen tall. */}
374
+ <details className="w-full rounded-lg border border-gray-200 bg-white px-3 py-2" open={hasFilters}>
375
+ <summary className="cursor-pointer text-sm font-medium text-gray-700">Filters{hasFilters ? ' (on)' : ''}</summary>
376
+ <div className="mt-3 flex flex-wrap items-end gap-2">
369
377
  <label className="flex flex-col gap-1">
370
378
  <span className="text-xs font-medium text-gray-700">Source</span>
371
379
  <select
@@ -419,7 +427,6 @@ export function LibraryPage({
419
427
  />
420
428
  </label>
421
429
 
422
- <button type="submit" className={cn.button}>Search</button>
423
430
  <button
424
431
  type="button"
425
432
  className={cn.button}
@@ -436,6 +443,8 @@ export function LibraryPage({
436
443
  >
437
444
  Clear
438
445
  </button>
446
+ </div>
447
+ </details>
439
448
  </form>
440
449
 
441
450
  {ignored.length ? (
@@ -481,7 +490,7 @@ export function LibraryPage({
481
490
 
482
491
  <section className={cn.section}>
483
492
  <div className="flex items-baseline justify-between gap-4">
484
- <h2 className={cn.heading}>{folder ? folderName(folder) : 'Library'}</h2>
493
+ <h2 className={cn.heading}>{folder ? folderName(folder) : 'All documents'}</h2>
485
494
  <p className={cn.muted}>
486
495
  {count} record{count === 1 ? '' : 's'}
487
496
  {count > 0 ? ` · page ${page} of ${lastPage}` : ''}
@@ -12,6 +12,10 @@ import { ConnectionSettingsForm, ReplaceKeyForm } from './ConnectionForms';
12
12
  import type { BoundApi } from './bound-api';
13
13
  import { DEFAULTS, RUN_KIND_COPY } from './copy';
14
14
 
15
+ // One main action per card: Reconnect (when the account is broken) is the only filled button; the rest are outlined, and Disconnect is a quiet red link.
16
+ const SECONDARY_BTN = 'rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-800 hover:border-gray-400 disabled:opacity-50';
17
+ const QUIET_DANGER_BTN = 'rounded-md px-3 py-1.5 text-sm font-medium text-red-700 hover:bg-red-50 disabled:opacity-50';
18
+
15
19
  export function ConnectionCard({
16
20
  api, personal, connection, entry, canManage, classNames: cn, onChanged,
17
21
  }: {
@@ -112,7 +116,7 @@ export function ConnectionCard({
112
116
  {api.connectionRuns ? (
113
117
  <button
114
118
  type="button"
115
- className={cn.button}
119
+ className={SECONDARY_BTN}
116
120
  disabled={Boolean(busy)}
117
121
  onClick={() => {
118
122
  const opening = !activityOpen;
@@ -131,7 +135,7 @@ export function ConnectionCard({
131
135
  <>
132
136
  <button
133
137
  type="button"
134
- className={cn.button}
138
+ className={SECONDARY_BTN}
135
139
  disabled={Boolean(busy)}
136
140
  onClick={() => void guard('check', async () => {
137
141
  setCheckWhy(null);
@@ -167,7 +171,7 @@ export function ConnectionCard({
167
171
  ) : (
168
172
  <button
169
173
  type="button"
170
- className={cn.button}
174
+ className={SECONDARY_BTN}
171
175
  disabled={Boolean(busy)}
172
176
  onClick={() => {
173
177
  setConfirmingDisconnect(false);
@@ -186,7 +190,7 @@ export function ConnectionCard({
186
190
  {api.connectionChoices && api.connectionActions ? (
187
191
  <button
188
192
  type="button"
189
- className={cn.button}
193
+ className={SECONDARY_BTN}
190
194
  disabled={Boolean(busy)}
191
195
  onClick={() => void guard('discover', async () => {
192
196
  const page = await api.connectionChoices!(connection.id);
@@ -217,7 +221,7 @@ export function ConnectionCard({
217
221
  {(configFields.length || trackerApi) && api.updateConnectionConfig ? (
218
222
  <button
219
223
  type="button"
220
- className={cn.button}
224
+ className={SECONDARY_BTN}
221
225
  disabled={Boolean(busy) || confirmingDisconnect}
222
226
  onClick={() => {
223
227
  setReplacing(false);
@@ -230,7 +234,7 @@ export function ConnectionCard({
230
234
  ) : null}
231
235
  <button
232
236
  type="button"
233
- className={cn.button}
237
+ className={QUIET_DANGER_BTN}
234
238
  disabled={Boolean(busy) || confirmingDisconnect}
235
239
  onClick={() => {
236
240
  setReplacing(false);
@@ -27,7 +27,7 @@ export function TimelinePage({ api, scope, now, timeZone, className }: TimelineP
27
27
  return (
28
28
  <TrackerTimeline
29
29
  api={api} orgId={scope.orgId} now={now ?? mountedAt} timeZone={timeZone}
30
- filter={NO_FILTER} className={className}
30
+ filter={NO_FILTER} className={className} heading={false}
31
31
  />
32
32
  );
33
33
  }
@@ -29,6 +29,8 @@ export interface TrackerTimelineProps {
29
29
  /** Free-text filters wait this long before they become a server query. */
30
30
  debounceMs?: number;
31
31
  className?: string;
32
+ /** Draw the 'Timeline' heading. A page that already titles itself Timeline turns this off (one title per page). */
33
+ heading?: boolean;
32
34
  }
33
35
 
34
36
  const FILTER_DEBOUNCE_MS = 400;
@@ -44,7 +46,7 @@ function useDebounced<T>(value: T, ms: number): T {
44
46
  }
45
47
 
46
48
  export function TrackerTimeline({
47
- api, orgId, filter, now, timeZone = 'UTC', debounceMs = FILTER_DEBOUNCE_MS, className,
49
+ api, orgId, filter, now, timeZone = 'UTC', debounceMs = FILTER_DEBOUNCE_MS, className, heading = true,
48
50
  }: TrackerTimelineProps) {
49
51
  const apiRef = React.useRef(api);
50
52
  apiRef.current = api;
@@ -81,7 +83,7 @@ export function TrackerTimeline({
81
83
 
82
84
  return (
83
85
  <section className={className ?? 'space-y-4'} aria-label="Tracker timeline" data-testid="tracker-timeline">
84
- <h2 className="text-lg font-semibold text-gray-900">Timeline</h2>
86
+ {heading ? <h2 className="text-lg font-semibold text-gray-900">Timeline</h2> : null}
85
87
  {error ? <p className="text-sm text-red-600" role="alert">{error}</p> : null}
86
88
  {loading && !built ? <p className="text-sm text-gray-500">Loading the timeline…</p> : null}
87
89
  {built ? (