create-pmos 0.851.0 → 0.852.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 +79 -105
- package/payload/AGENTS.md +63 -0
- 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 +78 -22
- package/workspace/guide/cli.md +20 -0
- package/workspace/guide/initiatives-and-next-steps.md +11 -0
- package/workspace/guide/programs.md +1 -0
- package/workspace/lib/features.json +2 -0
- package/workspace/lib/knowledge-cli.js +6 -0
- package/workspace/lib/on-item-routes.js +68 -0
- package/workspace/lib/on-item.js +272 -0
- package/workspace/lib/one-person-knows.js +403 -0
- package/workspace/lib/pmos-verbs.js +6 -0
- package/workspace/lib/route-modules.js +2 -0
- package/workspace/lib/routes-capture.js +1 -1
- package/workspace/lib/routes-one-person-knows.js +40 -0
- package/workspace/lib/routes-screen-map.js +47 -0
- package/workspace/lib/routes-stage-signoffs.js +4 -1
- package/workspace/lib/screen-map.js +381 -0
- package/workspace/lib/signoffs.js +4 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-prog-panel.js +25 -1
- package/workspace/public/pm/cozy-board.css +3 -0
- package/workspace/public/pm/cozy-pop-work.js +5 -2
- package/workspace/public/pm/home-app.js +5 -0
- package/workspace/public/pm/on-item.js +155 -0
- package/workspace/public/pm/one-person-knows.js +66 -0
- package/workspace/public/pm/premium-board.js +2 -0
- package/workspace/public/pm/screen-map.css +23 -0
- package/workspace/public/pm/screen-map.js +187 -0
- package/workspace/public/premium-board.html +2 -0
- package/workspace/test-lists/kit-agents-verbs.json +9 -0
- package/workspace/test-lists/one-person-knows.json +9 -0
- package/workspace/test-lists/screen-map.json +9 -0
- package/workspace/test-lists/surface-on-item.json +9 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/* pm/on-item.js — what PMOS can do for the open initiative shows on it, with no typed ask (job #1986, surface-on-item; LINE.md Rule 12;
|
|
2
|
+
* board SfA on the Exploring 3 canvas, page `surface`, agreed 2026-11-25). The data is GET /api/on-item (lib/on-item.js readOf).
|
|
3
|
+
*
|
|
4
|
+
* blockHtml(d) the Sign-offs block: each open sign-off, what that person asked before (with its source), and, with no
|
|
5
|
+
* source yet, the lines in the initiative's files where they may have said yes, each with an icon-only ✓.
|
|
6
|
+
* '' when no sign-off is open (zero is silence). PURE
|
|
7
|
+
* linesHtml(d, st) the ✦ lines: the numbers that tell whether the experiment can conclude, and the press release at Plan. PURE
|
|
8
|
+
* sideFor(ini, ws, stage, redraw) → both, for the popup drawn now: reads GET /api/on-item once per initiative and stage, then draws from memory
|
|
9
|
+
* press(e, body, { say }) the popup's click listener hands each press here first; true when it was one of these
|
|
10
|
+
*
|
|
11
|
+
* Every ✓ writes on the PM's press only and offers Undo (lib/on-item-routes.js). The numbers draft runs as the ✦ background draft
|
|
12
|
+
* (pm/star-draft.js run) and lands on its line for ✓; nothing is kept before. Built from the system parts: pm-block, pm-said, pm-btn,
|
|
13
|
+
* pm-meta. The UI says PMOS, never Claude. */
|
|
14
|
+
import { pmGet, pmPost } from './http.js';
|
|
15
|
+
import { noteUse } from './use-log.js';
|
|
16
|
+
import { undoToast } from './hi-pop.js';
|
|
17
|
+
import * as SD from './star-draft.js';
|
|
18
|
+
|
|
19
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
20
|
+
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>`;
|
|
21
|
+
const I = { spark: 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', check: 'M5 12.5l4.5 4.5L19 7.5', x: 'M6 6l12 12M18 6L6 18', open: 'M14 4h6v6M20 4l-9 9M18 14v6H4V6h6' };
|
|
22
|
+
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>`;
|
|
23
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
24
|
+
const day = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? +m[3] + ' ' + MON[+m[2] - 1] : ''; };
|
|
25
|
+
const KIND = { signoff: 'had to say yes to', answer: 'said', objection: 'objected' };
|
|
26
|
+
|
|
27
|
+
/** The Sign-offs block. d: GET /api/on-item. */
|
|
28
|
+
export function blockHtml(d) {
|
|
29
|
+
const S = (d && d.signoffs) || [];
|
|
30
|
+
if (!S.length) return '';
|
|
31
|
+
const one = (s) => {
|
|
32
|
+
const head = `<p class="oi-h"><b>${esc(s.who)}</b> <span>signs off ${esc(s.what)}</span>${s.asked ? ` <span class="pm-meta">· asked ${esc(day(s.asked))}</span>` : ''}</p>`;
|
|
33
|
+
const past = s.past && s.past.length ? `<div class="oi-past" role="list" aria-label="${esc('What ' + s.who + ' asked before')}"><p class="pm-meta">Asked before</p>${s.past.map((p) =>
|
|
34
|
+
`<p class="oi-pi" role="listitem">${esc(KIND[p.kind] || '')} “${esc(p.text)}”<span class="pm-meta"> · ${esc([p.ini, day(p.date), p.source].filter(Boolean).join(' · '))}</span></p>`).join('')}</div>` : '';
|
|
35
|
+
const ev = s.evidence ? `<p class="oi-ev${s.evidence.ok ? '' : ' warn'}">${SV(I.check, 14)}<span>Their yes: “${esc(s.evidence.quote)}” <span class="pm-meta">· ${esc(s.evidence.ref)}${s.evidence.ok ? ' · Today can record it' : ' · ' + esc(s.evidence.why)}</span></span></p>` : '';
|
|
36
|
+
const picks = !s.evidence && s.picks && s.picks.length ? `<div class="pm-said oi-picks" role="group" aria-label="${esc('Where ' + s.who + ' may have said yes')}">${SV(I.spark, 14)}<div><p>Did ${esc(s.who)} say yes here?</p>${s.picks.map((k, i) =>
|
|
37
|
+
`<p class="oi-pk"><span>“${esc(k.quote)}” <span class="pm-meta">· ${esc(k.ref)}</span></span>${btn(`data-oi-act="pick" data-oi-id="${esc(s.id)}" data-oi-n="${i}"`, 'Yes, this is their yes', I.check, 'primary')}</p>`).join('')}</div></div>` : '';
|
|
38
|
+
return `<div class="oi-so" data-oi-so="${esc(s.id)}">${head}${past}${ev}${picks}</div>`;
|
|
39
|
+
};
|
|
40
|
+
return `<section class="pm-block pwd-blk oi-block" aria-label="Sign-offs" data-oi-ini="${esc(d.ini || '')}" data-oi-ws="${esc(d.ws || '')}"><h2 class="pm-h-sm">Sign-offs</h2>${S.map(one).join('')}</section>`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The ✦ lines. st: what this page holds for them { draft: { state, text, why } | null, dropped: Set }. */
|
|
44
|
+
export function linesHtml(d, st = {}) {
|
|
45
|
+
if (!d) return '';
|
|
46
|
+
const dropped = st.dropped || new Set(), out = [];
|
|
47
|
+
const N = d.numbers;
|
|
48
|
+
if (N && !dropped.has('numbers')) {
|
|
49
|
+
const dr = st.draft || null;
|
|
50
|
+
if (dr && dr.state === 'pending') out.push(SD.pendingHtml('the numbers'));
|
|
51
|
+
else if (dr && dr.state === 'ready') out.push(`<div class="pm-said oi-line" role="group" aria-label="Draft of the numbers">${SV(I.spark, 14)}<div><p>Can it conclude by ${esc(day(N.due))}? PMOS drafted the numbers from the records:</p><pre class="oi-pre">${esc(dr.text)}</pre></div>`
|
|
52
|
+
+ `<span class="oi-b">${btn('data-oi-act="numbers-keep"', 'Keep these numbers', I.check, 'primary')}${btn('data-oi-act="numbers-drop"', 'Not these', I.x)}</span></div>`);
|
|
53
|
+
else out.push(`<div class="pm-said oi-line" role="group" aria-label="Can it conclude?">${SV(I.spark, 14)}<p>Can it conclude by ${esc(day(N.due))}? PMOS can tell once the record has a baseline, the smallest change worth seeing and the weekly traffic.${dr && dr.why ? ' <span class="pm-meta">' + esc(dr.why) + '</span>' : ''}</p>`
|
|
54
|
+
+ `<span class="oi-b">${btn('data-oi-act="numbers"', 'Yes, draft the numbers', I.check, 'primary')}${btn('data-oi-act="no" data-oi-what="numbers"', 'No', I.x)}</span></div>`);
|
|
55
|
+
}
|
|
56
|
+
const P = d.press;
|
|
57
|
+
if (P && !dropped.has('press')) {
|
|
58
|
+
out.push(P.state === 'drafting' ? `<p class="pm-meta oi-line" role="status">${SV(I.spark, 14)} ${esc(P.say)}</p>`
|
|
59
|
+
: `<div class="pm-said oi-line" role="group" aria-label="Press release and FAQ">${SV(I.spark, 14)}<p>${esc(P.say)}</p><span class="oi-b">${btn('data-oi-act="press"', 'Yes, draft the press release', I.check, 'primary')}${btn('data-oi-act="no" data-oi-what="press"', 'No', I.x)}</span></div>`);
|
|
60
|
+
}
|
|
61
|
+
return out.length ? `<section class="pm-block pwd-blk oi-lines" aria-label="PMOS can do this now" data-oi-ini="${esc(d.ini || '')}" data-oi-ws="${esc(d.ws || '')}">${out.join('')}</section>` : '';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* ── the popup ── */
|
|
65
|
+
const ST = new Map(); // ws|ini → { d: data | null while reading | false, stage, draft, dropped }
|
|
66
|
+
const kOf = (ini, ws) => (ws || '') + '|' + ini;
|
|
67
|
+
const DROP = 'oi-dropped';
|
|
68
|
+
const droppedOf = (ini) => { try { return new Set((JSON.parse(localStorage.getItem(DROP) || '{}')[ini]) || []); } catch { return new Set(); } };
|
|
69
|
+
const keepDrop = (ini, set) => { try { const all = JSON.parse(localStorage.getItem(DROP) || '{}'); all[ini] = [...set]; localStorage.setItem(DROP, JSON.stringify(all)); } catch { /* a private window */ } };
|
|
70
|
+
let CSS_DONE = false, lastRedraw = null;
|
|
71
|
+
function css() {
|
|
72
|
+
if (CSS_DONE || typeof document === 'undefined' || !document.head) return;
|
|
73
|
+
CSS_DONE = true;
|
|
74
|
+
const s = document.createElement('style');
|
|
75
|
+
s.textContent = '.oi-block .oi-so+.oi-so{border-top:1px solid var(--line);margin-top:8px;padding-top:8px}.oi-block .oi-h{margin:4px 0}.oi-block .oi-past p{margin:2px 0}'
|
|
76
|
+
+ '.oi-block .oi-ev{display:flex;gap:6px;align-items:flex-start;margin:6px 0 0}.oi-block .oi-ev.warn{color:var(--state-late)}'
|
|
77
|
+
+ '.oi-block .oi-picks,.oi-lines .oi-line{max-width:none;margin:8px 0 0;align-items:flex-start}.oi-picks>svg,.oi-line>svg{color:var(--blue);flex:none;margin-top:3px}'
|
|
78
|
+
+ '.oi-block .oi-pk{display:flex;gap:6px;align-items:flex-start;justify-content:space-between;margin:4px 0}.oi-lines .oi-line p{flex:1;margin:0}'
|
|
79
|
+
+ '.oi-lines .oi-b{display:flex;gap:4px}.oi-lines .oi-pre{white-space:pre-wrap;font:inherit;margin:4px 0 0}.oi-lines p.oi-line{display:flex;gap:6px}';
|
|
80
|
+
document.head.appendChild(s);
|
|
81
|
+
}
|
|
82
|
+
function load(ini, ws, stage) {
|
|
83
|
+
const k = kOf(ini, ws), cur = ST.get(k) || { draft: null, dropped: droppedOf(ini) };
|
|
84
|
+
ST.set(k, { ...cur, d: cur.d || null, stage });
|
|
85
|
+
pmGet('/api/on-item?ini=' + encodeURIComponent(ini) + '&stage=' + encodeURIComponent(stage || '') + (ws ? '&ws=' + encodeURIComponent(ws) : ''))
|
|
86
|
+
.then((x) => { const s = ST.get(k); if (!s) return; s.d = x && x.ok ? { ...x, ini, ws: ws || '' } : false; if (lastRedraw) lastRedraw(); })
|
|
87
|
+
.catch(() => { const s = ST.get(k); if (s) s.d = false; });
|
|
88
|
+
}
|
|
89
|
+
/** Both parts for the popup drawn now: the ✦ lines (under the Overview) and the Sign-offs block. */
|
|
90
|
+
export function sideFor(ini, ws, stage, redraw) {
|
|
91
|
+
if (!ini) return { lines: '', block: '' };
|
|
92
|
+
lastRedraw = redraw;
|
|
93
|
+
const k = kOf(ini, ws), s = ST.get(k);
|
|
94
|
+
if (!s || s.stage !== (stage || '')) load(ini, ws, stage || '');
|
|
95
|
+
const t = ST.get(k);
|
|
96
|
+
if (!t || !t.d) return { lines: '', block: '' };
|
|
97
|
+
css();
|
|
98
|
+
return { lines: linesHtml(t.d, t), block: blockHtml(t.d) };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const toast = (say, t) => { if (say) say(t); };
|
|
102
|
+
async function act(b, sec, say) {
|
|
103
|
+
const ini = sec.dataset.oiIni, ws = sec.dataset.oiWs || '', k = kOf(ini, ws), s = ST.get(k);
|
|
104
|
+
if (!s || !s.d) return;
|
|
105
|
+
const a = b.dataset.oiAct, again = () => load(ini, ws, s.stage);
|
|
106
|
+
if (a === 'no') { s.dropped.add(b.dataset.oiWhat); keepDrop(ini, s.dropped); if (lastRedraw) lastRedraw(); return; }
|
|
107
|
+
if (a === 'pick') {
|
|
108
|
+
const so = (s.d.signoffs || []).find((x) => x.id === b.dataset.oiId), pk = so && so.picks[+b.dataset.oiN];
|
|
109
|
+
if (!pk) return;
|
|
110
|
+
b.disabled = true;
|
|
111
|
+
const r = await pmPost('/api/on-item/evidence', { ws: ws || null, ini, id: so.id, ref: pk.ref, quote: pk.quote }).catch(() => null);
|
|
112
|
+
if (!r || !r.ok) { b.disabled = false; toast(say, (r && r.error) || 'Not saved. The server did not say why.'); return; }
|
|
113
|
+
noteUse('onItemEvidence');
|
|
114
|
+
again();
|
|
115
|
+
undoToast(`Saved as ${so.who}'s yes. Today can record the sign-off.`, async () => { const u = await pmPost('/api/on-item/evidence', { ws: ws || null, ini, id: so.id, undo: true, before: r.before || null }).catch(() => null); again(); return u || { ok: false }; });
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (a === 'numbers') {
|
|
119
|
+
s.draft = { state: 'pending' }; if (lastRedraw) lastRedraw();
|
|
120
|
+
const r = await SD.run(s.d.numbers.ask, { ws: ws || null, pmPost, pmGet });
|
|
121
|
+
s.draft = r.ok ? { state: 'ready', text: r.text } : { state: 'failed', why: r.why };
|
|
122
|
+
if (lastRedraw) lastRedraw();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (a === 'numbers-drop') { s.draft = null; if (lastRedraw) lastRedraw(); return; }
|
|
126
|
+
if (a === 'numbers-keep') {
|
|
127
|
+
const v = {};
|
|
128
|
+
for (const l of String((s.draft && s.draft.text) || '').split(/\n/)) { const m = /^\s*(baseline|min_change|weekly_traffic)\s*:\s*(.+?)\s*$/i.exec(l); if (m) v[m[1].toLowerCase()] = m[2]; }
|
|
129
|
+
b.disabled = true;
|
|
130
|
+
const r = await pmPost('/api/on-item/numbers', { ws: ws || null, ini, ...v }).catch(() => null);
|
|
131
|
+
if (!r || !r.ok) { b.disabled = false; toast(say, (r && r.error) || 'Not saved. The server did not say why.'); return; }
|
|
132
|
+
noteUse('onItemNumbers');
|
|
133
|
+
s.draft = null; again();
|
|
134
|
+
undoToast('The numbers are in the record. Can it conclude? shows in the Overview.', async () => { const u = await pmPost('/api/on-item/numbers', { ws: ws || null, ini, undo: true, before: r.before }).catch(() => null); again(); return u || { ok: false }; });
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (a === 'press') {
|
|
138
|
+
b.disabled = true;
|
|
139
|
+
const r = await pmPost('/api/on-item/press-release', { ws: ws || null, ini }).catch(() => null);
|
|
140
|
+
if (!r || !r.ok) { b.disabled = false; toast(say, (r && r.error) || 'PMOS could not start the draft. The server did not say why.'); return; }
|
|
141
|
+
noteUse('onItemPress');
|
|
142
|
+
again();
|
|
143
|
+
undoToast('PMOS is drafting the press release and FAQ. It lands in Artefacts.', async () => { const u = await pmPost('/api/on-item/press-release', { ws: ws || null, ini, undo: true }).catch(() => null); again(); return u || { ok: false }; });
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/** The popup's click listener hands each press here first; true when it was one of these. */
|
|
147
|
+
export function press(e, body, { say } = {}) {
|
|
148
|
+
const b = e.target.closest && e.target.closest('[data-oi-act]');
|
|
149
|
+
if (!b || !body || !body.contains(b)) return false;
|
|
150
|
+
const sec = b.closest('[data-oi-ini]');
|
|
151
|
+
if (!sec) return false;
|
|
152
|
+
e.stopImmediatePropagation();
|
|
153
|
+
act(b, sec, say);
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* pm/one-person-knows.js — "Only one person knows this": the areas of a product that one person alone touched in 6 months, under the
|
|
2
|
+
* Principles on Work when it shows one product (initiative one-person-knows, job #1899, idea A391; board BatchPeopleDS panel 12).
|
|
3
|
+
*
|
|
4
|
+
* mount(host, { ws, single, say }) → draws the block into `host`; a Work page that shows several products at once shows none
|
|
5
|
+
*
|
|
6
|
+
* Built only from Komorebi parts: a list block (pm-block, its head, pm-meta), pm-li rows, the at-risk state glyph (pm/state-glyph.js) and an
|
|
7
|
+
* icon-only pm-btn. It reads and writes GET and POST /api/one-person-knows (lib/routes-one-person-knows.js) and nothing else.
|
|
8
|
+
* · Each row: the area, and "only <person>, <n> months". The head: "<n> of <m> areas".
|
|
9
|
+
* · Before the person's leave, the row has a ✦ (bdKnowPlan): a pairing with the nearest teammate or a short write-up. A press plans it
|
|
10
|
+
* and offers Undo in Work's toast; the row then says what was planned.
|
|
11
|
+
* · Zero is silence: when every area has two people, no block.
|
|
12
|
+
* The ✦ notes bdKnowPlan in the local use log (noteUse), which counts its use (the bet's kill line). */
|
|
13
|
+
import { pmGet, pmPost } from './http.js';
|
|
14
|
+
import { noteUse } from './use-log.js';
|
|
15
|
+
import { stateGlyph } from './state-glyph.js';
|
|
16
|
+
|
|
17
|
+
const API = '/api/one-person-knows';
|
|
18
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
19
|
+
const SPARK = '<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z"/></svg>';
|
|
20
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
21
|
+
const short = (d) => (/^\d{4}-\d{2}-\d{2}$/.test(String(d || '')) ? (+d.slice(8, 10)) + ' ' + MON[+d.slice(5, 7) - 1] : '');
|
|
22
|
+
|
|
23
|
+
/** "only Sam, 6 months" */
|
|
24
|
+
export const whoLine = (a) => `only ${a.person}, ${a.months} ${a.months === 1 ? 'month' : 'months'}`;
|
|
25
|
+
/** The ✦'s label: what the press does. */
|
|
26
|
+
export const suggestLabel = (s) => (s.plan === 'pairing' ? `Plan a pairing with ${s.partner}` : 'Draft a short write-up') + (s.before ? ` before ${short(s.before)}` : '');
|
|
27
|
+
export const planLine = (p) => (p.plan === 'pairing' ? `pairing with ${p.partner} planned` : 'write-up drafted') + (p.before ? ` before ${short(p.before)}` : '');
|
|
28
|
+
|
|
29
|
+
/** The block's markup. state = { areas, total }. Pure, so the test reads it. '' when no area is known by one person (zero is silence). */
|
|
30
|
+
export function blockHtml(state) {
|
|
31
|
+
const areas = Array.isArray(state && state.areas) ? state.areas : [];
|
|
32
|
+
if (!areas.length) return '';
|
|
33
|
+
const total = Number(state.total) || areas.length;
|
|
34
|
+
const row = (a) => {
|
|
35
|
+
const sub = [whoLine(a), a.plan ? planLine(a.plan) : ''].filter(Boolean).join(' · ');
|
|
36
|
+
const act = !a.plan && a.suggest
|
|
37
|
+
? `<span class="acts"><button type="button" class="pm-btn" name="bdKnowPlan" value="${esc(a.key)}" aria-label="${esc(suggestLabel(a.suggest))}" title="${esc(suggestLabel(a.suggest))}">${SPARK}</button></span>` : '';
|
|
38
|
+
return `<div class="pm-li${act ? ' know-due' : ''}" role="listitem" data-know-row="${esc(a.key)}">${stateGlyph('risk', { size: 14 })}<span class="txt"><span class="t">${esc(a.label)}</span><span class="w">${esc(sub)}</span></span>${act}</div>`;
|
|
39
|
+
};
|
|
40
|
+
return `<section class="pm-block list" aria-label="One-person areas"><div class="head"><h3 class="pm-h-sm">One-person areas</h3><span class="sp"></span><span class="pm-meta">${areas.length} of ${total} areas</span></div>`
|
|
41
|
+
+ `<div class="rows" role="list">${areas.map(row).join('')}</div></section>`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Draw the block into `host` and wire its ✦. */
|
|
45
|
+
export async function mount(host, opts = {}) {
|
|
46
|
+
if (!host) return;
|
|
47
|
+
const { ws = null, single = true, say = null } = opts;
|
|
48
|
+
if (!single) { host.hidden = true; host.innerHTML = ''; return; }
|
|
49
|
+
let r = null; try { r = await pmGet(API + (ws ? '?ws=' + encodeURIComponent(ws) : '')); } catch { r = null; }
|
|
50
|
+
if (!r || !r.ok) { host.hidden = true; return; } // an extra: a failed read leaves Work as it was
|
|
51
|
+
const html = blockHtml(r);
|
|
52
|
+
host.hidden = !html; host.innerHTML = html;
|
|
53
|
+
host.onclick = async (e) => {
|
|
54
|
+
const b = e.target.closest('button[name="bdKnowPlan"]'); if (!b) return;
|
|
55
|
+
const area = b.value;
|
|
56
|
+
noteUse(b.name);
|
|
57
|
+
b.disabled = true;
|
|
58
|
+
const res = await pmPost(API, { ws, act: 'plan', area }).catch(() => null);
|
|
59
|
+
if (!res || !res.ok) { b.disabled = false; if (say) say((res && res.error) || 'Not planned.'); return; }
|
|
60
|
+
if (say) say(res.plan && res.plan.plan === 'pairing' ? 'Pairing planned.' : 'Write-up drafted.', async () => { await pmPost(API, { ws, act: 'undo', area }).catch(() => null); mount(host, opts); });
|
|
61
|
+
mount(host, opts);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Draw the block again after a read of Work. */
|
|
66
|
+
export const refresh = (host, opts) => mount(host, opts);
|
|
@@ -75,6 +75,7 @@ import * as ST from './bd-stands.js'; // Where it stands, its Suggestion and t
|
|
|
75
75
|
import * as LS from './load-shapes.js'; // the skeleton and the slow-case line while the board is read (page-open-speed, SpD) // the Board as the first panel: fit(), the rows that open beside, the open row's mark
|
|
76
76
|
import * as STRAT from './bd-strategy.js'; // the product's strategy in five lines above the initiatives (bet A458)
|
|
77
77
|
import * as PRIN from './bd-principles.js'; // the product's principles drafted from its decisions, below the strategy (bet A352)
|
|
78
|
+
import * as KNOW from './one-person-knows.js'; // the areas only one person knows, below the principles (job #1899, A391)
|
|
78
79
|
import * as VERS from './app-versions.js'; // the app versions still in use and the open bugs their users hit, below the principles (idea A211)
|
|
79
80
|
import * as SEG from './segments.js'; // the product's user groups and the roadmap items that serve each, below the principles (idea A327)
|
|
80
81
|
import * as SWO from './switch-owners.js'; // who has which switch, per customer, below the principles (idea A263)
|
|
@@ -1554,6 +1555,7 @@ async function load() {
|
|
|
1554
1555
|
LE.loaded({ since, stale: !!r.stale }); // a change still saving stays on the new read; open views (the big Work breakdown) follow it
|
|
1555
1556
|
STRAT.refresh($('#cStrat'), { ws: M.board.ws || null, board: M.board.id || null, single: !ALL, say });
|
|
1556
1557
|
PRIN.refresh($('#cPrin'), { ws: M.board.ws || null, single: !ALL, say });
|
|
1558
|
+
KNOW.refresh($('#cKnow'), { ws: M.board.ws || null, single: !ALL, say });
|
|
1557
1559
|
VERS.refresh($('#cVers'), { ws: M.board.ws || null, single: !ALL, say });
|
|
1558
1560
|
SEG.refresh($('#cSeg'), { ws: M.board.ws || null, single: !ALL, say });
|
|
1559
1561
|
SWO.refresh($('#cSw'), { ws: M.board.ws || null, single: !ALL, say });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* pm/screen-map.css — the product page's Screens tab (pm/screen-map.js, initiative screen-map, board BatchPlanDS panel 8).
|
|
2
|
+
* Design tokens only: a change to a token reaches the map with no rebuild. Loaded by pm/screen-map.js the first time the tab draws. */
|
|
3
|
+
.sm { display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
|
|
4
|
+
.sm-bar { display: flex; align-items: center; gap: 2px; }
|
|
5
|
+
.sm-leg { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
|
|
6
|
+
.sm-view { position: relative; height: 360px; overflow: hidden; background: var(--well); border-radius: var(--radius-card); touch-action: none; cursor: grab; }
|
|
7
|
+
.sm-view:active { cursor: grabbing; }
|
|
8
|
+
.sm-plane { position: absolute; left: 0; top: 0; width: var(--bd-smw); height: var(--bd-smh); transform-origin: 0 0; transform: translate(var(--bd-smtx, 0), var(--bd-smty, 0)) scale(var(--bd-smk, 1)); }
|
|
9
|
+
.sm-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
|
|
10
|
+
.sm-lines path { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .55; }
|
|
11
|
+
.sm-lines marker path { fill: var(--muted); stroke: none; opacity: .8; }
|
|
12
|
+
.sm-card { position: absolute; left: var(--bd-smx); top: var(--bd-smy); width: 112px; height: 66px; box-sizing: border-box; display: flex; flex-direction: column; align-items: stretch; gap: var(--space-4); padding: var(--space-4);
|
|
13
|
+
background: var(--card); color: var(--ink); border: 0; border-radius: var(--radius-sm); box-shadow: var(--raise); font: inherit; font-size: var(--fs-meta); line-height: var(--lh-meta); text-align: center; cursor: pointer; }
|
|
14
|
+
.sm-card:focus-visible, .sm-card.on { outline: 2px solid var(--blue); outline-offset: 1px; }
|
|
15
|
+
.sm-th { display: block; height: 30px; background: var(--well); border-radius: var(--radius-sm); flex: none; }
|
|
16
|
+
.sm-h { flex: 1; }
|
|
17
|
+
.sm-n { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
18
|
+
.sm-mk { position: absolute; top: -6px; right: -6px; display: inline-flex; gap: 1px; background: var(--card); border-radius: var(--radius-pill); padding: 1px; }
|
|
19
|
+
.sm-why { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-4); }
|
|
20
|
+
.sm-why li { display: flex; align-items: center; gap: var(--space-4); }
|
|
21
|
+
.sm-note { display: flex; gap: var(--space-8); align-items: center; }
|
|
22
|
+
.sm-note .pm-input { flex: 1; min-width: 0; }
|
|
23
|
+
@media (pointer: coarse) { .sm .pm-btn { width: 44px; height: 44px; } .sm-view { height: 300px; } }
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/* pm/screen-map.js — the product page's Screens tab: the live map of the product's screens (initiative screen-map, job #1895, idea A318;
|
|
2
|
+
* board BatchPlanDS panel 8, agreed 2026-11-25).
|
|
3
|
+
*
|
|
4
|
+
* readMap(ws) → the map from GET /api/screen-map (lib/screen-map.js read: the default branch, so it follows each merge) | null
|
|
5
|
+
* layoutOf(map) → { w, h, nodes: [{ id, x, y }], edges: [{ from, to, d }] } PURE: a column per step from the start
|
|
6
|
+
* mapHtml(map, o) → the tab's markup PURE: the test reads it
|
|
7
|
+
* mount(host, { ws, map, say }) draws it into host and wires zoom, pan, a screen's detail and its note
|
|
8
|
+
*
|
|
9
|
+
* Built from Komorebi parts only: pm-block for a screen's detail, pm-btn icon buttons (zoom in, zoom out, fit, close, send) each with an
|
|
10
|
+
* aria-label, pm-input for the note, pm-meta for the legend, and the state glyphs for the marks (duplicate = at risk, dead end = no signal,
|
|
11
|
+
* deep = waiting). Every screen is a small card with a well for its thumbnail and its name; the flows are lines between the cards.
|
|
12
|
+
* · Zero is silence: a map with no screen draws nothing (the product page shows no Screens tab); the legend names only the marks on
|
|
13
|
+
* the map; an unmarked screen carries no mark.
|
|
14
|
+
* · Say it once: the date of the last merge shows once, in the legend line.
|
|
15
|
+
* · A press on a screen opens its detail under the map: the route, the file, each mark with why, and a note. Send keeps the note as a
|
|
16
|
+
* capture that names the screen (POST /api/screen-map/note); PMOS files it as work, and Today shows it.
|
|
17
|
+
* · Zoom with the buttons, or with Ctrl and the wheel (a pinch on a trackpad); drag the map to pan.
|
|
18
|
+
* The cards carry data-sm-screen, so the local use log counts screen presses (the bet's health number). */
|
|
19
|
+
import { pmGet, pmPost } from './http.js';
|
|
20
|
+
import { stateGlyph } from './state-glyph.js';
|
|
21
|
+
|
|
22
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
23
|
+
const SV = (d) => `<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
24
|
+
const I = { plus: 'M12 5v14M5 12h14', minus: 'M5 12h14', fit: 'M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5', x: 'M6 6l12 12M18 6L6 18', send: 'M4 12l16-8-6 16-2-7z' };
|
|
25
|
+
export const MARK = Object.freeze({ dup: { state: 'risk', word: 'duplicate' }, dead: { state: 'none', word: 'dead end' }, deep: { state: 'wait', word: 'more than 4 steps' } });
|
|
26
|
+
const CW = 112, CH = 66, GX = 56, GY = 18, PAD = 14, ROWS = 6;
|
|
27
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
28
|
+
const dayOf = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? `${+m[3]} ${MON[+m[2] - 1]}` : ''; };
|
|
29
|
+
|
|
30
|
+
/** GET /api/screen-map for a workspace. Null when it cannot be read or has no screen (the tab is then left out). */
|
|
31
|
+
export async function readMap(ws) {
|
|
32
|
+
try {
|
|
33
|
+
const r = await pmGet('/api/screen-map' + (ws ? '?ws=' + encodeURIComponent(ws) : ''));
|
|
34
|
+
return r && r.ok && Array.isArray(r.screens) && r.screens.length ? r : null;
|
|
35
|
+
} catch { return null; }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** PURE. A column for each step from the start, cards in name order, at most ROWS cards a column (a longer one wraps into the next).
|
|
39
|
+
* Screens the start does not reach sit in a second band below, in columns by their own steps from the screens nothing leads to. A flow
|
|
40
|
+
* is a curve from the right edge of one card to the left edge of the other. */
|
|
41
|
+
export function layoutOf(map) {
|
|
42
|
+
const S = (map && map.screens) || [], F = (map && map.flows) || [];
|
|
43
|
+
const reached = S.filter((s) => typeof s.steps === 'number');
|
|
44
|
+
const rest = S.filter((s) => typeof s.steps !== 'number');
|
|
45
|
+
// the second band's own steps, from the unreached screens no other unreached screen leads to
|
|
46
|
+
const own = new Map(), ids = new Set(rest.map((s) => s.id));
|
|
47
|
+
const inn = new Set(F.filter((f) => ids.has(f.from) && ids.has(f.to)).map((f) => f.to));
|
|
48
|
+
const q = rest.filter((s) => !inn.has(s.id)).map((s) => s.id);
|
|
49
|
+
if (!q.length && rest.length) q.push(rest[0].id);
|
|
50
|
+
for (const id of q) own.set(id, 0);
|
|
51
|
+
while (q.length) { const id = q.shift(); for (const f of F) if (f.from === id && ids.has(f.to) && !own.has(f.to)) { own.set(f.to, own.get(id) + 1); q.push(f.to); } }
|
|
52
|
+
const pos = new Map();
|
|
53
|
+
let w = 0, top = PAD;
|
|
54
|
+
for (const [band, stepOf] of [[reached, (s) => s.steps], [rest, (s) => own.get(s.id) || 0]]) {
|
|
55
|
+
if (!band.length) continue;
|
|
56
|
+
const cols = new Map();
|
|
57
|
+
for (const s of band) { const c = stepOf(s); if (!cols.has(c)) cols.set(c, []); cols.get(c).push(s); }
|
|
58
|
+
let col = 0, rows = 0;
|
|
59
|
+
for (const c of [...cols.keys()].sort((a, b) => a - b)) {
|
|
60
|
+
const L = cols.get(c).slice().sort((a, b) => a.name.localeCompare(b.name));
|
|
61
|
+
for (let i = 0; i < L.length; i += ROWS) {
|
|
62
|
+
const part = L.slice(i, i + ROWS);
|
|
63
|
+
part.forEach((s, j) => pos.set(s.id, { x: PAD + col * (CW + GX), y: top + j * (CH + GY) }));
|
|
64
|
+
rows = Math.max(rows, part.length); col++;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
w = Math.max(w, PAD * 2 + col * (CW + GX) - GX);
|
|
68
|
+
top += rows * (CH + GY) + GY * 2;
|
|
69
|
+
}
|
|
70
|
+
const nodes = S.map((s) => ({ id: s.id, ...pos.get(s.id) }));
|
|
71
|
+
const edges = F.filter((f) => pos.has(f.from) && pos.has(f.to)).map((f) => {
|
|
72
|
+
const a = pos.get(f.from), b = pos.get(f.to);
|
|
73
|
+
const x1 = a.x + CW, y1 = a.y + CH / 2, x2 = b.x, y2 = b.y + CH / 2;
|
|
74
|
+
const back = x2 <= x1; // a flow back to an earlier column bends under the cards
|
|
75
|
+
const d = back ? `M${x1} ${y1} C${x1 + GX} ${y1 + CH}, ${x2 - GX} ${y2 + CH}, ${x2} ${y2}` : `M${x1} ${y1} C${x1 + GX / 2} ${y1}, ${x2 - GX / 2} ${y2}, ${x2} ${y2}`;
|
|
76
|
+
return { from: f.from, to: f.to, d };
|
|
77
|
+
});
|
|
78
|
+
return { w: Math.max(w, PAD * 2 + CW), h: top - GY * 2 + PAD, nodes, edges, cw: CW, ch: CH };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const glyph = (m) => stateGlyph(MARK[m.kind].state, { size: 14, why: MARK[m.kind].word + ': ' + m.why });
|
|
82
|
+
|
|
83
|
+
/** PURE. The tab: the map's tools and legend, the map, and the open screen's detail (o.open: a screen id; o.note: the typed note). */
|
|
84
|
+
export function mapHtml(map, o = {}) {
|
|
85
|
+
const S = (map && map.screens) || [];
|
|
86
|
+
if (!S.length) return '';
|
|
87
|
+
const L = layoutOf(map);
|
|
88
|
+
const by = new Map(S.map((s) => [s.id, s]));
|
|
89
|
+
const btn = (id, icon, label) => `<button type="button" class="pm-btn" id="${id}" aria-label="${esc(label)}" title="${esc(label)}">${SV(icon)}</button>`;
|
|
90
|
+
const kinds = Object.keys(MARK).filter((k) => S.some((s) => (s.marks || []).some((m) => m.kind === k)));
|
|
91
|
+
const legend = kinds.map((k) => `${stateGlyph(MARK[k].state, { size: 14 })} ${esc(MARK[k].word)}`).concat(map.updated ? [`updated on merge ${esc(dayOf(map.updated))}`] : []).join(' · ');
|
|
92
|
+
const cards = L.nodes.map((n) => {
|
|
93
|
+
const s = by.get(n.id), marks = (s.marks || []);
|
|
94
|
+
const label = s.name + (marks.length ? ': ' + marks.map((m) => MARK[m.kind].word).join(', ') : '');
|
|
95
|
+
return `<button type="button" class="sm-card${o.open === s.id ? ' on' : ''}" data-sm-screen="${esc(s.id)}" data-x="${n.x}" data-y="${n.y}" aria-label="${esc(label)}" title="${esc(s.route)}">`
|
|
96
|
+
+ `<span class="sm-th" aria-hidden="true"></span><span class="sm-n">${esc(s.name)}</span>`
|
|
97
|
+
+ (marks.length ? `<span class="sm-mk">${marks.map(glyph).join('')}</span>` : '') + '</button>';
|
|
98
|
+
}).join('');
|
|
99
|
+
const lines = `<svg class="sm-lines" width="${L.w}" height="${L.h}" viewBox="0 0 ${L.w} ${L.h}" aria-hidden="true"><defs><marker id="smArr" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="7" markerHeight="7" orient="auto"><path d="M0 0L8 4L0 8z"/></marker></defs>`
|
|
100
|
+
+ L.edges.map((e) => `<path d="${e.d}" marker-end="url(#smArr)"/>`).join('') + '</svg>';
|
|
101
|
+
const open = o.open && by.get(o.open);
|
|
102
|
+
const detail = open ? `<section class="pm-block sm-detail" aria-label="${esc(open.name)}"><div class="head"><h4 class="pm-h-sm sm-h">${esc(open.name)} <span class="pm-meta">· ${esc(open.route)}</span></h4>${btn('smClose', I.x, 'Close this screen')}</div>`
|
|
103
|
+
+ `<span class="pm-meta">${esc(open.file)}</span>`
|
|
104
|
+
+ ((open.marks || []).length ? `<ul class="sm-why">${open.marks.map((m) => `<li>${glyph(m)} <span>${esc(m.why)}</span></li>`).join('')}</ul>` : '')
|
|
105
|
+
+ `<form class="sm-note" id="smNoteForm"><input class="pm-input" id="smNote" maxlength="2000" aria-label="A note on ${esc(open.name)}" placeholder="A note to start work on this screen" value="${esc(o.note || '')}" />`
|
|
106
|
+
+ `<button type="submit" class="pm-btn primary" id="smSend" aria-label="Start work from this screen" title="Start work from this screen">${SV(I.send)}</button></form></section>` : '';
|
|
107
|
+
return `<div class="sm" aria-label="Screens"><div class="sm-bar"><span class="pm-meta sm-leg">${legend}</span>${btn('smOut', I.minus, 'Zoom out')}${btn('smIn', I.plus, 'Zoom in')}${btn('smFit', I.fit, 'Fit the map')}</div>`
|
|
108
|
+
+ `<div class="sm-view" id="smView" role="group" aria-label="${esc(S.length + ' screens and the flows between them')}"><div class="sm-plane" id="smPlane" data-w="${L.w}" data-h="${L.h}">${lines}${cards}</div></div>${detail}</div>`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* ── the browser part ── */
|
|
112
|
+
const VIEW = new Map(); // ws → { k, x, y, open } so a redraw of the product page keeps the place
|
|
113
|
+
// its own stylesheet, from the module's own folder so it shares the module's build (test.js N2-build)
|
|
114
|
+
function css() {
|
|
115
|
+
if (typeof document === 'undefined' || document.getElementById('smCss')) return;
|
|
116
|
+
const l = document.createElement('link'); l.id = 'smCss'; l.rel = 'stylesheet'; l.href = new URL('./screen-map.css', import.meta.url).href; document.head.appendChild(l);
|
|
117
|
+
}
|
|
118
|
+
/** Draw the map into host and wire its presses. */
|
|
119
|
+
export function mount(host, opts = {}) {
|
|
120
|
+
if (!host) return;
|
|
121
|
+
const { ws = null, map = null, say = null } = opts;
|
|
122
|
+
if (!map || !(map.screens || []).length) { host.innerHTML = ''; host.hidden = true; return; }
|
|
123
|
+
css();
|
|
124
|
+
const V = VIEW.get(ws || '') || { k: 1, x: 0, y: 0, open: null, note: '' }; VIEW.set(ws || '', V);
|
|
125
|
+
if (V.open && !map.screens.some((s) => s.id === V.open)) V.open = null;
|
|
126
|
+
// run-time geometry only, as custom properties the sheet reads (conformance R28-1): the place of each card, the plane's size, the zoom and pan
|
|
127
|
+
const apply = () => { const p = host.querySelector('#smPlane'); if (!p) return; p.style.setProperty('--bd-smtx', V.x + 'px'); p.style.setProperty('--bd-smty', V.y + 'px'); p.style.setProperty('--bd-smk', String(V.k)); };
|
|
128
|
+
const place = () => {
|
|
129
|
+
const p = host.querySelector('#smPlane'); if (!p) return;
|
|
130
|
+
p.style.setProperty('--bd-smw', p.dataset.w + 'px'); p.style.setProperty('--bd-smh', p.dataset.h + 'px');
|
|
131
|
+
for (const c of p.querySelectorAll('[data-sm-screen]')) { c.style.setProperty('--bd-smx', c.dataset.x + 'px'); c.style.setProperty('--bd-smy', c.dataset.y + 'px'); }
|
|
132
|
+
};
|
|
133
|
+
const draw = () => { host.hidden = false; host.innerHTML = mapHtml(map, V); place(); apply(); };
|
|
134
|
+
const zoom = (f, cx, cy) => {
|
|
135
|
+
const v = host.querySelector('#smView'); if (!v) return;
|
|
136
|
+
const r = v.getBoundingClientRect(), px = cx == null ? r.width / 2 : cx - r.left, py = cy == null ? r.height / 2 : cy - r.top;
|
|
137
|
+
const k = Math.max(0.3, Math.min(2.5, V.k * f));
|
|
138
|
+
V.x = px - ((px - V.x) * k) / V.k; V.y = py - ((py - V.y) * k) / V.k; V.k = k; apply();
|
|
139
|
+
};
|
|
140
|
+
const fit = () => {
|
|
141
|
+
const v = host.querySelector('#smView'), L = layoutOf(map); if (!v) return;
|
|
142
|
+
// not laid out yet: the map's sheet is still loading (the view is not clipped yet)
|
|
143
|
+
if (typeof getComputedStyle === 'function' && getComputedStyle(v).overflow !== 'hidden') return false;
|
|
144
|
+
const r = v.getBoundingClientRect(); if (!r.width || !r.height) return false;
|
|
145
|
+
V.k = Math.max(0.3, Math.min(1, r.width / L.w, r.height / L.h)); V.x = 0; V.y = 0; apply(); return true;
|
|
146
|
+
};
|
|
147
|
+
let drag = null, moved = false;
|
|
148
|
+
host.onpointerdown = (e) => {
|
|
149
|
+
if (!e.target.closest('#smView') || e.button > 0) return;
|
|
150
|
+
drag = { x: e.clientX, y: e.clientY, vx: V.x, vy: V.y }; moved = false;
|
|
151
|
+
};
|
|
152
|
+
host.onpointermove = (e) => {
|
|
153
|
+
if (!drag) return;
|
|
154
|
+
const dx = e.clientX - drag.x, dy = e.clientY - drag.y;
|
|
155
|
+
if (!moved && Math.abs(dx) + Math.abs(dy) < 5) return;
|
|
156
|
+
moved = true; V.x = drag.vx + dx; V.y = drag.vy + dy; apply();
|
|
157
|
+
};
|
|
158
|
+
host.onpointerup = host.onpointercancel = () => { drag = null; };
|
|
159
|
+
host.onwheel = (e) => { if (!e.ctrlKey && !e.metaKey) return; if (!e.target.closest('#smView')) return; e.preventDefault(); zoom(e.deltaY < 0 ? 1.12 : 1 / 1.12, e.clientX, e.clientY); };
|
|
160
|
+
host.onclick = (e) => {
|
|
161
|
+
if (moved) { moved = false; return; } // the end of a drag is not a press
|
|
162
|
+
const c = e.target.closest('[data-sm-screen]');
|
|
163
|
+
if (c) { V.open = V.open === c.dataset.smScreen ? null : c.dataset.smScreen; V.note = ''; draw(); const n = host.querySelector('#smNote'); if (n) n.focus(); return; }
|
|
164
|
+
const b = e.target.closest('button'); if (!b) return;
|
|
165
|
+
if (b.id === 'smIn') zoom(1.25);
|
|
166
|
+
else if (b.id === 'smOut') zoom(1 / 1.25);
|
|
167
|
+
else if (b.id === 'smFit') fit();
|
|
168
|
+
else if (b.id === 'smClose') { V.open = null; draw(); }
|
|
169
|
+
};
|
|
170
|
+
host.oninput = (e) => { if (e.target.id === 'smNote') V.note = e.target.value; };
|
|
171
|
+
host.onsubmit = async (e) => {
|
|
172
|
+
if (e.target.id !== 'smNoteForm') return;
|
|
173
|
+
e.preventDefault();
|
|
174
|
+
const text = V.note.trim(), s = map.screens.find((x) => x.id === V.open);
|
|
175
|
+
if (!text || !s) { const n = host.querySelector('#smNote'); if (n) n.focus(); return; }
|
|
176
|
+
const res = await pmPost('/api/screen-map/note', { ws, screen: s.id, text }).catch(() => null);
|
|
177
|
+
if (!res || !res.ok) { if (say) say((res && res.error) || 'The note was not kept. Try again.'); return; }
|
|
178
|
+
V.note = ''; draw();
|
|
179
|
+
if (say) say(`Kept as a capture on ${s.name}. PMOS files it as work.`);
|
|
180
|
+
};
|
|
181
|
+
host.onkeydown = (e) => { if (e.key === 'Escape' && V.open) { V.open = null; draw(); } };
|
|
182
|
+
draw();
|
|
183
|
+
// the first time: the whole map in view, once the map's sheet has laid it out
|
|
184
|
+
let tries = 0;
|
|
185
|
+
const first = () => { if (V.fitted || !host.isConnected) return; if (fit()) V.fitted = true; else if (++tries < 40) setTimeout(first, 50); };
|
|
186
|
+
first();
|
|
187
|
+
}
|
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
<section class="bd-sec" id="cStrat" aria-label="Strategy" hidden></section>
|
|
66
66
|
<!-- the product's principles drafted from its decisions (pm/bd-principles.js, bet A352): below the strategy, one product only -->
|
|
67
67
|
<section class="bd-sec" id="cPrin" aria-label="Principles" hidden></section>
|
|
68
|
+
<!-- only one person knows this (pm/one-person-knows.js, job #1899, A391): below the principles, one product only -->
|
|
69
|
+
<section class="bd-sec" id="cKnow" aria-label="Only one person knows this" hidden></section>
|
|
68
70
|
<!-- the app versions still in use and the open bugs their users hit (pm/app-versions.js, idea A211): below the principles, one product only -->
|
|
69
71
|
<section class="bd-sec" id="cVers" aria-label="Versions" hidden></section>
|
|
70
72
|
<!-- the product's user groups and the roadmap items that serve each (pm/segments.js, idea A327): below the principles, one product only -->
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "When a feature ships, chat knows (job #2046, idea A555, done test planning/done-tests/chat-knows-verbs.md V1-V3, N1, N2): every verb in lib/pmos-verbs.js is named in kit/AGENTS.md, with what it does and when to run it. No server, network or browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"kit-agents-verbs.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"kit-agents-verbs.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Only one person knows this (initiative one-person-knows, job #1899, done test K1-K7, N1-N4): the pure areas and the ✦ before a leave, pmos knowledge on a scratch repository, the route, the Work block's markup and wiring. No server, browser, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"one-person-knows.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"one-person-knows.test.js": 3
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "A live map of the product's screens (initiative screen-map, job #1895, done test S1-S7, N1, N2): the pure screens, flows, marks and layout, the read from the default branch on a scratch git repository, the pmos screens verb, the route and the product page's wiring. No server, browser, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"screen-map.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"screen-map.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Sign-offs, grill, numbers, press release and milestones show on the open item (surface-on-item, job #1986, LINE.md Rule 12; done test planning/done-tests/surface-on-item.md S1-S7, N1-N2): the Sign-offs block with past asks and yes picks, the numbers and press release ✦ lines, the grill of a plan never grilled, and a program's first milestone drafts. No server, network, model or browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"surface-on-item.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"surface-on-item.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|