create-pmos 0.820.0 → 0.822.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/package.json +27 -3
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/workflows.js +26 -6
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +26 -2
- package/workspace/guide/agent-capabilities.md +1 -0
- package/workspace/guide/cli.md +4 -0
- package/workspace/lib/ai-cli.js +17 -2
- package/workspace/lib/driver.js +2 -0
- package/workspace/lib/engine/workflows.js +26 -6
- package/workspace/lib/line-driver.js +40 -12
- package/workspace/lib/line.js +30 -8
- package/workspace/lib/pmos-verbs.js +1 -1
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +1 -1
- package/workspace/lib/routes-stage-signoffs.js +71 -0
- package/workspace/lib/routes-your-move.js +10 -1
- package/workspace/lib/signoff-cli.js +13 -3
- package/workspace/lib/signoffs.js +24 -4
- package/workspace/lib/stage-signoffs.js +207 -0
- package/workspace/lib/vendor/scripts/workflows.js +26 -6
- package/workspace/lib/worth-it.js +66 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-today-app.js +61 -1
- package/workspace/public/pm/cozy-today-model.js +20 -4
- package/workspace/public/pm/cozy-today-view.js +17 -2
- package/workspace/public/pm/home-app.js +1 -1
- package/workspace/test-lists/factory-signoffs-reach-you.json +9 -0
- package/workspace/test-lists/worth-it-by-kind.json +9 -0
|
@@ -41,6 +41,7 @@ export function mountToday(ctx) {
|
|
|
41
41
|
draw();
|
|
42
42
|
readReports();
|
|
43
43
|
readQuestions();
|
|
44
|
+
readSignoffs();
|
|
44
45
|
readLine();
|
|
45
46
|
readDigest();
|
|
46
47
|
readSync();
|
|
@@ -59,6 +60,58 @@ export function mountToday(ctx) {
|
|
|
59
60
|
X.questions = lines;
|
|
60
61
|
draw();
|
|
61
62
|
}
|
|
63
|
+
/* factory-signoffs-reach-you (boards LnYou4, LnBy4): each product's open stage sign-offs (GET /api/stage-signoffs), one Your move row each,
|
|
64
|
+
* and the ✦ rows that suggest a stage's sign-off lines. A product that does not answer is left out; nothing is guessed. */
|
|
65
|
+
async function readSignoffs() {
|
|
66
|
+
const P = ((ctx.S.M && ctx.S.M.products) || []).filter((p) => p && p.model);
|
|
67
|
+
const L = [...new Set((P.length ? P.map((p) => p.ws || ctx.boardWs() || '') : [ctx.boardWs() || '']))];
|
|
68
|
+
const got = await Promise.all(L.map((ws) => ctx.pmGet('/api/stage-signoffs' + (ws ? '?ws=' + encodeURIComponent(ws) : '')).catch(() => null)));
|
|
69
|
+
const rows = [], suggest = [];
|
|
70
|
+
got.forEach((r, i) => { if (!r || !r.ok) return; const ws = r.ws || L[i]; for (const x of r.rows || []) rows.push({ ...x, ws }); for (const g of r.suggest || []) suggest.push({ ...g, ws }); });
|
|
71
|
+
console.info('[stage-signoffs] products=' + L.length + ' rows=' + rows.length + ' suggest=' + suggest.length);
|
|
72
|
+
const next = JSON.stringify([rows, suggest]);
|
|
73
|
+
if (next === (X.soSeen || '[[],[]]')) return; // nothing new, and none at all: no redraw
|
|
74
|
+
X.soSeen = next; X.signoffs = rows; X.signoffSuggest = suggest;
|
|
75
|
+
draw();
|
|
76
|
+
}
|
|
77
|
+
/** ✓ on a sign-off row: recorded with its source; when it was the stage's last missing item the stage moves in the same press. One Undo. */
|
|
78
|
+
async function signoffRecord(r) {
|
|
79
|
+
const s = r.ref || {};
|
|
80
|
+
const res = await ctx.pmPost('/api/stage-signoffs/record', { ws: s.ws || undefined, ini: s.ini, id: s.id }).catch(() => null);
|
|
81
|
+
if (!res || !res.ok) return ctx.toast((res && res.error) || 'It did not go through. Nothing changed.');
|
|
82
|
+
const said = res.moved ? `Recorded ${s.who}’s yes. ${r.work || s.title} moved to ${res.moved.toName}.` : `Recorded ${s.who}’s yes on ${s.item}.`;
|
|
83
|
+
ctx.toastUndo(said, async () => { const u = await ctx.pmPost('/api/stage-signoffs/undo', { ws: s.ws || undefined, ...res.undo }).catch(() => null); await readSignoffs(); ctx.reload && ctx.reload(); return u || { ok: false }; });
|
|
84
|
+
await readSignoffs();
|
|
85
|
+
if (res.moved && ctx.reload) ctx.reload();
|
|
86
|
+
return after(true);
|
|
87
|
+
}
|
|
88
|
+
/** A sign-off whose source did not pass: it opens, so the PM reads it. A file opens in the Viewer; a ticket opens its initiative. */
|
|
89
|
+
function signoffOpen(r) {
|
|
90
|
+
const s = r.ref || {};
|
|
91
|
+
if (s.ref && !/^[A-Z][A-Z0-9_]{0,19}-\d{1,7}$/.test(s.ref) && ctx.openFile) { ctx.openFile({ path: s.ref.replace(/[#:]\d+(-\d+)?$/, ''), name: s.ref.split('/').pop() }); return; }
|
|
92
|
+
if (s.ini && ctx.hasIni(s.ini)) ctx.goIni(s.ini);
|
|
93
|
+
}
|
|
94
|
+
/** A sign-off with no source: PMOS's drafted question goes to the outbox as a tracker comment. It is sent from there, never from here. */
|
|
95
|
+
async function signoffAsk(r) {
|
|
96
|
+
const s = r.ref || {};
|
|
97
|
+
const res = await ctx.pmPost('/api/outbox/draft', { channel: 'jira-write', recipient: s.recipient || s.ini, body: s.draft || r.title }).catch(() => null);
|
|
98
|
+
if (!res || !res.ok) return ctx.toast((res && res.error) || 'The question was not drafted. Nothing changed.');
|
|
99
|
+
const id = res.entry && res.entry.id;
|
|
100
|
+
ctx.toastUndo('The question is in Today’s batch, ready to send to ' + s.who + '. Nothing is sent yet.', async () => { const u = id ? await ctx.pmPost('/api/outbox/discard', { id }).catch(() => null) : null; ctx.reload && ctx.reload(); return u || { ok: false }; });
|
|
101
|
+
if (ctx.reload) ctx.reload();
|
|
102
|
+
return after(true);
|
|
103
|
+
}
|
|
104
|
+
/** Keep or Change on PMOS's suggested sign-off lines (board LnBy4). Keep makes them sign-offs; Change opens the workflows to edit them. */
|
|
105
|
+
async function signoffSuggest(r, keep) {
|
|
106
|
+
const g = r.ref || {};
|
|
107
|
+
const res = await ctx.pmPost('/api/stage-signoffs/suggest', { ws: g.ws || undefined, wf: g.wf, stage: g.stage, act: keep ? 'keep' : 'change', ...(keep ? { by: g.by } : {}) }).catch(() => null);
|
|
108
|
+
if (!res || !res.ok) return ctx.toast((res && res.error) || 'It did not go through. Nothing changed.');
|
|
109
|
+
const undo = async () => { const u = await ctx.pmPost('/api/stage-signoffs/suggest', { ws: g.ws || undefined, wf: g.wf, stage: g.stage, act: 'undo' }).catch(() => null); await readSignoffs(); return u || { ok: false }; };
|
|
110
|
+
ctx.toastUndo(keep ? 'Kept. ' + Object.keys(g.by).join(', ') + ' are sign-offs now; PMOS asks for them on Today.' : 'PMOS will not suggest them again. Edit the sign-offs in Settings › Workflows.', undo);
|
|
111
|
+
if (!keep) import('./cozy-settings.js').then((M) => M.openSettings('workflows', { wf: g.wf })).catch(() => {}); // Settings › Workflows, in place
|
|
112
|
+
await readSignoffs();
|
|
113
|
+
return after(true);
|
|
114
|
+
}
|
|
62
115
|
/* tracker-sync-on-today (board TrackerSyncDesk): each product's sync with its tracker (GET /api/tracker-sync). Only a product below 95%
|
|
63
116
|
* gets a ✦ row (TM.syncSuggest); ✕ hides it until its number changes (kept in this browser). */
|
|
64
117
|
const SYNC_NO = 'pmos.today.syncNo';
|
|
@@ -152,6 +205,7 @@ export function mountToday(ctx) {
|
|
|
152
205
|
const lab = (S.lab || []).flatMap((l) => (l.items || []).map((f) => ({ ...f, ws: l.ws, board: l.board })));
|
|
153
206
|
const L = TM.logModel({ rank: ctx.rank(), move, items: tdItems(), drafts, review: R && R.open && !R.done ? { title: 'Your weekly review' } : null,
|
|
154
207
|
own: X.log.entries, marks: X.log.marks, lab, questions: X.questions || [], titleOf: ctx.titleOf, productOf, now, fixed: X.log.fixed || {},
|
|
208
|
+
signoffs: X.signoffs || [], signoffSuggest: X.signoffSuggest || [],
|
|
155
209
|
// your-move (A468): an initiative's ship date is its board end date; a line with no default on work that ships soon blocks it
|
|
156
210
|
shipOf: (id) => { const r = byId.get('i:' + id); return (r && r.board && r.board.end) || ''; } });
|
|
157
211
|
if (L.move.length !== X.ymN) { X.ymN = L.move.length; console.info('[your-move] rows=' + L.move.length + ' shown=' + L.first.length + (L.move[0] ? ' first-tier=' + L.move[0].tier : '')); }
|
|
@@ -297,6 +351,8 @@ export function mountToday(ctx) {
|
|
|
297
351
|
if (r.src === 'move') { if (ref.kind === 'task' && r.ini && ctx.hasIni(r.ini)) { ctx.goIni(r.ini, { task: (ref.task && ref.task.uid) || null }); return; } pop(r); ctx.select(r.key); if (ref.kind === 'session') chatPop(); return; }
|
|
298
352
|
if (r.src === 'item') { if (r.ini && ctx.hasIni(r.ini)) { ctx.goIni(r.ini); return; } pop(r); import('./home-work.js').then((M) => M.openWorkItem(ref.key)).catch(() => {}); return; }
|
|
299
353
|
if (r.src === 'question') { openQuestion(ref); return; }
|
|
354
|
+
if (r.src === 'signoff') { if (ref.ini && ctx.hasIni(ref.ini)) ctx.goIni(ref.ini); return; }
|
|
355
|
+
if (r.src === 'signoff-by') { if (ref.ini && ctx.hasIni(ref.ini)) ctx.goIni(ref.ini); return; }
|
|
300
356
|
if (r.src === 'draft') { pop(r); ctx.openFinished(ref.fin); return; }
|
|
301
357
|
if (r.src === 'review') { pop(r); ctx.openReviewVw(); return; }
|
|
302
358
|
if (r.src === 'lab') { pop(r); ctx.openLab(ref); }
|
|
@@ -597,9 +653,10 @@ export function mountToday(ctx) {
|
|
|
597
653
|
}
|
|
598
654
|
if (act === 'open' && key === 'digest') { openDigest(); return; }
|
|
599
655
|
const r = rowOf(key); if (!r) return;
|
|
600
|
-
if (r.tier != null && (act === 'open' || act === 'done' || act === 'tomorrow')) noteUse('ym-act'); // your-move's health number
|
|
656
|
+
if (r.tier != null && (act === 'open' || act === 'done' || act === 'tomorrow' || /^(so|sb)-/.test(act))) noteUse('ym-act'); // your-move's health number
|
|
601
657
|
if (act === 'q-remind') { remindQuestion(r.ref); return; }
|
|
602
658
|
if (act === 'open') { open(r); return; }
|
|
659
|
+
if (act === 'so-open') { signoffOpen(r); return; }
|
|
603
660
|
if (act === 'date') { chooseDate(r, b); return; }
|
|
604
661
|
if (act === 'file') { chooseFile(r, b); return; } // capture-to-initiative: the filed chip's change
|
|
605
662
|
if (X.busy.has(key)) return;
|
|
@@ -611,6 +668,9 @@ export function mountToday(ctx) {
|
|
|
611
668
|
else if (act === 'keep') await keep(r);
|
|
612
669
|
else if (act === 'plain') await plain(r);
|
|
613
670
|
else if (act === 'lab-keep' || act === 'lab-drop') await lab(r, act === 'lab-keep');
|
|
671
|
+
else if (act === 'so-record') await signoffRecord(r);
|
|
672
|
+
else if (act === 'so-ask') await signoffAsk(r);
|
|
673
|
+
else if (act === 'sb-keep' || act === 'sb-change') await signoffSuggest(r, act === 'sb-keep');
|
|
614
674
|
else if (act === 'lk-yes' || act === 'lk-no') await looks(r, act === 'lk-yes');
|
|
615
675
|
else if (act === 'same-yes' || act === 'same-no') await same(r, act === 'same-yes');
|
|
616
676
|
} finally { X.busy.delete(key); if (b.isConnected) b.disabled = false; }
|
|
@@ -143,7 +143,7 @@ function typeOf(r) {
|
|
|
143
143
|
const ref = r.ref || {};
|
|
144
144
|
if (r.bullet === 'note' || r.src === 'note') return 'Note';
|
|
145
145
|
if (r.src === 'draft') return 'Report';
|
|
146
|
-
if (r.src === 'lab' || r.src === 'question') return 'Decision';
|
|
146
|
+
if (r.src === 'lab' || r.src === 'question' || r.src === 'signoff' || r.src === 'signoff-by') return 'Decision';
|
|
147
147
|
if (r.src !== 'ask') return 'Task';
|
|
148
148
|
switch (ref.kind) {
|
|
149
149
|
case 'mention': return 'Ask';
|
|
@@ -160,7 +160,8 @@ function typeOf(r) {
|
|
|
160
160
|
* drafts: [{ id, title, ini? }], review: { title } | null, own: today-log entries, marks: today-log marks, lab: [{ ws, board, id, title, why }],
|
|
161
161
|
* questions: GET /api/open-questions lines, each with its ws (open-questions-today), titleOf(ini) → the initiative's name,
|
|
162
162
|
* shipOf(ini) → its ship date 'YYYY-MM-DD' or '' (Your move: a line with no default on work that ships soon blocks it), now,
|
|
163
|
-
* fixed: GET /api/today-log fixed ({ [ws]: keys }, quiet-rows: the line rows Your move shows today per product)
|
|
163
|
+
* fixed: GET /api/today-log fixed ({ [ws]: keys }, quiet-rows: the line rows Your move shows today per product),
|
|
164
|
+
* signoffs: GET /api/stage-signoffs rows, each with its ws; signoffSuggest: its suggest list (factory-signoffs-reach-you) }
|
|
164
165
|
* quiet-rows: the drafts in the outbox are one row, Today's batch (pm/quiet-rows.js batchRow); Your move keeps at most 3 line rows a day per
|
|
165
166
|
* product (capLine), the rest wait under Later (`held`), and `toFix` is what the page writes once to the day ledger.
|
|
166
167
|
* A row: { key, src, bullet, first, title, work, ini, ws, job, when, late, carried, done, dates: 'task' | 'item' | 'mark', drop, ref }
|
|
@@ -257,6 +258,20 @@ export function logModel(o = {}) {
|
|
|
257
258
|
// your-move (A468): every line waiting on the PM is one Decide row, so Your move can rank it; its age and its default ride along
|
|
258
259
|
for (const q of Q.mine) put({ key: q.key, src: 'question', bullet: 'task', title: q.title, ini: iniOnly(q.ini), ws: q.ws, work: q.meta, job: 'Decide', carried: 0, late: false, when: '', reason: q.under,
|
|
259
260
|
age: q.age || 0, due: q.due || '', hasDefault: !!(q.line && q.line.default), ref: q });
|
|
261
|
+
// factory-signoffs-reach-you (board LnYou4): one Decide row per open sign-off a workflow stage waits on, with who gives it and where, and
|
|
262
|
+
// one ✦ row per stage whose sign-off lines PMOS suggests (board LnBy4); both wait on the PM, so Your move ranks them
|
|
263
|
+
for (const s of o.signoffs || []) {
|
|
264
|
+
if (!s || !s.key) continue;
|
|
265
|
+
const age = s.asked ? Math.max(0, between(s.asked, today) || 0) : 0;
|
|
266
|
+
put({ key: s.key, src: 'signoff', bullet: 'task', title: s.who + ' signs off: ' + s.item, ini: iniOnly(s.ini), ws: s.ws || '', work: work(s.ini, s.title), job: 'Decide',
|
|
267
|
+
carried: 0, late: false, when: '', reason: s.stage && s.stage.name ? s.stage.name + ' waits on it' : '', age, ref: s });
|
|
268
|
+
}
|
|
269
|
+
for (const g of o.signoffSuggest || []) {
|
|
270
|
+
if (!g || !g.key || !g.by) continue;
|
|
271
|
+
const items = Object.keys(g.by);
|
|
272
|
+
put({ key: g.key, src: 'signoff-by', bullet: 'task', title: 'Sign-offs for ' + (g.stageName || g.stage) + ': ' + items.join(', '), ini: null, ws: g.ws || '', work: '', job: 'Decide',
|
|
273
|
+
carried: 0, late: false, when: '', reason: 'PMOS suggests ' + (items.length === 1 ? 'it is' : 'they are') + ' a person’s yes, by ' + [...new Set(Object.values(g.by))].join(', '), age: 0, ref: g });
|
|
274
|
+
}
|
|
260
275
|
oneLine(out);
|
|
261
276
|
// a row done today whose source has let it go keeps its × from what it said when it was done
|
|
262
277
|
for (const [k, m] of Object.entries(marks)) {
|
|
@@ -433,10 +448,10 @@ export function costOf(r, today, shipOf = () => '') {
|
|
|
433
448
|
if (r.type === 'Ask' && !(r.who && r.who.length)) return null; // nobody waits on the answer
|
|
434
449
|
if (r.src === 'batch') return [2, r.left == null ? QR.LAPSE_DAYS : r.left, r.why]; // quiet-rows: Today's batch, a send today, soonest lapse first
|
|
435
450
|
const ref = r.ref || {}, c = ref.call || null, ld = lateDays(r, today);
|
|
436
|
-
const waits = r.src === 'ask' || r.src === 'question' || r.src === 'draft' || r.src === 'review' || (r.src === 'own' && r.first) || ld > 0;
|
|
451
|
+
const waits = r.src === 'ask' || r.src === 'question' || r.src === 'signoff' || r.src === 'signoff-by' || r.src === 'draft' || r.src === 'review' || (r.src === 'own' && r.first) || ld > 0;
|
|
437
452
|
if (!waits) return null;
|
|
438
453
|
if (r.src === 'own' && r.first) return [0, 0, 'You marked it first'];
|
|
439
|
-
const age = r.src === 'question' ? r.age || 0 : r.carried || 0;
|
|
454
|
+
const age = r.src === 'question' || r.src === 'signoff' ? r.age || 0 : r.carried || 0;
|
|
440
455
|
const ship = r.ini ? String(shipOf(r.ini) || '') : '', sd = ship ? between(today, ship) : null;
|
|
441
456
|
const dflt = r.src === 'question' && r.hasDefault && r.due ? r.due : '';
|
|
442
457
|
if (sd != null && sd >= 0 && sd <= SHIP_SOON && !dflt) return [1, sd, shipWhy(ship, today) + (r.src === 'question' ? '; no safe default' : '')];
|
|
@@ -446,6 +461,7 @@ export function costOf(r, today, shipOf = () => '') {
|
|
|
446
461
|
if (r.type === 'Ask' && r.carried >= 1) return [3, -r.carried, names(r.who) + ' ' + (r.who.length > 1 ? 'wait' : 'waits') + ' on you ' + plural(r.carried, 'day', 'days')];
|
|
447
462
|
if (c && c.kind === 'session' && (c.state === 'blocked' || c.state === 'needs')) return [3, 0, 'A session waits on you; its work stops until you answer'];
|
|
448
463
|
if (r.src === 'question') return [4, -age, r.reason || 'Waits on you ' + plural(age, 'day', 'days')];
|
|
464
|
+
if (r.src === 'signoff' || r.src === 'signoff-by') return [4, -age, r.reason || 'Waits on you'];
|
|
449
465
|
const w = whyOf(r, today);
|
|
450
466
|
return [4, -age, w && !/^Waits on you$/.test(w) ? w : age ? 'Waits on you ' + plural(age, 'day', 'days') : 'Waits on you'];
|
|
451
467
|
}
|
|
@@ -34,6 +34,7 @@ export const I = {
|
|
|
34
34
|
reply: 'M5 5h14v10H9l-4 4z', decide: 'M12 4l8 8-8 8-8-8z', send: 'M4 12l16-8-6 16-3-7z',
|
|
35
35
|
spark: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z',
|
|
36
36
|
undo: 'M9 14L4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3',
|
|
37
|
+
open: 'M14 4h6v6M20 4l-9 9M18 14v5H5V6h5',
|
|
37
38
|
sun: 'M12 3v2M12 19v2M5 5l1.4 1.4M17.6 17.6L19 19M3 12h2M19 12h2M5 19l1.4-1.4M17.6 6.4L19 5M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8z',
|
|
38
39
|
};
|
|
39
40
|
/** The small sign of each type (one stroke icon). */
|
|
@@ -67,6 +68,16 @@ export function whyLine(r) {
|
|
|
67
68
|
/** The first action of a row, by its job: Done for a thing to do, else the item opens where the PM replies, decides or sends. */
|
|
68
69
|
const JOB_ACT = { Reply: ['open', 'Reply', I.reply], Decide: ['open', 'Decide', I.decide], Send: ['open', 'Send', I.send] };
|
|
69
70
|
|
|
71
|
+
/** factory-signoffs-reach-you (boards LnYou4, LnBy4): the one action of a sign-off row, and Keep or Change on PMOS's suggestion. A sign-off is
|
|
72
|
+
* recorded (✓) only when its source passed the check; otherwise the row opens the source, or drafts the question for the tracker. */
|
|
73
|
+
export function signoffActs(r) {
|
|
74
|
+
const t = r.title, s = r.ref || {};
|
|
75
|
+
if (r.src === 'signoff-by') return ib('sb-keep', 'Keep: ' + t, I.yes, r.key) + ib('sb-change', 'Change them in the workflow: ' + t, I.no, r.key);
|
|
76
|
+
if (s.action === 'record') return ib('so-record', 'Record the sign-off: ' + t + '. Source: ' + (s.ref || ''), I.yes, r.key);
|
|
77
|
+
if (s.action === 'open') return ib('so-open', 'Check the source first: ' + (s.ref || '') + '. ' + (s.why || ''), I.open, r.key);
|
|
78
|
+
return ib('so-ask', 'Ask in the tracker: ' + (s.draft || t), I.send, r.key);
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
/** One row of the log: a ListRow (pm-li). o.lit: the lit first row of a group; o.sopen: its members are listed. */
|
|
71
82
|
export function rowHtml(r, o = {}) {
|
|
72
83
|
const [kd, kl] = kindOf(r);
|
|
@@ -74,6 +85,7 @@ export function rowHtml(r, o = {}) {
|
|
|
74
85
|
let acts = '';
|
|
75
86
|
if (!r.done && r.src !== 'note') {
|
|
76
87
|
if (r.src === 'question') acts = ib('open', 'Answer: ' + t, I.decide, r.key); // the register's line: it is answered where it opens, not marked done here
|
|
88
|
+
else if (r.src === 'signoff' || r.src === 'signoff-by') acts = signoffActs(r);
|
|
77
89
|
else if (r.src === 'lab') acts = ib('lab-keep', 'Keep it: start an initiative from ' + t, I.yes, r.key) + ib('lab-drop', 'Drop it: ' + t, I.no, r.key);
|
|
78
90
|
else {
|
|
79
91
|
const j = JOB_ACT[r.job];
|
|
@@ -159,11 +171,12 @@ export function overviewHtml(O) {
|
|
|
159
171
|
* work, the kind, the age), the ✦ line that says why it is in that place, and two icon Buttons: one action for its kind, and Put off a day. */
|
|
160
172
|
export const YM_SHOW = 5;
|
|
161
173
|
const KIND_WORD = { Ask: 'reply', Decision: 'a decision', Check: 'a check', Milestone: 'a date change', Task: 'task', Report: 'a draft to send' };
|
|
162
|
-
const ageOf = (r) => Math.max(0, r.src === 'question' ? r.age || 0 : r.carried || 0);
|
|
174
|
+
const ageOf = (r) => Math.max(0, r.src === 'question' || r.src === 'signoff' ? r.age || 0 : r.carried || 0);
|
|
163
175
|
/** The one action of a Your move row: an answer, a reply, a decision or a send opens the item; a thing to do is Done. */
|
|
164
176
|
function moveAct(r) {
|
|
165
177
|
const t = r.title;
|
|
166
178
|
if (r.src === 'question') return ib('open', 'Answer: ' + t, I.decide, r.key);
|
|
179
|
+
if (r.src === 'signoff' || r.src === 'signoff-by') return signoffActs(r);
|
|
167
180
|
const j = JOB_ACT[r.job];
|
|
168
181
|
if (j) return ib('open', j[1] + ': ' + t, j[2], r.key);
|
|
169
182
|
if (r.members) return ib('open', 'Show them: ' + t, I.more, r.key, ` aria-expanded="false"`);
|
|
@@ -173,7 +186,7 @@ function moveAct(r) {
|
|
|
173
186
|
export function moveRowHtml(r, n, o = {}) {
|
|
174
187
|
const [kd, kl] = kindOf(r);
|
|
175
188
|
const late = lateOf(r), age = ageOf(r);
|
|
176
|
-
const meta = [r.work || '', r.src === 'question' || r.src === 'batch' ? '' : KIND_WORD[r.type] || '', !late && r.tier !== 3 && age ? plural(age, 'day', 'days') : ''].filter(Boolean).join(' · ');
|
|
189
|
+
const meta = [r.work || '', r.src === 'question' || r.src === 'batch' || r.src === 'signoff-by' ? '' : r.src === 'signoff' ? 'a sign-off' : KIND_WORD[r.type] || '', !late && r.tier !== 3 && age ? plural(age, 'day', 'days') : ''].filter(Boolean).join(' · ');
|
|
177
190
|
// what the PM typed opens nothing: its words are the whole of it
|
|
178
191
|
const title = r.src === 'own' ? `<span class="t td-t">${esc(r.title)}</span>`
|
|
179
192
|
: `<button type="button" class="t td-t" data-td="open" data-key="${esc(r.key)}"${r.members ? ` aria-expanded="${!!o.sopen}"` : ''}>${esc(r.title)}${r.members ? ic(I.more, 14) : ''}</button>`;
|
|
@@ -305,6 +318,8 @@ export function swipeActs(r) {
|
|
|
305
318
|
if (r.looks) return { right: 'lk-yes', left: 'lk-no' };
|
|
306
319
|
if (r.members && r.drafts) return { right: 'same-yes', left: 'same-no' };
|
|
307
320
|
// a Your move row (your-move): right does its action, so a reply, an answer, a decision or a send opens the item; left puts it off a day
|
|
321
|
+
if (r.src === 'signoff-by') return { right: 'sb-keep', left: 'tomorrow' };
|
|
322
|
+
if (r.src === 'signoff') { const a = (r.ref || {}).action; return { right: a === 'record' ? 'so-record' : a === 'open' ? 'so-open' : 'so-ask', left: 'tomorrow' }; }
|
|
308
323
|
if (r.tier != null && (r.src === 'question' || JOB_ACT[r.job] || r.members)) return { right: 'open', left: 'tomorrow' };
|
|
309
324
|
return { right: 'done', left: 'tomorrow' };
|
|
310
325
|
}
|
|
@@ -2452,7 +2452,7 @@ mountPanels({
|
|
|
2452
2452
|
if (TD_PAGE) TDY = mountToday({ S, VW, POP, pmGet, pmPost, toast, toastUndo, isPhone, now: NOW,
|
|
2453
2453
|
rank: () => { S.topRank = rankMove({ ...rankIn(), calls: YD.callsOf((S.M && S.M.move) || []), now: NOW() }); return S.topRank; },
|
|
2454
2454
|
rows: () => new Map(allRows().map((r) => [r.id, r])), titleOf: (id) => (iniRowOf(id) ? iniTitle(id) : String(id || '').replace(/[-_]+/g, ' ').replace(/^./, (c) => c.toUpperCase())), hasIni: (id) => !!(id && iniRowOf(id)), boardWs, boardId,
|
|
2455
|
-
goIni: (id, o) => goIni(id, o || {}), select: (id) => select(id),
|
|
2455
|
+
goIni: (id, o) => goIni(id, o || {}), select: (id) => select(id), openFile: (f) => openFile(f),
|
|
2456
2456
|
// a mention row opens that one mention (Today round 3), never the Mentions list
|
|
2457
2457
|
openMention: (id, o) => { const L = MEN.mentionsOf(S.D), m = [...L.waiting, ...L.toread, ...L.answered].find((x) => x.id === id) || (o && o.m); if (!m) return false; MEN.openOneMention(m, menCtx(), o || {}); return true; },
|
|
2458
2458
|
mentions: () => MEN.mentionsOf(S.D), mentionAct: (id, act) => pmPost('/api/mentions/act', { id, act }), reloadMentions: () => MEN.load(menCtx()).then(() => drawList()),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "factory-signoffs-reach-you (job #1861, Factory page slice A): a stage's sign-offs reach Today's Your move, ✓ records one and moves the stage, one Undo. An IDPF-shaped repository; no browser, no network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"stage-signoffs.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"stage-signoffs.test.js": 8
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Is each kind of AI run worth it (initiative worth-it-by-kind, done test K1-K5, N1, N2): the pure cost-beside-keep per kind, the flag, and pmos ai worth on a scratch state folder. No server, browser, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"worth-it.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"worth-it.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|