@startsimpli/integrations 0.2.141 → 0.2.143

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.141",
3
+ "version": "0.2.143",
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",
@@ -150,7 +150,7 @@ describe('TrackerPage — it must not loop', () => {
150
150
  render(<TrackerPage api={api} scope={SCOPE} now={NOW} />);
151
151
  await screen.findByText('Chase the inventor for comments on 2148');
152
152
  expect(calls).toBe(1);
153
- await userEvent.click(screen.getAllByRole('button', { name: 'Done' })[0]);
153
+ await userEvent.click(screen.getAllByRole('button', { name: 'Mark done' })[0]);
154
154
  await new Promise((resolve) => setTimeout(resolve, 150));
155
155
  expect(updated).toHaveLength(1);
156
156
  expect(calls).toBe(2);
@@ -646,3 +646,36 @@ describe('TrackerPage — adding a to-do', () => {
646
646
  expect(screen.queryByRole('textbox', { name: /add a to-do/i })).toBeNull();
647
647
  });
648
648
  });
649
+
650
+ describe('TrackerPage — done fold and blocked reason', () => {
651
+ it('says so when nothing has been finished', async () => {
652
+ render(<TrackerPage api={makeApi({ rows: ROWS.filter((r) => r.status !== 'done') })} scope={SCOPE} now={NOW} />);
653
+ await screen.findByText('Chase the inventor for comments on 2148');
654
+ await userEvent.click(screen.getByText('Done'));
655
+ expect(await screen.findByText(/nothing finished yet/i)).toBeInTheDocument();
656
+ });
657
+
658
+ it('shows why a blocked to-do is blocked', async () => {
659
+ const rows = [commitment({ externalId: 'commit:b1', title: 'Share the staging link', status: 'blocked', statusReason: 'Waiting on DNS' })];
660
+ render(<TrackerPage api={makeApi({ rows })} scope={SCOPE} now={NOW} />);
661
+ expect(await screen.findByText(/Waiting on DNS/)).toBeInTheDocument();
662
+ });
663
+ });
664
+
665
+ describe('TrackerPage — filtering', () => {
666
+ it('narrows the list by title, owner or project as you type, and says when nothing matches', async () => {
667
+ render(<TrackerPage api={makeApi()} scope={SCOPE} now={NOW} projectNames={{}} />);
668
+ await screen.findByText('Chase the inventor for comments on 2148');
669
+ const box = screen.getByRole('searchbox', { name: /filter to-dos/i });
670
+ await userEvent.type(box, 'equity');
671
+ expect(screen.getByText('Send the equity sheet to Harry Holcomb')).toBeInTheDocument();
672
+ expect(screen.queryByText('Chase the inventor for comments on 2148')).toBeNull();
673
+ await userEvent.clear(box);
674
+ await userEvent.type(box, 'rae');
675
+ expect(screen.getByText('Chase the inventor for comments on 2148')).toBeInTheDocument();
676
+ await userEvent.clear(box);
677
+ await userEvent.type(box, 'zzzz');
678
+ expect(screen.getByText(/no to-dos match/i)).toBeInTheDocument();
679
+ expect(screen.queryByText(/nothing is owed/i)).toBeNull();
680
+ });
681
+ });
@@ -314,13 +314,22 @@ export function TrackerPage({
314
314
  // `sweepEpoch` re-arms the poll after the button starts a new one.
315
315
  }, [canQueue, pollMs, maxAutoResumes, scope.orgId, sweepEpoch]);
316
316
 
317
+ const [filterText, setFilterText] = React.useState('');
318
+ /** Client-side narrowing over the loaded page: title, owner, subject or project name. */
319
+ const matches = React.useCallback((r: Commitment) => {
320
+ const q = filterText.trim().toLowerCase();
321
+ if (!q) return true;
322
+ const project = r.focusId ? projectNames[r.focusId] ?? '' : '';
323
+ return [r.title, r.ownerName, r.subject, project, r.detail].some((v) => (v ?? '').toLowerCase().includes(q));
324
+ }, [filterText, projectNames]);
325
+ const filtering = filterText.trim().length > 0;
317
326
  const groups = React.useMemo(
318
- () => groupTracker(rows, { now: clock, timeZone }),
319
- [rows, clock, timeZone],
327
+ () => groupTracker(rows.filter(matches), { now: clock, timeZone }),
328
+ [rows, matches, clock, timeZone],
320
329
  );
321
330
  const doneGroups = React.useMemo(
322
- () => (doneRows ? groupTracker(doneRows, { now: clock, timeZone }).done : []),
323
- [doneRows, clock, timeZone],
331
+ () => (doneRows ? groupTracker(doneRows.filter(matches), { now: clock, timeZone }).done : []),
332
+ [doneRows, matches, clock, timeZone],
324
333
  );
325
334
 
326
335
  /** One write, then the list is re-read: the server is the source of what is owed. */
@@ -401,6 +410,14 @@ export function TrackerPage({
401
410
  <button type="submit" className={cn.secondaryButton} disabled={adding || !draftTitle.trim()}>Add</button>
402
411
  </form>
403
412
  ) : null}
413
+ {rows.length > 0 ? (
414
+ <input
415
+ type="search" className={`${cn.input} w-full`} value={filterText}
416
+ onChange={(e) => setFilterText(e.target.value)}
417
+ placeholder="Filter to-dos by title, owner or project…" aria-label="Filter to-dos"
418
+ />
419
+ ) : null}
420
+ {filtering && owed === 0 && rows.length > 0 ? <p className={cn.muted}>No to-dos match “{filterText.trim()}”.</p> : null}
404
421
  <div className="flex flex-wrap items-center gap-3">
405
422
  <p className={cn.muted} data-testid="tracker-summary">
406
423
  {loading ? 'Loading…' : `${owed} owed · ${c.today} today · ${c.inProgress} in progress`}
@@ -468,7 +485,7 @@ export function TrackerPage({
468
485
  {sweep ? <SweepPanel sweep={sweep} now={clock} classNames={cn} onOpenDocument={onOpenDocument} /> : null}
469
486
  {run ? <RunSummary result={run} classNames={cn} onOpenDocument={onOpenDocument} /> : null}
470
487
 
471
- {!loading && owed === 0 && c.stale === 0 ? (
488
+ {!loading && owed === 0 && c.stale === 0 && !filtering ? (
472
489
  <p className={cn.muted}>
473
490
  {workspaceHasAny === false
474
491
  ? 'Nothing has been pulled out of your meetings yet. Connect a source, then run “Pull from meetings”.'
@@ -483,7 +500,7 @@ export function TrackerPage({
483
500
  </h2>
484
501
  <ul>
485
502
  {groups[key].map((entry) => rowFor(entry, canWrite ? {
486
- actions: <button type="button" className={btn} onClick={() => void act(entry.item, { status: 'done' })}>Done</button>,
503
+ actions: <button type="button" className={btn} onClick={() => void act(entry.item, { status: 'done' })}>Mark done</button>,
487
504
  } : undefined))}
488
505
  </ul>
489
506
  </section>
@@ -538,7 +555,7 @@ export function TrackerPage({
538
555
  >
539
556
  <summary className={foldSummary}>Done{doneRows ? ` (${doneGroups.length})` : ''}</summary>
540
557
  <ul className="px-4 pb-3">
541
- {doneRows === null ? <li className={cn.muted}>Loading…</li> : doneGroups.map((entry) => rowFor(entry))}
558
+ {doneRows === null ? <li className={cn.muted}>Loading…</li> : doneGroups.length === 0 ? <li className={cn.muted}>Nothing finished yet.</li> : doneGroups.map((entry) => rowFor(entry))}
542
559
  </ul>
543
560
  </details>
544
561
  </div>
@@ -48,10 +48,13 @@ export function CompactItemRow({ item, days, due, project, trackerName, onOpen,
48
48
  {item.title}
49
49
  </button>
50
50
  ) : <span className="block truncate text-sm font-medium text-gray-900">{item.title}</span>}
51
+ {item.status === 'blocked' && item.statusReason ? (
52
+ <span className="block truncate text-xs text-gray-500">Blocked: {item.statusReason}</span>
53
+ ) : null}
51
54
  </div>
52
55
  <div className="flex shrink-0 items-center gap-2">
53
56
  {project ? <span className={CHIP} title={project}>{project}</span> : null}
54
- {showStatus && item.status !== 'open' && item.status !== 'done' ? <span className={CHIP}>{item.status.replace('_', ' ')}</span> : null}
57
+ {showStatus && item.status !== 'open' && item.status !== 'done' ? <span className={CHIP} title={item.statusReason || undefined}>{item.status.replace('_', ' ')}</span> : null}
55
58
  {item.sync ? <ExternalLinkChip sync={item.sync} trackerName={trackerName} className={CHIP} /> : null}
56
59
  {label ? <span className={`w-16 text-right text-xs ${late ? 'font-semibold text-red-700' : 'text-gray-500'}`}>{label}</span> : null}
57
60
  {actions}