paseo-follow-up 2.3.0-beta.0 → 2.3.0-beta.2
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 +17 -7
- package/client/catch-up.tsx +25 -105
- package/client/dismiss.tsx +106 -0
- package/client/home-chrome.tsx +3 -1
- package/client/home.tsx +4 -2
- package/client/inbox-store.ts +11 -1
- package/client/more-context.tsx +177 -0
- package/client/needs-you.tsx +28 -9
- package/client/questions.tsx +43 -8
- package/index.client.tsx +7 -0
- package/index.server.ts +27 -7
- package/package.json +3 -2
- package/server/agent-actions.ts +1 -1
- package/server/agent-hook.mjs +1 -1
- package/server/agent-parity.ts +10 -1
- package/server/context-requests.ts +6 -3
- package/server/dismiss.ts +62 -0
- package/server/engine.ts +13 -1
- package/server/hook-source.ts +1 -1
- package/server/inbox.ts +29 -4
- package/server/mcp-source.ts +8 -0
- package/server/mcp.mjs +8 -0
- package/server/questions.ts +47 -9
- package/shared/activity.ts +2 -2
- package/shared/attention.ts +50 -3
- package/shared/brief.ts +9 -6
- package/shared/catch-up.ts +29 -1
- package/shared/chat.ts +1 -1
- package/shared/contracts.ts +13 -3
- package/shared/display.ts +4 -3
- package/shared/errors.ts +6 -2
- package/shared/home-keys.ts +2 -2
- package/shared/inbox.ts +21 -3
- package/shared/model.ts +7 -0
- package/shared/paseo-keys.ts +24 -0
- package/shared/questions.ts +29 -1
- package/shared/search-key.ts +8 -8
- package/shared/section-search.ts +2 -2
- package/shared/status-invariants.ts +2 -2
package/client/brief.tsx
CHANGED
|
@@ -26,6 +26,7 @@ import { cardStore } from "./card-store";
|
|
|
26
26
|
import { PrSheet } from "./pr-sheet";
|
|
27
27
|
import { isLight, withAlpha, type Colors } from "./theme";
|
|
28
28
|
import { dismissToast, notice, runAction, runUndoable } from "./toasts";
|
|
29
|
+
import { DismissX, RevealScope, useDismiss } from "./dismiss";
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* The brief card (design §2): the ask in one line, decisions as option rows, only the context needed, and the one
|
|
@@ -347,7 +348,7 @@ function Past({ b, c, now, compact, height, pending = false, onResend, resending
|
|
|
347
348
|
/** `embedded`: inside Home's detail pane, which has its own reply box and action bar, so the card drops its moves. */
|
|
348
349
|
/** `snoozed`: the row is in Later, so the card wears the row's muted tone and says "Later" instead of "Needs you". */
|
|
349
350
|
/** `bare`: a section of the Needs you block (client/needs-you.tsx), whose frame says "Needs you": no border, margin or second label. */
|
|
350
|
-
type BriefCardProps = PluginTimelineItemProps<Brief> & { deps: BriefDeps; embedded?: boolean; snoozed?: boolean; bare?: boolean };
|
|
351
|
+
type BriefCardProps = PluginTimelineItemProps<Brief> & { deps: BriefDeps; embedded?: boolean; snoozed?: boolean; bare?: boolean; /** After its x is pressed (Catch up moves on). */ onDismissed?: () => void };
|
|
351
352
|
/** A brief names its PRs ("#240 is merged"): each "#N" its workspace tracks opens that PR (a-row-that-names-a-pr-opens-it-in-one-click). */
|
|
352
353
|
export function BriefCard(props: BriefCardProps) {
|
|
353
354
|
const workspace = props.item.data.workspaceId ? props.deps.workspace(props.item.data.workspaceId) : undefined;
|
|
@@ -355,7 +356,7 @@ export function BriefCard(props: BriefCardProps) {
|
|
|
355
356
|
return <PrLinksProvider prs={prs}><BriefCardBody {...props} /></PrLinksProvider>;
|
|
356
357
|
}
|
|
357
358
|
|
|
358
|
-
function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, snoozed = false, bare = false }: BriefCardProps) {
|
|
359
|
+
function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, snoozed = false, bare = false, onDismissed }: BriefCardProps) {
|
|
359
360
|
const c = theme.colors; const row = item.data; const compact = layout.compact;
|
|
360
361
|
// The row is a snapshot; the live brief decides (shownBrief). Only a row that still looks open asks, one query per
|
|
361
362
|
// agent for every card in its chat. A card is actionable only when the server says this exact brief is open.
|
|
@@ -392,6 +393,7 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
392
393
|
const [marked, setMarked] = useState<string | null>(null);
|
|
393
394
|
// The send landed: green at once, before the server's answered brief replaces the card.
|
|
394
395
|
const [sent, setSent] = useState(false);
|
|
396
|
+
const dismiss = useDismiss();
|
|
395
397
|
const picks = usePicks(b.id);
|
|
396
398
|
const words = useWords(b.id);
|
|
397
399
|
const notes = useNotes(b.id);
|
|
@@ -420,6 +422,11 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
420
422
|
const acts = flaggedAct && !snoozed;
|
|
421
423
|
const tone = !snoozed && (acts || b.kind === "done" || b.kind === "review" || b.kind === "error") ? kindTone(b.kind, c) : c.foregroundMuted;
|
|
422
424
|
const ageText = age(b.at, now);
|
|
425
|
+
// dismissing-anything-in-needs-you-sends-the-agent-nothing: an ask still in Needs you (or in Later) has the small x
|
|
426
|
+
// beside its age. It signs the row off as dismissed: the agent is sent nothing, and a restated ask isn't flagged again.
|
|
427
|
+
const x = flaggedAct && shown.actionable && agentId ? <View style={{ marginVertical: compact ? -8 : -5, marginRight: compact ? -8 : -6 }}>
|
|
428
|
+
<DismissX theme={theme} compact={compact} label="Dismiss the agent's ask" disabled={!!sending} onPress={() => dismiss({ agentId }, { onDismissed })} />
|
|
429
|
+
</View> : null;
|
|
423
430
|
const border = acts ? withAlpha(attention, isLight(c) ? 0.5 : 0.45) : c.border;
|
|
424
431
|
// Every send from the card (a pick, Something else, Send answers, the keyboard's Send) goes through runAction: the
|
|
425
432
|
// card keeps the picks and words and says what failed, and the toast offers Retry. Success is the card itself.
|
|
@@ -470,7 +477,7 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
470
477
|
if (b.slim) {
|
|
471
478
|
// Permission: Paseo's own prompt below is the control (F9). Fallback: the paragraph is right above.
|
|
472
479
|
// The label and age share the top line so the ask always gets the full width; at a narrow panel the move wraps under it.
|
|
473
|
-
return <
|
|
480
|
+
return <RevealScope accessibilityRole="summary" accessibilityLabel={`${acts ? "Needs you: " : ""}${askText}. ${b.sourceLine}`}
|
|
474
481
|
style={[{ marginVertical: embedded ? 0 : 10, gap: 4, paddingHorizontal: 12, paddingVertical: 10, borderRadius: 10, borderWidth: 1, borderColor: border }, bare && BARE]}>
|
|
475
482
|
<View style={{ flexDirection: "row", alignItems: "center", gap: 7 }}>
|
|
476
483
|
<Icon name={ICON[b.kind]} size={14} color={tone} />
|
|
@@ -478,6 +485,7 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
478
485
|
<View style={{ flex: 1 }} />
|
|
479
486
|
{/* In Later the age would read as a second clock beside "Later until"; the pane header keeps it. */}
|
|
480
487
|
{!snoozed && <Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16, fontVariant: ["tabular-nums"] }}>{ageText}</Text>}
|
|
488
|
+
{x}
|
|
481
489
|
</View>
|
|
482
490
|
<View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: 10, rowGap: 8 }}>
|
|
483
491
|
<RichText numberOfLines={3} tooltip={askText}
|
|
@@ -486,7 +494,7 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
486
494
|
</View>
|
|
487
495
|
{!!error && <Text accessibilityRole="alert" style={{ color: c.statusDanger, fontSize: 13, lineHeight: 18 }}>{error}</Text>}
|
|
488
496
|
{!!mergeWhy && <Text accessibilityRole="alert" style={{ color: c.statusWarning, fontSize: 13, lineHeight: 18 }}>{mergeWhy}</Text>}
|
|
489
|
-
</
|
|
497
|
+
</RevealScope>;
|
|
490
498
|
}
|
|
491
499
|
|
|
492
500
|
const tight = isTight(b, compact, height);
|
|
@@ -511,7 +519,7 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
511
519
|
const otherId = !multi ? askedDecisions(b).find(d => isOther(picks[d.id]))?.id : undefined;
|
|
512
520
|
const keySend = multi ? (sendBar(b, sendable).ready ? () => sendAll() : null) : otherId && words[otherId]?.trim() ? () => sendOther(otherId) : null;
|
|
513
521
|
const sendOther = (decisionId: string) => { const text = words[decisionId]?.trim(); if (text) void run(`${decisionId}:${OTHER}`, async answerId => { await answer([{ decisionId, choice: OTHER, words: text }], answerId); clearCard(b.id); }); };
|
|
514
|
-
return <
|
|
522
|
+
return <RevealScope accessibilityRole="summary" accessibilityLabel={`${acts ? "Needs you" : flaggedAct ? "Later" : word(b.kind)}: ${askText}`}
|
|
515
523
|
style={[{ marginVertical: embedded ? 0 : 10, borderRadius: 12, borderWidth: 1, borderColor: border, backgroundColor: c.surface1, overflow: "hidden" }, bare && BARE]}>
|
|
516
524
|
<SubmitScope enabled={!!keySend && !busy} onSubmit={() => keySend?.()} style={{ paddingHorizontal: pad, paddingTop: compact ? 12 : 14, paddingBottom: 14, gap: tight ? 10 : 12 }}>
|
|
517
525
|
<View style={{ gap: 4 }}>
|
|
@@ -525,9 +533,11 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
525
533
|
{!snoozed && <Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16, fontVariant: ["tabular-nums"] }}>{ageText}</Text>}
|
|
526
534
|
{/* Phones: where the card's facts come from sits behind ⓘ instead of a footer under every card. */}
|
|
527
535
|
{compact && <Pressable accessibilityRole="button" accessibilityLabel={why ? "Hide where this comes from" : "Where this comes from"} aria-expanded={why} accessibilityState={{ expanded: why }}
|
|
528
|
-
onPress={() => setWhy(v => !v)} style={{ width: 44, height: 44, marginVertical: -15, marginRight: -14, alignItems: "center", justifyContent: "center" }}>
|
|
536
|
+
onPress={() => setWhy(v => !v)} style={{ width: 44, height: 44, marginVertical: -15, marginRight: x ? -10 : -14, alignItems: "center", justifyContent: "center" }}>
|
|
529
537
|
<Icon name="Info" size={14} color={why ? c.foreground : c.foregroundMuted} />
|
|
530
538
|
</Pressable>}
|
|
539
|
+
{/* The x is always the card's last control, in its top-right corner, on every Needs-you item. */}
|
|
540
|
+
{x}
|
|
531
541
|
</View>
|
|
532
542
|
{/* The ask role on phones (react-native-web ignores hitSlop, so the ⓘ above is a real 44 box); desktop keeps 19/26. */}
|
|
533
543
|
{/* Bare: a section of the Needs you block, so the same size as its question titles. */}
|
|
@@ -558,7 +568,7 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
|
|
|
558
568
|
<Text style={{ flex: 1, color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>{b.sourceLine}</Text>
|
|
559
569
|
</View>}
|
|
560
570
|
{detail.workspace && sheet && <PrSheet workspace={detail.workspace} prKey={sheet.key} intent={sheet.intent} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />}
|
|
561
|
-
</
|
|
571
|
+
</RevealScope>;
|
|
562
572
|
}
|
|
563
573
|
|
|
564
574
|
const BARE = { marginVertical: 0, borderWidth: 0, borderRadius: 0, backgroundColor: "transparent" } as const;
|
package/client/catch-up.tsx
CHANGED
|
@@ -13,16 +13,16 @@ import { needsYou } from "../shared/attention";
|
|
|
13
13
|
import { liveBrief } from "../shared/brief";
|
|
14
14
|
import { age, snoozeUntil } from "../shared/inbox";
|
|
15
15
|
import { laterChoices } from "../shared/row-menu";
|
|
16
|
-
import { errorText } from "../shared/errors";
|
|
17
16
|
import { CATCH_UP_RAIL_DEFAULT, CATCH_UP_RAIL_MAX, CATCH_UP_RAIL_MIN } from "../shared/display";
|
|
18
|
-
import { CATCH_UP_KEYS,
|
|
17
|
+
import { CATCH_UP_KEYS, MODE, catchUpKey, contextFor, keyLabel, deckCards, groupOf, openInWorkspace, park, prevPos, applySwipe, skipWorkspace, swipeLock, swipeOutcome, settle as settleCard, startSession, statsOf, sync, type ContextRequest, type DeckCard, type Outcome, type Session } from "../shared/catch-up";
|
|
19
18
|
import type { Workspace } from "../shared/model";
|
|
20
19
|
import type { ListWorkspace } from "../shared/list";
|
|
21
20
|
import { bottomInset, Button, focusSoon, IconButton, SubmitScope, text, type Theme } from "./kit";
|
|
22
21
|
import { glyphColor } from "./home-list";
|
|
23
22
|
import { useHomeModel, type HomeSources } from "./home-data";
|
|
24
23
|
import { useInbox } from "./inbox";
|
|
25
|
-
import { QuestionBody, type SendReady } from "./questions";
|
|
24
|
+
import { QuestionBody, QuestionDismissX, type SendReady } from "./questions";
|
|
25
|
+
import { DismissReveal, useDismiss } from "./dismiss";
|
|
26
26
|
import { NeedsYouList } from "./needs-you";
|
|
27
27
|
import { BriefCard, type BriefDeps } from "./brief";
|
|
28
28
|
import { SummaryLine } from "./about";
|
|
@@ -36,6 +36,9 @@ import { hostDictation } from "./dictation";
|
|
|
36
36
|
import { ownsKey, surfaceVisible } from "../shared/list-keys";
|
|
37
37
|
import { useReducedMotion } from "./motion";
|
|
38
38
|
import { PRIMARY_FORM } from "./dock";
|
|
39
|
+
import { MorePanel, MoveResult, ContextAnswer } from "./more-context";
|
|
40
|
+
|
|
41
|
+
export { MorePanel, MoveResult, ContextAnswer };
|
|
39
42
|
|
|
40
43
|
/** react-native-web's data attribute, so the option-letter keys find this card's radios. */
|
|
41
44
|
const CARD_MARK = { dataSet: { catchUpCard: "1" } } as object;
|
|
@@ -80,8 +83,8 @@ export function skipNoun(card: Pick<DeckCard, "kind" | "item">): string {
|
|
|
80
83
|
/** The card Skip's tooltip and accessible name: what it does and that the card comes back. */
|
|
81
84
|
export const skipCardHint = (noun: string) => `Skip this ${noun}. It comes back after the rest`;
|
|
82
85
|
export const skipWorkspaceHint = (n: number) => `Skip this workspace's ${n} cards. They come back after the rest`;
|
|
83
|
-
/** The newest ask about this card, if any. */
|
|
84
|
-
const askFor = (context: readonly ContextRequest[],
|
|
86
|
+
/** The newest ask about this card, if any, from whichever surface asked it (sameCard). */
|
|
87
|
+
const askFor = (context: readonly ContextRequest[], card: DeckCard) => contextFor(context, { workspaceId: card.s.workspaceId, cardKey: card.key });
|
|
85
88
|
|
|
86
89
|
export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: Theme; compact: boolean; deps: CatchUpDeps; navigation: Nav; onExit: () => void }) {
|
|
87
90
|
const c = theme.colors; const t = text(c, compact);
|
|
@@ -184,6 +187,9 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
|
|
|
184
187
|
setTimeout(() => hit(mic()), 0);
|
|
185
188
|
break;
|
|
186
189
|
}
|
|
190
|
+
// The card's own Dismiss (QuestionBody), so the key does exactly what the click does.
|
|
191
|
+
// The card's own x (client/dismiss.tsx), whatever the card is, so the key does exactly what the click does.
|
|
192
|
+
case "dismiss": { const d = inCard('[aria-label^="Dismiss"]'); if (!d) return; d.click?.(); break; }
|
|
187
193
|
case "note": { const add = inCard('[aria-label^="Add a note"]'); if (add) add.click?.(); else r.querySelector('[aria-label="Tell the agent something"]')?.focus?.(); break; }
|
|
188
194
|
// Its sheet or popover takes focus itself (MoveResult).
|
|
189
195
|
case "later": if (!click('[aria-label="Later (L)"]')) return; break;
|
|
@@ -282,10 +288,11 @@ export function CatchUp({ theme, compact, deps, navigation, onExit }: { theme: T
|
|
|
282
288
|
|
|
283
289
|
const body = finished || !card ? <Finished theme={theme} compact={compact} stats={stats} empty={!total} onHome={onExit}
|
|
284
290
|
onSkipped={() => setSession(s => ({ ...s, pos: s.order.findIndex(k => s.outcomes[k] === "skipped"), lapped: true }))} />
|
|
285
|
-
|
|
286
|
-
|
|
291
|
+
// The card on screen is the selected one: its x shows without hover (dismissing-anything-in-needs-you-sends-the-agent-nothing).
|
|
292
|
+
: <DismissReveal.Provider value="always"><CardView key={card.key} card={card} w={w} theme={theme} compact={compact} deps={deps} navigation={navigation} gone={gone} more={more} setMore={setMore}
|
|
293
|
+
request={askFor(context, card)} waiting={!!session.parked[card.s.key]} onAsk={ask}
|
|
287
294
|
sameWorkspace={session.order.filter(k => cardOf(k)?.s.key === card.s.key)}
|
|
288
|
-
onDone={() => settle("done")} onSkip={skip} onSkipWorkspace={wsLeft > 1 ? skipWs : undefined} wsLeft={wsLeft} onBack={session.pos > 0 ? back : undefined} onLater={() => settle("later")}
|
|
295
|
+
onDone={() => settle("done")} onSkip={skip} onSkipWorkspace={wsLeft > 1 ? skipWs : undefined} wsLeft={wsLeft} onBack={session.pos > 0 ? back : undefined} onLater={() => settle("later")} /></DismissReveal.Provider>;
|
|
289
296
|
|
|
290
297
|
const rail = <ScrollView {...({ dataSet: { catchUpRail: "1" } } as object)} contentContainerStyle={{ paddingVertical: 8 }}>
|
|
291
298
|
{session.order.map((k, i) => {
|
|
@@ -352,6 +359,7 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
|
|
|
352
359
|
const ws = openRowCopy<ListWorkspace>(w, full);
|
|
353
360
|
const [laterOpen, setLaterOpen] = useState(false);
|
|
354
361
|
const [ready, setReady] = useState<SendReady | null>(null);
|
|
362
|
+
const dismiss = useDismiss();
|
|
355
363
|
const openChat = () => { if (!navigation) return; if (s.agentId) navigation.openAgent({ agentId: s.agentId }); else if (s.workspaceId) navigation.openWorkspace({ workspaceId: s.workspaceId }); };
|
|
356
364
|
const word = cardWord(card);
|
|
357
365
|
const color = card.item?.kind === "merge" ? mergedColor(c) : card.kind === "finished" ? c.foregroundMuted : c.statusWarning;
|
|
@@ -391,16 +399,19 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
|
|
|
391
399
|
|
|
392
400
|
const askBlock = card.kind === "question" && q && ws
|
|
393
401
|
? <View style={{ gap: 8 }}>
|
|
394
|
-
<
|
|
395
|
-
|
|
396
|
-
|
|
402
|
+
<View style={{ flexDirection: "row", alignItems: "flex-start", gap: 8 }}>
|
|
403
|
+
<RichText plain style={[compact ? t.ask : [t.body, { fontSize: 15, lineHeight: 21, fontWeight: "600" }], { flex: 1, minWidth: 0 }]}>{`${q.id} · ${q.title}`}</RichText>
|
|
404
|
+
<View style={{ marginTop: compact ? -4 : -1, marginRight: -5 }}><QuestionDismissX workspaceId={ws.id} questionId={q.id} theme={theme} compact={compact} onDismissed={onDone} dismiss={dismiss} /></View>
|
|
405
|
+
</View>
|
|
406
|
+
<QuestionBody key={q.id} workspace={ws} question={q} theme={theme} compact={compact} inline={false} dismissAt="host"
|
|
407
|
+
openAgent={id => navigation?.openAgent({ agentId: id })} onAnswered={onDone} onSendReady={setReady} dictate moreContext={false} />
|
|
397
408
|
</View>
|
|
398
409
|
: card.kind === "item" && card.item && full
|
|
399
410
|
? <View style={{ borderRadius: 10, borderWidth: 1, borderColor: withAlpha(c.statusWarning, 0.45), overflow: "hidden" }}>
|
|
400
411
|
<NeedsYouList workspace={full} theme={theme} compact={compact} rows={[card.item]} flush actions={{ after: onDone, openAgent: openChat } as never} />
|
|
401
412
|
</View>
|
|
402
413
|
: card.kind === "permission" ? <PermissionCard s={s} theme={theme} compact={compact} onDone={onDone} />
|
|
403
|
-
: card.kind === "brief" ? <BriefAsk s={s} theme={theme} compact={compact} deps={deps} />
|
|
414
|
+
: card.kind === "brief" ? <BriefAsk s={s} theme={theme} compact={compact} deps={deps} onDismissed={onDone} />
|
|
404
415
|
: <View style={{ gap: 10 }}>
|
|
405
416
|
<Text style={compact ? t.ask : [t.body, { fontSize: 15, lineHeight: 21, fontWeight: "600" }]}>{s.line || "The agent finished its turn."}</Text>
|
|
406
417
|
<Text style={t.meta}>Nothing to decide. Sign it off once you've read it, or reply.</Text>
|
|
@@ -467,54 +478,6 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
|
|
|
467
478
|
</DockedPane>;
|
|
468
479
|
}
|
|
469
480
|
|
|
470
|
-
/**
|
|
471
|
-
* Where a move's result opens (MOVE_OPENS, a-move-bar-action-opens-in-view): a sheet in the phone's dock or a popover
|
|
472
|
-
* on its desktop button. Focus moves into it (its first choice), and on the web it scrolls into view the least distance.
|
|
473
|
-
*/
|
|
474
|
-
export function MoveResult({ place, theme, label, width, children }: { place: "sheet" | "popover"; theme: Theme; label: string; width?: number; children: ReactNode }) {
|
|
475
|
-
const c = theme.colors;
|
|
476
|
-
const ref = useRef<View>(null);
|
|
477
|
-
useEffect(() => {
|
|
478
|
-
if (Platform.OS !== "web") return;
|
|
479
|
-
const t = setTimeout(() => {
|
|
480
|
-
const node = ref.current as unknown as { querySelector?(q: string): { focus?(o?: object): void } | null; scrollIntoView?(o: object): void } | null;
|
|
481
|
-
node?.scrollIntoView?.({ block: "nearest" });
|
|
482
|
-
// The first choice: More context's suggestions ("I don't get it" leads), else Later's first time.
|
|
483
|
-
(node?.querySelector?.('[role="radio"]') ?? node?.querySelector?.('[role="menu"] [role="button"]'))?.focus?.({ preventScroll: true });
|
|
484
|
-
}, 0);
|
|
485
|
-
return () => clearTimeout(t);
|
|
486
|
-
}, []);
|
|
487
|
-
return <View ref={ref} {...({ dataSet: { moveResult: place } } as object)} role="dialog" accessibilityLabel={label}
|
|
488
|
-
style={[{ padding: place === "sheet" ? 14 : 16, borderRadius: 12, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface1 },
|
|
489
|
-
place === "sheet"
|
|
490
|
-
? { marginHorizontal: 12, marginTop: 12 }
|
|
491
|
-
: { position: "absolute", zIndex: 20, left: 0, bottom: "100%", marginBottom: 8, width, shadowColor: "#000", shadowOpacity: 0.22, shadowRadius: 16, shadowOffset: { width: 0, height: 6 } }]}>
|
|
492
|
-
{children}
|
|
493
|
-
</View>;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/** What came back for this card: the answer, "answered in its chat", a failure, or (seen going Back) that it's still asking. */
|
|
497
|
-
export function ContextAnswer({ theme, compact, request, waiting, agent, openChat, openAgent }: { theme: Theme; compact: boolean; request: ContextRequest; waiting: boolean; agent: string; openChat: () => void; openAgent?: (agentId: string) => void }) {
|
|
498
|
-
const c = theme.colors; const t = text(c, compact);
|
|
499
|
-
const who = request.target === "overseer" ? "Overseer" : agent === "the agent" ? "The agent" : agent;
|
|
500
|
-
const asking = request.state === "asking";
|
|
501
|
-
return <View accessibilityLiveRegion="polite" style={{ gap: 8, padding: compact ? 14 : 16, borderRadius: 12, borderWidth: 1, borderColor: asking ? c.border : withAlpha(c.statusSuccess, 0.4), backgroundColor: c.surface1 }}>
|
|
502
|
-
<View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
503
|
-
<Icon name={asking ? "Hourglass" : request.state === "failed" ? "CircleAlert" : "Sparkles"} size={14} color={request.state === "failed" ? c.statusDanger : c.foregroundMuted} />
|
|
504
|
-
<RichText plain style={[t.small, { flex: 1 }]}>{asking ? `Asked ${who === "Overseer" ? "the Overseer" : who}${waiting ? " · this comes back as the next card when it answers. You can still act on it now" : ""}` : `${who} · you asked: ${askHeadline(request.ask)}`}</RichText>
|
|
505
|
-
</View>
|
|
506
|
-
{request.state === "answered" && request.answer && <RichText selectable style={t.body}>{request.answer}</RichText>}
|
|
507
|
-
{request.state === "chat" && <View style={{ gap: 8 }}>
|
|
508
|
-
<Text style={t.body}>{who === "Overseer" ? "The Overseer answered in its own chat, not here: it can't reply on a card." : `${who} answered in its chat.`}</Text>
|
|
509
|
-
{/* A 2.2.0-beta.3 ask of the Overseer: its answer is in the Overseer's chat (an-ask-goes-only-to-an-agent-that-can-answer-it). */}
|
|
510
|
-
<View style={{ flexDirection: "row" }}>{who === "Overseer"
|
|
511
|
-
? <Button theme={theme} compact={compact} icon="MessageSquare" title="Open Overseer" disabled={!request.askedOf || !openAgent} onPress={() => request.askedOf && openAgent?.(request.askedOf)} />
|
|
512
|
-
: <Button theme={theme} compact={compact} icon="MessageSquare" title="Open chat" onPress={openChat} />}</View>
|
|
513
|
-
</View>}
|
|
514
|
-
{request.state === "failed" && <Text style={t.body}>{request.error ?? "The ask didn't go through. Try again, or open the chat."}</Text>}
|
|
515
|
-
</View>;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
481
|
function PermissionCard({ s, theme, compact, onDone }: { s: DeckCard["s"]; theme: Theme; compact: boolean; onDone: () => void }) {
|
|
519
482
|
const agent = useAgentLive(s.agentId);
|
|
520
483
|
const t = text(theme.colors, compact);
|
|
@@ -523,55 +486,12 @@ function PermissionCard({ s, theme, compact, onDone }: { s: DeckCard["s"]; theme
|
|
|
523
486
|
onRespond={r => { void agent.handle?.respondToPermission({ requestId: p.id, response: r as never }); onDone(); }} />)}</View>;
|
|
524
487
|
}
|
|
525
488
|
|
|
526
|
-
function BriefAsk({ s, theme, compact, deps }: { s: DeckCard["s"]; theme: Theme; compact: boolean; deps: CatchUpDeps }) {
|
|
489
|
+
function BriefAsk({ s, theme, compact, deps, onDismissed }: { s: DeckCard["s"]; theme: Theme; compact: boolean; deps: CatchUpDeps; onDismissed?: () => void }) {
|
|
527
490
|
const read = useRpc(inboxBriefRpc);
|
|
528
491
|
const brief = useQuery({ queryKey: ["follow-up", "home-brief", s.agentId, "catch-up"], queryFn: () => read({ agentId: s.agentId! }), enabled: !!s.agentId });
|
|
529
492
|
const b = liveBrief(brief.data?.brief);
|
|
530
493
|
if (!b) return <Text style={text(theme.colors, compact).ask}>{s.line}</Text>;
|
|
531
|
-
return <BriefCard {...({ embedded: true, item: { data: b }, theme, layout: { compact }, agentId: s.agentId, deps: deps.briefDeps } as unknown as Parameters<typeof BriefCard>[0])} />;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* More context: "I don't get it" first (most asks just need explaining), then the developer's own words, to one place:
|
|
536
|
-
* the card's workspace's main agent, the one that can answer on the card (an-ask-goes-only-to-an-agent-that-can-answer-
|
|
537
|
-
* it). It may wake, because the developer asked. The deck moves on and this workspace comes back when the answer is ready.
|
|
538
|
-
*/
|
|
539
|
-
export function MorePanel({ theme, compact, onClose, onAsk }: { theme: Theme; compact: boolean; onClose: () => void; onAsk: (words: string) => Promise<void> }) {
|
|
540
|
-
const c = theme.colors; const t = text(c, compact);
|
|
541
|
-
const [words, setWords] = useState<string>(CONTEXT_ASKS[0].text);
|
|
542
|
-
const [picked, setPicked] = useState<string>(CONTEXT_ASKS[0].id);
|
|
543
|
-
const [busy, setBusy] = useState(false);
|
|
544
|
-
const [error, setError] = useState<string | null>(null);
|
|
545
|
-
const send = () => {
|
|
546
|
-
if (!words.trim() || busy) return;
|
|
547
|
-
setBusy(true); setError(null);
|
|
548
|
-
// The words stay unless the ask is recorded.
|
|
549
|
-
onAsk(words.trim()).catch(e => setError(errorText(e))).finally(() => setBusy(false));
|
|
550
|
-
};
|
|
551
|
-
return <View {...({ dataSet: { catchUpMore: "1" } } as object)} style={{ gap: 10 }}>
|
|
552
|
-
<View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
553
|
-
<Icon name="Sparkles" size={14} color={c.foreground} />
|
|
554
|
-
<Text style={[t.label, { flex: 1, fontWeight: "600" }]}>More context</Text>
|
|
555
|
-
<IconButton theme={theme} compact={compact} icon="X" label="Close more context" onPress={onClose} />
|
|
556
|
-
</View>
|
|
557
|
-
<View accessibilityRole="radiogroup" style={{ flexDirection: "row", flexWrap: "wrap", gap: 6 }}>
|
|
558
|
-
{CONTEXT_ASKS.map((x, i) => <Pressable key={x.id} accessibilityLabel={compact ? x.label : `${x.label} (${i + 1})`} accessibilityRole="radio" accessibilityState={{ checked: picked === x.id }} onPress={() => { setPicked(x.id); setWords(x.text); }}
|
|
559
|
-
style={{ minHeight: compact ? 36 : 28, justifyContent: "center", paddingHorizontal: 10, borderRadius: 999, borderWidth: 1, borderColor: picked === x.id ? c.foreground : c.border, backgroundColor: picked === x.id ? c.surface2 : "transparent" }}>
|
|
560
|
-
<Text style={[t.meta, { color: picked === x.id ? c.foreground : c.foregroundMuted }]}>{x.label}</Text>
|
|
561
|
-
</Pressable>)}
|
|
562
|
-
</View>
|
|
563
|
-
<View {...PRIMARY_FORM} style={{ gap: 10 }}>
|
|
564
|
-
<TextInput accessibilityLabel="What do you want to know?" placeholder="What do you want to know?" placeholderTextColor={c.foregroundMuted} value={words} multiline
|
|
565
|
-
onChangeText={v => { setWords(v); setPicked(CONTEXT_ASKS.find(x => x.text === v)?.id ?? ""); }}
|
|
566
|
-
style={{ minHeight: compact ? 84 : 56, paddingHorizontal: 10, paddingVertical: 8, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, backgroundColor: c.surface0 }} />
|
|
567
|
-
{!!error && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusDanger }]}>{error}</Text>}
|
|
568
|
-
<View {...({ dataSet: { askAgent: "1" } } as object)} style={{ flexDirection: "row" }}>
|
|
569
|
-
<Button theme={theme} compact={compact} grow={compact} kind="primary" icon="MessageSquareText" title="Ask the agent" loading={busy} disabled={!words.trim() || busy}
|
|
570
|
-
accessibilityHint={compact ? "Asks this workspace's main agent, which may wake it" : `Asks this workspace's main agent, which may wake it. ${keyLabel("⌘↵", isMac())}`} onPress={send} />
|
|
571
|
-
</View>
|
|
572
|
-
</View>
|
|
573
|
-
<Text style={t.small}>This workspace steps aside while you keep going, and comes back as your next card with the answer. Back reaches it any time.</Text>
|
|
574
|
-
</View>;
|
|
494
|
+
return <BriefCard {...({ embedded: true, item: { data: b }, theme, layout: { compact }, agentId: s.agentId, deps: deps.briefDeps, onDismissed } as unknown as Parameters<typeof BriefCard>[0])} />;
|
|
575
495
|
}
|
|
576
496
|
|
|
577
497
|
export function Finished({ theme, compact, stats, empty, onHome, onSkipped }: { theme: Theme; compact: boolean; stats: ReturnType<typeof statsOf>; empty: boolean; onHome: () => void; onSkipped: () => void }) {
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { createContext, useContext, useEffect, useRef, useState, type ReactNode } from "react";
|
|
2
|
+
import { Platform, View, type StyleProp, type ViewProps, type ViewStyle } from "react-native";
|
|
3
|
+
import { useRpc } from "@getpaseo/plugin/client";
|
|
4
|
+
import { Icon, useToast } from "@getpaseo/plugin/client/ui";
|
|
5
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
6
|
+
import { dismissRpc } from "../shared/contracts";
|
|
7
|
+
import { Pressable } from "./text";
|
|
8
|
+
import { focusRing, type Theme } from "./kit";
|
|
9
|
+
import { withAlpha } from "./theme";
|
|
10
|
+
import { liveBriefKey, overviewKey, workspaceKey } from "./keys";
|
|
11
|
+
import { hasToastHost, pushToast, runAction } from "./toast-store";
|
|
12
|
+
import type { InboxStore } from "./inbox-store";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Dismiss, the same on every Needs-you item (dismissing-anything-in-needs-you-sends-the-agent-nothing): a small muted x
|
|
16
|
+
* in the card's top-right corner, next to its age. "This no longer needs me": the item leaves Needs you and every
|
|
17
|
+
* count at once, the agent is sent nothing, and the toast's Undo brings it back. One control (DismissX), one request
|
|
18
|
+
* (follow.dismiss), one toast.
|
|
19
|
+
*
|
|
20
|
+
* Where it shows: on a phone (no hover) always, muted, with a 40 px hit area (a real box, since react-native-web ignores hitSlop) rather than a bigger glyph.
|
|
21
|
+
* On desktop it appears while the pointer is over its card or focus is inside it (RevealScope), and always on the card
|
|
22
|
+
* that is selected (Catch up's card, Home's detail pane: `DismissReveal` "always"). Hidden is opacity 0, never
|
|
23
|
+
* unmounted, so the card doesn't move when it appears and the keyboard and screen readers always reach it.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/** As long as sign-off's Undo (6 s): the toast holds while the pointer or focus is on it. */
|
|
27
|
+
export const DISMISS_UNDO_MS = 6_000;
|
|
28
|
+
/** The x's tooltip and the second half of its accessibility label. */
|
|
29
|
+
export const DISMISS_HINT = "it no longer needs you, and the agent isn't messaged";
|
|
30
|
+
|
|
31
|
+
export type DismissTarget = { workspaceId: string; key: string } | { agentId: string };
|
|
32
|
+
const targetKey = (t: DismissTarget) => "agentId" in t ? `agent:${t.agentId}` : `${t.workspaceId}:${t.key}`;
|
|
33
|
+
|
|
34
|
+
/** The inbox store, bound once by the client entry, so dismissing a brief updates the rows at once. */
|
|
35
|
+
let inbox: InboxStore | null = null;
|
|
36
|
+
export function bindDismissInbox(store: InboxStore | null): void { inbox = store; }
|
|
37
|
+
|
|
38
|
+
/** Dismiss one item, with Undo in the toast. `onDismissed` runs at once, before the request: the card moves on. */
|
|
39
|
+
export function useDismiss(): (target: DismissTarget, options?: { onDismissed?: () => void }) => void {
|
|
40
|
+
const rpc = useRpc(dismissRpc);
|
|
41
|
+
const toast = useToast();
|
|
42
|
+
const cache = useQueryClient();
|
|
43
|
+
const refresh = (t: DismissTarget) => {
|
|
44
|
+
if ("agentId" in t) void cache.invalidateQueries({ queryKey: liveBriefKey(t.agentId) });
|
|
45
|
+
else void cache.invalidateQueries({ queryKey: workspaceKey(t.workspaceId) });
|
|
46
|
+
void cache.invalidateQueries({ queryKey: overviewKey });
|
|
47
|
+
};
|
|
48
|
+
const call = (t: DismissTarget, undo: boolean) => "agentId" in t && inbox ? inbox.dismiss(t.agentId, undo) : rpc({ ...t, ...(undo ? { undo: true } : {}) });
|
|
49
|
+
const undo = (t: DismissTarget, name: string) => void runAction({ label: `Undo dismiss ${name}`, toast, run: () => call(t, true), onSuccess: () => refresh(t),
|
|
50
|
+
success: () => `${name.charAt(0).toUpperCase()}${name.slice(1)} is back in Needs you`, failure: `Couldn't bring back ${name}` }, `dismiss:${targetKey(t)}`);
|
|
51
|
+
return (t, options = {}) => {
|
|
52
|
+
options.onDismissed?.();
|
|
53
|
+
void runAction({ label: "Dismiss", toast, run: () => call(t, false), onSuccess: () => refresh(t), failure: "Couldn't dismiss it",
|
|
54
|
+
// Already gone (merged, answered, sent elsewhere): nothing to say, the surface shows what happened.
|
|
55
|
+
reconcile: () => refresh(t),
|
|
56
|
+
success: r => {
|
|
57
|
+
const message = `Dismissed ${r.name}. The agent wasn't messaged.`;
|
|
58
|
+
if (!hasToastHost()) return message;
|
|
59
|
+
pushToast("success", message, [{ label: "Undo", onPress: () => undo(t, r.name) }], { durationMs: DISMISS_UNDO_MS, keep: true });
|
|
60
|
+
return null;
|
|
61
|
+
} }, `dismiss:${targetKey(t)}`);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** "always": the card is the selected one (Catch up's card, Home's detail pane), so its x shows without hover. */
|
|
66
|
+
export const DismissReveal = createContext<"hover" | "always">("hover");
|
|
67
|
+
const Hovered = createContext<boolean>(false);
|
|
68
|
+
|
|
69
|
+
type DomNode = { addEventListener(type: string, f: () => void): void; removeEventListener(type: string, f: () => void): void; setAttribute?(k: string, v: string): void };
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* A card whose x shows while the pointer is over it or focus is inside it (desktop web). Native and phones draw the x
|
|
73
|
+
* always, so this is a plain View there.
|
|
74
|
+
*/
|
|
75
|
+
export function RevealScope({ children, style, ...rest }: { children: ReactNode; style?: StyleProp<ViewStyle> } & Omit<ViewProps, "style" | "children">) {
|
|
76
|
+
const [hovered, setHovered] = useState(false);
|
|
77
|
+
const [focused, setFocused] = useState(false);
|
|
78
|
+
// react-native-web forwards these to the DOM (as client/linked.tsx's hover does); React's onFocus/onBlur bubble, so
|
|
79
|
+
// focus anywhere inside the card counts. Native ignores them: the x is always shown there.
|
|
80
|
+
const web = Platform.OS === "web" ? { onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), onFocus: () => setFocused(true), onBlur: () => setFocused(false) } : {};
|
|
81
|
+
return <View style={style} {...rest} {...(web as object)}><Hovered.Provider value={hovered || focused}>{children}</Hovered.Provider></View>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The small x. `label` names what it dismisses ("Dismiss Q3", "Dismiss #12 is approved"); the hint follows it. Quiet by
|
|
86
|
+
* design: the muted foreground at 14 px (16 on phones), no fill until hovered, never the size or colour of an action.
|
|
87
|
+
*/
|
|
88
|
+
export function DismissX({ theme, compact, label, onPress, disabled = false }: { theme: Theme; compact: boolean; label: string; onPress: () => void; disabled?: boolean }) {
|
|
89
|
+
const c = theme.colors;
|
|
90
|
+
const reveal = useContext(DismissReveal);
|
|
91
|
+
const hovered = useContext(Hovered);
|
|
92
|
+
const [focused, setFocused] = useState(false);
|
|
93
|
+
const touch = compact || Platform.OS !== "web";
|
|
94
|
+
const shown = touch || reveal === "always" || hovered || focused;
|
|
95
|
+
const tip = useRef<View>(null);
|
|
96
|
+
useEffect(() => { if (Platform.OS === "web") (tip.current as unknown as DomNode | null)?.setAttribute?.("title", `Dismiss: ${DISMISS_HINT}`); }, []);
|
|
97
|
+
// Phones: a real 40 px box (react-native-web ignores hitSlop) pulled in by 6 px each side, so it lays out as 28 px;
|
|
98
|
+
// native also gets 4 px of hitSlop, a 48 px target. The glyph stays small and muted.
|
|
99
|
+
const box = touch ? 40 : 22;
|
|
100
|
+
return <Pressable ref={tip} accessibilityRole="button" accessibilityLabel={`${label}: ${DISMISS_HINT}`} disabled={disabled} onPress={onPress}
|
|
101
|
+
hitSlop={4} onFocus={() => setFocused(true)} onBlur={() => setFocused(false)}
|
|
102
|
+
style={(state: { hovered?: boolean; pressed: boolean; focused?: boolean }) => ({ ...focusRing(state.focused, c), width: box, height: box, margin: touch ? -6 : 0, borderRadius: box / 2, alignItems: "center", justifyContent: "center",
|
|
103
|
+
opacity: shown ? (disabled ? 0.4 : 1) : 0, backgroundColor: state.pressed ? c.surface2 : state.hovered ? withAlpha(c.foreground, 0.06) : "transparent" })}>
|
|
104
|
+
{state => <Icon name="X" size={touch ? 16 : 14} color={(state as { hovered?: boolean }).hovered ? c.foreground : c.foregroundMuted} />}
|
|
105
|
+
</Pressable>;
|
|
106
|
+
}
|
package/client/home-chrome.tsx
CHANGED
|
@@ -130,7 +130,9 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
|
|
|
130
130
|
: !!value && <Pressable accessibilityRole="button" accessibilityLabel={`Clear ${placeholder.toLowerCase()}`} hitSlop={dense ? 14 : 8} onPress={() => { onChange(""); inputRef.current?.focus(); }}>
|
|
131
131
|
<Icon name="X" size={dense ? 16 : 13} color={c.foregroundMuted} />
|
|
132
132
|
</Pressable>}
|
|
133
|
-
{slashHint && !value && !focused && !dense && Platform.OS === "web" && <Text accessibilityElementsHidden importantForAccessibility="no"
|
|
133
|
+
{slashHint && !value && !focused && !dense && Platform.OS === "web" && <Text accessibilityElementsHidden importantForAccessibility="no"
|
|
134
|
+
// React Native Web drops title props on Text; keep the existing chip's DOM title current directly.
|
|
135
|
+
ref={node => { (node as unknown as { setAttribute?: (key: string, value: string) => void } | null)?.setAttribute?.("title", slashTitle ?? ""); }} style={{ color: c.foregroundMuted, fontSize: 11, paddingHorizontal: 4, borderRadius: 3, borderWidth: 1, borderColor: c.border, fontVariant: ["tabular-nums"] }}>{slashHint}</Text>}
|
|
134
136
|
</View>;
|
|
135
137
|
}
|
|
136
138
|
|
package/client/home.tsx
CHANGED
|
@@ -23,6 +23,7 @@ import { NeedsYouBlock } from "./needs-you";
|
|
|
23
23
|
import { HeldMerges } from "./merge-button";
|
|
24
24
|
import { PrSheet } from "./pr-sheet";
|
|
25
25
|
import { QuestionSheet } from "./questions";
|
|
26
|
+
import { DismissReveal } from "./dismiss";
|
|
26
27
|
import { Age, BadgeView, BRIEF_KEY, glyphColor, HomeList, OVERSEER_KEY, PrChipView, PrSummaryText, type OverseerRowState } from "./home-list";
|
|
27
28
|
import { answerLine, overseerRowState } from "../shared/overseer";
|
|
28
29
|
import type { OmniboxItem } from "../shared/search";
|
|
@@ -592,7 +593,8 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
|
|
|
592
593
|
// Only a real ask joins it (shared briefAsks): a done brief on a row flagged for something else stays out of the count.
|
|
593
594
|
const inBlock = !!w && !!showBrief && !later && briefAsks(b, row);
|
|
594
595
|
|
|
595
|
-
|
|
596
|
+
// Home's detail pane is the selected workspace: every x in it shows without hover (client/dismiss.tsx).
|
|
597
|
+
return <DismissReveal.Provider value="always"><DockedPane compact={compact} header={header} style={{ backgroundColor: c.surface0 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 16, paddingBottom: 24 }}
|
|
596
598
|
dock={({ yields, typingInContent }) => s.agentId && !typingInContent && <View nativeID={compact ? TOAST_ANCHOR : undefined} style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0 }, bottomInset(compact)]}>
|
|
597
599
|
{!yields && moves}
|
|
598
600
|
<ReplyBox theme={theme} compact={compact} agentName={s.title} placeholder={compact ? "Reply to the agent" : undefined} onSend={async text => {
|
|
@@ -617,7 +619,7 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
|
|
|
617
619
|
{laterModal}
|
|
618
620
|
{full && sheet && <PrSheet workspace={full} prKey={sheet.key} intent={sheet.intent} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />}
|
|
619
621
|
{full && <QuestionSheet workspace={full} questionId={question} theme={theme} compact={compact} onClose={() => setQuestion(null)} />}
|
|
620
|
-
|
|
622
|
+
</DismissReveal.Provider>;
|
|
621
623
|
}
|
|
622
624
|
|
|
623
625
|
/**
|
package/client/inbox-store.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PluginClientContext } from "@getpaseo/plugin/client";
|
|
2
|
-
import { inboxActRpc, inboxFeed, inboxListRpc } from "../shared/contracts";
|
|
2
|
+
import { dismissRpc, inboxActRpc, inboxFeed, inboxListRpc } from "../shared/contracts";
|
|
3
3
|
import { openFeed, type Feed } from "./feeds";
|
|
4
4
|
import type { RpcInput, RpcOutput } from "@getpaseo/plugin";
|
|
5
5
|
import { withoutWithdrawnAsks, type InboxRow } from "../shared/inbox";
|
|
@@ -143,6 +143,16 @@ export function createInboxStore(client: PluginClientContext) {
|
|
|
143
143
|
nudge,
|
|
144
144
|
stop() { stopped = true; feed?.stop(); offVisible(); offNoReview(); if (timer) clearTimeout(timer); if (nudged) clearTimeout(nudged); listeners.clear(); unsubscribe(); },
|
|
145
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Dismiss an agent's ask (dismissing-anything-in-needs-you-sends-the-agent-nothing): it leaves Needs you at once and
|
|
148
|
+
* the agent is sent nothing. The caller's toast carries Undo (`undo: true`), so no Undo bar here.
|
|
149
|
+
*/
|
|
150
|
+
async dismiss(agentId: string, undo = false) {
|
|
151
|
+
if (!undo) { patch([agentId], r => ({ ...r, needs: null, snooze: null, signedOffAt: new Date().toISOString(), undoable: true })); emit(); }
|
|
152
|
+
try { return await client.rpc(dismissRpc, { agentId, ...(undo ? { undo: true } : {}) }); }
|
|
153
|
+
finally { refresh(); }
|
|
154
|
+
},
|
|
155
|
+
|
|
146
156
|
/** Sign off now; queue for replay when the host can't be reached. */
|
|
147
157
|
async signOff(requested: string[], options: { muteTurn?: boolean } = {}) {
|
|
148
158
|
const agentIds = requested.filter(id => !inflight.has(id));
|