create-pmos 0.397.0 → 0.398.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 +13 -13
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +101 -52
- package/workspace/briefing-premium-board-test.js +252 -128
- package/workspace/briefing-premium-calendar-2-test.js +135 -198
- package/workspace/briefing-premium-calendar-3-test.js +143 -418
- package/workspace/briefing-premium-calendar-test.js +86 -196
- package/workspace/briefing-premium-doc-edit-test.js +95 -83
- package/workspace/briefing-premium-initiative-test.js +159 -296
- package/workspace/briefing-premium-insights-test.js +337 -219
- package/workspace/briefing-premium-metrics-test.js +53 -97
- package/workspace/briefing-premium-products-test.js +40 -27
- package/workspace/briefing-premium-sources-test.js +66 -48
- package/workspace/briefing-premium-test.js +150 -647
- package/workspace/briefing-premium-work-test.js +88 -283
- package/workspace/changelog.json +12 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +47 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-premium.js +85 -19
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +62 -14
- package/workspace/lib/insights-records.js +101 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/route-modules.js +4 -0
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-insights-premium.js +12 -3
- package/workspace/lib/routes-insights-records.js +129 -0
- package/workspace/lib/routes-notes.js +1 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/viewer-meeting.js +205 -0
- package/workspace/lib/viewer-report.js +89 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +85 -75
- package/workspace/premium-briefing-depth-test.js +66 -53
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +35 -37
- package/workspace/premium-chat-context-test.js +19 -18
- package/workspace/premium-chat-goal-view-test.js +23 -23
- package/workspace/premium-chat-notes-test.js +26 -31
- package/workspace/premium-chat-report-tab-test.js +32 -28
- package/workspace/premium-chat-term-test.js +16 -16
- package/workspace/premium-chat-viewer-test.js +60 -59
- package/workspace/premium-core-doc-issue-test.js +50 -43
- package/workspace/premium-html-viewer-test.js +14 -17
- package/workspace/premium-phone-card-test.js +7 -2
- package/workspace/premium-phone-room-test.js +41 -35
- package/workspace/premium-report-read-test.js +115 -197
- package/workspace/premium-viewer-download-test.js +19 -22
- package/workspace/premium-viewer-flicker-test.js +11 -16
- package/workspace/premium-viewer-share-test.js +6 -9
- package/workspace/premium-viewer-test.js +41 -60
- package/workspace/premium-vw-backlog-test.js +53 -33
- package/workspace/premium-vw-cal-test.js +82 -128
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +11 -10
- package/workspace/premium-vw-item-test.js +50 -49
- package/workspace/premium-vw-jira-test.js +53 -27
- package/workspace/premium-vw-meet-test.js +118 -187
- package/workspace/premium-vw-notes-test.js +85 -108
- package/workspace/premium-vw-rec-test.js +72 -194
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +61 -53
- package/workspace/public/pm/bd-acts.js +305 -0
- package/workspace/public/pm/bd-span.js +186 -82
- package/workspace/public/pm/bd-stages.js +25 -11
- package/workspace/public/pm/c3-doc-sheet.js +1 -1
- package/workspace/public/pm/c3-md.js +3 -395
- package/workspace/public/pm/c3-phone-detail.js +1 -1
- package/workspace/public/pm/c3-phone-model.js +3 -68
- package/workspace/public/pm/chat-term.js +3 -3
- package/workspace/public/pm/cozy-board.css +497 -230
- package/workspace/public/pm/cozy-home.css +570 -142
- package/workspace/public/pm/cozy-home.js +5 -3
- package/workspace/public/pm/cozy-insights.css +296 -167
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +17 -6
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-viewer.css +3 -3
- package/workspace/public/pm/cozy-viewer.js +144 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +83 -1
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +905 -0
- package/workspace/public/pm/home-around.js +515 -0
- package/workspace/public/pm/home-chat.js +459 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-more.js +249 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-work.js +519 -0
- package/workspace/public/pm/phone-moment.js +69 -0
- package/workspace/public/pm/pm-work-view.js +1 -1
- package/workspace/public/pm/premium-attach.js +4 -0
- package/workspace/public/pm/premium-board.js +423 -394
- package/workspace/public/pm/premium-chart-tab.js +110 -62
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +25 -21
- package/workspace/public/pm/premium-insights.js +792 -568
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-notes.js +1 -1
- package/workspace/public/pm/premium-report-frame.css +20 -0
- package/workspace/public/pm/premium-report-read.js +509 -480
- package/workspace/public/pm/premium-report-tab.js +87 -63
- package/workspace/public/pm/premium-shell.js +72 -119
- package/workspace/public/pm/premium-viewer.js +22 -1
- package/workspace/public/pm/premium-vw-cal.js +187 -48
- package/workspace/public/pm/premium-vw-doc.css +6 -0
- package/workspace/public/pm/premium-vw-doc.js +40 -2
- package/workspace/public/pm/premium-vw-file.js +2 -2
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +731 -0
- package/workspace/public/pm/premium-vw-notes.js +56 -69
- package/workspace/public/pm/premium-vw-open.js +35 -0
- package/workspace/public/pm/premium-vw-page.js +16 -0
- package/workspace/public/pm/premium-vw-rec.js +11 -218
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +28 -70
- package/workspace/public/premium-initiative.html +8 -48
- package/workspace/public/premium-insights.html +22 -60
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium.html +16 -107
- package/workspace/server.js +18 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/public/pm/premium-work.js +0 -729
- package/workspace/public/pm/premium.js +0 -1146
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/* pm/bd-acts.js — the Board's features the Agreed design has no frame for, kept working as plain, minimal versions in the cozy style
|
|
2
|
+
* (initiative premium-agreed-design; PM instruction 2026-10-22: "do not drop their function"). Each one carries a small "Waiting for design" tag,
|
|
3
|
+
* opens in the Board's side panel (never the old dialog) and presses the same routes the console uses, behind the launch nonce:
|
|
4
|
+
* New initiative POST /api/boards/asks/add { board, line, source } then /asks/accept { board, ask, title, lane, anchor }; anchors from GET /api/boards/anchors
|
|
5
|
+
* New asks POST /api/boards/asks/accept (the form above, from the intake draft) · /asks/decline { board, ask, why }
|
|
6
|
+
* a row's actions POST /api/boards/move { board, id, to } · /api/lifecycle { initiative_id, state, reason, back? } · /api/boards/archive { board, id, archived, reason? },
|
|
7
|
+
* each with Undo, which writes the opposite line through the same route
|
|
8
|
+
* Cancelled, archived the board's own lists, with Reopen and Restore
|
|
9
|
+
* Documents the board's core documents with their state; Draft it posts POST /api/core-docs/draft { scope, key }
|
|
10
|
+
* Sprint and release the sprint and the release as the Jira reading and the release record hold them
|
|
11
|
+
* Metrics GET /api/board-metrics-premium (read-only)
|
|
12
|
+
* Notifications the toolbar's bell: the rows where something waits on you, and the new asks
|
|
13
|
+
* Find, Filter the rows on screen by title, owner and lane (the page's own filter state)
|
|
14
|
+
* List, By stage the rows as a list and as one column per stage
|
|
15
|
+
* Nothing here invents a value: what a record does not hold is not drawn. */
|
|
16
|
+
import { pmPost } from './http.js';
|
|
17
|
+
import { $, $$, esc } from './premium-shell.js';
|
|
18
|
+
|
|
19
|
+
export const WTAG = '<span class="bd-wtag" title="This part has no Agreed design yet. It works as a plain version until it has one.">Waiting for design</span>';
|
|
20
|
+
const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
21
|
+
const X = 'M6 6l12 12M18 6L6 18';
|
|
22
|
+
const LANES = [['feature', 'Feature'], ['discovery', 'Discovery'], ['chore', 'Chore'], ['incident', 'Incident'], ['content', 'Content'], ['prototype', 'Prototype']];
|
|
23
|
+
const BACK = [['two', 'In 2 weeks', 14], ['month', 'In a month', 30], ['quarter', 'Next quarter', 80], ['none', 'No date', null]];
|
|
24
|
+
const WHY = ['No longer needed', 'Replaced by another initiative', 'Not worth it now', 'Hit a kill condition', 'Other'];
|
|
25
|
+
const AWHY = ['Not related to this board', 'Old idea, never started', 'Duplicate', 'Other'];
|
|
26
|
+
const dayIso = (n) => { const t = new Date(Date.now() + n * 86400000); return t.getFullYear() + '-' + String(t.getMonth() + 1).padStart(2, '0') + '-' + String(t.getDate()).padStart(2, '0'); };
|
|
27
|
+
|
|
28
|
+
let A = null; // the page: { M(), load(), say(msg, undo?), panel(html, from), close(), redraw(), F, rowOf(key), statusOf(r), openIni(r) }
|
|
29
|
+
export function init(api) { A = api; }
|
|
30
|
+
const M = () => A.M();
|
|
31
|
+
const post = (p, body) => pmPost(p, { ws: M().board.ws, ...body });
|
|
32
|
+
const errOf = (r) => (r && r.error) || 'Nothing was recorded. The server did not say why.';
|
|
33
|
+
|
|
34
|
+
/** A side panel of this module: its title, the tag, a close button and the body. */
|
|
35
|
+
function panel(title, body, from, eye = 'Board') {
|
|
36
|
+
A.panel(`<div class="pk-h"><div class="pk-ht"><p class="pk-eye">${esc(eye)} ${WTAG}</p><h2 id="pkTitle">${esc(title)}</h2></div><div class="pk-tools"><button type="button" class="bd-ib" data-pk="close" aria-label="Close" title="Close">${SV(X)}</button></div></div><div class="pk-b bd-pl">${body}</div>`, from);
|
|
37
|
+
}
|
|
38
|
+
const msg = (id) => `<p class="bd-amsg" id="${id}" role="status"></p>`;
|
|
39
|
+
async function press(btn, m, fn) {
|
|
40
|
+
btn.disabled = true; if (m) m.textContent = '';
|
|
41
|
+
const r = await fn().catch(() => null);
|
|
42
|
+
if (r && r.ok === true) return r;
|
|
43
|
+
btn.disabled = false; if (m) m.textContent = errOf(r); return null;
|
|
44
|
+
}
|
|
45
|
+
async function done(r, text, undo) { A.close(); A.say(text, undo); await A.load(); return r; }
|
|
46
|
+
const tagHead = (text) => `<p class="bd-whead">${WTAG}<span>${esc(text)}</span></p>`;
|
|
47
|
+
|
|
48
|
+
/* ── List and By stage ─────────────────────────────────────────────────────────────────────────────────────────── */
|
|
49
|
+
export function listHtml(L) {
|
|
50
|
+
if (!L.length) return tagHead('The list of initiatives') + '<p class="bd-amut">No initiative matches.</p>';
|
|
51
|
+
const row = (r) => { const s = A.statusOf(r); return `<button type="button" class="bd-lr ini2" data-key="${esc(r.key)}"><span class="t"><b>${esc(r.title)}</b><small>${esc([r.owner || 'No owner', r.lane].filter(Boolean).join(' · '))}</small></span><span class="st">${esc((r.track && r.track.label) || r.stage || '')}</span><span class="cs s-${s.tone}"><i class="cz-dot ${s.tone}"></i>${esc(s.text)}</span><span class="fin${r.over ? ' over' : ''}">${esc(r.finish || 'Not planned')}</span></button>`; };
|
|
52
|
+
return tagHead('The list of initiatives, in the board\'s order') + `<div class="bd-rows" role="list">${L.map(row).join('')}</div>` + goneLink();
|
|
53
|
+
}
|
|
54
|
+
export function stagesHtml(L) {
|
|
55
|
+
const S = M().steps || [];
|
|
56
|
+
const col = (s, j) => { const rs = L.filter((r) => r.track && r.track.k === j); return `<section class="bd-col" aria-label="${esc(s.label)}"><h3>${s.ms ? '<i class="cz-ms" aria-hidden="true"></i>' : ''}${esc(s.label)} <span>${s.count}</span></h3>${rs.map((r) => { const st = A.statusOf(r); return `<button type="button" class="bd-card ini2" data-key="${esc(r.key)}"><b>${esc(r.title)}</b><span class="cs s-${st.tone}"><i class="cz-dot ${st.tone}"></i>${esc(st.text)}</span></button>`; }).join('') || '<p class="bd-amut">None loaded</p>'}</section>`; };
|
|
57
|
+
return tagHead('One column per stage of the board') + `<div class="bd-cols">${S.map(col).join('')}</div>`;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* ── Cancelled and archived ────────────────────────────────────────────────────────────────────────────────────── */
|
|
61
|
+
export function goneLink() {
|
|
62
|
+
const G = M().initiatives.gone || { cancelled: [], archived: [] }, nc = G.cancelled.length, na = G.archived.length;
|
|
63
|
+
if (!nc && !na) return '';
|
|
64
|
+
return `<p class="bd-gone"><button type="button" class="dlink" data-act="gone">${[nc ? nc + ' cancelled' : '', na ? na + ' archived' : ''].filter(Boolean).join(' · ')}</button></p>`;
|
|
65
|
+
}
|
|
66
|
+
function openGone(from) {
|
|
67
|
+
const G = M().initiatives.gone || { cancelled: [], archived: [] };
|
|
68
|
+
const row = (r, k) => `<div class="bd-ar"><span class="t"><b>${esc(r.title)}</b><small>${esc(k === 'archived' ? (r.acts && r.acts.archived && (r.acts.archived.into ? 'Merged into ' + (r.acts.archived.intoTitle || r.acts.archived.into) : r.acts.archived.reason)) || 'Archived' : (r.acts && r.acts.reason) || 'Cancelled')}</small></span><button type="button" class="bd-btn" data-act="${k === 'archived' ? 'restore' : 'reopen'}" data-id="${esc(r.key)}">${k === 'archived' ? 'Restore' : 'Reopen'}</button></div>`;
|
|
69
|
+
panel('Cancelled and archived', (G.cancelled.length ? `<p class="bd-albl">Cancelled</p>${G.cancelled.map((r) => row(r, 'cancelled')).join('')}` : '') + (G.archived.length ? `<p class="bd-albl">Archived</p>${G.archived.map((r) => row(r, 'archived')).join('')}` : '') + (!G.cancelled.length && !G.archived.length ? '<p class="bd-amut">No initiative of this board is cancelled or archived.</p>' : '') + msg('goneM'), from);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* ── a row's actions: move, hold, resume, cancel, reopen, archive, restore, each with Undo ─────────────────────────── */
|
|
73
|
+
const life = (id, state, reason, back) => post('/api/lifecycle', { initiative_id: id, state, reason: reason || '', ...(back ? { back } : {}) });
|
|
74
|
+
const arch = (id, archived, reason) => post('/api/boards/archive', { board: M().board.id, id, archived, ...(reason ? { reason } : {}) });
|
|
75
|
+
const move = (id, to) => post('/api/boards/move', { board: M().board.id, id, to });
|
|
76
|
+
const prevOf = (r) => ({ life: r.acts.life, reason: r.acts.reason, backDay: r.acts.backDay || null });
|
|
77
|
+
const lifeBack = (r, p) => (p.life === 'hold' ? life(r.id, 'on-hold', p.reason, p.backDay) : p.life === 'cancelled' ? life(r.id, 'cancelled', p.reason) : life(r.id, 'active', 'undo'));
|
|
78
|
+
function itemsOf(r) {
|
|
79
|
+
const a = r.acts || { stages: [], stage: '' }, cur = a.stages.indexOf(a.stage), out = [];
|
|
80
|
+
if (a.archived) return [['restore', 'Restore', 'Back in the lists, as it was']];
|
|
81
|
+
if (a.life === 'cancelled') return [['reopen', 'Reopen', 'Back to ' + (a.stage || 'its stage') + ', active again']];
|
|
82
|
+
if (!M().board.self && !a.life && cur >= 0) {
|
|
83
|
+
if (a.stages[cur + 1]) out.push(['mv:' + (cur + 1), 'Move to ' + a.stages[cur + 1], 'The next stage of its workflow']);
|
|
84
|
+
if (cur > 0) out.push(['mv:' + (cur - 1), 'Back to ' + a.stages[cur - 1], 'The stage before']);
|
|
85
|
+
}
|
|
86
|
+
if (a.life === 'hold') out.push(['resume', 'Resume', 'Back to ' + (a.stage || 'its stage') + ', active again']);
|
|
87
|
+
else out.push(['hold', 'Put on hold', 'Pause it; keeps its stage and work']);
|
|
88
|
+
out.push(['cancel', 'Cancel', 'Stop it for good, with a reason'], ['archive', 'Archive', 'Out of every list; restore any time']);
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
function openRowActs(r, from) {
|
|
92
|
+
const self = M().board.self ? '<p class="bd-amut">The stage of a PMOS-self initiative comes from the repository. It moves when the files land.</p>' : '';
|
|
93
|
+
panel('Initiative actions', `<p class="bd-asub">${esc(r.title)}</p>${self}<div class="bd-alist">${itemsOf(r).map(([k, l, s]) => `<button type="button" class="bd-ai" data-act="row" data-k="${esc(k)}" data-id="${esc(r.key)}"><b>${esc(l)}</b><small>${esc(s)}</small></button>`).join('')}</div>${msg('rowM')}`, from, r.title);
|
|
94
|
+
}
|
|
95
|
+
async function runRow(r, k, btn) {
|
|
96
|
+
const a = r.acts, p = prevOf(r), m = $('#rowM');
|
|
97
|
+
if (k.startsWith('mv:')) {
|
|
98
|
+
const to = a.stages[+k.slice(3)], fromStage = a.stage; if (!to) return;
|
|
99
|
+
const res = await press(btn, m, () => move(r.id, to)); if (!res) return;
|
|
100
|
+
const w = Array.isArray(res.warnings) && res.warnings.length ? ' Warning: ' + res.warnings.join('; ') + '. Warnings never block.' : '';
|
|
101
|
+
await done(res, 'Moved to ' + to + '. Recorded as a move line in the board ledger.' + w, async () => { const u = await move(r.id, fromStage); A.say(u && u.ok ? 'Back in ' + fromStage + '.' : errOf(u)); await A.load(); });
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (k === 'hold') return formHold(r);
|
|
105
|
+
if (k === 'cancel') return formReason(r, 'cancel');
|
|
106
|
+
if (k === 'archive') return formReason(r, 'archive');
|
|
107
|
+
if (k === 'resume' || k === 'reopen') {
|
|
108
|
+
const res = await press(btn, m, () => life(r.id, 'active', k === 'resume' ? 'resumed' : 'reopened')); if (!res) return;
|
|
109
|
+
await done(res, r.title + ' is active again. Recorded as a lifecycle line.', async () => { const u = await lifeBack(r, p); A.say(u && u.ok ? 'Undone.' : errOf(u)); await A.load(); });
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (k === 'restore') {
|
|
113
|
+
const res = await press(btn, m, () => arch(r.id, false)); if (!res) return;
|
|
114
|
+
await done(res, r.title + ' is restored. Recorded in the board ledger.', async () => { const u = await arch(r.id, true, a.archived && a.archived.reason); A.say(u && u.ok ? r.title + ' is archived again.' : errOf(u)); await A.load(); });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const radios = (name, L, cur) => `<div class="bd-rad" role="radiogroup">${L.map(([v, l]) => `<label><input type="radio" name="${name}" value="${esc(v)}"${v === cur ? ' checked' : ''}><span>${esc(l)}</span></label>`).join('')}</div>`;
|
|
118
|
+
function formHold(r) {
|
|
119
|
+
panel('Put on hold', `<p class="bd-asub">${esc(r.title)}</p><form class="bd-form" data-form="hold" data-id="${esc(r.key)}"><label>Why it is paused <em>optional</em><textarea name="why" rows="2" maxlength="500"></textarea></label><p class="bd-albl">Check back</p>${radios('back', BACK.map((b) => [b[0], b[1]]), 'month')}<p class="bd-amut">Keeps its stage, its work and its history. Recorded as one on-hold line in lifecycle.jsonl; Undo writes the state it had before.</p>${msg('formM')}<div class="bd-arow"><button type="submit" class="bd-btn solid">Put on hold</button><button type="button" class="bd-btn" data-pk="close">Not now</button></div></form>`, null, r.title);
|
|
120
|
+
}
|
|
121
|
+
function formReason(r, kind) {
|
|
122
|
+
const L = kind === 'cancel' ? WHY : AWHY;
|
|
123
|
+
panel(kind === 'cancel' ? 'Cancel the initiative' : 'Archive the initiative', `<p class="bd-asub">${esc(r.title)}</p><form class="bd-form" data-form="${kind}" data-id="${esc(r.key)}"><p class="bd-albl">Why</p>${radios('why', L.map((w) => [w, w]), kind === 'archive' ? L[0] : '')}<label>Note <em>optional</em><textarea name="note" rows="2" maxlength="300"></textarea></label><p class="bd-amut">${kind === 'cancel' ? 'Keeps its stage, its work and its history. Reopen it any time. Recorded as one cancelled line in lifecycle.jsonl.' : 'It leaves every list and count of the board. Nothing is deleted. Recorded as one archive line in the board ledger.'}</p>${msg('formM')}<div class="bd-arow"><button type="submit" class="bd-btn solid">${kind === 'cancel' ? 'Cancel initiative' : 'Archive'}</button><button type="button" class="bd-btn" data-pk="close">Not now</button></div></form>`, null, r.title);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ── New initiative and New asks ──────────────────────────────────────────────────────────────────────────────── */
|
|
127
|
+
let anchors = null;
|
|
128
|
+
async function anchorsOf() {
|
|
129
|
+
const b = M().board, key = b.ws + '/' + b.id;
|
|
130
|
+
if (anchors && anchors.key === key) return anchors.list;
|
|
131
|
+
let r = null;
|
|
132
|
+
try { r = await (await fetch('/api/boards/anchors?ws=' + encodeURIComponent(b.ws || '') + '&board=' + encodeURIComponent(b.id || ''), { credentials: 'same-origin' })).json(); } catch { r = null; }
|
|
133
|
+
anchors = { key, list: r && r.ok && Array.isArray(r.anchors) ? r.anchors : null };
|
|
134
|
+
return anchors.list;
|
|
135
|
+
}
|
|
136
|
+
async function openNew(from, ask) {
|
|
137
|
+
const d = ask ? ask.draft || {} : { title: '', lane: 'feature', anchor: '' }, first = (M().board.stages || [])[0] || 'the first stage';
|
|
138
|
+
panel(ask ? 'Accept ask' : 'New initiative', `${ask ? `<p class="bd-quote">“${esc(ask.line)}”</p>` : ''}<form class="bd-form" data-form="new"${ask ? ` data-ask="${esc(ask.id)}"` : ''}><label>Title<input name="title" maxlength="120" value="${esc(d.title || '')}" placeholder="For example: Per-key API usage for partners"></label><label>Lane<select name="lane">${LANES.map(([v, l]) => `<option value="${v}"${v === (d.lane || 'feature') ? ' selected' : ''}>${l}</option>`).join('')}</select></label><label>Anchor<span id="anW"><select name="anchor" disabled><option>Reading the anchors</option></select></span></label><p class="bd-amut">Every initiative anchors to a KR or a declared health budget. Unanchored work is rejected. It lands in ${esc(first)}.</p>${msg('formM')}<div class="bd-arow"><button type="submit" class="bd-btn solid">${ask ? 'Accept into ' : 'Create in '}${esc(first)}</button><button type="button" class="bd-btn" data-pk="close">Not now</button></div></form>`, from);
|
|
139
|
+
const L = await anchorsOf(), w = $('#anW'); if (!w) return;
|
|
140
|
+
w.innerHTML = L && L.length ? `<select name="anchor"><option value="">Choose a KR or a health budget</option>${L.map((x) => `<option value="${esc(x.value)}"${x.value === d.anchor ? ' selected' : ''}>${esc(x.label || x.value)}</option>`).join('')}</select>`
|
|
141
|
+
: `<input name="anchor" maxlength="120" value="${esc(d.anchor || '')}" placeholder="A KR id or health:<budget>">`;
|
|
142
|
+
}
|
|
143
|
+
function openAsks(from) {
|
|
144
|
+
const A0 = M().asks;
|
|
145
|
+
if (M().board.self) { panel('New asks', '<p class="bd-amut">PMOS-self has no ask source. New work starts at the pmos-router skill.</p>', from); return; }
|
|
146
|
+
const L = (A0 && A0.rows) || [];
|
|
147
|
+
panel('New asks', A0 == null || A0.missing ? '<p class="bd-amut">The new asks could not be read, so none is shown.</p>' : L.length ? L.map((a) => `<div class="bd-ask"><p class="bd-quote">“${esc(a.line)}”</p><small>${esc([a.source, a.by, a.at].filter(Boolean).join(' · '))}</small><div class="bd-arow"><button type="button" class="bd-btn solid" data-act="accept" data-id="${esc(a.id)}">Accept</button><button type="button" class="bd-btn" data-act="decline" data-id="${esc(a.id)}">Decline</button></div></div>`).join('') : '<p class="bd-amut">No new ask waits for triage.</p>', from);
|
|
148
|
+
}
|
|
149
|
+
function openDecline(a) {
|
|
150
|
+
panel('Decline ask', `<p class="bd-quote">“${esc(a.line)}”</p><form class="bd-form" data-form="decline" data-ask="${esc(a.id)}"><label>Reason<textarea name="why" rows="3" maxlength="500" required></textarea></label><p class="bd-amut">The reason is kept with the ask in the board ledger.</p>${msg('formM')}<div class="bd-arow"><button type="submit" class="bd-btn solid">Decline</button><button type="button" class="bd-btn" data-pk="close">Not now</button></div></form>`, null);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* ── Sprint and release, Metrics ─────────────────────────────────────────────────────────────────────────────── */
|
|
154
|
+
function openSprint(from) {
|
|
155
|
+
const s = M().sprint || {}, R = M().release || {};
|
|
156
|
+
const sp = s.name ? `<div class="bd-kv"><span>Sprint</span><b>${esc(s.name)}</b><span>Dates</span><b>${esc([s.start, s.end].filter(Boolean).join(' – '))}</b>${s.cap ? `<span>Where</span><b>${esc(s.cap)}</b>` : ''}${s.goal ? `<span>Goal</span><b>${esc(s.goal)}</b>` : ''}${s.counts ? `<span>Tickets</span><b>${s.counts.done} done · ${s.counts.doing} doing · ${s.counts.todo} to do</b>` : ''}</div>` : '<p class="bd-amut">No sprint is on record. A Jira read writes one.</p>';
|
|
157
|
+
const rel = R.name ? `<div class="bd-kv"><span>Release</span><b>${esc(R.name)}</b><span>Date</span><b>${esc(R.at || '')}${R.away ? ' · ' + esc(R.away) : ''}</b>${(R.ini || []).length ? `<span>Carries</span><b>${R.ini.map((x) => esc(x.title)).join(', ')}</b>` : ''}</div>` : '<p class="bd-amut">No release is on record.</p>';
|
|
158
|
+
panel('Sprint and release', `<p class="bd-albl">Sprint</p>${sp}<p class="bd-albl">Release</p>${rel}<p class="bd-amut">As the cached Jira reading and the release record hold them. Nothing here changes Jira.</p>`, from);
|
|
159
|
+
}
|
|
160
|
+
/** Metrics: the board's four measures (GET /api/board-metrics-premium), each with its value, its week, its change, its target where Insights set
|
|
161
|
+
* one, and a fold with its definition and its values by week. Targets and longer ranges live on Insights. Asks again while Blocked and Idle
|
|
162
|
+
* are still derived. */
|
|
163
|
+
async function openMetrics(from, again) {
|
|
164
|
+
if (!again) panel('Metrics', '<p class="bd-amut" id="metW">Reading the metrics…</p>', from);
|
|
165
|
+
let r = null;
|
|
166
|
+
try { r = await (await fetch('/api/board-metrics-premium?ws=' + encodeURIComponent(M().board.ws || ''), { credentials: 'same-origin' })).json(); } catch { r = null; }
|
|
167
|
+
const w = $('#metW'); if (!w) return; // the panel was closed
|
|
168
|
+
if (!r || !r.ok || !r.model) { w.textContent = 'The metrics could not be read, so none is shown.' + (r && r.error ? ' The reason: ' + r.error + '.' : ''); return; }
|
|
169
|
+
const m = r.model, ws = encodeURIComponent(M().board.ws || '');
|
|
170
|
+
const tile = (t) => {
|
|
171
|
+
const weeks = (t.wk || []).map((k, i) => `<span>${esc(k)}</span><b>${t.ser && t.ser[i] != null ? esc(String(t.ser[i])) : 'Not kept yet'}</b>`).join('');
|
|
172
|
+
return `<details class="bd-met${t.look || t.kind === 'warn' || t.kind === 'bad' ? ' look' : ''}" data-met="${esc(t.key)}"><summary><span>${esc(t.label)}</span><b>${esc(t.absent || t.value || '')}</b><small>${esc(t.absent ? t.why || '' : t.text || '')}</small>`
|
|
173
|
+
+ `${t.change && !t.absent ? `<small>${esc(t.change.txt)}</small>` : ''}${t.chip ? `<em class="bd-mchip${t.ok ? ' ok' : ''}">${esc(t.chip)}${t.targetTxt ? ' · ' + esc(t.targetTxt) : ''}</em>` : t.look ? '<em class="bd-mchip">Needs a look</em>' : ''}</summary>`
|
|
174
|
+
+ `<p class="bd-amut">${esc(t.def || '')}</p>${weeks ? `<div class="bd-kv">${weeks}</div>` : ''}</details>`;
|
|
175
|
+
};
|
|
176
|
+
w.outerHTML = `<div id="metW"><p class="bd-amut">${esc(m.header || '')}${m.lead ? ' · ' + esc(m.lead) : ''}</p><div class="bd-mets">${(m.tiles || []).map(tile).join('')}</div><p class="bd-amut">${esc(m.note || '')} <a class="bd-alink" href="/premium-insights.html?ws=${ws}">Targets and longer ranges are on Insights</a>.</p></div>`;
|
|
177
|
+
if (m.pending) setTimeout(() => { if ($('#metW')) openMetrics(null, true); }, 3000);
|
|
178
|
+
}
|
|
179
|
+
/* ── Find and Filter: the page's filter state (F.q, F.owners, F.lanes) ─────────────────────────────────────────── */
|
|
180
|
+
function openFind(from) {
|
|
181
|
+
panel('Find', `<label class="bd-form"><span class="bd-albl">Find an initiative by its title</span><input id="bdQ" type="search" maxlength="80" value="${esc(A.F.q || '')}" placeholder="Type part of a title"></label><p class="bd-amut" id="bdQn"></p>`, from);
|
|
182
|
+
const q = $('#bdQ'); if (q) { q.focus(); q.oninput = () => { A.F.q = q.value.trim(); A.redraw(); $('#bdQn').textContent = A.F.q ? 'The board shows the initiatives whose title holds “' + A.F.q + '”.' : ''; }; }
|
|
183
|
+
}
|
|
184
|
+
function openFilter(from) {
|
|
185
|
+
const rows = M().initiatives.list.rows, owners = [...new Set(rows.map((r) => r.owner || 'No owner'))].sort(), lanes = [...new Set(rows.map((r) => r.lane).filter(Boolean))].sort();
|
|
186
|
+
const box = (k, v) => `<label class="bd-chk"><input type="checkbox" data-flt="${k}" value="${esc(v)}"${A.F[k].has(v) ? ' checked' : ''}><span>${esc(v)}</span></label>`;
|
|
187
|
+
panel('Filter', `<p class="bd-albl">Owner</p><div class="bd-chks">${owners.map((o) => box('owners', o)).join('')}</div><p class="bd-albl">Lane</p><div class="bd-chks">${lanes.map((l) => box('lanes', l)).join('')}</div><div class="bd-arow"><button type="button" class="bd-btn" data-act="fclear">Clear</button></div>`, from);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* ── Documents ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
191
|
+
export function docsHtml() {
|
|
192
|
+
const D = M().docs || { rows: [] }, L = D.rows || [];
|
|
193
|
+
const add = '<button type="button" class="bd-btn" id="addDoc" data-act="adddoc">Add a document</button>';
|
|
194
|
+
const head = `<div class="bd-dochd">${tagHead('The board\'s core documents' + (D.cap ? ' · ' + D.cap : ''))}${D.scope ? add : ''}</div>`;
|
|
195
|
+
if (!L.length) return head + `<p class="bd-amut">${D.missing ? 'The core documents could not be read, so none is shown.' : 'No document is on this board yet.'}</p>`;
|
|
196
|
+
const row = (d) => `<div class="bd-lr doc" role="listitem" data-doc-key="${esc(d.key)}"><span class="t">${d.path ? `<button type="button" class="bd-dlink" data-act="cdoc" data-key="${esc(d.key)}">${esc(d.title)}</button>` : `<b>${esc(d.title)}</b>`}<small>${esc([d.what, d.cadence, d.by, d.added ? 'added ' + d.added : ''].filter(Boolean).join(' · '))}</small></span><span class="st">${esc(d.state || '')}</span><span class="pth">${esc(d.path || '')}</span>${d.act && d.act.kind === 'draft' ? `<button type="button" class="bd-btn" data-act="draft" data-key="${esc(d.key)}"${d.running ? ' disabled' : ''}>${d.running ? 'Drafting' : esc(d.act.label || 'Draft it')}</button>` : '<span></span>'}</div>`;
|
|
197
|
+
return head + `<div class="bd-rows" role="list">${L.map(row).join('')}</div>`;
|
|
198
|
+
}
|
|
199
|
+
/** A core document with a file: its text, read from the repository (GET /api/doc), and for a draft the Issue it press
|
|
200
|
+
* (POST /api/core-docs/issue { scope, key, slot }), which marks the draft issued and sends nothing to anyone. */
|
|
201
|
+
async function openCoreDoc(key, from) {
|
|
202
|
+
const D = M().docs || {}, d = (D.rows || []).find((x) => x.key === key); if (!d || !d.path) return;
|
|
203
|
+
const draft = d.st === 'draft' && !!d.slot;
|
|
204
|
+
const bar = draft ? `<div class="bd-issue" data-issue-bar="draft"><span>A draft. Nothing is sent: issuing marks it issued and sends nothing to anyone.</span><button type="button" class="bd-btn solid" data-act="issue" data-key="${esc(d.key)}">Issue it</button></div>`
|
|
205
|
+
: `<div class="bd-issue done" data-issue-bar="done"><span>${esc(d.state || 'Issued')}. Nothing was sent to anyone.</span></div>`;
|
|
206
|
+
panel(d.title, `${bar}${msg('formM')}<p class="bd-amut">${esc(d.path)}</p><pre class="bd-doc" id="cdText">Reading the document…</pre>`, from, 'Document');
|
|
207
|
+
let text = null; try { const res = await fetch('/api/doc?ws=' + encodeURIComponent(M().board.ws || '') + '&path=' + encodeURIComponent(d.path), { credentials: 'same-origin' }); text = res.ok ? await res.text() : null; } catch { text = null; }
|
|
208
|
+
const el = $('#cdText'); if (el) el.textContent = text == null ? d.path + ' could not be read.' : text;
|
|
209
|
+
}
|
|
210
|
+
async function issueDoc(key, btn) {
|
|
211
|
+
const D = M().docs || {}, d = (D.rows || []).find((x) => x.key === key); if (!d) return;
|
|
212
|
+
const r = await press(btn, $('#formM'), () => post('/api/core-docs/issue', { scope: D.scope, key: d.key, slot: d.slot }));
|
|
213
|
+
if (!r) return;
|
|
214
|
+
A.say('Issued. Nothing was sent to anyone.'); await A.load(); openCoreDoc(key, null);
|
|
215
|
+
}
|
|
216
|
+
/** Add a document: a board document written by you or drafted by PMOS, kept in PMOS or linked to a page elsewhere (POST /api/custom-docs/add).
|
|
217
|
+
* PMOS saves the title and the address on the board's record; it does not read or sync the linked page. */
|
|
218
|
+
const DKINDS = ['In PMOS', 'Confluence', 'Google Docs', 'Google Slides'];
|
|
219
|
+
function openAddDoc(from) {
|
|
220
|
+
panel('Add a document', `<form class="bd-form" data-form="adddoc"><label>Title<input name="title" maxlength="80" placeholder="For example: UAT plan"></label><p class="bd-albl">Who writes it</p>${radios('writer', [['drafts', 'PMOS drafts it'], ['you', 'I write it']], 'drafts')}<label>Where it lives<select name="kind">${DKINDS.map((k) => `<option>${k}</option>`).join('')}</select></label><label>Address<input name="url" maxlength="300" placeholder="https://" disabled></label><p class="bd-amut">It is saved on the board's record. PMOS does not read or sync a linked page.</p>${msg('formM')}<div class="bd-arow"><button type="submit" class="bd-btn solid">Add</button><button type="button" class="bd-btn" data-pk="close">Not now</button></div></form>`, from);
|
|
221
|
+
const f = $('#peek form[data-form="adddoc"]'); if (f) f.kind.onchange = () => { f.url.disabled = f.kind.value === 'In PMOS'; };
|
|
222
|
+
}
|
|
223
|
+
/* ── the presses ─────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
224
|
+
/* ── Notifications (the toolbar's bell): what waits on you on this board and the new asks ───────────────────────────────── */
|
|
225
|
+
function openBell(from) {
|
|
226
|
+
const rows = (M().rows || []).filter((r) => r.track && r.track.you), na = (M().chips || {}).asks;
|
|
227
|
+
const list = rows.map((r) => `<button type="button" class="bd-ai" data-act="ini" data-id="${esc(r.key)}"><b>${esc(r.title)}</b><small>${esc(r.track.you)}</small></button>`).join('');
|
|
228
|
+
const asks = na ? `<button type="button" class="bd-ai" data-act="asks"><b>${na} new ${na === 1 ? 'ask' : 'asks'}</b><small>Waiting for triage</small></button>` : '';
|
|
229
|
+
panel('Notifications', list || asks ? `<div class="bd-alist">${list}${asks}</div>` : '<p class="bd-amut">Nothing on this board waits on you, and no new ask waits for triage.</p>', from);
|
|
230
|
+
}
|
|
231
|
+
export const open = { new: openNew, asks: openAsks, row: openRowActs, sprint: openSprint, metrics: openMetrics, find: openFind, filter: openFilter, gone: openGone, bell: openBell };
|
|
232
|
+
const askOf = (id) => ((M().asks && M().asks.rows) || []).find((a) => a.id === id);
|
|
233
|
+
document.addEventListener('click', async (e) => {
|
|
234
|
+
const b = e.target.closest('[data-act]'); if (!b || !A || !M()) return;
|
|
235
|
+
const k = b.dataset.act;
|
|
236
|
+
if (k === 'gone') { openGone(b); return; }
|
|
237
|
+
if (k === 'ini') { const r = A.rowOf(b.dataset.id); if (r && A.openIni) A.openIni(r); return; }
|
|
238
|
+
if (k === 'asks') { openAsks(b); return; }
|
|
239
|
+
if (k === 'adddoc') { openAddDoc(b); return; }
|
|
240
|
+
if (k === 'cdoc') { openCoreDoc(b.dataset.key, b); return; }
|
|
241
|
+
if (k === 'issue') { issueDoc(b.dataset.key, b); return; }
|
|
242
|
+
if (k === 'accept') { const a = askOf(b.dataset.id); if (a) openNew(null, a); return; }
|
|
243
|
+
if (k === 'decline') { const a = askOf(b.dataset.id); if (a) openDecline(a); return; }
|
|
244
|
+
if (k === 'fclear') { A.F.owners.clear(); A.F.lanes.clear(); $$('[data-flt]').forEach((x) => { x.checked = false; }); A.redraw(); return; }
|
|
245
|
+
if (k === 'row') { const r = A.rowOf(b.dataset.id); if (r) runRow(r, b.dataset.k, b); return; }
|
|
246
|
+
if (k === 'reopen' || k === 'restore') { const r = A.rowOf(b.dataset.id); if (r) runRow(r, k, b); return; }
|
|
247
|
+
if (k === 'draft') {
|
|
248
|
+
b.disabled = true;
|
|
249
|
+
const r = await pmPost('/api/core-docs/draft', { ws: M().board.ws, scope: M().docs.scope, key: b.dataset.key }).catch(() => null);
|
|
250
|
+
if (r && r.ok) { A.say('The agent is drafting it. It lands as a draft for you to review; nothing is sent.'); await A.load(); } else { b.disabled = false; A.say(errOf(r)); }
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
document.addEventListener('change', (e) => {
|
|
254
|
+
const c = e.target.closest('[data-flt]'); if (!c || !A) return;
|
|
255
|
+
const S = A.F[c.dataset.flt]; if (c.checked) S.add(c.value); else S.delete(c.value); A.redraw();
|
|
256
|
+
});
|
|
257
|
+
document.addEventListener('submit', async (e) => {
|
|
258
|
+
const f = e.target.closest('form[data-form]'); if (!f || !A) return;
|
|
259
|
+
e.preventDefault();
|
|
260
|
+
const kind = f.dataset.form, m = $('#formM'), go = f.querySelector('[type="submit"]'), val = (n) => (f.elements[n] ? String(f.elements[n].value || '').trim() : '');
|
|
261
|
+
if (kind === 'new') {
|
|
262
|
+
const title = val('title'), lane = val('lane'), anchor = val('anchor'), askId = f.dataset.ask || null;
|
|
263
|
+
if (!title) { m.textContent = 'Give it a title.'; return; }
|
|
264
|
+
if (!anchor) { m.textContent = 'Choose an anchor. Unanchored work is rejected.'; return; }
|
|
265
|
+
const res = await press(go, m, async () => {
|
|
266
|
+
let ask = askId;
|
|
267
|
+
if (!ask) { const r0 = await post('/api/boards/asks/add', { board: M().board.id, line: title, source: 'New initiative, typed by you' }); if (!r0 || r0.ok !== true) return r0; ask = r0.ask && r0.ask.id; }
|
|
268
|
+
return post('/api/boards/asks/accept', { board: M().board.id, ask, title, lane, anchor });
|
|
269
|
+
});
|
|
270
|
+
if (res) await done(res, '“' + title + '” is ' + (askId ? 'accepted' : 'created') + ' in ' + (res.stage || 'the first stage') + ', anchored to ' + anchor + '.');
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (kind === 'adddoc') {
|
|
274
|
+
const title = val('title'), kd = val('kind'), url = val('url'), writer = (f.querySelector('input[name="writer"]:checked') || {}).value || 'drafts';
|
|
275
|
+
if (!title) { m.textContent = 'Give the document a title.'; return; }
|
|
276
|
+
if (kd !== 'In PMOS' && !url) { m.textContent = 'Paste the address of the ' + kd + ' page, or choose In PMOS.'; return; }
|
|
277
|
+
const body = { scope: M().docs.scope, title, writer, ...(kd !== 'In PMOS' ? { kind: kd, url } : {}) };
|
|
278
|
+
const res = await press(go, m, () => post('/api/custom-docs/add', body));
|
|
279
|
+
if (res) await done(res, '“' + title + '” is added to the board\'s documents.');
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (kind === 'decline') {
|
|
283
|
+
const why = val('why').replace(/\s+/g, ' '); if (!why) { m.textContent = 'Say why. A decline needs a reason.'; return; }
|
|
284
|
+
const res = await press(go, m, () => post('/api/boards/asks/decline', { board: M().board.id, ask: f.dataset.ask, why }));
|
|
285
|
+
if (res) await done(res, 'Ask declined. The reason is kept in the board ledger.');
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const r = A.rowOf(f.dataset.id); if (!r) return;
|
|
289
|
+
const p = prevOf(r);
|
|
290
|
+
if (kind === 'hold') {
|
|
291
|
+
const bk = BACK.find((q) => q[0] === val('back')) || BACK[1], day = bk[2] != null ? dayIso(bk[2]) : null;
|
|
292
|
+
const res = await press(go, m, () => life(r.id, 'on-hold', val('why'), day));
|
|
293
|
+
if (res) await done(res, r.title + ' is on hold. Recorded as a lifecycle line.', async () => { const u = await lifeBack(r, p); A.say(u && u.ok ? r.title + ' is back as it was.' : errOf(u)); await A.load(); });
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
const why = val('why'); if (!why) { m.textContent = 'Pick a reason.'; return; }
|
|
297
|
+
const reason = why + (val('note') ? ': ' + val('note').replace(/\s+/g, ' ') : '');
|
|
298
|
+
if (kind === 'cancel') {
|
|
299
|
+
const res = await press(go, m, () => life(r.id, 'cancelled', reason));
|
|
300
|
+
if (res) await done(res, r.title + ' is cancelled. Recorded as a lifecycle line.', async () => { const u = await lifeBack(r, p); A.say(u && u.ok ? r.title + ' is back as it was.' : errOf(u)); await A.load(); });
|
|
301
|
+
} else if (kind === 'archive') {
|
|
302
|
+
const res = await press(go, m, () => arch(r.id, true, reason));
|
|
303
|
+
if (res) await done(res, r.title + ' is archived. Recorded in the board ledger.', async () => { const u = await arch(r.id, false); A.say(u && u.ok ? r.title + ' is restored.' : errOf(u)); await A.load(); });
|
|
304
|
+
}
|
|
305
|
+
});
|