@andrioid/paseo-attention-span 0.4.12 → 0.4.13

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.
@@ -21,7 +21,7 @@ import { NumberText, PlaceText } from "./entity";
21
21
  import { NextUpList } from "./next-up";
22
22
  import { Still } from "./still";
23
23
  import { agentSignal, sessionEntry, startAnotherEntry } from "./session-menu";
24
- import { ActionSheet, DETAILS_STALE_MS, DetailLines, type DetailsQuery, detailsKey, FadeIn, Modal, type SheetEntry, useArrived, usePrefetchOnRest } from "./sheet";
24
+ import { ActionSheet, DETAILS_STALE_MS, DetailLines, type DetailsQuery, detailsKey, FadeIn, githubEntry, Modal, type SheetEntry, useArrived, usePrefetchOnRest } from "./sheet";
25
25
  import { FeedbackAsk, FeedbackLine, type FeedbackScreen, FeedbackSheet } from "./feedback";
26
26
  import { branchWorkspaces, type FetchProviders, findCheckout, githubProjects, itemAgents, listProfiles, noProjectMessage, resolveAgentConfig, startSession } from "./sessions";
27
27
  import { SetupChecklist } from "./setup";
@@ -735,7 +735,7 @@ function ItemRow({ item, first, actions, group }: { item: Item; first: boolean;
735
735
  : undefined
736
736
  }
737
737
  secondary={[
738
- only ? { label: only.label, icon: only.icon, onPress: only.onPress } : { label: `Details for #${item.number}`, icon: "chevronRight", onPress: open },
738
+ only ? { label: only.label, accessibilityLabel: only.accessibilityLabel, icon: only.icon, onPress: only.onPress } : { label: `Details for #${item.number}`, icon: "chevronRight", onPress: open },
739
739
  // History is where I report from, so its cards copy their link in one tap [ATT-15].
740
740
  ...(history ? [{ label: `Copy link to #${item.number}`, icon: "copy" as const, onPress: () => copy(item.url, `Copied link to #${item.number}`) }] : []),
741
741
  ]}
@@ -872,15 +872,10 @@ function sheetEntries(
872
872
  entries.push({ key: action, icon: ACTION_ICONS[action], label, detail: actionDetail(action, item), housekeeping: action === "close", onPress: () => onPerform(action) });
873
873
  }
874
874
  }
875
- // Anything Attention Span doesn't cover [ATT-12], and its link to share [ATT-15].
876
- entries.push({
877
- key: "github",
878
- icon: "github",
879
- label: `Open ${item.kind === "issue" ? "issue" : "PR"} on GitHub`,
880
- detail: `${item.repo}#${item.number}`,
881
- onPress: close(() => void openExternalUrl(item.url)),
882
- copy: { text: item.url, label: `Copy link to #${item.number}`, done: `Copied link to #${item.number}` },
883
- });
875
+ // Anything Attention Span doesn't cover [ATT-12], with an issue's PR beside it: the one its actions apply to, or in
876
+ // History, where an issue is its own target, the first of the PRs that closed it.
877
+ const pr = targetUrl(item) && item.target.kind === "pr" ? item.target : item.kind === "issue" && item.children[0] ? item.children[0] : undefined;
878
+ entries.push(githubEntry(item, (url) => close(() => void openExternalUrl(url))(), pr));
884
879
  // Nothing's left to start on once it's merged or closed.
885
880
  if (!item.closedAt) entries.push(startAnotherEntry(sessions.length > 0, withOptions("Start session", fallbackKind(item))));
886
881
  if (inDoing) entries.push({ key: "dismiss", icon: "dismiss", label: "Dismiss", detail: "Hides it until something new happens on it", housekeeping: true, onPress: close(() => actions.dismiss(item)) });
@@ -1178,7 +1173,9 @@ function Waiting({ groups, actions }: { groups: WaitingGroup[]; actions: Actions
1178
1173
  count={items.length}
1179
1174
  action={
1180
1175
  who && !who.bot ? (
1181
- <Button icon="copy" label={styles.compact ? undefined : "Copy list"} variant="ghost" accessibilityLabel={`Copy what waits on ${who.login}`} onPress={() => nudge(who.login)} />
1176
+ <View style={styles.overCard}>
1177
+ <Button icon="markdown" variant="ghost" accessibilityLabel={`Copy what waits on ${who.login}`} onPress={() => nudge(who.login)} />
1178
+ </View>
1182
1179
  ) : null
1183
1180
  }
1184
1181
  />
@@ -1206,7 +1203,7 @@ function weekLabel(monday: Date): string {
1206
1203
  }
1207
1204
 
1208
1205
  // What I finished, by week, with reviews tucked away per week [HIS-01, HIS-02].
1209
- // A week copies as a list of links to paste into a report, each led by its kind; reviews stay out of it [HIS-03, HIS-04].
1206
+ // A week copies as a list of links to paste into a report, each led by its kind; its reviews copy as a list of their own [HIS-03, HIS-04].
1210
1207
  function History({ items, actions }: { items: Item[]; actions: Actions }) {
1211
1208
  const styles = useStyles();
1212
1209
  const copy = useCopy();
@@ -1232,25 +1229,42 @@ function History({ items, actions }: { items: Item[]; actions: Actions }) {
1232
1229
  count={done.length}
1233
1230
  action={
1234
1231
  copied.length > 0 ? (
1235
- <Button
1236
- icon="copy"
1237
- variant="ghost"
1238
- accessibilityLabel={`Copy links from ${label}`}
1239
- onPress={() =>
1240
- copy(
1241
- linkList(copied.map((item) => ({ title: item.title, url: item.url, mark: workEmoji(item) }))),
1242
- `Copied ${copied.length} link${copied.length === 1 ? "" : "s"} from ${label}`,
1243
- )
1244
- }
1245
- />
1232
+ <View style={styles.overCard}>
1233
+ <Button
1234
+ icon="markdown"
1235
+ variant="ghost"
1236
+ accessibilityLabel={`Copy links from ${label}`}
1237
+ onPress={() =>
1238
+ copy(
1239
+ linkList(copied.map((item) => ({ title: item.title, url: item.url, mark: workEmoji(item) }))),
1240
+ `Copied ${copied.length} link${copied.length === 1 ? "" : "s"} from ${label}`,
1241
+ )
1242
+ }
1243
+ />
1244
+ </View>
1246
1245
  ) : null
1247
1246
  }
1248
1247
  />
1249
1248
  {done.length > 0 ? <Card items={done} actions={actions} /> : null}
1250
1249
  {reviewed.length > 0 ? (
1251
1250
  <View style={{ gap: 8 }}>
1252
- <View style={styles.wrap}>
1251
+ {/* Its copy lines up under the week's, at the right edge, like every Markdown copy. */}
1252
+ <View style={styles.row}>
1253
1253
  <Toggle label={`Reviewed (${reviewed.length})`} active={open === label} onPress={() => setOpen(open === label ? null : label)} />
1254
+ <View style={{ flex: 1 }} />
1255
+ <View style={styles.overCard}>
1256
+ <Button
1257
+ icon="markdown"
1258
+ variant="ghost"
1259
+ accessibilityLabel={`Copy reviewed links from ${label}`}
1260
+ onPress={() =>
1261
+ copy(
1262
+ linkList(reviewed.map((item) => ({ title: item.title, url: item.url, mark: workEmoji(item) }))),
1263
+ `Copied ${reviewed.length} reviewed link${reviewed.length === 1 ? "" : "s"} from ${label}`,
1264
+ )
1265
+ }
1266
+ />
1267
+ </View>
1254
1268
  </View>
1255
1269
  {open === label ? <Card items={reviewed} actions={actions} /> : null}
1256
1270
  </View>
package/client/icons.ts CHANGED
@@ -19,6 +19,8 @@ export const ICONS = {
19
19
  play: { 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=\"M7 4v16l13-8z\"/></svg>" },
20
20
  github: { 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=\"M9 19c-4.3 1.4-4.3-2.5-6-3m12 5v-3.5c0-1 .1-1.4-.5-2c2.8-.3 5.5-1.4 5.5-6a4.6 4.6 0 0 0-1.3-3.2a4.2 4.2 0 0 0-.1-3.2s-1.1-.3-3.5 1.3a12.3 12.3 0 0 0-6.2 0C6.5 2.8 5.4 3.1 5.4 3.1a4.2 4.2 0 0 0-.1 3.2A4.6 4.6 0 0 0 4 9.5c0 4.6 2.7 5.7 5.5 6c-.6.6-.6 1.2-.5 2V21\"/></svg>" },
21
21
  copy: { 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=\"M7 9.667A2.667 2.667 0 0 1 9.667 7h8.666A2.667 2.667 0 0 1 21 9.667v8.666A2.667 2.667 0 0 1 18.333 21H9.667A2.667 2.667 0 0 1 7 18.333z\"/><path d=\"M4.012 16.737A2 2 0 0 1 3 15V5c0-1.1.9-2 2-2h10c.75 0 1.158.385 1.5 1\"/></g></svg>" },
22
+ // Copies a Markdown list, where "copy" copies a bare link.
23
+ markdown: { 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 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/><path d=\"M7 15V9l2 2l2-2v6m3-2l2 2l2-2m-2 2V9\"/></g></svg>" },
22
24
  dismiss: { 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=\"M10.585 10.587a2 2 0 0 0 2.829 2.828\"/><path d=\"M16.681 16.673A8.7 8.7 0 0 1 12 18q-5.4 0-9-6q1.908-3.18 4.32-4.674m2.86-1.146A9 9 0 0 1 12 6q5.4 0 9 6q-1 1.665-2.138 2.87M3 3l18 18\"/></g></svg>" },
23
25
  // The plugin's logo in one colour, for the sidebar (assets/logo.svg).
24
26
  logo: { svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"207 195 585 585\" fill=\"currentColor\"><path d=\"M 562.9 297.9 C 577.2 309.5 586.1 323.3 595.5 338.9 C 599.6 345.7 603.7 352.3 607.9 358.9 C 624.5 384.8 640.6 410.9 656.4 437.3 C 659.6 442.7 662.8 448.1 666.1 453.4 C 667.3 455.5 668.6 457.6 669.8 459.7 C 670.4 460.6 670.9 461.5 671.5 462.5 C 673 465 674.5 467.5 676 470 C 675.7 470.7 675.3 471.3 675 472 C 673.8 470.7 672.5 469.4 671.2 468.1 C 640.6 436.7 605.7 416.8 561.3 415 C 497.3 414.6 443.8 453.2 399 495 C 397.6 496.3 396.2 497.6 394.8 498.9 C 384.5 508.6 374.3 518.3 365 529 C 362.7 531.3 360.3 533.7 358 536 C 355.7 538.7 353.3 541.3 351 544 C 349.4 545.8 347.8 547.5 346.1 549.3 C 342 553.8 338.1 558.5 334.3 563.2 C 331.9 566.1 329.5 568.8 327 571.5 C 322.9 575.9 319.1 580.5 315.3 585.1 C 312.8 588.2 310.2 591.3 307.6 594.3 C 302.9 599.9 298.4 605.5 293.9 611.3 C 290.7 615.4 287.4 619.4 284 623.5 C 279.8 628.6 275.6 633.8 271.5 639 C 248.5 668.5 248.5 668.5 241 671 C 234.5 671.8 229.5 671.7 223.5 668.9 C 219.1 665.2 215.8 661.5 214 656 C 213.3 646.3 216.7 639.9 222.3 632.2 C 223.4 630.8 224.5 629.3 225.6 627.8 C 226.7 626.2 227.8 624.6 229 623 C 231.3 619.7 233.6 616.5 235.9 613.2 C 237.1 611.5 238.2 609.8 239.4 608.1 C 240 607.3 240.6 606.4 241.2 605.6 C 243 603 244.8 600.4 246.6 597.8 C 252 590.2 257.3 582.5 262.6 574.8 C 267.3 568 272 561.3 276.7 554.7 C 282.5 546.5 288.2 538.2 293.9 530 C 297.3 525.1 300.6 520.3 304 515.5 C 305.3 513.6 306.7 511.7 308 509.7 C 364 429.2 364 429.2 366 426.4 C 367.3 424.5 368.7 422.5 370 420.6 C 373.3 415.8 376.7 411 380 406.2 C 388.5 394.1 396.9 381.8 405.2 369.6 C 408 365.5 410.8 361.5 413.6 357.4 C 418.2 350.7 422.7 343.9 427.2 337.1 C 428.4 335.4 429.6 333.6 430.8 331.8 C 432.7 328.9 434.6 326.1 436.5 323.2 C 450.8 302 470.3 287 495.6 281.4 C 520.2 278.3 542.9 282.9 562.9 297.9 Z\"/><path d=\"M 576.8 472.7 C 577.6 472.7 577.6 472.7 581.9 472.7 C 593.2 472.8 603.9 473.3 615 476 C 616.6 476.4 618.2 476.8 619.8 477.2 C 653.1 486.3 682.9 506.7 704 534 C 705.2 535.5 706.4 537 707.7 538.5 C 718.6 552.2 728.7 566.7 739 581 C 740.1 582.5 741.2 584 742.3 585.5 C 748.6 594.2 754.8 602.9 761 611.7 C 765.2 617.8 769.6 623.8 774 629.8 C 781.8 640.7 785.2 647.6 784 661 C 780.2 671 774.4 678.5 765 683.4 C 752.7 689 740.9 689.6 728 685 C 708.8 676.4 695.5 661.4 683 645 C 682.2 644 681.4 642.9 680.5 641.8 C 673.5 632.7 666.7 623.4 660 614 C 657.8 611 655.7 608 653.5 605 C 652.4 603.5 651.4 602 650.3 600.5 C 648.1 597.5 645.9 594.4 643.6 591.4 C 638.8 584.6 633.9 577.9 629.1 571.1 C 610.5 545.1 610.5 545.1 601 535 C 600 533.7 598.9 532.4 597.8 531.1 C 584 516.2 567 505.1 548 498 C 547 497.6 546 497.2 545 496.8 C 532.1 492.2 519.1 491.7 505.6 491.9 C 504.2 491.9 502.8 491.9 501.3 491.9 C 497.9 491.9 494.4 492 491 492 C 499.6 483.4 519 480.2 530.6 477.6 C 531.6 477.3 532.6 477.1 533.6 476.9 C 548 473.7 562 472.6 576.8 472.7 Z\"/><path fill-rule=\"evenodd\" d=\"M 510 543 C 510.5 543.2 510.5 543.2 512.8 544.3 C 530.3 552.9 543.5 569.8 550.4 587.8 C 553.3 597 554.3 605.2 554.3 614.8 C 554.3 615.9 554.3 617 554.4 618.1 C 554.4 639.1 544.4 657.2 530.3 672.2 C 524.8 677.5 518.7 681.3 512 685 C 511.2 685.5 511.2 685.5 506.9 687.8 C 488.9 695.8 468.4 696.2 449.7 689.9 C 427.8 681.2 412.1 665.9 402.5 644.6 C 395.2 626.6 394.4 606.4 401 588 C 404.9 578.8 409.5 570.6 416 563 C 416.9 561.9 417.8 560.7 418.7 559.5 C 442.5 534.3 479.1 528.1 510 543 Z M 465.2 570.6 C 471.2 574.4 474.4 578.4 477 585 C 477.5 591.4 476.9 596.2 474 602 C 468.5 607.4 464.9 609.9 457.2 610.3 C 452.1 610.2 448.4 609.8 444 607 C 436.8 599.4 435.5 596.1 435.6 585.8 C 436.2 580.3 438 577.8 442 574 C 450.1 569 456.1 567.2 465.2 570.6 Z\"/></svg>" },
@@ -20,7 +20,7 @@ import type { IconName } from "./icons";
20
20
  import type { FetchDetails } from "./attention-screen";
21
21
  import { CardList, CardRow, type Tone } from "./card";
22
22
  import { sessionEntry, startAnotherEntry } from "./session-menu";
23
- import { ActionSheet, DETAILS_STALE_MS, DetailLines, type DetailsQuery, detailsKey, Modal, type SheetEntry, usePrefetchOnRest } from "./sheet";
23
+ import { ActionSheet, DETAILS_STALE_MS, DetailLines, type DetailsQuery, detailsKey, githubEntry, Modal, type SheetEntry, usePrefetchOnRest } from "./sheet";
24
24
  import { githubColor, IssuePills, PlaceText } from "./entity";
25
25
  import { Button, KeepStyles, Meta, SectionHeader, TablerIcon, useHover, useStyles } from "./ui";
26
26
 
@@ -395,7 +395,8 @@ function IssueSheet({
395
395
  claim
396
396
  ? { key: "claim", icon: "claim", label: "Claim", detail: "Assigns you, without starting a session", onPress: close(() => onClaim(issue, true)) }
397
397
  : { key: "unclaim", icon: "unclaim", label: "Unclaim", detail: "Removes you as assignee, so it goes back to Unclaimed", housekeeping: true, onPress: close(() => onClaim(issue, false)) },
398
- { key: "github", icon: "github", label: "Open issue on GitHub", detail: `${issue.repo}#${issue.number}`, onPress: close(() => void openExternalUrl(issue.url)) },
398
+ // Someone's PR open against it sits beside the issue [ATT-12].
399
+ githubEntry({ kind: "issue", ...issue }, (url) => close(() => void openExternalUrl(url))(), issue.openPrs[0]),
399
400
  ...(sessions.length ? [startAnotherEntry(true, withOptions)] : []),
400
401
  // Giving it up or closing it sits apart, below the work [ATT-06].
401
402
  { key: "close", icon: "issueClosed", label: "Close issue", detail: "Asks first: as completed or not planned, with an optional comment", housekeeping: true, onPress: close(onCloseIssue) },
package/client/sheet.tsx CHANGED
@@ -22,12 +22,17 @@ export interface SheetEntry {
22
22
  detailNode?: ReactNode;
23
23
  // Said on hover, and to screen readers, for a line that can't show everything [ATT-19].
24
24
  hint?: string;
25
+ // What screen readers say in place of the label, where the label alone doesn't say what it opens.
26
+ accessibilityLabel?: string;
25
27
  // A line that changes while the sheet is open, so screen readers say it when it does.
26
28
  live?: boolean;
27
29
  disabled?: boolean;
28
30
  onPress: () => void;
29
31
  // A copy icon at the end of the line, so copying adds no line to the sheet [ATT-15].
30
32
  copy?: { text: string; label: string; done: string };
33
+ // A second half with the same weight, like an issue's PR beside the issue: side by side, or one above the other on
34
+ // phones, so neither half is cut short [ATT-12].
35
+ beside?: Pick<SheetEntry, "icon" | "label" | "detail" | "accessibilityLabel" | "onPress" | "copy">;
31
36
  // A running session's state at the end of the line: the line opens it [SES-03, ATT-07].
32
37
  badge?: Chip;
33
38
  // Muted, for a line that's there on purpose but rarely wanted, like starting another session.
@@ -72,32 +77,59 @@ function EntryGroup({ entries }: { entries: SheetEntry[] }) {
72
77
  const INNER_RADIUS = 11;
73
78
 
74
79
  function Entry({ entry, first, last }: { entry: SheetEntry; first: boolean; last: boolean }) {
80
+ const styles = useStyles();
81
+ const beside = entry.beside;
82
+ const stacked = !!beside && styles.compact;
83
+ const line = first ? null : { borderTopWidth: 1, borderTopColor: styles.c.surface1 };
84
+ if (!beside) {
85
+ return (
86
+ <View style={[styles.row, { gap: 0, alignItems: "stretch" }, line]}>
87
+ <Half entry={entry} corners={{ topLeft: first, bottomLeft: last, topRight: first, bottomRight: last }} />
88
+ </View>
89
+ );
90
+ }
91
+ // Two halves: side by side with a short divider, or on phones one above the other with a line like the sheet's own.
92
+ return (
93
+ <View style={[stacked ? null : [styles.row, { gap: 0, alignItems: "stretch" }], line]}>
94
+ <Half entry={entry} corners={stacked ? { topLeft: first, topRight: first } : { topLeft: first, bottomLeft: last }} />
95
+ {stacked ? (
96
+ <View style={{ height: 1, backgroundColor: styles.c.surface1 }} />
97
+ ) : (
98
+ <View style={{ width: 1, marginVertical: 8, backgroundColor: styles.c.border }} />
99
+ )}
100
+ <Half entry={{ key: `${entry.key}-beside`, ...beside }} corners={stacked ? { bottomLeft: last, bottomRight: last } : { topRight: first, bottomRight: last }} />
101
+ </View>
102
+ );
103
+ }
104
+
105
+ // A line's pressable part and its copy icon. The pressed and hovered fill follows the block's rounded corners where it
106
+ // touches them; the copy icon has its own fill at the right.
107
+ function Half({ entry, corners }: { entry: SheetEntry; corners: { topLeft?: boolean; bottomLeft?: boolean; topRight?: boolean; bottomRight?: boolean } }) {
75
108
  const styles = useStyles();
76
109
  const { hovered, hover } = useHover();
77
110
  const copy = useCopy();
78
111
  const muted = styles.c.foregroundMuted;
79
112
  const dim = entry.disabled || entry.quiet;
80
- // The pressed and hovered fill follows the block's rounded corners; the copy icon has its own at the right.
81
- const corners = {
82
- borderTopLeftRadius: first ? INNER_RADIUS : 0,
83
- borderBottomLeftRadius: last ? INNER_RADIUS : 0,
84
- borderTopRightRadius: first && !entry.copy ? INNER_RADIUS : 0,
85
- borderBottomRightRadius: last && !entry.copy ? INNER_RADIUS : 0,
113
+ const radius = {
114
+ borderTopLeftRadius: corners.topLeft ? INNER_RADIUS : 0,
115
+ borderBottomLeftRadius: corners.bottomLeft ? INNER_RADIUS : 0,
116
+ borderTopRightRadius: corners.topRight && !entry.copy ? INNER_RADIUS : 0,
117
+ borderBottomRightRadius: corners.bottomRight && !entry.copy ? INNER_RADIUS : 0,
86
118
  };
87
119
  const detail = entry.detailNode ?? (entry.detail ? <Text style={styles.muted}>{entry.detail}</Text> : null);
88
120
  return (
89
- <View style={[styles.row, { gap: 0, alignItems: "stretch" }, first ? null : { borderTopWidth: 1, borderTopColor: styles.c.surface1 }]}>
121
+ <View style={[styles.row, { flex: 1, gap: 0, alignItems: "stretch", minWidth: 0 }]}>
90
122
  <Pressable
91
123
  accessibilityRole="button"
92
124
  // The button's name is all a screen reader says of it, so a hint goes in it too.
93
- accessibilityLabel={entry.hint ? `${entry.label}. ${entry.hint}` : entry.label}
125
+ accessibilityLabel={[entry.accessibilityLabel ?? entry.label, entry.hint].filter(Boolean).join(". ")}
94
126
  accessibilityState={{ disabled: !!entry.disabled }}
95
127
  disabled={entry.disabled}
96
128
  onPress={entry.onPress}
97
129
  {...hover}
98
130
  style={({ pressed }) => [
99
131
  styles.row,
100
- corners,
132
+ radius,
101
133
  { flex: 1, alignItems: "flex-start", paddingVertical: 10, paddingHorizontal: 12, backgroundColor: pressed || hovered ? styles.c.border : "transparent" },
102
134
  ]}
103
135
  >
@@ -129,6 +161,39 @@ function Entry({ entry, first, last }: { entry: SheetEntry; first: boolean; last
129
161
  );
130
162
  }
131
163
 
164
+ // The line that opens an item on GitHub, for anything Attention Span doesn't cover [ATT-12], with its link to share [ATT-15].
165
+ // An issue with a PR has the PR beside it, with the same weight, so reaching the PR doesn't mean going through the issue;
166
+ // in a stack it's the PR the actions apply to, and says where it sits.
167
+ export function githubEntry(
168
+ item: { kind: "pr" | "issue"; repo: string; number: number; url: string },
169
+ onOpen: (url: string) => void,
170
+ pr?: { number: number; url: string; stack?: { number: number }[] },
171
+ ): SheetEntry {
172
+ const copy = (number: number, url: string) => ({ text: url, label: `Copy link to #${number}`, done: `Copied link to #${number}` });
173
+ if (!pr || item.kind !== "issue") {
174
+ return { key: "github", icon: "github", label: `Open ${item.kind === "issue" ? "issue" : "PR"} on GitHub`, detail: `${item.repo}#${item.number}`, onPress: () => onOpen(item.url), copy: copy(item.number, item.url) };
175
+ }
176
+ // The repo is on the sheet's top line already, so each half says only its number.
177
+ const place = pr.stack && pr.stack.length > 1 ? pr.stack.findIndex((p) => p.number === pr.number) : -1;
178
+ return {
179
+ key: "github",
180
+ icon: "github",
181
+ label: "Open issue",
182
+ detail: `#${item.number}`,
183
+ accessibilityLabel: `Open issue #${item.number} on GitHub`,
184
+ onPress: () => onOpen(item.url),
185
+ copy: copy(item.number, item.url),
186
+ beside: {
187
+ icon: "github",
188
+ label: "Open PR",
189
+ detail: place >= 0 ? `#${pr.number} · ${place + 1} of ${pr.stack!.length}` : `#${pr.number}`,
190
+ accessibilityLabel: `Open PR #${pr.number} on GitHub${place >= 0 ? `, ${place + 1} of ${pr.stack!.length} in its stack` : ""}`,
191
+ onPress: () => onOpen(pr.url),
192
+ copy: copy(pr.number, pr.url),
193
+ },
194
+ };
195
+ }
196
+
132
197
  // A state as a pill on a soft tint of its tone.
133
198
  function Badge(chip: Chip) {
134
199
  const styles = useStyles();
package/client/ui.tsx CHANGED
@@ -29,6 +29,8 @@ export function makeStyles(theme: Theme, compact: boolean) {
29
29
  danger: { color: c.statusDanger, fontSize: 13 },
30
30
  title: { color: c.foreground, fontSize: 16, fontWeight: "600" as const, flexShrink: 1 },
31
31
  card: { backgroundColor: c.surface1, borderRadius: 12, borderWidth: 1, borderColor: c.border, overflow: "hidden" as const },
32
+ // Over a card, lines a button up with its cards' last column: their padding plus the card's border.
33
+ overCard: { marginRight: (compact ? 12 : 16) + 1 },
32
34
  item: { padding: compact ? 12 : 16, gap: 10, flexDirection: "row" as const, alignItems: "flex-start" as const },
33
35
  divider: { borderTopWidth: 1, borderTopColor: c.border },
34
36
  body: { flex: 1, gap: 6, minWidth: 0 },
@@ -113,7 +113,7 @@ Projects are extra, so they never cost the searches they ride on (`server/projec
113
113
  A card shows its main action and ›. Tapping the card or › opens its **sheet**, a bottom sheet on phones and a dialog on desktop [ATT-06]. When the sheet would hold a single action, as on Waiting and History cards where it's only Open PR (or issue) on GitHub, the card shows that action instead of ›; tapping the card still opens the sheet. History cards also have a copy icon that copies the item's URL [ATT-15]. Top to bottom, the sheet has:
114
114
 
115
115
  1. **What the card knows:** repo#number, its chips, the full quote and the full stack. Each PR in the stack opens on GitHub, so an issue's PRs are a tap away [ATT-12]. On an issue, the PR its actions apply to is tinted in the stack and says "actions apply here", and its chips are said once, on its row: the top keeps only what the row doesn't say [ATT-04].
116
- 2. **Every action,** each with a line saying what it will do, in one list, with what takes the item off my list or gives it up (Dismiss, Unclaim, Close issue, Close PR) apart below the work, icons quiet. A session action's line asks first: it ends in "…" and opens Options, since the card's button is the one-tap start [SES-01, SES-02]. Once a session of that kind runs, the line opens it instead and shows its state as a badge (working, idle, needs you, failed) [SES-03, ATT-07]. Then Open issue or Open PR on GitHub [ATT-12], with a copy icon at its end that copies the URL without adding a line [ATT-15], a muted "Start a session…" ("Start another session…" once there is one) for a session with no action preset [SES-02], and Dismiss [ATT-08].
116
+ 2. **Every action,** each with a line saying what it will do, in one list, with what takes the item off my list or gives it up (Dismiss, Unclaim, Close issue, Close PR) apart below the work, icons quiet. A session action's line asks first: it ends in "…" and opens Options, since the card's button is the one-tap start [SES-01, SES-02]. Once a session of that kind runs, the line opens it instead and shows its state as a badge (working, idle, needs you, failed) [SES-03, ATT-07]. Then Open issue or Open PR on GitHub [ATT-12], with a copy icon at its end that copies the URL without adding a line [ATT-15]. An issue with a PR splits that line in two halves of the same weight, "Open issue #90" and "Open PR #103 · 1 of 2", each with its own copy icon, side by side on desktop and one above the other on phones: the PR is the one its actions apply to (in Next up, the first open PR against it), so reaching it doesn't mean going through the issue on GitHub. Then a muted "Start a session…" ("Start another session…" once there is one) for a session with no action preset [SES-02], and Dismiss [ATT-08].
117
117
  3. **What's fetched when it opens,** in one GraphQL request, so the refresh stays as light as before [GH-01]: the PR's size, led by its number on an issue's sheet ("PR #103 · +149 −15 · 5 files"), and the linked issue or PRs, leaving out PRs the stack already shows. It comes last so the actions don't move when it arrives. The description isn't shown; making sense of it takes GitHub anyway.
118
118
 
119
119
  An agent icon (Tabler's `message-ai`, a speech bubble with "AI") marks every action that starts or continues an agent session, marked *(agent)* below; the rest change GitHub right away [ATT-13]. GitHub actions don't ask first, apart from Merge and Close. Instead an Undo row appears, where GitHub can take it back, until I switch tabs [ATT-14].
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrioid/paseo-attention-span",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "description": "For when your attention is spread thin: the GitHub issues and pull requests waiting on you, grouped by why, with one-tap Paseo sessions.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/requirements.yaml CHANGED
@@ -109,7 +109,7 @@ functional:
109
109
  As a developer, I can:
110
110
  HIS-01: see the issues and pull requests I finished, grouped by week; so that I can tell others what I got done.
111
111
  HIS-02: see pull requests I reviewed that merged, apart from my own work; so that I can tell others what I got done.
112
- HIS-03: copy a week's finished work as a Markdown list of links; so that reporting progress is one paste.
112
+ HIS-03: copy a week's finished work as a Markdown list of links, and the pull requests I reviewed that week as a list of their own; so that reporting progress is one paste.
113
113
  HIS-04: see what kind of work each finished item was, bug, feature or task, from its issue type, else its labels, else a Conventional Commit title like "fix: …", on its card and leading its copied line like "- 🐞 [title](link)", with PRs of no kind led by 🔀 and issues closed as not planned left out of the copy; so that a busy week's report skims at a glance in any repo.
114
114
  feedback:
115
115
  As a developer, I can: