paseo-follow-up 2.4.0-beta.4 → 2.4.0-beta.6
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/client/brief.tsx +35 -14
- package/client/catch-up.tsx +21 -7
- package/client/compass-settings.tsx +323 -0
- package/client/header.tsx +6 -1
- package/client/home-chrome.tsx +26 -2
- package/client/home-data.ts +2 -1
- package/client/home-list.tsx +6 -4
- package/client/home-view.ts +9 -3
- package/client/home.tsx +48 -14
- package/client/image-attach.tsx +276 -0
- package/client/more-context.tsx +18 -11
- package/client/morning-brief-settings.tsx +2 -0
- package/client/needs-you.tsx +10 -4
- package/client/new.tsx +34 -16
- package/client/panel.tsx +1 -1
- package/client/pending-answers.ts +25 -5
- package/client/pr-stats-settings.tsx +35 -10
- package/client/questions.tsx +15 -10
- package/client/row-actions.ts +0 -1
- package/client/unsent-images.ts +26 -0
- package/client/why-it-matters.tsx +194 -0
- package/index.server.ts +120 -18
- package/package.json +3 -1
- package/server/agent-actions.ts +34 -12
- package/server/agent-hook.mjs +1 -1
- package/server/agent-parity.ts +29 -6
- package/server/compass.ts +376 -0
- package/server/daemon.ts +6 -2
- package/server/dispatch.ts +45 -12
- package/server/engine.ts +83 -13
- package/server/hook-source.ts +1 -1
- package/server/image-store.ts +100 -0
- package/server/image-support.ts +37 -0
- package/server/inbox.ts +10 -4
- package/server/mcp-source.ts +20 -11
- package/server/mcp.mjs +20 -11
- package/server/message-queue.ts +26 -5
- package/server/overseer-prompt-source.ts +1 -1
- package/server/overseer-prompt.md +1 -1
- package/server/overseer.ts +71 -23
- package/server/pr-stats-gate.ts +48 -10
- package/server/pr-stats-sync.ts +7 -7
- package/server/pr-stats.ts +17 -12
- package/server/ranker.ts +5 -1
- package/server/report-issue-adapter.ts +1 -1
- package/server/tasks.ts +17 -4
- package/shared/activity.ts +25 -0
- package/shared/agent-load.ts +6 -1
- package/shared/attention.ts +22 -6
- package/shared/brief-sources.ts +3 -0
- package/shared/chat.ts +1 -1
- package/shared/compass.ts +776 -0
- package/shared/contracts.ts +26 -5
- package/shared/dispatch.ts +40 -10
- package/shared/headline.ts +3 -0
- package/shared/home.ts +13 -3
- package/shared/images.ts +95 -0
- package/shared/inbox.ts +29 -1
- package/shared/model.ts +27 -2
- package/shared/morning-brief.ts +4 -1
- package/shared/overseer.ts +151 -11
- package/shared/pr-stats-settings.ts +27 -0
- package/shared/priorities.ts +2 -2
- package/shared/queue.ts +3 -0
- package/shared/ranker.ts +7 -3
- package/shared/row-menu.ts +1 -5
- package/shared/send-decision.ts +82 -4
- package/shared/status-invariants.ts +47 -2
- package/shared/status.ts +1 -1
- package/shared/task-rows.ts +5 -3
package/client/brief.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo, useState, useSyncExternalStore } from "react";
|
|
1
|
+
import { useMemo, useState, useSyncExternalStore, type ReactNode } from "react";
|
|
2
2
|
import { browserKey, liveBriefKey, LIVE_BRIEF_POLL_MS, workspaceKey } from "./keys";
|
|
3
3
|
import { Platform, View, useWindowDimensions } from "react-native";
|
|
4
4
|
import { Pressable, Text } from "./text";
|
|
@@ -8,12 +8,13 @@ import { deliveryStatus } from "../shared/queue";
|
|
|
8
8
|
import { Icon, TextInput, copyText, useToast } from "@getpaseo/plugin/client/ui";
|
|
9
9
|
import { BRIEF_KIND, briefCardAsk, BRIEF_VERSION, askedDecisions, cardPicks, notedCount, pickedCount, briefSchema, collapsedLine, outcomeLabel, extrasFit, hasOriginal, nothingNeededLine, isTight, pastRows, pastTone, selectsFirst, sendBar, shownBrief, pastAsk, liveBrief, newAnswerId, type Brief, type BriefDecision, type BriefMove } from "../shared/brief";
|
|
10
10
|
import { needsYou } from "../shared/attention";
|
|
11
|
-
import { age } from "../shared/inbox";
|
|
11
|
+
import { age, briefOutlived } from "../shared/inbox";
|
|
12
12
|
import { noReviewReposVersion, onNoReviewRepos } from "../shared/pr-workflow";
|
|
13
13
|
import { briefKey, HEADLINE_WORD } from "../shared/headline";
|
|
14
14
|
/** The card's kind word comes from the same table as the pill and the Needs-you row. */
|
|
15
15
|
const word = (kind: Brief["kind"]) => HEADLINE_WORD[briefKey(kind)];
|
|
16
16
|
import { answerQuestionRpc, briefActionRpc, browserStatusRpc, inboxBriefRpc } from "../shared/contracts";
|
|
17
|
+
import { ImageField, useImageAttachments, type ImageAttachments } from "./image-attach";
|
|
17
18
|
import { errorText, mootNote } from "../shared/errors";
|
|
18
19
|
import { PRIMARY_FORM } from "./dock";
|
|
19
20
|
import { OTHER, OTHER_LABEL, OWN_ANSWER_HINT, briefAnswerStatus, isDoneOnly, isOpen, isOther, TASK_DONE, type Question } from "../shared/questions";
|
|
@@ -40,7 +41,7 @@ export type BriefDeps = {
|
|
|
40
41
|
/** The workspace's list form (shared/list.ts); the PR sheet reads the full one itself. */
|
|
41
42
|
workspace(id: string): ListWorkspace | undefined;
|
|
42
43
|
/** The agent's Needs-you inbox row, so a card knows whether its brief is an ask (briefAsks). */
|
|
43
|
-
row?(agentId: string): { needs?: unknown } | null;
|
|
44
|
+
row?(agentId: string): { needs?: unknown; status?: string; turnStartedAt?: string | null } | null;
|
|
44
45
|
/** Opens Follow-up's panel for a workspace whose record this client hasn't loaded yet. */
|
|
45
46
|
openPanel(workspaceId: string): void;
|
|
46
47
|
/** Done's Undo window, so the composer pill says Done (and its Undo cancels the same toast) until it ends. */
|
|
@@ -145,6 +146,11 @@ function OptionRow({ option, recommended, sending, disabled, tight, open, onTogg
|
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
/** "Add note" / "Remove note": a quiet text link (muted, 13px), 44 tall on phones. QuestionBody uses it too. */
|
|
149
|
+
/** The brief's answer or note field with the card's pasted images (client/image-attach.tsx); a read-only copy has none. */
|
|
150
|
+
/** `row`: whether this field draws the card's thumbnails. One set per card, so only its last open field does. */
|
|
151
|
+
function WithImages({ img, c, compact, row, children }: { img?: ImageAttachments; c: Colors; compact: boolean; row: boolean; children: ReactNode }) {
|
|
152
|
+
return img ? <ImageField model={img} theme={{ colors: c }} compact={compact} row={row}>{children}</ImageField> : <>{children}</>;
|
|
153
|
+
}
|
|
148
154
|
export function NoteLink({ icon, label, a11y, disabled, onPress, c, compact }: { icon: string; label: string; a11y: string; disabled: boolean; onPress: () => void; c: Colors; compact: boolean }) {
|
|
149
155
|
return <Pressable accessibilityRole="button" accessibilityLabel={a11y} accessibilityState={{ disabled }} disabled={disabled} onPress={onPress} hitSlop={6}
|
|
150
156
|
style={({ hovered, pressed, focused }: { hovered?: boolean; pressed: boolean; focused?: boolean }) => ({ ...ring(focused, c), flexDirection: "row", alignItems: "center", gap: 6, alignSelf: "flex-start", minHeight: compact ? 44 : 28, paddingHorizontal: 4, marginLeft: -4, borderRadius: 6, opacity: disabled ? 0.5 : pressed ? 0.7 : 1, backgroundColor: hovered && !disabled ? withAlpha(c.foreground, 0.05) : "transparent" })}>
|
|
@@ -157,7 +163,9 @@ export function NoteLink({ icon, label, a11y, disabled, onPress, c, compact }: {
|
|
|
157
163
|
* The card's body: decisions, error text, details, context, facts and links, and the agent's extra ask. Shared by the
|
|
158
164
|
* open card and by a past card's read-only "Show full question", so a past question reads exactly as it was asked.
|
|
159
165
|
*/
|
|
160
|
-
function BriefBody({ b, c, compact, tight, embedded, height, mode, picks, onPick, busy, onSend, words = {}, onWords, onSendOther, notes = {}, notesOpen = {}, onNote, onNoteOpen, doneIds = [] }: {
|
|
166
|
+
export function BriefBody({ b, c, compact, tight, embedded, height, mode, picks, onPick, busy, onSend, words = {}, onWords, onSendOther, notes = {}, notesOpen = {}, onNote, onNoteOpen, doneIds = [], img }: {
|
|
167
|
+
/** The card's pasted images (one model for its answer and note fields). Absent: read-only copies. */
|
|
168
|
+
img?: ImageAttachments;
|
|
161
169
|
/** one-done-button: decisions answered by the card's Done button (an action card), drawn without option rows. */
|
|
162
170
|
doneIds?: readonly string[];
|
|
163
171
|
b: Brief; c: Colors; compact: boolean; tight: boolean; embedded: boolean; height: number;
|
|
@@ -179,6 +187,9 @@ function BriefBody({ b, c, compact, tight, embedded, height, mode, picks, onPick
|
|
|
179
187
|
const extra = !!b.context || b.facts.length > 0 || b.links.length > 0;
|
|
180
188
|
const showExtra = readonly || !tight || details || extrasFit(b, height);
|
|
181
189
|
const numbered = b.decisions.length > 1;
|
|
190
|
+
// The card has one image set (its answer and note fields share it), so its thumbnails are drawn once: under the
|
|
191
|
+
// last decision whose answer or note field is open. Several open fields each drew them before.
|
|
192
|
+
const rowAt = readonly ? null : [...b.decisions].reverse().find(d => isOther(picks[d.id]) || !!notesOpen[d.id])?.id ?? null;
|
|
182
193
|
return <>
|
|
183
194
|
{b.decisions.map((d, i) => { const done = !readonly && doneIds.includes(d.id); return <View key={d.id} accessibilityRole={mode === "select" ? "radiogroup" : undefined} accessibilityLabel={mode === "select" ? d.question : undefined} style={{ gap: 8 }}>
|
|
184
195
|
{(numbered || d.question.trim() !== b.ask.trim()) && <RichText style={{ color: c.foreground, fontSize: 14, lineHeight: 20, fontWeight: numbered ? "600" : "400" }}>{`${numbered ? `${i + 1}. ` : ""}${d.question}`}</RichText>}
|
|
@@ -193,20 +204,20 @@ function BriefBody({ b, c, compact, tight, embedded, height, mode, picks, onPick
|
|
|
193
204
|
onPress={() => onPick(d.id, OTHER)} c={c} compact={compact} />}
|
|
194
205
|
{/* Something else's field with its Send answer, kept on screen together while typing (DockedPane). */}
|
|
195
206
|
{!readonly && isOther(picks[d.id]) && <View {...PRIMARY_FORM} style={{ gap: 8 }}>
|
|
196
|
-
<TextInput accessibilityLabel={`Your answer${numbered ? ` to question ${i + 1}` : ""}, required`} placeholder="Your answer (required)" placeholderTextColor={c.foregroundMuted} autoFocus multiline maxLength={2000}
|
|
207
|
+
<WithImages img={img} c={c} compact={compact} row={rowAt === d.id}><TextInput accessibilityLabel={`Your answer${numbered ? ` to question ${i + 1}` : ""}, required`} placeholder="Your answer (required)" placeholderTextColor={c.foregroundMuted} autoFocus multiline maxLength={2000}
|
|
197
208
|
value={words[d.id] ?? ""} editable={!busy} onChangeText={t => onWords?.(d.id, t)}
|
|
198
|
-
style={{ minHeight: compact ? 66 : 58, paddingHorizontal: 10, paddingVertical: 8, borderRadius: 8, borderWidth: 1, borderColor: words[d.id]?.trim() ? c.border : withAlpha(c.accent, 0.7), color: c.foreground, backgroundColor: c.surface0, fontSize: 14, lineHeight: 20, textAlignVertical: "top" }}
|
|
209
|
+
style={{ minHeight: compact ? 66 : 58, paddingHorizontal: 10, paddingVertical: 8, borderRadius: 8, borderWidth: 1, borderColor: words[d.id]?.trim() ? c.border : withAlpha(c.accent, 0.7), color: c.foreground, backgroundColor: c.surface0, fontSize: 14, lineHeight: 20, textAlignVertical: "top" }} /></WithImages>
|
|
199
210
|
{mode === "send" && <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 10 }}>
|
|
200
|
-
<Btn shortcut label={busy === `${d.id}:${OTHER}` ? "Sending…" : "Send answer"} icon="Send" primary disabled={!words[d.id]?.trim() || !!busy} onPress={() => onSendOther?.(d.id)} c={c} compact={compact} />
|
|
211
|
+
<Btn shortcut label={busy === `${d.id}:${OTHER}` ? "Sending…" : "Send answer"} icon="Send" primary disabled={!words[d.id]?.trim() || !!busy || !!img?.blocked} onPress={() => onSendOther?.(d.id)} c={c} compact={compact} />
|
|
201
212
|
{!words[d.id]?.trim() && <Text style={{ flexShrink: 1, color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>{OWN_ANSWER_HINT}</Text>}
|
|
202
213
|
</View>}
|
|
203
214
|
</View>}
|
|
204
215
|
{/* A note on a lettered pick ("A, but…"): quiet until asked for, never in the way of the one-tap answer. */}
|
|
205
216
|
{!readonly && !isOther(picks[d.id]) && (notesOpen[d.id] ? <View {...PRIMARY_FORM} style={{ gap: 6, marginTop: 2 }}>
|
|
206
217
|
<Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16, fontWeight: "600" }}>Note</Text>
|
|
207
|
-
<TextInput accessibilityLabel={`Note for the agent${numbered ? ` on decision ${i + 1}` : ""}, optional`} placeholder={mode === "select" ? "Sent with your pick for this decision" : "Sent with the option you tap"}
|
|
218
|
+
<WithImages img={img} c={c} compact={compact} row={rowAt === d.id}><TextInput accessibilityLabel={`Note for the agent${numbered ? ` on decision ${i + 1}` : ""}, optional`} placeholder={mode === "select" ? "Sent with your pick for this decision" : "Sent with the option you tap"}
|
|
208
219
|
placeholderTextColor={c.foregroundMuted} autoFocus={focusNote === d.id} multiline maxLength={2000} value={notes[d.id] ?? ""} editable={!busy} onChangeText={t => onNote?.(d.id, t)}
|
|
209
|
-
style={{ minHeight: compact ? 66 : 58, paddingHorizontal: 10, paddingVertical: 8, borderRadius: 8, borderWidth: 1, borderColor: c.border, color: c.foreground, backgroundColor: c.surface0, fontSize: 14, lineHeight: 20, textAlignVertical: "top" }}
|
|
220
|
+
style={{ minHeight: compact ? 66 : 58, paddingHorizontal: 10, paddingVertical: 8, borderRadius: 8, borderWidth: 1, borderColor: c.border, color: c.foreground, backgroundColor: c.surface0, fontSize: 14, lineHeight: 20, textAlignVertical: "top" }} /></WithImages>
|
|
210
221
|
<NoteLink icon="X" label="Remove note" a11y={`Remove the note${numbered ? ` on decision ${i + 1}` : ""}`} disabled={!!busy} onPress={() => { onNote?.(d.id, ""); onNoteOpen?.(d.id, false); setFocusNote(null); }} c={c} compact={compact} />
|
|
211
222
|
</View> : done ? null : <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: 14 }}>
|
|
212
223
|
<NoteLink icon="MessageSquarePlus" label="Add note" a11y={numbered ? `Add note to decision ${i + 1}` : "Add note"} disabled={!!busy} onPress={() => { setFocusNote(d.id); onNoteOpen?.(d.id, true); }} c={c} compact={compact} />
|
|
@@ -374,7 +385,9 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
374
385
|
// The check itself failed (or there's no agent to ask): don't leave a dead card. The server still validates every
|
|
375
386
|
// action against the stored brief, and a moot refusal reconciles, so acting on the row is safe.
|
|
376
387
|
const unverifiable = live.isError || !agentId;
|
|
377
|
-
const
|
|
388
|
+
const verified = row.state !== "open" ? { brief: row, actionable: false } : unverifiable && checked.brief.state === "open" ? { ...checked, actionable: true } : checked;
|
|
389
|
+
// A running agent's newer turn outlived a finish that asked nothing: it reads as the turn before, not "Finished".
|
|
390
|
+
const shown = agentId && briefOutlived(verified.brief, deps.row?.(agentId)) ? { brief: { ...verified.brief, state: "superseded" as const }, actionable: false } : verified;
|
|
378
391
|
const b = shown.brief;
|
|
379
392
|
// One predicate decides whether the brief's own words draw (briefCardShown, inside briefCardAsk): beside what Needs you
|
|
380
393
|
// holds, a brief without an ask points at it instead (a-brief-without-an-ask-never-sits-beside-needs-you).
|
|
@@ -386,6 +399,9 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
386
399
|
const { height } = useWindowDimensions();
|
|
387
400
|
const act = useRpc(briefActionRpc);
|
|
388
401
|
const answerQuestion = useRpc(answerQuestionRpc);
|
|
402
|
+
// Pasted images on the answer or the note (every-agent-field-takes-images): they ride the answer to the brief's agent.
|
|
403
|
+
const img = useImageAttachments({ target: { kind: "agent", agentId } });
|
|
404
|
+
const withImages = () => { const images = img.uploads(); return images ? { images } : {}; };
|
|
389
405
|
const browserRead = useRpc(browserStatusRpc);
|
|
390
406
|
const [sending, setBusy] = useState<string | null>(null);
|
|
391
407
|
// Until the server confirms this brief is the open one, every control waits ("checking" matches no button's key).
|
|
@@ -450,7 +466,7 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
450
466
|
if (busy || marked) return;
|
|
451
467
|
setError(null); setSent(false); setMarked(new Date().toISOString());
|
|
452
468
|
const doneId = newAnswerId();
|
|
453
|
-
const id = runUndoable("Telling the agent it's done", { label: "Done", toast, run: async (): Promise<unknown> => doneQ && workspace ? answerQuestion({ workspaceId: workspace.id, questionId: doneQ.id, choice: TASK_DONE.letter, ...(notesOpen[doneQ.id] && notes[doneQ.id]?.trim() ? { words: notes[doneQ.id].trim() } : {}), action: "send" })
|
|
469
|
+
const id = runUndoable("Telling the agent it's done", { label: "Done", toast, run: async (): Promise<unknown> => doneQ && workspace ? answerQuestion({ workspaceId: workspace.id, questionId: doneQ.id, choice: TASK_DONE.letter, ...(notesOpen[doneQ.id] && notes[doneQ.id]?.trim() ? { words: notes[doneQ.id].trim() } : {}), ...withImages(), action: "send" })
|
|
454
470
|
: act({ agentId, briefId: b.id, move: "done", answerId: doneId }), success: "Marked done. The agent has it.",
|
|
455
471
|
failure: "Done not sent", open: () => deps.openAgent(agentId), onSuccess: () => setSent(true), onError: e => { setMarked(null); setError(errorText(e)); }, reconcile: e => { setMarked(null); reconcile(e); } }, () => setMarked(null), `done:${b.id}`, () => deps.endDone?.(agentId));
|
|
456
472
|
// The pill's Undo is this toast's Undo: it closes the toast (so nothing is sent) and reopens the card.
|
|
@@ -516,8 +532,13 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
516
532
|
type DecisionPick = { decisionId: string; choice: string; words?: string };
|
|
517
533
|
const asQuestions = (list: DecisionPick[]) => !!workspace && list.length > 0 && list.every(x => b.questionIds.includes(x.decisionId) && workspace.questions.some(q => q.id === x.decisionId && !q.answer && !q.closed));
|
|
518
534
|
const answer = async (list: DecisionPick[], answerId: string) => {
|
|
519
|
-
|
|
520
|
-
|
|
535
|
+
// The field already says why (before Send); a key or a bar's Send can't get past it either.
|
|
536
|
+
if (img.blocked) throw new Error(img.blocked);
|
|
537
|
+
const images = withImages();
|
|
538
|
+
if (!asQuestions(list)) { const out = await act({ agentId, briefId: b.id, answerId, ...(list.length === 1 ? list[0] : { choices: list }), ...images }); img.clear(); return out; }
|
|
539
|
+
// The images ride the first answer's message: one message to the agent carries them once.
|
|
540
|
+
for (const [i, x] of list.entries()) await answerQuestion({ workspaceId: workspace!.id, questionId: x.decisionId, choice: x.choice, ...(x.words ? { words: x.words } : {}), ...(i === 0 ? images : {}), action: "send" });
|
|
541
|
+
img.clear();
|
|
521
542
|
void cache.invalidateQueries({ queryKey: liveBriefKey(agentId) }); void cache.invalidateQueries({ queryKey: workspaceKey(workspace!.id) });
|
|
522
543
|
};
|
|
523
544
|
// A tap sends the letter, with the note when one is typed; a sent answer clears the card (clearCard).
|
|
@@ -559,7 +580,7 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
559
580
|
<BriefBody b={b} c={c} compact={compact} tight={tight} embedded={embedded} height={height} mode={multi ? "select" : "send"} picks={picks}
|
|
560
581
|
onPick={(decisionId, letter) => { if (!busy) pickStore.set(b.id, decisionId, letter); }} busy={busy} onSend={sendOne}
|
|
561
582
|
words={words} onWords={(decisionId, t) => wordStore.set(b.id, decisionId, t)} onSendOther={sendOther}
|
|
562
|
-
notes={notes} notesOpen={notesOpen} onNote={(decisionId, t) => noteStore.set(b.id, decisionId, t)} onNoteOpen={(decisionId, open) => noteOpenStore.set(b.id, decisionId, open ? "1" : "")} doneIds={doneQ ? [doneQ.id] : []} />
|
|
583
|
+
notes={notes} notesOpen={notesOpen} onNote={(decisionId, t) => noteStore.set(b.id, decisionId, t)} onNoteOpen={(decisionId, open) => noteOpenStore.set(b.id, decisionId, open ? "1" : "")} doneIds={doneQ ? [doneQ.id] : []} img={img} />
|
|
563
584
|
|
|
564
585
|
{multi && <SendBar b={b} picks={sendable} noted={notedCount(sendable, openNotes)} busy={busy} error={error} onSend={sendAll} c={c} compact={compact} />}
|
|
565
586
|
|
package/client/catch-up.tsx
CHANGED
|
@@ -7,6 +7,8 @@ import { Animated, PanResponder, Platform, View } from "react-native";
|
|
|
7
7
|
import { Pressable, Text } from "./text";
|
|
8
8
|
import { useRpc } from "@getpaseo/plugin/client";
|
|
9
9
|
import { Icon, ScrollView, TextInput } from "@getpaseo/plugin/client/ui";
|
|
10
|
+
import { ImageField, useImageAttachments } from "./image-attach";
|
|
11
|
+
import type { ImageUpload } from "../shared/images";
|
|
10
12
|
import { useQuery } from "@tanstack/react-query";
|
|
11
13
|
import { inboxBriefRpc } from "../shared/contracts";
|
|
12
14
|
import { needsYou } from "../shared/attention";
|
|
@@ -125,9 +127,9 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
|
|
|
125
127
|
const nextCard = cardOf(session.order[session.pos + 1]);
|
|
126
128
|
useWorkspace(live, nextCard?.s.workspaceId ?? "", { enabled: !!nextCard?.s.workspaceId });
|
|
127
129
|
|
|
128
|
-
const ask = async (words: string) => {
|
|
130
|
+
const ask = async (words: string, images?: ImageUpload[]) => {
|
|
129
131
|
if (!card) return;
|
|
130
|
-
const out = await extras.askContext({ workspaceId: card.s.workspaceId, agentId: card.s.agentId, cardKey: card.key, card: cardLabel(card, w).slice(0, 300), ask: words });
|
|
132
|
+
const out = await extras.askContext({ workspaceId: card.s.workspaceId, agentId: card.s.agentId, cardKey: card.key, card: cardLabel(card, w).slice(0, 300), ask: words, ...(images?.length ? { images } : {}) });
|
|
131
133
|
setMore(false);
|
|
132
134
|
// context-never-blocks-the-deck: the workstream waits, the deck moves on.
|
|
133
135
|
if (out.request.state === "asking") setSession(s => park(s, out.request.id, card.key));
|
|
@@ -351,7 +353,7 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
|
|
|
351
353
|
/** One card: who and what, the ask through its own surface's component, then the deck's moves pinned to the bottom. */
|
|
352
354
|
function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMore, request, waiting, onAsk, sameWorkspace, onDone, onSkip, onSkipWorkspace, wsLeft, onBack, onLater }: {
|
|
353
355
|
card: DeckCard; w: ListWorkspace | undefined; theme: Theme; compact: boolean; deps: CatchUpDeps; navigation: Nav; gone: boolean; more: boolean; setMore: (v: boolean | ((v: boolean) => boolean)) => void;
|
|
354
|
-
request: ContextRequest | null; waiting: boolean; onAsk: (words: string) => Promise<void>;
|
|
356
|
+
request: ContextRequest | null; waiting: boolean; onAsk: (words: string, images?: ImageUpload[]) => Promise<void>;
|
|
355
357
|
sameWorkspace: string[]; onDone: () => void; onSkip: () => void; onSkipWorkspace?: () => void; wsLeft: number; onBack?: () => void; onLater: () => void;
|
|
356
358
|
}) {
|
|
357
359
|
const c = theme.colors; const t = text(c, compact);
|
|
@@ -363,6 +365,7 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
|
|
|
363
365
|
const dismiss = useDismiss();
|
|
364
366
|
const openChat = () => { if (!navigation) return; if (s.agentId) navigation.openAgent({ agentId: s.agentId }); else if (s.workspaceId) navigation.openWorkspace({ workspaceId: s.workspaceId }); };
|
|
365
367
|
const word = cardWord(card);
|
|
368
|
+
const compassLine = s.compass ?? (s.priority?.source?.kind === "compass" ? s.priority.reason : null);
|
|
366
369
|
const color = card.item?.kind === "merge" ? mergedColor(c) : card.kind === "finished" ? c.foregroundMuted : c.statusWarning;
|
|
367
370
|
const q = card.kind === "question" ? ws?.questions.find(x => x.id === card.questionId) ?? null : null;
|
|
368
371
|
const nth = sameWorkspace.indexOf(card.key);
|
|
@@ -390,6 +393,11 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
|
|
|
390
393
|
</View>
|
|
391
394
|
{ws && <SummaryLine key={ws.id} workspace={ws} theme={theme} compact={compact} />}
|
|
392
395
|
{full && <ReferencesLine workspace={full} theme={theme} compact={compact} />}
|
|
396
|
+
{/* One muted line of pinned context (docs/compass.md): the note's own words, never a second reason. */}
|
|
397
|
+
{compassLine && <View style={{ flexDirection: "row", alignItems: "center", gap: 5, minWidth: 0 }}>
|
|
398
|
+
<Icon name="Compass" size={12} color={c.foregroundMuted} />
|
|
399
|
+
<Text numberOfLines={1} style={[t.meta, { flex: 1, minWidth: 0, color: c.foregroundMuted }]}>{`Compass · ${compassLine}`}</Text>
|
|
400
|
+
</View>}
|
|
393
401
|
</View>;
|
|
394
402
|
|
|
395
403
|
const goneBanner = gone && <View accessibilityRole="alert" style={{ flexDirection: "row", alignItems: "center", gap: 8, padding: 12, borderRadius: 10, backgroundColor: c.surface1, borderWidth: 1, borderColor: c.border }}>
|
|
@@ -425,7 +433,7 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
|
|
|
425
433
|
// a-move-bar-action-opens-in-view (MOVE_OPENS): More context and Later open where the eye is, a sheet above the
|
|
426
434
|
// phone's bar or a popover on their button on desktop, never appended below the card.
|
|
427
435
|
const closeMore = () => { setMore(false); if (!compact) focusSoon("catch-up-more"); };
|
|
428
|
-
const moreBlock = more && <MorePanel theme={theme} compact={compact} onClose={closeMore} onAsk={onAsk} />;
|
|
436
|
+
const moreBlock = more && <MorePanel theme={theme} compact={compact} onClose={closeMore} onAsk={onAsk} target={s.workspaceId ? { kind: "workspace", workspaceId: s.workspaceId } : s.agentId ? { kind: "agent", agentId: s.agentId } : null} />;
|
|
429
437
|
const later = (until: string) => { setLaterOpen(false); if (s.agentId) void deps.sources.inbox.snooze([s.agentId], until); onLater(); };
|
|
430
438
|
const laterBlock = laterOpen && <View {...({ dataSet: { catchUpLater: "1" } } as object)} accessibilityRole="menu" accessibilityLabel="Later" style={{ gap: 8 }}>
|
|
431
439
|
<Text style={[t.small, { fontWeight: "600" }]}>Back in your Needs you</Text>
|
|
@@ -572,9 +580,15 @@ function NoteRow({ theme, compact, agentId }: { theme: Theme; compact: boolean;
|
|
|
572
580
|
const c = theme.colors;
|
|
573
581
|
const agent = useAgentLive(agentId);
|
|
574
582
|
const [words, setWords] = useState("");
|
|
575
|
-
|
|
583
|
+
// Pasted images go with the words through Paseo's own send (every-agent-field-takes-images).
|
|
584
|
+
const img = useImageAttachments({ target: { kind: "agent", agentId } });
|
|
585
|
+
const send = () => {
|
|
586
|
+
const images = img.uploads()?.map(i => ({ data: i.data, mimeType: i.mimeType }));
|
|
587
|
+
void agent.handle?.send(words.trim(), images ? { images } : undefined); setWords(""); img.clear();
|
|
588
|
+
};
|
|
589
|
+
return <ImageField model={img} theme={theme} compact={compact}><View {...PRIMARY_FORM} style={{ flexDirection: "row", alignItems: "flex-end", gap: 8 }}>
|
|
576
590
|
<TextInput accessibilityLabel="Tell the agent something" placeholder="Tell the agent something" placeholderTextColor={c.foregroundMuted} value={words} onChangeText={setWords} multiline
|
|
577
591
|
style={{ flex: 1, minHeight: compact ? 44 : 36, paddingHorizontal: 10, paddingVertical: 8, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, backgroundColor: c.surface0 }} />
|
|
578
|
-
<IconButton theme={theme} compact={compact} icon="Send" label="Send to the agent" tooltip={!compact} disabled={!words.trim()} onPress={
|
|
579
|
-
</View>;
|
|
592
|
+
<IconButton theme={theme} compact={compact} icon="Send" label="Send to the agent" tooltip={!compact} disabled={!words.trim() || !!img.blocked} onPress={send} />
|
|
593
|
+
</View></ImageField>;
|
|
580
594
|
}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { ActivityIndicator, TextInput, View } from "react-native";
|
|
3
|
+
import { useRpc } from "@getpaseo/plugin/client";
|
|
4
|
+
import { Icon, SettingsSection, useToast } from "@getpaseo/plugin/client/ui";
|
|
5
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
+
import { Pressable, Text } from "./text";
|
|
7
|
+
import { Button, SubmitScope, Switch, errorText, text, type Theme } from "./kit";
|
|
8
|
+
import { RichText } from "./rich-text";
|
|
9
|
+
import { raised, tint } from "./theme";
|
|
10
|
+
import { compassFindRpc, compassRpc, readCompassRpc, setCompassRpc } from "../shared/contracts";
|
|
11
|
+
import {
|
|
12
|
+
COMPASS, ROLES, ROLE_INFO, type CompassChange, type CompassNote, type CompassSource, type GlossaryEntry, type Place, type Preset, type PresetView, type Role, type Who,
|
|
13
|
+
} from "../shared/compass";
|
|
14
|
+
|
|
15
|
+
export const compassKey = ["follow-up", "compass"];
|
|
16
|
+
|
|
17
|
+
type View_ = {
|
|
18
|
+
settings: { sources: CompassSource[]; instructions: string; glossary: GlossaryEntry[] };
|
|
19
|
+
readers: { conversation: boolean; history: boolean };
|
|
20
|
+
presets: PresetView[];
|
|
21
|
+
blocked: string | null;
|
|
22
|
+
places: Record<string, { status: string; readAt: string | null; at: string | null; error: string | null }>;
|
|
23
|
+
notes: CompassNote[];
|
|
24
|
+
workspaces: Record<string, string>;
|
|
25
|
+
unplaced: number;
|
|
26
|
+
lastRead: { at: string; trigger: string; ok: boolean; notes: number; error: string | null } | null;
|
|
27
|
+
today: { extractions: number; cap: number };
|
|
28
|
+
running: boolean;
|
|
29
|
+
};
|
|
30
|
+
type Found = { id: string; name: string; place: Place };
|
|
31
|
+
|
|
32
|
+
const clock = (iso: string) => new Date(iso).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
|
|
33
|
+
const placeName = (p: Place) => p.kind === "conversation" ? (p.sub === "dm" ? `DM with ${p.name}` : `#${p.name}`) : p.name;
|
|
34
|
+
/** "DM with Dana" when the source is one person read in their DM; else "Dana in #planning, DM with Avi". */
|
|
35
|
+
const whoWhere = (s: CompassSource) => s.who.kind === "person" && s.places.length === 1 && s.places[0].kind === "conversation" && s.places[0].sub === "dm" && s.places[0].id === s.who.person.id
|
|
36
|
+
? placeName(s.places[0]) : `${whoName(s.who)} in ${s.places.map(placeName).join(", ")}`;
|
|
37
|
+
const day = (d: string) => new Date(`${d}T12:00:00`).toLocaleDateString([], { weekday: "short", month: "short", day: "numeric" });
|
|
38
|
+
const whoName = (w: Who) => w.kind === "person" ? w.person.name : w.kind === "people" ? w.people.map(p => p.name).join(", ") : w.kind === "me" ? "You" : "Everyone";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Settings → Morning brief → Compass (docs/compass.md): the people and places that set the developer's priorities, how
|
|
42
|
+
* to read them, and the glossary. One editor for every source; presets only fill its fields. Every change goes through
|
|
43
|
+
* the RPC `set_compass` runs, and Read now through `read_compass`.
|
|
44
|
+
*/
|
|
45
|
+
export function CompassSection({ theme, compact }: { theme: Theme; compact: boolean }) {
|
|
46
|
+
const c = theme.colors; const t = text(c, compact);
|
|
47
|
+
const read = useRpc(compassRpc); const write = useRpc(setCompassRpc); const readNow = useRpc(readCompassRpc);
|
|
48
|
+
const cache = useQueryClient(); const toast = useToast();
|
|
49
|
+
const query = useQuery({ queryKey: compassKey, queryFn: async () => await read({}) as View_, refetchInterval: q => q.state.data?.running ? 2_000 : 30_000 });
|
|
50
|
+
const change = useMutation({
|
|
51
|
+
mutationFn: async (input: CompassChange) => await write(input) as View_,
|
|
52
|
+
onSuccess: value => cache.setQueryData(compassKey, value),
|
|
53
|
+
onError: error => toast.error(errorText(error)),
|
|
54
|
+
});
|
|
55
|
+
const reading = useMutation({
|
|
56
|
+
mutationFn: async () => await readNow({}) as { running: boolean; view: View_ },
|
|
57
|
+
onSuccess: r => cache.setQueryData(compassKey, r.view),
|
|
58
|
+
onError: error => toast.error(errorText(error)),
|
|
59
|
+
});
|
|
60
|
+
const [editing, setEditing] = useState<string | "new" | null>(null);
|
|
61
|
+
const data = query.data;
|
|
62
|
+
const full = !!data && data.settings.sources.length >= COMPASS.sources;
|
|
63
|
+
return <SettingsSection title="Compass" info="The people and places that set your priorities. Follow-up reads what they say each workday morning, keeps a note of each priority with their words, and AI priority ranks your work by it. Only the people you pick are read, only through read-only tools, and a fast model with no tools reads it. Agents can set it up too.">
|
|
64
|
+
{query.isPending && <ActivityIndicator accessibilityLabel="Loading Compass" color={c.foregroundMuted} style={{ alignSelf: "flex-start", marginVertical: 8 }} />}
|
|
65
|
+
{query.error && <Text style={[t.meta, { color: c.statusWarning }]}>{`Couldn't load Compass: ${errorText(query.error)}`}</Text>}
|
|
66
|
+
{data?.blocked && <Line icon="TriangleAlert" tone={c.statusWarning} text={data.blocked} theme={theme} compact={compact} />}
|
|
67
|
+
{data && <View style={{ ...raised(c), borderRadius: 10, backgroundColor: c.surface1, overflow: "hidden" }}>
|
|
68
|
+
{data.settings.sources.length === 0 && editing !== "new" && <View style={{ padding: compact ? 14 : 12, gap: 4 }}>
|
|
69
|
+
<Text style={[t.label, { color: c.foreground }]}>Nobody sets your priorities here yet</Text>
|
|
70
|
+
<Text style={t.meta}>Add the person whose words decide what you work on first, like your product lead's DM. Or ask the Overseer to set it up for you.</Text>
|
|
71
|
+
</View>}
|
|
72
|
+
{data.settings.sources.map((s, i) => editing === s.id
|
|
73
|
+
? <SourceEditor key={s.id} view={data} source={s} first={i === 0} busy={change.isPending} theme={theme} compact={compact} onCancel={() => setEditing(null)}
|
|
74
|
+
onSave={input => change.mutate(input, { onSuccess: () => setEditing(null) })} onRemove={() => change.mutate({ remove: s.id }, { onSuccess: () => setEditing(null) })} />
|
|
75
|
+
: <SourceRow key={s.id} view={data} source={s} first={i === 0} busy={change.isPending} theme={theme} compact={compact} onEdit={() => setEditing(s.id)}
|
|
76
|
+
onToggle={on => change.mutate({ source: { id: s.id, enabled: on } })} />)}
|
|
77
|
+
{editing === "new" && <SourceEditor view={data} first={data.settings.sources.length === 0} busy={change.isPending} theme={theme} compact={compact} onCancel={() => setEditing(null)}
|
|
78
|
+
onSave={input => change.mutate(input, { onSuccess: () => setEditing(null) })} />}
|
|
79
|
+
</View>}
|
|
80
|
+
{data && editing !== "new" && <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
|
|
81
|
+
{full
|
|
82
|
+
? <Text style={t.meta}>{`Compass holds ${COMPASS.sources} sources. Remove one to add another.`}</Text>
|
|
83
|
+
: <Button title="Add a source" icon="Plus" theme={theme} compact={compact} disabled={!!editing} onPress={() => setEditing("new")} />}
|
|
84
|
+
{data.settings.sources.length > 0 && <Button title="Read now" icon="RotateCcw" kind="ghost" theme={theme} compact={compact} loading={reading.isPending || data.running} disabled={!!data.blocked} onPress={() => reading.mutate()} />}
|
|
85
|
+
{data.settings.sources.length > 0 && <Text style={t.meta}>{statusLine(data)}</Text>}
|
|
86
|
+
</View>}
|
|
87
|
+
{data && <ReadingNotes value={data.settings.instructions} busy={change.isPending} theme={theme} compact={compact} onSave={v => change.mutate({ instructions: v })} />}
|
|
88
|
+
{data && <Glossary entries={data.settings.glossary} busy={change.isPending} theme={theme} compact={compact} onSave={g => change.mutate({ glossary: g })} />}
|
|
89
|
+
</SettingsSection>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** "Read 09:02 · 3 notes live · 1 not matched to a workspace", or why the last read failed. */
|
|
93
|
+
function statusLine(v: View_): string {
|
|
94
|
+
if (v.running) return "Reading…";
|
|
95
|
+
// One source already shows its count on its row; the total is news only with several.
|
|
96
|
+
const parts = [v.lastRead ? `Read ${clock(v.lastRead.at)}` : "Not read yet", ...(v.settings.sources.length > 1 ? [`${v.notes.length} note${v.notes.length === 1 ? "" : "s"} live`] : [])];
|
|
97
|
+
if (v.unplaced) parts.push(`${v.unplaced} not matched to a workspace`);
|
|
98
|
+
if (v.today.extractions >= v.today.cap) parts.push(`paused until tomorrow: ${v.today.cap} reads today`);
|
|
99
|
+
return parts.join(" · ");
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function Line({ icon, tone, text: line, theme, compact }: { icon: string; tone: string; text: string; theme: Theme; compact: boolean }) {
|
|
103
|
+
const t = text(theme.colors, compact);
|
|
104
|
+
return <View style={{ flexDirection: "row", alignItems: "flex-start", gap: 6 }}>
|
|
105
|
+
<View style={{ paddingTop: compact ? 4 : 3 }}><Icon name={icon} size={12} color={tone} /></View>
|
|
106
|
+
<Text style={[t.meta, { color: tone, flex: 1 }]}>{line}</Text>
|
|
107
|
+
</View>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** One source, read-only: who, where, its roles, its reading notes' first line, how its places read. Edit opens the editor in place. */
|
|
111
|
+
function SourceRow({ view, source, first, busy, onEdit, onToggle, theme, compact }: { view: View_; source: CompassSource; first: boolean; busy: boolean; onEdit: () => void; onToggle: (on: boolean) => void; theme: Theme; compact: boolean }) {
|
|
112
|
+
const c = theme.colors; const t = text(c, compact);
|
|
113
|
+
const notes = view.notes.filter(n => n.source === source.id); const live = notes.length;
|
|
114
|
+
const [open, setOpen] = useState(false);
|
|
115
|
+
const bad = source.places.map(p => view.places[`${p.kind}:${p.id}`]).find(p => p && (p.status === "failed" || p.status === "paused"));
|
|
116
|
+
const slow = source.places.some(p => view.places[`${p.kind}:${p.id}`]?.status === "slow-path");
|
|
117
|
+
return <View style={{ flexDirection: "row", gap: 10, alignItems: "flex-start", padding: compact ? 14 : 12, borderTopWidth: first ? 0 : 1, borderTopColor: c.border }}>
|
|
118
|
+
<View style={{ flex: 1, minWidth: 0, gap: 4 }}>
|
|
119
|
+
<RichText plain style={[t.label, { color: source.enabled ? c.foreground : c.foregroundMuted }]}>{source.label}</RichText>
|
|
120
|
+
<Text style={t.meta}>{whoWhere(source)}</Text>
|
|
121
|
+
<View style={{ flexDirection: "row", flexWrap: "wrap", gap: 6 }}>
|
|
122
|
+
{source.roles.map(r => <View key={r} style={{ paddingHorizontal: 8, minHeight: 20, justifyContent: "center", borderRadius: 999, backgroundColor: c.surface2 }}>
|
|
123
|
+
<Text style={[t.meta, { color: c.foreground }]}>{ROLE_INFO[r].label}</Text>
|
|
124
|
+
</View>)}
|
|
125
|
+
</View>
|
|
126
|
+
{source.instructions ? <RichText plain numberOfLines={2} style={[t.meta, { fontStyle: "italic" }]}>{`“${source.instructions}”`}</RichText> : null}
|
|
127
|
+
{source.enabled && (live
|
|
128
|
+
? <Pressable accessibilityRole="button" accessibilityState={{ expanded: open }} accessibilityLabel={`${open ? "Hide" : "Show"} ${live} note${live === 1 ? "" : "s"} from ${source.label}`} onPress={() => setOpen(o => !o)} hitSlop={compact ? 0 : 6}
|
|
129
|
+
style={{ flexDirection: "row", alignItems: "center", gap: 4, alignSelf: "flex-start", minHeight: compact ? 44 : 20 }}>
|
|
130
|
+
<Text style={[t.meta, { color: c.foreground }]}>{`${live} note${live === 1 ? "" : "s"} live`}</Text>
|
|
131
|
+
<Icon name={open ? "ChevronUp" : "ChevronDown"} size={12} color={c.foregroundMuted} />
|
|
132
|
+
{slow && <Text style={t.meta}>· read by search, the slower path</Text>}
|
|
133
|
+
</Pressable>
|
|
134
|
+
: <Text style={t.meta}>{["No notes live", slow ? "read by search, the slower path" : null].filter(Boolean).join(" · ")}</Text>)}
|
|
135
|
+
{source.enabled && open && <NoteList notes={notes} view={view} theme={theme} compact={compact} />}
|
|
136
|
+
{source.enabled && bad?.error && <Line icon="TriangleAlert" tone={c.statusWarning} text={bad.error} theme={theme} compact={compact} />}
|
|
137
|
+
<Pressable accessibilityRole="button" accessibilityLabel={`Edit ${source.label}`} onPress={onEdit} disabled={busy} hitSlop={compact ? 0 : 6}
|
|
138
|
+
style={{ flexDirection: "row", alignItems: "center", gap: 4, alignSelf: "flex-start", minHeight: compact ? 44 : 20 }}>
|
|
139
|
+
<Icon name="Pencil" size={12} color={c.accent} />
|
|
140
|
+
<Text style={[t.meta, { color: c.accent, fontWeight: "600" }]}>Edit</Text>
|
|
141
|
+
</Pressable>
|
|
142
|
+
</View>
|
|
143
|
+
<Switch theme={theme} compact={compact} label={compact ? "" : source.enabled ? "On" : "Off"} accessibilityLabel={`Read ${source.label}`} value={source.enabled} disabled={busy} onChange={onToggle} />
|
|
144
|
+
</View>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* What Compass understood from a source: each live note, the words it quotes, its date and where it went. The quote is
|
|
149
|
+
* the proof (a-compass-note-quotes-its-source), so it is always shown.
|
|
150
|
+
*/
|
|
151
|
+
function NoteList({ notes, view, theme, compact }: { notes: CompassNote[]; view: View_; theme: Theme; compact: boolean }) {
|
|
152
|
+
const c = theme.colors; const t = text(c, compact);
|
|
153
|
+
const where = (n: CompassNote) => n.match.workspace ? view.workspaces[n.match.workspace] ?? "its workspace" : n.match.issue ? n.match.issue : "not matched to a workspace";
|
|
154
|
+
return <View style={{ gap: 10, paddingTop: 2 }}>
|
|
155
|
+
{notes.map(n => <View key={n.id} style={{ gap: 2, paddingLeft: 10, borderLeftWidth: 2, borderLeftColor: c.border }}>
|
|
156
|
+
<RichText plain style={[t.body, { color: c.foreground }]}>{n.what}</RichText>
|
|
157
|
+
{n.quote && <RichText plain numberOfLines={3} style={[t.meta, { fontStyle: "italic" }]}>{`“${n.quote}”`}</RichText>}
|
|
158
|
+
<Text style={[t.meta, { fontVariant: ["tabular-nums"] }]}>{[n.until ? `Until ${day(n.until)}` : null, ROLE_INFO[n.role].label, where(n)].filter(Boolean).join(" · ")}</Text>
|
|
159
|
+
</View>)}
|
|
160
|
+
</View>;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The one editor for adding and changing a source. A preset only fills the fields. Who and where are picked from the chat
|
|
165
|
+
* tool's own search (compass_find), so every place has the tool's own id; a person's DM comes with the person.
|
|
166
|
+
*/
|
|
167
|
+
function SourceEditor({ view, source, first, busy, onSave, onCancel, onRemove, theme, compact }: { view: View_; source?: CompassSource; first: boolean; busy: boolean; onSave: (c: CompassChange) => void; onCancel: () => void; onRemove?: () => void; theme: Theme; compact: boolean }) {
|
|
168
|
+
const c = theme.colors; const t = text(c, compact);
|
|
169
|
+
const [preset, setPreset] = useState<Preset | null>(source ? null : view.presets.find(p => p.offered) ?? null);
|
|
170
|
+
const [people, setPeople] = useState<Found[]>(source ? source.who.kind === "person" ? [{ id: source.who.person.id, name: source.who.person.name, place: null! }] : source.who.kind === "people" ? source.who.people.map(p => ({ id: p.id, name: p.name, place: null! })) : [] : []);
|
|
171
|
+
const [me, setMe] = useState(source?.who.kind === "me" || preset?.who === "me");
|
|
172
|
+
const [places, setPlaces] = useState<Place[]>(source?.places ?? []);
|
|
173
|
+
const [roles, setRoles] = useState<Role[]>(source?.roles ?? preset?.roles ?? ["priorities"]);
|
|
174
|
+
const [label, setLabel] = useState(source?.label ?? "");
|
|
175
|
+
const [notes, setNotes] = useState(source?.instructions ?? "");
|
|
176
|
+
const [picking, setPicking] = useState<"people" | "channels" | null>(null);
|
|
177
|
+
const usePreset = (p: Preset) => { setPreset(p); setRoles(p.roles); setMe(p.who === "me"); if (p.who === "me") setPeople([]); };
|
|
178
|
+
const dmOnly = preset?.sub === "dm";
|
|
179
|
+
const addPerson = (f: Found) => {
|
|
180
|
+
setPicking(null);
|
|
181
|
+
setPeople(ps => ps.some(p => p.id === f.id) || ps.length >= COMPASS.people ? ps : [...ps, f]);
|
|
182
|
+
// A person's DM preset: their DM is the place.
|
|
183
|
+
if (dmOnly) setPlaces(ps => ps.some(p => p.id === f.id) ? ps : [...ps, f.place].slice(0, COMPASS.places));
|
|
184
|
+
if (!label && !source) setLabel(f.name);
|
|
185
|
+
};
|
|
186
|
+
const who: Who | null = me ? { kind: "me" } : people.length === 1 ? { kind: "person", person: { id: people[0].id, name: people[0].name } } : people.length > 1 ? { kind: "people", people: people.map(p => ({ id: p.id, name: p.name })) } : null;
|
|
187
|
+
const ready = !!who && places.length > 0 && roles.length > 0;
|
|
188
|
+
const save = () => who && onSave({ source: { ...(source ? { id: source.id } : {}), ...(label.trim() ? { label: label.trim() } : {}), who, places, roles, instructions: notes } });
|
|
189
|
+
const chip = (title: string, onRemoveChip: () => void, key: string) => <View key={key} style={{ flexDirection: "row", alignItems: "center", gap: 4, minHeight: compact ? 44 : 28, paddingLeft: 10, paddingRight: 4, borderRadius: 6, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface0 }}>
|
|
190
|
+
<Text style={t.body}>{title}</Text>
|
|
191
|
+
<Pressable accessibilityRole="button" accessibilityLabel={`Remove ${title}`} onPress={onRemoveChip} hitSlop={6} style={{ minWidth: compact ? 36 : 22, minHeight: compact ? 36 : 22, alignItems: "center", justifyContent: "center" }}>
|
|
192
|
+
<Icon name="X" size={12} color={c.foregroundMuted} />
|
|
193
|
+
</Pressable>
|
|
194
|
+
</View>;
|
|
195
|
+
const labelCol = (s: string) => <Text style={[t.meta, { width: compact ? undefined : 96, minWidth: compact ? 64 : undefined }]}>{s}</Text>;
|
|
196
|
+
const row = { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 } as const;
|
|
197
|
+
return <SubmitScope enabled={ready && !busy} onSubmit={save} style={{ padding: compact ? 14 : 12, gap: 12, borderTopWidth: first ? 0 : 1, borderTopColor: c.border, backgroundColor: c.surface1 }}>
|
|
198
|
+
{!source && <View style={{ gap: 6 }}>
|
|
199
|
+
<Text style={[t.meta, { color: c.foreground, fontWeight: "600" }]}>Start from</Text>
|
|
200
|
+
<View style={row}>
|
|
201
|
+
{view.presets.filter(p => p.offered).map(p => <Pressable key={p.id} accessibilityRole="radio" accessibilityState={{ checked: preset?.id === p.id }} onPress={() => usePreset(p)}
|
|
202
|
+
style={state => ({ minHeight: compact ? 44 : 30, paddingHorizontal: 12, borderRadius: 6, justifyContent: "center", borderWidth: 1, borderColor: preset?.id === p.id ? c.accent : c.border,
|
|
203
|
+
backgroundColor: preset?.id === p.id ? tint(c.accent, c) : (state as { hovered?: boolean }).hovered ? c.surface2 : c.surface0 })}>
|
|
204
|
+
<Text style={{ color: c.foreground, fontSize: 13, fontWeight: "500" }}>{p.label}</Text>
|
|
205
|
+
</Pressable>)}
|
|
206
|
+
</View>
|
|
207
|
+
{preset && <Text style={t.meta}>{preset.hint}</Text>}
|
|
208
|
+
{view.presets.some(p => !p.offered) && <Text style={t.meta}>{`Not yet: ${view.presets.filter(p => !p.offered).map(p => p.label.toLowerCase()).join(", ")}. Compass reads conversations in this release.`}</Text>}
|
|
209
|
+
</View>}
|
|
210
|
+
<View style={row}>
|
|
211
|
+
{labelCol("Whose words")}
|
|
212
|
+
{me ? <Text style={t.body}>Yours</Text> : people.map(p => chip(p.name, () => { setPeople(ps => ps.filter(x => x.id !== p.id)); if (dmOnly) setPlaces(ps => ps.filter(x => x.id !== p.id)); }, p.id))}
|
|
213
|
+
{!me && people.length < COMPASS.people && <Button title={people.length ? "Add a person" : "Pick a person"} icon="Plus" kind={people.length ? "ghost" : "secondary"} theme={theme} compact={compact} onPress={() => setPicking(picking === "people" ? null : "people")} />}
|
|
214
|
+
</View>
|
|
215
|
+
{picking === "people" && <FindPicker kind="people" theme={theme} compact={compact} onCancel={() => setPicking(null)} onPick={addPerson} />}
|
|
216
|
+
<View style={row}>
|
|
217
|
+
{labelCol("Where")}
|
|
218
|
+
{places.map(p => chip(placeName(p), () => setPlaces(ps => ps.filter(x => x !== p)), `${p.kind}:${p.id}`))}
|
|
219
|
+
{places.length < COMPASS.places && !dmOnly && <Button title={places.length ? "Add" : "Pick a channel"} icon="Plus" kind={places.length ? "ghost" : "secondary"} theme={theme} compact={compact} onPress={() => setPicking(picking === "channels" ? null : "channels")} />}
|
|
220
|
+
{dmOnly && !places.length && <Text style={t.meta}>Their DM with you, once you pick them.</Text>}
|
|
221
|
+
</View>
|
|
222
|
+
{picking === "channels" && <FindPicker kind="channels" theme={theme} compact={compact} onCancel={() => setPicking(null)} onPick={f => { setPicking(null); setPlaces(ps => ps.some(p => p.id === f.id) ? ps : [...ps, f.place]); }} />}
|
|
223
|
+
<View style={{ gap: 6 }}>
|
|
224
|
+
<Text style={[t.meta, { color: c.foreground, fontWeight: "600" }]}>What they tell you</Text>
|
|
225
|
+
<View style={row}>
|
|
226
|
+
{ROLES.map(r => { const on = roles.includes(r); return <Pressable key={r} accessibilityRole="checkbox" accessibilityState={{ checked: on }} onPress={() => setRoles(rs => on ? rs.filter(x => x !== r) : [...rs, r])}
|
|
227
|
+
style={state => ({ minHeight: compact ? 44 : 28, paddingHorizontal: 10, borderRadius: 999, justifyContent: "center", borderWidth: 1, borderColor: on ? c.accent : c.border,
|
|
228
|
+
backgroundColor: on ? tint(c.accent, c) : (state as { hovered?: boolean }).hovered ? c.surface2 : "transparent" })}>
|
|
229
|
+
<Text style={{ color: on ? c.foreground : c.foregroundMuted, fontSize: 12, fontWeight: "500" }}>{ROLE_INFO[r].label}</Text>
|
|
230
|
+
</Pressable>; })}
|
|
231
|
+
</View>
|
|
232
|
+
</View>
|
|
233
|
+
<View style={{ gap: 6 }}>
|
|
234
|
+
<Text style={[t.meta, { color: c.foreground, fontWeight: "600" }]}>How to read this</Text>
|
|
235
|
+
<TextInput accessibilityLabel="How to read this source" multiline value={notes} onChangeText={v => setNotes(v.slice(0, COMPASS.sourceInstructions))} placeholder="P0 means today, P1 this week. Ignore hiring talk."
|
|
236
|
+
placeholderTextColor={c.foregroundMuted} style={{ minHeight: 64, padding: 10, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, fontSize: 13, backgroundColor: c.surface0, textAlignVertical: "top" }} />
|
|
237
|
+
<Text style={t.meta}>{`Your words for the model that reads it. They change how messages are read, never what is read. ${notes.length}/${COMPASS.sourceInstructions}`}</Text>
|
|
238
|
+
</View>
|
|
239
|
+
<View style={row}>
|
|
240
|
+
{labelCol("Name")}
|
|
241
|
+
<TextInput accessibilityLabel="Source name" value={label} onChangeText={setLabel} placeholder="Dana · product" placeholderTextColor={c.foregroundMuted}
|
|
242
|
+
style={{ flex: 1, minWidth: 160, minHeight: compact ? 44 : 32, paddingHorizontal: 10, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, fontSize: 13, backgroundColor: c.surface0 }} />
|
|
243
|
+
</View>
|
|
244
|
+
<View style={[row, { justifyContent: "space-between" }]}>
|
|
245
|
+
<View style={row}>
|
|
246
|
+
<Button title={source ? "Save" : "Add source"} kind="primary" shortcut theme={theme} compact={compact} loading={busy} disabled={!ready} onPress={save} />
|
|
247
|
+
<Button title="Cancel" kind="ghost" theme={theme} compact={compact} onPress={onCancel} />
|
|
248
|
+
</View>
|
|
249
|
+
{onRemove && <Button title="Remove source" kind="ghost" icon="Trash2" theme={theme} compact={compact} disabled={busy} onPress={onRemove} />}
|
|
250
|
+
</View>
|
|
251
|
+
{!ready && <Text style={t.meta}>{!who ? "Pick whose words count." : !places.length ? "Pick where to read them." : "Give it at least one role."}</Text>}
|
|
252
|
+
</SubmitScope>;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** People or channels from the chat tool's own search (compass_find): only results with the tool's own id can be picked. */
|
|
256
|
+
function FindPicker({ kind, onPick, onCancel, theme, compact }: { kind: "people" | "channels"; onPick: (f: Found) => void; onCancel: () => void; theme: Theme; compact: boolean }) {
|
|
257
|
+
const c = theme.colors; const t = text(c, compact);
|
|
258
|
+
const find = useRpc(compassFindRpc);
|
|
259
|
+
const [q, setQ] = useState(""); const [debounced, setDebounced] = useState("");
|
|
260
|
+
useEffect(() => { const id = setTimeout(() => setDebounced(q.trim()), 350); return () => clearTimeout(id); }, [q]);
|
|
261
|
+
const results = useQuery({ queryKey: ["follow-up", "compass-find", kind, debounced], enabled: debounced.length >= 2, staleTime: 60_000,
|
|
262
|
+
queryFn: async () => await find({ kind, query: debounced }) as { results: Found[]; error: string | null } });
|
|
263
|
+
return <View style={{ borderWidth: 1, borderColor: c.border, borderRadius: 8, backgroundColor: c.surface0, overflow: "hidden" }}>
|
|
264
|
+
<View style={{ flexDirection: "row", gap: 8, padding: 8, alignItems: "center" }}>
|
|
265
|
+
<TextInput autoFocus accessibilityLabel={kind === "people" ? "Search people" : "Search channels"} value={q} onChangeText={setQ} placeholder={kind === "people" ? "Search people by name" : "Search channels by name"}
|
|
266
|
+
placeholderTextColor={c.foregroundMuted} autoCapitalize="none" autoCorrect={false}
|
|
267
|
+
style={{ flex: 1, minWidth: 0, minHeight: compact ? 44 : 32, paddingHorizontal: 10, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, fontSize: 13, backgroundColor: c.surface1 }} />
|
|
268
|
+
<Button title="Cancel" kind="ghost" theme={theme} compact={compact} onPress={onCancel} />
|
|
269
|
+
</View>
|
|
270
|
+
{results.isFetching && <Text style={[t.meta, { paddingHorizontal: 12, paddingBottom: 8 }]}>Searching…</Text>}
|
|
271
|
+
{results.data?.error && <Text style={[t.meta, { paddingHorizontal: 12, paddingBottom: 8, color: c.statusWarning }]}>{results.data.error}</Text>}
|
|
272
|
+
{(results.data?.results ?? []).map(r => <Pressable key={r.id} accessibilityRole="button" onPress={() => onPick(r)}
|
|
273
|
+
style={state => ({ minHeight: compact ? 44 : 34, paddingHorizontal: 12, justifyContent: "center", borderTopWidth: 1, borderTopColor: c.border, backgroundColor: state.pressed || (state as { hovered?: boolean }).hovered ? c.surface2 : "transparent" })}>
|
|
274
|
+
<Text style={t.body}>{kind === "people" ? r.name : `#${r.name}`}</Text>
|
|
275
|
+
</Pressable>)}
|
|
276
|
+
{debounced.length >= 2 && !results.isFetching && !results.data?.results.length && !results.data?.error && <Text style={[t.meta, { paddingHorizontal: 12, paddingBottom: 8 }]}>{`Nothing matches "${debounced}".`}</Text>}
|
|
277
|
+
</View>;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** "How to read your Compass": the developer's words for every source, saved on Save. */
|
|
281
|
+
function ReadingNotes({ value, busy, onSave, theme, compact }: { value: string; busy: boolean; onSave: (v: string) => void; theme: Theme; compact: boolean }) {
|
|
282
|
+
const c = theme.colors; const t = text(c, compact);
|
|
283
|
+
const [draft, setDraft] = useState(value);
|
|
284
|
+
useEffect(() => setDraft(value), [value]);
|
|
285
|
+
const dirty = draft.trim() !== value.trim();
|
|
286
|
+
return <SubmitScope enabled={dirty && !busy} onSubmit={() => onSave(draft)} style={{ gap: 6 }}>
|
|
287
|
+
<Text style={[t.label, { color: c.foreground }]}>How to read your Compass</Text>
|
|
288
|
+
<TextInput accessibilityLabel="How to read your Compass" multiline value={draft} onChangeText={v => setDraft(v.slice(0, COMPASS.instructions))} placeholder="P0 means today. 'The renewal' is the acme renewal. Customer asks wait for the plan unless they name a date."
|
|
289
|
+
placeholderTextColor={c.foregroundMuted} style={{ minHeight: 72, padding: 10, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, fontSize: 13, backgroundColor: c.surface0, textAlignVertical: "top" }} />
|
|
290
|
+
<View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
|
|
291
|
+
<Text style={[t.meta, { flex: 1, minWidth: 180 }]}>{`For every source. ${draft.length}/${COMPASS.instructions}`}</Text>
|
|
292
|
+
{dirty && <Button title="Save" kind="primary" shortcut theme={theme} compact={compact} loading={busy} onPress={() => onSave(draft)} />}
|
|
293
|
+
</View>
|
|
294
|
+
</SubmitScope>;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/** The glossary: your words → an issue key. Matching reads it before anything else, word for word. */
|
|
298
|
+
function Glossary({ entries, busy, onSave, theme, compact }: { entries: GlossaryEntry[]; busy: boolean; onSave: (g: GlossaryEntry[]) => void; theme: Theme; compact: boolean }) {
|
|
299
|
+
const c = theme.colors; const t = text(c, compact);
|
|
300
|
+
const [words, setWords] = useState(""); const [key, setKey] = useState("");
|
|
301
|
+
const means = (g: GlossaryEntry) => "issue" in g.means ? g.means.issue : "workspace" in g.means ? `workspace ${g.means.workspace}` : g.means.account;
|
|
302
|
+
const field = { minHeight: compact ? 44 : 32, paddingHorizontal: 10, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, fontSize: 13, backgroundColor: c.surface0 } as const;
|
|
303
|
+
const add = () => { onSave([...entries, { words: words.trim(), means: { issue: key.trim().toUpperCase() } }]); setWords(""); setKey(""); };
|
|
304
|
+
return <View style={{ gap: 6 }}>
|
|
305
|
+
<Text style={[t.label, { color: c.foreground }]}>Glossary</Text>
|
|
306
|
+
<Text style={t.meta}>Your own words for your work. When a note says one, it goes to that issue's workspace.</Text>
|
|
307
|
+
{entries.map(g => <View key={g.words} style={{ flexDirection: "row", alignItems: "center", gap: 8, minHeight: compact ? 44 : 28 }}>
|
|
308
|
+
<RichText plain style={[t.body, { color: c.foreground }]}>{`“${g.words}”`}</RichText>
|
|
309
|
+
<Icon name="ArrowRight" size={12} color={c.foregroundMuted} />
|
|
310
|
+
<Text style={[t.body, { fontFamily: "ui-monospace, Menlo, monospace", fontSize: 12 }]}>{means(g)}</Text>
|
|
311
|
+
<Pressable accessibilityRole="button" accessibilityLabel={`Remove ${g.words}`} disabled={busy} onPress={() => onSave(entries.filter(x => x !== g))} hitSlop={6}
|
|
312
|
+
style={{ minWidth: compact ? 44 : 22, minHeight: compact ? 44 : 22, alignItems: "center", justifyContent: "center" }}>
|
|
313
|
+
<Icon name="X" size={12} color={c.foregroundMuted} />
|
|
314
|
+
</Pressable>
|
|
315
|
+
</View>)}
|
|
316
|
+
{entries.length < COMPASS.glossary && <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
|
|
317
|
+
<TextInput accessibilityLabel="Word" value={words} onChangeText={setWords} placeholder="Phoenix" placeholderTextColor={c.foregroundMuted} style={[field, { flexGrow: 1, flexBasis: 120, minWidth: 0 }]} />
|
|
318
|
+
<Icon name="ArrowRight" size={12} color={c.foregroundMuted} />
|
|
319
|
+
<TextInput accessibilityLabel="Issue key" value={key} onChangeText={setKey} placeholder="ACME-40" autoCapitalize="characters" placeholderTextColor={c.foregroundMuted} style={[field, { flexGrow: 1, flexBasis: 100, minWidth: 0, fontFamily: "ui-monospace, Menlo, monospace" }]} />
|
|
320
|
+
<Button title="Add" icon="Plus" theme={theme} compact={compact} loading={busy} disabled={words.trim().length < 2 || key.trim().length < 3} onPress={add} />
|
|
321
|
+
</View>}
|
|
322
|
+
</View>;
|
|
323
|
+
}
|
package/client/header.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import { VersionMark } from "./updates";
|
|
|
10
10
|
import { IconSwap, Spinner } from "./motion";
|
|
11
11
|
import { segmentPaint, type Colors } from "./theme";
|
|
12
12
|
import { ReferencesLine } from "./linked";
|
|
13
|
+
import { WhyItMatters } from "./why-it-matters";
|
|
13
14
|
import { SummaryLine } from "./about";
|
|
14
15
|
|
|
15
16
|
/** PR status older than this means the poll has stopped working; say so instead of looking current. */
|
|
@@ -56,7 +57,7 @@ function LiveGlyph({ icon, colors }: { icon: LiveIcon; colors: Colors }) {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings, onRefresh, refreshing, onAuto, autoPending, notice, onOpenPr, resize, hideTitle = false, onHome, more }: {
|
|
60
|
+
export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings, onRefresh, refreshing, onAuto, autoPending, notice, onOpenPr, resize, hideTitle = false, onHome, more, openAgent }: {
|
|
60
61
|
workspace: Workspace; theme: Theme; compact: boolean; now: number; onSettings: (category?: SettingsCategory) => void; onRefresh: () => void; refreshing: boolean; onAuto: (next: boolean) => void; autoPending: boolean; notice: string | null; onOpenPr?: (key: string) => void;
|
|
61
62
|
/** Expand to the larger view, or collapse back to the panel. Absent where the panel is already as wide as it gets. */
|
|
62
63
|
resize?: { icon: "Maximize2" | "Minimize2"; label: string; onPress: () => void } | null;
|
|
@@ -66,6 +67,8 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
|
|
|
66
67
|
onHome?: () => void;
|
|
67
68
|
/** The More button (client/panel-menu.tsx), before the gear. */
|
|
68
69
|
more?: ReactNode;
|
|
70
|
+
/** Why it matters' Ask the Overseer opens the Overseer's chat with the draft in it. */
|
|
71
|
+
openAgent?: (agentId: string) => void;
|
|
69
72
|
}) {
|
|
70
73
|
const c = theme.colors; const t = text(c, compact);
|
|
71
74
|
const parts = headline(w, now);
|
|
@@ -112,6 +115,7 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
|
|
|
112
115
|
{/* Spec and Linked: their own line, as on desktop and Home. The 44px bar can't hold them beside Home, the version
|
|
113
116
|
and settings at 390pt without pushing settings off-screen. */}
|
|
114
117
|
<ReferencesLine workspace={w} theme={theme} compact />
|
|
118
|
+
<WhyItMatters workspace={w} theme={theme} compact openAgent={openAgent} />
|
|
115
119
|
<Text accessibilityLiveRegion="polite" style={[t.ask, { color: c.foregroundMuted }]}>
|
|
116
120
|
{parts.map((part, i) => <Text key={part.text} style={toneOf(part.tone) ? { color: toneOf(part.tone) } : { color: c.foreground }}>{i ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" · "}</Text> : null}{part.text}</Text>)}
|
|
117
121
|
</Text>
|
|
@@ -129,6 +133,7 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
|
|
|
129
133
|
{!compact && !hideTitle && <SummaryLine workspace={w} theme={theme} compact={false} />}
|
|
130
134
|
{/* The references line: Spec and Linked, one line, only when there's a spec or anything linked. */}
|
|
131
135
|
<ReferencesLine workspace={w} theme={theme} compact={compact} />
|
|
136
|
+
<WhyItMatters workspace={w} theme={theme} compact={compact} openAgent={openAgent} />
|
|
132
137
|
<Text accessibilityLiveRegion="polite" style={[t.meta, { color: c.foregroundMuted, marginTop: 2 }]}>
|
|
133
138
|
{parts.map((part, i) => <Text key={part.text} style={toneOf(part.tone) ? { color: toneOf(part.tone), fontWeight: "600" } : { color: c.foreground }}>{i ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" · "}</Text> : null}{part.text}</Text>)}
|
|
134
139
|
</Text>
|