create-pmos 0.827.0 → 0.829.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 +217 -45
- 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/state/discoveries.md +1 -1
- package/workspace/bin/pmos.js +19 -9
- package/workspace/board-deliveries-test.js +2 -2
- package/workspace/changelog.json +216 -12
- package/workspace/guide/cli.md +62 -0
- package/workspace/guide/home.md +1 -0
- package/workspace/guide/settings-and-switches.md +1 -0
- package/workspace/lib/board-cli.js +5 -1
- package/workspace/lib/board-premium.js +1 -0
- package/workspace/lib/critical-needs.js +162 -0
- package/workspace/lib/deps-cli.js +102 -0
- package/workspace/lib/engine/boards.js +13 -2
- package/workspace/lib/features.json +5 -0
- package/workspace/lib/five-action-cap.js +84 -0
- package/workspace/lib/needs-providers.js +1 -0
- package/workspace/lib/page-one-answer.js +86 -0
- package/workspace/lib/pages-cli.js +6 -2
- package/workspace/lib/people-cli.js +43 -2
- package/workspace/lib/pmos-verbs.js +15 -1
- package/workspace/lib/portfolio-cli.js +64 -0
- package/workspace/lib/portfolio.js +168 -0
- package/workspace/lib/prototype-cli.js +86 -0
- package/workspace/lib/report-cli.js +12 -2
- package/workspace/lib/report-readers.js +5 -3
- package/workspace/lib/review-pack.js +348 -0
- package/workspace/lib/review-reasons.js +357 -0
- package/workspace/lib/route-modules.js +6 -0
- package/workspace/lib/routes-boards.js +25 -2
- package/workspace/lib/routes-portfolio.js +50 -0
- package/workspace/lib/routes-review-pack.js +42 -0
- package/workspace/lib/routes-roadmap-ops.js +53 -1
- package/workspace/lib/routes-sim-users.js +66 -0
- package/workspace/lib/routes-stakeholders.js +42 -0
- package/workspace/lib/routes-strategy-card.js +29 -1
- package/workspace/lib/routes-team-waits.js +24 -0
- package/workspace/lib/routes-use-log.js +6 -1
- package/workspace/lib/sim-users.js +329 -0
- package/workspace/lib/stakeholder-map.js +232 -0
- package/workspace/lib/task-store.js +1 -1
- package/workspace/lib/team-waits.js +167 -0
- package/workspace/lib/tradeoff-cards.js +258 -0
- package/workspace/lib/tradeoff-cli.js +83 -0
- package/workspace/lib/voice-cli.js +7 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-vw-jira-test.js +6 -2
- package/workspace/public/pm/bd-backlog.js +44 -6
- package/workspace/public/pm/bd-principles.js +12 -1
- package/workspace/public/pm/cozy-library.css +5 -0
- package/workspace/public/pm/cozy-pick.css +1 -0
- package/workspace/public/pm/cozy-pop-work.js +8 -2
- package/workspace/public/pm/cozy-proto.css +5 -0
- package/workspace/public/pm/cozy-proto.js +11 -3
- package/workspace/public/pm/cozy-today-app.js +53 -3
- package/workspace/public/pm/cozy-today-view.js +12 -4
- package/workspace/public/pm/day-time.js +8 -0
- package/workspace/public/pm/five-action-cap.js +104 -0
- package/workspace/public/pm/home-ini.js +3 -2
- package/workspace/public/pm/ini-links.js +2 -1
- package/workspace/public/pm/ini-tasks.js +5 -2
- package/workspace/public/pm/ini-view-model.js +14 -6
- package/workspace/public/pm/ini-view.js +12 -2
- package/workspace/public/pm/library-model.js +1 -1
- package/workspace/public/pm/page-one-answer.css +18 -0
- package/workspace/public/pm/page-one-answer.js +134 -0
- package/workspace/public/pm/pop-work-model.js +8 -6
- package/workspace/public/pm/portfolio.js +67 -0
- package/workspace/public/pm/premium-board.js +19 -6
- package/workspace/public/pm/premium-library.js +27 -3
- package/workspace/public/pm/product-switcher.js +7 -1
- package/workspace/public/pm/range-pick.css +12 -0
- package/workspace/public/pm/range-pick.js +30 -6
- package/workspace/public/pm/review-pack.js +47 -0
- package/workspace/public/pm/review-reasons.js +75 -0
- package/workspace/public/pm/sim-users.js +34 -0
- package/workspace/public/pm/sort-order.js +3 -0
- package/workspace/public/pm/stakeholder-map.js +125 -0
- package/workspace/public/pm/task-card.js +10 -7
- package/workspace/public/pm/team-waits.js +56 -0
- package/workspace/public/pm/tradeoff-cards.css +27 -0
- package/workspace/public/pm/tradeoff-cards.js +183 -0
- package/workspace/public/premium-board.html +1 -0
- package/workspace/public/premium-portfolio.html +48 -0
- package/workspace/public/today.html +1 -0
- package/workspace/run-tests.js +9 -1
- package/workspace/server.js +1 -1
- package/workspace/stage-card-tasks-test.js +11 -5
- package/workspace/test-lists/critical-needs.json +9 -0
- package/workspace/test-lists/five-action-cap.json +9 -0
- package/workspace/test-lists/page-one-answer.json +9 -0
- package/workspace/test-lists/portfolio.json +9 -0
- package/workspace/test-lists/review-pack.json +9 -0
- package/workspace/test-lists/review-reasons.json +9 -0
- package/workspace/test-lists/sim-users.json +9 -0
- package/workspace/test-lists/stakeholder-map.json +9 -0
- package/workspace/test-lists/task-time-optional.json +9 -0
- package/workspace/test-lists/team-waits.json +9 -0
- package/workspace/test-lists/tradeoff-cards.json +9 -0
- package/workspace/test-timings.json +25 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* pm/review-pack.js — the monthly review pack as Library shows it (initiative review-pack, job #1910; board BatchMoreADS panel 25).
|
|
2
|
+
*
|
|
3
|
+
* packHtml(item) PURE → the preview: one pm-block with the pack's parts (Goals, Bets that failed, Next big decision, Asks), each line with the
|
|
4
|
+
* record it came from, then the ✦ line. The parts are read back from the file (lib/review-pack.js readPack), so the PM's
|
|
5
|
+
* edits show. A part with no line is not drawn (zero is silence).
|
|
6
|
+
* shareHtml(item) PURE → the icon-only share button (the Issue press), or '' once the pack is issued
|
|
7
|
+
* share(item, post) → POST /api/report/issue { ws, cadence, slot, sha }: the PM's own press. PMOS never shares a pack by itself.
|
|
8
|
+
* The copy names PMOS only. */
|
|
9
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
10
|
+
const STAR = 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z';
|
|
11
|
+
const SEND = 'M4 12l16-8-6 16-2.5-6.5z';
|
|
12
|
+
export const SAID = 'Drafted by PMOS from goals, experiments and decisions. Edit, then share.';
|
|
13
|
+
|
|
14
|
+
const src = (l) => (l.source ? ` <span class="pm-meta rp-src" title="Where this line comes from">${esc(l.source)}</span>` : '');
|
|
15
|
+
/** The lines of one part: a failed bet's name leads the line under it ("Saved cards: No lift…"); a name with no line under it stands alone. */
|
|
16
|
+
function linesHtml(lines) {
|
|
17
|
+
const out = [];
|
|
18
|
+
for (let i = 0; i < lines.length; i++) {
|
|
19
|
+
const l = lines[i], next = lines[i + 1];
|
|
20
|
+
if (l.head && next && !next.head) { out.push(`<li><b>${esc(l.text)}</b>: ${esc(next.text)}${src(next)}</li>`); i++; }
|
|
21
|
+
else if (l.head) out.push(`<li><b>${esc(l.text)}</b></li>`);
|
|
22
|
+
else out.push(`<li>${esc(l.text)}${src(l)}</li>`);
|
|
23
|
+
}
|
|
24
|
+
return out.join('');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function packHtml(x) {
|
|
28
|
+
const P = (x && x.pack) || {};
|
|
29
|
+
const parts = (P.sections || []).filter((s) => s && Array.isArray(s.lines) && s.lines.length);
|
|
30
|
+
if (!parts.length) return '';
|
|
31
|
+
return `<section class="pm-block rp-pack" aria-label="Review pack"><b>${esc(x.name)}</b>`
|
|
32
|
+
+ parts.map((s) => `<div class="rp-part"><span class="pm-meta rp-head">${esc(s.head)}</span><ul class="rp-lines">${linesHtml(s.lines)}</ul></div>`).join('')
|
|
33
|
+
+ `</section><p class="pm-said"><svg class="pm-ic pm-star" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${STAR}"/></svg><span>${esc(SAID)}</span></p>`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function shareHtml(x) {
|
|
37
|
+
const P = (x && x.pack) || {};
|
|
38
|
+
if (!P.cadence || !P.slot || !P.sha || P.issued) return '';
|
|
39
|
+
return `<button type="button" class="pm-btn" data-rp-share aria-label="Share ${esc(x.name)}: issue it as it is now" title="Share (issue it as it is now)"><svg class="pm-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="${SEND}"/></svg></button>`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function share(x, post) {
|
|
43
|
+
const P = (x && x.pack) || {};
|
|
44
|
+
const ws = (x && x.open && x.open.doc && x.open.doc.ws) || undefined;
|
|
45
|
+
if (!P.cadence || !P.slot || !P.sha) return { ok: false, error: 'The pack could not be read, so it was not shared.' };
|
|
46
|
+
return post('/api/report/issue', { ws, cadence: P.cadence, slot: P.slot, sha: P.sha });
|
|
47
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* pm/review-reasons.js — Customer voice on Work: survey comments and app-store reviews grouped by reason, not by score (idea A427,
|
|
2
|
+
* initiative review-reasons; board BatchMoreADS panel 28). It sits under the principles on a Board that shows one product.
|
|
3
|
+
*
|
|
4
|
+
* mount(host, { ws, single, say }) → draws the block into `host`; a Board that shows several products at once shows none
|
|
5
|
+
*
|
|
6
|
+
* Built only from Komorebi parts: a Detail block (pm-block, its head), pm-table for the reasons, pm-said for the one ✦, pm-meta for the
|
|
7
|
+
* score line, pm-badge alert for a growing complaint, icon-only pm-btn with a label. No inline style (conformance R28-1). It reads GET /api/voice and writes POST /api/voice/file and /api/voice/undo
|
|
8
|
+
* (lib/routes-strategy-card.js over lib/review-reasons.js, the ledger `pmos voice` writes too) and nothing else.
|
|
9
|
+
* · Rows sort by growth over 30 days; the chevron on a row opens its comments.
|
|
10
|
+
* · One ✦ for the fastest-growing complaint; accepting it files a triage item and the Board's toast offers Undo.
|
|
11
|
+
* · The score stays as one line under the reasons. Comments with no reason yet: one quiet count.
|
|
12
|
+
* · No comments: no block (zero is silence).
|
|
13
|
+
* Each ✦ press notes voiceFile and each Undo voiceUndo in the local use log (the bet's kill line). */
|
|
14
|
+
import { pmGet, pmPost } from './http.js';
|
|
15
|
+
import { noteUse } from './use-log.js';
|
|
16
|
+
|
|
17
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
18
|
+
const SV = (d, cls = 'pm-ic') => `<svg class="${cls}" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
19
|
+
const I = { voice: 'M4 5h16v11H9l-5 4z', chev: 'M7 10l5 5 5-5', spark: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z', undo: 'M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3' };
|
|
20
|
+
const btn = (name, value, icon, label, kind = '') => `<button type="button" class="pm-btn${kind ? ' ' + kind : ''}" name="${name}" value="${esc(value)}" aria-label="${esc(label)}" title="${esc(label)}">${SV(icon)}</button>`;
|
|
21
|
+
const when = (iso) => { const d = new Date(iso); return Number.isNaN(d.getTime()) ? '' : d.toISOString().slice(0, 10); };
|
|
22
|
+
const scoreOf = (c) => (c.score == null ? '' : `${c.score} of ${c.scale}`);
|
|
23
|
+
|
|
24
|
+
/** The block's markup. state = { rows, unsorted, score, suggest, open }. Pure, so the test reads it. '' when there is nothing to show. */
|
|
25
|
+
export function blockHtml(state) {
|
|
26
|
+
const rows = Array.isArray(state && state.rows) ? state.rows : [];
|
|
27
|
+
const unsorted = (state && state.unsorted) || 0;
|
|
28
|
+
if (!rows.length && !unsorted) return '';
|
|
29
|
+
const open = new Set((state && state.open) || []);
|
|
30
|
+
const growthCell = (r) => (/^up|^new$/.test(r.growth) && r.complaint ? `<span class="pm-badge alert">${esc(r.growth)}</span>` : esc(r.growth));
|
|
31
|
+
const row = (r) => {
|
|
32
|
+
const isOpen = open.has(r.reason);
|
|
33
|
+
const filed = r.filed ? ` <span class="pm-badge" title="Filed as a triage item">filed</span>` : '';
|
|
34
|
+
const main = `<tr data-voice-row="${esc(r.reason)}"><td>${esc(r.reason)}${filed}</td><td>${r.n}</td><td>${growthCell(r)}</td>`
|
|
35
|
+
+ `<td>${btn('voiceOpen', r.reason, I.chev, (isOpen ? 'Close the comments of ' : 'Open the comments of ') + r.reason, 'ghost')}</td></tr>`;
|
|
36
|
+
if (!isOpen) return main;
|
|
37
|
+
const list = (r.comments || []).map((c) => `<div class="pm-li" role="listitem"><span class="txt"><span class="t">${esc(c.text)}</span>`
|
|
38
|
+
+ `<span class="w">${esc([c.source, scoreOf(c), when(c.at)].filter(Boolean).join(' · '))}</span></span></div>`).join('');
|
|
39
|
+
return main + `<tr data-voice-comments="${esc(r.reason)}"><td colspan="4"><div role="list">${list}</div></td></tr>`;
|
|
40
|
+
};
|
|
41
|
+
const table = rows.length ? `<table class="pm-table"><thead><tr><th>Reason</th><th>Comments</th><th>30 days</th><th><span class="vh">Open</span></th></tr></thead><tbody>${rows.map(row).join('')}</tbody></table>` : '';
|
|
42
|
+
const s = state && state.suggest;
|
|
43
|
+
const said = s ? `<p class="pm-said">${SV(I.spark, 'pm-ic pm-star')}<span>${esc(s.line)}</span>${btn('voiceFile', s.reason, I.spark, 'Make it a work item: PMOS files it in triage', 'primary')}</p>` : '';
|
|
44
|
+
const foot = [state && state.score, unsorted ? `${unsorted} ${unsorted === 1 ? 'comment has' : 'comments have'} no reason yet` : ''].filter(Boolean).join(' · ');
|
|
45
|
+
return `<section class="pm-block" aria-label="Customer voice"><div class="head">${SV(I.voice)}<h3 class="pm-h-sm">Customer voice</h3><span class="sp"></span></div>`
|
|
46
|
+
+ table + said + (foot ? `<p class="pm-meta">${esc(foot)}</p>` : '') + '</section>';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Draw the block into `host` and wire its presses. */
|
|
50
|
+
export async function mount(host, opts = {}) {
|
|
51
|
+
if (!host) return;
|
|
52
|
+
const { ws = null, single = true, say = null } = opts;
|
|
53
|
+
if (!single) { host.hidden = true; host.innerHTML = ''; return; }
|
|
54
|
+
const r = await pmGet('/api/voice' + (ws ? '?ws=' + encodeURIComponent(ws) : '')).catch(() => null);
|
|
55
|
+
if (!r || !r.ok) { host.hidden = true; return; } // the block is an extra: a failed read leaves the Board as it was
|
|
56
|
+
const state = { ...r, open: host._voiceOpen || [] };
|
|
57
|
+
const html = blockHtml(state);
|
|
58
|
+
host.hidden = !html; host.innerHTML = html;
|
|
59
|
+
host.onclick = async (e) => {
|
|
60
|
+
const b = e.target.closest('button[name="voiceOpen"], button[name="voiceFile"]'); if (!b) return;
|
|
61
|
+
if (b.name === 'voiceOpen') {
|
|
62
|
+
const set = new Set(host._voiceOpen || []); if (set.has(b.value)) set.delete(b.value); else set.add(b.value);
|
|
63
|
+
host._voiceOpen = [...set]; host.innerHTML = blockHtml({ ...r, open: host._voiceOpen }); return;
|
|
64
|
+
}
|
|
65
|
+
noteUse('voiceFile');
|
|
66
|
+
b.disabled = true;
|
|
67
|
+
const res = await pmPost('/api/voice/file', { ws, reason: b.value }).catch(() => null);
|
|
68
|
+
if (!res || !res.ok) { b.disabled = false; if (say) say((res && res.error) || 'Not filed.'); return; }
|
|
69
|
+
if (say) say('Filed in triage.', async () => { noteUse('voiceUndo'); await pmPost('/api/voice/undo', { ws, capture: res.capture }).catch(() => null); mount(host, opts); });
|
|
70
|
+
mount(host, opts);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Draw the block again after a read of the Board. */
|
|
75
|
+
export const refresh = (host, opts) => mount(host, opts);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* pm/sim-users.js — Findings: what simulated users found on the prototype before it reached you (initiative sim-users, idea A20, board
|
|
2
|
+
* BatchReleaseDS panel 24, agreed 2026-11-25). The server walks each key task once per persona (lib/sim-users.js) and the compare view
|
|
3
|
+
* carries the result (GET /api/lab/compare: compare.findings). This draws it above the design with the system parts: a pm-block list, one
|
|
4
|
+
* pm-li per finding, the state glyph (At risk where they got stuck, On track where all finished). Findings, not clicks, and never a score.
|
|
5
|
+
* Each finding is a press that shows the screen it came from (data-pc-screen: pm/cozy-proto.js shows it). No findings: nothing (zero is
|
|
6
|
+
* silence). `pmos prototype findings <initiative>` reads the same store.
|
|
7
|
+
*
|
|
8
|
+
* findingsHtml(findings) PURE → '' | the block's HTML · notePress() counts a press on this computer only (use-log control sim-finding)
|
|
9
|
+
* loadFindings({ ws, ini, file }) → Promise<findings | null> (null: none, or the read failed; the Viewer never waits on it) */
|
|
10
|
+
import { stateGlyph } from './state-glyph.js';
|
|
11
|
+
import { noteUse } from './use-log.js';
|
|
12
|
+
import { pmGet } from './http.js';
|
|
13
|
+
|
|
14
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
15
|
+
|
|
16
|
+
export function findingsHtml(f) {
|
|
17
|
+
const rows = f && Array.isArray(f.rows) ? f.rows : [];
|
|
18
|
+
if (!rows.length) return '';
|
|
19
|
+
const n = Number(f.personas) || 0;
|
|
20
|
+
const li = (r) => {
|
|
21
|
+
const inner = `${stateGlyph(r.state === 'on' ? 'on' : 'risk', { progress: r.state === 'on' ? 1 : 0 })}<span class="txt"><span class="t">${esc(r.text)}</span>${r.who ? `<span class="w">${esc(r.who)}</span>` : ''}</span>`;
|
|
22
|
+
return r.screen
|
|
23
|
+
? `<button type="button" class="pm-li pc-find" data-pc-screen="${esc(r.screen)}" data-pc-find aria-label="${esc('Show the screen: ' + r.text)}" title="${esc(r.text + (r.who ? ' · ' + r.who : ''))}">${inner}</button>`
|
|
24
|
+
: `<div class="pm-li pc-find">${inner}</div>`;
|
|
25
|
+
};
|
|
26
|
+
return `<section class="pm-block list pc-finds" aria-label="Findings"><div class="head"><h3 class="pm-h-sm">Findings</h3><span class="sp"></span>`
|
|
27
|
+
+ `<span class="pm-meta" title="A hint for your grilling, never a score">${n} persona${n === 1 ? '' : 's'}</span></div><div class="rows">${rows.map(li).join('')}</div></section>`;
|
|
28
|
+
}
|
|
29
|
+
export function notePress() { return noteUse('sim-finding'); }
|
|
30
|
+
export async function loadFindings({ ws, ini, file }) {
|
|
31
|
+
if (!ini || !file) return null;
|
|
32
|
+
const r = await pmGet('/api/sim-users/findings?ws=' + encodeURIComponent(ws || '') + '&initiative=' + encodeURIComponent(ini) + '&file=' + encodeURIComponent(file)).catch(() => null);
|
|
33
|
+
return r && r.ok ? r.findings || null : null;
|
|
34
|
+
}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* initiatives of a product sit in [data-po-list="@<product key>"], each [data-po-id="<initiative id>"]. Only the PM changes the order. */
|
|
14
14
|
import { pmGet, pmPost } from './http.js';
|
|
15
15
|
import { MODES, DEFAULT, labelOf, arranged } from './order-model.js';
|
|
16
|
+
import './tradeoff-cards.js'; // trade-off cards on Work (job #1918, A325): it starts itself only where #ibBody is, and reads the moves below
|
|
16
17
|
|
|
17
18
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
18
19
|
const SV = (d, w = 1.8) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
@@ -55,6 +56,8 @@ function seen() {
|
|
|
55
56
|
|
|
56
57
|
export async function moveIn(list, ids) {
|
|
57
58
|
const was = L, k = list.dataset.poList.slice(1);
|
|
59
|
+
// trade-off cards (pm/tradeoff-cards.js): a row put directly above another shows the line for that pair, from the redraw save() makes
|
|
60
|
+
if (typeof window !== 'undefined') window.dispatchEvent(new CustomEvent('pmos:order-moved', { detail: { list: list.dataset.poList, ids } }));
|
|
58
61
|
const ok = await save(arranged(L, k, ids, seen()));
|
|
59
62
|
if (ok && O) O.say(was.sort === 'mine' ? 'Moved · Today and Work use this order' : 'Moved · now My order on Today and Work', () => save(was));
|
|
60
63
|
return ok;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/* pm/stakeholder-map.js — the People block of an initiative on Work: who decides, who must agree, who needs to know, and when each last heard
|
|
2
|
+
* from you (initiative stakeholder-map, job #1896, idea A371; board BatchPeopleDS panel 9, agreed 2026-11-25).
|
|
3
|
+
*
|
|
4
|
+
* blockHtml(map, ui) → the block's markup ('' when there is no name: zero is silence). Pure, so the test reads it.
|
|
5
|
+
* map: GET /api/stakeholders; ui: { open: the id whose ✦ draft update is open }
|
|
6
|
+
* blockFor(ini, ws, redraw) → the block for the popup drawn now: reads GET /api/stakeholders once per initiative, then draws from memory
|
|
7
|
+
* press(e, body, { say }) → the popup's click listener hands each press here first: keep, drop, group, ✦, copy, I sent it
|
|
8
|
+
*
|
|
9
|
+
* Built only from the system parts on the board: pm-block, pm-li, pm-said, pm-btn and the state glyphs (pm/state-glyph.js). Every button
|
|
10
|
+
* is icon-only with an aria-label. A row is a draft until kept: ✓ keeps it in its group, ✕ takes it off, the group button moves it to the
|
|
11
|
+
* next group. A row with no news for 3 weeks has the late glyph and a ✦: it opens the draft update to copy. PMOS NEVER SENDS IT: "I sent it"
|
|
12
|
+
* only records the date (POST act told). Each write offers Undo in the toast. The UI says PMOS, never Claude. */
|
|
13
|
+
import { pmGet, pmPost } from './http.js';
|
|
14
|
+
import { noteUse } from './use-log.js';
|
|
15
|
+
import { stateGlyph } from './state-glyph.js';
|
|
16
|
+
import { undoToast } from './hi-pop.js';
|
|
17
|
+
|
|
18
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
19
|
+
const SV = (d, w = 16) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
20
|
+
const I = {
|
|
21
|
+
spark: 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', ok: 'M5 12.5l4.5 4.5L19 7.5', x: 'M6 6l12 12M18 6L6 18',
|
|
22
|
+
group: 'M7 7h10M7 12h10M7 17h6M17 15l2 2-2 2', copy: 'M9 9h10v10H9zM5 15V5h10', sent: 'M4 12l16-8-6 16-3-7z',
|
|
23
|
+
};
|
|
24
|
+
export const NEXT_GROUP = Object.freeze({ decides: 'agree', agree: 'know', know: 'decides' });
|
|
25
|
+
export const GROUP_WORD = Object.freeze({ decides: 'decides', agree: 'must agree', know: 'needs to know' });
|
|
26
|
+
|
|
27
|
+
/** "last heard 3 days ago" · "last heard today" · "no update on record". */
|
|
28
|
+
export function heardText(days) {
|
|
29
|
+
if (days == null) return 'no update on record';
|
|
30
|
+
if (days === 0) return 'last heard today';
|
|
31
|
+
return `last heard ${days} ${days === 1 ? 'day' : 'days'} ago`;
|
|
32
|
+
}
|
|
33
|
+
const btn = (attrs, label, icon, kind = '') => `<button type="button" class="pm-btn${kind ? ' ' + kind : ''}" ${attrs} aria-label="${esc(label)}" title="${esc(label)}">${SV(icon)}</button>`;
|
|
34
|
+
|
|
35
|
+
export function blockHtml(map, ui = {}) {
|
|
36
|
+
const rows = Array.isArray(map && map.rows) ? map.rows : [];
|
|
37
|
+
if (!rows.length) return '';
|
|
38
|
+
const ini = String((map && map.ini) || '');
|
|
39
|
+
const row = (r) => {
|
|
40
|
+
const g = r.stale ? stateGlyph('late', { why: `No news in ${r.days} days` }) : stateGlyph('on', { progress: 0, why: r.days == null ? 'No update on record yet' : 'Heard from in the last 3 weeks' });
|
|
41
|
+
const sub = [heardText(r.days), r.kept ? '' : 'draft: ' + r.why].filter(Boolean).join(' · ');
|
|
42
|
+
const id = esc(r.id), nm = esc(r.name);
|
|
43
|
+
const acts = `<span class="acts">${btn(`data-sm-act="group" data-sm-id="${id}" data-sm-group="${esc(NEXT_GROUP[r.group] || 'know')}"`, `Move ${r.name} to ${GROUP_WORD[NEXT_GROUP[r.group]] || 'needs to know'}`, I.group)}`
|
|
44
|
+
+ (r.kept ? '' : btn(`data-sm-act="drop" data-sm-id="${id}"`, `Take ${r.name} off`, I.x, 'outline') + btn(`data-sm-act="keep" data-sm-id="${id}" data-sm-group="${esc(r.group)}"`, `Keep ${r.name}`, I.ok, 'primary')) + '</span>';
|
|
45
|
+
const star = r.update ? btn(`data-sm-act="read" data-sm-id="${id}" aria-expanded="${ui.open === r.id}"`, `Read the draft update for ${r.name}`, I.spark) : '';
|
|
46
|
+
const li = `<div class="pm-li${r.stale ? ' sm-stale' : ''}${r.kept ? '' : ' sm-draft'}" role="listitem" data-sm-row="${id}" data-sm-name="${nm}">${g}`
|
|
47
|
+
+ `<span class="txt"><span class="t">${nm} · ${esc(GROUP_WORD[r.group] || r.groupWord || '')}</span><span class="w">${esc(sub)}</span></span>${acts}${star}</div>`;
|
|
48
|
+
const upd = r.update && ui.open === r.id
|
|
49
|
+
? `<div class="pm-said sm-upd" role="group" aria-label="PMOS drafted this update; you send it">${SV(I.spark, 14)}<p>${esc(r.update)}</p>`
|
|
50
|
+
+ `<span class="sm-upd-b">${btn(`data-sm-act="copy" data-sm-id="${id}"`, 'Copy the update', I.copy, 'outline')}${btn(`data-sm-act="told" data-sm-id="${id}"`, 'I sent it', I.sent, 'primary')}</span></div>`
|
|
51
|
+
: '';
|
|
52
|
+
return li + upd;
|
|
53
|
+
};
|
|
54
|
+
return `<section class="pm-block sm-block" aria-label="People" data-sm-ini="${esc(ini)}"><div class="head"><h3 class="pm-h-sm sm-h">People</h3><span class="pm-meta">${rows.length}</span></div>`
|
|
55
|
+
+ `<div role="list">${rows.map(row).join('')}</div></section>`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ── the popup ── */
|
|
59
|
+
const MAPS = new Map(); // ws|ini → map | null while reading | false when there is none
|
|
60
|
+
const UI = { open: '' };
|
|
61
|
+
const kOf = (ini, ws) => (ws || '') + '|' + ini;
|
|
62
|
+
let CSS_DONE = false;
|
|
63
|
+
function css() {
|
|
64
|
+
if (CSS_DONE || typeof document === 'undefined' || !document.head) return;
|
|
65
|
+
CSS_DONE = true;
|
|
66
|
+
const s = document.createElement('style');
|
|
67
|
+
s.textContent = '.sm-block .sm-h{flex:1}.sm-block .pm-li.sm-stale{background:var(--well)}.sm-block .pm-li.sm-draft .t{font-weight:500}.sm-block .sm-upd{max-width:none;margin:0 8px 8px 44px;align-items:flex-start}'
|
|
68
|
+
+ '.sm-block .sm-upd p{flex:1;margin:0}.sm-block .sm-upd-b{display:flex;gap:4px}';
|
|
69
|
+
document.head.appendChild(s);
|
|
70
|
+
}
|
|
71
|
+
function load(ini, ws, redraw, again = false) {
|
|
72
|
+
const k = kOf(ini, ws);
|
|
73
|
+
if (!again) MAPS.set(k, null);
|
|
74
|
+
pmGet('/api/stakeholders?ini=' + encodeURIComponent(ini) + (ws ? '&ws=' + encodeURIComponent(ws) : ''))
|
|
75
|
+
.then((x) => { MAPS.set(k, x && x.ok ? x : false); if (x && x.ok && ((x.rows || []).length || again) && redraw) redraw(); })
|
|
76
|
+
.catch(() => MAPS.set(k, false));
|
|
77
|
+
}
|
|
78
|
+
let lastRedraw = null, lastWs = '';
|
|
79
|
+
export function blockFor(ini, ws, redraw) {
|
|
80
|
+
if (!ini) return '';
|
|
81
|
+
lastRedraw = redraw; lastWs = ws || '';
|
|
82
|
+
const k = kOf(ini, ws);
|
|
83
|
+
if (!MAPS.has(k)) load(ini, ws, redraw);
|
|
84
|
+
const m = MAPS.get(k);
|
|
85
|
+
if (!m) return '';
|
|
86
|
+
css();
|
|
87
|
+
return blockHtml(m, UI);
|
|
88
|
+
}
|
|
89
|
+
if (typeof document !== 'undefined' && document.addEventListener) document.addEventListener('cz:chat-turn', () => { MAPS.clear(); if (lastRedraw) lastRedraw(); });
|
|
90
|
+
|
|
91
|
+
async function write(ini, ws, body) {
|
|
92
|
+
const r = await pmPost('/api/stakeholders', { ws: ws || null, ini, ...body }).catch(() => null);
|
|
93
|
+
load(ini, ws, lastRedraw, true);
|
|
94
|
+
return r;
|
|
95
|
+
}
|
|
96
|
+
/** One press inside the popup body: the popup's own click listener (pm/cozy-pop-work.js) hands every press here first; true when it was
|
|
97
|
+
* the People block's, so the popup leaves it alone. */
|
|
98
|
+
export function press(e, body, { say } = {}) {
|
|
99
|
+
const b = e.target.closest && e.target.closest('[data-sm-act]');
|
|
100
|
+
if (!b || !body || !body.contains(b)) return false;
|
|
101
|
+
const sec = b.closest('[data-sm-ini]');
|
|
102
|
+
if (!sec) return false;
|
|
103
|
+
e.stopImmediatePropagation(); // the popup's own press handler (registered after this one) leaves it alone
|
|
104
|
+
act(b, sec, say);
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
async function act(b, sec, say) {
|
|
108
|
+
const ini = sec.dataset.smIni, ws = lastWs, id = b.dataset.smId, what = b.dataset.smAct;
|
|
109
|
+
const m = MAPS.get(kOf(ini, ws)), row = m && (m.rows || []).find((r) => r.id === id);
|
|
110
|
+
if (!row) return;
|
|
111
|
+
const tell = (text, undoIt) => { if (undoIt) undoToast(text, undoIt); else if (say) say(text); };
|
|
112
|
+
if (what === 'read') { UI.open = UI.open === id ? '' : id; noteUse('stakeholderUpdate'); if (lastRedraw) lastRedraw(); return; }
|
|
113
|
+
if (what === 'copy') {
|
|
114
|
+
try { await navigator.clipboard.writeText(row.update || ''); tell('Copied. Send it from your mail or chat.'); } catch { tell('Select the text and copy it.'); }
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const kind = what === 'group' ? 'keep' : what;
|
|
118
|
+
noteUse('stakeholder' + kind[0].toUpperCase() + kind.slice(1));
|
|
119
|
+
b.disabled = true;
|
|
120
|
+
const r = await write(ini, ws, { person: id, name: row.name, act: kind, ...(kind === 'keep' ? { group: b.dataset.smGroup } : {}) });
|
|
121
|
+
if (!r || !r.ok) { b.disabled = false; tell((r && r.error) || 'Not saved.'); return; }
|
|
122
|
+
if (kind === 'told') UI.open = '';
|
|
123
|
+
const word = { keep: `${row.name} kept · ${GROUP_WORD[b.dataset.smGroup] || ''}`, drop: `${row.name} taken off`, told: `Marked: ${row.name} heard from you today` }[kind];
|
|
124
|
+
tell(word, () => { write(ini, ws, { person: id, name: row.name, act: 'undo' }); });
|
|
125
|
+
}
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
* section and the initiative → tasks/edit, the group → /api/initiative-layout place,
|
|
28
28
|
* a Jira ticket's notes → tickets/note. Each answers { ok, from } so Undo is save(from). */
|
|
29
29
|
|
|
30
|
-
import { rangeHtml, mountRange } from './range-pick.js';
|
|
30
|
+
import { rangeHtml, mountRange } from './range-pick.js';
|
|
31
|
+
import { isTime, withTime } from './day-time.js'; // a task's optional time on its start and due (task-time-optional) // start and due on one calendar (the same picker everywhere a task's dates are set)
|
|
31
32
|
|
|
32
33
|
export const STATES = ['To do', 'In progress', 'Done', "Won't do", 'Archived']; // a task's only stage is its state (scripts/boards.js TASK_STATES)
|
|
33
34
|
const SKEY = { 'To do': 'todo', 'In progress': 'prog', Done: 'done', "Won't do": 'wont', Archived: 'arch' };
|
|
@@ -64,7 +65,7 @@ export function taskOf(row, extra = {}) {
|
|
|
64
65
|
const r = row || {}, jira = r.src === 'jira' || (r.pmos === false && /^Jira/.test(r.src || ''));
|
|
65
66
|
return {
|
|
66
67
|
uid: r.uid || '', key: r.key && /^task:/.test(r.key) ? r.key : 'task:' + (r.uid || r.key || ''), title: r.title || '', status: r.status || r.state || 'To do',
|
|
67
|
-
start: r.start || '', due: r.end || r.due || '', owner: r.owner || (jira ? r.assignee || '' : ''), notes: r.notes || '', ini: r.ini || extra.ini || '',
|
|
68
|
+
start: r.start || '', due: r.end || r.due || '', start_time: isTime(r.start_time) ? r.start_time : '', due_time: isTime(r.due_time) ? r.due_time : '', owner: r.owner || (jira ? r.assignee || '' : ''), notes: r.notes || '', ini: r.ini || extra.ini || '',
|
|
68
69
|
iniTitle: extra.iniTitle || '', group: extra.group != null ? extra.group : '', board: r.board || extra.board || '',
|
|
69
70
|
section: typeof r.section === 'string' ? r.section : '', milestone: !!r.milestone, wbs: r.wbs && (r.wbs.title || r.wbs.id) ? { id: r.wbs.id || '', title: r.wbs.title || r.wbs.id } : null,
|
|
70
71
|
// a Jira ticket (task-detail-every-task): its link and Jira's own status name, as the board's items carry them (Jira owns both)
|
|
@@ -107,9 +108,10 @@ export async function placeOf(row, stages = [], rows = [], map = null) {
|
|
|
107
108
|
* label says Due, so the words do not (say it once). */
|
|
108
109
|
export function dueLine(t, now = Date.now()) {
|
|
109
110
|
const d = dayOf(t.due), s = dayOf(t.start);
|
|
110
|
-
if (!d) return { text: s ? 'Starts ' + short(t.start) : '', late: false, lateText: '', none: !s };
|
|
111
|
-
const same = s && s.getMonth() === d.getMonth() && s.getFullYear() === d.getFullYear();
|
|
112
|
-
const text = s && +s !== +d
|
|
111
|
+
if (!d) return { text: s ? 'Starts ' + withTime(short(t.start), t.start_time) : '', late: false, lateText: '', none: !s };
|
|
112
|
+
const same = s && s.getMonth() === d.getMonth() && s.getFullYear() === d.getFullYear(), tm = isTime(t.start_time) || isTime(t.due_time);
|
|
113
|
+
const text = tm ? (s && (+s !== +d || isTime(t.start_time)) ? withTime(short(t.start), t.start_time) + ' → ' + withTime(short(t.due), t.due_time) : withTime(short(t.due), t.due_time))
|
|
114
|
+
: s && +s !== +d ? (same ? short(t.start) + ' → ' + d.getDate() : short(t.start) + ' → ' + short(t.due)) : short(t.due);
|
|
113
115
|
const diff = Math.round((d - todayOf(now)) / 86400000);
|
|
114
116
|
const late = diff < 0 && !closed(t.status);
|
|
115
117
|
return { text, late, lateText: late ? -diff + (diff === -1 ? ' day late' : ' days late') : !closed(t.status) && diff === 0 ? 'Today' : '', none: false };
|
|
@@ -346,7 +348,8 @@ export function mountCard(el, t, h) {
|
|
|
346
348
|
// the dates picker wires itself; each tap saves with Undo, and the second tap (the due day) closes it
|
|
347
349
|
const dp = el.querySelector('.tkc-dp');
|
|
348
350
|
if (dp) mountRange(dp, { start: t.start, due: t.due, one: !!t.milestone, field: st.field, month: st.month, today: isoOf(todayOf(h.now ? h.now() : Date.now())),
|
|
349
|
-
|
|
351
|
+
time: !t.jira, start_time: t.start_time, due_time: t.due_time, timeOpen: st.timeOpen, // the optional time (task-time-optional): a PMOS task's only
|
|
352
|
+
onState: (s) => { st.field = s.field; st.month = s.month; st.timeOpen = s.timeOpen; },
|
|
350
353
|
onPick: (patch, done) => { if (done) st.open = null; change('dates', patch); } });
|
|
351
354
|
if (dp && inDp) dp.querySelector('.rp-g [tabindex="0"]')?.focus({ preventScroll: true });
|
|
352
355
|
};
|
|
@@ -471,7 +474,7 @@ export function boardSaver(o) {
|
|
|
471
474
|
if (patch.status != null) return post('/api/boards/tasks/state', { ws, board, task: t.uid, state: patch.status });
|
|
472
475
|
if (patch.group != null) return post('/api/initiative-layout', { ws, kind: 'place', initiative: t.ini, task: t.key, group: patch.group });
|
|
473
476
|
const body = {};
|
|
474
|
-
for (const k of ['owner', 'notes', 'start', 'due', 'section', 'initiative', 'milestone', 'priority']) if (patch[k] != null) body[k] = patch[k];
|
|
477
|
+
for (const k of ['owner', 'notes', 'start', 'due', 'start_time', 'due_time', 'section', 'initiative', 'milestone', 'priority']) if (patch[k] != null) body[k] = patch[k];
|
|
475
478
|
return post('/api/boards/tasks/edit', { ws, board, task: t.uid, ...body });
|
|
476
479
|
};
|
|
477
480
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* pm/team-waits.js — "Waiting on other teams" on Work › Dependencies (initiative team-waits, bet A364; board BatchCodeDS panel 14, In development).
|
|
2
|
+
* Pure: Node imports it (team-waits.test.js). Rows come from GET /api/team-waits (lib/team-waits.js waitsOf), one per wait, oldest first.
|
|
3
|
+
*
|
|
4
|
+
* LATE_DAYS a wait this many days old or more is late: the late glyph and its day count (spec question Q1)
|
|
5
|
+
* rowsOf(waits, { today }) → [{ id, ws, name, since, sub, state, chase }] the rows as the board draws them
|
|
6
|
+
* waitsHtml(rows) → the block: pm-block "Waiting on other teams" with its count, a pm-li per row, an icon-only Chase button;
|
|
7
|
+
* '' with no row (zero is silence)
|
|
8
|
+
* chaseDraft(w, { by }) → { to, subject, body, mailto } a draft for the PM's own mail app. PMOS sends nothing.
|
|
9
|
+
*
|
|
10
|
+
* A row: "<initiative> → <team or what>", then "waiting since 4 Nov" (" · 21 days" once it is late), then, while its sprint runs,
|
|
11
|
+
* "Sprint 14 at risk" once. Text from records goes through esc(). The UI says PMOS. */
|
|
12
|
+
import { stateGlyph } from './state-glyph.js';
|
|
13
|
+
|
|
14
|
+
export const LATE_DAYS = 14;
|
|
15
|
+
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
16
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
17
|
+
/** "2026-11-04" → "4 Nov" */
|
|
18
|
+
export const dayWords = (d) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(d || '')); return m ? `${Number(m[3])} ${MON[Number(m[2]) - 1]}` : ''; };
|
|
19
|
+
const ICON_CHASE = 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0';
|
|
20
|
+
const SV = (d) => `<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
21
|
+
|
|
22
|
+
/** What the wait is on, in the fewest words: the team, else what it waits for. */
|
|
23
|
+
const onOf = (w) => w.team || w.what || 'another team';
|
|
24
|
+
|
|
25
|
+
export function rowsOf(waits, { today } = {}) {
|
|
26
|
+
return (Array.isArray(waits) ? waits : []).map((w) => {
|
|
27
|
+
const days = Number.isFinite(w.days) ? w.days : 0;
|
|
28
|
+
const late = days >= LATE_DAYS;
|
|
29
|
+
const atRisk = !!(w.sprint && w.sprint_end && (!today || w.sprint_end >= today));
|
|
30
|
+
const sub = ['waiting since ' + dayWords(w.since) + (late ? ` · ${days} ${days === 1 ? 'day' : 'days'}` : ''), atRisk ? `${/^sprint\b/i.test(w.sprint) ? w.sprint : 'Sprint ' + w.sprint} at risk` : '']
|
|
31
|
+
.filter(Boolean).join(' · ');
|
|
32
|
+
return { id: w.id, ws: w.ws || '', name: `${w.title || w.ini || 'Untitled'} → ${onOf(w)}`, what: w.team && w.what ? w.what : '', since: w.since, sub, state: late ? 'late' : 'wait', chase: w };
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function waitsHtml(rows) {
|
|
37
|
+
if (!rows || !rows.length) return '';
|
|
38
|
+
const row = (r, i) => `<div class="pm-li" role="listitem" data-tw="${esc(r.id)}">${stateGlyph(r.state, { size: 14 })}`
|
|
39
|
+
+ `<span class="txt"><span class="t">${esc(r.name)}</span><span class="w">${esc(r.sub)}${r.what ? ' · ' + esc(r.what) : ''}</span></span>`
|
|
40
|
+
+ `<span class="acts"><button type="button" class="pm-btn" data-tw-chase="${i}" aria-label="Chase${r.chase && r.chase.who ? ' ' + esc(r.chase.who) : ''}" title="Chase: a draft in your mail app">${SV(ICON_CHASE)}</button></span></div>`;
|
|
41
|
+
return `<section class="pm-block list tw-block" aria-label="Waiting on other teams"><div class="head"><h3 class="pm-h-sm">Waiting on other teams</h3><span class="sp"></span>`
|
|
42
|
+
+ `<span class="pm-meta">${rows.length}</span></div><div class="rows" role="list">${rows.map(row).join('')}</div></section>`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The Chase draft: to the wait's person when PMOS knows an address, else to nobody yet (the PM picks in the mail app). PMOS sends nothing. */
|
|
46
|
+
export function chaseDraft(w, { by = '' } = {}) {
|
|
47
|
+
const ini = w.title || w.ini || 'our work';
|
|
48
|
+
const on = w.what || w.team || 'this';
|
|
49
|
+
const to = /^[^\s@]+@[^\s@]+$/.test(w.email || '') ? w.email : '';
|
|
50
|
+
const hi = w.who ? `Hi ${String(w.who).split(/\s+/)[0]},` : 'Hi,';
|
|
51
|
+
const subject = `${ini}: waiting on ${on}`;
|
|
52
|
+
const body = [hi, '', `${ini} has been waiting on ${on}${w.key ? ' (' + w.key + ')' : ''} since ${dayWords(w.since)}.`
|
|
53
|
+
+ (w.sprint && w.sprint_end ? ` It holds up ${/^sprint\b/i.test(w.sprint) ? w.sprint : 'Sprint ' + w.sprint}, which ends ${dayWords(w.sprint_end)}.` : ''),
|
|
54
|
+
'Is there a date we can plan on, or anything you need from us?', '', 'Thanks', by].join('\n').trimEnd();
|
|
55
|
+
return { to, subject, body, mailto: 'mailto:' + encodeURIComponent(to).replace(/%40/g, '@') + '?subject=' + encodeURIComponent(subject) + '&body=' + encodeURIComponent(body) };
|
|
56
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* pm/tradeoff-cards.css — the trade-off line, the kept reason and the card (board TradeoffDS; pm/tradeoff-cards.js). Tokens only. */
|
|
2
|
+
.tc-line{padding:2px 0 2px 14px;border-top:1px dashed var(--line)}
|
|
3
|
+
.tc-open{display:inline-flex;align-items:center;gap:8px;border:0;background:none;color:var(--muted);font:inherit;font-size:var(--fs-meta);line-height:20px;padding:6px 8px;border-radius:var(--radius-sm);cursor:pointer}
|
|
4
|
+
@media (hover: hover){.tc-open:hover{background:var(--well);color:var(--ink)}}
|
|
5
|
+
.tc-open:focus-visible{outline:none;box-shadow:var(--glow)}
|
|
6
|
+
.tc-kept{display:flex;align-items:flex-start;gap:6px;margin:0;padding:0 8px 6px 14px;font-size:var(--fs-meta);line-height:20px;color:var(--muted)}
|
|
7
|
+
.tc-kept span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
|
|
8
|
+
.tc-kept svg,.tc-past svg{flex-shrink:0;margin-top:3px}
|
|
9
|
+
.tc-scrim{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:16px;background:color-mix(in srgb, var(--cz-ink) 28%, transparent)}
|
|
10
|
+
.tc-card{width:min(520px,100%);max-height:calc(100vh - 32px);overflow:auto;background:var(--card);color:var(--ink);border-radius:var(--radius-card);box-shadow:var(--lift);padding:var(--space-16) var(--space-24) var(--space-24);display:flex;flex-direction:column;gap:var(--space-12)}
|
|
11
|
+
.tc-h{display:flex;align-items:center;gap:4px}
|
|
12
|
+
.tc-t{flex:1;margin:0;display:flex;align-items:center;gap:8px;font-size:var(--fs-panel);line-height:24px;font-weight:var(--fw-panel)}
|
|
13
|
+
.tc-past{display:flex;gap:6px;margin:0;font-size:var(--fs-meta);line-height:20px;color:var(--muted)}
|
|
14
|
+
.tc-grid{background:var(--well);border-radius:var(--radius-md);padding:var(--space-4) 0}
|
|
15
|
+
.tc-r{display:grid;grid-template-columns:minmax(96px,.8fr) 1fr 1fr}
|
|
16
|
+
.tc-l{padding:6px 12px;font-size:var(--fs-meta);line-height:20px;color:var(--muted)}
|
|
17
|
+
.tc-v{padding:6px 12px;font-size:var(--fs-body);line-height:22px;background:var(--card)}
|
|
18
|
+
.tc-r:nth-child(2) .tc-v{border-top-left-radius:0}
|
|
19
|
+
.tc-col-h{padding:8px 12px;font-weight:var(--fw-row);background:var(--card)}
|
|
20
|
+
.tc-nk{color:var(--muted)}
|
|
21
|
+
.tc-sug{display:flex;gap:8px;margin:0;font-size:var(--fs-body);line-height:22px}
|
|
22
|
+
.tc-star{color:var(--blue)}
|
|
23
|
+
.tc-why{font-size:var(--fs-meta);line-height:20px;color:var(--muted)}
|
|
24
|
+
.tc-foot{display:flex;justify-content:flex-end;gap:8px}
|
|
25
|
+
.tc-foot .pm-btn{width:40px;height:40px}
|
|
26
|
+
.tc-err{margin:0;font-size:var(--fs-meta);color:var(--alert)}
|
|
27
|
+
@media (max-width:600px){.tc-r{grid-template-columns:1fr 1fr}.tc-l{grid-column:1 / -1;padding-bottom:0}.tc-r:first-child .tc-l{display:none}}
|