@yemi33/minions 0.1.48 → 0.1.50
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-prd.js +34 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -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
|
|
|
@@ -182,9 +209,11 @@ function renderPrdProgress(prog) {
|
|
|
182
209
|
'<span onclick="event.stopPropagation();planView(\'' + escHtml(g.sourcePlan || g.file) + '\')" style="color:var(--blue);cursor:pointer;font-size:10px;padding:2px 8px;background:rgba(56,139,253,0.1);border:1px solid rgba(56,139,253,0.3);border-radius:4px" title="Review latest plan changes">Review plan</span>' +
|
|
183
210
|
'</div>'
|
|
184
211
|
: '';
|
|
185
|
-
const pauseResumeBtn =
|
|
186
|
-
? '<span onclick="event.stopPropagation();planApprove(\'' + escHtml(g.file) + '\')" style="color:var(--green);cursor:pointer;font-size:9px;padding:1px 6px;background:rgba(63,185,80,0.1);border:1px solid rgba(63,185,80,0.3);border-radius:3px">
|
|
187
|
-
:
|
|
212
|
+
const pauseResumeBtn = isAwaitingApproval
|
|
213
|
+
? '<span onclick="event.stopPropagation();planApprove(\'' + escHtml(g.file) + '\')" style="color:var(--green);cursor:pointer;font-size:9px;padding:1px 6px;background:rgba(63,185,80,0.1);border:1px solid rgba(63,185,80,0.3);border-radius:3px">Approve</span>'
|
|
214
|
+
: isPaused
|
|
215
|
+
? '<span onclick="event.stopPropagation();planApprove(\'' + escHtml(g.file) + '\')" style="color:var(--green);cursor:pointer;font-size:9px;padding:1px 6px;background:rgba(63,185,80,0.1);border:1px solid rgba(63,185,80,0.3);border-radius:3px">Resume</span>'
|
|
216
|
+
: '<span onclick="event.stopPropagation();planPause(\'' + escHtml(g.file) + '\')" style="color:var(--yellow);cursor:pointer;font-size:9px;padding:1px 6px;background:rgba(210,153,34,0.1);border:1px solid rgba(210,153,34,0.3);border-radius:3px">Pause</span>';
|
|
188
217
|
const deleteBtn = '<span onclick="event.stopPropagation();planDelete(\'' + escHtml(g.file) + '\')" style="color:var(--red);cursor:pointer;font-size:9px;padding:1px 6px;background:rgba(248,81,73,0.1);border:1px solid rgba(248,81,73,0.3);border-radius:3px">Delete</span>';
|
|
189
218
|
const sourcePlanLink = g.sourcePlan
|
|
190
219
|
? '<span onclick="event.stopPropagation();planView(\'' + escHtml(g.sourcePlan) + '\')" style="color:var(--blue);cursor:pointer;font-size:9px;padding:1px 6px;background:rgba(56,139,253,0.1);border:1px solid rgba(56,139,253,0.3);border-radius:3px" title="View source plan">📄 Plan</span>'
|
package/package.json
CHANGED