@yemi33/minions 0.1.48 → 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 +5 -0
- package/dashboard/js/render-prd.js +29 -2
- 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
|
|
package/package.json
CHANGED