create-pmos 0.836.0 → 0.837.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 +51 -17
- 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/changelog.json +50 -2
- package/workspace/guide/cli.md +18 -0
- package/workspace/guide/layout.md +5 -1
- package/workspace/lib/built-vs-design-http.js +81 -0
- package/workspace/lib/built-vs-design.js +454 -0
- package/workspace/lib/deps-cli.js +47 -2
- package/workspace/lib/features.json +1 -0
- package/workspace/lib/needs-providers.js +1 -0
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/prefs-sync.js +1 -0
- package/workspace/lib/review-cli.js +6 -0
- package/workspace/lib/routes-pop-work.js +4 -1
- package/workspace/lib/routes-team-waits.js +39 -2
- package/workspace/lib/team-slips.js +160 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/ask-here-ctx.js +20 -2
- package/workspace/public/pm/ask-here.css +6 -1
- package/workspace/public/pm/ask-here.js +38 -25
- package/workspace/public/pm/bd-backlog.js +34 -5
- package/workspace/public/pm/built-vs-design.css +16 -0
- package/workspace/public/pm/built-vs-design.js +95 -0
- package/workspace/public/pm/cozy-events-view.js +1 -1
- package/workspace/public/pm/cozy-home.css +10 -0
- package/workspace/public/pm/cozy-pop-work.js +6 -4
- package/workspace/public/pm/cozy-today-view.js +4 -1
- package/workspace/public/pm/goals-ds.js +3 -2
- package/workspace/public/pm/home-chat.js +19 -3
- package/workspace/public/pm/ini-tasks.js +2 -2
- package/workspace/public/pm/page-chat.js +2 -1
- package/workspace/public/pm/team-slips.js +48 -0
- package/workspace/test-lists/built-vs-design.json +9 -0
- package/workspace/test-lists/team-slips.json +9 -0
|
@@ -38,6 +38,7 @@ import * as IF from './inline-fields.js'; // a task's sprint and priority, set
|
|
|
38
38
|
import * as SD from './star-draft.js'; // a ✦ draft runs as a PMOS background job and lands on its line (star-buttons-act-directly A7)
|
|
39
39
|
import * as CAP from './pop-cap.js'; // five actions at most: Ask PMOS and the toolbar's four, the rest under ⋯ (popup-cap, idea A498)
|
|
40
40
|
import { noteUse } from './use-log.js';
|
|
41
|
+
import * as BVD from './built-vs-design.js'; // the built screen beside its design, its circles, Accept and Send back (built-vs-design, A380)
|
|
41
42
|
import * as STMAP from './story-map.js'; // a new bet's story map with the Release 1 line (initiative story-map, A419)
|
|
42
43
|
import * as TLY from './three-layouts.js'; // three layouts for a new screen, pick one (initiative three-layouts, A317)
|
|
43
44
|
import * as PR from './print-pdf.js'; // Print or PDF under ⋯ (job #1911, A379)
|
|
@@ -108,7 +109,7 @@ export const resetItems = () => { ITEMS.clear(); CRIT.clear(); };
|
|
|
108
109
|
/* A chat turn may have written what the popup shows (initiative chat-saves-to-cards, Wawan 2026-11-23: the chat saved the case and the card
|
|
109
110
|
* kept saying no line is written): the popup's reads of one initiative (the case's artefacts, the Library's rows, the done test's criteria)
|
|
110
111
|
* were kept for the page's life, so they are read again after every chat turn, and when the page comes back into view. */
|
|
111
|
-
function rereadAll() { ART.clear(); ITEMS.clear(); CRIT.clear(); TLY.forget(); if (artRedraw) artRedraw(); }
|
|
112
|
+
function rereadAll() { ART.clear(); ITEMS.clear(); CRIT.clear(); BVD.reset(); TLY.forget(); if (artRedraw) artRedraw(); }
|
|
112
113
|
if (typeof document !== 'undefined' && document.addEventListener) {
|
|
113
114
|
document.addEventListener('cz:chat-turn', () => rereadAll());
|
|
114
115
|
document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'visible') rereadAll(); });
|
|
@@ -454,7 +455,7 @@ function model(r, v0, o) {
|
|
|
454
455
|
}
|
|
455
456
|
export function html(r, v, o = {}) {
|
|
456
457
|
const { W, S } = model(r, v, o), C = cols(), mode = store.get(SPAN, 'full');
|
|
457
|
-
if (phone() && !RO) return phoneHtml(W, S, keyOf(v, o), v);
|
|
458
|
+
if (phone() && !RO) return phoneHtml(W, S, keyOf(v, o), v).replace('<form class="pw-pask"', BVD.html(keyOf(v, o), o.ws) + '<form class="pw-pask"');
|
|
458
459
|
if (S.big) return `<div class="pw" data-pw-big-on>${breakdownHtml(W, C, mode, true, S)}</div>`;
|
|
459
460
|
if (!RO && !phone()) return dsHtml(r, v, o, W, S, C, mode);
|
|
460
461
|
return `<div class="pw">${overviewHtml(W, S, keyOf(v, o))}${breakdownHtml(W, C, mode, false, S)}${artefactsHtml(W.artefacts, C, true, { scope: keyOf(v, o), recPath: v.prd && (v.prd.path || v.prd) })}</div>`;
|
|
@@ -501,7 +502,7 @@ function dsHtml(r, v, o, W, S, C, mode) {
|
|
|
501
502
|
const ppl = SMAP.blockFor(id, o.ws, () => { if (artRedraw) artRedraw(); });
|
|
502
503
|
// the story map (A419): a new bet's journey and its Release 1 line, above the breakdown; nothing when there is no map and the bet has tasks
|
|
503
504
|
const smap = STMAP.blockHtml({ id, ws: o.ws || '', title: W.title || '', tasks: stagesOf(r, v, { ...o, today: W.today, subAll: true }).filter((x) => x.kind === 'task').length });
|
|
504
|
-
return `<div class="pw pwd">${PD.overviewHtml(W, r, { oid: id, dropped: dropped(), open: ovOpen() })}${ppl}<div class="pwd-main">${PD.stagesHtml(st, W)}${lay}${smap}${crit}${wbs}</div></div>`;
|
|
505
|
+
return `<div class="pw pwd">${PD.overviewHtml(W, r, { oid: id, dropped: dropped(), open: ovOpen() })}${ppl}<div class="pwd-main">${PD.stagesHtml(st, W)}${lay}${smap}${crit}${BVD.html(id, o.ws)}${wbs}</div></div>`;
|
|
505
506
|
}
|
|
506
507
|
|
|
507
508
|
/** The grouping ✦ the PM said no to, for this initiative: 'group:<stage>'. */
|
|
@@ -912,7 +913,7 @@ export function wire(body, h0, x0) {
|
|
|
912
913
|
// the Viewer reuses its body for the next item: the presses read the item shown now from the body, so one set of listeners serves all
|
|
913
914
|
body.__pwh = ED.writes(h0); body.__pwx = x0;
|
|
914
915
|
{ const o = x0 && x0.o ? x0.o() || {} : {}; ASK_AT = o.id ? { id: String(o.id), ws: o.ws || '' } : null; }
|
|
915
|
-
{ const c = cur(); if (c) { readItems(c.id, (x0.o() || {}).ws, () => redraw()); readCrit(c.id, (x0.o() || {}).ws, () => redraw()); if (!RO && !phone()) TLY.read((x0.o() || {}).ws, c.id, () => redraw()); if (c.S.top) body.scrollTop = c.S.top; }
|
|
916
|
+
{ const c = cur(); if (c) { readItems(c.id, (x0.o() || {}).ws, () => redraw()); readCrit(c.id, (x0.o() || {}).ws, () => redraw()); if (!RO && !phone()) TLY.read((x0.o() || {}).ws, c.id, () => redraw()); if (!RO) BVD.read(c.id, (x0.o() || {}).ws, () => redraw()); if (c.S.top) body.scrollTop = c.S.top; }
|
|
916
917
|
const q = OPEN_ON_DRAW;
|
|
917
918
|
if (c && q && q.id === String(c.id) && Date.now() - q.at < 15000) { OPEN_ON_DRAW = null; setTimeout(() => { const c2 = cur(); if (c2) openSmall(q.uid, c2, body.__pwh, body.__pwx, body); }, 0); } }
|
|
918
919
|
if (body.__pw) return;
|
|
@@ -953,6 +954,7 @@ export function wire(body, h0, x0) {
|
|
|
953
954
|
if (b.disabled || !body.contains(b)) return;
|
|
954
955
|
const c = cur(); if (!c) return;
|
|
955
956
|
const h = body.__pwh, x = body.__pwx;
|
|
957
|
+
if (BVD.press(b, h)) return; // the Review block: ✓ Accept, ↩ Send back as a fix (built-vs-design)
|
|
956
958
|
const d = b.dataset, S = c.S, W = c.W;
|
|
957
959
|
if (d.pwv) { store.set(VIEW, d.pwv); redraw(); return; }
|
|
958
960
|
if ('pwOv' in d) { try { localStorage.setItem(OV, ovOpen() ? '0' : '1'); } catch { /* a private window */ } redraw(); return; }
|
|
@@ -28,7 +28,10 @@ export function setCapShown(ids) { if (Array.isArray(ids) && ids.length) CAP_SHO
|
|
|
28
28
|
/** What a right-click on a Today row names (initiative ask-anywhere): its initiative when it has one, else the row itself. */
|
|
29
29
|
function askOf(r) {
|
|
30
30
|
if (r.ini) return ` data-ask="initiative:${esc(r.ini)}" data-ask-title="${esc(r.work || r.ini)}"${r.ws ? ` data-ask-ws="${esc(r.ws)}"` : ''}`;
|
|
31
|
-
|
|
31
|
+
// a morning-brief call of a "needs you" item (call:n:<key>) opens that item's viewer: need:<key>, or the Weekly update's own viewer
|
|
32
|
+
// (update) for its row (home-app.js openRow). Name the item it opens, so the Ask card's chat is that item's own.
|
|
33
|
+
const k = String(r.key || ''), n = /^call:n:/.test(k) ? k.slice(7) : null, id = n === null ? k : n === 'update' ? 'update' : 'need:' + n;
|
|
34
|
+
return ` data-ask="today item:${esc(id)}" data-ask-title="${esc(r.title || r.text || '')}"`;
|
|
32
35
|
}
|
|
33
36
|
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
34
37
|
const svg = (d, w = 15, sw = 1.9) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
@@ -169,10 +169,11 @@ export function tableHtml(p, o) {
|
|
|
169
169
|
left: (k) => `<td class="pm-meta">${esc(k.left)}</td>`,
|
|
170
170
|
levers: (k, ob, i) => `<td class="gl-lvs">${i === 0 ? ob.levers.map((l) => `<span><b>${esc(l.title)}</b> <span class="pm-meta${l.tone ? ' gl-al' : ''}">${esc(l.txt)}</span></span>`).join('') : ''}</td>`,
|
|
171
171
|
};
|
|
172
|
-
const group = (label, sub, extra = '') => `<tr class="gl-g"><td colspan="${n}"><div class="pm-group"><b>${esc(label)}</b><span>${esc(sub)}</span>${extra}</div></td></tr>`;
|
|
172
|
+
const group = (label, sub, extra = '', ask = '') => `<tr class="gl-g"${ask}><td colspan="${n}"><div class="pm-group"><b>${esc(label)}</b><span>${esc(sub)}</span>${extra}</div></td></tr>`;
|
|
173
173
|
let body = '';
|
|
174
174
|
for (const ob of T.objectives) {
|
|
175
|
-
|
|
175
|
+
// the objective is the record a right-click names (ask-anywhere)
|
|
176
|
+
body += group(ob.label + (ob.title ? ' · ' + ob.title : ''), noun(ob.krs.length, 'key result', 'key results'), '', ob.id ? ` data-ask="goal:${esc(ob.id)}" data-ask-title="${esc(ob.label + (ob.title ? ' · ' + ob.title : ''))}"` : '');
|
|
176
177
|
body += ob.krs.map((k, i) => `<tr><td class="gl-kr"><a href="#" class="gl-k" data-gl-ws="${esc(ws)}" data-gl-kr="${esc(k.key)}" title="${esc(k.sub)}">${esc(k.token)} · ${esc(k.title)}</a></td>`
|
|
177
178
|
+ cols.map(([c]) => cell[c](k, ob, i)).join('') + '</tr>').join('');
|
|
178
179
|
}
|
|
@@ -47,6 +47,18 @@ import { nextPromptUi } from './next-prompt-ui.js'; // the suggested next prom
|
|
|
47
47
|
import { cardsUi } from './chat-cards.js';
|
|
48
48
|
import { a2uiUi } from './a2ui-view.js'; // a2ui-inbound-render: another agent's A2UI v1.0 surface, drawn with PMOS's own parts; a press goes back as words // ask-cards-and-pickers: the rows an answer names, live, and a picker (canvas A2Cards, A2Ask)
|
|
49
49
|
import { runAction, routeOf } from './action-run.js';
|
|
50
|
+
|
|
51
|
+
/* The chat's text size, one for every chat (the person's choice, kept with their view choices: pmos.chat.fs, lib/prefs-sync.js). The page's
|
|
52
|
+
* <html data-chat-fs> sets it; cozy-home.css scales the chat's type roles from it. */
|
|
53
|
+
const FS = [['s', 'Small', 'A−'], ['m', 'Normal', 'A'], ['l', 'Large', 'A+']];
|
|
54
|
+
const FS_KEY = 'pmos.chat.fs';
|
|
55
|
+
export function chatFs() { try { const v = localStorage.getItem(FS_KEY); return FS.some((f) => f[0] === v) ? v : ''; } catch { return ''; } }
|
|
56
|
+
export function setChatFs(v) {
|
|
57
|
+
if (!FS.some((f) => f[0] === v)) return;
|
|
58
|
+
try { localStorage.setItem(FS_KEY, v); } catch { /* the size still shows on this page */ }
|
|
59
|
+
if (typeof document !== 'undefined') document.documentElement.dataset.chatFs = v;
|
|
60
|
+
}
|
|
61
|
+
if (typeof document !== 'undefined' && document.documentElement && chatFs()) document.documentElement.dataset.chatFs = chatFs();
|
|
50
62
|
import { tellCards } from './card-log.js'; // each answer's card list and each press to the local use log (card catalog rule 9, A511)
|
|
51
63
|
/* The views a chat opens go in the Viewer: on a page with no dialog the old viewer's views draw in the cozy card (premium-viewer.js). */
|
|
52
64
|
let REPORT_TAB = false; // a report tab was opened from a chat on this page: only then is premium-report-tab.js read at send
|
|
@@ -504,9 +516,12 @@ export function mountChat(el, host) {
|
|
|
504
516
|
// One box everywhere (testing fixes: a loose chat and an initiative's chat drew two different boxes): +, / and @ (in an initiative), the
|
|
505
517
|
// To: or In: chip, the mic and ↑ send. A loose session's "Link to an initiative" is in the + menu, and no hint line repeats under the box.
|
|
506
518
|
const link = sc.loose && t.sid ? '<button type="button" role="menuitem" data-hm-link><b>Link to an initiative</b><em>Move this chat under one</em></button>' : '';
|
|
507
|
-
|
|
508
|
-
const
|
|
509
|
-
|
|
519
|
+
// the chat's text size (Wawan 2026-11-25: "I can edit the font size on the chat, any chat"): three sizes in the + menu, kept for the person
|
|
520
|
+
const fsz = chatFs();
|
|
521
|
+
const size = '<span class="hm-fsz" role="group" aria-label="Text size"><b>Text size</b>' + FS.map(([k, n, a]) => `<button type="button" class="hm-fsb fs-${k}${fsz === k ? ' on' : ''}" data-hm-fs="${k}" aria-pressed="${fsz === k}" aria-label="${n} text" title="${n} text">${a}</button>`).join('') + '</span>';
|
|
522
|
+
const addOpen = !!C.addOpen;
|
|
523
|
+
const add = `<span class="hm-mw hm-addw"><button type="button" class="hm-tool" id="hmAdd" data-hm-add aria-haspopup="menu" aria-expanded="${addOpen}" aria-label="${t.key ? 'Attach a file, notes and more' : 'More'}" title="${t.key ? 'Attach a file' : 'More'}">${SVG(PLUS)}</button>`
|
|
524
|
+
+ `<span class="hm-pmenu hm-addm" role="menu" aria-label="Add"${addOpen ? ' data-esc-layer' : ' hidden'}>${attach}${notesBtn}${term}${link}${size}</span>${t.key ? '<input type="file" id="hmFile" multiple hidden>' : ''}</span>`;
|
|
510
525
|
const wait = C.conv && C.conv.ask && t.also ? `<button type="button" class="hm-chip" data-hm-also><i class="dot" aria-hidden="true"></i><span>1 more next step</span></button>` : '';
|
|
511
526
|
const to = t.to && !wait ? `<button type="button" class="hm-chip to" data-hm-to aria-label="Who reads this: ${esc(t.to.name)}. Change">${avHtml(t.to, 20)}<span>To: ${esc(t.to.name)}</span></button>` : '';
|
|
512
527
|
// chief-of-staff C5 (CsB): the soft "You are on …" chip of the chat over a page; × drops it (sc.drop), and the chip then reads Everything
|
|
@@ -632,6 +647,7 @@ export function mountChat(el, host) {
|
|
|
632
647
|
if (CU.owns(b)) { await CU.press(b); return; } // a row's button, a picker's choice, its ✓ or Undo (pm/chat-cards.js); any other button stays synchronous
|
|
633
648
|
const ic = b.closest('.hm-icard'), card = C.t && C.t.intro && C.t.intro.card;
|
|
634
649
|
if (ic && card && card.press) { if (await card.press(b)) draw(); return; }
|
|
650
|
+
if (d.hmFs) { setChatFs(d.hmFs); drawFoot({ role: role() }); return; } // the menu stays open: the size shows at once, and a second press is one step on
|
|
635
651
|
if ('hmMic' in d) { mic(); return; }
|
|
636
652
|
if (d.hmVer && C.t && C.t.ini) { import('./cozy-proto.js').then((M) => M.openVersion({ ws: C.t.ws, ini: C.t.ini, n: Number(d.hmVer) })).catch(() => {}); return; }
|
|
637
653
|
if (d.hmUnmark) { if (C.mark) C.mark[d.hmUnmark] = null; drawFoot({ role: role() }); return; }
|
|
@@ -107,7 +107,7 @@ const stageKeyOf = (v) => { const L = stagesOf(v), k = STAGE.get(v.id || v.key);
|
|
|
107
107
|
* view sheet (a bottom sheet on a phone, a popover under it on a desktop): View, Group by and Zoom, three rows of the same shape. ── */
|
|
108
108
|
export function viewBtnHtml(m) {
|
|
109
109
|
const x = VIEWS.find((y) => y[0] === m) || VIEWS[0];
|
|
110
|
-
return `<button type="button" class="ivx-vb" data-iv-vbtn aria-haspopup="dialog" aria-expanded="false" aria-label="${esc('Tasks view: ' + x[1] + '. Change the view, grouping or zoom')}" title="View, group and zoom">${SVG(x[2], 18)}${SVG(P.down, 13, 2.2)}</button>`;
|
|
110
|
+
return `<button type="button" class="ivx-vb" data-iv-vbtn aria-haspopup="dialog" aria-expanded="${POP && POP.el.isConnected && POP.el.querySelector('.ivs') ? 'true' : 'false'}" aria-label="${esc('Tasks view: ' + x[1] + '. Change the view, grouping or zoom')}" title="View, group and zoom">${SVG(x[2], 18)}${SVG(P.down, 13, 2.2)}</button>`;
|
|
111
111
|
}
|
|
112
112
|
/** The Kanban's stage picker (or group picker): at the top of the Kanban, not in the header. */
|
|
113
113
|
export function kanbanPickHtml(v) {
|
|
@@ -588,7 +588,7 @@ function rehang(P) {
|
|
|
588
588
|
if (!n || P.el.contains(n)) return;
|
|
589
589
|
P.anchor = n; n.setAttribute('aria-expanded', 'true'); const r = n.getBoundingClientRect(); P.at = [r.left, r.top];
|
|
590
590
|
}
|
|
591
|
-
export function closePop() { if (!POP) return; const { el, anchor, scrim } = POP; POP = null; el.remove(); if (scrim) scrim.remove(); if (anchor && anchor.isConnected) anchor.setAttribute('aria-expanded', 'false'); }
|
|
591
|
+
export function closePop() { if (!POP) return; const { el, anchor, scrim } = POP; POP = null; el.remove(); if (scrim) scrim.remove(); if (anchor && anchor.isConnected) anchor.setAttribute('aria-expanded', 'false'); document.querySelectorAll('[data-iv-vbtn][aria-expanded="true"]').forEach((b) => b.setAttribute('aria-expanded', 'false')); } // a redraw while open drew a new button as expanded
|
|
592
592
|
/** o.sheet: a bottom sheet over a scrim (a phone); o.right: the popover's right edge under the press's right edge. */
|
|
593
593
|
export function openPop(anchor, html, onPress, o = {}) {
|
|
594
594
|
closePop(); cardStyle();
|
|
@@ -126,9 +126,10 @@ export function itemTarget(it, ws) {
|
|
|
126
126
|
const kind = String((it && it.kind) || 'item').trim().toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') || 'item';
|
|
127
127
|
const id = String((it && it.id) || '').replace(/[^A-Za-z0-9._:-]+/g, '-').replace(/^[^A-Za-z0-9]+/, '');
|
|
128
128
|
if (!id || !title) return null;
|
|
129
|
+
const where = String((it && it.where) || '').replace(/\s+/g, ' ').trim().slice(0, 40); // the field pressed (ask-here.js): "In: <title> › <field>"
|
|
129
130
|
const key = ('pop:' + kind + ':' + id).slice(0, 104);
|
|
130
131
|
const facts = (Array.isArray(it.facts) ? it.facts : []).filter((f) => Array.isArray(f) && f[1] != null && String(f[1]).trim()).slice(0, 12).map(([a, b]) => [String(a), String(b)]);
|
|
131
|
-
return { key, ws: ws || undefined, title, about: title, role: CLAUDE, rich: false, popAbout: true, scope: { text: 'In: ' + title, icon: PIN, drop: true },
|
|
132
|
+
return { key, ws: ws || undefined, title, about: title, role: CLAUDE, rich: false, popAbout: true, scope: { text: 'In: ' + title + (where ? ' › ' + where : ''), icon: PIN, drop: true },
|
|
132
133
|
context: { title, subject: String(it.subject || ''), say: String(it.say || ''), facts }, placeholder: 'Ask or tell PMOS', empty: COS_EMPTY };
|
|
133
134
|
}
|
|
134
135
|
export function cosTarget(here, ws) {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* pm/team-slips.js — "Upstream" on Work › Dependencies: other teams' slips, before they hit you (initiative team-slips, bet A15; board
|
|
2
|
+
* BatchMoreADS panel 27). Pure: Node imports it (team-slips.test.js). Rows come from GET /api/team-slips (lib/team-slips.js slipsOf).
|
|
3
|
+
*
|
|
4
|
+
* rowsOf(slips) → [{ key, ws, name, sub, state, move, act, ini, chase }] one row per slip, as the board draws them
|
|
5
|
+
* slipsHtml(rows, { watching }) → the block: pm-block "Upstream" with "Watching n boards your work waits on", a pm-li per slip, an
|
|
6
|
+
* icon-only ✦ (the one move) and an icon-only wave-off; '' with no slip (zero is silence)
|
|
7
|
+
* chaseDraft(s, { by }) → { to, subject, body, mailto } a draft for the PM's own mail app. PMOS sends nothing.
|
|
8
|
+
*
|
|
9
|
+
* A row: "<team> will likely slip to 9 Dec", then "was 2 Dec · your <what> is 5 Dec". ✦ shifts your date (it opens the initiative, whose
|
|
10
|
+
* owner moves the date) when the slip lands on or past your date, else it opens a chase draft. Text from records goes through esc().
|
|
11
|
+
* The UI says PMOS. */
|
|
12
|
+
import { stateGlyph } from './state-glyph.js';
|
|
13
|
+
import { esc, dayWords } from './team-waits.js';
|
|
14
|
+
|
|
15
|
+
const ICON_SPARK = 'M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z';
|
|
16
|
+
const ICON_X = 'M6 6l12 12M18 6L6 18';
|
|
17
|
+
const SV = (d) => `<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
18
|
+
|
|
19
|
+
export function rowsOf(slips) {
|
|
20
|
+
return (Array.isArray(slips) ? slips : []).map((s) => {
|
|
21
|
+
const act = s.move === 'shift' ? `Shift your date to ${dayWords(s.shift_to)}` : `Chase ${s.who || s.team || 'them'}`;
|
|
22
|
+
const sub = [`was ${dayWords(s.theirs)}`, s.yours ? `your ${s.yours_what || s.title || 'date'} is ${dayWords(s.yours)}` : ''].filter(Boolean).join(' · ');
|
|
23
|
+
return { key: s.key, ws: s.ws || '', name: `${s.team || s.from || s.key} will likely slip to ${dayWords(s.likely)}`, sub,
|
|
24
|
+
state: s.hits ? 'late' : 'wait', move: s.move, act, ini: s.ini || '', chase: s };
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function slipsHtml(rows, { watching = 0 } = {}) {
|
|
29
|
+
if (!rows || !rows.length) return '';
|
|
30
|
+
const row = (r, i) => `<div class="pm-li" role="listitem" data-ts="${esc(r.key)}">${stateGlyph(r.state, { size: 14 })}`
|
|
31
|
+
+ `<span class="txt"><span class="t">${esc(r.name)}</span><span class="w">${esc(r.sub)}</span></span>`
|
|
32
|
+
+ `<span class="acts"><button type="button" class="pm-btn" data-ts-go="${i}" aria-label="${esc(r.act)}" title="✦ ${esc(r.act)}">${SV(ICON_SPARK)}</button>`
|
|
33
|
+
+ `<button type="button" class="pm-btn" data-ts-skip="${i}" aria-label="Wave off this slip" title="Wave off: the row goes until a later date">${SV(ICON_X)}</button></span></div>`;
|
|
34
|
+
const n = Number(watching) || 0;
|
|
35
|
+
return `<section class="pm-block list ts-block" aria-label="Upstream"><div class="head"><h3 class="pm-h-sm">Upstream</h3><span class="sp"></span>`
|
|
36
|
+
+ `<span class="pm-meta">Watching ${n} ${n === 1 ? 'board' : 'boards'} your work waits on</span></div><div class="rows" role="list">${rows.map(row).join('')}</div></section>`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The chase draft for a slip: to the wait's person when PMOS knows an address. PMOS sends nothing. */
|
|
40
|
+
export function chaseDraft(s, { by = '' } = {}) {
|
|
41
|
+
const ini = s.title || s.ini || 'our work';
|
|
42
|
+
const to = /^[^\s@]+@[^\s@]+$/.test(s.email || '') ? s.email : '';
|
|
43
|
+
const hi = s.who ? `Hi ${String(s.who).split(/\s+/)[0]},` : 'Hi,';
|
|
44
|
+
const subject = `${ini}: ${s.key} now looks like ${dayWords(s.likely)}`;
|
|
45
|
+
const body = [hi, '', `${s.key} was due ${dayWords(s.theirs)} and now looks like ${dayWords(s.likely)}.`
|
|
46
|
+
+ (s.yours ? ` ${ini} needs it for ${dayWords(s.yours)}.` : ''), 'Is the new date firm, and is there anything we can do to help it land sooner?', '', 'Thanks', by].join('\n').trimEnd();
|
|
47
|
+
return { to, subject, body, mailto: 'mailto:' + encodeURIComponent(to).replace(/%40/g, '@') + '?subject=' + encodeURIComponent(subject) + '&body=' + encodeURIComponent(body) };
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Built screen beside its design (initiative built-vs-design, job #1903, A380; done test V1-V7, N1-N3): the PNG reader, the numbered differences, pmos review on a scratch repository, the routes with a fake context, the Review block's markup, the guide. No server, browser, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"built-vs-design.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"built-vs-design.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Other teams' slips (initiative team-slips, bet A15, done test S1-S7, N1, N2): the store, pmos deps slips, the Today row, the Upstream block and /api/team-slips. Fixture repos; no browser, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"team-slips.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"team-slips.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|