paseo-follow-up 1.4.0-beta.2 → 1.4.0-beta.21

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.
Files changed (92) hide show
  1. package/OVERVIEW.md +15 -4
  2. package/README.md +59 -6
  3. package/client/about.tsx +22 -12
  4. package/client/agents.tsx +132 -0
  5. package/client/brief.tsx +200 -72
  6. package/client/chat.tsx +12 -4
  7. package/client/display.tsx +62 -11
  8. package/client/header.tsx +40 -19
  9. package/client/home-chrome.tsx +135 -40
  10. package/client/home-list.tsx +90 -35
  11. package/client/home-view.ts +66 -8
  12. package/client/home.tsx +268 -77
  13. package/client/inbox-store.ts +15 -7
  14. package/client/keys.ts +3 -0
  15. package/client/kit.tsx +46 -15
  16. package/client/large.tsx +9 -10
  17. package/client/live.tsx +8 -6
  18. package/client/needs-you.tsx +36 -8
  19. package/client/onboarding.tsx +455 -0
  20. package/client/panel.tsx +98 -23
  21. package/client/pill.tsx +41 -21
  22. package/client/pr-controls.tsx +38 -14
  23. package/client/pr-sheet.tsx +8 -6
  24. package/client/questions.tsx +6 -4
  25. package/client/reviewers.tsx +63 -21
  26. package/client/settings-shell.tsx +77 -0
  27. package/client/settings.tsx +145 -49
  28. package/client/shipping.tsx +186 -0
  29. package/client/spec.tsx +1 -1
  30. package/client/stacks.tsx +4 -3
  31. package/client/tasks.tsx +1 -1
  32. package/client/theme.ts +21 -0
  33. package/client/visibility.ts +7 -0
  34. package/client/workspace-data.ts +37 -0
  35. package/docs/screenshots/decision-card-answered-phone-light.png +0 -0
  36. package/docs/screenshots/decision-card-expanded-chat-light.png +0 -0
  37. package/docs/screenshots/decision-card-partial-phone-dark.png +0 -0
  38. package/docs/screenshots/decision-card-unanswered-phone-dark.png +0 -0
  39. package/index.client.tsx +27 -8
  40. package/index.server.ts +257 -24
  41. package/package.json +5 -3
  42. package/server/about.ts +15 -4
  43. package/server/agent-actions.ts +75 -6
  44. package/server/agent-hook.mjs +54 -16
  45. package/server/agent-parity.ts +149 -0
  46. package/server/agent-settings.ts +124 -0
  47. package/server/ai-jobs.ts +88 -23
  48. package/server/daemon.ts +165 -105
  49. package/server/directory.ts +165 -0
  50. package/server/discovery.ts +34 -6
  51. package/server/engine.ts +31 -9
  52. package/server/etag.ts +14 -0
  53. package/server/github.ts +66 -5
  54. package/server/hook-source.ts +1 -1
  55. package/server/inbox-directory.ts +14 -19
  56. package/server/inbox.ts +28 -1
  57. package/server/mcp-source.ts +1 -1
  58. package/server/mcp.d.mts +3 -1
  59. package/server/mcp.mjs +83 -10
  60. package/server/native-tools.ts +3 -2
  61. package/server/onboarding.ts +101 -0
  62. package/server/overseer-prompt-source.ts +1 -1
  63. package/server/overseer-prompt.md +1 -0
  64. package/server/overseer.ts +72 -8
  65. package/server/pr-actions.ts +91 -15
  66. package/server/pr-workflow.ts +188 -0
  67. package/server/questions.ts +1 -1
  68. package/server/ranker.ts +431 -0
  69. package/server/recovery-config.ts +17 -0
  70. package/server/scopes.ts +20 -8
  71. package/server/tasks.ts +9 -3
  72. package/server/trust-bypass.ts +125 -0
  73. package/shared/about.ts +8 -3
  74. package/shared/activity.ts +3 -1
  75. package/shared/agent-settings.ts +169 -0
  76. package/shared/attention.ts +8 -4
  77. package/shared/brief.ts +44 -0
  78. package/shared/chat.ts +3 -1
  79. package/shared/contracts.ts +42 -4
  80. package/shared/display.ts +16 -1
  81. package/shared/headline.ts +5 -0
  82. package/shared/home.ts +6 -0
  83. package/shared/model.ts +12 -1
  84. package/shared/onboarding.ts +243 -0
  85. package/shared/overseer.ts +10 -2
  86. package/shared/pr-actions.ts +26 -4
  87. package/shared/pr-workflow.ts +133 -0
  88. package/shared/questions.ts +17 -0
  89. package/shared/ranker.ts +237 -0
  90. package/shared/search.ts +25 -5
  91. package/shared/settings-nav.ts +97 -0
  92. package/skills/follow-through/SKILL.md +3 -1
@@ -3,13 +3,15 @@ import { inboxActRpc, inboxListRpc } from "../shared/contracts";
3
3
  import type { RpcInput, RpcOutput } from "@getpaseo/plugin";
4
4
  import type { InboxRow } from "../shared/inbox";
5
5
  import { subscribeDisplay } from "./display";
6
- import { onVisible, pollDelay } from "./visibility";
6
+ import { onVisible, whileVisible } from "./visibility";
7
7
 
8
8
  type List = RpcOutput<typeof inboxListRpc>;
9
9
  export type Recent = { agentIds: string[]; label: string; at: number; batch: boolean };
10
- const POLL_MS = 4_000;
11
- /** While the app is hidden (1.3.0-beta.4). */
12
- const HIDDEN_POLL_MS = 30_000;
10
+ /**
11
+ * The backstop poll. Changes arrive sooner by push: an agent's status or attention changing in Paseo's agent stream
12
+ * calls `nudge` (1.4.0). Nothing polls while the app is hidden; it refreshes once on return.
13
+ */
14
+ const POLL_MS = 15_000;
13
15
 
14
16
  /**
15
17
  * One shared poll of the inbox for every surface on this client. Sign-offs apply optimistically;
@@ -32,7 +34,7 @@ export function createInboxStore(client: PluginClientContext) {
32
34
  let stopped = false;
33
35
  const listeners = new Set<() => void>();
34
36
  const emit = () => { version++; for (const l of listeners) l(); };
35
- const rpcList = (): Promise<List> => client.rpc(inboxListRpc, {});
37
+ const rpcList = (): Promise<List> => client.rpc(inboxListRpc, data?.etag ? { etag: data.etag } : {});
36
38
  const act = (input: RpcInput<typeof inboxActRpc>) => client.rpc(inboxActRpc, input);
37
39
 
38
40
  const poll = async () => {
@@ -44,15 +46,20 @@ export function createInboxStore(client: PluginClientContext) {
44
46
  }
45
47
  const next = await rpcList();
46
48
  if (stopped) return;
49
+ // Nothing changed since the answer this store holds: keep it, and only re-render if we were offline.
50
+ if (next.unchanged && data) { if (offlineSince !== null || failures) { offlineSince = null; failures = 0; emit(); } return; }
47
51
  data = next; offlineSince = null; failures = 0;
48
52
  // Rows signed off while offline stay hidden until the replay lands.
49
53
  emit();
50
54
  } catch {
51
55
  failures++;
52
56
  if (failures >= 2 && offlineSince === null) { offlineSince = Date.now(); emit(); }
53
- } finally { if (!stopped) timer = setTimeout(() => void poll(), pollDelay(POLL_MS, HIDDEN_POLL_MS)); }
57
+ } finally { if (!stopped) timer = whileVisible(POLL_MS, () => void poll()); }
54
58
  };
55
59
  const refresh = () => { if (timer) clearTimeout(timer); void poll(); };
60
+ let nudged: ReturnType<typeof setTimeout> | null = null;
61
+ /** Something changed in Paseo: refresh soon, coalescing a burst of agent updates into one read. */
62
+ const nudge = () => { if (nudged || stopped) return; nudged = setTimeout(() => { nudged = null; refresh(); }, 750); };
56
63
  const unsubscribe = subscribeDisplay(values => {
57
64
  const on = values.enable_inbox !== false;
58
65
  if (on !== enabled) { enabled = on; emit(); if (on) refresh(); }
@@ -97,7 +104,8 @@ export function createInboxStore(client: PluginClientContext) {
97
104
  recent: () => recent,
98
105
  clearRecent() { recent = null; emit(); },
99
106
  refresh,
100
- stop() { stopped = true; offVisible(); if (timer) clearTimeout(timer); listeners.clear(); unsubscribe(); },
107
+ nudge,
108
+ stop() { stopped = true; offVisible(); if (timer) clearTimeout(timer); if (nudged) clearTimeout(nudged); listeners.clear(); unsubscribe(); },
101
109
 
102
110
  /** Sign off now; queue for replay when the host can't be reached. */
103
111
  async signOff(requested: string[], options: { muteTurn?: boolean } = {}) {
package/client/keys.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  /** React Query keys shared by every surface that reads Follow-up state. */
2
2
  export const workspaceKey = (id: string) => ["follow-through", "workspace", id];
3
3
  export const overviewKey = ["follow-through", "overview"];
4
+ /** The browser extension's connection status: one shared query for every surface (1.4.0: 15 s, was 5 s). */
5
+ export const browserKey = ["follow-through", "browser"];
6
+ export const BROWSER_POLL_MS = 15_000;
package/client/kit.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState, type ReactNode } from "react";
2
- import { Pressable, Text, View, type StyleProp, type ViewStyle } from "react-native";
2
+ import { Platform, Pressable, Text, View, type StyleProp, type ViewStyle } from "react-native";
3
3
  import { Icon } from "@getpaseo/plugin/client/ui";
4
4
  import { PressScale, Spinner } from "./motion";
5
5
  import { raised, tint, withAlpha, type Colors, type Theme } from "./theme";
@@ -15,13 +15,44 @@ export function useNow(intervalMs = 30_000): number {
15
15
 
16
16
  export { errorText } from "../shared/errors";
17
17
 
18
- export const text = (colors: Colors) => ({
19
- title: { color: colors.foreground, fontSize: 15, lineHeight: 21, fontWeight: "600" as const },
20
- body: { color: colors.foreground, fontSize: 13, lineHeight: 18 },
21
- meta: { color: colors.foregroundMuted, fontSize: 12, lineHeight: 17, fontVariant: ["tabular-nums" as const] },
22
- small: { color: colors.foregroundMuted, fontSize: 11, lineHeight: 15, fontVariant: ["tabular-nums" as const] },
23
- label: { color: colors.foreground, fontSize: 13, lineHeight: 18, fontWeight: "600" as const },
24
- });
18
+ /**
19
+ * The type scale. Desktop values are the long-standing ones; `compact` (phones) steps body and titles up for reading at
20
+ * arm's length and keeps hierarchy in weight and colour: one 600 line per block, supporting text muted. `ask` is the one
21
+ * line per pane you act on; `section` heads groups (sentence case on phones, small caps on desktop).
22
+ */
23
+ export const text = (colors: Colors, compact = false) => {
24
+ const cap = (n: number) => Platform.OS === "web" ? {} : { maxFontSizeMultiplier: n };
25
+ return {
26
+ headline: { color: colors.foreground, fontSize: compact ? 20 : 21, lineHeight: compact ? 26 : 29, fontWeight: "600" as const, letterSpacing: -0.2, ...cap(1.4) },
27
+ title: { color: colors.foreground, fontSize: compact ? 17 : 15, lineHeight: compact ? 23 : 21, fontWeight: "600" as const, ...cap(1.4) },
28
+ ask: { color: colors.foreground, fontSize: compact ? 16 : 15, lineHeight: compact ? 22 : 21, fontWeight: "600" as const, ...cap(1.4) },
29
+ body: { color: colors.foreground, fontSize: compact ? 14 : 13, lineHeight: compact ? 20 : 18, ...cap(1.4) },
30
+ meta: { color: colors.foregroundMuted, fontSize: 12, lineHeight: 17, fontVariant: ["tabular-nums" as const], ...cap(1.25) },
31
+ small: { color: colors.foregroundMuted, fontSize: 11, lineHeight: 15, fontVariant: ["tabular-nums" as const], ...cap(1.25) },
32
+ label: { color: colors.foreground, fontSize: compact ? 14 : 13, lineHeight: compact ? 20 : 18, fontWeight: "600" as const, ...cap(1.4) },
33
+ section: compact
34
+ ? { color: colors.foregroundMuted, fontSize: 13, lineHeight: 18, fontWeight: "600" as const, ...cap(1.25) }
35
+ : { color: colors.foregroundMuted, fontSize: 11, lineHeight: 15, fontWeight: "600" as const, letterSpacing: 0.5, textTransform: "uppercase" as const },
36
+ };
37
+ };
38
+
39
+ /** Spacing tokens. Phones get a 16 gutter, roomier rows and 44px controls; desktop keeps today's density. */
40
+ export const space = (compact = false) => compact
41
+ ? { gutter: 16, section: 16, stack: 6, rowV: 12, rowH: 16, card: 14, control: 44, row: 48 }
42
+ : { gutter: 12, section: 12, stack: 4, rowV: 9, rowH: 12, card: 12, control: 32, row: 32 };
43
+
44
+ /**
45
+ * Bottom clearance for anything that touches the screen's bottom edge on a phone (the composer dock, the undo bar,
46
+ * sheet footers). The plugin has no safe-area provider: web uses env() (0 unless the host sets viewport-fit=cover, so
47
+ * the max() still leaves 12), native uses the gesture-bar / home-indicator heights. Desktop gets nothing.
48
+ */
49
+ export function bottomInset(compact: boolean, extra = 0): ViewStyle {
50
+ if (!compact) return {};
51
+ if (Platform.OS === "web") return { paddingBottom: `max(${12 + extra}px, calc(env(safe-area-inset-bottom) + ${extra}px))` as unknown as number };
52
+ return { paddingBottom: (Platform.OS === "ios" ? 34 : 24) + extra };
53
+ }
54
+ /** The same clearance as a number, for absolutely positioned bars (web can't do env() in `bottom`, so it uses 12). */
55
+ export const bottomGap = (compact: boolean) => !compact || Platform.OS === "web" ? 12 : Platform.OS === "ios" ? 34 : 24;
25
56
 
26
57
  type ButtonKind = "primary" | "secondary" | "ghost" | "danger";
27
58
  /** One button vocabulary for the whole plugin: 32px on desktop with a hit slop, 44px on touch layouts. */
@@ -64,9 +95,9 @@ export function Card({ theme, icon, title, tone = "plain", count, right, childre
64
95
  const accent = tone === "attention" ? c.statusWarning : tone === "success" ? c.statusSuccess : null;
65
96
  return <View style={[{ marginHorizontal: compact ? 16 : 12, marginTop: 12, borderRadius: 8, overflow: "hidden", backgroundColor: c.surface0 },
66
97
  accent ? { borderWidth: 1, borderColor: withAlpha(accent, 0.7) } : raised(c), style]}>
67
- <View style={{ flexDirection: "row", alignItems: "center", gap: 7, paddingHorizontal: 12, paddingTop: 10, paddingBottom: 8 }}>
68
- <Icon name={icon} size={14} color={accent ?? c.foregroundMuted} />
69
- <Text accessibilityRole="header" style={{ color: accent ?? c.foreground, fontSize: 13, lineHeight: 18, fontWeight: "600" }}>{title}</Text>
98
+ <View style={{ flexDirection: "row", alignItems: "center", gap: compact ? 8 : 7, paddingHorizontal: compact ? 14 : 12, paddingTop: 10, paddingBottom: 8, minHeight: compact ? 44 : undefined }}>
99
+ <Icon name={icon} size={compact ? 16 : 14} color={accent ?? c.foregroundMuted} />
100
+ <Text accessibilityRole="header" style={{ color: accent ?? c.foreground, fontSize: compact ? 14 : 13, lineHeight: compact ? 20 : 18, fontWeight: "600" }}>{title}</Text>
70
101
  {count !== undefined && count !== "" && <Chip theme={theme} color={accent ?? c.foregroundMuted} label={String(count)} />}
71
102
  <View style={{ flex: 1 }} />
72
103
  {right}
@@ -99,19 +130,19 @@ export function Switch({ theme, label, value, onChange, disabled = false, access
99
130
  }
100
131
 
101
132
  /** A row inside a card: hairline on top, hover tint when pressable. */
102
- export function CardRow({ theme, onPress, accessibilityLabel, children, style, first = false }: { theme: Theme; onPress?: () => void; accessibilityLabel?: string; children: ReactNode; style?: StyleProp<ViewStyle>; first?: boolean }) {
133
+ export function CardRow({ theme, onPress, accessibilityLabel, children, style, first = false, compact = false }: { theme: Theme; onPress?: () => void; accessibilityLabel?: string; children: ReactNode; style?: StyleProp<ViewStyle>; first?: boolean; compact?: boolean }) {
103
134
  const c = theme.colors;
104
- const base: ViewStyle = { paddingHorizontal: 12, paddingVertical: 9, borderTopWidth: first ? 0 : 1, borderTopColor: c.border };
135
+ const base: ViewStyle = { paddingHorizontal: compact ? 14 : 12, paddingVertical: compact ? 12 : 9, borderTopWidth: first ? 0 : 1, borderTopColor: c.border };
105
136
  if (!onPress) return <View style={[base, style]}>{children}</View>;
106
137
  return <Pressable accessibilityRole="button" accessibilityLabel={accessibilityLabel} onPress={onPress}
107
138
  style={state => [base, { backgroundColor: state.pressed ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" }, style]}>{children}</Pressable>;
108
139
  }
109
140
 
110
141
  /** The fold row that hides finished items: "3 merged · Show". */
111
- export function FoldRow({ theme, label, open, onPress, icon, iconColor }: { theme: Theme; label: string; open: boolean; onPress: () => void; icon: string; iconColor: string }) {
142
+ export function FoldRow({ theme, label, open, onPress, icon, iconColor, compact = false }: { theme: Theme; label: string; open: boolean; onPress: () => void; icon: string; iconColor: string; compact?: boolean }) {
112
143
  const c = theme.colors;
113
144
  return <Pressable accessibilityRole="button" aria-expanded={open} accessibilityState={{ expanded: open }} accessibilityLabel={`${open ? "Hide" : "Show"} ${label}`} onPress={onPress}
114
- style={state => ({ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: 12, paddingVertical: 8, borderTopWidth: 1, borderTopColor: c.border, backgroundColor: state.pressed ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
145
+ style={state => ({ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: compact ? 14 : 12, paddingVertical: 8, minHeight: compact ? 48 : undefined, borderTopWidth: 1, borderTopColor: c.border, backgroundColor: state.pressed ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
115
146
  <View style={{ width: 16, alignItems: "center" }}><Icon name={icon} size={13} color={iconColor} /></View>
116
147
  <Text style={{ flex: 1, color: c.foregroundMuted, fontSize: 12, lineHeight: 17, fontWeight: "600", fontVariant: ["tabular-nums"] }}>{label}</Text>
117
148
  <Icon name={open ? "ChevronUp" : "ChevronDown"} size={14} color={c.foregroundMuted} />
package/client/large.tsx CHANGED
@@ -1,11 +1,11 @@
1
1
  import { useEffect } from "react";
2
2
  import { Platform, Text, View } from "react-native";
3
- import { useRpc, type PluginScreenProps } from "@getpaseo/plugin/client";
4
- import { useQuery } from "@tanstack/react-query";
5
- import { getRpc } from "../shared/contracts";
3
+ import { type PluginScreenProps } from "@getpaseo/plugin/client";
4
+ import { useWorkspace } from "./workspace-data";
5
+ import type { LiveStore } from "./live";
6
6
  import { Button, Card, CardRow, errorText, text } from "./kit";
7
7
  import { Skeleton } from "./motion";
8
- import { PanelTop, WorkspaceView, useSessionFolds, workspaceKey, type PanelLinks } from "./panel";
8
+ import { PanelTop, WorkspaceView, useSessionFolds, type PanelLinks } from "./panel";
9
9
 
10
10
  export const LARGE_SCREEN = "follow-through-workspace";
11
11
 
@@ -13,12 +13,11 @@ export const LARGE_SCREEN = "follow-through-workspace";
13
13
  * The panel opened as a Paseo screen: the host supplies the page, header and close button, and the
14
14
  * layout switches to two columns. Collapse (or Esc) returns to the workspace, where the panel still is.
15
15
  */
16
- export function FollowLarge(props: PluginScreenProps & PanelLinks) {
16
+ export function FollowLarge(props: PluginScreenProps & PanelLinks & { live?: LiveStore }) {
17
17
  const { theme, layout, params, navigation } = props;
18
18
  const workspaceId = params.workspaceId ?? "";
19
19
  const c = theme.colors;
20
- const read = useRpc(getRpc);
21
- const query = useQuery({ queryKey: workspaceKey(workspaceId), queryFn: () => read({ workspaceId }), refetchInterval: 5000, enabled: !!workspaceId });
20
+ const query = useWorkspace(props.live, workspaceId);
22
21
  const folds = useSessionFolds(workspaceId);
23
22
  const back = () => navigation?.openWorkspace({ workspaceId });
24
23
 
@@ -39,10 +38,10 @@ export function FollowLarge(props: PluginScreenProps & PanelLinks) {
39
38
  return () => doc.removeEventListener("keydown", onKey);
40
39
  }, [navigation, workspaceId]);
41
40
 
42
- if (query.isPending && workspaceId) return <View accessibilityLabel="Loading Follow-up" style={{ flex: 1, backgroundColor: c.surface0, padding: 24, gap: 12, maxWidth: 1240, width: "100%", alignSelf: "center" }}>
41
+ if (query.pending && workspaceId) return <View accessibilityLabel="Loading Follow-up" style={{ flex: 1, backgroundColor: c.surface0, padding: 24, gap: 12, maxWidth: 1240, width: "100%", alignSelf: "center" }}>
43
42
  <Skeleton width="30%" height={16} color={c.surface2} /><Skeleton width="60%" height={10} color={c.surface2} /><Skeleton width="100%" height={6} color={c.surface2} radius={3} />
44
43
  </View>;
45
- const w = query.data?.workspace;
44
+ const w = query.workspace;
46
45
  if (!w) return <View style={{ flex: 1, backgroundColor: c.surface0, padding: layout.compact ? 16 : 24 }}>
47
46
  <Card theme={theme} compact={layout.compact} icon="GitPullRequest" title="Nothing to show here" style={{ marginHorizontal: 0, marginTop: 0, maxWidth: 520 }}>
48
47
  <CardRow theme={theme}>
@@ -52,7 +51,7 @@ export function FollowLarge(props: PluginScreenProps & PanelLinks) {
52
51
  </Card>
53
52
  </View>;
54
53
  return <WorkspaceView theme={theme} layout={layout} host={props.host} navigation={navigation} workspace={w} large
55
- loadError={query.error ? "Refresh failed. Showing the last saved state." : query.data?.error ?? null}
54
+ loadError={query.error ? "Refresh failed. Showing the last saved state." : query.loadError}
56
55
  openSettings={props.openSettings} openOverview={props.openOverview} folds={folds}
57
56
  top={<PanelTop theme={theme} compact={layout.compact} openOverview={props.openOverview} />}
58
57
  resize={navigation ? { icon: "Minimize2", label: "Back to the workspace (Esc)", onPress: back } : null} />;
package/client/live.tsx CHANGED
@@ -8,11 +8,10 @@ import { needsYou } from "../shared/attention";
8
8
  import { useSidebarViewActive } from "./inbox";
9
9
  import { homeCounts } from "../shared/home";
10
10
  import { useHomeModel, type HomeSources } from "./home-data";
11
- import { onVisible, pollDelay } from "./visibility";
11
+ import { onVisible, whileVisible } from "./visibility";
12
12
 
13
- const POLL_MS = 8_000;
14
- /** While the app is hidden. */
15
- const HIDDEN_POLL_MS = 60_000;
13
+ /** The backstop poll; agent changes `nudge` it sooner (1.4.0). Nothing while the app is hidden. */
14
+ const POLL_MS = 15_000;
16
15
 
17
16
  /** One shared poll of tracked workspaces for the pills, header-button dots and the sidebar count. */
18
17
  export function createLiveStore(client: PluginClientContext) {
@@ -22,6 +21,7 @@ export function createLiveStore(client: PluginClientContext) {
22
21
  let version = 0;
23
22
  const listeners = new Set<() => void>();
24
23
  let timer: ReturnType<typeof setTimeout> | null = null;
24
+ let nudged: ReturnType<typeof setTimeout> | null = null;
25
25
  let stopped = false;
26
26
  /** The worker's list revision this store holds; each poll asks only for what changed since (1.3.0-beta.4). */
27
27
  let revision: number | undefined;
@@ -41,7 +41,7 @@ export function createLiveStore(client: PluginClientContext) {
41
41
  archived = [...all.values()].filter(w => w.archived);
42
42
  emit();
43
43
  } catch { /* Keep the last answer through restarts and disconnects. */ }
44
- finally { if (!stopped) timer = setTimeout(() => void poll(), pollDelay(POLL_MS, HIDDEN_POLL_MS)); }
44
+ finally { if (!stopped) timer = whileVisible(POLL_MS, () => void poll()); }
45
45
  };
46
46
  const offVisible = onVisible(() => { if (timer) clearTimeout(timer); void poll(); });
47
47
  void poll();
@@ -52,7 +52,9 @@ export function createLiveStore(client: PluginClientContext) {
52
52
  all: () => [...workspaces.values()],
53
53
  archived: () => archived,
54
54
  refresh: () => { if (timer) clearTimeout(timer); void poll(); },
55
- stop() { stopped = true; offVisible(); if (timer) clearTimeout(timer); listeners.clear(); },
55
+ /** Paseo reported an agent change: one diff read soon, however many updates arrive together. */
56
+ nudge: () => { if (nudged || stopped) return; nudged = setTimeout(() => { nudged = null; if (timer) clearTimeout(timer); void poll(); }, 1_500); },
57
+ stop() { stopped = true; offVisible(); if (timer) clearTimeout(timer); if (nudged) clearTimeout(nudged); listeners.clear(); },
56
58
  };
57
59
  }
58
60
  export type LiveStore = ReturnType<typeof createLiveStore>;
@@ -4,9 +4,10 @@ import { useRpc } from "@getpaseo/plugin/client";
4
4
  import { useMutation, useQueryClient } from "@tanstack/react-query";
5
5
  import { checkPrActionRpc, controlRpc, sendRpc } from "../shared/contracts";
6
6
  import { needsYou, shortRefs, type NeedItem } from "../shared/attention";
7
+ import { sameText } from "../shared/home";
7
8
  import type { Workspace } from "../shared/model";
8
9
  import { Button, Card, CardRow, errorText, text, type Theme } from "./kit";
9
- import type { Colors } from "./theme";
10
+ import { withAlpha, type Colors } from "./theme";
10
11
  import { meanwhile } from "./questions";
11
12
  import { useReviewerSettings } from "./reviewers";
12
13
 
@@ -35,8 +36,8 @@ export type NeedActions = {
35
36
  };
36
37
 
37
38
  /** The developer's queue: one row per decision, each with its single action inline. */
38
- export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date.now(), flush = false, skip = [] }: { workspace: Workspace; theme: Theme; compact: boolean; actions: NeedActions; now?: number; flush?: boolean; skip?: NeedItem["kind"][] }) {
39
- const c = theme.colors; const t = text(c);
39
+ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date.now(), flush = false, skip = [], feature = false }: { workspace: Workspace; theme: Theme; compact: boolean; actions: NeedActions; now?: number; flush?: boolean; skip?: NeedItem["kind"][]; /** Phones' detail pane: the first question is the screen's ask, an attention card with a full-width Answer. */ feature?: boolean }) {
40
+ const c = theme.colors; const t = text(c, compact);
40
41
  useReviewerSettings();
41
42
  const toast = useToast();
42
43
  const cache = useQueryClient();
@@ -77,16 +78,42 @@ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date
77
78
  case "reviewers": return actions.openPr && <Button theme={theme} compact={compact} icon="UserPlus" title="Add reviewers" onPress={() => actions.openPr!(item.prKey, "reviewers")} />;
78
79
  }
79
80
  };
80
- return <View>
81
- {items.map((item, index) => {
81
+ const featured = feature && items[0]?.kind === "question" ? items[0] as Extract<NeedItem, { kind: "question" }> : null;
82
+ return <View style={featured ? { gap: 12 } : undefined}>
83
+ {featured && <View accessibilityRole="summary" style={{ borderRadius: 10, borderWidth: 1, borderColor: withAlpha(c.statusWarning, 0.7), padding: 14, gap: 6 }}>
84
+ <View style={{ flexDirection: "row", gap: 10 }}>
85
+ <View style={{ paddingTop: 3 }}><Icon name={glyph(featured, c).name} size={16} color={c.statusWarning} /></View>
86
+ <View style={{ flex: 1, minWidth: 0, gap: 6 }}>
87
+ <Text accessibilityRole="header" style={t.ask}>{featured.title}</Text>
88
+ {!!featured.detail && !sameText(featured.detail, featured.title.replace(/^Q\d+ · /, "")) && <Text numberOfLines={2} style={[t.body, { color: c.foregroundMuted }]}>{featured.detail}</Text>}
89
+ <QuestionState workspace={w} questionId={featured.questionId} theme={theme} />
90
+ </View>
91
+ </View>
92
+ {actions.openQuestion && <View style={{ marginTop: 6 }}><Button theme={theme} compact grow kind="primary" icon="MessageCircleReply" title={`Answer ${featured.questionId}`} accessibilityLabel={`Answer ${featured.title}`} onPress={() => actions.openQuestion!(featured.questionId)} /></View>}
93
+ </View>}
94
+ <View>
95
+ {items.filter(item => item !== featured).map((item, index) => {
82
96
  const g = glyph(item, c);
83
97
  const button = action(item);
84
- return <CardRow key={item.key} theme={theme} first={index === 0 && flush} style={flush ? { paddingHorizontal: 0 } : undefined}>
98
+ // Phones: the action sits at the row's right edge so rows never grow a second line of controls. A send batch
99
+ // (the primary, with its task list) and Retry's pair keep their buttons full width under the row.
100
+ const inline = compact && button && item.kind !== "send" && !(item.kind === "retry" && !item.exhausted);
101
+ if (inline) return <CardRow key={item.key} theme={theme} compact first={index === 0 && flush} style={flush ? { paddingHorizontal: 0 } : undefined}>
102
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
103
+ <Icon name={g.name} size={16} color={g.color} />
104
+ <View style={{ flex: 1, minWidth: 0, gap: 2 }}>
105
+ <Text numberOfLines={2} style={t.label}>{item.title}</Text>
106
+ {"detail" in item && !!item.detail && !sameText(item.detail, item.title.replace(/^Q\d+ · /, "")) && <Text numberOfLines={1} style={t.meta}>{item.detail}</Text>}
107
+ </View>
108
+ {button}
109
+ </View>
110
+ </CardRow>;
111
+ return <CardRow key={item.key} theme={theme} compact={compact} first={index === 0 && flush} style={flush ? { paddingHorizontal: 0 } : undefined}>
85
112
  <View style={{ flexDirection: "row", gap: 9 }}>
86
113
  <View style={{ paddingTop: 2 }}><Icon name={g.name} size={14} color={g.color} /></View>
87
114
  <View style={{ flex: 1, minWidth: 0, gap: 3 }}>
88
- <Text style={t.body}>{item.title}</Text>
89
- {"detail" in item && !!item.detail && <Text numberOfLines={item.kind === "question" ? 2 : 3} style={t.meta}>{item.detail}</Text>}
115
+ <Text style={compact ? t.label : t.body}>{item.title}</Text>
116
+ {"detail" in item && !!item.detail && !sameText(item.detail, item.title.replace(/^Q\d+ · /, "")) && <Text numberOfLines={item.kind === "question" ? 2 : 3} style={t.meta}>{item.detail}</Text>}
90
117
  {item.kind === "question" && <QuestionState workspace={w} questionId={item.questionId} theme={theme} />}
91
118
  {item.kind === "send" && <View style={{ gap: 2 }}>
92
119
  {item.tasks.slice(0, 4).map((task, i) => <Text key={i} numberOfLines={2} style={t.meta}><Text style={{ fontVariant: ["tabular-nums"] }}>{`${i + 1}. `}</Text>{shortRefs(task, w)}</Text>)}
@@ -100,6 +127,7 @@ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date
100
127
  </View>
101
128
  </CardRow>;
102
129
  })}
130
+ </View>
103
131
  </View>;
104
132
  }
105
133