@yemi33/minions 0.1.403 → 0.1.405

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.405 (2026-04-06)
4
+
5
+ ### Fixes
6
+ - PR delete is optimistic — row removed immediately, reverted on failure
7
+ - PR delete searches all project files, not just the first project
8
+
3
9
  ## 0.1.403 (2026-04-06)
4
10
 
5
11
  ### Fixes
@@ -39,6 +39,7 @@ function prTableHtml(rows) {
39
39
  }
40
40
 
41
41
  function renderPrs(prs) {
42
+ prs = prs.filter(p => !isDeleted('pr:' + p.id));
42
43
  allPrs = prs;
43
44
  const el = document.getElementById('pr-content');
44
45
  const count = document.getElementById('pr-count');
@@ -153,15 +154,18 @@ async function _submitLinkPr() {
153
154
 
154
155
  async function unlinkPr(id) {
155
156
  if (!confirm('Remove ' + id + ' from tracking?')) return;
157
+ // Optimistic: remove row immediately
158
+ markDeleted('pr:' + id);
159
+ const row = document.querySelector('[data-pr-id="' + id + '"]')?.closest('tr');
160
+ if (row) row.remove();
161
+ showToast('cmd-toast', id + ' removed', true);
156
162
  try {
157
163
  const res = await fetch('/api/pull-requests/delete', {
158
164
  method: 'POST', headers: { 'Content-Type': 'application/json' },
159
165
  body: JSON.stringify({ id })
160
166
  });
161
- if (!res.ok) { const d = await res.json().catch(() => ({})); alert('Failed: ' + (d.error || 'unknown')); return; }
162
- showToast('cmd-toast', id + ' removed', true);
163
- refresh();
164
- } catch (e) { alert('Error: ' + e.message); }
167
+ if (!res.ok) { _deletedIds.delete('pr:' + id); const d = await res.json().catch(() => ({})); alert('Failed: ' + (d.error || 'unknown')); refresh(); return; }
168
+ } catch (e) { _deletedIds.delete('pr:' + id); alert('Error: ' + e.message); refresh(); }
165
169
  }
166
170
 
167
171
  window.MinionsPrs = { prRow, prTableHtml, renderPrs, prPrev, prNext, openAllPrs, openModal, openAddPrModal, unlinkPr };
package/dashboard.js CHANGED
@@ -3637,19 +3637,24 @@ What would you like to discuss or change? When you're happy, say "approve" and I
3637
3637
 
3638
3638
  { method: 'POST', path: '/api/pull-requests/delete', desc: 'Remove a PR from tracking', params: 'id, project?', handler: async (req, res) => {
3639
3639
  const body = await readBody(req);
3640
- const { id, project: projectName } = body;
3640
+ const { id } = body;
3641
3641
  if (!id) return jsonReply(res, 400, { error: 'id required' });
3642
3642
  reloadConfig();
3643
- const projects = shared.getProjects(CONFIG);
3644
- const targetProject = projectName ? projects.find(p => p.name?.toLowerCase() === projectName.toLowerCase()) : projects[0];
3645
- const prPath = targetProject ? shared.projectPrPath(targetProject) : path.join(MINIONS_DIR, 'pull-requests.json');
3643
+ // Search all project PR files and central file
3644
+ const prPaths = [
3645
+ ...shared.getProjects(CONFIG).map(p => shared.projectPrPath(p)),
3646
+ path.join(MINIONS_DIR, 'pull-requests.json'),
3647
+ ];
3646
3648
  let found = false;
3647
- mutateJsonFileLocked(prPath, (prs) => {
3648
- if (!Array.isArray(prs)) return prs;
3649
- const idx = prs.findIndex(p => p.id === id);
3650
- if (idx >= 0) { prs.splice(idx, 1); found = true; }
3651
- return prs;
3652
- }, { defaultValue: [] });
3649
+ for (const prPath of prPaths) {
3650
+ if (found) break;
3651
+ mutateJsonFileLocked(prPath, (prs) => {
3652
+ if (!Array.isArray(prs)) return prs;
3653
+ const idx = prs.findIndex(p => p.id === id);
3654
+ if (idx >= 0) { prs.splice(idx, 1); found = true; }
3655
+ return prs;
3656
+ }, { defaultValue: [] });
3657
+ }
3653
3658
  if (!found) return jsonReply(res, 404, { error: 'PR not found' });
3654
3659
  invalidateStatusCache();
3655
3660
  return jsonReply(res, 200, { ok: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.403",
3
+ "version": "0.1.405",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"