@yemi33/minions 0.1.47 → 0.1.49
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 +10 -0
- package/dashboard/js/render-plans.js +9 -2
- package/dashboard/js/render-prd.js +29 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -164,11 +164,18 @@ function renderPlans(plans) {
|
|
|
164
164
|
|
|
165
165
|
function renderPlanCard(p) {
|
|
166
166
|
const prdFile = planToPrdFile[p.file] || (p.file.endsWith('.json') ? p.file : '');
|
|
167
|
-
const rawStatus = p.status || 'active';
|
|
168
167
|
const isArchived = p.archived;
|
|
169
168
|
|
|
169
|
+
// For .md plans with a linked PRD, use the PRD's status as the authoritative intent
|
|
170
|
+
// (p.status for .md is 'draft'/'converted'/'active', not the PRD lifecycle status)
|
|
171
|
+
let prdJsonStatus = p.status || 'active';
|
|
172
|
+
if (prdFile && p.format !== 'prd') {
|
|
173
|
+
const linkedPrd = plans.find(pp => pp.file === prdFile && pp.format === 'prd');
|
|
174
|
+
if (linkedPrd) prdJsonStatus = linkedPrd.status || prdJsonStatus;
|
|
175
|
+
}
|
|
176
|
+
|
|
170
177
|
// Single source of truth: derive status from work items
|
|
171
|
-
const effectiveStatus = isArchived ? 'completed' : derivePlanStatus(prdFile, p.file,
|
|
178
|
+
const effectiveStatus = isArchived ? 'completed' : derivePlanStatus(prdFile, p.file, prdJsonStatus, allWi);
|
|
172
179
|
|
|
173
180
|
const statusLabelsMap = {
|
|
174
181
|
'completed': 'Completed', 'in-progress': 'In Progress', 'paused': 'Paused',
|
|
@@ -12,8 +12,35 @@ function renderPrd(prd, prog) {
|
|
|
12
12
|
section.innerHTML = '<p style="color:var(--orange);margin-bottom:0">PRD file found but has parse errors.</p>';
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
//
|
|
15
|
+
|
|
16
|
+
// Derive status from work items
|
|
17
|
+
const allWi = window._lastWorkItems || [];
|
|
18
|
+
const prdItems = (prog?.items || []).filter(i => !i._archived);
|
|
19
|
+
const implementItems = allWi.filter(w => prdItems.some(pi => pi.id === w.id));
|
|
20
|
+
const allDone = implementItems.length > 0 && implementItems.every(w => w.status === 'done' || w.status === 'in-pr' || w.status === 'implemented' || w.status === 'complete');
|
|
21
|
+
const hasActive = implementItems.some(w => w.status === 'pending' || w.status === 'dispatched');
|
|
22
|
+
|
|
23
|
+
// Find the active PRD file for action buttons
|
|
24
|
+
const prdFile = prd.existing?.[0]?.file || '';
|
|
25
|
+
const prdStatus = prd.existing?.[0]?.status || '';
|
|
26
|
+
const effectiveStatus = allDone && !hasActive ? 'completed' : hasActive ? 'in-progress' : prdStatus || 'active';
|
|
27
|
+
|
|
28
|
+
const statusColors = { 'completed': 'var(--green)', 'in-progress': 'var(--blue)', 'awaiting-approval': 'var(--yellow)', 'paused': 'var(--muted)', 'approved': 'var(--green)' };
|
|
29
|
+
const statusLabels = { 'completed': 'Completed', 'in-progress': 'In Progress', 'awaiting-approval': 'Awaiting Approval', 'paused': 'Paused', 'approved': 'Approved' };
|
|
30
|
+
|
|
31
|
+
let actions = '';
|
|
32
|
+
if (prdFile) {
|
|
33
|
+
if (effectiveStatus === 'awaiting-approval') {
|
|
34
|
+
actions = ' <button class="pr-pager-btn" style="font-size:9px;padding:1px 6px;color:var(--green);border-color:var(--green);margin-left:4px" onclick="planApprove(\'' + escHtml(prdFile) + '\')">Approve</button>';
|
|
35
|
+
} else if (effectiveStatus === 'in-progress') {
|
|
36
|
+
actions = ' <button class="pr-pager-btn" style="font-size:9px;padding:1px 6px;color:var(--yellow);border-color:var(--yellow);margin-left:4px" onclick="planPause(\'' + escHtml(prdFile) + '\')">Pause</button>';
|
|
37
|
+
} else if (effectiveStatus === 'paused') {
|
|
38
|
+
actions = ' <button class="pr-pager-btn" style="font-size:9px;padding:1px 6px;color:var(--green);border-color:var(--green);margin-left:4px" onclick="planApprove(\'' + escHtml(prdFile) + '\')">Resume</button>';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
badge.innerHTML = '<span style="font-weight:600;font-size:11px;color:' + (statusColors[effectiveStatus] || 'var(--muted)') + '">' + (statusLabels[effectiveStatus] || effectiveStatus) + '</span>' +
|
|
43
|
+
' <span style="color:var(--muted);font-size:10px">' + (prd.age || '') + '</span>' + actions;
|
|
17
44
|
section.innerHTML = '';
|
|
18
45
|
}
|
|
19
46
|
|
package/package.json
CHANGED