@andrioid/paseo-attention-span 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/OVERVIEW.md +7 -1
  2. package/client/attention-screen.tsx +74 -1176
  3. package/client/coverage-settings.tsx +5 -4
  4. package/client/data.ts +4 -2
  5. package/client/feedback.tsx +21 -25
  6. package/client/history.tsx +17 -50
  7. package/client/item-actions.ts +363 -0
  8. package/client/item-row.tsx +450 -0
  9. package/client/new-issue.tsx +244 -0
  10. package/client/next-up.tsx +36 -183
  11. package/client/pickers.tsx +237 -0
  12. package/client/session-menu.ts +3 -11
  13. package/client/sessions.ts +58 -57
  14. package/client/setup.tsx +2 -1
  15. package/client/sheet.tsx +92 -15
  16. package/client/still.tsx +70 -27
  17. package/client/ui.tsx +23 -14
  18. package/client/wrap-up.tsx +151 -85
  19. package/docs/architecture.md +22 -11
  20. package/docs/screenshots/desktop-dark-doing-acknowledge.png +0 -0
  21. package/docs/screenshots/desktop-dark-doing-clear.png +0 -0
  22. package/docs/screenshots/desktop-dark-doing-issue-sheet.png +0 -0
  23. package/docs/screenshots/desktop-dark-doing-reviewers.png +0 -0
  24. package/docs/screenshots/desktop-dark-doing-sheet.png +0 -0
  25. package/docs/screenshots/desktop-dark-doing-wrap-dirty.png +0 -0
  26. package/docs/screenshots/desktop-dark-doing-wrap-multi.png +0 -0
  27. package/docs/screenshots/desktop-dark-doing-wrap.png +0 -0
  28. package/docs/screenshots/desktop-dark-doing.png +0 -0
  29. package/docs/screenshots/desktop-dark-next-up-setup.png +0 -0
  30. package/docs/screenshots/desktop-dark-next-up.png +0 -0
  31. package/docs/screenshots/desktop-dark-settings.png +0 -0
  32. package/docs/screenshots/phone-dark-doing.png +0 -0
  33. package/docs/screenshots/phone-light-next-up-filtered.png +0 -0
  34. package/index.client.tsx +19 -0
  35. package/index.server.ts +43 -26
  36. package/package.json +3 -1
  37. package/requirements.yaml +11 -3
  38. package/server/actions.ts +2 -1
  39. package/server/archive.ts +146 -67
  40. package/server/archived.ts +12 -16
  41. package/server/changes.ts +34 -54
  42. package/server/classify.ts +142 -136
  43. package/server/feedback.ts +2 -6
  44. package/server/fetch.ts +262 -0
  45. package/server/fixture.ts +91 -7
  46. package/server/github-types.ts +3 -1
  47. package/server/markdown.ts +3 -1
  48. package/server/port.ts +46 -0
  49. package/server/queries.ts +33 -23
  50. package/server/service.ts +155 -272
  51. package/server/setup.ts +15 -14
  52. package/server/store.ts +94 -80
  53. package/server/update.ts +34 -13
  54. package/server/view.ts +16 -15
  55. package/shared/archive.ts +116 -13
  56. package/shared/attention.ts +50 -18
  57. package/shared/changes.ts +2 -1
  58. package/shared/config.ts +2 -6
  59. package/shared/drafting.ts +17 -0
  60. package/shared/feedback.ts +6 -5
  61. package/shared/format.ts +2 -1
  62. package/shared/history-report.ts +2 -1
  63. package/shared/item-sessions.ts +76 -0
  64. package/shared/item-view.ts +223 -0
  65. package/shared/linked-sessions.ts +59 -8
  66. package/shared/names.ts +17 -0
  67. package/shared/new-issue.ts +129 -0
  68. package/shared/next-up-filter.ts +137 -0
  69. package/shared/paging.ts +16 -0
  70. package/shared/rpc.ts +23 -10
  71. package/shared/setup.ts +3 -1
  72. package/shared/still.ts +28 -7
  73. package/shared/wrap-up.ts +20 -23
@@ -24,7 +24,7 @@ flowchart LR
24
24
  ```
25
25
 
26
26
  - **Paseo plugin**, installed per daemon.
27
- - Client: one screen and a sidebar header item. React Native primitives only, so it works on phone and desktop [REACH-01].
27
+ - Client: one screen, a sidebar header item and two Command Center items for a new issue [ISS-01]. React Native primitives only, so it works on phone and desktop [REACH-01].
28
28
  - Server: RPC handlers for fetching and for GitHub actions.
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].
@@ -40,7 +40,7 @@ flowchart LR
40
40
  - optional merge method per repo [PRS-04]
41
41
  - `codeRepos`: where an issue repo's code lives, for issues kept in their own repo [SES-07]
42
42
  - `nextUp`: where unclaimed issues come from (`mine`, `orgs`, `repos`, set in Settings) and the org issue fields for priority, effort and scope [NXT-04]
43
- - `state.json`: dismissals [ATT-08], what others did to my work, with which notes I've cleared or an archive acknowledged [HIS-06, HIS-07, ATT-22], Reviewed and Changed by others shown in History's weeks [HIS-07], the scopes, sources and project statuses ticked in Next up's filter [NXT-03, NXT-09], my Paseo projects' GitHub repos [NXT-08], the update put off with Not now [UPD-01] and the last fetch of each feed, so the screen shows instantly after a restart [PRIV-01].
43
+ - `state.json`: dismissals [ATT-08], what others did to my work, with which notes I've cleared or an archive acknowledged [HIS-06, HIS-07, ATT-22], Reviewed and Changed by others shown in History's weeks [HIS-07], the scopes, sources and project statuses ticked in Next up's filter [NXT-03, NXT-09], the repository and profile the New issue sheet last started with [ISS-01], my Paseo projects' GitHub repos [NXT-08], the device's time zone for History's weeks [HIS-01], the update put off with Not now [UPD-01] and the last fetch of each feed, so the screen shows instantly after a restart [PRIV-01].
44
44
 
45
45
  ## Tabs
46
46
 
@@ -48,12 +48,12 @@ The tabs tell the story of my work, left to right: what I finished, what needs m
48
48
 
49
49
  | Tab | Shows |
50
50
  |---|---|
51
- | 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 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. |
51
+ | 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
52
  | Doing | The sections below |
53
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
54
  | Next up | *Assigned to you* [NXT-06], then *Unclaimed* [NXT-01] |
55
55
 
56
- 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. 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`).
56
+ 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`).
57
57
 
58
58
  A sheet shows what the card knows on top, in the same pieces as the card, then every action, then what's fetched when it opens (a PR's size, linked PRs or issues). Tapping a card opens its sheet at once, with every action, and what's fetched fills in; it comes last, so the actions don't move when it arrives. Resting the pointer on a card for 300 ms fetches it ahead, best effort (`usePrefetchOnRest` in `client/sheet.tsx`), and it stays fresh for a minute, so the card and its sheet share one query and on desktop most sheets open complete. Until then `Skeleton` bars hold the room of the lines the card expects, at the lines' own height: one for the size of the PR its actions apply to, one per open PR a Next up issue is known to have. They show only after 150 ms, holding their room meanwhile, so a quick answer doesn't flash them, and lines that come in while the sheet is open fade in. An issue's sheet lists only its open PRs, as its card knows them. A failed fetch shows its error line. On desktop the sheet is a centered dialog, so the one line it can't expect, someone else's PR closing the same issue, grows it a little when it comes [ATT-06, GH-01].
59
59
 
@@ -84,7 +84,7 @@ Top to bottom. Each item appears once, under its most urgent reason [ATT-02]. `s
84
84
  | Needs upstream | My PRs with conflicts or an out-of-sync stack [UPS-01, UPS-02] |
85
85
  | Needs a reviewer | My PRs nobody has been asked to review, even while CI runs [PRS-12]. Only what GitHub records counts as asked: a pending request, an approval or requested changes. GitHub drops a reviewer's request once they review, so a review that only commented, by a person or a bot, leaves it here to re-request; the repo, not us, decides whose approval counts |
86
86
  | My drafts | My drafts, with their own state tags [PRS-05, PRS-06] |
87
- | Wrap up | First, the cleanup: finished or out-of-my-hands work whose unarchived Paseo sessions are all idle, including a review session on someone else's merged PR [ATT-22]. It takes merged, closed and handed-off items, mine or anyone's, including my own PRs I closed without merging ("closed 3h ago, not merged", from the live closed search, never listed in History), as far back as History and its ledger keep, with no age cutoff of its own; a stack or issue group enters only when everything its sessions serve is done, and counts once; one session never makes two rows. A busy session keeps its row out until idle. Newest finish first, each row saying what happened and what is still open: "merged by dave 2h ago · your session's still open", "merged by alice 1d ago · your review session's still open", "2 sessions still open", with an amber "unsaved changes" where a worktree has them. **Archive session** (plural for several) archives the item's agents; a worktree goes too only when it's Paseo's and nothing else lives in it, never a local checkout. One idle session with nothing uncommitted or unpushed archives at once; unsaved or unknown work asks first in a sheet naming it ("2 uncommitted files and 1 unpushed commit on split-invoice-pdf", or "Couldn't check for unsaved changes") with Open session and Archive anyway; several sessions open a sheet listing each one's state with Open; archiving from there checks first too, and any unsaved work it finds gets the naming confirm. **Archive all clean · n** sits in the header with 2+ rows and archives every clean single-session row; it and single archives wait for each other like Got it and Mark all. Success acknowledges exactly the changes present at that moment, so they go to their week as cleared rather than History's unread notes; so does archiving a session Attention Span started in Paseo itself, for what others did up to then, once no session it started is left on that work; a failure keeps the row and says why, and a worktree that wouldn't go after its sessions did is said in an error toast. Until the session list has loaded, or when it fails, Wrap up isn't known: Doing says so instead of showing the horizon. There is no Undo: Paseo's SDK can't restore a workspace and its agents, so the dirty check and confirmation are the safeguard instead. Its rows count in Doing's and the sidebar's count, and keep the horizon away. |
87
+ | Wrap up | First, the cleanup: finished or out-of-my-hands work whose unarchived Paseo sessions are all idle, including a review session on someone else's merged PR [ATT-22]. It takes merged, closed and handed-off items, mine or anyone's, including my own PRs I closed without merging ("closed 3h ago, not merged", from the live closed search, never listed in History) and my merged PRs from the same search, which stand in until History has them (`ownClosed` in `server/changes.ts`; History's entry wins) [FRESH-03], as far back as History and its ledger keep, with no age cutoff of its own; a stack or issue group enters only when everything its sessions serve is done, and counts once; one session never makes two rows. A busy session keeps its row out until idle. Newest finish first, each row saying what happened and what is still open: "merged by dave 2h ago · your session's still open", "merged by alice 1d ago · your review session's still open", "2 sessions still open", with an amber "unsaved changes" where a worktree has them. **Archive session** (plural for several) archives the item's agents and the sub-agents they started; a worktree goes too only when it's Paseo's and no other session lives in it, never a local checkout. A sub-agent still running or starting, or flagged for anything but finished or failed (a permission, say), keeps its session's row out, like a busy session; a finished or failed one Paseo still flags for attention doesn't (`subAgentBusy`), as nobody opens a sub-agent and reporting back is its parent's job. One idle session with nothing uncommitted or unpushed archives at once; unsaved or unknown work, or a terminal open in a worktree that goes, asks first in a sheet shaped like Paseo's own "Archive workspace" one: 'Archive "Split invoice PDF"?' when the worktree goes with it (else "Archive the session on #186?"), then each session's lines in Paseo's words ("Uncommitted changes: 2 files (+12 −3)", "1 unpushed commit", "Couldn't check for unsaved changes") and a muted "Closes terminals: dev, shell", with Open session and Archive; a terminal that opened after the sheet brings it back; the multi sheet notes "+1 sub-agent" under a session that has them; several sessions open a sheet listing each one's state with Open; archiving from there checks first too, and any unsaved work it finds gets the naming confirm. **Archive all clean · n** sits in the header with 2+ rows and archives every clean single-session row; it and single archives wait for each other like Got it and Mark all. Success acknowledges exactly the changes present at that moment, so they go to their week as cleared rather than History's unread notes; so does archiving a session Attention Span started in Paseo itself, for what others did up to then, once no session it started is left on that work; a failure keeps the row and says why, and a worktree that stayed after its sessions went keeps a row in Wrap up, uncounted, saying why, briefly, beside the archive mark ("Fix flaky test still in it", "dev server opened meanwhile", "Paseo: worktree is locked") with a button for the reason (Open session, Archive worktree, Try again) and × to dismiss; it goes once the worktree is archived anywhere, and keeps the horizon away until then. Until the session list has loaded, or when it fails, Wrap up isn't known: Doing says so instead of showing the horizon. There is no Undo: Paseo's SDK can't restore a workspace and its agents, so the dirty check and confirmation are the safeguard instead. Its rows count in Doing's and the sidebar's count, and keep the horizon away. |
88
88
 
89
89
  **Nothing in Doing** shows a horizon instead of a list (`client/still.tsx`) [ATT-18], with "Nothing's on you. Enjoy the quiet." It follows the device's clock at fixed hours: a low sun in the morning (5–11), a high sun at midday (11–16), a setting sun in the evening (16–21), and a moon with a few stars at night, each in its own soft tint. It settles in on every arrival on the tab (the sky drifts up as it fades in, then its reflections, 700 ms; not with reduced motion), then holds still; when the hour changes while it's open, it crossfades. It shows only after a refresh that worked: before the first one there's a spinner, and after a failed one just the error. Items that are all dismissed count as clear; the "show them again" line sits faintly at the bottom. Wrap up's rows don't: the horizon waits until they're archived too [ATT-22]. Changed by others never touches Doing; it lives in History [HIS-07].
90
90
 
@@ -96,7 +96,7 @@ Top to bottom. Each item appears once, under its most urgent reason [ATT-02]. `s
96
96
  - **Mentions** [MEN-01..06]: a thread counts when a person @-mentioned me after my last comment, review or reaction there. Team mentions are ignored. A bot counts only when it opened a thread I need to resolve, and is marked with 🤖. The quote on a card is cut around the mention, so it's shown as plain text: links keep their text, Markdown marks and quoted replies go.
97
97
  - **Handed over** [PRS-08]: my PRs assigned to someone else, and not to me, are left out. Mentions of me on them still count. A PR of mine with nobody assigned is mine.
98
98
  - **Changed by others** [HIS-07] (`server/changes.ts`) keeps a ledger of what others did, in `state.json`, by GitHub's node ids, which a transfer keeps. Only someone else's doing counts; my own actions and others' pushes don't. Merges, unmerged closes and issue closes come from live searches: `mergedBy`, the last close event's actor, and an issue's `stateReason`. A PR that left my hands before it ended counts as the handover, not the merge; one assigned to someone after it ended is still my merge, and a PR someone else has waits a refresh for its lookup rather than be called a merge. Handovers come from GitHub's assign and unassign events, which are separate, never one "handover": a PR is looked up when it's assigned to someone else and not me, once per change of its assignees; it left my hands with whichever came last of my removal and the new owner's assignment, so a PR I took myself off is mine until someone takes it, and an earlier round's removal doesn't name who took it this time; an issue when it leaves my assigned search since the last refresh that worked. Leaving the search proves nothing (search lag, a coverage change, its 50 results), so only an unassign event of me by someone else counts; one closed by then is left to its close note. So unassignments are noticed only for issues Attention Span has seen assigned to me; on the first run none count as gone. A PR seen closed unmerged is tracked; once it drops out of the closed search, as a reopen takes it out, a batch asks for its state and last reopen event. A reopen removes the old close from its week whoever did it, and only someone else's is a note; a merged one stops being tracked, and nothing older than the ledger's window is tracked. A first run tracks from then on, so old closes don't replay as new. A failed lookup, or one node in it GitHub failed on (anything but not found), is asked again on the next refresh. A PR handed over isn't listed under the finished issue it closed either; when a cleared handover's work comes back to me it stays in its week, marked returned, so my later work on it is mine again. Events are kept `historyWeeks` + 1 weeks, or `mentionDays` if longer; unread notes expire after `mentionDays` for History's top section.
99
- - **Wrap up** [ATT-22] (`shared/wrap-up.ts`, drawn by `client/wrap-up.tsx`) is assembled on the client from the sessions the screen and the sidebar already poll; the server archives and acknowledges. An item's identity is `memberKeys` in `shared/attention.ts`: its key, the PRs under it and the work a change note is about, spelled as GitHub spells them since Paseo's labels match exactly, and compared ignoring case; Wrap up, archiving and acknowledging all use it. A finished item, reviewed PR, my own unmerged close, cleared change or unread change is a candidate; its sessions are the ones on any of its member keys. It enters when it has at least one unarchived session, every one is idle (not working and not needing me), none serves an item still in Doing or Waiting, and no session already belongs to another row. History lists a merged PR alone, as its branches are gone, so each live refresh remembers every open stack's and issue group's keys under each member (`groups` in `state.json`, kept as long as the ledger): a merged member whose remembered sibling is still open stays out, and so does its session. The screen freezes rows whose archive runs and Archive all clean while any row's archive runs (`shared/got-it.ts`). Archiving goes through `paseo.agents.ref(id).archive()`; a Paseo worktree is archived too only when every unarchived agent in it is being archived, and a local checkout never is. The dirty check reads Paseo's workspace snapshot and, for counts, `git status --porcelain` and `git rev-list --count @{upstream}..HEAD` (with no upstream, `HEAD --not --remotes`) on the daemon host. Clean needs both answers: when either can't say, it's treated as dirty and the sheet says so. Agents and their status are listed again right before archiving, so a session that started working during the checks, or one that moved into the worktree, stops it. A session Attention Span started, archived in Paseo itself, is caught by the `agent.archived` hook in `index.server.ts` (`server/archived.ts`), even with the screen closed: once no other open session labelled with any key of its item's group is left, the group's changes up to the archive's `archivedAt` are acknowledged, so what others do later still shows. A sub-agent's archive, a restored session and a session without an item label acknowledge nothing; sessions linked only by their workspace neither acknowledge nor hold an acknowledgement back. Lists read every page, and a lookup that fails is tried again on the next hook event or list request, never taken as "none left"; tries are kept in memory, so an archive while the server isn't running, or one pending at a restart, isn't noticed, and Got it or Mark all clears its notes. When a session leaves the screen's 15-second poll (`useItemAgents` in `client/sessions.ts`, shared with the sidebar), the screen reads the server's view from memory first, so the notes acknowledged for it are cleared before its Wrap up row goes. Paseo's SDK has no `restoreWorkspace`, so there is no Undo; `server/archive.ts` confirms instead.
99
+ - **Wrap up** [ATT-22] (`shared/wrap-up.ts`, drawn by `client/wrap-up.tsx`) is assembled on the client from the sessions the screen and the sidebar already poll; the server archives and acknowledges. An item's identity is `memberKeys` in `shared/attention.ts`: its key, the PRs under it and the work a change note is about, spelled as GitHub spells them since Paseo's labels match exactly, and compared ignoring case (`shared/names.ts`, as all GitHub names are); Wrap up, archiving and acknowledging all use it. A finished item, reviewed PR, my own unmerged close, cleared change or unread change is a candidate; its sessions are the ones on any of its member keys. It enters when it has at least one unarchived session, every one is idle (not working and not needing me), none serves an item still in Doing or Waiting, and no session already belongs to another row. History lists a merged PR alone, as its branches are gone, so each live refresh remembers every open stack's and issue group's keys under each member (`groups` in `state.json`, kept as long as the ledger): a merged member whose remembered sibling is still open stays out, and so does its session. The screen freezes rows whose archive runs and Archive all clean while any row's archive runs (`shared/got-it.ts`). Archiving goes through `paseo.agents.ref(id).archive()`, sub-agents first (found by Paseo's `paseo.parent-agent-id` label, `subAgentsOf` in `shared/linked-sessions.ts`; one in another workspace is archived, its workspace left alone; archive lists every page of agents, archived ones too, so one under an archived sub-agent still counts, and a sub-agent that won't archive and stays open stops the archive before its session goes); a Paseo worktree is archived too, through `paseo.workspaces.archive`, which archives everything in it, only when every unarchived agent in it is being archived, and a local checkout never is. Workspaces are named as Paseo's sidebar names them: the title, else the branch. A worktree that stays is a `KeptRow` in `state.json` (`kept`) with its row's item; the `workspace.archived` hook forgets it, and remembers the workspace so an archive still running doesn't add it back, Dismiss forgets it, and Archive worktree or Try again runs the same checks on the worktree alone (`rpc.archiveWorktree`). Paseo closes a worktree's terminals when it archives it, so they're listed (`paseo.terminals.list`) right before archiving and named on the sheet; the confirm sends back the ids it named, and any other asks again. They're listed once more right before each worktree goes: one that opened while the sessions were being archived keeps its worktree, said in its kept row, as Paseo's SDK has no archive that checks and removes at once. Terminals that can't be listed don't keep the worktree, as Paseo would close them anyway. The plugin SDK says nothing of what a terminal runs, so an idle shell and a dev server are named alike. The dirty check reads Paseo's workspace snapshot and, for counts, `git status --porcelain`, `git diff --shortstat HEAD` for lines, and `git rev-list --count @{upstream}..HEAD` (with no upstream, `HEAD --not --remotes`) on the daemon host. Clean needs both answers: when either can't say, it's treated as dirty and the sheet says so (`unsavedOf` in `shared/archive.ts`, for the server and the screen alike). Agents and their status are listed again right before archiving, so a session that started working during the checks, or one that moved into the worktree, stops it. A session Attention Span started, archived in Paseo itself, is caught by the `agent.archived` hook in `index.server.ts` (`server/archived.ts`), even with the screen closed: once no other open session labelled with any key of its item's group is left, the group's changes up to the archive's `archivedAt` are acknowledged, so what others do later still shows. A sub-agent's archive, a restored session and a session without an item label acknowledge nothing; sessions linked only by their workspace neither acknowledge nor hold an acknowledgement back. Lists read every page, and a lookup that fails is tried again on the next hook event or list request, never taken as "none left"; tries are kept in memory, so an archive while the server isn't running, or one pending at a restart, isn't noticed, and Got it or Mark all clears its notes. A new list that brings other merged branches polls again at once, so a session linked by branch doesn't wait for the next round. When a session leaves the screen's 15-second poll (`useItemAgents` in `client/sessions.ts`, shared with the sidebar), the screen reads the server's view from memory first, so the notes acknowledged for it are cleared before its Wrap up row goes. Paseo's SDK has no `restoreWorkspace`, so there is no Undo; `server/archive.ts` confirms instead.
100
100
 
101
101
  - **Dismiss** [ATT-08] hides an item until someone other than me comments, reviews or pushes, or its reason changes. My own actions and CI reruns don't bring it back.
102
102
  - **Behind base** [UPS-07] only matters when:
@@ -110,7 +110,7 @@ Top to bottom. Each item appears once, under its most urgent reason [ATT-02]. `s
110
110
 
111
111
  ## Next up
112
112
 
113
- A second tab lists open issues nobody is assigned to [NXT-01], from the sources chosen under Next up in Settings: my own repos (`user:<login>`, forks left out), orgs I belong to (picked from `viewer.organizations`), and single repos checked on GitHub [NXT-04]. Each source is its own search, so an issue knows which sources found it and no query outgrows GitHub's length limit; one found by several is listed once. With more than one source, the Filter button on Unclaimed also filters by source, and what I tick is saved in `state.json` [NXT-09]. With no sources chosen, it looks in the configured orgs and repos. With neither, it looks in the GitHub repos of my Paseo projects, listed at each refresh through the app's last connection and kept in `state.json` for refreshes before the app connects; with no projects either, it says where to add some [NXT-08]. Unlike the other searches it isn't about me, so it never runs across all of GitHub. They are ordered by priority, then effort, then age [NXT-02]. Priority and effort are org issue fields named in `config.json`; a value ranks by the configured `order` (matched by name, so "Small" matches "🐇 Small (0.5-2d)") or else by the field's own option order in the issue's own org, as two orgs may order a Priority field differently. Issues without a value go last. Each card shows the issue's number and repo, its age, then pills, each an icon half and a value half: the projects it's on with its Status there (a board icon and the project's name), then priority (flag), effort (weight) and scope (layers), values with the org's emoji and notes in brackets trimmed. Pointing at a pill names it ("Priority: P1 High"), and the sheet lists each by name, as phones can't point. Status and priority get a soft fill in the color GitHub has for the option, drawn in GitHub's shade for a dark or light theme (told by the theme's base surface); GRAY is what an option looks like with no color chosen, so it's left plain. Where an org colored none of its priorities, the top two are warm and accent instead. An open PR that closes the issue (`closedByPullRequestsReferences`, from the same search) shows as "PR by alice", without changing the order [NXT-10]. The type is a badge tinted with theme colors. **Close issue** in the sheet asks on the card for the reason (completed or not planned) and an optional comment, then runs `gh issue close`; Undo reopens it [NXT-11]. The Filter button on Unclaimed opens a sheet (a dialog on desktop) with a checkbox per source, per project and per scope; ticks apply right away, all are off at first, and what I tick is saved in `state.json` [NXT-03]. Each project the unclaimed issues are on lists every option of its Status field under it, in the board's order with its color, dimmed where no unclaimed issue has it, plus *No status* where some issue on it has none; *No project* comes last. Ticking a project ticks all its statuses; ticking some shows it partly ticked. An issue shows when any of its projects' ticks is on.
113
+ A second tab lists open issues nobody is assigned to [NXT-01], from the sources chosen under Next up in Settings: my own repos (`user:<login>`, forks left out), orgs I belong to (picked from `viewer.organizations`), and single repos checked on GitHub [NXT-04]. Each source is its own search, so an issue knows which sources found it and no query outgrows GitHub's length limit; one found by several is listed once. With more than one source, the Filter button on Unclaimed also filters by source, and what I tick is saved in `state.json` [NXT-09]. With no sources chosen, it looks in the configured orgs and repos. With neither, it looks in the GitHub repos of my Paseo projects, listed at each refresh through the app's last connection and kept in `state.json` for refreshes before the app connects; with no projects either, it says where to add some [NXT-08]. Unlike the other searches it isn't about me, so it never runs across all of GitHub. They are ordered by priority, then effort, then age [NXT-02]. Priority and effort are org issue fields named in `config.json`; a value ranks by the configured `order` (matched by name, so "Small" matches "🐇 Small (0.5-2d)") or else by the field's own option order in the issue's own org, as two orgs may order a Priority field differently. Issues without a value go last. Each card shows the issue's number and repo, its age, then pills, each an icon half and a value half: the projects it's on with its Status there (a board icon and the project's name), then priority (flag), effort (weight) and scope (layers), values with the org's emoji and notes in brackets trimmed. Pointing at a pill names it ("Priority: P1 High"), and the sheet lists each by name, as phones can't point. Status and priority get a soft fill in the color GitHub has for the option, drawn in GitHub's shade for a dark or light theme (told by the theme's base surface); GRAY is what an option looks like with no color chosen, so it's left plain. Where an org colored none of its priorities, the top two are warm and accent instead. An open PR that closes the issue (`closedByPullRequestsReferences`, from the same search) shows as "PR by alice", without changing the order [NXT-10]. The type is a badge tinted with theme colors. **Close issue** in the sheet asks on the card for the reason (completed or not planned) and an optional comment, then runs `gh issue close`; Undo reopens it [NXT-11]. The Filter button on Unclaimed opens a sheet (a dialog on desktop, its rules in `shared/next-up-filter.ts`) with a checkbox per source, per project and per scope; ticks apply right away, all are off at first, and what I tick is saved in `state.json` [NXT-03]. Each project the unclaimed issues are on lists every option of its Status field under it, in the board's order with its color, dimmed where no unclaimed issue has it, plus *No status* where some issue on it has none; *No project* comes last. Ticking a project ticks all its statuses; ticking some shows it partly ticked. An issue shows when any of its projects' ticks is on.
114
114
 
115
115
  **Projects** [NXT-12] are the open org or user projects an issue's on (`projectItems`, the first 10, archived items left out), with the value of the board's built-in Status field. Boards the token can't see, like an SSO org's, come back empty and are left out. When GitHub cuts the list short and none of the first 10 is open, the issue's boards are unknown: no pill, and a project filter hides it rather than call it on no project. Each board's Status options come once per board, in their own request after the searches (`projectStatusesQuery`), so a board that can't be read costs only its statuses in the filter.
116
116
 
@@ -144,7 +144,7 @@ An agent icon (Tabler's `message-ai`, a speech bubble with "AI") marks every act
144
144
 
145
145
  A tap starts with defaults. An existing workspace for the branch or PR is resumed instead of creating a new one.
146
146
 
147
- While an item has an open session, its main action is **Open session** instead, in every tab [SES-03, ATT-07]. A session belongs to an item when it was started on the item or on any PR under it, and isn't archived; none do once the item is merged or closed. With several, it opens one that needs me, else the most recent. In the sheet each session sits in the line of the action that started it, named after it ("Fix CI", "Rebase stack"), one line per session: a session's kind is saved as the `attention-span-kind` label when it starts. Sessions none of the item's actions would start lead the sheet: those started before kinds were saved, as "Continue session", and those whose action is gone, like Fix CI once checks pass. Sessions started outside Attention Span count too, with no kind, so they lead as "Continue session" [SES-08]: an agent in a workspace Paseo linked to a PR (`githubRuntime.pullRequest`) belongs to that PR, and one in a worktree belongs to the item of the Attention Span session there, unless the worktree has sessions for two items. Main and local checkouts never pass an item on, a labelled session keeps its own item, and agents another agent started belong to that agent. Issues get only the sessions Attention Span started: Paseo doesn't record which issue a workspace was started from. Next up's sheet does the same with Start: "Claim & start…" or "Start…" until there's a session, then the sessions as "Continue session" and a muted "Start another session…". Collapsed, a stack shows only the PRs that need attention [ATT-04]; once it shows any, an issue's card shows the PR its actions apply to as well, tinted with "actions apply here", and says that PR's facts on its row rather than in the meta, as the sheet does [ATT-06].
147
+ While an item has an open session, its main action is **Open session** instead, in every tab [SES-03, ATT-07]. A session belongs to an item when it was started on the item or on any PR under it, and isn't archived; none do once the item is merged or closed. With several, it opens one that needs me, else the most recent. In the sheet each session sits in the line of the action that started it, named after it ("Fix CI", "Rebase stack"), one line per session: a session's kind is saved as the `attention-span-kind` label when it starts. Sessions none of the item's actions would start lead the sheet: those started before kinds were saved, as "Continue session", and those whose action is gone, like Fix CI once checks pass. Sessions started outside Attention Span count too, with no kind, so they lead as "Continue session" [SES-08]: an agent in a workspace Paseo linked to a PR (`githubRuntime.pullRequest`) belongs to that PR, and one in a worktree belongs to the item of the Attention Span session there, unless the worktree has sessions for two items; failing both, one in a worktree belongs to my merged or closed PR whose repo and head branch the worktree is on, the most recently merged or closed if a branch was used twice, and none while an open PR of mine is on that branch (`closedBranches`, from History, my own unmerged closes and a merge done here before History catches up), since Paseo may drop a PR link once it merges [ATT-22]. The poll's pure assembly is `sessionsFrom` in `shared/item-sessions.ts`; `client/sessions.ts` only fetches every page. Main and local checkouts never pass an item on, a labelled session keeps its own item, and agents another agent started belong to that agent. Issues get only the sessions Attention Span started: Paseo doesn't record which issue a workspace was started from. Next up's sheet does the same with Start: "Claim & start…" or "Start…" until there's a session, then the sessions as "Continue session" and a muted "Start another session…". Collapsed, a stack shows only the PRs that need attention [ATT-04]; once it shows any, an issue's card shows the PR its actions apply to as well, tinted with "actions apply here", and says that PR's facts on its row rather than in the meta, as the sheet does [ATT-06].
148
148
 
149
149
  ## Sessions
150
150
 
@@ -165,6 +165,17 @@ Each session gets its own workspace on an empty scratch directory, so archiving
165
165
 
166
166
  The agent asks one question at a time from its kind's checklist, and checks the report against the requirements and docs, `config.json` and `state.json`, and open issues and discussions. A match gets its link and nothing else. It files an issue if a maintainer could finish and close it, otherwise a discussion in Q&A or Ideas, and says which and why. Posts are short up front, with the rest in collapsed `<details>` blocks, in English, in the user's voice, with nothing from their own setup they didn't write. It posts only after Post it in its question tool, or the reply "post" [SAFE-01], then archives its workspace (`archive_workspace`, or `archive_agent` without it). The client watches workspace updates, remembers the scratch ones by their directory, and opens Attention Span when one is removed, instead of leaving "workspace unavailable" on screen. The prompts are built in: `config.json` can't replace them, since they carry those rules.
167
167
 
168
+ ## New issues
169
+
170
+ A new issue in a repository I cover, from anywhere in Paseo [ISS-01]:
171
+
172
+ - **Where it starts**: two Command Center items, and New issue in Next up's Unclaimed header. Paseo lists `global` items everywhere and `agent` items beside them when an agent is focused, so there are two with different meanings rather than one per context: **New issue…** (global) and **New issue from this session…** (agent), which knows the workspace and agent. A Command Center item can't show a sheet of its own (only sidebar items get `openPopover`), so both open the Attention Span screen with `newIssue` (a fresh timestamp), `workspaceId` and `agentId` as its params, and the screen shows the sheet once per timestamp.
173
+ - **The sheet** (`client/new-issue.tsx`): a text box first. Below it, one line says where it goes, with what and with which profile, and opens the choices: repository, whether this session's last messages come along (only from a session), and agent profile. The repositories are the ones covered (`newIssueRepos`, from the server's view): those chosen in Settings and for Next up, my Paseo projects' and shown items' repos under a chosen org or my own account (with My repos), and every shown item's. With nothing chosen, all my projects. It starts on the workspace's repository, then the one Next up's source filter is narrowed to, then the one used last, then the only one there is; the last repository and profile are kept in `state.json` (`new-issue.choice`).
174
+ - **Checkout**: the project whose remote is the repository, or the one `codeRepos` maps it to [SES-05, SES-07]. When there's none, the sheet lists my projects; the pick is saved to `codeRepos`, like Start's. The agent runs in the workspace I came from when it's a checkout of that project, else in the project's own checkout (`workspaces.open` on its root). No new worktree: it only reads.
175
+ - **Context**: from a session, the sheet reads that agent's last timeline page (`timeline.refetch`, `tail`, projected) and keeps its last four messages, mine and the agent's, cut at 800 characters, with its title, workspace and branch. Reading may fail; the rest still goes.
176
+ - **The prompt** (`shared/new-issue.ts`) shares its core with feedback's (`shared/drafting.ts`): one question at a time until a maintainer could act on it, the whole draft before anything is posted, and Post it / Change something / Cancel [SAFE-01]. It reads the code to cite `path:line` and changes nothing; the body goes in a `mktemp -d` file outside the checkout. It follows the repository's issue templates (the checkout's `.github/ISSUE_TEMPLATE/`, else `gh api`; always `gh api` when the checkout is another repository's code [SES-07]), else feedback's skimmable shape, and picks only labels and issue types the repository has. It assigns no one and adds it to no project. A likely duplicate gets its link and File anyway / Comment there instead / Cancel; a comment is drafted and approved the same way [ISS-02]. Once posted, the agent archives itself (`archive_agent`), never the workspace, since that's my checkout. Its title carries a short random tag, "New issue: acme/web (k3x9q)", so it finds itself by exact title and archives nothing if that isn't exactly one agent. Start waits until the workspace I came from and my profiles are known, so it neither falls back to the project's checkout nor drops the remembered profile.
177
+ - The session is labelled `attention-span-item: new-issue:<repo>`, and no tab shows it.
178
+
168
179
  ## Updates
169
180
 
170
181
  A notice above the list says when a newer version is out, and Update installs it [UPD-01].
@@ -186,7 +197,7 @@ Light on GitHub's API [GH-01], and quick when I press ⟳. Attention Span has tw
186
197
 
187
198
  ### Live
188
199
 
189
- One GraphQL request per search, sent in parallel. GitHub runs the searches in one request one after another, so a combined request took about 5 seconds where parallel ones take about 2.
200
+ One GraphQL request per search, sent in parallel (`server/fetch.ts`; the service reaches GitHub, Paseo, its files and the clock only through `server/port.ts`, and previews pass a fixture port). GitHub runs the searches in one request one after another, so a combined request took about 5 seconds where parallel ones take about 2.
190
201
 
191
202
  - `is:pr is:open author:@me` (also asks for the viewer's login, and whether auto-merge is on and allowed)
192
203
  - `is:pr is:open user-review-requested:@me` (personal requests only)
@@ -200,13 +211,13 @@ One GraphQL request per search, sent in parallel. GitHub runs the searches in on
200
211
 
201
212
  Once my PRs and both issue searches are back, one batched **details** request asks for `Ref.compare` behind counts for my PRs, the open issues their descriptions refer to (at most 100), and the option order and colors of org issue fields when Next up needs them [NXT-02, NXT-10]. The other searches carry on meanwhile.
202
213
 
203
- Then, only for PRs whose assignees changed to someone else and issues that left my assigned search, one request per 20 asks for their last 30 assign and unassign events (`assignmentsQuery`) [HIS-07]; and one per 20 for tracked closed PRs that left the closed search asks their state and last reopen event (`reopenQuery`) [HIS-07]; usually none.
214
+ Then, only for PRs whose assignees changed to someone else and issues that left my assigned search, one request per 20 asks for their last 30 assign and unassign events (`assignmentsQuery`) [HIS-07]; and, at the same time, one per 20 for tracked closed PRs that left the closed search asks their state and last reopen event (`reopenQuery`) [HIS-07]; usually none.
204
215
 
205
216
  A live refresh is 10 requests and about 87 points, of the 5,000 GitHub allows per hour. Points depend on how much a query asks for, not how many requests carry it; my PRs (34) and review requests (20) cost the most.
206
217
 
207
218
  ### History
208
219
 
209
- One request with three searches, each from the Monday `historyWeeks` back: `is:pr is:merged author:@me` (with `mergedBy` [HIS-05]), `is:pr is:merged reviewed-by:@me -author:@me` (with `mergedBy` [HIS-02]), `is:issue is:closed assignee:@me` (with the last close event's actor [HIS-07]), and the viewer's login. Each result brings up to 20 label names, and issues their type [HIS-04]. About 4 points, mostly the label lists.
220
+ One request with three searches, each from midnight on the Monday `historyWeeks` back in the device's time zone, to the second. The screen sends its IANA zone with each request for the list; the server keeps the last one in `state.json`, uses UTC until one comes, uses it for background fetches and for which cleared changes still show, and fetches History again when it changes [HIS-01]: `is:pr is:merged author:@me` (with `mergedBy` [HIS-05]), `is:pr is:merged reviewed-by:@me -author:@me` (with `mergedBy` [HIS-02]), `is:issue is:closed assignee:@me` (with the last close event's actor [HIS-07]), and the viewer's login. Each result brings up to 20 label names, and issues their type [HIS-04]. About 4 points, mostly the label lists.
210
221
 
211
222
  Every search is scoped to the configured orgs and repos; Next up's unclaimed issues as described under Next up.
212
223
 
package/index.client.tsx CHANGED
@@ -6,6 +6,7 @@ import { CoverageSettings } from "./client/coverage-settings";
6
6
  import { useAttention } from "./client/data";
7
7
  import { returnFromFeedback } from "./client/feedback";
8
8
  import { ICONS } from "./client/icons";
9
+ import { newIssueParams } from "./client/new-issue";
9
10
  import { useItemAgents } from "./client/sessions";
10
11
  import { doingCount, wrapItems } from "./shared/wrap-up";
11
12
 
@@ -38,5 +39,23 @@ export default function contribute(client: PluginClientContext) {
38
39
  const Screen = (props: PluginScreenProps) => <AttentionScreen {...props} openSettings={() => client.openSettings("coverage")} />;
39
40
  client.addScreen({ id: "attention", title: "Attention Span", Component: Screen });
40
41
  client.addSidebarHeaderItem({ id: "attention", title: "Attention Span", Component: SidebarItem });
42
+ // A new issue from ⌘K anywhere [ISS-01]. ⌘K can't show a sheet, so it opens the screen with the sheet on it. Paseo lists
43
+ // global items everywhere and agent items beside them, so "from this session" is the one that knows where I am.
44
+ client.addCommandCenterItem({
45
+ id: "new-issue",
46
+ title: "New issue…",
47
+ icon: ICONS.issue,
48
+ context: "global",
49
+ keywords: ["issue", "github", "file", "report", "bug", "idea"],
50
+ onSelect: ({ openScreen }) => openScreen({ screenId: "attention", params: newIssueParams({}) }),
51
+ });
52
+ client.addCommandCenterItem({
53
+ id: "new-issue-from-session",
54
+ title: "New issue from this session…",
55
+ icon: ICONS.issue,
56
+ context: "agent",
57
+ keywords: ["issue", "github", "file", "follow-up", "later"],
58
+ onSelect: ({ openScreen, workspace, agent }) => openScreen({ screenId: "attention", params: newIssueParams({ workspaceId: workspace.id, agentId: agent.id }) }),
59
+ });
41
60
  return returnFromFeedback(client);
42
61
  }
package/index.server.ts CHANGED
@@ -18,38 +18,46 @@ import { ArchivedInPaseo } from "./server/archived";
18
18
  import { defaultBranch, sessionContext } from "./server/context";
19
19
  import { itemDetails } from "./server/details";
20
20
  import { feedbackInfo } from "./server/feedback";
21
- import { FIXTURE_CONTEXT, fixtureDetails, fixtureReviewerChoices } from "./server/fixture";
21
+ import { fixtureAnswers, fixtureDismissKept, fixturePort, fixtureView } from "./server/fixture";
22
22
  import { FIXTURE } from "./server/gh";
23
- import { checkCoverage, configStatus, myOrgs, setupStatus } from "./server/setup";
23
+ import { realPort } from "./server/port";
24
+ import { checkCoverage, configStatus, coverageOnGitHub, ghStatus, myOrgs, setupStatus } from "./server/setup";
24
25
  import { AttentionService, type Change } from "./server/service";
25
- import { UpdateCheck } from "./server/update";
26
- import type { Chip } from "./shared/attention";
26
+ import { createStore, DIR, OLD_DIR } from "./server/store";
27
+ import { fixtureUpdates, paseoUpdates, UpdateCheck } from "./server/update";
28
+ import type { AttentionView, Chip } from "./shared/attention";
27
29
  import { readyProviders } from "./shared/providers";
28
30
  import * as rpc from "./shared/rpc";
29
31
 
30
32
  export default function contribute(server: PluginServerContext) {
31
- const attention = new AttentionService();
32
- const updates = new UpdateCheck();
33
+ // Previews run on made-up data and never reach GitHub; which one is picked here, once.
34
+ const store = createStore(DIR, OLD_DIR);
35
+ const attention = new AttentionService(FIXTURE ? fixturePort(store, DIR) : realPort(store));
36
+ const answers = FIXTURE ? fixtureAnswers : { reviewerChoices, itemDetails, defaultBranch, sessionContext, ghStatus, myOrgs, coverageOnGitHub };
37
+ const updates = new UpdateCheck(FIXTURE ? fixtureUpdates : paseoUpdates);
38
+ // Each view the screen gets; previews add their made-up sessions [ATT-22].
39
+ const shown: (view: AttentionView) => AttentionView = FIXTURE ? fixtureView : (view) => view;
33
40
  const archived = new ArchivedInPaseo({ groupKeysOf: (itemKey) => attention.groupKeysOf(itemKey), acknowledge: (keys, upTo) => attention.acknowledge(keys, upTo) });
34
41
  const started = attention.start().catch((error) => console.error("Attention Span failed to start:", error));
35
42
  const ready = <T>(work: () => Promise<T>) => started.then(work);
36
43
 
37
44
  // A change on GitHub, answered with the list after it; what it does to the card shows right away [FRESH-02].
38
- const act = (key: string, work: () => Promise<void>, change: Change) => ready(() => attention.act(key, work, change));
45
+ const act = (key: string, work: () => Promise<void>, change: Change) => ready(() => attention.act(key, work, change)).then(shown);
39
46
  const chip = (text: string, tone: Chip["tone"] = "neutral", icon?: Chip["icon"]): Change => ({ kind: "chip", chip: { text, tone, ...(icon ? { icon } : {}) } });
40
47
 
41
- // The app asks for the list on load and every few minutes; its Paseo connection lets refreshes see my projects [NXT-08].
42
- server.handle(rpc.getAttention, ({ refresh, cached }, { paseo }) =>
48
+ // The app asks for the list on load and every few minutes; its Paseo connection lets refreshes see my projects [NXT-08],
49
+ // and its time zone sets History's weeks [HIS-01].
50
+ server.handle(rpc.getAttention, ({ refresh, cached, timeZone }, { paseo }) =>
43
51
  ready(() => {
44
52
  attention.connect(paseo);
45
53
  if (archived.waiting) void archived.notice(paseo);
46
- return attention.get(refresh, cached);
47
- }),
54
+ return attention.get(refresh, cached, timeZone);
55
+ }).then(shown),
48
56
  );
49
- server.handle(rpc.dismissItem, ({ key }) => ready(() => attention.dismiss(key)));
50
- server.handle(rpc.undismissItem, ({ key }) => ready(() => attention.undismiss(key)));
51
- server.handle(rpc.gotIt, ({ ids, on }) => ready(() => attention.gotIt(ids, on)));
52
- server.handle(rpc.setHistoryFilter, ({ filter }) => ready(() => attention.setHistoryFilter(filter)));
57
+ server.handle(rpc.dismissItem, ({ key }) => ready(() => attention.dismiss(key)).then(shown));
58
+ server.handle(rpc.undismissItem, ({ key }) => ready(() => attention.undismiss(key)).then(shown));
59
+ server.handle(rpc.gotIt, ({ ids, on }) => ready(() => attention.gotIt(ids, on)).then(shown));
60
+ server.handle(rpc.setHistoryFilter, ({ filter }) => ready(() => attention.setHistoryFilter(filter)).then(shown));
53
61
  // A session Attention Span started, archived in Paseo itself, even with Attention Span closed [HIS-07, ATT-22]. Each
54
62
  // event, and each request for the list, also tries again the ones that failed, as both bring a Paseo connection.
55
63
  server.on("agent.archived", ({ agent, archivedAt }, { paseo }) => {
@@ -59,21 +67,30 @@ export default function contribute(server: PluginServerContext) {
59
67
  server.on("agent.turn_ended", (_event, { paseo }) => {
60
68
  if (archived.waiting) void ready(() => archived.notice(paseo));
61
69
  });
62
- server.handle(rpc.archiveSessions, ({ targets, confirm }, { paseo }) => ready(() => attention.archive(paseo, targets, confirm)));
63
- server.handle(rpc.restoreDismissed, () => ready(() => attention.restoreDismissed()));
64
- server.handle(rpc.setCodeRepo, ({ issueRepo, codeRepo }) => ready(() => attention.setCodeRepo(issueRepo, codeRepo)));
65
- server.handle(rpc.setupStatus, () => setupStatus());
66
- server.handle(rpc.getCoverage, () => configStatus());
67
- server.handle(rpc.checkCoverage, ({ kind, name }) => checkCoverage(kind, name));
70
+ server.handle(rpc.archiveSessions, ({ targets, confirm, terminals }, { paseo }) => ready(() => attention.archive(paseo, targets, confirm, terminals)).then((outcome) => ({ ...outcome, view: shown(outcome.view) })));
71
+ server.handle(rpc.archiveWorktree, ({ workspaceId, confirm, terminals }, { paseo }) =>
72
+ ready(() => attention.archiveWorktree(paseo, workspaceId, confirm, terminals)).then((outcome) => ({ ...outcome, view: shown(outcome.view) })),
73
+ );
74
+ server.handle(rpc.dismissKept, ({ workspaceId }) => {
75
+ if (FIXTURE) fixtureDismissKept(workspaceId);
76
+ return ready(() => attention.dismissKept(workspaceId)).then(shown);
77
+ });
78
+ server.on("workspace.archived", ({ workspace }) => void ready(() => attention.forgetKept(workspace.id)));
79
+ server.handle(rpc.restoreDismissed, () => ready(() => attention.restoreDismissed()).then(shown));
80
+ server.handle(rpc.setCodeRepo, ({ issueRepo, codeRepo }) => ready(() => attention.setCodeRepo(issueRepo, codeRepo)).then(shown));
81
+ server.handle(rpc.setupStatus, () => setupStatus(store, answers.ghStatus));
82
+ server.handle(rpc.getCoverage, () => configStatus(store));
83
+ server.handle(rpc.checkCoverage, ({ kind, name }) => checkCoverage(kind, name, answers.coverageOnGitHub));
68
84
  server.handle(rpc.setCoverage, ({ orgs, repos }) => ready(() => attention.setCoverage(orgs, repos)).then(() => ({ ok: true as const })));
69
85
  server.handle(rpc.setNextUpSources, (sources) => ready(() => attention.setNextUpSources(sources)).then(() => ({ ok: true as const })));
70
86
  server.handle(rpc.issueFields, () => ready(async () => ({ fields: await attention.issueFields() })));
71
87
  server.handle(rpc.setNextUpFields, (fields) => ready(() => attention.setNextUpFields(fields)).then(() => ({ ok: true as const })));
72
88
  server.handle(rpc.setFollowThreads, ({ on }) => ready(() => attention.setFollowThreads(on)).then(() => ({ ok: true as const })));
73
- server.handle(rpc.myOrgs, async () => ({ orgs: await myOrgs() }));
89
+ server.handle(rpc.myOrgs, async () => ({ orgs: await answers.myOrgs() }));
74
90
  server.handle(rpc.setScopes, ({ scopes }) => ready(() => attention.setScopes(scopes)).then(() => ({ ok: true as const })));
75
91
  server.handle(rpc.setSources, ({ sources }) => ready(() => attention.setSources(sources)).then(() => ({ ok: true as const })));
76
92
  server.handle(rpc.setProjectFilter, ({ projects }) => ready(() => attention.setProjectFilter(projects)).then(() => ({ ok: true as const })));
93
+ server.handle(rpc.setNewIssueChoice, ({ repo, profileId }) => ready(() => attention.setNewIssueChoice(repo, profileId)).then(() => ({ ok: true as const })));
77
94
  server.handle(rpc.projectsAccess, () => ready(() => attention.projectsAccess(true)));
78
95
  server.handle(rpc.updateBranch, ({ key, target }) => act(key, () => updateBranch(target), chip("updating")));
79
96
  server.handle(rpc.mergePullRequest, ({ key, target }) => act(key, () => mergePullRequest(target), { kind: "finished" }));
@@ -90,13 +107,13 @@ export default function contribute(server: PluginServerContext) {
90
107
  server.handle(rpc.reviewerChoices, ({ target }) =>
91
108
  ready(() => {
92
109
  const { recent, login } = attention.reviewers(target.repo);
93
- return FIXTURE ? Promise.resolve(fixtureReviewerChoices(recent)) : reviewerChoices(target, recent, login);
110
+ return answers.reviewerChoices(target, recent, login);
94
111
  }),
95
112
  );
96
113
  server.handle(rpc.react, ({ key, subjectIds, on }) => act(key, () => react(subjectIds, on), on ? chip("acknowledged", "neutral", "thumbUp") : null));
97
114
  server.handle(rpc.rerunFailed, ({ key, repo, runIds }) => act(key, () => rerunFailed(repo, runIds), chip("rerunning")));
98
- server.handle(rpc.itemDetails, ({ subject, target, checks }) => (FIXTURE ? Promise.resolve(fixtureDetails(subject, target, checks)) : itemDetails(subject, target, checks)));
99
- server.handle(rpc.defaultBranch, async ({ repo }) => ({ name: FIXTURE ? "main" : await defaultBranch(repo) }));
115
+ server.handle(rpc.itemDetails, ({ subject, target, checks }) => answers.itemDetails(subject, target, checks));
116
+ server.handle(rpc.defaultBranch, async ({ repo }) => ({ name: await answers.defaultBranch(repo) }));
100
117
  server.handle(rpc.feedbackInfo, () => feedbackInfo());
101
118
  // [UPD-01]
102
119
  server.handle(rpc.checkUpdate, () => ready(async () => {
@@ -107,7 +124,7 @@ export default function contribute(server: PluginServerContext) {
107
124
  server.handle(rpc.skipUpdate, ({ latest }) => ready(() => attention.skipUpdate(latest)).then(() => ({ ok: true as const })));
108
125
  // The server's Paseo connection expands the snapshot; the app's may not (getpaseo compact snapshots) [SES-06].
109
126
  server.handle(rpc.readyProviders, async (_input, { paseo }) => ({ providers: readyProviders((await paseo.providers.snapshot()).entries) }));
110
- server.handle(rpc.sessionContext, async ({ kind, target }) => ({ context: FIXTURE ? FIXTURE_CONTEXT : await sessionContext(kind, target) }));
127
+ server.handle(rpc.sessionContext, async ({ kind, target }) => ({ context: await answers.sessionContext(kind, target) }));
111
128
 
112
129
  return () => attention.stop();
113
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrioid/paseo-attention-span",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
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": {
@@ -21,6 +21,7 @@
21
21
  "server/",
22
22
  "shared/",
23
23
  "!**/*.test.ts",
24
+ "!shared/test-builders.ts",
24
25
  "assets/",
25
26
  "requirements.yaml",
26
27
  "docs/architecture.md",
@@ -29,6 +30,7 @@
29
30
  "docs/screenshots/desktop-dark-doing-wrap-dirty.png",
30
31
  "docs/screenshots/desktop-dark-doing-wrap-multi.png",
31
32
  "docs/screenshots/desktop-dark-doing-clear.png",
33
+ "docs/screenshots/desktop-dark-next-up-setup.png",
32
34
  "docs/screenshots/desktop-dark-doing-acknowledge.png",
33
35
  "docs/screenshots/desktop-dark-doing-issue-sheet.png",
34
36
  "docs/screenshots/desktop-dark-doing-reviewers.png",
package/requirements.yaml CHANGED
@@ -37,7 +37,7 @@ functional:
37
37
  ATT-18: see a calm, restful scene in Doing when nothing needs me and no finished work waits to be wrapped up, only once a refresh has confirmed it; so that a clear list feels like rest rather than a blank page, and calm never stands in for a check that failed or hasn't run.
38
38
  ATT-19: tell at a glance what each person shown on an item is to it: someone I'm waiting on, who opened it, or whose comments are left to address, with an icon by their picture and the meaning in words when I point at it; so that a face and a time never leave me guessing.
39
39
  ATT-20: tell which item a card is on every tab by its number first, then its repository with the repository's name standing out from its owner, which my own repositories leave out; so that cards from several repositories scan without reading each one in full.
40
- ATT-22: wrap up finished or out-of-my-hands work whose Paseo sessions are still open, archiving them safely: checking for unsaved changes first, keeping worktrees shared with anything else, and acknowledging what others did once it succeeds; so that leftover sessions get cleaned up without losing work or resurfacing old changes.
40
+ ATT-22: wrap up finished or out-of-my-hands work whose Paseo sessions are still open, archiving them, and the sub-agents they started, safely: naming unsaved changes and the open terminals archiving closes first, in a sheet shaped like Paseo's own, keeping worktrees another session lives in, leaving a row that says why a worktree stayed until it goes or is dismissed, and acknowledging what others did once it succeeds; so that leftover sessions get cleaned up without losing work or resurfacing old changes.
41
41
  mentions:
42
42
  As a developer, I can:
43
43
  MEN-01: see open threads where a person mentioned me and is still waiting for my response; so that I only hear about mentions when someone is waiting for me.
@@ -57,7 +57,7 @@ functional:
57
57
  PRS-03: see my pull requests that are ready to merge; so that finished work ships.
58
58
  PRS-04: merge a ready pull request once its checks pass against its current base; so that what merges was tested against what it merges into.
59
59
  PRS-05: see my drafts after everything that isn't a draft; so that I finish or close my drafts before picking up new work.
60
- PRS-06: see only my own drafts as work items; so that other people's unfinished work stays out of my list.
60
+ PRS-06: see other people's drafts only where they ask something of me, like a review or a mention; so that their unfinished work stays out of my list otherwise.
61
61
  PRS-07: refresh or close a draft that has gone stale; so that old drafts don't linger.
62
62
  PRS-08: have my pull requests that are assigned to someone else left out; so that pull requests I've handed over don't count as mine.
63
63
  PRS-09: rerun the failed checks of a pull request without an agent, after seeing which failed and whether they were rerun before; so that flaky checks don't cost a session.
@@ -85,7 +85,7 @@ functional:
85
85
  SES-05: start sessions in my local checkout of the item's repository without configuring paths; so that new repositories work without setup.
86
86
  SES-06: start sessions even when no agent profiles are configured; so that Attention Span works before I've set anything up.
87
87
  SES-07: start a session on an issue in the repository its code lives in, chosen right there the first time; so that issues kept in a separate repository work without editing files.
88
- SES-08: see sessions started outside Attention Span on the item of the pull request their workspace is linked to, or of the session whose worktree they share, as "Continue session", including finished work in Wrap up; so that I don't start duplicate work and can clean up what I left open.
88
+ SES-08: see sessions started outside Attention Span on the item of the pull request their workspace is linked to, or of the session whose worktree they share, or of my merged or closed pull request whose branch their worktree is on, as "Continue session", including finished work in Wrap up; so that I don't start duplicate work and can clean up what I left open.
89
89
  SES-09: tell sessions reviewing someone else's pull request from work on my own in Paseo's sidebar, by a name like "Review PR 123: title"; so that I know which kind of work a workspace holds.
90
90
  next_up:
91
91
  As a developer, I can:
@@ -101,11 +101,13 @@ functional:
101
101
  NXT-10: see on each issue its repository, its projects with their status, and its priority, effort and scope at a glance, each a pill whose icon says what it is, named in words when I point at it and in the sheet, with status and priority softly in the color GitHub has for them (none for gray, and the top two priorities warm and accent where the org colored none), and whether an open pull request already closes it and by whom; so that I can judge whether to pick it up without opening it.
102
102
  NXT-11: close an issue from Next up as completed or not planned, with an optional comment, and undo it; so that work that's done or won't be done stops being suggested.
103
103
  NXT-12: see which open GitHub projects my Next up issues are on, and where on each board, once my gh login may read projects, with Settings saying the one command that allows it until then; so that I know whether work is planned or just an idea, without Next up breaking for anyone who hasn't allowed it.
104
+ NXT-13: see a calm scene in Next up when it has nothing at all to show, pointing me to Settings, plainly when it has nowhere to look and quietly when it found nothing to pick up, the latter only once a refresh has confirmed it; so that an empty Next up says how to fill it rather than looking broken.
104
105
  waiting:
105
106
  As a developer, I can:
106
107
  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.
107
108
  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.
108
109
  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.
110
+ 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.
109
111
  history:
110
112
  As a developer, I can:
111
113
  HIS-01: see the issues and pull requests I finished, grouped by week; so that I can tell others what I got done.
@@ -115,6 +117,11 @@ functional:
115
117
  HIS-05: see who merged a PR of mine when it wasn't me, as "merged 2h ago by dave", with its copied line unchanged; so that I know when someone else shipped my work.
116
118
  HIS-06: see each week's work that left my hands under Changed by others when that is shown, out of the week's copy, even once its new owner merges it, and keep it there when the work comes back to me after I've cleared it; so that my report doesn't claim work that wasn't mine.
117
119
  HIS-07: see at the top of History, unread, when someone else merged or closed my pull request, closed an issue assigned to me, reopened a pull request I had seen closed, took over or handed on my work, or unassigned me, with a dot on the tab while any is unread and Got it or Mark all as read to clear them; so that I learn when others move my work without it changing what I have to do.
120
+ HIS-08: see a calm scene in History when I've finished nothing in its weeks and nothing is unread, only once a refresh has confirmed it; so that an empty History reads as a start rather than a blank page.
121
+ new_issues:
122
+ As a developer, I can:
123
+ ISS-01: file an issue in a repository I cover from ⌘K anywhere in Paseo or from Next up, starting from a line or two in a sheet that already has the repository, my context and the agent profile filled in, with an agent in my checkout that asks until it's clear, follows the repository's templates, picks labels and type, and posts only once I approve the draft; so that a thought becomes a well-formed issue without leaving what I'm doing.
124
+ ISS-02: see a likely duplicate before filing, and choose to file anyway, comment there or cancel; so that I don't add noise to a repository.
118
125
  feedback:
119
126
  As a developer, I can:
120
127
  FB-01: tell the Attention Span project what to improve from the bottom of any tab, picking a problem, an idea or that I like it, with an agent that asks until it's clear, checks it against what's planned and already reported, and files it as an issue or a discussion, saying which and why, only once I approve the draft; so that feedback costs a minute and lands where it can be acted on or talked through.
@@ -136,6 +143,7 @@ non_functional:
136
143
  freshness:
137
144
  FRESH-01: stays current without me refreshing it; so that its count can be trusted.
138
145
  FRESH-02: shows what I just did on GitHub right away, and keeps showing it until GitHub's search catches up; so that I never refresh to see it.
146
+ FRESH-03: brings a pull request of mine merged outside Attention Span into History and Wrap up within minutes; so that finished work gets cleaned up without me refreshing History.
139
147
 
140
148
  deferred:
141
149
  feedback:
package/server/actions.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { IssueCloseReason, Reviewer, ReviewerChoices, Target } from "../shared/attention";
2
2
  import { graphql, runGh } from "./gh";
3
+ import { sameName } from "../shared/names";
3
4
 
4
5
  // Each action runs only from an explicit tap in Attention Span [SAFE-01].
5
6
 
@@ -106,7 +107,7 @@ export async function rerunFailed(repo: string, runIds: number[]): Promise<void>
106
107
  // Who the reviewer picker suggests: GitHub's picks for the PR and the repo's teams; recent reviewers come from the last fetch [PRS-12].
107
108
  // Fetched when the picker opens, not in every refresh [GH-01]. My own repos have no teams, so they aren't asked for.
108
109
  export async function reviewerChoices(target: Target, recent: Reviewer[], login: string | null): Promise<ReviewerChoices> {
109
- const isMe = (name: string) => !!login && name.toLowerCase() === login.toLowerCase();
110
+ const isMe = (name: string) => sameName(name, login);
110
111
  const [owner] = target.repo.split("/");
111
112
  const [suggested, teams] = await Promise.all([
112
113
  graphql<{ node: { suggestedReviewers: { reviewer: { login: string; avatarUrl?: string } }[] } | null }>(