@andrioid/paseo-attention-span 0.7.2 → 0.7.4

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
@@ -1,166 +1,68 @@
1
- I made Attention Span because my attention was getting spread across too many repositories, reviews and agent sessions, and GitHub's answer to that is... more notifications.
1
+ I made Attention Span because my attention was getting spread across too many repos, reviews and agent sessions, and GitHub's answer to that is... more notifications.
2
2
 
3
- So this is the opposite: one short list of the issues and pull requests that are actually waiting on you, grouped by *why*, with a button to start a Paseo agent session when you'd like help. The Attention entry in the sidebar shows a count, so you can ignore it with confidence.
3
+ So this goes the other way. You get one short list of the issues and PRs that are actually waiting on you, grouped by *why*, and a button to start a Paseo agent session when you want help. The sidebar entry shows a count, so you can ignore it with confidence.
4
4
 
5
- There are four tabs. I think of them as a little story: what needs me now, what's out of my hands, what I'll pick up next, and what I actually got done.
5
+ There are four tabs: what needs me now, what's out of my hands, what I'll pick up next, and what I actually got done.
6
6
 
7
- ## Doing: what needs you now
7
+ ## Doing
8
8
 
9
- This is the one you'll live in. At the top is **Wrap up**: finished or handed-off work whose Paseo sessions are still open, waiting for you to put them away. Below that it's split by reason: someone's waiting for your reply, someone answered your question, a review's been requested, CI's failing, changes were requested, it's ready to merge, it needs upstream, nobody's been asked to review it yet, or it's one of your drafts. Only things you can act on, though. Nudging people lives in Waiting.
9
+ This is the tab you'll live in. Items are grouped by reason: someone's waiting for your reply, a review was requested, CI is failing, it's ready to merge, and so on. Each item shows up once, under its most urgent reason. An issue and the PRs that close it count as one item, and so does a stack of PRs.
10
10
 
11
- Wrap up is the cleanup pass. A PR that merged, an issue that closed, work that left your hands, a review you finished on someone else's PR: if one of your sessions is still open on it, it sits here once the agent is idle, newest finish first. **Archive session** puts the session, the sub-agents it started and its worktree away. If anything is uncommitted or unpushed, or the worktree has terminals open, you get a sheet first, shaped like Paseo's own: "Uncommitted changes: 2 files (+12 −3)", "1 unpushed commit", the terminals it closes, with **Open session** beside **Archive**; several sessions get a list of their own. **Archive all clean** does the tidy ones in one go. A worktree another session still lives in stays, and so does its row, saying which session kept it, until the worktree goes or you dismiss it; a local checkout is never archived; and there's no Undo, which is exactly why it checks first. Archived work goes to History as already read, not as a new note.
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
- Sometimes all the PRs under an issue merge and the issue stays open anyway: they went into a feature branch, or the description only mentioned it. Wrap up asks about those too, session or not: "Close #12? #34 and #35 merged 2h ago". **Close #12** closes it as completed, with Undo. The × keeps it open until another PR of yours merges under it, which covers "first of three" plans. While it's asking, the issue stays in Next up with a "PRs merged" pill. A session open on that work joins the question's row, and becomes an ordinary Archive session row once you've answered.
13
+ ![Doing](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.4/docs/screenshots/desktop-dark-doing.png)
14
14
 
15
- ![Doing](docs/screenshots/desktop-dark-doing.png)
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
- Each item shows up once, under whichever reason is most urgent. An issue and the PRs that close it count as one item, and so does a stack of PRs. A stack is one change wearing several PRs, so it shouldn't take up five rows.
17
+ ![An item's actions](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.4/docs/screenshots/desktop-dark-doing-sheet.png)
18
18
 
19
- When there's nothing in it, you get a quiet horizon that follows the time of day instead of a blank page. It only shows up once a refresh has actually checked, so it never says you're clear when it doesn't know.
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
- ![Doing, with nothing in it](docs/screenshots/desktop-dark-doing-clear.png)
21
+ ## Waiting
22
22
 
23
- The other tabs get their own version when they're empty: a bench in History, an empty jetty in Waiting, a blank signpost in Next up. An empty Next up also points you to Settings, since it usually means it doesn't know where to look yet.
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.
24
24
 
25
- ![Next up, with nowhere to look](docs/screenshots/desktop-dark-next-up-setup.png)
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
- Mentions only count while the person is still waiting for you. Reply or react and it's gone. On your own issues and PRs, a new comment from the last 30 days shows up under **Answered** even if it doesn't tag you. On other people's threads only tags count. The point is to pick out the signal, and most of what happens in threads you once commented on isn't. If you do want those replies, turn on **Follow threads I've commented on** in Settings. Team mentions are left out entirely, because "@everyone-in-backend" is not really a question for *me*. And if something's just an FYI, dismiss it. It stays gone until something new happens on it.
27
+ ![Waiting](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.4/docs/screenshots/desktop-dark-waiting.png)
28
28
 
29
- Sometimes other people move your work without asking: they merge your PR, close it, close an issue assigned to you, reopen a PR you'd seen closed, take work over, or unassign you. None of that is something to do, so it doesn't count, but it shouldn't happen behind your back either. Each one waits at the top of **History**, like "merged by dave 2h ago" or "phil took over", and the tab gets a little green dot until you tap its check, or **Mark all as read** to clear them all. If the work is already in Wrap up, archiving the session acknowledges it instead.
29
+ ## Next up
30
30
 
31
- Every item has one main button that matches why it's there: Reply, Review, Fix CI, Merge. Open the item and you get 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.
31
+ For when your plate is clear. It does happen. Issues assigned to you come first, then unclaimed ones from the repos you point it at. If your org uses issue fields for priority and effort, it ranks by those. It also shows whether someone already has a PR open, which has saved me from redoing a colleague's work more than once.
32
32
 
33
- ![An item's actions](docs/screenshots/desktop-dark-doing-sheet.png)
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
- Some actions start an agent session:
35
+ ![Next up](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.4/docs/screenshots/desktop-dark-next-up.png)
36
36
 
37
- - **Review** reviews a PR and tells you what it thinks. It doesn't post anything. You're still the one with opinions in public.
38
- - **Fix CI** and **Address comments** commit fixes but don't push.
39
- - **Rebase** rebases a PR or a whole stack, and pushes only if there were no conflicts.
40
- - **Refresh draft** rebases a stale draft and tells you what it still needs. Every draft I've abandoned thanks it.
37
+ ## History
41
38
 
42
- The rest change GitHub right away: rerun failed jobs, update a branch, mark a draft ready, request a review, turn on auto-merge, merge, close a draft. Merge and close ask first. **Acknowledge** reacts 👍 to the comments waiting on you, but only after showing you them in full. Thumbs-upping things you haven't read is a hobby, not a workflow.
39
+ What you finished in recent weeks, grouped by week. There's a copy button per week for a Markdown list, tagged 🐞 bug, 🚀 feature or 🔧 task. That's my standup prep now. It takes about four seconds.
43
40
 
44
- ![Acknowledge](docs/screenshots/desktop-dark-doing-acknowledge.png)
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.
45
42
 
46
- A PR you opened isn't waiting on anyone until you've asked someone to review it, so it stays here under **Needs a reviewer**. **Request review** offers GitHub's suggestions, whoever reviewed your other PRs in that repo, and its teams, or you can type a name. Marking a draft ready asks the same question. If nobody reviews in that repo, **Merge** is right there once CI is green.
47
-
48
- ![Request review](docs/screenshots/desktop-dark-doing-reviewers.png)
49
-
50
- ## Waiting: out of your hands
51
-
52
- This is your work where someone else has the next move: the review you asked for, the reviewer looking again, CI running, or a question you asked that nobody's answered yet. Only questions count: a comment that just tells people something, even one that tags them, isn't waiting on anyone.
53
-
54
- It's grouped by who you're waiting on, whoever blocks the most first, and each item says why and for how long. Work with a session that's running or needs you leads its group. Who counts only when it's on record: the reviewers you asked, the reviewer who asked for changes, or the people you tagged in your question. Work that waits on nobody in particular, like CI or a repo rule, sits at the bottom rather than under a guess.
55
-
56
- Your PRs in Doing show up here too while someone you asked still hasn't reviewed them, even once they're approved. Merging is your call, but you might still want to nudge the person you asked.
57
-
58
- After three days an item's age turns amber, with a little ⌛. Usually that means someone forgot, and sometimes the someone is me. It only does that when a nudge would be fair, so not while CI is failing or still running, or while there are conflicts, changes to make or a reply you owe. Point at it to see why.
59
-
60
- ![Waited too long](docs/screenshots/desktop-dark-waiting-too-long.png)
61
-
62
- When someone needs a nudge, **Copy list** next to their name copies their items oldest first, one line each like "Review 2h: [title](link)", ready to paste into a message. Otherwise there's nothing to do here. That's the point. It's tracked, so you can stop holding it in your head.
63
-
64
- ![Waiting](docs/screenshots/desktop-dark-waiting.png)
65
-
66
- ## Next up: for when your plate is clear
67
-
68
- It does happen. Next up lists issues assigned to you first, because finishing what you've taken seems polite, and then open issues nobody's claimed. If your org uses issue fields for priority and effort, it ranks by those, so the important quick wins float to the top. Fields called Priority, Effort and Scope are picked up on their own; if yours are called something else, pick them in Settings. Each issue shows its repo, priority, effort and scope, and whether someone already has a PR open for it. That last one has saved me from duplicating a colleague's work more than once. Each fact sits in a small pill with an icon, so "Medium" never leaves you guessing whether it's priority or effort, and priority wears the color your org gave it.
69
-
70
- If your issues live on GitHub project boards, Next up shows which board and column each one is in, and the filter lets you pick boards and their columns: only TODO's Todo, say, and leave Ideas out. That needs one more permission than `gh` asks for by default; Settings tells you the command (`gh auth refresh -s read:project`) and until then everything else works as before.
71
-
72
- ![Next up](docs/screenshots/desktop-dark-next-up.png)
73
-
74
- Unclaimed issues come from wherever you point it: your own repos, your orgs, or single repos. Point it nowhere and it falls back to your Paseo projects' repos, so it never fills up with strangers' issues. You can filter by source or scope, and it remembers.
75
-
76
- ![Next up filtered by scope](docs/screenshots/phone-light-next-up-filtered.png)
77
-
78
- **Claim & start** (or just **Start**, if it's already yours) starts an agent that reads the issue and proposes a plan. You can also claim or give back an issue without starting anything, or close one as done or not planned, so the stuff that's never going to happen stops getting suggested to you.
79
-
80
- Thought of something that needs doing? **New issue** in Next up, or **New issue…** in Paseo's Command Center (⌘K) from anywhere, takes a line or two. An agent in your checkout then asks what it still needs, looks for duplicates, follows the repo's issue templates and labels, and shows you the whole issue before anything goes to GitHub. From inside a session, **New issue from this session…** brings along what that session was just talking about, so "file what we just found" works. Once it's posted, the agent puts itself away.
81
-
82
- Some orgs keep issues in a separate repo from the code. When that happens, the first Start asks where the code lives and remembers the answer.
83
-
84
- ![Where the code lives](docs/screenshots/desktop-dark-next-up-code-repo.png)
85
-
86
- ## History: what you got done
87
-
88
- The issues and PRs you finished in recent weeks, grouped by week, with what others did at the top until you've seen it. Reviews are work too, even if nobody counts them, so **Filter** can show them under each week, along with the changes by others you've cleared. Finished work is always there; the other two are off until you ask, and the button remembers.
89
-
90
- There's a copy button per week that gives you Markdown lists of what's shown, each line led by what kind of work it was: 🐞 bug, 🚀 feature, 🔧 task, or 🔀 for a PR that's none of those. The kind comes from the issue type, else the labels, else a title like "fix: …", so it works whether or not your repos use issue types. Cards show it too. Issues closed as not planned stay out of the list. A PR someone else merged says who, and so does an issue someone else closed. Work that left your hands (a PR someone closed or took over, an issue you were taken off) sits under **Changed by others** when that's shown, out of the list, even if its new owner merges it later. Changes by others are never copied. That's my standup prep now, and it takes about four seconds.
91
-
92
- ![History](docs/screenshots/desktop-dark-history.png)
93
-
94
- ![History filtered to Reviewed and changes](docs/screenshots/desktop-dark-history-filtered.png)
95
-
96
- ![Both lists under a week](docs/screenshots/desktop-dark-history-groups.png)
43
+ ![History](https://cdn.jsdelivr.net/npm/@andrioid/paseo-attention-span@0.7.4/docs/screenshots/desktop-dark-history.png)
97
44
 
98
45
  ## Agent sessions
99
46
 
100
- Actions with an agent icon start a session; the rest change GitHub right away. Where GitHub allows it, an Undo shows up afterwards, because I mis-tap more than I'd like to admit.
101
-
102
- Sessions run in a worktree of the registered project, or pick up the existing workspace for that branch. They start with the item's context already in the prompt: failing checks, unresolved comments, the issue's discussion. Once an item has a session, its main button opens that session instead of starting another. Open the item and each session sits where the action that started it was, with its state: working, idle, or needs you. Starting another one is there too, on purpose and out of the way.
103
-
104
- ![An item's sessions](docs/screenshots/desktop-dark-doing-issue-sheet.png)
105
-
106
- ## However you use GitHub
107
-
108
- I've tried not to bake in one way of working. It needs no configuration to start with, and so far it copes with:
109
-
110
- - **Working alone:** with nothing configured, it covers everything on GitHub that involves you, and Next up looks at your Paseo projects' repos.
111
- - **A team that reviews everything:** review requests, changes requested, waiting on reviewers and ready to merge each get their own spot.
112
- - **Stacked PRs:** a stack is one item and rebases as one.
113
- - **Issues first:** an issue and the PRs that close it are one item, and your org's issue fields rank Next up.
114
- - **Issues kept apart from the code:** Start asks once where the code lives.
115
- - **Open source:** mentions clear when you reply or react, and work waiting on maintainers sits in Waiting until it's waited too long.
47
+ Review reviews and reports back. It doesn't post anything, so you're still the one with opinions in public. Fix CI and Address comments commit but don't push. Rebase and Refresh draft push only if the rebase had no conflicts. Everything else (merge, rerun jobs, request review) changes GitHub right away, so merge and close ask first, and most actions offer an Undo. I mis-tap more than I'd like to admit.
116
48
 
117
- If your setup breaks it, I'd honestly like to hear about it.
118
-
119
- ## Turning off GitHub notifications
120
-
121
- Attention Span doesn't read your notifications at all. It searches GitHub for what needs you. So if notifications bury you, you can turn them off and not miss anything it would have shown you. They're at [github.com/settings/notifications](https://github.com/settings/notifications):
122
-
123
- - Turn off **Automatically watch repositories** and **Automatically watch teams**, so you don't get subscribed to every new repo you're given access to.
124
- - Under **Watching** and **Participating, @mentions and custom**, clear On GitHub, Email and CLI.
125
- - Under System, clear **Actions**, or keep only failed workflows if you can't quite let go.
126
- - Unwatch the repos you already watch at [github.com/watching](https://github.com/watching). There are probably more than you'd guess.
127
- - On your phone, turn off push in GitHub Mobile's settings.
128
-
129
- GitHub moves these settings around now and then. Their [notification docs](https://docs.github.com/en/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications) should be current.
49
+ Sessions start in a worktree with the item's context already in the prompt. Once an item has a session, its button opens that session instead of starting another.
130
50
 
131
51
  ## Setup
132
52
 
133
- What it needs:
134
-
135
- - The GitHub CLI, `gh`, installed and signed in on the machine that runs the Paseo daemon. The plugin uses that sign-in and doesn't keep a token of its own.
136
- - Your repos registered as Paseo projects, with their GitHub remote, so it can start sessions in them. Items from other repos still show up, and you can open them on GitHub.
137
- - Paseo 0.13.0 or later. I've only tested it on Linux, so other platforms are a pleasant surprise or a bug report.
53
+ - `gh` installed and signed in on the machine running the Paseo daemon. The plugin borrows that sign-in and keeps no token of its own.
54
+ - Your repos registered as Paseo projects with their GitHub remote, so it can start sessions in them. Items from other repos still show up; you just open them on GitHub.
55
+ - Paseo 0.13.0 or later. I've only tested it on Linux, so other platforms are either a pleasant surprise or a bug report.
138
56
 
139
- If `gh` is missing or signed out, or `config.json` won't parse, you get a setup checklist instead of the lists. It says what's missing, how to fix it, and has a button to check again. It also tells you what the plugin covers, how many of your projects it can start sessions in, and which agent the sessions will use.
57
+ If `gh` is missing or signed out, or `config.json` won't parse, you get a checklist instead of the lists. You don't need to configure anything to start. The gear on the screen covers orgs, repos and where Next up looks. The rest (agent profiles, prompts, merge methods) lives in `~/.config/paseo-attention-span/config.json`, in JSON. Sorry.
140
58
 
141
- ![Setup](docs/screenshots/desktop-dark-setup.png)
142
-
143
- To narrow things down, pick organizations and repos with the gear on the screen, or under Settings, Plugins, Attention Span. Each one is checked on GitHub as you add it, so typos show up straight away. Next up's unclaimed issues use these too, instead of your projects, unless you give Next up its own sources.
144
-
145
- ![Settings](docs/screenshots/desktop-dark-settings.png)
146
-
147
- Everything else lives in `~/.config/paseo-attention-span/config.json` on the daemon host. The settings screen writes there too.
148
-
149
- - `profiles`: which Paseo agent profile each kind of session uses. Reviews use `review` and everything else uses `default`. A missing profile falls back to Paseo's defaults.
150
- - `prompts`: your own prompt template per session type, if you don't like mine.
151
- - `mergeMethods`: squash, merge or rebase, per repo.
152
- - `codeRepos`: where an issue repo's code lives. The screen asks and fills this in, so you probably won't touch it.
153
- - `nextUp`: where Next up picks from and which org issue fields mean priority, effort and scope, both also in Settings. A field's `order` (best first) is the one thing here only the file sets, for when the org's own option order isn't the ranking you want.
154
- - `refreshMinutes` (15), `waitingTooLongDays` (3), `staleDraftDays` (30), `mentionDays` (30) and `historyWeeks` (4).
59
+ It doesn't read your GitHub notifications. It searches GitHub for what needs you, so you can [turn notifications off](https://github.com/settings/notifications) without missing anything it would have shown you. I did, and it's been nice.
155
60
 
156
61
  ## Your data
157
62
 
158
- - **GitHub:** it reads your PRs, review requests, mentions and issues through `gh`, limited to the orgs and repos you've configured. By default it refreshes every 15 minutes, which uses about 7% of GitHub's hourly API allowance. I checked.
159
- - **Local files:** a cache of what it shows, your dismissals and your Next up filter live in `~/.config/paseo-attention-span/state.json` on the daemon host. That's it.
160
- - **Paseo:** about twice a day it asks Paseo whether a newer version of Attention Span is out, the same check `paseo plugin update --check` makes. Paseo looks it up in its plugin registry, on npm or on GitHub, depending on how you installed it. If there is one, the screen says so, with a link to what changed. Update installs it and restarts Attention Span. Nothing updates until you tap it.
161
- - **Agent providers:** when a session starts, the item's context goes into the agent's prompt: descriptions, comments, review threads, failing CI logs. That prompt goes to whichever provider your agent profile uses, so it's worth knowing which one that is.
162
-
163
- ## What it doesn't do (yet)
63
+ - **GitHub:** it reads through `gh`, limited to what you've configured. The default 15-minute refresh uses about 7% of the hourly API allowance. I checked.
64
+ - **Local:** a cache and your dismissals live in `~/.config/paseo-attention-span/state.json`. That's it.
65
+ - **Updates:** about twice a day it asks Paseo whether there's a newer version. Nothing installs until you tap Update.
66
+ - **Agent providers:** a session's prompt carries the item's context (comments, review threads, CI logs) to whichever provider your agent profile uses.
164
67
 
165
- - github.com only. No other forges and no GitHub Enterprise, for now.
166
- - Apart from orgs, repos and Next up, settings are edited by hand. Yes, in JSON. Sorry.
68
+ It's github.com only for now. If your setup breaks it, I'd honestly like to hear about it.
@@ -214,6 +214,7 @@ function AttentionList({
214
214
  busy={act.busy}
215
215
  login={view.login}
216
216
  fixture={!!view.fixtureAgents}
217
+ agents={agentsNow}
217
218
  fetchDetails={act.fetchDetails}
218
219
  openAgent={act.openAgent}
219
220
  {...act.askActions}
package/client/card.tsx CHANGED
@@ -1,9 +1,9 @@
1
1
  import { TextInput } from "@getpaseo/plugin/client/ui";
2
2
  import { type ReactNode, useState } from "react";
3
3
  import { ActivityIndicator, Pressable, Text, View } from "react-native";
4
- import type { Chip } from "../shared/attention";
4
+ import type { Chip, GithubColor } from "../shared/attention";
5
5
  import type { IconName } from "./icons";
6
- import { type Place, PlaceText } from "./entity";
6
+ import { githubColor, type Place, PlaceText } from "./entity";
7
7
  import { Button, HintArea, Meta, TablerIcon, toneColor, useStyles } from "./ui";
8
8
 
9
9
  // Every card in every list has this anatomy; tabs fill it in with data and slots, not layout [ATT-05].
@@ -14,7 +14,7 @@ import { Button, HintArea, Meta, TablerIcon, toneColor, useStyles } from "./ui";
14
14
  // [actions] ← phone, labelled
15
15
  // confirm bar
16
16
  //
17
- // Colors come only from tones, so a card can't pick a theme color that some themes render plain.
17
+ // Tones follow the theme; merged PRs use GitHub's theme-aware purple.
18
18
 
19
19
  export type Tone = Chip["tone"];
20
20
 
@@ -37,7 +37,7 @@ export interface ConfirmSpec {
37
37
  }
38
38
 
39
39
  export interface CardProps {
40
- mark: { icon: IconName; tone: Tone };
40
+ mark: { icon: IconName; tone: Tone; color?: GithubColor };
41
41
  title: string;
42
42
  // "#number · repo", then when it happened, then signals [ATT-05, ATT-20].
43
43
  meta: { place: Place; when?: string; signals: Chip[] };
@@ -117,9 +117,9 @@ export function CardRow({ first, mark, title, meta, accessibilityLabel, onOpen,
117
117
  }
118
118
 
119
119
  // What the card is, as an icon on a softly tinted square.
120
- export function Mark({ icon, tone }: { icon: IconName; tone: Tone }) {
120
+ export function Mark({ icon, tone, color: github }: CardProps["mark"]) {
121
121
  const styles = useStyles();
122
- const color = toneColor(styles, tone);
122
+ const color = githubColor(styles, github) ?? toneColor(styles, tone);
123
123
  return (
124
124
  <View style={{ width: 30, height: 30, borderRadius: 8, alignItems: "center", justifyContent: "center" }}>
125
125
  <View style={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0, borderRadius: 8, backgroundColor: color, opacity: 0.16 }} />
@@ -344,6 +344,10 @@ export function useItemActions(attention: ReturnType<typeof useAttention>, navig
344
344
 
345
345
  // Wrap up's "Close #12?": closes as completed, or keeps it open until another PR merges under it; each with Undo [ATT-24].
346
346
  const askActions = {
347
+ onStartSession: (item: WrapItem) => {
348
+ const target: Target = { kind: "issue", repo: item.repo, number: item.number, title: item.title, url: item.url };
349
+ setOptions({ itemKey: item.wrap.itemKey, title: `Start session: ${item.title}`, kind: "start", target });
350
+ },
347
351
  onCloseIssue: (item: WrapItem) => {
348
352
  const key = item.wrap.itemKey;
349
353
  const target: Target = { kind: "issue", repo: item.repo, number: item.number, title: item.title, url: item.url };
@@ -169,7 +169,7 @@ function ItemRow({ item, first, actions, group }: { item: Item; first: boolean;
169
169
  {item.person ? <PersonQuote person={item.person} expanded={false} /> : null}
170
170
  {waitingOn}
171
171
  {alsoOn}
172
- {children.length > 0 ? <StackLine rows={children} merged={!!item.closedAt} target={targetRow?.key} /> : null}
172
+ {children.length > 0 ? <StackLine rows={children} target={targetRow?.key} /> : null}
173
173
  </>
174
174
  ) : null
175
175
  }
@@ -247,7 +247,7 @@ function ItemSheet({ item, waitChips, sessions, actions, ...handlers }: { item:
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
249
  {item.waitingOn ? <WaitingOnLine people={item.waitingOn} asked={item.wait?.reason === "question"} expanded /> : null}
250
- {item.children.length > 0 ? <StackLine rows={item.children} merged={!!item.closedAt} links target={targetRow?.key} /> : null}
250
+ {item.children.length > 0 ? <StackLine rows={item.children} links target={targetRow?.key} /> : null}
251
251
  </>
252
252
  }
253
253
  entries={sheetEntries(item, sessions, actions, handlers, { data: details.data, isLoading: details.isLoading, arrived })}
package/client/mark.ts CHANGED
@@ -1,19 +1,35 @@
1
- import type { Item } from "../shared/attention";
1
+ import type { Item, PrState, SubRow } from "../shared/attention";
2
2
  import type { CardProps } from "./card";
3
3
 
4
+ // A PR's own state, shared by card marks and linked stack rows [ATT-05, ATT-06].
5
+ const PR_MARKS: Record<PrState, CardProps["mark"]> = {
6
+ OPEN: { icon: "pr", tone: "good" },
7
+ DRAFT: { icon: "draft", tone: "neutral" },
8
+ CLOSED: { icon: "prClosed", tone: "bad" },
9
+ MERGED: { icon: "merge", tone: "good", color: "PURPLE" },
10
+ };
11
+
12
+ export const prStateMark = (state: PrState) => PR_MARKS[state];
13
+
14
+ // A parent issue's closure says nothing about the state of its individual PRs.
15
+ export function stackMark(row: Pick<SubRow, "state" | "draft" | "mergedAt">): CardProps["mark"] {
16
+ return prStateMark(row.state ?? (row.mergedAt ? "MERGED" : row.draft ? "DRAFT" : "OPEN"));
17
+ }
18
+
4
19
  // What the card is: open, draft, merged or closed. Urgency stays in the chips and section headers.
5
20
  // A note on what someone else did shows what happened instead; its words say it too, so color isn't the only sign [HIS-07].
6
21
  export function stateMark(item: Item): CardProps["mark"] {
7
22
  if (item.section === "reviewed" || item.wrap?.review) return { icon: "review", tone: "neutral" };
8
23
  if (item.change) {
9
24
  const kind = item.change.kind;
10
- if (kind === "merged") return { icon: "merge", tone: "good" };
11
- if (kind === "closed") return { icon: "prClosed", tone: "bad" };
25
+ if (kind === "merged") return prStateMark("MERGED");
26
+ if (kind === "closed") return prStateMark("CLOSED");
12
27
  if (kind === "issue_closed") return item.change.reason === "not_planned" ? { icon: "close", tone: "bad" } : { icon: "issueClosed", tone: "good" };
13
28
  if (kind === "reopened") return { icon: "pr", tone: "warn" };
14
29
  return { icon: kind === "unassigned" ? "userMinus" : "userShare", tone: "warn" };
15
30
  }
16
- if (item.closedAt) return item.kind === "pr" ? { icon: "merge", tone: "good" } : { icon: "issueClosed", tone: item.chips.length ? "neutral" : "good" };
31
+ if (item.kind === "pr" && item.closedUnmerged) return prStateMark("CLOSED");
32
+ if (item.closedAt) return item.kind === "pr" ? prStateMark("MERGED") : { icon: "issueClosed", tone: item.chips.length ? "neutral" : "good" };
17
33
  if (item.kind === "issue") return { icon: "issue", tone: "good" };
18
- return item.draft ? { icon: "draft", tone: "neutral" } : { icon: "pr", tone: "good" };
34
+ return prStateMark(item.draft ? "DRAFT" : "OPEN");
19
35
  }
package/client/stack.tsx CHANGED
@@ -2,38 +2,43 @@ import { openExternalUrl } from "@getpaseo/plugin/client";
2
2
  import type { ReactNode } from "react";
3
3
  import { Pressable, Text, View } from "react-native";
4
4
  import type { SubRow } from "../shared/attention";
5
- import { NumberText } from "./entity";
6
- import { Meta, TablerIcon, tint, useHover, useStyles } from "./ui";
5
+ import { stackMark } from "./mark";
6
+ import { githubColor, NumberText } from "./entity";
7
+ import { Meta, TablerIcon, tint, toneColor, useHover, useStyles } from "./ui";
7
8
 
8
9
  // Stacked or linked PRs as a connected line; collapsed, only those needing attention [ATT-03, ATT-04].
9
10
  // In the sheet each row opens its PR on GitHub [ATT-12], and the PR an issue's actions apply to is tinted and says so [ATT-06].
10
- export function StackLine({ rows, merged, links = false, target }: { rows: SubRow[]; merged: boolean; links?: boolean; target?: string }) {
11
+ export function StackLine({ rows, links = false, target }: { rows: SubRow[]; links?: boolean; target?: string }) {
11
12
  const styles = useStyles();
12
13
  return (
13
14
  <View>
14
- {rows.map((row, index) => (
15
- <StackRow key={row.key} url={row.url} number={row.number} link={links} target={row.key === target}>
16
- <View style={{ width: 16, alignItems: "center" }}>
17
- <View style={{ width: 2, flex: 1, backgroundColor: index === 0 ? "transparent" : styles.c.border }} />
18
- <TablerIcon name={merged ? "merge" : row.draft ? "draft" : "pr"} size={14} color={merged ? styles.c.statusSuccess : row.draft ? styles.c.foregroundMuted : styles.c.statusSuccess} />
19
- <View style={{ width: 2, flex: 1, backgroundColor: index === rows.length - 1 ? "transparent" : styles.c.border }} />
20
- </View>
21
- <View style={{ flex: 1, paddingVertical: 3, gap: 2 }}>
22
- <Text style={{ color: styles.c.foreground, fontSize: 13 }} numberOfLines={1}>
23
- {row.title}
24
- </Text>
25
- <View style={[styles.wrap, { columnGap: 10, rowGap: 2 }]}>
26
- <Meta lead={<NumberText number={row.number} />} facts={merged && row.mergedBy ? [`merged by ${row.mergedBy}`] : []} chips={row.chips} />
27
- {row.key === target ? <Text style={{ color: styles.action, fontSize: 12, fontWeight: "600" }}>actions apply here</Text> : null}
15
+ {rows.map((row, index) => {
16
+ const mark = stackMark(row);
17
+ const merged = mark.icon === "merge";
18
+ return (
19
+ <StackRow key={row.key} url={row.url} number={row.number} link={links} target={row.key === target}>
20
+ <View style={{ width: 16, alignItems: "center" }}>
21
+ <View style={{ width: 2, flex: 1, backgroundColor: index === 0 ? "transparent" : styles.c.border }} />
22
+ <TablerIcon name={mark.icon} size={14} color={githubColor(styles, mark.color) ?? toneColor(styles, mark.tone)} />
23
+ <View style={{ width: 2, flex: 1, backgroundColor: index === rows.length - 1 ? "transparent" : styles.c.border }} />
28
24
  </View>
29
- </View>
30
- {links ? (
31
- <View style={{ justifyContent: "center", paddingHorizontal: 4 }}>
32
- <TablerIcon name="github" size={14} color={styles.c.foregroundMuted} />
25
+ <View style={{ flex: 1, paddingVertical: 3, gap: 2 }}>
26
+ <Text style={{ color: styles.c.foreground, fontSize: 13 }} numberOfLines={1}>
27
+ {row.title}
28
+ </Text>
29
+ <View style={[styles.wrap, { columnGap: 10, rowGap: 2 }]}>
30
+ <Meta lead={<NumberText number={row.number} />} facts={merged && row.mergedBy ? [`merged by ${row.mergedBy}`] : []} chips={row.chips} />
31
+ {row.key === target ? <Text style={{ color: styles.action, fontSize: 12, fontWeight: "600" }}>actions apply here</Text> : null}
32
+ </View>
33
33
  </View>
34
- ) : null}
35
- </StackRow>
36
- ))}
34
+ {links ? (
35
+ <View style={{ justifyContent: "center", paddingHorizontal: 4 }}>
36
+ <TablerIcon name="github" size={14} color={styles.c.foregroundMuted} />
37
+ </View>
38
+ ) : null}
39
+ </StackRow>
40
+ );
41
+ })}
37
42
  </View>
38
43
  );
39
44
  }
@@ -2,7 +2,7 @@ import { useState } from "react";
2
2
  import { useQuery } from "@tanstack/react-query";
3
3
  import { openExternalUrl } from "@getpaseo/plugin/client";
4
4
  import { Text, View } from "react-native";
5
- import type { AgentSummary, WrapItem } from "../shared/attention";
5
+ import { type AgentSummary, isIdle, matchSessions, type WrapItem } from "../shared/attention";
6
6
  import { type ArchiveOutcome, type KeptRow, keptText, sheetLines, type UnsavedSession, unsavedWords } from "../shared/archive";
7
7
  import { allWrapBusy, wrapBusy } from "../shared/got-it";
8
8
  import { cleanSingle, sessionCleanliness, sessionUnsaved } from "../shared/wrap-up";
@@ -11,7 +11,7 @@ import { stateMark } from "./mark";
11
11
  import { type FetchDetails, itemDetailsQuery } from "./item-actions";
12
12
  import { PlaceText } from "./entity";
13
13
  import { StackLine } from "./stack";
14
- import { sessionEntry } from "./session-menu";
14
+ import { sessionEntry, startAnotherEntry } from "./session-menu";
15
15
  import { ActionSheet, DETAILS_STALE_MS, DetailLines, Dialog, githubEntry, type SheetEntry, usePrefetchOnRest } from "./sheet";
16
16
  import { Button, Meta, SectionHeader, useStyles } from "./ui";
17
17
 
@@ -21,6 +21,7 @@ import { Button, Meta, SectionHeader, useStyles } from "./ui";
21
21
 
22
22
  interface RowProps {
23
23
  busy: ReadonlySet<string>;
24
+ agents: AgentSummary[];
24
25
  login: string | null;
25
26
  // Previews have made-up sessions: their snapshot is the answer, as there's no daemon to ask.
26
27
  fixture: boolean;
@@ -40,6 +41,8 @@ interface AskProps {
40
41
  // Close as completed, with Undo, or Keep open until another PR merges under it [ATT-24].
41
42
  onCloseIssue: (item: WrapItem) => void;
42
43
  onKeepOpen: (item: WrapItem) => void;
44
+ // The same session-options flow as the other item sheets [SES-02, SES-03].
45
+ onStartSession: (item: WrapItem) => void;
43
46
  }
44
47
 
45
48
  export function WrapUp({
@@ -50,6 +53,7 @@ export function WrapUp({
50
53
  onDismissKept,
51
54
  onCloseIssue,
52
55
  onKeepOpen,
56
+ onStartSession,
53
57
  ...row
54
58
  }: { items: WrapItem[]; onArchiveAll: () => Promise<void> } & RowProps & KeptProps & AskProps) {
55
59
  const styles = useStyles();
@@ -77,7 +81,7 @@ export function WrapUp({
77
81
  <CardList>
78
82
  {items.map((item, index) =>
79
83
  item.wrap.ask ? (
80
- <AskRow key={item.key} item={item} first={index === 0} busy={row.busy} login={row.login} openSession={row.openAgent} fetchDetails={row.fetchDetails} onCloseIssue={onCloseIssue} onKeepOpen={onKeepOpen} />
84
+ <AskRow key={item.key} item={item} sessions={matchSessions(row.agents, item.wrap.keys)} first={index === 0} busy={row.busy} login={row.login} openSession={row.openAgent} fetchDetails={row.fetchDetails} onCloseIssue={onCloseIssue} onKeepOpen={onKeepOpen} onStartSession={onStartSession} />
81
85
  ) : (
82
86
  <WrapRow key={item.key} item={item} first={index === 0} {...row} />
83
87
  ),
@@ -99,10 +103,11 @@ export function WrapUp({
99
103
  );
100
104
  }
101
105
 
102
- // An open issue whose PRs of mine all merged: "Close #12? #34 and #35 merged 2h ago", Close #12, or × to keep it open until
103
- // another merges. A session open on the work waits for the usual row, which closing leaves behind [ATT-24].
106
+ // An open issue whose PRs of mine all merged: Close #12, or Keep open in its sheet until another merges.
107
+ // A session open on the work waits for the usual row, which closing leaves behind [ATT-24].
104
108
  function AskRow({
105
109
  item,
110
+ sessions,
106
111
  first,
107
112
  busy,
108
113
  login,
@@ -110,13 +115,13 @@ function AskRow({
110
115
  fetchDetails,
111
116
  onCloseIssue,
112
117
  onKeepOpen,
113
- }: { item: WrapItem; first: boolean; busy: ReadonlySet<string>; login: string | null; openSession: (agentId: string) => void; fetchDetails: FetchDetails } & AskProps) {
118
+ onStartSession,
119
+ }: { item: WrapItem; sessions: AgentSummary[]; first: boolean; busy: ReadonlySet<string>; login: string | null; openSession: (agentId: string) => void; fetchDetails: FetchDetails } & AskProps) {
114
120
  const [sheet, setSheet] = useState(false);
115
121
  const open = () => setSheet(true);
116
122
  const prefetch = usePrefetchOnRest(itemDetailsQuery(item, fetchDetails));
117
123
  const close = () => setSheet(false);
118
124
  const blocked = wrapBusy(busy, item.key);
119
- const { sessions } = item.wrap;
120
125
  const still = sessions.length > 1 ? ` · ${sessions.length} sessions still open` : sessions.length ? " · your session's still open" : "";
121
126
  return (
122
127
  <CardRow
@@ -128,18 +133,17 @@ function AskRow({
128
133
  hover={prefetch}
129
134
  busy={blocked}
130
135
  primary={{ label: `Close #${item.number}`, accessibilityLabel: `Close #${item.number} as completed`, icon: "issueClosed", onPress: () => onCloseIssue(item) }}
131
- secondary={[
132
- { label: `Details for #${item.number}`, icon: "chevronRight", onPress: open },
133
- { label: "Keep open", icon: "close", accessibilityLabel: `Keep #${item.number} open`, onPress: () => onKeepOpen(item) },
134
- ]}
136
+ secondary={[{ label: `Details for #${item.number}`, icon: "chevronRight", onPress: open }]}
135
137
  overlay={
136
138
  sheet ? (
137
139
  <WrapItemSheet
138
140
  item={item}
141
+ sessions={sessions}
139
142
  fetchDetails={fetchDetails}
140
143
  openSession={openSession}
141
144
  onClose={close}
142
145
  entries={[
146
+ { ...startAnotherEntry(sessions.length > 0, () => { close(); onStartSession(item); }), disabled: blocked },
143
147
  {
144
148
  key: "close", label: `Close #${item.number}`, icon: "issueClosed",
145
149
  detail: "Closes as completed, with Undo", disabled: blocked,
@@ -254,8 +258,10 @@ function WrapRow({ item, first, busy, login, fixture, openAgent: openSession, fe
254
258
  }
255
259
 
256
260
  // Wrap up owns its cleanup actions; the sheet uses the same details and entries as the other tabs [ATT-06, SES-03].
257
- function WrapItemSheet({ item, fetchDetails, openSession, entries, onClose }: {
261
+ function WrapItemSheet({ item, sessions = item.wrap.sessions, fetchDetails, openSession, entries, onClose }: {
258
262
  item: WrapItem;
263
+ // Navigation includes working sessions on close prompts; archive eligibility stays in item.wrap.sessions.
264
+ sessions?: AgentSummary[];
259
265
  fetchDetails: FetchDetails;
260
266
  openSession: (agentId: string) => void;
261
267
  entries: SheetEntry[];
@@ -272,13 +278,15 @@ function WrapItemSheet({ item, fetchDetails, openSession, entries, onClose }: {
272
278
  top={
273
279
  <>
274
280
  <Meta lead={<PlaceText place={{ repo: item.repo, number: item.number, login: null }} />} facts={[item.wrap.finish]} chips={[]} />
275
- {item.children.length > 0 ? <StackLine rows={item.children} merged={!!item.closedAt || !!item.wrap.ask} links /> : null}
281
+ {item.children.length > 0 ? <StackLine rows={item.children} links /> : null}
276
282
  </>
277
283
  }
278
284
  entries={[
279
- ...item.wrap.sessions.map((session) => ({
285
+ ...sessions.map((session) => ({
280
286
  ...sessionEntry(session, "Continue session", (id) => { onClose(); openSession(id); }),
281
- detail: [session.title, sessionStateText(session), session.subAgents?.count ? `+${session.subAgents.count} sub-agent${session.subAgents.count === 1 ? "" : "s"}` : null].filter(Boolean).join(" · "),
287
+ ...(isIdle(session) ? {
288
+ detail: [session.title, sessionStateText(session), session.subAgents?.count ? `+${session.subAgents.count} sub-agent${session.subAgents.count === 1 ? "" : "s"}` : null].filter(Boolean).join(" · "),
289
+ } : {}),
282
290
  })),
283
291
  githubEntry(item, (url) => { onClose(); void openExternalUrl(url); }, pr),
284
292
  ...entries,
@@ -372,10 +380,7 @@ function KeptWorktreeRow({
372
380
  onOpen={open}
373
381
  busy={busy}
374
382
  primary={{ ...primary, accessibilityLabel: `${primary.label}: ${row.name}` }}
375
- secondary={[
376
- { label: `Details for #${row.number}`, icon: "chevronRight", onPress: open },
377
- { label: "Dismiss", icon: "close", accessibilityLabel: `Dismiss: keep ${row.name}`, onPress: () => onDismiss(row) },
378
- ]}
383
+ secondary={[{ label: `Details for #${row.number}`, icon: "chevronRight", onPress: open }]}
379
384
  overlay={
380
385
  detailsOpen ? (
381
386
  <ActionSheet
@@ -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) 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. An open issue whose PRs of mine have all merged, with no PR open for it, gets a row too, with or without a session: "Close #12? #34 and #35 merged 2h ago", **Close #12** (as completed, no comment, Undo reopens) and × for Keep open, which lasts until another PR of mine merges under it (Undo too); its merged PRs' idle sessions join that row instead of making their own, and once it's closed they're the usual row. Archive all clean leaves it [ATT-24]. |
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 shared action sheet listing each one's state with Continue session; 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 Dismiss in its detail sheet; 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. An open issue whose PRs of mine have all merged, with no PR open for it, gets a row too, with or without a session: "Close #12? #34 and #35 merged 2h ago", **Close #12** (as completed, no comment, Undo reopens) and Keep open in its detail sheet, which lasts until another PR of mine merges under it (Undo too); its merged PRs' idle sessions join that row instead of making their own, and once it's closed they're the usual row. Archive all clean leaves it [ATT-24]. |
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`) uses the shared `ActionSheet` on every card-body or Details tap, including close-issue prompts and kept worktrees [ATT-06]. Item sheets reuse the detail query, hover prefetch, session entries, linked-PR rows (`client/stack.tsx`) and GitHub links from the other tabs; cleanup is an explicit action, with unsaved-work and terminal confirmations kept separate. Wrap up 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.
99
+ - **Wrap up** [ATT-22] (`shared/wrap-up.ts`, drawn by `client/wrap-up.tsx`) uses the shared `ActionSheet` on every card-body or Details tap, including close-issue prompts and kept worktrees [ATT-06]. PR cards and linked stack rows share state marks: open green, draft muted, closed unmerged red and merged purple; each stack row uses its own state, with merge timestamps supporting older saved rows. Cards show their main action and one Details chevron; Keep open and Dismiss live in the sheet. Close-issue prompts also offer the shared Start a session / Start another session entry, opening the usual session options on the issue. Their navigation lists all matching sessions, including working sessions; archive eligibility stays separate. Item sheets reuse the detail query, hover prefetch, session entries, linked-PR rows (`client/stack.tsx`) and GitHub links from the other tabs; cleanup is an explicit action, with unsaved-work and terminal confirmations kept separate. Wrap up 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
  - **Close #12?** [ATT-24] (`classifyCloseAsks` in `server/classify.ts`): after History's searches, the issues my merged PRs refer to that History doesn't know closed (`mergedToLookUp` in `server/references.ts`, at most 100) are looked up, a batch per request, for their state and the open PRs GitHub links to them, anyone's. A merged PR is put under an issue as `issueFor` picks one, counting History's closed issues as issues so a PR that closed one isn't put under another it mentions. An issue that's open, with no linked PR open, is asked about (`asks` in `state.json`'s History); as History is fetched daily, each live refresh looks the asked issues up again (`askOff`, one batched request while any is asked; one that can't be looked up keeps asking); the view leaves out one with a PR of mine open under it in the live feed (a mention or answer on the issue alone doesn't count), one Next up knows has anyone's PR open, one the live lookup found closed or with a PR open, one whose latest merge is older than History's weeks, one kept open (`keptOpen`: the latest merge then, so a later one asks again; kept for History's weeks, so an ask missing from one fetch doesn't lose it) and one I just closed. Closing goes through `rpc.closeIssue`, its done item carrying the merged PRs with their branches, so a session linked by branch keeps its row, whether the issue is assigned to me or not; as History's search only finds closed issues assigned to me, it's kept in `closedAsks` for History's weeks, listed in History with its PRs under it rather than alone, and Undo forgets it; Next up's card gets a "PRs merged" pill (`prsMerged`).
101
101
 
102
102
  - **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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrioid/paseo-attention-span",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
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": {
@@ -346,7 +346,7 @@ export function classify({ data, details, config, now }: ClassifyInput): Attenti
346
346
  const parent = parentOf(pr);
347
347
  const facts = { pr, s, base: parent ? `#${parent.number}` : pr.baseRefName, now, own: isOwn(pr) };
348
348
  const chips = [...(stack.length > 1 ? [chip(`${index + 1}/${stack.length}`)] : []), ...chipsFor(SUB_CHIPS, facts)];
349
- return { key: prKey(pr), number: pr.number, title: pr.title, url: pr.url, draft: pr.isDraft, chips, attention: s.outOfSync || s.conflicts || s.ciFailing };
349
+ return { key: prKey(pr), number: pr.number, title: pr.title, url: pr.url, draft: pr.isDraft, state: pr.isDraft ? "DRAFT" : "OPEN", chips, attention: s.outOfSync || s.conflicts || s.ciFailing };
350
350
  };
351
351
 
352
352
  const target = (pr: PullRequestNode, stack: PullRequestNode[]): Target => ({
@@ -485,7 +485,7 @@ export function classifyHistory(data: HistoryResult): Item[] {
485
485
  const linked = { repo: pr.repository.nameWithOwner, body: pr.body, linked: pr.closingIssuesReferences.nodes.map(prKey) };
486
486
  const issue = closed.get(issueFor([linked], (key) => closed.has(key)) ?? "");
487
487
  const head = pr.headRefName ? { headRefName: pr.headRefName } : {};
488
- if (issue) issue.children.push({ key: prKey(pr), number: pr.number, title: pr.title, url: pr.url, draft: false, chips: [], attention: false, ...mergedBy(pr), ...head, mergedAt: pr.mergedAt });
488
+ if (issue) issue.children.push({ key: prKey(pr), number: pr.number, title: pr.title, url: pr.url, draft: false, state: "MERGED", chips: [], attention: false, ...mergedBy(pr), ...head, mergedAt: pr.mergedAt });
489
489
  else {
490
490
  const item = plain(pr, "pr", "done");
491
491
  items.push(kinded({ ...item, target: { ...item.target, ...head }, closedAt: pr.mergedAt, ...mergedBy(pr) }, pr));
@@ -515,7 +515,7 @@ export function classifyCloseAsks(data: HistoryResult): CloseAsk[] {
515
515
  // Its branch, so a session on it still finds its row once the issue is closed; who merged it, as History says [ATT-22, HIS-05].
516
516
  const by = pr.mergedBy?.login;
517
517
  ask.prs.push({
518
- key: prKey(pr), number: pr.number, title: pr.title, url: pr.url, draft: false, chips: [], attention: false, mergedAt: pr.mergedAt,
518
+ key: prKey(pr), number: pr.number, title: pr.title, url: pr.url, draft: false, state: "MERGED", chips: [], attention: false, mergedAt: pr.mergedAt,
519
519
  ...(pr.headRefName ? { headRefName: pr.headRefName } : {}),
520
520
  ...(by && me && by.toLowerCase() !== me ? { mergedBy: by } : {}),
521
521
  });
package/server/fixture.ts CHANGED
@@ -439,7 +439,8 @@ export const FIXTURE_AGENTS: AgentSummary[] = [
439
439
  agent("agent-186", `${REPO}#186`, "fix", "idle", 40, false, { ...sessionWorkspace("split-invoice-pdf", true, 1, true, 2)!, dirtyLines: { added: 12, deleted: 3 }, terminals: ["dev", "shell"] }, "Split invoice PDF"),
440
440
  agent("agent-190", `${REPO}#190`, "review", "idle", 60, false, sessionWorkspace("add-vat-export", false, 0), "Review PR 190: Add the VAT export"),
441
441
  // On a PR under an issue Wrap up asks to close: it joins that row [ATT-24].
442
- agent("agent-195", `${REPO}#195`, "fix", "idle", 10, false, sessionWorkspace("statement-pdf-download", false, 0), "Statement PDF download"),
442
+ // A session started from the close-issue prompt stays visible while working, even though it cannot be archived.
443
+ agent("agent-195", `${REPO}#195`, "fix", "running", 10, false, sessionWorkspace("statement-pdf-download", false, 0), "Statement PDF download"),
443
444
  // With a review sub-agent it started, archived along with it.
444
445
  { ...agent("agent-172", `${REPO}#172`, "fix", "idle", 240, false, sessionWorkspace("fix-vat-credit-notes", false, 0), "Fix VAT on credit notes"), subAgents: { count: 1, working: false } },
445
446
  agent("agent-172b", `${REPO}#172`, "address", "idle", 250, false, sessionWorkspace("credit-note-tests", undefined, undefined), "Credit note tests"),
@@ -213,12 +213,16 @@ export function sessionTitle(kind: SessionKind, target: Pick<Target, "kind" | "n
213
213
  return (kind === "review" ? `Review ${item}` : item).slice(0, 120);
214
214
  }
215
215
 
216
+ export type PrState = "OPEN" | "DRAFT" | "CLOSED" | "MERGED";
217
+
216
218
  export interface SubRow {
217
219
  key: string;
218
220
  number: number;
219
221
  title: string;
220
222
  url: string;
221
223
  draft: boolean;
224
+ // Optional for older saved groups; mergedAt and draft are the fallback.
225
+ state?: PrState;
222
226
  chips: Chip[];
223
227
  // Behind its parent, conflicting or failing CI: shown even when the stack is collapsed.
224
228
  attention: boolean;
@@ -2,9 +2,10 @@
2
2
  // [ATT-05, ATT-06].
3
3
  import { type ActionId, type AgentSummary, type AttentionView, type Chip, type FailingChecks, isWorking, type Item, looseSessions, ownStack, reviewAgain, SECTIONS, type SubRow, type TabId, type WaitingOn, type WrapItem } from "./attention";
4
4
  import { summarizeRerun } from "./checks";
5
- import type { SessionKind } from "./config";
5
+ import { nextUpSources, type SessionKind } from "./config";
6
6
  import { ago } from "./format";
7
7
  import { sameName } from "./names";
8
+ import { nextUpFilter } from "./next-up-filter";
8
9
  import { ACTION_SESSION } from "./prompts";
9
10
  import { doingCount, finishText } from "./wrap-up";
10
11
 
@@ -211,14 +212,19 @@ export function stackMetaChips(item: Item, targetRow: SubRow | undefined): Chip[
211
212
 
212
213
  // Each tab's count: History's finished work in the weeks it shows [HIS-01], Doing with Wrap up's rows [ATT-09, ATT-22], work
213
214
  // waiting on several people once, and every issue in Next up.
215
+ function nextUpUnclaimed(view: Pick<AttentionView, "unclaimed" | "scopes" | "config" | "sources" | "projects" | "projectFilter">) {
216
+ return nextUpFilter({ unclaimed: view.unclaimed, selected: view.scopes, sources: nextUpSources(view.config), selectedSources: view.sources, projects: view.projects, selectedProjects: view.projectFilter }).shown;
217
+ }
218
+
214
219
  export function tabCounts(
215
- view: Pick<AttentionView, "history" | "count" | "waiting" | "assigned" | "unclaimed">,
220
+ view: Pick<AttentionView, "history" | "count" | "waiting" | "assigned" | "unclaimed" | "scopes" | "config" | "sources" | "projects" | "projectFilter">,
216
221
  wrap: WrapItem[],
217
222
  ): Record<TabId, number> {
218
223
  return {
219
224
  history: view.history.filter((item) => item.section === "done" && !!item.closedAt).length,
220
225
  doing: doingCount(view, wrap),
221
226
  waiting: new Set(view.waiting.flatMap((group) => group.items.map((item) => item.key))).size,
222
- next: view.assigned.length + view.unclaimed.length,
227
+ // Unclaimed as its filter leaves it, so the tab says what the list shows [NXT-03, NXT-09].
228
+ next: view.assigned.length + nextUpUnclaimed(view).length,
223
229
  };
224
230
  }