paseo-follow-up 2.5.0 → 2.6.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.
Files changed (87) hide show
  1. package/OVERVIEW.md +1 -1
  2. package/README.md +0 -1
  3. package/client/brief-since.tsx +4 -3
  4. package/client/catch-up.tsx +56 -15
  5. package/client/header.tsx +5 -3
  6. package/client/home-data.ts +3 -1
  7. package/client/home-list.tsx +19 -11
  8. package/client/home-view.ts +8 -1
  9. package/client/home.tsx +29 -10
  10. package/client/keys.ts +2 -0
  11. package/client/kit.tsx +5 -2
  12. package/client/large.tsx +5 -3
  13. package/client/live.tsx +4 -3
  14. package/client/merge-button.tsx +3 -2
  15. package/client/messages.tsx +5 -1
  16. package/client/more-context.tsx +17 -4
  17. package/client/morning-brief-settings.tsx +5 -4
  18. package/client/needs-you.tsx +5 -4
  19. package/client/new-settings.tsx +8 -7
  20. package/client/now-lines.tsx +60 -0
  21. package/client/onboarding.tsx +55 -123
  22. package/client/paged-list.tsx +115 -0
  23. package/client/panel.tsx +24 -8
  24. package/client/pr-stats-settings.tsx +3 -2
  25. package/client/pr-stats.tsx +10 -10
  26. package/client/questions.tsx +63 -40
  27. package/client/release-notes.tsx +10 -9
  28. package/client/reviewers.tsx +8 -3
  29. package/client/row-open.ts +28 -0
  30. package/client/section-search.tsx +5 -3
  31. package/client/settings.tsx +11 -8
  32. package/client/setup-dialog.tsx +168 -0
  33. package/client/setup-gate.tsx +69 -0
  34. package/client/setup-ui.ts +27 -0
  35. package/client/shipping.tsx +5 -4
  36. package/client/stacks.tsx +11 -3
  37. package/client/tasks.tsx +5 -1
  38. package/client/your-questions.tsx +375 -0
  39. package/index.client.tsx +11 -3
  40. package/index.server.ts +162 -32
  41. package/package.json +1 -1
  42. package/server/agent-actions.ts +23 -14
  43. package/server/agent-hook.mjs +7 -5
  44. package/server/agent-parity.ts +21 -6
  45. package/server/ai-jobs.ts +26 -5
  46. package/server/brief-timeline.ts +47 -0
  47. package/server/context-requests.ts +90 -21
  48. package/server/directory.ts +6 -0
  49. package/server/discovery.ts +2 -0
  50. package/server/engine.ts +3 -0
  51. package/server/hook-source.ts +7 -5
  52. package/server/inbox-classifier.ts +17 -0
  53. package/server/inbox.ts +9 -3
  54. package/server/job-agent.ts +13 -2
  55. package/server/mcp-source.ts +23 -15
  56. package/server/mcp.mjs +23 -15
  57. package/server/obligations.ts +4 -1
  58. package/server/session-prompt.ts +30 -3
  59. package/server/turn-end.ts +133 -0
  60. package/server/wait-jobs.ts +18 -2
  61. package/server/wait.ts +17 -12
  62. package/shared/activity.ts +2 -1
  63. package/shared/agent-settings.ts +9 -8
  64. package/shared/catch-up.ts +65 -20
  65. package/shared/chat.ts +2 -2
  66. package/shared/compass.ts +5 -4
  67. package/shared/contracts.ts +52 -8
  68. package/shared/history.ts +160 -0
  69. package/shared/home-keys.ts +1 -0
  70. package/shared/home.ts +54 -8
  71. package/shared/job-rows.ts +2 -2
  72. package/shared/list.ts +4 -1
  73. package/shared/message-sender.ts +2 -0
  74. package/shared/model.ts +8 -0
  75. package/shared/new-name.ts +4 -1
  76. package/shared/now.ts +228 -0
  77. package/shared/onboarding.ts +17 -13
  78. package/shared/paged.ts +96 -0
  79. package/shared/provider-support.ts +83 -34
  80. package/shared/recommend.ts +1 -1
  81. package/shared/settings-nav.ts +3 -1
  82. package/shared/setup-popup.ts +28 -0
  83. package/shared/sort.ts +8 -1
  84. package/shared/status.ts +3 -1
  85. package/shared/wait.ts +2 -2
  86. package/shared/your-questions.ts +133 -0
  87. package/skills/follow-up/SKILL.md +1 -1
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
2
+ import { PagedRows } from "./paged-list";
2
3
  import { ActivityIndicator, Platform, View } from "react-native";
3
4
  import * as PluginClient from "@getpaseo/plugin/client";
4
5
  import { useRpc } from "@getpaseo/plugin/client";
@@ -239,7 +240,7 @@ function DesktopTable({ theme, rows, max, sort, onSort, onPerson }: { theme: The
239
240
  </Pressable>;
240
241
  })}
241
242
  </View>
242
- {rows.map((p, i) => <Pressable key={p.login} accessibilityRole="button" accessibilityLabel={`${p.login}: ${personWords(p)}. Opens their PRs and reviews.`} onPress={() => onPerson(p.login)}
243
+ <PagedRows items={rows} theme={theme} compact={false} noun="people" row={(p, i) => <Pressable key={p.login} accessibilityRole="button" accessibilityLabel={`${p.login}: ${personWords(p)}. Opens their PRs and reviews.`} onPress={() => onPerson(p.login)}
243
244
  style={({ hovered, pressed }: { hovered?: boolean; pressed: boolean }) => ({ flexDirection: "row", alignItems: "center", paddingHorizontal: 16, minHeight: 44, borderTopWidth: i ? 1 : 0, borderTopColor: c.border, backgroundColor: pressed ? c.surface2 : hovered ? withAlpha(c.foreground, 0.03) : "transparent" })}>
244
245
  <View style={{ flex: 1.2, minWidth: 140, flexDirection: "row", alignItems: "center", gap: 10 }}>
245
246
  <Avatar theme={theme} login={p.login} />
@@ -252,7 +253,7 @@ function DesktopTable({ theme, rows, max, sort, onSort, onPerson }: { theme: The
252
253
  <Hover text={cell.hover}><Text style={[t.body, { minWidth: 56, textAlign: "right", fontVariant: ["tabular-nums"], color: cell.value === null ? c.foregroundMuted : c.foreground }]}>{cell.text}</Text></Hover>
253
254
  </View>;
254
255
  })}
255
- </Pressable>)}
256
+ </Pressable>} resetKey={sort} />
256
257
  </View>;
257
258
  }
258
259
 
@@ -269,7 +270,7 @@ function PhoneTable({ theme, rows, max, sort, onSort, onPerson }: { theme: Theme
269
270
  <Text style={t.label}>{col.long}</Text><Icon name="ChevronDown" size={14} color={c.foregroundMuted} />
270
271
  </Pressable>
271
272
  </View>
272
- {rows.map((p, i) => {
273
+ <PagedRows items={rows} theme={theme} compact noun="people" resetKey={sort} row={(p, i) => {
273
274
  const cell = cellText(p, sort);
274
275
  return <Pressable key={p.login} accessibilityRole="button" accessibilityLabel={`${p.login}: ${personWords(p)}. Opens their PRs and reviews.`} onPress={() => onPerson(p.login)}
275
276
  style={({ pressed }: { pressed: boolean }) => ({ flexDirection: "row", alignItems: "center", gap: 12, paddingLeft: 16, paddingRight: 10, paddingVertical: 12, borderTopWidth: i ? 1 : 0, borderTopColor: c.border, backgroundColor: pressed ? c.surface2 : "transparent" })}>
@@ -284,7 +285,7 @@ function PhoneTable({ theme, rows, max, sort, onSort, onPerson }: { theme: Theme
284
285
  </View>
285
286
  <Icon name="ChevronRight" size={16} color={c.foregroundMuted} />
286
287
  </Pressable>;
287
- })}
288
+ }} />
288
289
  {open && <Modal title="Sort by" open onOpenChange={next => { if (!next) setOpen(false); }}>
289
290
  <Modal.Content contentContainerStyle={{ padding: 8 }}>
290
291
  {COLUMNS.map(x => <Pressable key={x.key} accessibilityRole="radio" accessibilityState={{ checked: x.key === sort }} onPress={() => { setOpen(false); onSort(x.key); }}
@@ -325,8 +326,8 @@ export function PersonView({ theme, compact, out, login }: { theme: Theme; compa
325
326
  const d = out.person?.login === login ? out.person : null;
326
327
  const row = d?.row ?? out.model?.people.find(p => p.login === login) ?? null;
327
328
  const [all, setAll] = useState(false);
328
- const prs = d ? (all ? d.prs : d.prs.slice(0, 8)) : [];
329
- const reviewed = d ? (all ? d.reviewed : d.reviewed.slice(0, 8)) : [];
329
+ // Each list folds to its first 8; Show all opens pages, never every PR of a 25,000-record repository (client/paged-list.tsx).
330
+ const fold = { open: all, onToggle: () => setAll(v => !v), preview: 8, theme, compact } as const;
330
331
  const wait = row ? medianCell(row.wait) : null, turn = row ? medianCell(row.turnaround) : null;
331
332
  return <View style={{ gap: 14 }}>
332
333
  {row && <View style={{ gap: 4 }}>
@@ -337,13 +338,12 @@ export function PersonView({ theme, compact, out, login }: { theme: Theme; compa
337
338
  {!d && <ActivityIndicator color={c.foregroundMuted} style={{ alignSelf: "flex-start" }} />}
338
339
  {d && <>
339
340
  <Text style={t.section}>{`Opened by ${login}`}</Text>
340
- {prs.length ? prs.map(p => <PrLine key={p.number} theme={theme} compact={compact} number={p.number} url={p.url} title={p.title}
341
- line={p.waiting ? `waiting ${p.wait === null ? "" : durationWords(p.wait)} for a first review` : [p.wait === null ? "no review yet" : `first review ${durationWords(p.wait)}${p.firstResponder ? ` by ${p.firstResponder}` : ""}`, p.merged ? "merged" : p.state === "C" ? "closed" : "open", p.size].join(" · ")} />)
341
+ {d.prs.length ? <PagedRows items={d.prs} {...fold} noun="PRs" row={p => <PrLine key={p.number} theme={theme} compact={compact} number={p.number} url={p.url} title={p.title}
342
+ line={p.waiting ? `waiting ${p.wait === null ? "" : durationWords(p.wait)} for a first review` : [p.wait === null ? "no review yet" : `first review ${durationWords(p.wait)}${p.firstResponder ? ` by ${p.firstResponder}` : ""}`, p.merged ? "merged" : p.state === "C" ? "closed" : "open", p.size].join(" · ")} />} />
342
343
  : <Text style={t.meta}>None in this period.</Text>}
343
344
  <Text style={t.section}>{`Reviews by ${login}`}</Text>
344
- {reviewed.length ? reviewed.map(r => <PrLine key={`r${r.number}`} theme={theme} compact={compact} number={r.number} url={r.url} title={r.title} line={`${r.author ? `by ${r.author} · ` : ""}${new Date(r.at * 1000).toLocaleDateString("en-US", { month: "short", day: "numeric", timeZone: out.timeZone })}`} />)
345
+ {d.reviewed.length ? <PagedRows items={d.reviewed} {...fold} noun="reviews" row={r => <PrLine key={`r${r.number}`} theme={theme} compact={compact} number={r.number} url={r.url} title={r.title} line={`${r.author ? `by ${r.author} · ` : ""}${new Date(r.at * 1000).toLocaleDateString("en-US", { month: "short", day: "numeric", timeZone: out.timeZone })}`} />} />
345
346
  : <Text style={t.meta}>None in this period.</Text>}
346
- {!all && (d.prs.length > 8 || d.reviewed.length > 8) && <Button theme={theme} compact={compact} kind="ghost" title={`Show all (${d.prs.length} PRs, ${d.reviewed.length} reviews)`} onPress={() => setAll(true)} />}
347
347
  </>}
348
348
  </View>;
349
349
  }
@@ -1,13 +1,13 @@
1
1
  // The question dialog and its answer form. The layout of options with a recommendation, the
2
2
  // "what the agent does meanwhile" line and Copy are adapted from Progress
3
3
  // (@stevecastaneda/paseo-progress, MIT, © 2026 Steve Castaneda); see THIRD_PARTY_NOTICES.md.
4
- import { useEffect, useRef, useState, type ReactNode } from "react";
4
+ import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
5
5
  import { View } from "react-native";
6
6
  import { Pressable, Text, copyable } from "./text";
7
7
  import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
8
8
  import { Icon, Modal, ScrollView, TextInput, copyText, useToast } from "@getpaseo/plugin/client/ui";
9
- import { useMutation, useQueryClient } from "@tanstack/react-query";
10
- import { answerQuestionRpc } from "../shared/contracts";
9
+ import { keepPreviousData, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
10
+ import { activityRpc, answerQuestionRpc } from "../shared/contracts";
11
11
  import { ImageField, useImageAttachments } from "./image-attach";
12
12
  import type { Workspace } from "../shared/model";
13
13
  import type { ListQuestion, ListWorkspace } from "../shared/list";
@@ -15,7 +15,10 @@ import { OTHER, OTHER_LABEL, closedLine, isDismissed, answerDraft, answerHeading
15
15
  import { ago } from "../shared/attention";
16
16
  import { RETRYING_DETAIL, deliveryStatus, receiptNote } from "../shared/queue";
17
17
  import { mootNote, sentence } from "../shared/errors";
18
- import { activity, activityQuestions, type ActivityTone } from "../shared/activity";
18
+ import { type ActivityTone } from "../shared/activity";
19
+ import { activityPage, type ActivityTab } from "../shared/history";
20
+ import { PAGE, pageInfo } from "../shared/paged";
21
+ import { Pager } from "./paged-list";
19
22
  import { Button, Card, CardRow, Chip, FoldRow, IconButton, SubmitScope, errorText, text, type Theme } from "./kit";
20
23
  import { Spinner } from "./motion";
21
24
  import { DictationField, useCaret, type FieldPad } from "./dictation";
@@ -23,7 +26,7 @@ import { NoteLink } from "./brief";
23
26
  import { QuestionMoreContext } from "./more-context";
24
27
  import { PRIMARY_FORM } from "./dock";
25
28
  import { mergedColor, tint, withAlpha, type Colors } from "./theme";
26
- import { overviewKey, workspaceKey } from "./keys";
29
+ import { activityKey, overviewKey, workspaceKey } from "./keys";
27
30
  import { PrLinksProvider, RichText } from "./rich-text";
28
31
  import { prLinksByNumber } from "../shared/presentation";
29
32
  import { notice, openQuestion, runAction } from "./toasts";
@@ -31,8 +34,7 @@ import { DismissX, useDismiss } from "./dismiss";
31
34
  import { putInChatOrCopy } from "../shared/put-in-chat";
32
35
  import { useChatComposer } from "./put-in-chat";
33
36
  import { Marked, NoMatchRow, useSectionSearch } from "./section-search";
34
- import { activityFields, questionFields, questionStatus } from "../shared/section-search";
35
- import type { Activity } from "../shared/activity";
37
+ import { questionStatus } from "../shared/section-search";
36
38
  import { answerImagesKey, clearPendingAnswer, failPendingAnswer, pendingKey, setPendingAnswer, usePendingAnswer, usePendingAnswers, type PendingAnswer } from "./pending-answers";
37
39
 
38
40
  const who = (w: Pick<ListWorkspace, "mainAgentId">, agentId: string | null) => !agentId || agentId === w.mainAgentId ? "the main agent" : "a root session";
@@ -416,9 +418,11 @@ function hostOf(url: string): string {
416
418
  }
417
419
 
418
420
  /** The question dialog: a sheet on phones, a dialog on desktop. */
419
- export function QuestionSheet({ workspace: w, questionId, theme, compact, onClose, openAgent }: { workspace: Workspace; questionId: string | null; theme: Theme; compact: boolean; onClose: () => void; openAgent?: (agentId: string) => void }) {
421
+ export function QuestionSheet({ workspace: w, questionId, theme, compact, onClose, openAgent, fallback }: { workspace: Workspace; questionId: string | null; theme: Theme; compact: boolean; onClose: () => void; openAgent?: (agentId: string) => void;
422
+ /** The question as an Activity page carried it: an old settled one follow.get no longer sends (shared/history.ts). */
423
+ fallback?: Question | null }) {
420
424
  const c = theme.colors;
421
- const q = questionId ? w.questions.find(x => x.id === questionId) ?? null : null;
425
+ const q = questionId ? w.questions.find(x => x.id === questionId) ?? (fallback?.id === questionId ? fallback : null) : null;
422
426
  const color = !q ? c.foregroundMuted : q.answer ? c.statusSuccess : q.closed ? c.foregroundMuted : c.statusWarning;
423
427
  return <Modal title={q ? `${q.id} · ${q.title}` : "Question"} icon={<Icon name={q?.answer ? "MessageCircleReply" : "MessageCircleQuestion"} size={18} color={color} />} open={!!q} onOpenChange={next => { if (!next) onClose(); }}>
424
428
  <Modal.Content contentContainerStyle={{ padding: compact ? 16 : 20 }}>
@@ -459,49 +463,69 @@ export function QuestionStepper({ workspace: w, theme, compact, openAgent, onAns
459
463
 
460
464
  const toneColor = (c: Colors, tone: ActivityTone) => tone === "merged" ? mergedColor(c) : tone === "success" ? c.statusSuccess : tone === "warning" ? c.statusWarning : tone === "danger" ? c.statusDanger : c.foregroundMuted;
461
465
 
462
- /** The workspace's log: a timeline of what happened, and every question under its ref. */
463
- export function ActivityCard({ workspace: w, theme, compact, now, open, toggle, onOpenQuestion }: { workspace: Workspace; theme: Theme; compact: boolean; now: number; open: (key: string) => boolean; toggle: (key: string) => void; onOpenQuestion: (id: string) => void }) {
466
+ /**
467
+ * The workspace's log: a timeline of what happened, and every question under its ref. Paged (client/paged-list.tsx):
468
+ * folded it shows the newest few, "Show all N" opens pages of PAGE.size, and a search finds across every page. Its rows
469
+ * come a page at a time from follow.activity (the worker holds the whole history; follow.get carries only the newest,
470
+ * shared/history.ts), with the panel's own copy drawn until the first page answers.
471
+ */
472
+ export function ActivityCard({ workspace: w, theme, compact, now, open, toggle, onOpenQuestion }: { workspace: Workspace; theme: Theme; compact: boolean; now: number; open: (key: string) => boolean; toggle: (key: string) => void; onOpenQuestion: (id: string, question?: Question) => void }) {
464
473
  const c = theme.colors; const t = text(c);
465
- const rows = activity(w);
466
- const questions = activityQuestions(w.questions).sort((a, b) => Number(isOpen(b)) - Number(isOpen(a)) || Number(b.id.slice(1)) - Number(a.id.slice(1)));
467
- const [tab, setTab] = useState<"timeline" | "questions">("timeline");
468
- // Activity searches both tabs at once; each tab chip then counts its own matches.
469
- const search = useSectionSearch<Activity | Question>(w.id, "activity", { theme, compact, items: [...rows, ...questions], fields: x => "askedAt" in x ? questionFields(x) : activityFields(x) });
470
- const hits = search.hits;
471
- if (!rows.length && !questions.length) return null;
474
+ const [tab, setTab] = useState<ActivityTab>("timeline");
475
+ const [page, setPage] = useState({ key: "", at: 0 });
472
476
  const all = open("activity");
473
- const LIMIT = 5;
474
- const found = { timeline: hits ? rows.filter(r => hits.has(r)) : rows, questions: hits ? questions.filter(q => hits.has(q)) : questions };
475
- const tabButton = (id: "timeline" | "questions", label: string, count?: number) => {
477
+ const read = useRpc(activityRpc);
478
+ const [remote, setRemote] = useState<{ matches: number; total: number } | null>(null);
479
+ // Activity searches both tabs at once on the worker; each tab chip then counts its own matches.
480
+ const search = useSectionSearch<never>(w.id, "activity", { theme, compact, items: [], fields: () => [], remote });
481
+ const query = search.query?.trim() ?? "";
482
+ const searching = !!query;
483
+ const paged = all || searching;
484
+ const key = `${tab}|${query}|${paged}`;
485
+ const at = page.key === key ? page.at : 0;
486
+ const limit = paged ? PAGE.size : PAGE.preview;
487
+ const input = { workspaceId: w.id, tab, ...(query ? { query } : {}), offset: at * limit, limit };
488
+ const local = useMemo(() => ({ ...activityPage(w, input), error: null }), [w, tab, query, at, limit]); // eslint-disable-line react-hooks/exhaustive-deps
489
+ const reply = useQuery({ queryKey: activityKey(w.id, w.updatedAt, tab, query, at * limit, limit), queryFn: () => read(input), placeholderData: keepPreviousData, staleTime: 15_000, refetchOnWindowFocus: false });
490
+ // Until the worker answers this workspace's first page, the panel's own (bounded) copy draws it.
491
+ const d = reply.data && !reply.data.error && reply.data.tab === tab ? reply.data : local;
492
+ const counts = d.counts;
493
+ useEffect(() => { const next = searching ? { matches: counts.timeline + counts.questions, total: d.all } : null; setRemote(r => r?.matches === next?.matches && r?.total === next?.total ? r : next); }, [searching, counts.timeline, counts.questions, d.all]);
494
+ const info = pageInfo(d.total, at, limit);
495
+ if (!d.all && !searching) return null;
496
+ const hasQuestions = searching ? counts.questions > 0 || counts.timeline > 0 : d.counts.questions > 0;
497
+ const tabButton = (id: ActivityTab, label: string, count?: number) => {
476
498
  const selected = tab === id;
477
499
  return <Pressable key={id} accessibilityRole="tab" aria-selected={selected} accessibilityState={{ selected }} accessibilityLabel={count !== undefined ? `${label}, ${count}` : label} onPress={() => setTab(id)} hitSlop={4}
478
- style={state => ({ flexDirection: "row", alignItems: "center", gap: 5, minHeight: compact ? 36 : 24, paddingHorizontal: 9, borderRadius: 999, backgroundColor: selected ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
500
+ style={state => ({ flexDirection: "row", alignItems: "center", gap: 5, minHeight: compact ? 36 : 24, paddingHorizontal: 7, borderRadius: 999, backgroundColor: selected ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
479
501
  <Text style={{ color: selected ? c.foreground : c.foregroundMuted, fontSize: 12, fontWeight: "600" }}>{label}</Text>
480
502
  {count !== undefined && <Text style={{ color: c.foregroundMuted, fontSize: 12, fontVariant: ["tabular-nums"] }}>{count}</Text>}
481
503
  </Pressable>;
482
504
  };
483
- const list = found[tab];
484
- // While searching, "Show all" is ignored: every match shows.
485
- const shown = all || hits ? list : list.slice(0, LIMIT);
486
- const tabs = (counts: boolean) => <View accessibilityRole="tablist" style={{ flexDirection: "row", gap: 2, marginVertical: -4 }}>{tabButton("timeline", "Timeline", counts ? found.timeline.length : undefined)}{tabButton("questions", "Questions", found.questions.length)}</View>;
505
+ const tabs = (withCounts: boolean) => <View accessibilityRole="tablist" style={{ flexDirection: "row", gap: 0, marginVertical: -4 }}>{tabButton("timeline", "Timeline", withCounts ? counts.timeline : undefined)}{tabButton("questions", "Questions", counts.questions)}</View>;
506
+ const rows = d.timeline, questions = d.questions;
507
+ const empty = tab === "timeline" ? !rows.length : !questions.length;
508
+ const footer = !paged
509
+ ? d.total > PAGE.preview && <FoldRow theme={theme} compact={compact} open={false} onPress={() => toggle("activity")} icon="History" iconColor={c.foregroundMuted} label={`Show all ${d.total}`} />
510
+ : (info.pages > 1 || !searching) && <Pager theme={theme} compact={compact} info={info} busy={reply.isFetching && reply.isPlaceholderData} noun={tab === "timeline" ? "events" : "questions"}
511
+ onPage={p => setPage({ key, at: p })} onLess={searching ? undefined : () => { setPage({ key, at: 0 }); toggle("activity"); }} />;
487
512
  return <Card theme={theme} compact={compact} icon="Activity" title="Activity" search={search.header}
488
- right={<View style={{ flexDirection: "row", alignItems: "center", gap: 4 }}>{questions.length ? tabs(false) : null}{search.button}</View>}>
513
+ right={<View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>{hasQuestions ? tabs(false) : null}{search.button}</View>}>
489
514
  {/* Searching: the tabs move under the field and count their matches, so a hit in the other tab is never hidden. */}
490
- {search.header && questions.length > 0 && <View style={{ flexDirection: "row", paddingHorizontal: compact ? 14 : 12, paddingTop: 6, paddingBottom: 10 }}>{tabs(!!hits)}</View>}
491
- {hits && !hits.size && <NoMatchRow section="activity" query={search.query!} theme={theme} compact={compact} />}
492
- {hits && hits.size > 0 && !list.length && <View style={{ paddingHorizontal: compact ? 14 : 12, paddingVertical: 10, borderTopWidth: 1, borderTopColor: c.border }}>
493
- <Text style={t.meta}>{`Nothing in ${tab === "timeline" ? "Timeline" : "Questions"} matches. ${found[tab === "timeline" ? "questions" : "timeline"].length} in ${tab === "timeline" ? "Questions" : "Timeline"}.`}</Text>
515
+ {search.header && <View style={{ flexDirection: "row", paddingHorizontal: compact ? 14 : 12, paddingTop: 6, paddingBottom: 10 }}>{tabs(searching)}</View>}
516
+ {searching && !counts.timeline && !counts.questions && <NoMatchRow section="activity" query={query} theme={theme} compact={compact} />}
517
+ {searching && (counts.timeline > 0 || counts.questions > 0) && empty && <View style={{ paddingHorizontal: compact ? 14 : 12, paddingVertical: 10, borderTopWidth: 1, borderTopColor: c.border }}>
518
+ <Text style={t.meta}>{`Nothing in ${tab === "timeline" ? "Timeline" : "Questions"} matches. ${tab === "timeline" ? counts.questions : counts.timeline} in ${tab === "timeline" ? "Questions" : "Timeline"}.`}</Text>
494
519
  </View>}
495
520
  {/* The timeline is drawn on the same rail as the stacks: a 2px line through 16px state nodes. */}
496
- {!list.length ? null : tab === "timeline" ? <View style={{ paddingHorizontal: 12, paddingTop: 4, paddingBottom: 6, borderTopWidth: 1, borderTopColor: c.border }}>
497
- {(shown as typeof rows).map((r, i, all) => {
521
+ {empty ? null : tab === "timeline" ? <View style={{ paddingHorizontal: 12, paddingTop: 4, paddingBottom: 6, borderTopWidth: 1, borderTopColor: c.border }}>
522
+ {rows.map(({ row: r, hit }, i) => {
498
523
  const color = toneColor(c, r.tone);
499
- const hit = hits?.get(r);
500
524
  return <View key={r.key} style={{ flexDirection: "row", gap: 10 }}>
501
525
  <View style={{ width: 16, alignItems: "center" }}>
502
- <View style={{ width: 2, height: 8, backgroundColor: i === 0 ? "transparent" : c.border }} />
526
+ <View style={{ width: 2, height: 8, backgroundColor: i === 0 && info.page === 0 ? "transparent" : c.border }} />
503
527
  <View style={{ width: 16, height: 16, borderRadius: 8, alignItems: "center", justifyContent: "center", backgroundColor: tint(color, c) }}><Icon name={r.icon} size={10} color={color} /></View>
504
- <View style={{ width: 2, flex: 1, minHeight: 4, backgroundColor: i === all.length - 1 ? "transparent" : c.border }} />
528
+ <View style={{ width: 2, flex: 1, minHeight: 4, backgroundColor: i === rows.length - 1 && info.page === info.pages - 1 ? "transparent" : c.border }} />
505
529
  </View>
506
530
  <View style={{ flex: 1, minWidth: 0, gap: 2, paddingTop: 6, paddingBottom: 8 }}>
507
531
  <View style={{ flexDirection: "row", alignItems: "baseline", gap: 8 }}>
@@ -512,14 +536,13 @@ export function ActivityCard({ workspace: w, theme, compact, now, open, toggle,
512
536
  </View>
513
537
  </View>;
514
538
  })}
515
- </View> : (shown as typeof questions).map(q => {
539
+ </View> : questions.map(({ question: q, hit }) => {
516
540
  // Until it reached the agent the row says where it is, in muted, like every other surface (answerStatus).
517
541
  const s = answerStatus(q);
518
542
  const status = questionStatus(q);
519
- const hit = hits?.get(q);
520
543
  const icon = q.answer ? "MessageCircleReply" : q.closed ? "MessageCircleOff" : "MessageCircleQuestion";
521
544
  const color = s?.delivered ? c.statusSuccess : q.answer || q.closed ? c.foregroundMuted : c.statusWarning;
522
- return <CardRow key={q.id} theme={theme} onPress={() => onOpenQuestion(q.id)} accessibilityLabel={`${q.id}, ${q.title}. ${status}. Open`}>
545
+ return <CardRow key={q.id} theme={theme} onPress={() => onOpenQuestion(q.id, q as Question)} accessibilityLabel={`${q.id}, ${q.title}. ${status}. Open`}>
523
546
  <View style={{ flexDirection: "row", gap: 9 }}>
524
547
  <View style={{ paddingTop: 2 }}><Icon name={icon} size={13} color={color} /></View>
525
548
  <View style={{ flex: 1, minWidth: 0, gap: 2 }}>
@@ -533,6 +556,6 @@ export function ActivityCard({ workspace: w, theme, compact, now, open, toggle,
533
556
  </View>
534
557
  </CardRow>;
535
558
  })}
536
- {!hits && list.length > LIMIT && <FoldRow theme={theme} compact={compact} open={all} onPress={() => toggle("activity")} icon="History" iconColor={c.foregroundMuted} label={all ? "Show less" : `Show all ${list.length}`} />}
559
+ {footer || null}
537
560
  </Card>;
538
561
  }
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useMemo, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
2
+ import { PagedRows, usePagedList } from "./paged-list";
2
3
  import { Image, Platform, Modal as RNModal, View, useWindowDimensions, type ScrollView as NativeScrollView, type StyleProp, type ViewStyle } from "react-native";
3
4
  import { Pressable, Text } from "./text";
4
5
  import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
@@ -82,6 +83,8 @@ function NoteImage({ block, theme, compact }: { block: Extract<NoteBlock, { kind
82
83
  export function VersionNotes({ note, theme, compact = false, max = Infinity }: { note: ReleaseNote; theme: Theme; compact?: boolean; max?: number }) {
83
84
  const c = theme.colors; const t = text(c, compact);
84
85
  const [all, setAll] = useState(false);
86
+ // A preview (`max`) folds behind "Show all N", which opens pages, never every bullet (client/paged-list.tsx).
87
+ const page = usePagedList({ items: note.items, open: all, onToggle: () => setAll(v => !v), preview: max, theme, compact, noun: "changes" });
85
88
  if (note.blocks?.length) {
86
89
  const quietFrom = note.blocks.findIndex(b => b.kind === "rule");
87
90
  // Headings sit a step above body text and closer to the paragraph they open than to the one before.
@@ -98,13 +101,9 @@ export function VersionNotes({ note, theme, compact = false, max = Infinity }: {
98
101
  })}
99
102
  </View>;
100
103
  }
101
- const items = all ? note.items : note.items.slice(0, max);
102
104
  return <View style={{ gap: 8 }}>
103
- {items.map((item, i) => { const runs = inlineRuns(item); return <Bullet key={i} text={plainInline(item)} runs={runs.some(r => r.bold) ? runs : undefined} theme={theme} compact={compact} />; })}
104
- {!all && note.items.length > max && <Pressable accessibilityRole="button" onPress={() => setAll(true)} hitSlop={compact ? { top: 14, bottom: 14, left: 8, right: 8 } : 6}
105
- style={{ minHeight: compact ? 44 : undefined, justifyContent: "center", alignSelf: "flex-start" }}>
106
- <Text style={[t.label, { color: c.foreground, fontWeight: "600" }]}>{`Show all ${note.items.length}`}</Text>
107
- </Pressable>}
105
+ {page.shown.map((item, i) => { const runs = inlineRuns(item); return <Bullet key={i} text={plainInline(item)} runs={runs.some(r => r.bold) ? runs : undefined} theme={theme} compact={compact} />; })}
106
+ {page.footer}
108
107
  </View>;
109
108
  }
110
109
 
@@ -127,13 +126,15 @@ function VersionHeader({ note, theme, compact }: { note: FeedNote; theme: Theme;
127
126
  </View>;
128
127
  }
129
128
 
130
- /** Every version in one scroll, newest first: each one's header and its notes, nothing folded. */
129
+ /** A version can carry tens of blocks and screenshots: a page of the feed holds a few versions. */
130
+ export const VERSIONS_PER_PAGE = 5;
131
+ /** Every version, newest first: each one's header and its notes, nothing folded, `VERSIONS_PER_PAGE` versions a page. */
131
132
  export function NotesFeed({ feed, theme, compact }: { feed: readonly FeedNote[]; theme: Theme; compact: boolean }) {
132
133
  return <View style={{ gap: compact ? 32 : 36 }}>
133
- {feed.map(n => <View key={n.version} style={{ gap: compact ? 14 : 16 }}>
134
+ <PagedRows items={feed} size={VERSIONS_PER_PAGE} theme={theme} compact={compact} noun="versions" row={n => <View key={n.version} style={{ gap: compact ? 14 : 16 }}>
134
135
  <VersionHeader note={n} theme={theme} compact={compact} />
135
136
  <VersionNotes note={n} theme={theme} compact={compact} />
136
- </View>)}
137
+ </View>} />
137
138
  </View>;
138
139
  }
139
140
 
@@ -1,4 +1,6 @@
1
1
  import { useEffect, useMemo, useState, useSyncExternalStore } from "react";
2
+ import { PagedRows, usePagedList } from "./paged-list";
3
+ import { PAGE } from "../shared/paged";
2
4
  import { View } from "react-native";
3
5
  import { Pressable, Text } from "./text";
4
6
  import { useRpc } from "@getpaseo/plugin/client";
@@ -131,11 +133,11 @@ export function ReviewerSettings({ theme, compact = false }: { theme: Theme; com
131
133
  </View>
132
134
  {data.repos.length > 0 ? <Disclosure id="reviewers.repos" title="Repositories" summary={reposSummary(data.repos, data.config)}
133
135
  defaultOpen={!reviewersConfigured(data.config)} theme={theme} compact={compact}>
134
- {own.map((repo, i) => <View key={repo} style={{ borderTopWidth: i ? 1 : 0, borderTopColor: c.border }}>
136
+ <PagedRows items={own} theme={theme} compact={compact} noun="repositories" row={(repo, i) => <View key={repo} style={{ borderTopWidth: i ? 1 : 0, borderTopColor: c.border }}>
135
137
  <Disclosure framed={false} id={`reviewers.repo.${repo}`} title={repo} summary={repoSummary(data.config.repos[repo] ?? [], data.config.defaults)} defaultOpen={false} theme={theme} compact={compact}>
136
138
  <ReviewerList first titled={false} repo={repo} list={data.config.repos[repo] ?? []} theme={theme} compact={compact} fallback={fallback} />
137
139
  </Disclosure>
138
- </View>)}
140
+ </View>} />
139
141
  {rest.length > 0 && <DefaultRepos repos={rest} defaults={data.config.defaults} theme={theme} compact={compact} first={!own.length} />}
140
142
  </Disclosure> : <Text style={t.meta}>Repositories show here once Follow-up has seen a PR in them.</Text>}
141
143
  </View>;
@@ -148,11 +150,13 @@ export function ReviewerSettings({ theme, compact = false }: { theme: Theme; com
148
150
  function DefaultRepos({ repos, defaults, theme, compact, first }: { repos: string[]; defaults: ReviewerEntry[]; theme: Theme; compact: boolean; first: boolean }) {
149
151
  const c = theme.colors; const t = text(c);
150
152
  const [editing, setEditing] = useState<string | null>(null);
153
+ // Chips wrap, so a page holds more of them than of rows.
154
+ const pageRepos = usePagedList({ items: repos, size: PAGE.size * 2, theme, compact, noun: "repositories" });
151
155
  return <View style={{ borderTopWidth: first ? 0 : 1, borderTopColor: c.border }}>
152
156
  <View style={{ paddingLeft: 36, paddingRight: 14, paddingVertical: 10, gap: 6 }}>
153
157
  <Text style={t.meta}>{`On the default${defaults.length ? ` (${defaults.map(reviewerLabel).join(", ")})` : ""}. Give one its own list:`}</Text>
154
158
  <View style={{ flexDirection: "row", flexWrap: "wrap", gap: 6 }}>
155
- {repos.map(repo => <Pressable key={repo} accessibilityRole="button" accessibilityLabel={`Give ${repo} its own list`} accessibilityState={{ selected: editing === repo }} onPress={() => setEditing(editing === repo ? null : repo)}
159
+ {pageRepos.shown.map(repo => <Pressable key={repo} accessibilityRole="button" accessibilityLabel={`Give ${repo} its own list`} accessibilityState={{ selected: editing === repo }} onPress={() => setEditing(editing === repo ? null : repo)}
156
160
  style={state => ({ flexDirection: "row", alignItems: "center", gap: 5, minHeight: compact ? 44 : 28, paddingHorizontal: 8, borderRadius: 6, borderWidth: 1, borderColor: editing === repo ? c.foregroundMuted : c.border, backgroundColor: state.pressed ? c.surface2 : "transparent" })}>
157
161
  <Icon name="GitPullRequest" size={12} color={c.foregroundMuted} />
158
162
  <Text numberOfLines={1} style={{ color: c.foreground, fontSize: 12, lineHeight: 16 }}>{repo}</Text>
@@ -160,6 +164,7 @@ function DefaultRepos({ repos, defaults, theme, compact, first }: { repos: strin
160
164
  </Pressable>)}
161
165
  </View>
162
166
  </View>
167
+ {pageRepos.footer}
163
168
  {editing && <ReviewerList key={editing} repo={editing} list={[]} theme={theme} compact={compact} startAdding fallback="Add the first reviewer for this repository." />}
164
169
  </View>;
165
170
  }
@@ -0,0 +1,28 @@
1
+ import { useCallback, useRef } from "react";
2
+
3
+ /** Rows keep one opener while Home's render callback changes; activation always reads the latest callback. */
4
+ export function useRowOpen(open: ((key: string) => void) | undefined) {
5
+ const openRef = useRef(open); openRef.current = open;
6
+ const onOpen = useCallback((key: string) => openRef.current?.(key), []);
7
+ return open ? onOpen : undefined;
8
+ }
9
+
10
+ /** Desktop row activation. Native views have no DOM listener; touch keeps its single-tap selection. */
11
+ type RowClick = { pointerType?: string; target?: { closest?(selector: string): unknown } };
12
+ type RowNode = {
13
+ addEventListener?(type: string, listener: (event: RowClick) => void): void;
14
+ removeEventListener?(type: string, listener: (event: RowClick) => void): void;
15
+ };
16
+
17
+ export function bindRowDoubleClick(node: RowNode | null, open: () => void) {
18
+ if (!node?.addEventListener) return;
19
+ const onDoubleClick = (event: RowClick) => {
20
+ if (event.pointerType === "touch") return;
21
+ // The row itself is a button. A closer control belongs to itself, including a menu or its items.
22
+ const control = event.target?.closest?.('button, a, input, textarea, select, [role="button"], [role="link"], [role="menu"], [role="menuitem"], [contenteditable="true"]');
23
+ if (control !== node) return;
24
+ open();
25
+ };
26
+ node.addEventListener("dblclick", onDoubleClick);
27
+ return () => node.removeEventListener?.("dblclick", onDoubleClick);
28
+ }
@@ -25,11 +25,13 @@ export type SectionSearch<T> = {
25
25
  button: ReactNode;
26
26
  };
27
27
 
28
- export function useSectionSearch<T>(workspaceId: string, section: SectionId, { theme, compact, items, fields }: {
28
+ export function useSectionSearch<T>(workspaceId: string, section: SectionId, { theme, compact, items, fields, remote }: {
29
29
  theme: Theme; compact: boolean;
30
30
  /** Every item of the section, folded ones included, in the order the section draws them. */
31
31
  items: readonly T[];
32
32
  fields: (item: T) => readonly ItemField[];
33
+ /** The section searches on the worker (a paged list, follow.activity): no local matching, and "n of N" from its answer. */
34
+ remote?: { matches: number; total: number } | null;
33
35
  }): SectionSearch<T> {
34
36
  const [state, setState] = useState<SectionQuery>(null);
35
37
  const inputRef = useRef<TextInput | null>(null);
@@ -37,11 +39,11 @@ export function useSectionSearch<T>(workspaceId: string, section: SectionId, { t
37
39
  const placeholder = SECTION_PLACEHOLDER[section];
38
40
  const buttonId = `follow-section-search-${section}`;
39
41
  const close = () => { setState(null); focusSoon(buttonId); };
40
- const results = query === null ? null : filterItems(items, fields, query);
42
+ const results = query === null || remote !== undefined ? null : filterItems(items, fields, query);
41
43
  const hits = results ? new Map(results.map(r => [r.item, r.hit])) : null;
42
44
  const header = query === null ? undefined : <View style={{ flex: 1, minWidth: 0, flexDirection: "row", alignItems: "center", gap: compact ? 4 : 6, marginVertical: -4 }}>
43
45
  <QueryField theme={theme} value={query} onChange={q => setState({ workspaceId, query: q })} placeholder={placeholder} icon="Search" dense={compact}
44
- inputRef={inputRef} slashHint={false} autoFocus onEscape={close} count={results ? matchCount(results.length, items.length) : ""} />
46
+ inputRef={inputRef} slashHint={false} autoFocus onEscape={close} count={results ? matchCount(results.length, items.length) : remote && query?.trim() ? matchCount(remote.matches, remote.total) : ""} />
45
47
  <IconButton icon="X" label={`Close ${placeholder.toLowerCase()}`} onPress={close} theme={theme} compact={compact} />
46
48
  </View>;
47
49
  const button = query === null ? <IconButton nativeID={buttonId} icon="Search" label={placeholder} tooltip onPress={() => setState({ workspaceId, query: "" })} theme={theme} compact={compact} /> : null;
@@ -1,4 +1,6 @@
1
1
  import { useEffect, useState } from "react";
2
+ import { usePagedList } from "./paged-list";
3
+ import { PAGE } from "../shared/paged";
2
4
  import { useViewSync, useViewVersion } from "./view-store";
3
5
  import { ActivityIndicator, TextInput, View } from "react-native";
4
6
  import { Pressable, Text } from "./text";
@@ -115,16 +117,19 @@ function ProjectsFold({ theme, compact }: { theme: Theme; compact: boolean }) {
115
117
  onError: error => toast.error(errorText(error)),
116
118
  });
117
119
  const projects = query.data?.projects;
120
+ // A shared host lists hundreds of projects: pages (client/paged-list.tsx).
121
+ const page = usePagedList({ items: projects ?? [], theme, compact, noun: "projects" });
118
122
  if (query.isPending) return <ActivityIndicator accessibilityLabel="Loading projects" color={c.foregroundMuted} style={{ alignSelf: "flex-start", marginVertical: 8 }} />;
119
123
  if (query.error || !projects) return <SettingsCard><SettingsAction label="Couldn't load projects" hint={query.error ? errorText(query.error) : undefined} actionLabel="Retry" onPress={() => void query.refetch()} /></SettingsCard>;
120
124
  if (!projects.length) return <Text style={t.meta}>Projects appear here once you add them to Paseo.</Text>;
121
125
  return <Disclosure id="following.projects" title="Projects" summary={projectsSummary(projects)} defaultOpen={projectsOpenByDefault(projects.length)} theme={theme} compact={compact}>
122
126
  <Text style={[t.meta, { paddingHorizontal: 14, paddingTop: 10 }]}>With Follow every workspace on, a project that's off stops following its new workspaces; ones already followed stay followed (turn one off under Workspaces). With it off, only the projects on here are followed.</Text>
123
127
  <View style={{ padding: 8 }}><SettingsCard>
124
- {projects.map(project => <SettingsSwitch key={project.id} label={project.name}
128
+ {page.shown.map(project => <SettingsSwitch key={project.id} label={project.name}
125
129
  hint={project.key.startsWith("remote:") ? project.key.slice(7) : project.path.split("/").filter(Boolean).slice(-2).join("/")}
126
130
  value={project.enable_default_tracking} disabled={change.isPending}
127
131
  onValueChange={value => change.mutate({ projectId: project.id, enable_default_tracking: value })} />)}
132
+ {page.footer}
128
133
  </SettingsCard></View>
129
134
  </Disclosure>;
130
135
  }
@@ -133,9 +138,10 @@ function WorkspacesFold({ theme, compact, all, autoDefault, busy, set }: { theme
133
138
  set: (w: { workspaceId: string; follow?: boolean; enable_auto_sends?: boolean }, toast?: string) => void }) {
134
139
  const c = theme.colors; const t = text(c, compact);
135
140
  const [q, setQ] = useState("");
136
- const [cap, setCap] = useState(25);
137
141
  const [openId, setOpenId] = useState<string | null>(null);
138
- const view = workspaceRows(all, autoDefault, q, cap);
142
+ // Every match, paged (client/paged-list.tsx): "Show 25 more" used to add rows until all of them were drawn.
143
+ const view = workspaceRows(all, autoDefault, q, Infinity);
144
+ const page = usePagedList({ items: view.rows, resetKey: q, size: PAGE.size, theme, compact, noun: "workspaces" });
139
145
  return <Disclosure id="following.workspaces" title="Workspaces" summary={workspacesSummary(all, autoDefault)} defaultOpen={workspacesOpenByDefault(view.exceptions)} theme={theme} compact={compact}>
140
146
  <View style={{ padding: 10, paddingBottom: 6 }}>
141
147
  <TextInput accessibilityLabel="Search workspaces" value={q} onChangeText={v => { setQ(v); setOpenId(null); }} placeholder={`Search ${all.length} workspaces`} placeholderTextColor={c.foregroundMuted}
@@ -143,7 +149,7 @@ function WorkspacesFold({ theme, compact, all, autoDefault, busy, set }: { theme
143
149
  style={{ minHeight: compact ? 44 : 32, paddingHorizontal: 10, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, fontSize: 13, backgroundColor: c.surface0 }} />
144
150
  </View>
145
151
  {!view.rows.length && <Text style={[t.meta, { paddingHorizontal: 14, paddingBottom: 12 }]}>{`No workspace matches "${q.trim()}".`}</Text>}
146
- {view.rows.map(w => {
152
+ {page.shown.map(w => {
147
153
  const open = openId === w.id;
148
154
  const followed = !w.optedOut && w.enable_tracking;
149
155
  const exception = view.exceptions > 0 && (w.optedOut || !w.enable_tracking || (!w.parked && w.enable_auto_sends !== autoDefault));
@@ -168,10 +174,7 @@ function WorkspacesFold({ theme, compact, all, autoDefault, busy, set }: { theme
168
174
  </View>}
169
175
  </View>;
170
176
  })}
171
- {view.hidden > 0 && <Pressable accessibilityRole="button" onPress={() => setCap(n => n + 25)}
172
- style={state => ({ minHeight: compact ? 44 : 36, justifyContent: "center", paddingHorizontal: 14, borderTopWidth: 1, borderTopColor: c.border, backgroundColor: state.pressed ? c.surface2 : "transparent" })}>
173
- <Text style={[t.meta, { color: c.foreground }]}>{`Show ${Math.min(25, view.hidden)} more (${view.hidden} left)`}</Text>
174
- </Pressable>}
177
+ {page.footer}
175
178
  </Disclosure>;
176
179
  }
177
180