@andrioid/paseo-attention-span 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/OVERVIEW.md CHANGED
@@ -10,11 +10,11 @@ This is the tab you'll live in. Items are grouped by reason: someone's waiting f
10
10
 
11
11
  At the top is **Wrap up**. It lists merged, closed or handed-off work that still has a Paseo session open. Archive puts the session and its worktree away. It leaves alone worktrees another session still uses, and your own checkout. It also checks for uncommitted or unpushed work first, because there's no Undo.
12
12
 
13
- ![Doing](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.5/docs/screenshots/desktop-dark-doing.png)
13
+ ![Doing](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.6/docs/screenshots/desktop-dark-doing.png)
14
14
 
15
15
  Every item has one main button that matches why it's there: Reply, Review, Fix CI, Merge. Open the item to see every action, each with a line saying what it'll do. I wanted buttons you can press without wondering what's about to happen to your repo.
16
16
 
17
- ![An item's actions](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.5/docs/screenshots/desktop-dark-doing-sheet.png)
17
+ ![An item's actions](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.6/docs/screenshots/desktop-dark-doing-sheet.png)
18
18
 
19
19
  Mentions clear when you reply or react. Team mentions don't count, because "@everyone-in-backend" isn't really a question for *me*. If something's just an FYI, dismiss it.
20
20
 
@@ -24,7 +24,7 @@ This is your work where someone else has the next move: a review you asked for,
24
24
 
25
25
  Otherwise there's nothing to do here, and that's kind of the point. It's tracked, so you can stop holding it in your head.
26
26
 
27
- ![Waiting](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.5/docs/screenshots/desktop-dark-waiting.png)
27
+ ![Waiting](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.6/docs/screenshots/desktop-dark-waiting.png)
28
28
 
29
29
  ## Next up
30
30
 
@@ -32,7 +32,7 @@ For when your plate is clear. It does happen. Issues assigned to you come first,
32
32
 
33
33
  **Start** launches an agent that reads the issue and proposes a plan. **New issue** (also in ⌘K) takes a line or two, and an agent turns that into a proper issue. It checks for duplicates and shows you the result before anything goes to GitHub.
34
34
 
35
- ![Next up](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.5/docs/screenshots/desktop-dark-next-up.png)
35
+ ![Next up](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.6/docs/screenshots/desktop-dark-next-up.png)
36
36
 
37
37
  ## History
38
38
 
@@ -40,7 +40,7 @@ What you finished in recent weeks, grouped by week. There's a copy button per we
40
40
 
41
41
  Things other people did to your work, like merging your PR or taking an issue over, wait at the top until you've seen them. None of it is a to-do, but it shouldn't happen behind your back either.
42
42
 
43
- ![History](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.5/docs/screenshots/desktop-dark-history.png)
43
+ ![History](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.6/docs/screenshots/desktop-dark-history.png)
44
44
 
45
45
  ## Agent sessions
46
46
 
@@ -28,7 +28,7 @@ import { History } from "./history";
28
28
  import { WrapUp } from "./wrap-up";
29
29
  import { SetupChecklist } from "./setup";
30
30
  import { UpdateNotice } from "./update";
31
- import { Avatar, Button, Loading, SectionHeader, SpinningIcon, StylesProvider, TablerIcon, tint, useCopy, useStyles } from "./ui";
31
+ import { Avatar, Button, Hint, Loading, SectionHeader, SpinningIcon, StylesProvider, TablerIcon, tint, useCopy, useStyles } from "./ui";
32
32
 
33
33
  const SECTION_ICONS: Record<SectionId, IconName> = {
34
34
  reply: "reply",
@@ -164,21 +164,26 @@ function AttentionList({
164
164
  ))}
165
165
  </View>
166
166
  <View style={[styles.row, { gap: 16 }]}>
167
- <Pressable
168
- accessibilityRole="button"
169
- accessibilityLabel="Refresh now"
170
- accessibilityState={{ busy: refreshing, disabled: pressed }}
171
- disabled={pressed}
172
- style={styles.row}
173
- onPress={() => void attention.refreshNow(TAB_FEED[tab]).catch(() => {})}
174
- >
175
- <SpinningIcon name="update" size={14} spinning={refreshing} />
176
- <Text style={styles.muted}>{feed.fetchedAt ? `${ago(feed.fetchedAt)} ago` : "never"}</Text>
177
- </Pressable>
178
- {openSettings ? (
179
- <Pressable accessibilityRole="button" accessibilityLabel="Attention Span settings" onPress={openSettings} hitSlop={8}>
180
- <TablerIcon name="settings" size={16} />
167
+ <Hint text="Refresh now" inline>
168
+ <Pressable
169
+ accessibilityRole="button"
170
+ accessibilityLabel="Refresh now"
171
+ accessibilityState={{ busy: refreshing, disabled: pressed }}
172
+ disabled={pressed}
173
+ style={styles.row}
174
+ onPress={() => void attention.refreshNow(TAB_FEED[tab]).catch(() => {})}
175
+ >
176
+ <SpinningIcon name="update" size={14} spinning={refreshing} />
177
+ <Text style={styles.muted}>{feed.fetchedAt ? `${ago(feed.fetchedAt)} ago` : "never"}</Text>
181
178
  </Pressable>
179
+ </Hint>
180
+ {openSettings ? (
181
+ <Hint text="Settings" inline>
182
+ {/* Padding, not hitSlop: native only reaches as far as the hint's wrapper, which hugs the icon. */}
183
+ <Pressable accessibilityRole="button" accessibilityLabel="Attention Span settings" onPress={openSettings} style={{ padding: 8, margin: -8 }}>
184
+ <TablerIcon name="settings" size={16} />
185
+ </Pressable>
186
+ </Hint>
182
187
  ) : null}
183
188
  </View>
184
189
  </View>
@@ -362,7 +367,7 @@ function Waiting({ groups, actions }: { groups: WaitingGroup[]; actions: Actions
362
367
  action={
363
368
  who && !who.bot ? (
364
369
  <View style={styles.overCard}>
365
- <Button icon="markdown" variant="ghost" accessibilityLabel={`Copy what waits on ${who.login}`} onPress={() => nudge(who.login)} />
370
+ <Button icon="copy" variant="ghost" accessibilityLabel={`Copy what waits on ${who.login}`} onPress={() => nudge(who.login)} />
366
371
  </View>
367
372
  ) : null
368
373
  }
package/client/card.tsx CHANGED
@@ -61,7 +61,8 @@ export interface CardProps {
61
61
 
62
62
  export function CardList({ children }: { children: ReactNode }) {
63
63
  const styles = useStyles();
64
- return <View style={styles.card}>{children}</View>;
64
+ // Unclipped, so an action's hint can show above it on the first row.
65
+ return <View style={[styles.card, { overflow: "visible" }]}>{children}</View>;
65
66
  }
66
67
 
67
68
  export function CardRow({ first, mark, title, meta, accessibilityLabel, onOpen, hover, primary, secondary, busy, extra, confirm, overlay }: CardProps & { first: boolean }) {
@@ -96,7 +96,7 @@ export function History({
96
96
  links > 0 ? (
97
97
  <View style={styles.overCard}>
98
98
  <Button
99
- icon="markdown"
99
+ icon="copy"
100
100
  variant="ghost"
101
101
  accessibilityLabel={`Copy links from ${label}`}
102
102
  onPress={() => copy(week.copy.text, `Copied ${links} link${links === 1 ? "" : "s"} from ${label}`)}
package/client/icons.ts CHANGED
@@ -19,8 +19,6 @@ 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>" },
24
22
  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>" },
25
23
  // The plugin's logo in one colour, for the sidebar (assets/logo.svg).
26
24
  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>" },
package/client/ui.tsx CHANGED
@@ -234,7 +234,10 @@ export function Hint({ text, inline, children }: { text: string; inline?: boolea
234
234
  setPlacement(null);
235
235
  };
236
236
  const where: ViewStyle =
237
- placement?.side === "beside" ? { left: "100%", marginLeft: HINT_GAP, bottom: -2 } : { left: placement?.offset ?? 0, bottom: "100%", marginBottom: 4 };
237
+ placement?.side === "beside"
238
+ ? { left: "100%", marginLeft: HINT_GAP, bottom: -2 }
239
+ : // Shifted left to fit near the right edge: kept to that edge, so it stays over what it's about.
240
+ { left: placement?.offset ?? 0, bottom: "100%", marginBottom: 4, alignItems: placement && placement.offset < 0 ? "flex-end" : "flex-start" };
238
241
  return (
239
242
  // Raised while shown: every view is its own layer here, so the words would otherwise sit under whatever follows.
240
243
  <View ref={self} accessibilityLabel={text} onPointerEnter={show} onPointerLeave={hide} style={[inline ? null : { alignSelf: "flex-start" }, placement ? { zIndex: 10 } : null]}>
@@ -312,13 +315,15 @@ export function Button({
312
315
  disabled?: boolean;
313
316
  busy?: boolean;
314
317
  pressed?: boolean;
318
+ // An icon-only button shows it on hover too, so every icon says what it does.
315
319
  accessibilityLabel?: string;
316
320
  }) {
317
321
  const styles = useStyles();
318
322
  const { hovered, hover } = useHover();
319
323
  const { c } = styles;
324
+ const tip = label ? undefined : accessibilityLabel;
320
325
  const color = variant === "solid" ? c.accentForeground : variant === "calm" ? styles.action : variant === "ghost" ? c.foregroundMuted : variant === "danger" ? c.statusDanger : c.foreground;
321
- return (
326
+ const button = (
322
327
  <Pressable
323
328
  accessibilityRole="button"
324
329
  accessibilityLabel={accessibilityLabel ?? label ?? icon}
@@ -342,6 +347,13 @@ export function Button({
342
347
  {label ? <Text style={{ color, fontSize: 13, fontWeight: "600" }}>{label}</Text> : null}
343
348
  </Pressable>
344
349
  );
350
+ return tip ? (
351
+ <Hint text={tip} inline>
352
+ {button}
353
+ </Hint>
354
+ ) : (
355
+ button
356
+ );
345
357
  }
346
358
 
347
359
  // Filter, with how many ticks are on [NXT-03, HIS-07].
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrioid/paseo-attention-span",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
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/shared/hint.ts CHANGED
@@ -5,6 +5,8 @@
5
5
  export const HINT_GAP = 8;
6
6
  // Less room than this beside the content, and the hint goes above it instead.
7
7
  export const HINT_MIN_WIDTH = 160;
8
+ // Above content near the area's right edge, it may shift left this far, so a button's label fits on a line.
9
+ export const HINT_ABOVE_WIDTH = 240;
8
10
 
9
11
  export type HintPlacement =
10
12
  | { side: "beside"; width: number }
@@ -16,6 +18,6 @@ export function hintPlacement(x: number, width: number, left: number, right: num
16
18
  if (beside >= HINT_MIN_WIDTH) return { side: "beside", width: beside };
17
19
  // From the content's left edge to the area's right; where that's too narrow, as wide as needed by shifting left, but never
18
20
  // wider than the area.
19
- const span = Math.min(Math.max(HINT_MIN_WIDTH, right - x), right - left);
21
+ const span = Math.min(Math.max(HINT_ABOVE_WIDTH, right - x), right - left);
20
22
  return { side: "above", width: span, offset: Math.min(0, right - span - x) };
21
23
  }