@andrioid/paseo-attention-span 0.7.6 → 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 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
- ![Doing](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.6/docs/screenshots/desktop-dark-doing.png)
13
+ ![Doing](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.8.0/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.6/docs/screenshots/desktop-dark-doing-sheet.png)
17
+ ![An item's actions](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.8.0/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
 
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
- ![Waiting](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.6/docs/screenshots/desktop-dark-waiting.png)
27
+ ![Waiting](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.8.0/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.6/docs/screenshots/desktop-dark-next-up.png)
35
+ ![Next up](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.8.0/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.6/docs/screenshots/desktop-dark-history.png)
43
+ ![History](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.8.0/docs/screenshots/desktop-dark-history.png)
44
44
 
45
45
  ## Agent sessions
46
46
 
@@ -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. */}
@@ -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} asked={item.wait?.reason === "question"} expanded={false} /> : null;
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} asked={item.wait?.reason === "question"} expanded /> : null}
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, asked, expanded }: { people: WaitingOn[]; asked: boolean; expanded: boolean }) {
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 ${asked ? "you asked" : "your last push or reply"}, ${ago(at)} ago`;
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 }}>
@@ -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 comment is the last from a person, bots don't count, and my comments since someone else last spoke 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; a statement, tagged or not, waits on nobody and 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, the people and teams my comments 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; 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 or question; 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
+ | 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 }`
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.7.6",
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 question, and nobody where none of those apply; so that I know whom to nudge without guessing.
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:
@@ -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]. Both searches can find one; it's the same thread.
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 comment on a thread is the last one from a person, and if not, the recent comments since that I haven't 👍'd.
529
- // On a thread I opened, my opening counts as my last word until I comment. Bots don't count [MEN-05]. Only the last comments
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 people = thread.comments.nodes.filter((c) => c.author && c.author.__typename !== "Bot");
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 comments since someone else last spoke; bots don't end the run.
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 comments since someone else last spoke tag, each from the first comment that tags them; only the fetched comments
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 isn't a question: nobody owes me an answer, so it's not listed [WAI-01].
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"),
@@ -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: Nodes<Comment>;
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].
@@ -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([^>]*)>/g)) {
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 comments since someone else last spoke ask something; a statement, tagged or not, waits on nobody [WAI-01].
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 while fresh. Waiting says when it's
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>;
@@ -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].
@@ -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 === "question" ? "you asked" : "your last push or reply";
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 {