@andrioid/paseo-attention-span 0.7.5 → 0.8.0
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 +6 -6
- package/client/attention-screen.tsx +21 -16
- package/client/card.tsx +2 -1
- package/client/coverage-settings.tsx +20 -1
- package/client/history.tsx +1 -1
- package/client/icons.ts +0 -2
- package/client/item-row.tsx +5 -5
- package/client/ui.tsx +14 -2
- package/docs/architecture.md +5 -3
- package/docs/screenshots/desktop-dark-doing-acknowledge.png +0 -0
- package/docs/screenshots/desktop-dark-doing-clear.png +0 -0
- package/docs/screenshots/desktop-dark-doing-issue-sheet.png +0 -0
- package/docs/screenshots/desktop-dark-doing-reviewers.png +0 -0
- package/docs/screenshots/desktop-dark-doing-sheet.png +0 -0
- package/docs/screenshots/desktop-dark-doing-wrap-dirty.png +0 -0
- package/docs/screenshots/desktop-dark-doing-wrap-multi.png +0 -0
- package/docs/screenshots/desktop-dark-doing-wrap.png +0 -0
- package/docs/screenshots/desktop-dark-doing.png +0 -0
- package/docs/screenshots/desktop-dark-history-filtered.png +0 -0
- package/docs/screenshots/desktop-dark-history-groups.png +0 -0
- package/docs/screenshots/desktop-dark-history.png +0 -0
- package/docs/screenshots/desktop-dark-next-up-setup.png +0 -0
- package/docs/screenshots/desktop-dark-next-up.png +0 -0
- package/docs/screenshots/desktop-dark-settings.png +0 -0
- package/docs/screenshots/desktop-dark-waiting-too-long.png +0 -0
- package/docs/screenshots/desktop-dark-waiting.png +0 -0
- package/docs/screenshots/phone-dark-doing.png +0 -0
- package/docs/screenshots/phone-dark-history.png +0 -0
- package/docs/screenshots/phone-light-next-up-filtered.png +0 -0
- package/index.server.ts +1 -0
- package/package.json +1 -1
- package/requirements.yaml +2 -2
- package/server/classify.ts +15 -11
- package/server/fetch.ts +1 -1
- package/server/fixture.ts +2 -1
- package/server/github-types.ts +5 -1
- package/server/markdown.ts +4 -1
- package/server/queries.ts +8 -3
- package/server/rules.ts +8 -4
- package/server/service.ts +6 -0
- package/server/setup.ts +3 -3
- package/server/store.ts +6 -1
- package/shared/attention.ts +1 -1
- package/shared/config.ts +2 -0
- package/shared/hint.ts +3 -1
- package/shared/item-view.ts +6 -1
- package/shared/rpc.ts +2 -0
- package/shared/setup.ts +2 -0
package/OVERVIEW.md
CHANGED
|
@@ -10,21 +10,21 @@ 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
|
-

|
|
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
|
-

|
|
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
|
|
|
21
21
|
## Waiting
|
|
22
22
|
|
|
23
|
-
This is your work where someone else has the next move: a review you asked for, CI running, a question nobody's answered. It's grouped by who you're waiting on. After three days an item turns amber, but only when a nudge would be fair. **Copy list** gives you that person's items as Markdown, ready to paste into a message.
|
|
23
|
+
This is your work where someone else has the next move: a review you asked for, CI running, a question nobody's answered, someone you tagged who hasn't replied. It's grouped by who you're waiting on. After three days an item turns amber, but only when a nudge would be fair. **Copy list** gives you that person's items as Markdown, ready to paste into a message.
|
|
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
|
-

|
|
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
|
-

|
|
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
|
-

|
|
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
|
-
<
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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="
|
|
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
|
-
|
|
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 }) {
|
|
@@ -34,6 +34,7 @@ function Coverage() {
|
|
|
34
34
|
const save = useRpc(rpc.setCoverage);
|
|
35
35
|
const saveNextUp = useRpc(rpc.setNextUpSources);
|
|
36
36
|
const saveFollow = useRpc(rpc.setFollowThreads);
|
|
37
|
+
const saveOnlyQuestions = useRpc(rpc.setOnlyQuestionsWait);
|
|
37
38
|
const saveFields = useRpc(rpc.setNextUpFields);
|
|
38
39
|
const coverage = useQuery({ queryKey: COVERAGE_QUERY_KEY, queryFn: () => fetchCoverage({}) });
|
|
39
40
|
const [saving, setSaving] = useState(false);
|
|
@@ -47,7 +48,7 @@ function Coverage() {
|
|
|
47
48
|
</SettingsCard>
|
|
48
49
|
</SettingsSection>
|
|
49
50
|
);
|
|
50
|
-
const { orgs, repos, nextUp, fields, followThreads } = coverage.data;
|
|
51
|
+
const { orgs, repos, nextUp, fields, followThreads, onlyQuestionsWait } = coverage.data;
|
|
51
52
|
// A file that doesn't parse is left for the person who edited it.
|
|
52
53
|
if (coverage.data.error)
|
|
53
54
|
return (
|
|
@@ -131,6 +132,24 @@ function Coverage() {
|
|
|
131
132
|
: "Only tags bring other people's threads back. Your own issues and PRs show any recent reply."}
|
|
132
133
|
</Text>
|
|
133
134
|
</View>
|
|
135
|
+
<View style={{ gap: 8 }}>
|
|
136
|
+
<SettingsSection title="Waiting">
|
|
137
|
+
<SettingsCard>
|
|
138
|
+
<SettingsSwitch
|
|
139
|
+
label="Only questions wait"
|
|
140
|
+
hint="A comment that tags someone waits on them only if it asks a question"
|
|
141
|
+
value={onlyQuestionsWait}
|
|
142
|
+
disabled={saving}
|
|
143
|
+
onValueChange={(on) => void write({ onlyQuestionsWait: on }, () => saveOnlyQuestions({ on }))}
|
|
144
|
+
/>
|
|
145
|
+
</SettingsCard>
|
|
146
|
+
</SettingsSection>
|
|
147
|
+
<Text style={[styles.muted, CAPTION]}>
|
|
148
|
+
{onlyQuestionsWait
|
|
149
|
+
? "Your issues and comments wait on someone only when they ask a question. Tagging someone without asking waits on nobody."
|
|
150
|
+
: "Your issues and comments wait on whoever they tag, and on an answer to any question, until someone replies."}
|
|
151
|
+
</Text>
|
|
152
|
+
</View>
|
|
134
153
|
<View style={{ gap: 4 }}>
|
|
135
154
|
{error ? <Text style={styles.danger}>{error}</Text> : null}
|
|
136
155
|
{/* Until more moves here, point to the file for the rest. */}
|
package/client/history.tsx
CHANGED
|
@@ -96,7 +96,7 @@ export function History({
|
|
|
96
96
|
links > 0 ? (
|
|
97
97
|
<View style={styles.overCard}>
|
|
98
98
|
<Button
|
|
99
|
-
icon="
|
|
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/item-row.tsx
CHANGED
|
@@ -9,7 +9,7 @@ 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
|
-
import { actionLabel, alsoWaitingOn, cardStack, cardWhen, copiesLink, rerunState, sessionSignal, type SheetStep, sheetPlan, soleStep, stackMetaChips, targetUrl, waitChips } from "../shared/item-view";
|
|
12
|
+
import { actionLabel, alsoWaitingOn, cardStack, cardWhen, copiesLink, rerunState, sessionSignal, type SheetStep, sheetPlan, soleStep, stackMetaChips, targetUrl, waitChips, waitedSince } from "../shared/item-view";
|
|
13
13
|
import { CardList, CardRow } from "./card";
|
|
14
14
|
import { PlaceText } from "./entity";
|
|
15
15
|
import type { IconName } from "./icons";
|
|
@@ -125,7 +125,7 @@ export function ItemRow({ item, first, actions, group }: { item: Item; first: bo
|
|
|
125
125
|
const waits = waitChips(item, !!group, actions.config.waitingTooLongDays);
|
|
126
126
|
// The group names one; the card names the rest [WAI-01].
|
|
127
127
|
const others = alsoWaitingOn(item, group?.who);
|
|
128
|
-
const waitingOn = group ? null : item.waitingOn ? <WaitingOnLine people={item.waitingOn}
|
|
128
|
+
const waitingOn = group ? null : item.waitingOn ? <WaitingOnLine people={item.waitingOn} reason={item.wait?.reason} expanded={false} /> : null;
|
|
129
129
|
const alsoOn = others.length ? <Text style={styles.muted}>also waiting on {others.join(", ")}</Text> : null;
|
|
130
130
|
const [sheet, setSheet] = useState<Sheet>(null);
|
|
131
131
|
const [confirm, setConfirm] = useState<"merge" | "close" | null>(null);
|
|
@@ -246,7 +246,7 @@ function ItemSheet({ item, waitChips, sessions, actions, ...handlers }: { item:
|
|
|
246
246
|
{/* Number first, as on the card; the sheet always names the owner, even of my own repos [ATT-20]. */}
|
|
247
247
|
<Meta lead={<PlaceText place={{ repo: item.repo, number: item.number, login: null }} />} facts={meta} chips={[...waitChips, ...stackMetaChips(item, targetRow)]} />
|
|
248
248
|
{item.person ? <PersonQuote person={item.person} expanded /> : null}
|
|
249
|
-
{item.waitingOn ? <WaitingOnLine people={item.waitingOn}
|
|
249
|
+
{item.waitingOn ? <WaitingOnLine people={item.waitingOn} reason={item.wait?.reason} expanded /> : null}
|
|
250
250
|
{item.children.length > 0 ? <StackLine rows={item.children} links target={targetRow?.key} /> : null}
|
|
251
251
|
</>
|
|
252
252
|
}
|
|
@@ -351,7 +351,7 @@ const MAX_FACES = 5;
|
|
|
351
351
|
|
|
352
352
|
// Who my work waits on: one by name, several by picture, named on hover, and each by name in the sheet [WAI-02].
|
|
353
353
|
// On an issue they're who my question tagged; on a PR, reviewers since my last push or reply [WAI-02, ATT-19].
|
|
354
|
-
function WaitingOnLine({ people,
|
|
354
|
+
function WaitingOnLine({ people, reason, expanded }: { people: WaitingOn[]; reason: string | undefined; expanded: boolean }) {
|
|
355
355
|
const styles = useStyles();
|
|
356
356
|
const [hovered, setHovered] = useState<string | null>(null);
|
|
357
357
|
const name = (login: string) => (
|
|
@@ -360,7 +360,7 @@ function WaitingOnLine({ people, asked, expanded }: { people: WaitingOn[]; asked
|
|
|
360
360
|
</Text>
|
|
361
361
|
);
|
|
362
362
|
const since = (at: string) => <Text style={styles.muted}>· {ago(at)}</Text>;
|
|
363
|
-
const explain = (logins: string[], at: string) => `Waiting on ${logins.join(", ")} since ${
|
|
363
|
+
const explain = (logins: string[], at: string) => `Waiting on ${logins.join(", ")} since ${waitedSince(reason)}, ${ago(at)} ago`;
|
|
364
364
|
if (expanded || people.length === 1) {
|
|
365
365
|
return (
|
|
366
366
|
<View style={{ gap: 6 }}>
|
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"
|
|
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
|
-
|
|
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/docs/architecture.md
CHANGED
|
@@ -29,12 +29,13 @@ flowchart LR
|
|
|
29
29
|
- With several hosts, each runs its own copy, with its own `gh` login, `config.json` and `state.json`. Paseo shows one sidebar row for all of them and switches hosts with the picker in the screen's header; the row follows the host in view, else the one picked last.
|
|
30
30
|
- **GitHub access** goes through the host's existing `gh` login. The plugin stores no token [SEC-01]. Projects need the `read:project` scope, which `gh auth login` doesn't ask for; Next up reads them only once the login has it [NXT-12].
|
|
31
31
|
- **Setup checklist** [SET-01]: when a refresh fails, the screen asks the server what setup needs (`gh api user` for whether `gh` is there and who it's signed in as, and whether `config.json` parses). If `gh` is missing or signed out, or the file is broken, a checklist takes the tabs' place. Each line says how to fix it, and Check again refreshes. It also lists what's covered, the Paseo projects with a GitHub remote, and which profile sessions will use. Other failures, like a network error, stay a red line above the tabs.
|
|
32
|
-
- **Settings screen** [SRC-02], under Settings → Plugins → Attention Span and the gear next to ⟳: orgs and repos, one per row. Each is checked with `gh api users/<org>` (it must be an organization, since searches use `org:`) or `gh api repos/<owner>/<name>` before it's saved, and GitHub's exact name is kept. Saving rewrites only `orgs` and `repos` in `config.json`, refuses a file that doesn't parse, and refreshes the lists. A Replies section has one switch, Follow threads I've commented on, which writes only `followThreads` [ATT-17].
|
|
32
|
+
- **Settings screen** [SRC-02], under Settings → Plugins → Attention Span and the gear next to ⟳: orgs and repos, one per row. Each is checked with `gh api users/<org>` (it must be an organization, since searches use `org:`) or `gh api repos/<owner>/<name>` before it's saved, and GitHub's exact name is kept. Saving rewrites only `orgs` and `repos` in `config.json`, refuses a file that doesn't parse, and refreshes the lists. A Replies section has one switch, Follow threads I've commented on, which writes only `followThreads` [ATT-17]. A Waiting section has one switch, Only questions wait, which writes only `onlyQuestionsWait` [WAI-01].
|
|
33
33
|
- **Local files** live in `~/.config/paseo-attention-span/`:
|
|
34
34
|
- `config.json`, edited by hand, except `orgs` and `repos` (the settings screen) and `codeRepos`, which the screen can add to:
|
|
35
35
|
- orgs and repos [SRC-01]
|
|
36
36
|
- a profile per reason: `review` for Review, `default` for everything else
|
|
37
37
|
- `followThreads` (default off, also under Settings → Replies → Follow threads I've commented on): recent replies after mine on other people's threads show under Answered [ATT-17]
|
|
38
|
+
- `onlyQuestionsWait` (default off, also under Settings → Waiting → Only questions wait): my words wait on whom they tag only if they ask a question; off, a tag alone waits [WAI-01]
|
|
38
39
|
- `waitingTooLongDays` (default 3) [ATT-11] and `refreshMinutes` (default 15) [FRESH-01], `historyWeeks` (default 4) [HIS-01]
|
|
39
40
|
- optional prompt templates that replace the built-in ones [SES-04]
|
|
40
41
|
- optional merge method per repo [PRS-04]
|
|
@@ -50,7 +51,7 @@ The tabs tell the story of my work, left to right: what I finished, what needs m
|
|
|
50
51
|
|---|---|
|
|
51
52
|
| History | The last `historyWeeks` (default 4) by week, newest first, in the device's time zone [HIS-01]; which items each week shows and copies is `shared/history-report.ts`, drawn by `client/history.tsx`. Above the weeks, **Changed by others** lists the unread notes, newest first: my PR merged or closed unmerged by someone else, an issue assigned to me closed by someone else as completed or not planned, a PR of mine reopened by someone else after Attention Span saw it closed, my PR or issue taken over or handed on, or me unassigned from an issue. Each is a row in the same words ("merged by dave 2h ago", "closed by alice 6h ago as completed", "reopened by bob 1h ago", "phil took over", "bob unassigned you 8d ago"), its tile showing what happened [HIS-07]. **Got it**, an icon-only check in the main action's style, clears one (Undo brings it back); with two or more, a ghost **✓ Mark all as read** clears the notes on screen, one Undo bringing them all back, and the two wait for each other in `shared/got-it.ts`. A note about work already in Doing's Wrap up waits there instead, because archiving it is the acknowledgement; unread notes expire after `mentionDays` (default 30). They never count in Doing's count, the sidebar's or the horizon, and the History tab shows a green dot and says "unread changes" to screen readers while any is unread. **Filter** between the notes and the weeks opens a sheet, *Show in each week*: Finished (always, disabled), Reviewed and Changed by others, both off at first and remembered in `state.json`; the button reads "Filter · n" in green when on. With Reviewed on, each week shows a labelled **Reviewed** list of others' merged PRs I reviewed [HIS-02]; with Changed by others on, a labelled list of its cleared notes that aren't already finished work, like a PR closed unmerged, a handover or a reopen [HIS-06, HIS-07]. These replace the old collapsed disclosures. Each week's count is its finished items. A PR of mine someone else merged says so: "merged 2h ago by dave", with its copied line unchanged; under the issue it closed, its row in the sheet says "merged by dave" [HIS-05]. An issue someone else closed says "closed 6h ago by alice" too. A merge or issue close the live refresh sees fills its week at once, before History's daily fetch; when the fetch catches up, its richer card takes the live one's place [HIS-07]. A PR of mine the live refresh sees merged that History doesn't list, merged on GitHub say, has History fetched once its search has caught up (`SETTLE_MS` later), once per PR, so a search slow to show it doesn't fetch on every refresh [FRESH-03]. A PR that left my hands isn't listed as done even once its new owner merges it; a handover cleared into a week stays there if the work comes back to me, but doesn't hide what I later finish [HIS-06]. The copy icon on a week's heading copies what's shown as Markdown lists of links, per kind: Finished, plus Reviewed when shown, separated by `## Finished` and `## Reviewed` headings; never Changed by others; an issue and the PRs that closed it are one line, linking the issue; an issue closed as not planned isn't copied, and PRs that referred to it are listed on their own [HIS-03]. Each card has a plain chip (bug, feature or task) for what kind of work it was, and each copied line leads with its emoji: 🐞, 🚀 or 🔧; a PR of none of those leads with 🔀 and has no chip, an issue of none leads with nothing [HIS-04]. The first of these that names a kind decides: the issue type, the labels (bug beats feature beats task), a Conventional Commit title prefix (`fix:` bug, `feat:` feature, `chore:`, `refactor:`, `docs:`, `build:`, `ci:`, `test:`, `perf:`, `style:` task). Types and labels match only as whole names, ignoring case, emoji and wrappers like `type:` or `kind/`, so "bug", "Type: Bug 🐞" and "kind/bug" count but "not a bug" and "bug bash" don't. Until History is fetched again, what I just finished uses the issue type and title only. |
|
|
52
53
|
| Doing | The sections below |
|
|
53
|
-
| Waiting | My work where someone else has the next move [WAI-01]: *Waiting for review* (while GitHub records a review as owed: a pending request, or an approval or requested changes; or approved but blocked by a repo rule [PRS-13]), *Waiting for the reviewer* (after I replied or pushed), *CI running*, *Questions I asked* (threads where my
|
|
54
|
+
| Waiting | My work where someone else has the next move [WAI-01]: *Waiting for review* (while GitHub records a review as owed: a pending request, or an approval or requested changes; or approved but blocked by a repo rule [PRS-13]), *Waiting for the reviewer* (after I replied or pushed), *CI running*, *Questions I asked* (threads where my words are the last from a person, bots don't count, and my words since someone else last spoke tag someone or ask something: a question mark outside quotes, code and links, read from GitHub's rendered comments (`bodyHTML`) so code and links count however they were written. On an issue I opened, its opening is my first words, when the fetched comments reach back to it. With `onlyQuestionsWait` on (Settings → Waiting → Only questions wait, off by default) a statement waits on nobody, tagged or not; with it off, a tagged statement waits on whom it tags. An untagged statement isn't listed): on my own issues however old, on others' only while my comment is within `mentionDays` [ATT-11]. Each shows who it waits on, never a guess [WAI-02]: on a PR, the reviewers currently requested and, after I replied, whoever requested changes, but nobody when a repo rule blocks it; on a question or tag, the people and teams my words since the last answer tag, read from GitHub's rendered comments (`bodyHTML`), where only real accounts and teams I can see are linked, never in code; bots aren't tags: GitHub links no app (`@github-actions`), links some to an organization (`@dependabot`), which is nobody to nudge, and `@renovate[bot]` to a user followed by `[bot]`, and all of those are skipped; tags in quotes don't count, and only the last 10 comments are read. Waiting groups it all by who it waits on, not by those reasons [WAI-01]: one group per person or team (a person tagged with other capitals is one), whoever blocks the most items first, ties by whose oldest item has waited longest, then requested bots, who can't be nudged, and last *Not on a person* for work nobody is on record for. In each group, work with a session that needs me leads, then one that's working, then the rest, oldest first; a finished session I've seen doesn't lift it. Work waiting on several is under each, saying "also waiting on" the rest, and counts once in the tab. Each card says why it waits (review, re-review, question or tagged; nothing where its chips say, like approved, blocked by repo rules, or CI running) and since when. A group's **Copy list** copies its items oldest first as a Markdown list, each line led by why and how long ("- Review 2h: [title](url)"), for a nudge; a requested bot gets none [WAI-03]. My PRs in Doing that wait on people or teams I asked, approved or not, are listed here too, under each of them [PRS-15]. Once something has waited `waitingTooLongDays` (default 3), its age turns amber with ⌛ and says so on hover, but only where a nudge is fair: not while CI fails or runs, nor with conflicts, changes to make or a reply I owe (`nudgeable` in `server/rules.ts`) [ATT-11]. In Doing, one person shows by name, several by picture, named on hover and in the sheet. |
|
|
54
55
|
| Next up | *Assigned to you* [NXT-06], then *Unclaimed* [NXT-01] |
|
|
55
56
|
|
|
56
57
|
Every card in every tab is the same component, `CardRow` in `client/card.tsx` [ATT-05]: a tinted mark for what it is, a title of at most two lines, then the item's number, its repo (the name brighter than the owner, which my own repos leave out) [ATT-20], when it happened and signal chips, then content only some lists have (pills, a quote, a stack line), and its actions: on the right on desktop, labelled under the text on phones. A change on GitHub asks first in a `ConfirmBar` on the card [SAFE-01]. Tabs differ only in what they pass in: each maps its data to the card's mark, meta, actions and slots. What an item's card and sheet show, and in what order, is decided in `shared/item-view.ts` and drawn by `client/item-row.tsx`; the actions behind them are `useItemActions` in `client/item-actions.ts`. Marks and signals take a tone, never a raw theme color, because some themes draw `accent` close to white. How an item itself is shown, its number and repo and an issue's pills, lives in `client/entity.tsx` (`PlaceText`, `IssuePills`, `ProjectPill`, `FieldPill`, GitHub's option colors), so cards and sheets compose the same pieces rather than format their own; `client/ui.tsx` keeps the generic ones (`Meta`, `Pill`, `Signal`).
|
|
@@ -205,7 +206,8 @@ One GraphQL request per search, sent in parallel (`server/fetch.ts`; the service
|
|
|
205
206
|
- `is:open mentions:@me updated:>=<30 days ago>` (fetching the description, recent comments, review-thread comments, their IDs for 👍, and `viewerHasReacted`)
|
|
206
207
|
- `is:issue is:open assignee:@me`
|
|
207
208
|
- `is:open involves:@me updated:>=<30 days ago> sort:updated-desc`, 100 at most, issues and PRs with their last 10 conversation comments, as for mentions (for Answered and fresh questions) [ATT-16]
|
|
208
|
-
- `is:issue is:open author:@me commenter:@me sort:updated-desc`, 50 at most, no date limit, the same fields (questions on my own issues nobody answered, however old) [ATT-11]
|
|
209
|
+
- `is:issue is:open author:@me commenter:@me sort:updated-desc`, 50 at most, no date limit, the same fields plus the opening (questions and tags on my own issues nobody answered, however old) [ATT-11, WAI-01]
|
|
210
|
+
- `is:issue is:open author:@me -commenter:@me sort:updated-desc`, 50 at most, no date limit, the same fields (an opening on my own issue that tags someone or asks, before a person comments; bots' comments don't count), apart from the one above so these don't crowd out questions [WAI-01]
|
|
209
211
|
- `is:pr is:closed author:@me closed:>=<30 days ago> sort:updated-desc`, 50 at most, with `mergedBy`, the last close event's actor and assignees [HIS-07]
|
|
210
212
|
- `is:issue is:closed assignee:@me closed:>=<30 days ago> sort:updated-desc`, 50 at most, with `stateReason` and the last close event's actor (an issue someone else closed) [HIS-07]
|
|
211
213
|
- `is:issue is:open no:assignee` (Next up, with issue type and field values, and projects when the login may read them [NXT-12]; one request per source [NXT-09], skipped when there's nowhere to look [NXT-08]). "My repos" needs my login, taken from the last fetch or asked once with `viewer { login }`
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.server.ts
CHANGED
|
@@ -87,6 +87,7 @@ export default function contribute(server: PluginServerContext) {
|
|
|
87
87
|
server.handle(rpc.issueFields, () => ready(async () => ({ fields: await attention.issueFields() })));
|
|
88
88
|
server.handle(rpc.setNextUpFields, (fields) => ready(() => attention.setNextUpFields(fields)).then(() => ({ ok: true as const })));
|
|
89
89
|
server.handle(rpc.setFollowThreads, ({ on }) => ready(() => attention.setFollowThreads(on)).then(() => ({ ok: true as const })));
|
|
90
|
+
server.handle(rpc.setOnlyQuestionsWait, ({ on }) => ready(() => attention.setOnlyQuestionsWait(on)).then(() => ({ ok: true as const })));
|
|
90
91
|
server.handle(rpc.myOrgs, async () => ({ orgs: await answers.myOrgs() }));
|
|
91
92
|
server.handle(rpc.setScopes, ({ scopes }) => ready(() => attention.setScopes(scopes)).then(() => ({ ok: true as const })));
|
|
92
93
|
server.handle(rpc.setSources, ({ sources }) => ready(() => attention.setSources(sources)).then(() => ({ ok: true as const })));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrioid/paseo-attention-span",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
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,8 +109,8 @@ functional:
|
|
|
109
109
|
NXT-14: group unclaimed issues by repository, each under its name, the repository with the most important issue first and NXT-02's order within each, offered whenever more than one repository is shown, and have my choice remembered; so that I can see which project each issue belongs to when I have many going.
|
|
110
110
|
waiting:
|
|
111
111
|
As a developer, I can:
|
|
112
|
-
WAI-01: see my work that is waiting on others, grouped by who it waits on with whoever blocks the most first, bots after people, and work no person holds up last, each group with work that has an active session first, and each card saying why it waits and for how long, including my pull requests in Doing that wait on whom I asked, where a pull request waits for review only once someone has been asked, and a thread only once my last words ask a question; so that I know that work is tracked and who is blocking me most.
|
|
113
|
-
WAI-02: see who my waiting work waits on: reviewers I asked, reviewers who asked for changes and people I tagged in my unanswered
|
|
112
|
+
WAI-01: see my work that is waiting on others, grouped by who it waits on with whoever blocks the most first, bots after people, and work no person holds up last, each group with work that has an active session first, and each card saying why it waits and for how long, including my pull requests in Doing that wait on whom I asked, where a pull request waits for review only once someone has been asked, and a thread only once my last words, the opening of an issue I opened included, ask a question or tag someone, or only a question when I choose that only questions wait; so that I know that work is tracked and who is blocking me most.
|
|
113
|
+
WAI-02: see who my waiting work waits on: reviewers I asked, reviewers who asked for changes and people I tagged in my unanswered words but not bots, and nobody where none of those apply; so that I know whom to nudge without guessing.
|
|
114
114
|
WAI-03: copy the list of my work waiting on one person or team, oldest first, each line a Markdown link led by why and for how long, like "Review 2h: [title](link)"; so that nudging them is one paste they can skim.
|
|
115
115
|
WAI-04: see a calm scene in Waiting when nothing waits on anyone, only once a refresh has confirmed it; so that being blocked by nobody feels like rest rather than a blank page.
|
|
116
116
|
history:
|
package/server/classify.ts
CHANGED
|
@@ -194,9 +194,9 @@ export function classify({ data, details, config, now }: ClassifyInput): Attenti
|
|
|
194
194
|
if (waiting) mentions.set(prKey(node), waiting);
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
// What each thread I'm in is waiting for: an answer, or me [ATT-16].
|
|
197
|
+
// What each thread I'm in is waiting for: an answer, or me [ATT-16]. Several searches can find one; it's the same thread.
|
|
198
198
|
const threads = new Map<string, IssueNode>();
|
|
199
|
-
for (const node of [...compact(data.involved.nodes), ...compact(data.asked.nodes)]) threads.set(prKey(node), node);
|
|
199
|
+
for (const node of [...compact(data.involved.nodes), ...compact(data.asked.nodes), ...compact(data.opened.nodes)]) threads.set(prKey(node), node);
|
|
200
200
|
const answers = new Map<string, NonNullable<ReturnType<typeof threadState>>>();
|
|
201
201
|
for (const [key, node] of threads) {
|
|
202
202
|
const found = threadState(node, me, now, config);
|
|
@@ -436,7 +436,7 @@ export function classify({ data, details, config, now }: ClassifyInput): Attenti
|
|
|
436
436
|
...plain(issue, kind, section),
|
|
437
437
|
person,
|
|
438
438
|
waitingOn: section !== "answered" && tagged.length > 0 ? tagged : undefined,
|
|
439
|
-
wait: section === "answered" ? undefined : { reason: "question", since, ...(tooLong ? { tooLong } : {}) },
|
|
439
|
+
wait: section === "answered" ? undefined : { reason: flags.question ? "question" : "tagged", since, ...(tooLong ? { tooLong } : {}) },
|
|
440
440
|
actions: section === "answered" ? replyActions(person) : [],
|
|
441
441
|
// A new answer brings back a dismissed one [ATT-08].
|
|
442
442
|
othersActivityAt: person ? latest(...(person.comments ?? []).map((c) => c.createdAt)) : EPOCH,
|
|
@@ -525,37 +525,41 @@ export function classifyCloseAsks(data: HistoryResult): CloseAsk[] {
|
|
|
525
525
|
return [...asks.values()].map((ask) => ({ ...ask, prs: ask.prs.sort((a, b) => a.mergedAt!.localeCompare(b.mergedAt!)) }));
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
-
// Whether my last
|
|
529
|
-
// On a thread I opened,
|
|
528
|
+
// Whether my last words on a thread are the last from a person, and if not, the recent comments since that I haven't 👍'd.
|
|
529
|
+
// On a thread I opened, its opening is my first words: when every comment was fetched, it's in my words since someone else
|
|
530
|
+
// last spoke, and its tags and questions count as a comment's do. Bots don't count [MEN-05, WAI-01]. Only the last comments
|
|
530
531
|
// are fetched: on someone else's thread, once mine is out of them the conversation has moved on.
|
|
531
532
|
export function threadState(
|
|
532
533
|
thread: IssueNode,
|
|
533
534
|
me: string,
|
|
534
535
|
now: Date,
|
|
535
|
-
config: Pick<AttentionConfig, "mentionDays" | "followThreads">,
|
|
536
|
+
config: Pick<AttentionConfig, "mentionDays" | "followThreads" | "onlyQuestionsWait">,
|
|
536
537
|
): { flags: IssueState; person?: Person; mine: string; tagged: WaitingOn[] } | null {
|
|
537
538
|
const authored = thread.author?.login.toLowerCase() === me;
|
|
538
|
-
const
|
|
539
|
+
const all = thread.comments.totalCount === undefined || thread.comments.totalCount <= thread.comments.nodes.length;
|
|
540
|
+
const opening: Comment[] = authored && all ? [{ author: thread.author, bodyHTML: thread.bodyHTML, createdAt: thread.createdAt }] : [];
|
|
541
|
+
const people = [...opening, ...thread.comments.nodes.filter((c) => c.author && c.author.__typename !== "Bot")];
|
|
539
542
|
const index = people.findLastIndex((c) => c.author?.login.toLowerCase() === me);
|
|
540
543
|
if (index < 0 && !authored) return null;
|
|
541
544
|
const mine = index < 0 ? thread.createdAt : people[index].createdAt;
|
|
542
545
|
const after = people.slice(index + 1);
|
|
543
546
|
const recent = (at: string) => daysSince(at, now) < config.mentionDays;
|
|
544
547
|
const unread = after.filter((c) => recent(c.createdAt) && !c.reactionGroups?.some((group) => group.viewerHasReacted));
|
|
545
|
-
// My
|
|
548
|
+
// My words since someone else last spoke; bots don't end the run.
|
|
546
549
|
let first = index;
|
|
547
550
|
while (first > 0 && people[first - 1].author?.login.toLowerCase() === me) first -= 1;
|
|
548
551
|
const run = index >= 0 ? people.slice(first, index + 1) : [];
|
|
552
|
+
const tagged = index >= 0 && after.length === 0 ? taggedSince(run, me, thread.url) : [];
|
|
549
553
|
const flags: IssueState = {
|
|
550
554
|
authored,
|
|
551
555
|
follow: config.followThreads,
|
|
552
|
-
// Opening a thread isn't asking a question; a comment is.
|
|
553
556
|
mineLast: index >= 0 && after.length === 0,
|
|
554
557
|
question: run.some((comment) => asksQuestion(comment.bodyHTML)),
|
|
558
|
+
tags: tagged.length > 0,
|
|
559
|
+
onlyQuestions: config.onlyQuestionsWait,
|
|
555
560
|
answered: unread.length > 0,
|
|
556
561
|
fresh: recent(mine),
|
|
557
562
|
};
|
|
558
|
-
const tagged = flags.mineLast ? taggedSince(run, me, thread.url) : [];
|
|
559
563
|
const last = unread.at(-1);
|
|
560
564
|
if (!last?.author) return { flags, mine, tagged };
|
|
561
565
|
return {
|
|
@@ -574,7 +578,7 @@ export function threadState(
|
|
|
574
578
|
};
|
|
575
579
|
}
|
|
576
580
|
|
|
577
|
-
// Who my
|
|
581
|
+
// Who my words since someone else last spoke tag, each from the first that tags them; only the fetched comments
|
|
578
582
|
// count. A tag gives just a name, so a person's picture is GitHub's for that name [WAI-02].
|
|
579
583
|
function taggedSince(run: Comment[], me: string, url: string): WaitingOn[] {
|
|
580
584
|
const origin = new URL(url).origin;
|
package/server/fetch.ts
CHANGED
|
@@ -110,7 +110,7 @@ export async function searchLive(gh: Gh, config: AttentionConfig, now: Date, unc
|
|
|
110
110
|
};
|
|
111
111
|
const merge = (parts: Partial<LiveResult>[]) => Object.assign({}, ...parts) as LiveResult;
|
|
112
112
|
const forDetails = Promise.all([search("mine"), search("reviews"), search("assigned"), searchUnclaimed()]);
|
|
113
|
-
const others = Promise.all([search("mentions"), search("involved"), search("asked"), search("ended"), search("closedIssues")]);
|
|
113
|
+
const others = Promise.all([search("mentions"), search("involved"), search("asked"), search("opened"), search("ended"), search("closedIssues")]);
|
|
114
114
|
const afterThem = forDetails.then((parts) => details(gh, config, merge(parts), projects.on, projects.problems));
|
|
115
115
|
const [first, rest, found] = await Promise.all([forDetails, others, afterThem]);
|
|
116
116
|
return { data: merge([...first, ...rest]), details: found };
|
package/server/fixture.ts
CHANGED
|
@@ -137,6 +137,7 @@ export function builders(now: Date) {
|
|
|
137
137
|
mentions: nodes("mentions") as SearchResult["mentions"],
|
|
138
138
|
involved: nodes("involved") as SearchResult["involved"],
|
|
139
139
|
asked: nodes("asked") as SearchResult["asked"],
|
|
140
|
+
opened: nodes("opened") as SearchResult["opened"],
|
|
140
141
|
assigned: nodes("assigned") as SearchResult["assigned"],
|
|
141
142
|
unclaimed: nodes("unclaimed") as SearchResult["unclaimed"],
|
|
142
143
|
merged: nodes("merged") as SearchResult["merged"],
|
|
@@ -264,7 +265,7 @@ export function fixture(now: Date): { data: SearchResult; details: Details } {
|
|
|
264
265
|
),
|
|
265
266
|
// A comment on my PR's conversation [ATT-16].
|
|
266
267
|
issue(111, [comment(bob, "Big change. Could you split the index migration into its own PR?", 0.2)], "Faster product search", { __typename: "PullRequest", author: me, createdAt: daysAgo(2) }),
|
|
267
|
-
// A statement that tags someone
|
|
268
|
+
// A statement that tags someone waits on them, unless only questions wait [WAI-01].
|
|
268
269
|
issue(145, [comment(me, "@bob deployed the fix to staging.", 0.5, { bodyHTML: `<p>${tag("bob")} deployed the fix to staging.</p>` })], "Checkout hangs on slow networks"),
|
|
269
270
|
// Someone else's old thread where people kept going after me: not mine to follow [ATT-16].
|
|
270
271
|
issue(144, [comment(me, "Same here on 2.3", 400), comment(bob, "+1", 300)], "Crash on startup"),
|
package/server/github-types.ts
CHANGED
|
@@ -89,11 +89,14 @@ export interface IssueNode {
|
|
|
89
89
|
__typename?: "Issue" | "PullRequest";
|
|
90
90
|
createdAt: string;
|
|
91
91
|
author: Actor | null;
|
|
92
|
+
// GitHub's rendering of its opening, where tags of real accounts are links [WAI-01, WAI-02].
|
|
93
|
+
bodyHTML?: string;
|
|
92
94
|
number: number;
|
|
93
95
|
title: string;
|
|
94
96
|
url: string;
|
|
95
97
|
repository: Repo;
|
|
96
|
-
comments
|
|
98
|
+
// How many conversation comments there are, to tell whether the fetched ones reach back to the opening.
|
|
99
|
+
comments: Nodes<Comment> & { totalCount?: number };
|
|
97
100
|
}
|
|
98
101
|
|
|
99
102
|
export interface PickableNode {
|
|
@@ -129,6 +132,7 @@ export interface LiveResult {
|
|
|
129
132
|
mentions: Nodes<MentionNode>;
|
|
130
133
|
involved: Nodes<IssueNode>;
|
|
131
134
|
asked: Nodes<IssueNode>;
|
|
135
|
+
opened: Nodes<IssueNode>;
|
|
132
136
|
assigned: Nodes<PickableNode>;
|
|
133
137
|
unclaimed: Nodes<PickableNode>;
|
|
134
138
|
// My PRs closed lately [HIS-07].
|
package/server/markdown.ts
CHANGED
|
@@ -96,10 +96,13 @@ export function asksQuestion(html: string | undefined): boolean {
|
|
|
96
96
|
|
|
97
97
|
// People and teams tagged in a comment, from GitHub's rendering of it: GitHub links a tag only to an account that exists and
|
|
98
98
|
// a team I can see, and never in code. Tags in quoted replies are someone else's words, so they don't count [WAI-02].
|
|
99
|
+
// Bots don't count either: GitHub links no app like @github-actions or @copilot, links @dependabot and @coderabbitai to an
|
|
100
|
+
// organization, which is nobody to nudge, and @renovate[bot] to the user before its "[bot]" [WAI-02].
|
|
99
101
|
export function taggedIn(html: string | undefined): { login: string; team: boolean }[] {
|
|
100
102
|
const text = ownWords(html);
|
|
101
103
|
const tags: { login: string; team: boolean }[] = [];
|
|
102
|
-
for (const [, attributes] of text.matchAll(/<a\b([^>]*)
|
|
104
|
+
for (const [, attributes, bot] of text.matchAll(/<a\b([^>]*)>[\s\S]*?<\/a>(\[bot\])?/g)) {
|
|
105
|
+
if (bot || /\bdata-hovercard-type="organization"/.test(attributes)) continue;
|
|
103
106
|
const kind = /\bclass="[^"]*\b(user|team)-mention\b/.exec(attributes)?.[1];
|
|
104
107
|
const path = /\bhref="(?:https?:\/\/[^/"]+)?([^"?#]*)/.exec(attributes)?.[1] ?? "";
|
|
105
108
|
const team = /^\/orgs\/([^/]+)\/teams\/([^/]+)\/?$/.exec(path);
|
package/server/queries.ts
CHANGED
|
@@ -5,8 +5,8 @@ import type { IssueRef } from "./references";
|
|
|
5
5
|
|
|
6
6
|
// An issue or PR with its last conversation comments [ATT-16], rendered too for who my questions tag [WAI-02].
|
|
7
7
|
const THREAD = `__typename
|
|
8
|
-
... on Issue { number title url createdAt author { ...author } repository { nameWithOwner } comments(last: 10) { nodes { ...comment bodyHTML } } }
|
|
9
|
-
... on PullRequest { number title url createdAt author { ...author } repository { nameWithOwner } comments(last: 10) { nodes { ...comment bodyHTML } } }`;
|
|
8
|
+
... on Issue { number title url createdAt bodyHTML author { ...author } repository { nameWithOwner } comments(last: 10) { totalCount nodes { ...comment bodyHTML } } }
|
|
9
|
+
... on PullRequest { number title url createdAt bodyHTML author { ...author } repository { nameWithOwner } comments(last: 10) { totalCount nodes { ...comment bodyHTML } } }`;
|
|
10
10
|
|
|
11
11
|
// Each search with how many results it asks for and what it reads of each.
|
|
12
12
|
const SEARCHES = {
|
|
@@ -26,6 +26,8 @@ const SEARCHES = {
|
|
|
26
26
|
involved: { first: 100, nodes: THREAD },
|
|
27
27
|
// My own issues where I commented, for questions nobody answered however old [ATT-11].
|
|
28
28
|
asked: { first: 50, nodes: THREAD },
|
|
29
|
+
// My own issues I haven't commented on, for an opening that tags someone or asks, however old [WAI-01].
|
|
30
|
+
opened: { first: 50, nodes: THREAD },
|
|
29
31
|
assigned: { first: 50, nodes: "...pickable" },
|
|
30
32
|
unclaimed: { first: 100, nodes: "...pickable" },
|
|
31
33
|
// My PRs closed lately, with who merged or closed them, for Changed by others [HIS-07]. Who closed one comes from its last
|
|
@@ -225,8 +227,11 @@ export function searchVariables(config: AttentionConfig, now: Date, timeZone?: s
|
|
|
225
227
|
closedIssues: `is:issue is:closed assignee:@me closed:>=${since} sort:updated-desc ${scope}`,
|
|
226
228
|
// Threads I opened, commented on, was assigned or mentioned in, active lately: answers, and fresh questions [ATT-16].
|
|
227
229
|
involved: `is:open involves:@me updated:>=${since} sort:updated-desc ${scope}`,
|
|
228
|
-
// On my own issues a question nobody answered stays however old [ATT-11]. Newest first, so old ones go last.
|
|
230
|
+
// On my own issues a question or tag nobody answered stays however old [ATT-11, WAI-01]. Newest first, so old ones go last.
|
|
229
231
|
asked: `is:issue is:open author:@me commenter:@me sort:updated-desc ${scope}`,
|
|
232
|
+
// And the rest of my own issues, where my opening may still be my last words, as only bots commented: `asked` can't find
|
|
233
|
+
// them before I comment [WAI-01]. Kept apart, so they don't crowd out the questions above.
|
|
234
|
+
opened: `is:issue is:open author:@me -commenter:@me sort:updated-desc ${scope}`,
|
|
230
235
|
// History [HIS-01, HIS-02]
|
|
231
236
|
merged: `is:pr is:merged author:@me merged:>=${history} ${scope}`,
|
|
232
237
|
reviewed: `is:pr is:merged reviewed-by:@me -author:@me merged:>=${history} ${scope}`,
|
package/server/rules.ts
CHANGED
|
@@ -104,8 +104,12 @@ export interface IssueState {
|
|
|
104
104
|
follow: boolean;
|
|
105
105
|
// My comment is the last one from a person; bots don't count [MEN-05].
|
|
106
106
|
mineLast: boolean;
|
|
107
|
-
// My
|
|
107
|
+
// My words since someone else last spoke ask something [WAI-01].
|
|
108
108
|
question: boolean;
|
|
109
|
+
// My words since someone else last spoke tag someone [WAI-01, WAI-02].
|
|
110
|
+
tags: boolean;
|
|
111
|
+
// Only questions wait: a statement waits on nobody, even one that tags someone. The onlyQuestionsWait setting [WAI-01].
|
|
112
|
+
onlyQuestions: boolean;
|
|
109
113
|
// A person commented after me (or after I opened it) within mentionDays, and I haven't 👍'd it [MEN-02].
|
|
110
114
|
answered: boolean;
|
|
111
115
|
// My last comment is within mentionDays.
|
|
@@ -118,7 +122,7 @@ export const ISSUE_RULES: Rules<IssueState> = {
|
|
|
118
122
|
// A recent comment after mine, without mentioning me: mine until I reply, 👍 it or dismiss it [ATT-16].
|
|
119
123
|
// On someone else's thread only when I've allowed replies without a tag [ATT-17].
|
|
120
124
|
answered: { when: (s) => s.answered && (s.authored || s.follow) },
|
|
121
|
-
// My question waits on an answer: on my own issues however long ago, on others' only
|
|
122
|
-
// waited too long [WAI-01, ATT-11].
|
|
123
|
-
wait_answer: { when: (s) => s.mineLast && s.question && (s.authored || s.fresh) },
|
|
125
|
+
// My question, or a tag unless only questions wait, waits on an answer: on my own issues however long ago, on others' only
|
|
126
|
+
// while fresh. Waiting says when it's waited too long [WAI-01, ATT-11].
|
|
127
|
+
wait_answer: { when: (s) => s.mineLast && (s.question || (s.tags && !s.onlyQuestions)) && (s.authored || s.fresh) },
|
|
124
128
|
};
|
package/server/service.ts
CHANGED
|
@@ -254,6 +254,12 @@ export class AttentionService {
|
|
|
254
254
|
await this.refresh("live").catch(() => {});
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
// Only questions wait [WAI-01]. Only the live feed has threads.
|
|
258
|
+
async setOnlyQuestionsWait(on: boolean): Promise<void> {
|
|
259
|
+
this.config = await this.port.store.saveOnlyQuestionsWait(on);
|
|
260
|
+
await this.refresh("live").catch(() => {});
|
|
261
|
+
}
|
|
262
|
+
|
|
257
263
|
async setScopes(scopes: string[]): Promise<void> {
|
|
258
264
|
this.state.scopes = scopes;
|
|
259
265
|
await this.save();
|
package/server/setup.ts
CHANGED
|
@@ -23,11 +23,11 @@ export async function ghStatus(): Promise<SetupStatus["gh"]> {
|
|
|
23
23
|
|
|
24
24
|
export async function configStatus(store: Pick<Store, "loadConfig">): Promise<ConfigStatus> {
|
|
25
25
|
try {
|
|
26
|
-
const { orgs, repos, nextUp, followThreads } = await store.loadConfig();
|
|
26
|
+
const { orgs, repos, nextUp, followThreads, onlyQuestionsWait } = await store.loadConfig();
|
|
27
27
|
const fields = Object.fromEntries(FIELD_ROLES.flatMap((role) => (nextUp[role] === undefined ? [] : [[role, nextUp[role]?.field ?? null]])));
|
|
28
|
-
return { error: null, orgs, repos, nextUp: { mine: nextUp.mine, orgs: nextUp.orgs, repos: nextUp.repos }, fields, followThreads };
|
|
28
|
+
return { error: null, orgs, repos, nextUp: { mine: nextUp.mine, orgs: nextUp.orgs, repos: nextUp.repos }, fields, followThreads, onlyQuestionsWait };
|
|
29
29
|
} catch (error) {
|
|
30
|
-
return { error: (error as Error).message, orgs: [], repos: [], nextUp: { mine: false, orgs: [], repos: [] }, fields: {}, followThreads: false };
|
|
30
|
+
return { error: (error as Error).message, orgs: [], repos: [], nextUp: { mine: false, orgs: [], repos: [] }, fields: {}, followThreads: false, onlyQuestionsWait: false };
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
package/server/store.ts
CHANGED
|
@@ -162,6 +162,11 @@ export function createStore(dir: string, oldDir?: string) {
|
|
|
162
162
|
return updateConfig((file) => ({ ...file, followThreads }));
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
// Whether only questions wait, from settings [WAI-01].
|
|
166
|
+
function saveOnlyQuestionsWait(onlyQuestionsWait: boolean): Promise<AttentionConfig> {
|
|
167
|
+
return updateConfig((file) => ({ ...file, onlyQuestionsWait }));
|
|
168
|
+
}
|
|
169
|
+
|
|
165
170
|
// What the screen writes changes only its own keys; everything else in the file is kept as it is.
|
|
166
171
|
// A file that doesn't read or parse is left alone.
|
|
167
172
|
async function updateConfig(change: (file: Record<string, unknown>) => Record<string, unknown>): Promise<AttentionConfig> {
|
|
@@ -192,6 +197,6 @@ export function createStore(dir: string, oldDir?: string) {
|
|
|
192
197
|
await writeAtomically(state, JSON.stringify(saved, null, 2));
|
|
193
198
|
}
|
|
194
199
|
|
|
195
|
-
return { moveOldFiles, loadConfig, saveCodeRepo, saveCoverage, saveNextUpSources, saveNextUpFields, saveFollowThreads, loadState, saveState };
|
|
200
|
+
return { moveOldFiles, loadConfig, saveCodeRepo, saveCoverage, saveNextUpSources, saveNextUpFields, saveFollowThreads, saveOnlyQuestionsWait, loadState, saveState };
|
|
196
201
|
}
|
|
197
202
|
export type Store = ReturnType<typeof createStore>;
|
package/shared/attention.ts
CHANGED
|
@@ -111,7 +111,7 @@ export interface WaitingOn {
|
|
|
111
111
|
// What my work waits for: on items in Waiting, and on my PRs in Doing that wait on reviewers too, which Waiting lists as
|
|
112
112
|
// well [WAI-01, PRS-15].
|
|
113
113
|
export interface Wait {
|
|
114
|
-
// In a word or two: "review", "re-review", "question". None where the chips already say, like blocked by repo rules.
|
|
114
|
+
// In a word or two: "review", "re-review", "question", "tagged". None where the chips already say, like blocked by repo rules.
|
|
115
115
|
reason?: string;
|
|
116
116
|
// Since I asked, tagged, pushed or replied.
|
|
117
117
|
since: string;
|
package/shared/config.ts
CHANGED
|
@@ -40,6 +40,8 @@ export const AttentionConfig = z.object({
|
|
|
40
40
|
// Follow threads I've commented on: a recent reply after mine on someone else's thread shows without a tag.
|
|
41
41
|
// Off: only my own threads and mentions [ATT-17].
|
|
42
42
|
followThreads: z.boolean().default(false),
|
|
43
|
+
// Only questions wait: my words that tag someone wait on them only if they ask something. Off: a tag alone waits [WAI-01].
|
|
44
|
+
onlyQuestionsWait: z.boolean().default(false),
|
|
43
45
|
// How many weeks History shows [HIS-01].
|
|
44
46
|
historyWeeks: z.number().int().positive().default(4),
|
|
45
47
|
// Unclaimed issues to pick from [NXT-04]. With no sources chosen, Next up looks in `orgs` and `repos` [NXT-08].
|
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(
|
|
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
|
}
|
package/shared/item-view.ts
CHANGED
|
@@ -153,6 +153,11 @@ export function rerunState(details: { data?: { failing: FailingChecks[] }; isLoa
|
|
|
153
153
|
return { state: "ready", failing, runIds: summary.runIds };
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
// What a wait counts from, in words: my question, my tag, or my last push or reply [WAI-01].
|
|
157
|
+
export function waitedSince(reason: string | undefined): string {
|
|
158
|
+
return reason === "question" ? "you asked" : reason === "tagged" ? "you tagged them" : "your last push or reply";
|
|
159
|
+
}
|
|
160
|
+
|
|
156
161
|
// Why it waits and how long, in Waiting only; Doing says what's mine to do. Once it has waited too long, where nudging is
|
|
157
162
|
// fair, the age itself turns amber with ⌛ and says so in words [WAI-01, ATT-11].
|
|
158
163
|
export function waitChips(item: Item, inWaiting: boolean, tooLongDays: number, now = new Date()): Chip[] {
|
|
@@ -161,7 +166,7 @@ export function waitChips(item: Item, inWaiting: boolean, tooLongDays: number, n
|
|
|
161
166
|
const age = ago(wait.since, now);
|
|
162
167
|
const reason: Chip[] = wait.reason ? [{ text: wait.reason, tone: "neutral" }] : [];
|
|
163
168
|
if (!wait.tooLong) return [...reason, { text: age, tone: "neutral" }];
|
|
164
|
-
const since = wait.reason
|
|
169
|
+
const since = waitedSince(wait.reason);
|
|
165
170
|
const limit = `${tooLongDays} day${tooLongDays === 1 ? "" : "s"}`;
|
|
166
171
|
return [...reason, { text: age, tone: "warn", icon: "hourglass", hint: `Waited too long: ${age} since ${since}, more than ${limit}` }];
|
|
167
172
|
}
|
package/shared/rpc.ts
CHANGED
|
@@ -68,6 +68,8 @@ const fieldChoice = z.string().nullable().optional();
|
|
|
68
68
|
export const setNextUpFields = defineRpc({ name: "config.set-next-up-fields", input: z.object({ priority: fieldChoice, effort: fieldChoice, scope: fieldChoice }), output: done });
|
|
69
69
|
// Replies on others' threads without a tag, from settings [ATT-17].
|
|
70
70
|
export const setFollowThreads = defineRpc({ name: "config.set-follow-threads", input: z.object({ on: z.boolean() }), output: done });
|
|
71
|
+
// Only questions wait, from settings [WAI-01].
|
|
72
|
+
export const setOnlyQuestionsWait = defineRpc({ name: "config.set-only-questions-wait", input: z.object({ on: z.boolean() }), output: done });
|
|
71
73
|
export const myOrgs = defineRpc({ name: "config.my-orgs", input: z.object({}), output: z.object({ orgs: z.array(z.string()) }) });
|
|
72
74
|
// Remember the scopes and sources ticked in Next up's filter [NXT-03, NXT-09].
|
|
73
75
|
export const setScopes = defineRpc({ name: "next-up.scopes", input: z.object({ scopes: z.array(z.string()) }), output: done });
|
package/shared/setup.ts
CHANGED
|
@@ -14,6 +14,8 @@ export interface ConfigStatus {
|
|
|
14
14
|
fields: Partial<Record<FieldRole, string | null>>;
|
|
15
15
|
// Replies on others' threads count without a tag [ATT-17].
|
|
16
16
|
followThreads: boolean;
|
|
17
|
+
// A tag waits only if it asks a question [WAI-01].
|
|
18
|
+
onlyQuestionsWait: boolean;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export interface SetupStatus {
|