@startsimpli/integrations 0.2.200 → 0.2.202
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 +7 -7
- package/src/__tests__/briefing-actions.test.ts +11 -0
- package/src/__tests__/briefing-edits.test.ts +98 -0
- package/src/__tests__/briefing-markdown.test.ts +64 -0
- package/src/__tests__/converse-brain.test.ts +64 -1
- package/src/__tests__/converse-cards.test.ts +53 -0
- package/src/__tests__/converse-handoff.test.ts +8 -0
- package/src/__tests__/converse-meeting-brief.test.ts +72 -8
- package/src/__tests__/converse-meeting-duplex.test.ts +132 -0
- package/src/__tests__/converse-meeting-keep-speech.test.ts +87 -0
- package/src/__tests__/converse-meeting-vad.test.ts +1 -1
- package/src/__tests__/converse-page.test.tsx +148 -37
- package/src/__tests__/converse-roci.test.ts +22 -0
- package/src/__tests__/converse-spoken-form.test.ts +10 -0
- package/src/__tests__/converse-spoken-summary.test.ts +27 -6
- package/src/__tests__/converse-structure.test.ts +27 -0
- package/src/__tests__/converse-view.test.ts +46 -0
- package/src/__tests__/converse.test.ts +29 -2
- package/src/__tests__/corpus-ask.test.ts +22 -0
- package/src/__tests__/corpus-tracker.test.tsx +42 -174
- package/src/__tests__/data-table-logic.test.ts +75 -0
- package/src/__tests__/data-table.test.tsx +133 -0
- package/src/__tests__/extract-classify.test.ts +17 -0
- package/src/__tests__/fleet-page.test.tsx +57 -0
- package/src/__tests__/fleet-view.test.ts +149 -0
- package/src/__tests__/home-brief.test.tsx +25 -40
- package/src/__tests__/library-call-shape.test.tsx +164 -0
- package/src/__tests__/load-error.test.tsx +1 -1
- package/src/__tests__/mini-markdown.test.tsx +24 -0
- package/src/__tests__/overview-page.test.tsx +36 -6
- package/src/__tests__/plan-shell.test.tsx +6 -4
- package/src/__tests__/project-basis-entity.test.ts +19 -0
- package/src/__tests__/project-basis.test.ts +21 -0
- package/src/__tests__/relay-cli.test.ts +10 -1
- package/src/__tests__/task-detail-project-guess.test.tsx +46 -0
- package/src/__tests__/timeline-events.test.ts +65 -0
- package/src/__tests__/timeline-table.test.tsx +66 -0
- package/src/__tests__/todo-table-model.test.ts +75 -0
- package/src/__tests__/todo-table.test.tsx +202 -0
- package/src/__tests__/tracker-timeline-component.test.tsx +4 -4
- package/src/__tests__/tracker-timeline-reader.test.ts +1 -1
- package/src/comms/__tests__/app-sends-page.test.tsx +69 -0
- package/src/comms/api/comms.ts +23 -0
- package/src/comms/components/ResultsPanel.tsx +2 -2
- package/src/comms/components/SendLog.tsx +20 -8
- package/src/comms/components/index.ts +1 -0
- package/src/comms/components/pages/AppSendsPage.tsx +58 -0
- package/src/comms/hooks/index.ts +8 -3
- package/src/components/FolderTree.tsx +12 -3
- package/src/components/index.ts +4 -1
- package/src/components/pages/ConversePage.tsx +114 -105
- package/src/components/pages/FleetPage.tsx +115 -0
- package/src/components/pages/LibraryPage.tsx +63 -24
- package/src/components/pages/TaskDetailPage.tsx +27 -1
- package/src/components/pages/TrackerPage.tsx +170 -474
- package/src/components/pages/converse/CardView.tsx +72 -0
- package/src/components/pages/converse/SettingsMenu.tsx +37 -0
- package/src/components/pages/converse/Thread.tsx +48 -33
- package/src/components/pages/converse/useNeedsYou.ts +60 -0
- package/src/components/pages/home/BriefCard.tsx +16 -7
- package/src/components/pages/home/HomeBriefPage.tsx +6 -91
- package/src/components/pages/home/MiniMarkdown.tsx +51 -0
- package/src/components/pages/home/{DueSoonLine.tsx → dueSoonText.ts} +2 -11
- package/src/components/pages/home/index.ts +1 -1
- package/src/components/pages/overview/OverviewPage.tsx +46 -83
- package/src/components/pages/plan/TalkPage.tsx +5 -14
- package/src/components/pages/plan/TimelinePage.tsx +4 -2
- package/src/components/pages/task-tracker/ProjectGuess.tsx +42 -0
- package/src/components/pages/tracker/SweepPanel.tsx +108 -0
- package/src/components/pages/tracker/TimelineTable.tsx +70 -0
- package/src/components/pages/tracker/TrackerTimeline.tsx +32 -15
- package/src/components/table/DataTable.tsx +92 -0
- package/src/components/table/RowMenu.tsx +35 -0
- package/src/components/table/TablePagination.tsx +63 -0
- package/src/components/table/TableToolbar.tsx +56 -0
- package/src/components/table/TodoTable.tsx +142 -0
- package/src/components/table/index.ts +10 -0
- package/src/components/table/table-logic.ts +60 -0
- package/src/components/table/todo-model.ts +93 -0
- package/src/corpus/ask-items.ts +7 -4
- package/src/corpus/ask.ts +1 -1
- package/src/corpus/briefing/actions/confirm.ts +9 -1
- package/src/corpus/briefing/actions/execute.ts +71 -11
- package/src/corpus/briefing/actions/log.ts +1 -1
- package/src/corpus/briefing/actions/seam.ts +18 -2
- package/src/corpus/briefing/actions/types.ts +14 -0
- package/src/corpus/briefing/generate-weekly.ts +4 -0
- package/src/corpus/briefing/generate.ts +4 -0
- package/src/corpus/briefing/index.ts +1 -0
- package/src/corpus/briefing/intent/describe.ts +5 -1
- package/src/corpus/briefing/intent/edits.ts +92 -0
- package/src/corpus/briefing/intent/grammar.ts +3 -0
- package/src/corpus/briefing/intent/ground.ts +5 -1
- package/src/corpus/briefing/intent/match.ts +3 -1
- package/src/corpus/briefing/intent/model.ts +36 -3
- package/src/corpus/briefing/intent/resolve.ts +12 -1
- package/src/corpus/briefing/intent/types.ts +8 -0
- package/src/corpus/briefing/markdown.ts +71 -0
- package/src/corpus/briefing/speak.ts +13 -0
- package/src/corpus/client.ts +40 -146
- package/src/corpus/converse/brain.ts +41 -13
- package/src/corpus/converse/briefing-queue.ts +105 -27
- package/src/corpus/converse/cards.ts +69 -0
- package/src/corpus/converse/client.ts +6 -0
- package/src/corpus/converse/fleet-view.ts +126 -0
- package/src/corpus/converse/fleet.ts +18 -5
- package/src/corpus/converse/followups.ts +12 -2
- package/src/corpus/converse/handle.ts +21 -12
- package/src/corpus/converse/handoff.ts +7 -2
- package/src/corpus/converse/index.ts +11 -3
- package/src/corpus/converse/meeting-config.ts +8 -4
- package/src/corpus/converse/meeting.ts +66 -11
- package/src/corpus/converse/respond.ts +14 -2
- package/src/corpus/converse/roci.ts +13 -0
- package/src/corpus/converse/spoken-form.ts +9 -2
- package/src/corpus/converse/spoken-summary.ts +30 -8
- package/src/corpus/converse/store.ts +2 -0
- package/src/corpus/converse/structure.ts +39 -0
- package/src/corpus/converse/types.ts +14 -1
- package/src/corpus/converse/view.ts +34 -0
- package/src/corpus/entities.ts +2 -0
- package/src/corpus/extract.ts +9 -4
- package/src/corpus/index.ts +2 -0
- package/src/corpus/participants.ts +220 -0
- package/src/corpus/project-basis.ts +23 -0
- package/src/corpus/timeline-events.ts +83 -0
- package/src/corpus/tracker-sort.ts +9 -3
- package/src/corpus/tracker-timeline-client.ts +2 -0
- package/src/corpus/tracker-timeline.ts +4 -0
- package/src/corpus/types.ts +38 -5
- package/src/native/app/__tests__/plan-talk-registry.test.tsx +2 -1
- package/src/native/app/converseServices.ts +5 -3
- package/src/native/app/device.ts +2 -0
- package/src/native/converse/ConverseScreen.tsx +30 -4
- package/src/native/converse/__tests__/liveScreen.test.tsx +35 -2
- package/src/native/converse/__tests__/meetingIO.test.ts +55 -1
- package/src/native/converse/format.ts +2 -2
- package/src/native/converse/io.ts +15 -5
- package/src/native/home/HomeScreen.tsx +1 -1
- package/src/native/home/tab.tsx +1 -2
- package/src/native/plan/PlanTab.tsx +1 -2
- package/src/native/plan/__tests__/plan-tab.test.tsx +5 -5
- package/src/native/talk/TalkTab.tsx +1 -1
- package/src/native/talk/__tests__/talk-tab.test.tsx +1 -1
- package/src/__tests__/home-needs-your-call.test.tsx +0 -65
- package/src/components/pages/tracker/TrackerBoard.tsx +0 -45
- package/src/components/pages/tracker/TrackerToolbar.tsx +0 -44
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* FLEET (Tandem /fleet, read-only): relay -> project leads -> their sessions, what each is for, and what waits on the
|
|
5
|
+
* person. The data is the relay's synced snapshot (`GET /corpus/converse/fleet-status`), parsed in the package
|
|
6
|
+
* (`buildFleetView`); this only draws it. Re-reads every 30s and says how old the snapshot is.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
|
|
10
|
+
import { ageWords, FLEET_FRESH_MS } from '../../corpus/converse/fleet';
|
|
11
|
+
import type { FleetSession, FleetView } from '../../corpus/converse/fleet-view';
|
|
12
|
+
import { LoadError } from '../LoadError';
|
|
13
|
+
|
|
14
|
+
export interface FleetPayload { snapshot: { text: string; updatedAt: string; view: FleetView | null } | null }
|
|
15
|
+
export interface FleetPageProps { load: () => Promise<FleetPayload>; refreshMs?: number }
|
|
16
|
+
|
|
17
|
+
function SessionRow({ s, testId }: { s: FleetSession; testId?: string }) {
|
|
18
|
+
return (
|
|
19
|
+
<div className="flex flex-col gap-0.5 py-2" data-testid={testId}>
|
|
20
|
+
<div className="flex items-center gap-2">
|
|
21
|
+
<span className={`h-2 w-2 shrink-0 rounded-full ${s.status === 'live' ? 'bg-green-500' : 'bg-gray-300'}`} title={s.status} />
|
|
22
|
+
<span className="font-medium text-gray-900">{s.name || s.id}</span>
|
|
23
|
+
<span className="font-mono text-xs text-gray-400">{s.id}</span>
|
|
24
|
+
</div>
|
|
25
|
+
{s.goal ? <p className="pl-4 text-sm text-gray-700">{s.goal}</p> : null}
|
|
26
|
+
{s.repo ? <p className="pl-4 text-xs text-gray-400">{s.repo}{s.branch ? `@${s.branch}` : ''} · {s.machine}</p> : null}
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const Card = ({ title, children, testId, tone = 'border-gray-200 bg-white' }: { title: string; children: React.ReactNode; testId?: string; tone?: string }) => (
|
|
32
|
+
<section className={`rounded-xl border p-4 ${tone}`} data-testid={testId}>
|
|
33
|
+
<h2 className="mb-1 text-sm font-semibold uppercase tracking-wide text-gray-500">{title}</h2>
|
|
34
|
+
{children}
|
|
35
|
+
</section>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
function FleetBody({ view }: { view: FleetView }) {
|
|
39
|
+
return (
|
|
40
|
+
<div className="space-y-4">
|
|
41
|
+
<Card title={`Waiting on you (${view.waitingOnQuinn.length})`} testId="fleet-waiting-quinn" tone="border-amber-300 bg-amber-50">
|
|
42
|
+
{view.waitingOnQuinn.length ? <ul className="list-disc space-y-1 pl-5 text-sm text-gray-900">{view.waitingOnQuinn.map((t) => <li key={t}>{t}</li>)}</ul> : <p className="text-sm text-gray-600">Nothing is waiting on you.</p>}
|
|
43
|
+
{view.loopsUpdated ? <p className="mt-2 text-xs text-gray-500">Ledger updated {view.loopsUpdated}</p> : null}
|
|
44
|
+
</Card>
|
|
45
|
+
{view.relay ? <Card title="Relay" testId="fleet-relay"><SessionRow s={view.relay} /></Card> : null}
|
|
46
|
+
{view.leads.map((l) => (
|
|
47
|
+
<Card key={l.role} title={l.role} testId={`fleet-lead-${l.role}`}>
|
|
48
|
+
{l.session ? <SessionRow s={l.session} /> : <p className="py-2 text-sm text-gray-500">No live session{l.listedId ? ` (notes list ${l.listedId}, which is not on the bridge)` : ''}.</p>}
|
|
49
|
+
{l.session && l.listedId ? <p className="text-xs text-amber-700">Notes list {l.listedId}; this live session matches the role by name.</p> : null}
|
|
50
|
+
{l.notes ? <p className="pb-2 text-xs text-gray-500">{l.notes}</p> : null}
|
|
51
|
+
{l.children.length ? <div className="ml-3 divide-y divide-gray-100 border-l border-gray-200 pl-3">{l.children.map((c) => <SessionRow key={c.id} s={c} />)}</div> : null}
|
|
52
|
+
</Card>
|
|
53
|
+
))}
|
|
54
|
+
{view.waitingOnSessions.length ? (
|
|
55
|
+
<Card title="Relay is waiting on sessions" testId="fleet-waiting-sessions">
|
|
56
|
+
<ul className="list-disc space-y-1 pl-5 text-sm text-gray-800">{view.waitingOnSessions.map((t) => <li key={t}>{t}</li>)}</ul>
|
|
57
|
+
</Card>
|
|
58
|
+
) : null}
|
|
59
|
+
{view.sections?.length ? (
|
|
60
|
+
<Card title="Relay's notes" testId="fleet-sections">
|
|
61
|
+
<div className="space-y-2">
|
|
62
|
+
{view.sections.map((sec) => (
|
|
63
|
+
<details key={sec.title} className="rounded-md border border-gray-100 px-3 py-2">
|
|
64
|
+
<summary className="cursor-pointer text-sm font-medium text-gray-800">{sec.title} <span className="text-xs text-gray-400">({sec.items.length})</span></summary>
|
|
65
|
+
<ul className="mt-2 list-disc space-y-1 pl-5 text-sm text-gray-700">{sec.items.map((t, i) => <li key={i}>{t}</li>)}</ul>
|
|
66
|
+
</details>
|
|
67
|
+
))}
|
|
68
|
+
</div>
|
|
69
|
+
</Card>
|
|
70
|
+
) : null}
|
|
71
|
+
{view.ports?.length ? (
|
|
72
|
+
<Card title="Local stacks" testId="fleet-ports">
|
|
73
|
+
<ul className="divide-y divide-gray-100 text-sm">
|
|
74
|
+
{view.ports.map((p) => (
|
|
75
|
+
<li key={p.project} className="flex flex-wrap items-baseline gap-x-2 py-1.5">
|
|
76
|
+
<span className="font-medium text-gray-900">{p.project}</span>
|
|
77
|
+
{p.url ? <a className="text-indigo-600 underline" href={p.url} target="_blank" rel="noreferrer">{p.url}</a> : <span className="text-gray-500">{p.base}</span>}
|
|
78
|
+
<span className="text-xs text-gray-400">{p.range}{p.notes ? ` · ${p.notes}` : ''}</span>
|
|
79
|
+
</li>
|
|
80
|
+
))}
|
|
81
|
+
</ul>
|
|
82
|
+
</Card>
|
|
83
|
+
) : null}
|
|
84
|
+
{view.unparsed?.length ? (
|
|
85
|
+
<Card title="Other lines in the notes" testId="fleet-unparsed">
|
|
86
|
+
<ul className="space-y-1 text-xs text-gray-600">{view.unparsed.map((t, i) => <li key={i} className="whitespace-pre-wrap">{t}</li>)}</ul>
|
|
87
|
+
</Card>
|
|
88
|
+
) : null}
|
|
89
|
+
{view.others.length ? <Card title={`Other sessions (${view.others.length})`} testId="fleet-others"><div className="divide-y divide-gray-100">{view.others.map((s) => <SessionRow key={s.id} s={s} />)}</div></Card> : null}
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function FleetPage({ load, refreshMs = 30000 }: FleetPageProps) {
|
|
95
|
+
const [data, setData] = React.useState<FleetPayload | undefined>();
|
|
96
|
+
const [error, setError] = React.useState<string | null>(null);
|
|
97
|
+
const [, tick] = React.useState(0);
|
|
98
|
+
const run = React.useCallback(() => { load().then((d) => { setData(d); setError(null); }).catch((e) => setError(e instanceof Error ? e.message : 'Could not load.')); }, [load]);
|
|
99
|
+
React.useEffect(() => { run(); const t = setInterval(() => { run(); tick((n) => n + 1); }, refreshMs); return () => clearInterval(t); }, [run, refreshMs]);
|
|
100
|
+
const snap = data?.snapshot;
|
|
101
|
+
const stale = snap ? Date.now() - Date.parse(snap.updatedAt) > FLEET_FRESH_MS : false;
|
|
102
|
+
return (
|
|
103
|
+
<div className="space-y-4">
|
|
104
|
+
{error ? <LoadError what="the fleet" message={error} onRetry={run} /> : null}
|
|
105
|
+
{data && !snap ? <div className="rounded-xl border border-gray-200 bg-white p-6 text-center" data-testid="fleet-empty"><p className="font-medium text-gray-900">The relay has not posted a fleet snapshot yet.</p></div> : null}
|
|
106
|
+
{snap ? (
|
|
107
|
+
<p className="text-sm text-gray-600" data-testid="fleet-age" data-stale={stale ? 'true' : 'false'}>
|
|
108
|
+
Snapshot from {ageWords(snap.updatedAt, Date.now()) || 'an unknown time'}{stale ? ' — older than 10 minutes, so this is where things stood, not now.' : '.'}
|
|
109
|
+
</p>
|
|
110
|
+
) : null}
|
|
111
|
+
{snap?.view ? <FleetBody view={snap.view} /> : null}
|
|
112
|
+
{snap && !snap.view ? <pre className="whitespace-pre-wrap rounded-xl border border-gray-200 bg-white p-4 text-sm text-gray-800" data-testid="fleet-text">{snap.text}</pre> : null}
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -182,6 +182,19 @@ export function LibraryPage({
|
|
|
182
182
|
const [count, setCount] = React.useState(0);
|
|
183
183
|
const [applied, setApplied] = React.useState<string[] | undefined>(undefined);
|
|
184
184
|
const [sources, setSources] = React.useState<SourceFreshness[]>([]);
|
|
185
|
+
/** Per-source totals, held apart from the cards so a late count patches a card, never replaces it. */
|
|
186
|
+
const [sourceCounts, setSourceCounts] = React.useState<Map<string, number | null>>(new Map());
|
|
187
|
+
/** True once the first list read has settled; the reads that are not the rows wait for it. */
|
|
188
|
+
const [firstPaint, setFirstPaint] = React.useState(false);
|
|
189
|
+
const defer = typeof api.participantsFor === 'function';
|
|
190
|
+
const shownSources = React.useMemo(
|
|
191
|
+
() => (sourceCounts.size === 0
|
|
192
|
+
? sources
|
|
193
|
+
: sources.map((source) => (sourceCounts.has(source.source)
|
|
194
|
+
? { ...source, documentCount: sourceCounts.get(source.source) ?? null }
|
|
195
|
+
: source))),
|
|
196
|
+
[sources, sourceCounts],
|
|
197
|
+
);
|
|
185
198
|
const [parties, setParties] = React.useState<Party[]>([]);
|
|
186
199
|
const [selectedId, setSelectedId] = React.useState<string | null>(initialDocumentId ?? null);
|
|
187
200
|
const [selected, setSelected] = React.useState<SourceDocument | null>(null);
|
|
@@ -202,25 +215,6 @@ export function LibraryPage({
|
|
|
202
215
|
*/
|
|
203
216
|
const [droppedOutOfScope, setDroppedOutOfScope] = React.useState(0);
|
|
204
217
|
|
|
205
|
-
// The reference-only surfaces (which sources exist, which parties exist) load
|
|
206
|
-
// once. They are what makes the filter controls DATA rather than a hardcoded
|
|
207
|
-
// vendor list — add a connector and its option appears with no code change.
|
|
208
|
-
React.useEffect(() => {
|
|
209
|
-
let live = true;
|
|
210
|
-
void (async () => {
|
|
211
|
-
const [freshness, partyPage] = await Promise.all([
|
|
212
|
-
api.listSources().catch(() => [] as SourceFreshness[]),
|
|
213
|
-
api.listParties({ page: 1, pageSize: 100 }).catch(() => ({
|
|
214
|
-
count: 0, next: null, previous: null, results: [] as Party[],
|
|
215
|
-
})),
|
|
216
|
-
]);
|
|
217
|
-
if (!live) return;
|
|
218
|
-
setSources(freshness);
|
|
219
|
-
setParties(partyPage.results ?? []);
|
|
220
|
-
})();
|
|
221
|
-
return () => { live = false; };
|
|
222
|
-
}, [api]);
|
|
223
|
-
|
|
224
218
|
/**
|
|
225
219
|
* The list query: the filter bar PLUS the open folder, bounded the way the
|
|
226
220
|
* reader asked for it — see `includeSubfolders` for why the default is the
|
|
@@ -239,7 +233,11 @@ export function LibraryPage({
|
|
|
239
233
|
setLoading(true);
|
|
240
234
|
void (async () => {
|
|
241
235
|
try {
|
|
242
|
-
|
|
236
|
+
// ROWS FIRST. With an adapter that can fetch participants separately the
|
|
237
|
+
// list waits for ONE read — the documents page — and the people on each
|
|
238
|
+
// row are patched in below. Behind a slow or single-file backend the
|
|
239
|
+
// edge read and the six-page roster walk were the page (2026-11-20).
|
|
240
|
+
const page = await api.listDocuments(query, defer ? { participants: false } : undefined);
|
|
243
241
|
if (!live) return;
|
|
244
242
|
// THE GUARD RUNS ON THE LIST, not only on the detail panel. A row from
|
|
245
243
|
// another workspace is a leak the moment it is drawn — its title and its
|
|
@@ -252,15 +250,55 @@ export function LibraryPage({
|
|
|
252
250
|
setCount(Math.max(0, (page.count ?? 0) - dropped.length));
|
|
253
251
|
setApplied(page.appliedFilters);
|
|
254
252
|
setLoadError('');
|
|
253
|
+
if (defer && api.participantsFor && kept.length) {
|
|
254
|
+
void api.participantsFor(kept.map((document) => document.id)).then((people) => {
|
|
255
|
+
if (!live) return;
|
|
256
|
+
setDocuments((current) => current.map((document) => {
|
|
257
|
+
const found = people.get(String(document.id));
|
|
258
|
+
return found ? { ...document, participants: found } : document;
|
|
259
|
+
}));
|
|
260
|
+
}).catch(() => { /* the rows stand without their people, as before */ });
|
|
261
|
+
}
|
|
255
262
|
} catch (err) {
|
|
256
263
|
if (live) setLoadError(readFailureMessage(err));
|
|
257
264
|
} finally {
|
|
258
|
-
if (live) setLoading(false);
|
|
265
|
+
if (live) { setLoading(false); setFirstPaint(true); }
|
|
259
266
|
}
|
|
260
267
|
})();
|
|
261
268
|
return () => { live = false; };
|
|
262
269
|
}, [api, query, scope, attempt]);
|
|
263
270
|
|
|
271
|
+
// The reference-only surfaces (which sources exist, which parties exist) load
|
|
272
|
+
// once. They are what makes the filter controls DATA rather than a hardcoded
|
|
273
|
+
// vendor list — add a connector and its option appears with no code change.
|
|
274
|
+
//
|
|
275
|
+
// IN QUEUE ORDER, because the queue is the bottleneck: the documents effect
|
|
276
|
+
// above asked first, the source CARDS ask next (they are above the fold), and
|
|
277
|
+
// everything that is not on the first screen — the per-source counts, the
|
|
278
|
+
// party filter, the people on each row — waits its turn behind the rows.
|
|
279
|
+
React.useEffect(() => {
|
|
280
|
+
let live = true;
|
|
281
|
+
void (async () => {
|
|
282
|
+
const freshness = await api
|
|
283
|
+
.listSources({ onCounts: (counts) => { if (live) setSourceCounts(counts); } })
|
|
284
|
+
.catch(() => [] as SourceFreshness[]);
|
|
285
|
+
if (live) setSources(freshness);
|
|
286
|
+
})();
|
|
287
|
+
return () => { live = false; };
|
|
288
|
+
}, [api]);
|
|
289
|
+
|
|
290
|
+
React.useEffect(() => {
|
|
291
|
+
if (!firstPaint) return undefined;
|
|
292
|
+
let live = true;
|
|
293
|
+
void (async () => {
|
|
294
|
+
const partyPage = await api.listParties({ page: 1, pageSize: 100 }).catch(() => ({
|
|
295
|
+
count: 0, next: null, previous: null, results: [] as Party[],
|
|
296
|
+
}));
|
|
297
|
+
if (live) setParties(partyPage.results ?? []);
|
|
298
|
+
})();
|
|
299
|
+
return () => { live = false; };
|
|
300
|
+
}, [api, firstPaint]);
|
|
301
|
+
|
|
264
302
|
React.useEffect(() => {
|
|
265
303
|
if (!selectedId) { setSelected(null); setSelectError(''); return; }
|
|
266
304
|
let live = true;
|
|
@@ -353,7 +391,7 @@ export function LibraryPage({
|
|
|
353
391
|
|
|
354
392
|
return (
|
|
355
393
|
<div className={cn.root}>
|
|
356
|
-
<FreshnessStrip sources={
|
|
394
|
+
<FreshnessStrip sources={shownSources} classNames={cn} now={now} />
|
|
357
395
|
|
|
358
396
|
<section className={cn.section}>
|
|
359
397
|
<form
|
|
@@ -386,7 +424,7 @@ export function LibraryPage({
|
|
|
386
424
|
>
|
|
387
425
|
<option value="">All sources</option>
|
|
388
426
|
{/* Options are DATA. A fourth connector appears here by existing. */}
|
|
389
|
-
{
|
|
427
|
+
{shownSources.map((source) => (
|
|
390
428
|
<option key={source.source} value={source.source}>{source.label}</option>
|
|
391
429
|
))}
|
|
392
430
|
</select>
|
|
@@ -487,6 +525,7 @@ export function LibraryPage({
|
|
|
487
525
|
onSelect={openFolder}
|
|
488
526
|
classNames={folderClassNames}
|
|
489
527
|
onUnavailable={() => setNoTree(true)}
|
|
528
|
+
hold={!firstPaint}
|
|
490
529
|
/>
|
|
491
530
|
</aside>
|
|
492
531
|
)}
|
|
@@ -575,7 +614,7 @@ export function LibraryPage({
|
|
|
575
614
|
filters.search || filters.source || filters.partyId
|
|
576
615
|
|| filters.occurredAfter || filters.occurredBefore || folder,
|
|
577
616
|
)}
|
|
578
|
-
sources={
|
|
617
|
+
sources={shownSources}
|
|
579
618
|
classNames={cn}
|
|
580
619
|
/>
|
|
581
620
|
)
|
|
@@ -22,11 +22,12 @@ import { OwnerPicker } from './task-tracker/OwnerPicker';
|
|
|
22
22
|
import type { RosterMember } from '../../corpus/owner-link';
|
|
23
23
|
import { ExternalLinkChip } from './task-tracker/ExternalLinkChip';
|
|
24
24
|
import { failureMessage } from './work-items';
|
|
25
|
+
import { ProjectGuess } from './task-tracker/ProjectGuess';
|
|
25
26
|
import { PossiblyDoneNote, markDonePatch, notDonePatch } from './tracker/PossiblyDone';
|
|
26
27
|
import type { MemberConnectionsApi } from './types';
|
|
27
28
|
|
|
28
29
|
export interface TaskDetailPageProps {
|
|
29
|
-
api: Pick<CommitmentApi, 'listCommitments' | 'updateCommitment'> & {
|
|
30
|
+
api: Pick<CommitmentApi, 'listCommitments' | 'updateCommitment'> & Partial<Pick<CommitmentApi, 'fileCommitment'>> & {
|
|
30
31
|
/** The workspace roster; absent means the owner stays text, as before. */
|
|
31
32
|
listMembers?: () => Promise<RosterMember[]>;
|
|
32
33
|
};
|
|
@@ -146,6 +147,26 @@ export function TaskDetailPage({
|
|
|
146
147
|
}
|
|
147
148
|
};
|
|
148
149
|
|
|
150
|
+
const confirmProject = async () => {
|
|
151
|
+
await patchItem({ projectBasis: null });
|
|
152
|
+
setItem((cur) => { if (!cur) return cur; const { projectBasis: _was, ...rest } = cur; return rest as Commitment; });
|
|
153
|
+
};
|
|
154
|
+
const changeProject = async (focusId: string) => {
|
|
155
|
+
if (!item || !apiRef.current.fileCommitment) return;
|
|
156
|
+
setBusy(true);
|
|
157
|
+
setError('');
|
|
158
|
+
try {
|
|
159
|
+
await apiRef.current.fileCommitment(item, focusId);
|
|
160
|
+
await apiRef.current.updateCommitment?.(item, { projectBasis: null });
|
|
161
|
+
const { projectBasis: _was, ...rest } = item;
|
|
162
|
+
setItem({ ...rest, focusId } as Commitment);
|
|
163
|
+
} catch (err) {
|
|
164
|
+
setError(failureMessage(err));
|
|
165
|
+
} finally {
|
|
166
|
+
setBusy(false);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
149
170
|
const setStatus = async (status: CommitmentStatus) => {
|
|
150
171
|
if (!item || !apiRef.current.updateCommitment) return;
|
|
151
172
|
setBusy(true);
|
|
@@ -227,6 +248,11 @@ export function TaskDetailPage({
|
|
|
227
248
|
{project ? <span className={cn.badge}>{project}</span> : null}
|
|
228
249
|
{item.sync ? <ExternalLinkChip sync={item.sync} trackerName={trackerName} className={cn.badge} /> : null}
|
|
229
250
|
</div>
|
|
251
|
+
{item.projectBasis && project && !editing ? (
|
|
252
|
+
<ProjectGuess basis={item.projectBasis} projectId={item.focusId} projects={projectNames}
|
|
253
|
+
onConfirm={confirmProject} onChange={apiRef.current.fileCommitment ? changeProject : undefined}
|
|
254
|
+
disabled={busy || !canWrite} mutedClassName={cn.muted} buttonClassName={cn.secondaryButton} />
|
|
255
|
+
) : null}
|
|
230
256
|
{editing ? (
|
|
231
257
|
<form className="mt-3 space-y-3" onSubmit={(e) => { e.preventDefault(); void save(); }}>
|
|
232
258
|
<label className="block text-sm">Title
|