@andrioid/paseo-attention-span 0.7.0 → 0.7.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 (48) hide show
  1. package/OVERVIEW.md +2 -0
  2. package/client/attention-screen.tsx +4 -0
  3. package/client/entity.tsx +15 -3
  4. package/client/icons.ts +2 -0
  5. package/client/item-actions.ts +24 -0
  6. package/client/item-row.tsx +5 -55
  7. package/client/next-up.tsx +49 -7
  8. package/client/stack.tsx +57 -0
  9. package/client/ui.tsx +4 -1
  10. package/client/wrap-up.tsx +181 -49
  11. package/docs/architecture.md +3 -2
  12. package/docs/screenshots/desktop-dark-doing-acknowledge.png +0 -0
  13. package/docs/screenshots/desktop-dark-doing-clear.png +0 -0
  14. package/docs/screenshots/desktop-dark-doing-issue-sheet.png +0 -0
  15. package/docs/screenshots/desktop-dark-doing-reviewers.png +0 -0
  16. package/docs/screenshots/desktop-dark-doing-sheet.png +0 -0
  17. package/docs/screenshots/desktop-dark-doing-wrap-dirty.png +0 -0
  18. package/docs/screenshots/desktop-dark-doing-wrap-multi.png +0 -0
  19. package/docs/screenshots/desktop-dark-doing-wrap.png +0 -0
  20. package/docs/screenshots/desktop-dark-doing.png +0 -0
  21. package/docs/screenshots/desktop-dark-history-filtered.png +0 -0
  22. package/docs/screenshots/desktop-dark-history-groups.png +0 -0
  23. package/docs/screenshots/desktop-dark-history.png +0 -0
  24. package/docs/screenshots/desktop-dark-next-up-code-repo.png +0 -0
  25. package/docs/screenshots/desktop-dark-next-up-setup.png +0 -0
  26. package/docs/screenshots/desktop-dark-next-up.png +0 -0
  27. package/docs/screenshots/desktop-dark-settings.png +0 -0
  28. package/docs/screenshots/desktop-dark-setup.png +0 -0
  29. package/docs/screenshots/desktop-dark-waiting.png +0 -0
  30. package/docs/screenshots/phone-dark-doing.png +0 -0
  31. package/docs/screenshots/phone-dark-history.png +0 -0
  32. package/docs/screenshots/phone-light-next-up-filtered.png +0 -0
  33. package/index.server.ts +2 -0
  34. package/package.json +1 -1
  35. package/requirements.yaml +2 -0
  36. package/server/classify.ts +29 -0
  37. package/server/fetch.ts +29 -3
  38. package/server/fixture.ts +16 -5
  39. package/server/github-types.ts +13 -0
  40. package/server/queries.ts +14 -0
  41. package/server/references.ts +12 -0
  42. package/server/service.ts +90 -11
  43. package/server/store.ts +17 -2
  44. package/server/view.ts +24 -4
  45. package/shared/attention.ts +26 -2
  46. package/shared/next-up-filter.ts +19 -0
  47. package/shared/rpc.ts +4 -0
  48. package/shared/wrap-up.ts +34 -9
package/OVERVIEW.md CHANGED
@@ -10,6 +10,8 @@ This is the one you'll live in. At the top is **Wrap up**: finished or handed-of
10
10
 
11
11
  Wrap up is the cleanup pass. A PR that merged, an issue that closed, work that left your hands, a review you finished on someone else's PR: if one of your sessions is still open on it, it sits here once the agent is idle, newest finish first. **Archive session** puts the session, the sub-agents it started and its worktree away. If anything is uncommitted or unpushed, or the worktree has terminals open, you get a sheet first, shaped like Paseo's own: "Uncommitted changes: 2 files (+12 −3)", "1 unpushed commit", the terminals it closes, with **Open session** beside **Archive**; several sessions get a list of their own. **Archive all clean** does the tidy ones in one go. A worktree another session still lives in stays, and so does its row, saying which session kept it, until the worktree goes or you dismiss it; a local checkout is never archived; and there's no Undo, which is exactly why it checks first. Archived work goes to History as already read, not as a new note.
12
12
 
13
+ Sometimes all the PRs under an issue merge and the issue stays open anyway: they went into a feature branch, or the description only mentioned it. Wrap up asks about those too, session or not: "Close #12? #34 and #35 merged 2h ago". **Close #12** closes it as completed, with Undo. The × keeps it open until another PR of yours merges under it, which covers "first of three" plans. While it's asking, the issue stays in Next up with a "PRs merged" pill. A session open on that work joins the question's row, and becomes an ordinary Archive session row once you've answered.
14
+
13
15
  ![Doing](docs/screenshots/desktop-dark-doing.png)
14
16
 
15
17
  Each item shows up once, under whichever reason is most urgent. An issue and the PRs that close it count as one item, and so does a stack of PRs. A stack is one change wearing several PRs, so it shouldn't take up five rows.
@@ -214,7 +214,9 @@ function AttentionList({
214
214
  busy={act.busy}
215
215
  login={view.login}
216
216
  fixture={!!view.fixtureAgents}
217
+ fetchDetails={act.fetchDetails}
217
218
  openAgent={act.openAgent}
219
+ {...act.askActions}
218
220
  onArchive={(item, confirm, terminals) => act.archiveRows([item], confirm, item.key, terminals)}
219
221
  onArchiveAll={async () => {
220
222
  const clean = wrap.filter(cleanSingle);
@@ -260,6 +262,8 @@ function AttentionList({
260
262
  projects={view.projects}
261
263
  selectedProjects={view.projectFilter}
262
264
  onFilter={(change) => act.filterNextUp(view, change)}
265
+ byRepo={view.unclaimedByRepo ?? false}
266
+ onByRepo={(on) => act.groupNextUp(view, on)}
263
267
  // Narrowed to one repository, a new issue starts there [ISS-01].
264
268
  onNewIssue={() => setNewIssue({ nextUp: view.sources.length === 1 && view.sources[0].startsWith("repo:") ? view.sources[0].slice(5) : undefined })}
265
269
  agents={actions.agents}
package/client/entity.tsx CHANGED
@@ -26,13 +26,25 @@ export function NumberText({ number }: { number: number }) {
26
26
  // "#160 · acme/shop", to lead a Meta line: the number on its own first, then the repo with its name standing out from its
27
27
  // owner, so cards from several repos scan.
28
28
  export function PlaceText({ place }: { place: Place }) {
29
- const strong = useStrongText();
30
- const label = repoLabel(place.repo, place.login);
31
- const cut = label.lastIndexOf("/") + 1;
32
29
  return (
33
30
  <>
34
31
  <NumberText number={place.number} />
35
32
  {" · "}
33
+ <RepoText repo={place.repo} login={place.login} />
34
+ </>
35
+ );
36
+ }
37
+
38
+ // "acme/shop" with its name standing out from its owner; mine without the owner where `login` is given. Bold where it heads
39
+ // a group [NXT-14].
40
+ export function RepoText({ repo, login, bold }: { repo: string; login: string | null; bold?: boolean }) {
41
+ const { c } = useStyles();
42
+ const text = useStrongText();
43
+ const strong = bold ? { color: c.foreground, fontWeight: "600" as const } : text;
44
+ const label = repoLabel(repo, login);
45
+ const cut = label.lastIndexOf("/") + 1;
46
+ return (
47
+ <>
36
48
  {label.slice(0, cut)}
37
49
  <Text style={strong}>{label.slice(cut)}</Text>
38
50
  </>
package/client/icons.ts CHANGED
@@ -57,6 +57,8 @@ export const ICONS = {
57
57
  userMinus: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 7a4 4 0 1 0 8 0a4 4 0 0 0-8 0M6 21v-2a4 4 0 0 1 4-4h4c.348 0 .686.045 1.009.128M16 19h6\"/></svg>" },
58
58
  // Tabler archive: puts a finished item's Paseo sessions away [ATT-22].
59
59
  archive: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"M3 4a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/><path d=\"M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8M10 12h4\"/></g></svg>" },
60
+ // Tabler folder: a repository, as Unclaimed groups by them [NXT-14].
61
+ folder: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2\"/></svg>" },
60
62
  chevronDown: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m6 9l6 6l6-6\"/></svg>" },
61
63
  // Tabler message-ai: marks actions that start or continue an agent session.
62
64
  agent: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"M8 9h8m-8 4h3.5m-1.506 6.804L8 21v-3H6a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v4\"/><path d=\"M14 21v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6\"/></g></svg>" },
@@ -102,8 +102,10 @@ export function useItemActions(attention: ReturnType<typeof useAttention>, navig
102
102
  const saveScopes = useRpc(rpc.setScopes);
103
103
  const saveSources = useRpc(rpc.setSources);
104
104
  const saveProjects = useRpc(rpc.setProjectFilter);
105
+ const saveByRepo = useRpc(rpc.setUnclaimedByRepo);
105
106
  const closeIssue = useRpc(rpc.closeIssue);
106
107
  const reopenIssue = useRpc(rpc.reopenIssue);
108
+ const keepOpen = useRpc(rpc.keepOpen);
107
109
  const update = useRpc(rpc.updateBranch);
108
110
  const merge = useRpc(rpc.mergePullRequest);
109
111
  const close = useRpc(rpc.closePullRequest);
@@ -340,6 +342,19 @@ export function useItemActions(attention: ReturnType<typeof useAttention>, navig
340
342
  },
341
343
  };
342
344
 
345
+ // Wrap up's "Close #12?": closes as completed, or keeps it open until another PR merges under it; each with Undo [ATT-24].
346
+ const askActions = {
347
+ onCloseIssue: (item: WrapItem) => {
348
+ const key = item.wrap.itemKey;
349
+ const target: Target = { kind: "issue", repo: item.repo, number: item.number, title: item.title, url: item.url };
350
+ change(item.key, "Close", () => closeIssue({ key, target, reason: "completed" }), `Closed #${item.number} as completed`, () => reopenIssue({ key, target }));
351
+ },
352
+ onKeepOpen: (item: WrapItem) => {
353
+ const key = item.wrap.itemKey;
354
+ change(item.key, "Keep open", () => keepOpen({ key, on: true }), `Kept #${item.number} open`, () => keepOpen({ key, on: false }));
355
+ },
356
+ };
357
+
343
358
  const failedSaving = (error: Error) => toast.error(`Saving the filter failed: ${error.message}`);
344
359
  // Ticks apply right away, like Next up's; the server remembers them [HIS-07].
345
360
  function filterHistory(view: AttentionView, next: HistoryFilter[]) {
@@ -355,6 +370,13 @@ export function useItemActions(attention: ReturnType<typeof useAttention>, navig
355
370
  if (change.sources) saveSources({ sources: change.sources }).catch(failedSaving);
356
371
  if (change.projectFilter) saveProjects({ projects: change.projectFilter }).catch(failedSaving);
357
372
  }
373
+ // Shown at once, and remembered; the saved view then wins over a refresh that started before it [NXT-14].
374
+ function groupNextUp(view: AttentionView, on: boolean) {
375
+ attention.setView({ ...view, unclaimedByRepo: on });
376
+ saveByRepo({ on })
377
+ .then((saved) => attention.setView(saved))
378
+ .catch((error: Error) => toast.error(`Saving the grouping failed: ${error.message}`));
379
+ }
358
380
 
359
381
  return {
360
382
  busy,
@@ -381,7 +403,9 @@ export function useItemActions(attention: ReturnType<typeof useAttention>, navig
381
403
  dismissKept: (row: KeptRow) => void run(`kept:${row.workspaceId}`, "Dismiss", async () => attention.setView(await dismissKept({ workspaceId: row.workspaceId }))),
382
404
  itemActions,
383
405
  issueActions,
406
+ askActions,
384
407
  filterHistory,
385
408
  filterNextUp,
409
+ groupNextUp,
386
410
  };
387
411
  }
@@ -3,22 +3,23 @@
3
3
  import { openExternalUrl } from "@getpaseo/plugin/client";
4
4
  import { useQuery } from "@tanstack/react-query";
5
5
  import { type ReactNode, useState } from "react";
6
- import { Pressable, Text, View } from "react-native";
7
- import { type ActionId, type AgentSummary, type Chip, type FailingChecks, type Item, itemSessions, type PersonRole, type SubRow, type WaitingGroup, type WaitingOn } from "../shared/attention";
6
+ import { Text, View } from "react-native";
7
+ import { type ActionId, type AgentSummary, type Chip, type FailingChecks, type Item, itemSessions, type PersonRole, type WaitingGroup, type WaitingOn } from "../shared/attention";
8
8
  import type { SessionKind } from "../shared/config";
9
9
  import { failingList, groupLabel, rerunHistory, summarizeRerun } from "../shared/checks";
10
10
  import { ago } from "../shared/format";
11
11
  import { noteBusy } from "../shared/got-it";
12
12
  import { actionLabel, alsoWaitingOn, cardStack, cardWhen, copiesLink, rerunState, sessionSignal, type SheetStep, sheetPlan, soleStep, stackMetaChips, targetUrl, waitChips } from "../shared/item-view";
13
13
  import { CardList, CardRow } from "./card";
14
- import { NumberText, PlaceText } from "./entity";
14
+ import { PlaceText } from "./entity";
15
15
  import type { IconName } from "./icons";
16
16
  import { type Actions, itemDetailsQuery } from "./item-actions";
17
17
  import { stateMark } from "./mark";
18
+ import { StackLine } from "./stack";
18
19
  import { AcknowledgeSheet, ReviewerSheet } from "./pickers";
19
20
  import { sessionEntry, startAnotherEntry } from "./session-menu";
20
21
  import { ActionSheet, DETAILS_STALE_MS, DetailLines, FadeIn, githubEntry, type SheetEntry, useArrived, usePrefetchOnRest } from "./sheet";
21
- import { Avatar, Hint, LINE_HEIGHT, Meta, mix, TablerIcon, tint, useCopy, useHover, useStrongText, useStyles } from "./ui";
22
+ import { Avatar, Hint, LINE_HEIGHT, Meta, mix, TablerIcon, useCopy, useStrongText, useStyles } from "./ui";
22
23
 
23
24
  // The agent icon marks every action that starts an agent session; the rest act on GitHub right away [ATT-13].
24
25
  const ACTION_ICONS: Record<ActionId, IconName> = {
@@ -397,54 +398,3 @@ function WaitingOnLine({ people, asked, expanded }: { people: WaitingOn[]; asked
397
398
  </Hint>
398
399
  );
399
400
  }
400
-
401
- // Stacked or linked PRs as a connected line; collapsed, only those needing attention [ATT-03, ATT-04].
402
- // In the sheet each row opens its PR on GitHub [ATT-12], and the PR an issue's actions apply to is tinted and says so [ATT-06].
403
- function StackLine({ rows, merged, links = false, target }: { rows: SubRow[]; merged: boolean; links?: boolean; target?: string }) {
404
- const styles = useStyles();
405
- return (
406
- <View>
407
- {rows.map((row, index) => (
408
- <StackRow key={row.key} url={row.url} number={row.number} link={links} target={row.key === target}>
409
- <View style={{ width: 16, alignItems: "center" }}>
410
- <View style={{ width: 2, flex: 1, backgroundColor: index === 0 ? "transparent" : styles.c.border }} />
411
- <TablerIcon name={merged ? "merge" : row.draft ? "draft" : "pr"} size={14} color={merged ? styles.c.statusSuccess : row.draft ? styles.c.foregroundMuted : styles.c.statusSuccess} />
412
- <View style={{ width: 2, flex: 1, backgroundColor: index === rows.length - 1 ? "transparent" : styles.c.border }} />
413
- </View>
414
- <View style={{ flex: 1, paddingVertical: 3, gap: 2 }}>
415
- <Text style={{ color: styles.c.foreground, fontSize: 13 }} numberOfLines={1}>
416
- {row.title}
417
- </Text>
418
- <View style={[styles.wrap, { columnGap: 10, rowGap: 2 }]}>
419
- <Meta lead={<NumberText number={row.number} />} facts={merged && row.mergedBy ? [`merged by ${row.mergedBy}`] : []} chips={row.chips} />
420
- {row.key === target ? <Text style={{ color: styles.action, fontSize: 12, fontWeight: "600" }}>actions apply here</Text> : null}
421
- </View>
422
- </View>
423
- {links ? (
424
- <View style={{ justifyContent: "center", paddingHorizontal: 4 }}>
425
- <TablerIcon name="github" size={14} color={styles.c.foregroundMuted} />
426
- </View>
427
- ) : null}
428
- </StackRow>
429
- ))}
430
- </View>
431
- );
432
- }
433
-
434
- function StackRow({ url, number, link, target = false, children }: { url: string; number: number; link: boolean; target?: boolean; children: ReactNode }) {
435
- const styles = useStyles();
436
- const { hovered, hover } = useHover();
437
- const tinted = target ? { backgroundColor: tint(styles.action, 0.1), borderRadius: 6 } : null;
438
- if (!link) return <View style={[styles.row, { alignItems: "stretch" }, tinted]}>{children}</View>;
439
- return (
440
- <Pressable
441
- accessibilityRole="link"
442
- accessibilityLabel={`Open PR #${number} on GitHub`}
443
- onPress={() => void openExternalUrl(url)}
444
- {...hover}
445
- style={({ pressed }) => [styles.row, { alignItems: "stretch", borderRadius: 6, backgroundColor: pressed || hovered ? styles.c.surface2 : target ? tint(styles.action, 0.1) : "transparent" }]}
446
- >
447
- {children}
448
- </Pressable>
449
- );
450
- }
@@ -13,15 +13,15 @@ import {
13
13
  type UnclaimedSource,
14
14
  } from "../shared/attention";
15
15
  import type { NextUpSource } from "../shared/config";
16
- import { CLEAR_FILTER, type FilterChange, nextUpFilter } from "../shared/next-up-filter";
16
+ import { CLEAR_FILTER, type FilterChange, nextUpFilter, repoGroups } from "../shared/next-up-filter";
17
17
  import type { IconName } from "./icons";
18
18
  import type { FetchDetails } from "./item-actions";
19
19
  import { CardList, CardRow, type Tone } from "./card";
20
20
  import { sessionEntry, startAnotherEntry } from "./session-menu";
21
21
  import { ActionSheet, DETAILS_STALE_MS, DetailLines, type DetailsQuery, detailsKey, FilterSheet, githubEntry, type SheetEntry, usePrefetchOnRest } from "./sheet";
22
- import { IssuePills, PlaceText } from "./entity";
22
+ import { IssuePills, PlaceText, RepoText } from "./entity";
23
23
  import { Still } from "./still";
24
- import { Button, FilterButton, Meta, SectionHeader, useStyles } from "./ui";
24
+ import { Button, FilterButton, Meta, SectionHeader, TablerIcon, useStyles } from "./ui";
25
25
 
26
26
  const TYPE_ICONS: Record<string, IconName> = { bug: "bug", feature: "feature", debt: "debt", task: "task", epic: "epic" };
27
27
 
@@ -42,6 +42,9 @@ interface Props {
42
42
  selectedProjects: string[];
43
43
  // Change any filter or all at once, so Clear empties them in one go.
44
44
  onFilter: (change: FilterChange) => void;
45
+ // Unclaimed grouped by repository, and turning it on or off [NXT-14].
46
+ byRepo: boolean;
47
+ onByRepo: (on: boolean) => void;
45
48
  agents: AgentSummary[];
46
49
  // Mine, so my repos show without the owner.
47
50
  login: string | null;
@@ -59,16 +62,18 @@ interface Props {
59
62
  onNewIssue: () => void;
60
63
  }
61
64
 
62
- type RowProps = Omit<Props, "calm" | "openSettings" | "assigned" | "unclaimed" | "unclaimedFrom" | "selected" | "sources" | "selectedSources" | "projects" | "selectedProjects" | "onFilter" | "onNewIssue">;
65
+ type RowProps = Omit<Props, "calm" | "openSettings" | "assigned" | "unclaimed" | "unclaimedFrom" | "selected" | "sources" | "selectedSources" | "projects" | "selectedProjects" | "onFilter" | "byRepo" | "onByRepo" | "onNewIssue">;
63
66
 
64
67
  // Assigned issues first [NXT-06], then unclaimed ones [NXT-01]; both already ranked by the server [NXT-02].
65
- export function NextUpList({ calm, openSettings, assigned, unclaimed, unclaimedFrom, selected, sources, selectedSources, projects, selectedProjects, onFilter, onNewIssue, ...rowProps }: Props) {
68
+ export function NextUpList({ calm, openSettings, assigned, unclaimed, unclaimedFrom, selected, sources, selectedSources, projects, selectedProjects, onFilter, byRepo, onByRepo, onNewIssue, ...rowProps }: Props) {
66
69
  const styles = useStyles();
67
70
  const filter = useMemo(
68
71
  () => nextUpFilter({ unclaimed, selected, sources, selectedSources, projects, selectedProjects }),
69
72
  [unclaimed, selected, sources, selectedSources, projects, selectedProjects],
70
73
  );
71
74
  const { shown, picked, groups } = filter;
75
+ // Only with two repositories or more is there anything to group [NXT-14].
76
+ const repos = useMemo(() => repoGroups(shown), [shown]);
72
77
  const [filtering, setFiltering] = useState(false);
73
78
 
74
79
  // Both point at where Next up looks: plainly when it has nowhere to look, quietly when it found nothing [NXT-13].
@@ -96,7 +101,18 @@ export function NextUpList({ calm, openSettings, assigned, unclaimed, unclaimedF
96
101
  count={shown.length}
97
102
  action={
98
103
  <View style={styles.wrap}>
99
- <Button label="New issue" icon="plus" variant="ghost" onPress={onNewIssue} />
104
+ {/* Just icons on a phone, so the header stays one line with Filter in it [NXT-14]. */}
105
+ {repos ? (
106
+ <Button
107
+ label={styles.compact ? undefined : "Group by repo"}
108
+ accessibilityLabel="Group by repo"
109
+ icon="folder"
110
+ variant={byRepo ? "calm" : "ghost"}
111
+ pressed={byRepo}
112
+ onPress={() => onByRepo(!byRepo)}
113
+ />
114
+ ) : null}
115
+ <Button label={styles.compact ? undefined : "New issue"} accessibilityLabel="New issue" icon="plus" variant="ghost" onPress={onNewIssue} />
100
116
  {groups.length > 0 ? <FilterButton count={picked} onPress={() => setFiltering(true)} /> : null}
101
117
  </View>
102
118
  }
@@ -114,6 +130,15 @@ export function NextUpList({ calm, openSettings, assigned, unclaimed, unclaimedF
114
130
  <Text style={styles.text}>No repos to look in. Register a project in Paseo, or choose where Next up looks in Settings.</Text>
115
131
  ) : shown.length === 0 ? (
116
132
  <Text style={styles.text}>{filter.empty}</Text>
133
+ ) : byRepo && repos ? (
134
+ <View style={{ gap: 8 }}>
135
+ {repos.map((group, index) => (
136
+ <View key={group.repo} style={{ gap: 8, marginTop: index ? 10 : 0 }}>
137
+ <RepoHeading repo={group.repo} count={group.issues.length} login={rowProps.login} />
138
+ <IssueList issues={group.issues} claim {...rowProps} />
139
+ </View>
140
+ ))}
141
+ </View>
117
142
  ) : (
118
143
  <IssueList issues={shown} claim {...rowProps} />
119
144
  )}
@@ -122,6 +147,21 @@ export function NextUpList({ calm, openSettings, assigned, unclaimed, unclaimedF
122
147
  );
123
148
  }
124
149
 
150
+ // A repository's name over its issues, standing out more than History's sub-groups, since it's what the list is sorted by
151
+ // [NXT-14]. Cards keep their repo too, for when this has scrolled away [NXT-10].
152
+ function RepoHeading({ repo, count, login }: { repo: string; count: number; login: string | null }) {
153
+ const styles = useStyles();
154
+ return (
155
+ <View style={[styles.row, { gap: 6, paddingVertical: 2 }]} accessibilityRole="header">
156
+ <TablerIcon name="folder" size={14} color={styles.c.foregroundMuted} />
157
+ <Text style={[styles.muted, { fontSize: 13 }]}>
158
+ <RepoText repo={repo} login={login} bold />
159
+ {` · ${count}`}
160
+ </Text>
161
+ </View>
162
+ );
163
+ }
164
+
125
165
  function IssueList({ issues, claim, ...rowProps }: RowProps & { issues: NextUpIssue[]; claim: boolean }) {
126
166
  return (
127
167
  <CardList>
@@ -132,8 +172,10 @@ function IssueList({ issues, claim, ...rowProps }: RowProps & { issues: NextUpIs
132
172
  );
133
173
  }
134
174
 
135
- // An open PR that closes it means someone may already be on it [NXT-10].
175
+ // An open PR that closes it means someone may already be on it [NXT-10]; my PRs under it all merged mean it may be done,
176
+ // while Wrap up asks [ATT-24].
136
177
  function prSignal(issue: NextUpIssue): Chip[] {
178
+ if (issue.prsMerged) return [{ text: "PRs merged", tone: "good" }];
137
179
  const [first, ...more] = issue.openPrs;
138
180
  if (!first) return [];
139
181
  return [{ text: `PR by ${first.author ?? "someone"}${more.length ? ` +${more.length}` : ""}`, tone: "warn" }];
@@ -0,0 +1,57 @@
1
+ import { openExternalUrl } from "@getpaseo/plugin/client";
2
+ import type { ReactNode } from "react";
3
+ import { Pressable, Text, View } from "react-native";
4
+ import type { SubRow } from "../shared/attention";
5
+ import { NumberText } from "./entity";
6
+ import { Meta, TablerIcon, tint, useHover, useStyles } from "./ui";
7
+
8
+ // Stacked or linked PRs as a connected line; collapsed, only those needing attention [ATT-03, ATT-04].
9
+ // In the sheet each row opens its PR on GitHub [ATT-12], and the PR an issue's actions apply to is tinted and says so [ATT-06].
10
+ export function StackLine({ rows, merged, links = false, target }: { rows: SubRow[]; merged: boolean; links?: boolean; target?: string }) {
11
+ const styles = useStyles();
12
+ return (
13
+ <View>
14
+ {rows.map((row, index) => (
15
+ <StackRow key={row.key} url={row.url} number={row.number} link={links} target={row.key === target}>
16
+ <View style={{ width: 16, alignItems: "center" }}>
17
+ <View style={{ width: 2, flex: 1, backgroundColor: index === 0 ? "transparent" : styles.c.border }} />
18
+ <TablerIcon name={merged ? "merge" : row.draft ? "draft" : "pr"} size={14} color={merged ? styles.c.statusSuccess : row.draft ? styles.c.foregroundMuted : styles.c.statusSuccess} />
19
+ <View style={{ width: 2, flex: 1, backgroundColor: index === rows.length - 1 ? "transparent" : styles.c.border }} />
20
+ </View>
21
+ <View style={{ flex: 1, paddingVertical: 3, gap: 2 }}>
22
+ <Text style={{ color: styles.c.foreground, fontSize: 13 }} numberOfLines={1}>
23
+ {row.title}
24
+ </Text>
25
+ <View style={[styles.wrap, { columnGap: 10, rowGap: 2 }]}>
26
+ <Meta lead={<NumberText number={row.number} />} facts={merged && row.mergedBy ? [`merged by ${row.mergedBy}`] : []} chips={row.chips} />
27
+ {row.key === target ? <Text style={{ color: styles.action, fontSize: 12, fontWeight: "600" }}>actions apply here</Text> : null}
28
+ </View>
29
+ </View>
30
+ {links ? (
31
+ <View style={{ justifyContent: "center", paddingHorizontal: 4 }}>
32
+ <TablerIcon name="github" size={14} color={styles.c.foregroundMuted} />
33
+ </View>
34
+ ) : null}
35
+ </StackRow>
36
+ ))}
37
+ </View>
38
+ );
39
+ }
40
+
41
+ function StackRow({ url, number, link, target = false, children }: { url: string; number: number; link: boolean; target?: boolean; children: ReactNode }) {
42
+ const styles = useStyles();
43
+ const { hovered, hover } = useHover();
44
+ const tinted = target ? { backgroundColor: tint(styles.action, 0.1), borderRadius: 6 } : null;
45
+ if (!link) return <View style={[styles.row, { alignItems: "stretch" }, tinted]}>{children}</View>;
46
+ return (
47
+ <Pressable
48
+ accessibilityRole="link"
49
+ accessibilityLabel={`Open PR #${number} on GitHub`}
50
+ onPress={() => void openExternalUrl(url)}
51
+ {...hover}
52
+ style={({ pressed }) => [styles.row, { alignItems: "stretch", borderRadius: 6, backgroundColor: pressed || hovered ? styles.c.surface2 : target ? tint(styles.action, 0.1) : "transparent" }]}
53
+ >
54
+ {children}
55
+ </Pressable>
56
+ );
57
+ }
package/client/ui.tsx CHANGED
@@ -294,7 +294,7 @@ export function useHover() {
294
294
  }
295
295
 
296
296
  // Calm by default: accent text on a subtle surface. Solid accent is for confirmations.
297
- // Busy: a spinner in place of the icon, and no second press while it runs.
297
+ // Busy: a spinner in place of the icon, and no second press while it runs. Pressed: a toggle, on or off, said as aria-pressed since React Native Web drops accessibilityState.
298
298
  export function Button({
299
299
  label,
300
300
  icon,
@@ -302,6 +302,7 @@ export function Button({
302
302
  variant = "plain",
303
303
  disabled,
304
304
  busy,
305
+ pressed,
305
306
  accessibilityLabel,
306
307
  }: {
307
308
  label?: string;
@@ -310,6 +311,7 @@ export function Button({
310
311
  variant?: Variant;
311
312
  disabled?: boolean;
312
313
  busy?: boolean;
314
+ pressed?: boolean;
313
315
  accessibilityLabel?: string;
314
316
  }) {
315
317
  const styles = useStyles();
@@ -321,6 +323,7 @@ export function Button({
321
323
  accessibilityRole="button"
322
324
  accessibilityLabel={accessibilityLabel ?? label ?? icon}
323
325
  accessibilityState={{ disabled: disabled || busy, busy }}
326
+ aria-pressed={pressed}
324
327
  disabled={disabled || busy}
325
328
  onPress={onPress}
326
329
  {...hover}