ai-agentmanager 1.26.1 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/public/keys.js CHANGED
@@ -13,6 +13,7 @@ export const SHORTCUTS = [
13
13
  ]],
14
14
  ['Anywhere', [
15
15
  [['y'], 'Today: what needs you, most pressing first', 'today'],
16
+ [['b'], 'Bugs: what bug hunts found, and the hunts', 'bugs'],
16
17
  [['n'], 'New agents', 'new'],
17
18
  [['a'], 'Ask Agent (a general session)', 'ask'],
18
19
  [['/'], 'Filter agents', 'filter'],
@@ -43,6 +44,7 @@ export const SHORTCUTS = [
43
44
  [['o'], 'Undecided again (Actions) or clear (Jira)', null],
44
45
  [['c'], 'Discuss it with Claude (Actions)', null],
45
46
  [['Enter'], 'Open the issue or where it was asked', null],
47
+ [['u'], 'Undo the last change (Today); or Undo on the message', null],
46
48
  [['r'], 'Look again', null],
47
49
  ]],
48
50
  ['In the standup', [
@@ -60,11 +62,11 @@ export const SHORTCUTS = [
60
62
  // A single key, as an event names it, to its action.
61
63
  export const SINGLE = {
62
64
  j: 'next', k: 'prev', Enter: 'terminal', t: 'terminal',
63
- r: 'changes', s: 'start', X: 'stop', e: 'edit', n: 'new', a: 'ask', '/': 'filter', w: 'watch', p: 'standup', m: 'map', i: 'issues', o: 'actions', h: 'assistant', ',': 'settings', d: 'designs', g: 'reviews', v: 'value', y: 'today', '?': 'help',
65
+ r: 'changes', s: 'start', X: 'stop', e: 'edit', n: 'new', a: 'ask', '/': 'filter', w: 'watch', p: 'standup', m: 'map', i: 'issues', o: 'actions', h: 'assistant', ',': 'settings', d: 'designs', g: 'reviews', v: 'value', y: 'today', b: 'bugs', '?': 'help',
64
66
  1: 'tab:agents', 2: 'tab:inbox', 3: 'tab:backlog', 4: 'tab:land', 5: 'tab:built',
65
67
  };
66
68
  // While Watch is open: only what makes sense there.
67
- const ON_WATCH = new Set(['today', 'new', 'ask', 'watch', 'standup', 'map', 'issues', 'actions', 'assistant', 'settings', 'designs', 'reviews', 'value', 'help']);
69
+ const ON_WATCH = new Set(['today', 'new', 'ask', 'watch', 'standup', 'map', 'issues', 'actions', 'assistant', 'settings', 'designs', 'reviews', 'value', 'bugs', 'help']);
68
70
 
69
71
  /** Typing somewhere: a field, an editor or a terminal (xterm types through a textarea). */
70
72
  const typing = (el) => Boolean(el?.closest?.('input, textarea, select, [contenteditable=""], [contenteditable="true"], .xterm, .cm-editor'));
package/public/style.css CHANGED
@@ -1306,3 +1306,34 @@ table.issues tr.kb-on td:first-child { box-shadow: inset 3px 0 0 var(--accent);
1306
1306
  .actions-table .action-meta { margin-top: 3px; }
1307
1307
  .actions-table .action-due { color: var(--yellow); font-weight: 600; }
1308
1308
  .actions-table tr.action-skip td:not(.issue-action), .actions-table tr.action-remove td:not(.issue-action), .actions-table tr.action-done td:not(.issue-action) { opacity: 0.65; }
1309
+
1310
+ /* Report a problem or idea */
1311
+ .support-dialog { width: min(640px, calc(100vw - 32px)); }
1312
+ .support-dialog .hint { margin: 0; }
1313
+ .support-kind { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; }
1314
+ .support-kind label.check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; width: auto; font-weight: 400; }
1315
+ .support-kind input { width: auto; margin: 0; }
1316
+ .support-dialog textarea { width: 100%; resize: vertical; font: inherit; }
1317
+ .support-label { font-size: 13px; font-weight: 500; }
1318
+ .support-shot { border: 1px dashed var(--border); border-radius: 8px; padding: 10px; font-size: 13px; }
1319
+ .support-shot.over { border-color: var(--accent, currentColor); background: color-mix(in srgb, currentColor 6%, transparent); }
1320
+ .support-img { display: block; max-width: 100%; max-height: 260px; margin: 0 auto; border-radius: 4px; }
1321
+ .support-shot-acts { display: flex; justify-content: flex-end; margin-top: 6px; }
1322
+ #support-earlier ul { margin: 6px 0; padding-left: 18px; font-size: 13px; }
1323
+ #support-earlier summary { cursor: pointer; font-size: 13px; }
1324
+
1325
+ /* Bugs */
1326
+ .bug-sev { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; border: 1px solid currentColor; }
1327
+ .bug-sev.critical, .bug-sev.high { color: var(--red); }
1328
+ .bug-sev.medium { color: var(--amber, #c98a12); }
1329
+ .bug-sev.low { color: var(--muted); }
1330
+ tr.bug-detail td { padding: 4px 12px 14px; font-size: 13px; }
1331
+ tr.bug-detail pre { white-space: pre-wrap; max-height: 280px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
1332
+ .hunt-running { margin: 0 0 8px; padding: 6px 10px; border-left: 3px solid var(--accent, currentColor); font-size: 13px; }
1333
+ .hunt-form { padding: 8px 0; }
1334
+ .hunt-form h3 { margin: 0; font-size: 15px; }
1335
+ .hunt-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; }
1336
+ #bugs-btn.hunting::after { content: ' ●'; color: var(--accent, currentColor); }
1337
+ .today-bug .today-label { color: var(--red); }
1338
+ #bugs-dialog td.today-acts { white-space: normal; text-align: right; }
1339
+ #bugs-dialog td.today-acts > * { margin: 2px 0; }
@@ -0,0 +1,168 @@
1
+ // Report a problem or an idea: a title, what happened (or what would help) and a screenshot when
2
+ // one helps, by pasting, dropping, choosing a file or capturing the screen. It's kept on this
3
+ // computer, and GitHub opens with a new issue filled in; the screenshot is put on the clipboard
4
+ // to paste there. Nothing is posted until you submit it on GitHub.
5
+
6
+ const MAX_SIDE = 2400;
7
+ const HINT = {
8
+ bug: 'What happened, and what you expected. Steps help: what you clicked or typed, in order.',
9
+ idea: 'What would help, and what you would use it for.',
10
+ };
11
+
12
+ export function initSupport({ api, $, esc, toast }) {
13
+ const dialog = $('#support-dialog');
14
+ const form = $('#support-form');
15
+ const shot = $('#support-shot');
16
+ let image = null; // { blob, url }
17
+
18
+ /** Any image as a PNG no larger than MAX_SIDE on a side: what the clipboard and GitHub take. */
19
+ async function asPng(source) {
20
+ const bmp = await createImageBitmap(source);
21
+ const k = Math.min(1, MAX_SIDE / Math.max(bmp.width, bmp.height));
22
+ const c = document.createElement('canvas');
23
+ c.width = Math.round(bmp.width * k);
24
+ c.height = Math.round(bmp.height * k);
25
+ c.getContext('2d').drawImage(bmp, 0, 0, c.width, c.height);
26
+ bmp.close?.();
27
+ return new Promise((ok, no) => c.toBlob((b) => (b ? ok(b) : no(new Error("Couldn't read the image"))), 'image/png'));
28
+ }
29
+
30
+ async function setImage(source) {
31
+ try {
32
+ const blob = source ? await asPng(source) : null;
33
+ if (image) URL.revokeObjectURL(image.url);
34
+ image = blob ? { blob, url: URL.createObjectURL(blob) } : null;
35
+ } catch (e) {
36
+ toast(e.message || "Couldn't read the image", 5000);
37
+ }
38
+ drawShot();
39
+ }
40
+
41
+ function drawShot() {
42
+ const capture = navigator.mediaDevices?.getDisplayMedia ? '<button type="button" class="small" data-support="capture" title="Pick a screen, window or tab to take a picture of">Capture the screen</button>' : '';
43
+ shot.innerHTML = image
44
+ ? `<img src="${image.url}" alt="Screenshot" class="support-img" /><div class="support-shot-acts"><button type="button" class="small" data-support="remove-shot">Remove</button></div>`
45
+ : `<div class="support-drop">Paste a screenshot (⌘V), drop an image here, <label class="small-link">choose a file<input type="file" accept="image/*" data-support="file" hidden /></label>${capture ? `, or ${capture}` : ''}.</div>`;
46
+ }
47
+
48
+ /** One frame of a screen, window or tab you pick; this window steps aside while it's taken. */
49
+ async function capture() {
50
+ let stream = null;
51
+ dialog.close();
52
+ try {
53
+ stream = await navigator.mediaDevices.getDisplayMedia({ video: { displaySurface: 'browser' }, audio: false, preferCurrentTab: true, selfBrowserSurface: 'include' });
54
+ const video = document.createElement('video');
55
+ video.muted = true;
56
+ video.srcObject = stream;
57
+ await video.play();
58
+ // Let the picker's own overlay go first.
59
+ await new Promise((r) => setTimeout(r, 400));
60
+ await setImage(await createImageBitmap(video));
61
+ } catch (e) {
62
+ if (e?.name !== 'NotAllowedError') toast(`Couldn't capture: ${e.message}`, 5000);
63
+ } finally {
64
+ stream?.getTracks().forEach((t) => t.stop());
65
+ dialog.showModal();
66
+ }
67
+ }
68
+
69
+ function kind() {
70
+ return form.kind.value || 'bug';
71
+ }
72
+
73
+ async function drawEarlier() {
74
+ const box = $('#support-earlier');
75
+ try {
76
+ const { tickets } = await api('GET', '/support');
77
+ box.innerHTML = tickets.length
78
+ ? `<details><summary>Your earlier reports (${tickets.length})</summary><ul>${tickets
79
+ .map((t) => `<li><a href="${esc(t.issueUrl)}" target="_blank" rel="noopener">${esc(t.title)}</a> <span class="hint">${esc(new Date(t.at).toLocaleDateString())}${t.screenshot ? ` · <a href="/api/support/${esc(t.id)}/screenshot" target="_blank" rel="noopener">screenshot</a>` : ''}</span></li>`)
80
+ .join('')}</ul><p class="hint">Kept on this computer in ${esc(tickets[0].folder.replace(/\/[^/]+$/, ''))}.</p></details>`
81
+ : '';
82
+ } catch {
83
+ box.innerHTML = '';
84
+ }
85
+ }
86
+
87
+ function open() {
88
+ form.reset();
89
+ $('#support-error').hidden = true;
90
+ $('#support-done').hidden = true;
91
+ form.hidden = false;
92
+ setImage(null);
93
+ form.details.placeholder = HINT.bug;
94
+ dialog.showModal();
95
+ form.title.focus();
96
+ drawEarlier();
97
+ }
98
+
99
+ form.addEventListener('change', (e) => {
100
+ if (e.target.name === 'kind') form.details.placeholder = HINT[kind()];
101
+ });
102
+ dialog.addEventListener('paste', (e) => {
103
+ const f = [...(e.clipboardData?.files ?? [])].find((x) => x.type.startsWith('image/'));
104
+ if (!f) return;
105
+ e.preventDefault();
106
+ setImage(f);
107
+ });
108
+ shot.addEventListener('dragover', (e) => {
109
+ e.preventDefault();
110
+ shot.classList.add('over');
111
+ });
112
+ shot.addEventListener('dragleave', () => shot.classList.remove('over'));
113
+ shot.addEventListener('drop', (e) => {
114
+ e.preventDefault();
115
+ shot.classList.remove('over');
116
+ const f = [...(e.dataTransfer?.files ?? [])].find((x) => x.type.startsWith('image/'));
117
+ if (f) setImage(f);
118
+ });
119
+ dialog.addEventListener('change', (e) => {
120
+ if (e.target.dataset.support === 'file' && e.target.files?.[0]) setImage(e.target.files[0]);
121
+ });
122
+ dialog.addEventListener('click', (e) => {
123
+ const b = e.target.closest('[data-support]')?.dataset.support;
124
+ if (b === 'capture') capture();
125
+ else if (b === 'remove-shot') setImage(null);
126
+ else if (b === 'close') dialog.close();
127
+ });
128
+
129
+ form.addEventListener('submit', async (e) => {
130
+ e.preventDefault();
131
+ const err = $('#support-error');
132
+ err.hidden = true;
133
+ // While this click still counts as yours: the browser allows the new tab and the clipboard only then.
134
+ const tab = window.open('about:blank', '_blank');
135
+ let copied = false;
136
+ if (image && navigator.clipboard?.write && window.ClipboardItem) {
137
+ copied = await navigator.clipboard.write([new ClipboardItem({ 'image/png': image.blob })]).then(
138
+ () => true,
139
+ () => false,
140
+ );
141
+ }
142
+ try {
143
+ let t = await api('POST', '/support', { kind: kind(), title: form.title.value, details: form.details.value });
144
+ if (image) {
145
+ const res = await fetch(`/api/support/${encodeURIComponent(t.id)}/screenshot`, { method: 'PUT', headers: { 'content-type': 'image/png', 'x-agentmgr': '1' }, body: image.blob });
146
+ if (!res.ok) throw new Error((await res.json().catch(() => null))?.error ?? `The screenshot wasn't saved (${res.status})`);
147
+ t = await res.json();
148
+ }
149
+ if (tab) {
150
+ tab.opener = null;
151
+ tab.location.href = t.issueUrl;
152
+ }
153
+ form.hidden = true;
154
+ const done = $('#support-done');
155
+ done.hidden = false;
156
+ done.innerHTML = `<p><b>Saved.</b> ${tab ? 'GitHub opened in a new tab with your report filled in' : 'Open the filled-in report on GitHub'}: look it over, ${t.screenshot ? (copied ? 'paste the screenshot (⌘V) where it says, ' : 'drag the screenshot in where it says, ') : ''}then submit it there.</p>
157
+ <p><a href="${esc(t.issueUrl)}" target="_blank" rel="noopener" class="small-link">Open the report on GitHub ↗</a>${t.screenshot ? ` · <a href="/api/support/${esc(t.id)}/screenshot" target="_blank" rel="noopener" class="small-link">The screenshot</a>` : ''}</p>
158
+ <p class="hint">GitHub issues are public. You need a GitHub account to submit. A copy is kept on this computer in ${esc(t.folder)}.</p>
159
+ <div class="dialog-actions"><button type="button" data-support="close" class="primary">Done</button></div>`;
160
+ } catch (ex) {
161
+ tab?.close();
162
+ err.textContent = ex.message;
163
+ err.hidden = false;
164
+ }
165
+ });
166
+
167
+ return { open };
168
+ }
package/public/today.js CHANGED
@@ -10,13 +10,15 @@ import { expandButton, expandable } from './expand.js';
10
10
  // Up to this score an item is pressing: it counts on the button.
11
11
  const PRESSING = 32;
12
12
 
13
- export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions, openIssues, openReviews, toast }) {
13
+ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions, openIssues, openReviews, openBugs, toast }) {
14
14
  const dialog = $('#today-dialog');
15
15
  const body = $('#today-body');
16
16
  let data = null;
17
17
  let loading = false;
18
18
  let again = null;
19
19
  let loadedAt = 0;
20
+ let undo = null; // { label, run }: the last change made here, to take back (u)
21
+ let asideOpen = false;
20
22
 
21
23
  async function load({ quiet = false, fresh = false } = {}) {
22
24
  if (loading) return;
@@ -52,6 +54,7 @@ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions,
52
54
  if (it.kind === 'pr-requested') return [btn('review', 'Review it', 'A reviewer agent reads it and finds what blocks approval (a)', true), link(it.url, 'PR')].join(' ');
53
55
  if (it.kind === 'pr-ready') return [btn('open-reviews', 'Open review', 'Pick what to post (Enter)', true), link(it.url, 'PR')].join(' ');
54
56
  if (it.kind === 'rule') return btn('inbox', 'Inbox', 'Decide in the inbox (Enter)', true);
57
+ if (it.kind === 'bug') return [btn('fix', 'Fix', 'Start an agent on it, with the failing test (a)', true), btn('skip', 'Snooze', 'Until tomorrow 9am (s)'), btn('notbug', 'Not a bug', "It won't be reported again"), btn('bugs', 'Evidence', 'See it in Bugs (Enter)')].join(' ');
55
58
  return [it.agentId ? btn('open', 'Open', "Open the agent's session (Enter)", it.score < 20) : '', link(it.url, it.issueKey ? 'Jira' : 'Link')].join(' ');
56
59
  }
57
60
 
@@ -85,10 +88,59 @@ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions,
85
88
  ${items.length
86
89
  ? `<div class="issues-scroll"><table class="issues today-table"><tbody>${items.map(row).join('')}</tbody></table></div>`
87
90
  : '<p class="hint issues-empty">Nothing needs you right now: no agent is waiting on you, nothing is due, and no review is waiting.</p>'}
88
- <p class="hint">Keys: j/k move (or click a row), Enter opens, a assign or review, d done, s skip, c discuss, r look again, f bigger.${off.length ? ` Not included (off in Settings → What you use): ${esc(off.join(', '))}.` : ''}${data.errors?.length ? ` Couldn't get: ${esc(data.errors.map((e) => `${e.source === 'jira' ? 'Jira' : e.source} (${e.error})`).join('; '))}.` : ''}</p>`;
91
+ ${asideHtml()}
92
+ <p class="hint">Keys: j/k move (or click a row), Enter opens, a assign or review, d done, s skip, c discuss, u undo, r look again, f bigger.${off.length ? ` Not included (off in Settings → What you use): ${esc(off.join(', '))}.` : ''}${data.errors?.length ? ` Couldn't get: ${esc(data.errors.map((e) => `${e.source === 'jira' ? 'Jira' : e.source} (${e.error})`).join('; '))}.` : ''}</p>`;
89
93
  keys.redraw();
90
94
  }
91
95
  const render = holdWhilePicking(body, draw);
96
+
97
+ /** What you skipped, marked done or removed: each can be brought back, or all of them. */
98
+ function asideHtml() {
99
+ const aside = data?.aside ?? [];
100
+ if (!aside.length) return '';
101
+ const rows = aside
102
+ .map((a) => `<tr data-aside-id="${esc(a.id)}"><td class="nowrap"><span class="today-label">${esc(a.label)}</span></td><td><div class="today-title">${esc(a.title)}</div>${a.at ? `<div class="hint">${esc(ago(a.at))}</div>` : ''}</td><td class="nowrap today-acts"><button class="small" data-today-back="${esc(a.id)}" title="Back on the list, undecided">Bring back</button></td></tr>`)
103
+ .join('');
104
+ return `<details class="today-aside" ${asideOpen ? 'open' : ''}><summary>Set aside: skipped, done or removed (${aside.length})</summary>
105
+ <div class="today-aside-head"><span class="hint">Brought back, an item is undecided again and shows in Today and its own list.</span><button class="small" data-today-back="all" title="Bring every one back">Bring all ${aside.length} back</button></div>
106
+ <table class="issues today-table"><tbody>${rows}</tbody></table></details>`;
107
+ }
108
+
109
+ /** Back to undecided: issues to no action, actions to open. Returns how to set them aside again. */
110
+ async function bringBack(list) {
111
+ const issues = list.filter((a) => a.kind === 'issue');
112
+ const acts = list.filter((a) => a.kind === 'action');
113
+ if (issues.length) await api('POST', '/issues/action', { keys: issues.map((a) => a.issueKey), action: null });
114
+ if (acts.length) await api('POST', '/actions/set', { ids: acts.map((a) => a.actionId), state: 'open' });
115
+ return async () => {
116
+ for (const state of new Set(list.map((a) => a.state))) {
117
+ const same = list.filter((a) => a.state === state);
118
+ const keys = same.filter((a) => a.kind === 'issue').map((a) => a.issueKey);
119
+ const ids = same.filter((a) => a.kind === 'action').map((a) => a.actionId);
120
+ if (keys.length) await api('POST', '/issues/action', { keys, action: state });
121
+ if (ids.length) await api('POST', '/actions/set', { ids, state });
122
+ }
123
+ };
124
+ }
125
+
126
+ /** Remember how to take back a change, and offer it on the toast. */
127
+ function changedWith(msg, label, run) {
128
+ undo = { label, run };
129
+ toast?.(msg, 6000, { label: 'Undo', run: takeBack });
130
+ }
131
+
132
+ async function takeBack() {
133
+ if (!undo) return toast?.('Nothing to undo', 2000);
134
+ const u = undo;
135
+ undo = null;
136
+ try {
137
+ await u.run();
138
+ toast?.(`Undone: ${u.label}`, 2500);
139
+ } catch (e) {
140
+ toast?.(e.message, 6000);
141
+ }
142
+ load();
143
+ }
92
144
  expandable(dialog, draw);
93
145
 
94
146
  const itemOf = (id) => data?.items.find((i) => i.id === id) ?? null;
@@ -110,6 +162,10 @@ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions,
110
162
  dialog.close();
111
163
  return openReviews();
112
164
  }
165
+ if (what === 'bugs' || (what === 'enter' && it.kind === 'bug')) {
166
+ dialog.close();
167
+ return openBugs?.();
168
+ }
113
169
  if (what === 'enter') {
114
170
  if (it.kind === 'action') {
115
171
  dialog.close();
@@ -124,7 +180,8 @@ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions,
124
180
  }
125
181
  if (it.kind === 'action' && ['done', 'skip'].includes(what)) {
126
182
  const r = await api('POST', '/actions/set', { ids: [it.actionId], state: what });
127
- toast?.(r.failed.length ? `Not changed: ${r.failed.map((x) => x.reason).join('; ')}` : what === 'done' ? 'Done' : 'Skipped', 2500);
183
+ if (r.failed.length) toast?.(`Not changed: ${r.failed.map((x) => x.reason).join('; ')}`, 6000);
184
+ else changedWith(what === 'done' ? 'Done' : 'Skipped', `${what === 'done' ? 'done' : 'skipped'} "${it.title}"`, () => api('POST', '/actions/set', { ids: [it.actionId], state: 'open' }));
128
185
  } else if (it.kind === 'action' && what === 'discuss') {
129
186
  const r = await api('POST', `/actions/${it.actionId}/discuss`, {});
130
187
  dialog.close();
@@ -132,7 +189,17 @@ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions,
132
189
  } else if (it.kind === 'issue-new' && ['assign', 'skip'].includes(what)) {
133
190
  const r = await api('POST', '/issues/action', { keys: [it.issueKey], action: what });
134
191
  const bad = r.failed.map((x) => x.reason).join('; ');
135
- toast?.(bad ? `Not changed: ${bad}` : r.started.length ? `Started an agent on ${it.title}` : `${it.title}: skipped`, bad ? 6000 : 3000);
192
+ if (bad || r.started.length) toast?.(bad ? `Not changed: ${bad}` : `Started an agent on ${it.title}`, bad ? 6000 : 3000);
193
+ else changedWith(`${it.title}: skipped`, `skipped ${it.issueKey}`, () => api('POST', '/issues/action', { keys: [it.issueKey], action: null }));
194
+ } else if (it.kind === 'bug' && (what === 'fix' || what === 'assign')) {
195
+ const r = await api('POST', `/findings/${it.findingId}/fix`, {});
196
+ toast?.(r.existing ? `${r.agent.name} is on it already` : `Agent ${r.agent.name} started on it`, 4000);
197
+ } else if (it.kind === 'bug' && ['skip', 'notbug'].includes(what)) {
198
+ const t = new Date();
199
+ t.setDate(t.getDate() + 1);
200
+ t.setHours(9, 0, 0, 0);
201
+ await api('POST', '/findings/set', { ids: [it.findingId], status: what === 'skip' ? 'snoozed' : 'notbug', until: what === 'skip' ? t.toISOString() : null });
202
+ changedWith(what === 'skip' ? 'Snoozed until tomorrow 9am' : "Not a bug: it won't be reported again", what === 'skip' ? 'snoozed' : 'not a bug', () => api('POST', '/findings/set', { ids: [it.findingId], status: 'open' }));
136
203
  } else if (it.kind === 'pr-requested' && (what === 'review' || what === 'assign')) {
137
204
  const a = await api('POST', '/reviews', { url: it.reviewUrl });
138
205
  toast?.(`Reviewer ${a.name ?? 'agent'} started`, 3000);
@@ -152,10 +219,26 @@ export function initToday({ api, $, esc, ago, openAgent, showInbox, openActions,
152
219
  s: (r) => act(itemOf(r.dataset.rowId), 'skip'),
153
220
  c: (r) => act(itemOf(r.dataset.rowId), 'discuss'),
154
221
  r: Object.assign(() => load({ fresh: true }), { needsRow: false }),
222
+ u: Object.assign(() => takeBack(), { needsRow: false }),
155
223
  },
156
224
  });
157
225
 
158
- body.addEventListener('click', (e) => {
226
+ body.addEventListener('toggle', (e) => {
227
+ if (e.target.matches?.('.today-aside')) asideOpen = e.target.open;
228
+ }, true);
229
+ body.addEventListener('click', async (e) => {
230
+ const back = e.target.closest('[data-today-back]')?.dataset.todayBack;
231
+ if (back) {
232
+ const list = back === 'all' ? data?.aside ?? [] : (data?.aside ?? []).filter((a) => a.id === back);
233
+ if (!list.length) return;
234
+ try {
235
+ const again = await bringBack(list);
236
+ changedWith(list.length === 1 ? `Back on the list: ${list[0].title}` : `${list.length} back on the list`, list.length === 1 ? 'brought back' : `brought ${list.length} back`, again);
237
+ } catch (err) {
238
+ toast?.(err.message, 6000);
239
+ }
240
+ return load();
241
+ }
159
242
  const b = e.target.closest('[data-today]')?.dataset.today;
160
243
  if (!b) return;
161
244
  if (b === 'close') return dialog.close();