create-pmos 0.827.0 → 0.828.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.
Files changed (43) hide show
  1. package/package.json +86 -32
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/bin/pmos.js +19 -9
  7. package/workspace/changelog.json +85 -12
  8. package/workspace/guide/cli.md +29 -0
  9. package/workspace/lib/board-cli.js +5 -1
  10. package/workspace/lib/features.json +2 -0
  11. package/workspace/lib/five-action-cap.js +84 -0
  12. package/workspace/lib/people-cli.js +43 -2
  13. package/workspace/lib/pmos-verbs.js +7 -1
  14. package/workspace/lib/portfolio-cli.js +64 -0
  15. package/workspace/lib/portfolio.js +168 -0
  16. package/workspace/lib/review-reasons.js +357 -0
  17. package/workspace/lib/route-modules.js +2 -0
  18. package/workspace/lib/routes-portfolio.js +50 -0
  19. package/workspace/lib/routes-stakeholders.js +42 -0
  20. package/workspace/lib/routes-strategy-card.js +29 -1
  21. package/workspace/lib/routes-use-log.js +6 -1
  22. package/workspace/lib/stakeholder-map.js +232 -0
  23. package/workspace/lib/voice-cli.js +7 -0
  24. package/workspace/package-lock.json +2 -2
  25. package/workspace/package.json +1 -1
  26. package/workspace/premium-vw-jira-test.js +6 -2
  27. package/workspace/public/pm/bd-principles.js +12 -1
  28. package/workspace/public/pm/cozy-pick.css +1 -0
  29. package/workspace/public/pm/cozy-pop-work.js +6 -1
  30. package/workspace/public/pm/cozy-today-app.js +48 -1
  31. package/workspace/public/pm/cozy-today-view.js +12 -4
  32. package/workspace/public/pm/five-action-cap.js +104 -0
  33. package/workspace/public/pm/portfolio.js +67 -0
  34. package/workspace/public/pm/product-switcher.js +7 -1
  35. package/workspace/public/pm/review-reasons.js +75 -0
  36. package/workspace/public/pm/stakeholder-map.js +125 -0
  37. package/workspace/public/premium-portfolio.html +48 -0
  38. package/workspace/server.js +1 -1
  39. package/workspace/stage-card-tasks-test.js +11 -5
  40. package/workspace/test-lists/five-action-cap.json +9 -0
  41. package/workspace/test-lists/portfolio.json +9 -0
  42. package/workspace/test-lists/review-reasons.json +9 -0
  43. package/workspace/test-lists/stakeholder-map.json +9 -0
@@ -0,0 +1,232 @@
1
+ 'use strict';
2
+ /* stakeholder-map.js — who decides, who must agree and who needs to know, for one initiative, and when each last heard from the PM
3
+ * (initiative stakeholder-map, job #1896, idea A371; board BatchPeopleDS panel 9, agreed 2026-11-25). THE ONE WRITER and THE ONE FOLD of
4
+ * stakeholders.jsonl. lib/people-cli.js is the verb (`pmos people map|keep|drop|told|undo`), lib/routes-stakeholders.js the routes,
5
+ * public/pm/stakeholder-map.js the People block of the initiative popup on Work.
6
+ *
7
+ * WHERE THE NAMES COME FROM (drafts until the PM keeps them). Nothing is invented; each draft names its source:
8
+ * decides the record's `decider`, `owner` or `sponsor` key
9
+ * must agree a sign-off of this initiative asked of them, or a journal decision of it they objected to (lib/approver-memory.js)
10
+ * needs to know a person in People whose interactions name the initiative: Jira watchers, meeting notes, mail (lib/people.js)
11
+ * The PM's keep (with a group) makes a name a stakeholder; drop takes it off for good (a dropped name is never drafted again); undo takes
12
+ * back the PM's last press on that name.
13
+ *
14
+ * LAST HEARD. The newest of: the person's interactions naming this initiative, else their newest interaction at all, and the PM's own
15
+ * `told` mark ("I sent it"). At STALE_DAYS (3 weeks) or more the row carries a ✦ draft update built from the record's title and status
16
+ * line. PMOS NEVER SENDS IT: the PM copies it and sends it, then marks `told`. A name with no date has no draft (nothing to measure).
17
+ *
18
+ * draftsOf({ ini, record, people, approvals }) → [{ id, name, group, why }]
19
+ * mapOf({ ini, record, people, approvals, lines, now }) → { ini, title, rows: [row], kept, drafts }
20
+ * row: { id, name, group, groupWord, kept, why, last, days, stale, update }
21
+ * readLines(dir) · fold(lines) → Map key → { ini, id, name, group, state: kept | dropped, told }
22
+ * act(dir, { ini, person, name, kind, group }, { by, now }) → { ok, line } | { ok: false, error } kind ∈ keep · drop · told · undo
23
+ * count(dir) → names kept (the health number)
24
+ * CLI: node lib/stakeholder-map.js count <product checkout> prints `[stakeholder-map] kept N` and N alone on the last line
25
+ *
26
+ * Append-only: one line per press { at, by, kind, ini, person, name?, group?, date? }. Nothing here reads a connector or sends anything.
27
+ */
28
+ const fs = require('fs');
29
+ const path = require('path');
30
+
31
+ const FILE = 'stakeholders.jsonl';
32
+ const TAG = '[stakeholder-map]';
33
+ const KINDS = ['keep', 'drop', 'told', 'undo'];
34
+ const GROUPS = Object.freeze(['decides', 'agree', 'know']);
35
+ const GROUP_WORD = Object.freeze({ decides: 'decides', agree: 'must agree', know: 'needs to know' });
36
+ const STALE_DAYS = 21;
37
+ const DAY = 86400000;
38
+
39
+ const one = (v, max = 200) => { const s = String(v == null ? '' : v).replace(/\s+/g, ' ').trim(); return s.length > max ? s.slice(0, max - 1).trimEnd() + '…' : s; };
40
+ const slugOf = (name) => {
41
+ const s = one(name, 80).toLowerCase().normalize('NFKD').replace(/[̀-ͯ]/g, '').replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 50);
42
+ return s || 'person';
43
+ };
44
+ const keyOf = (ini, id) => String(ini) + '|' + String(id);
45
+ const norm = (s) => one(s, 80).toLowerCase();
46
+ /** Two names are one person: equal, or one is the other's first name ("Ana" and "Ana Lim"). */
47
+ function same(a, b) {
48
+ const x = norm(a), y = norm(b);
49
+ if (!x || !y) return false;
50
+ if (x === y) return true;
51
+ return (!x.includes(' ') && y.split(' ')[0] === x) || (!y.includes(' ') && x.split(' ')[0] === y);
52
+ }
53
+ const dateOf = (v) => { const s = String(v || '').slice(0, 10); return /^\d{4}-\d{2}-\d{2}$/.test(s) ? s : null; };
54
+ const newest = (...ds) => ds.filter(Boolean).sort().pop() || null;
55
+ const GROUP_ALIAS = { decides: 'decides', decide: 'decides', decider: 'decides', agree: 'agree', 'must-agree': 'agree', 'must agree': 'agree', know: 'know', 'needs-to-know': 'know', 'needs to know': 'know', inform: 'know' };
56
+ const groupOf = (g) => GROUP_ALIAS[String(g || '').trim().toLowerCase()] || null;
57
+
58
+ /** The draft names of one initiative, each with its group and where it came from. */
59
+ function draftsOf({ ini, record = {}, people = [], approvals = [] } = {}) {
60
+ const out = [];
61
+ const add = (name, group, why) => {
62
+ const n = one(name, 80);
63
+ if (!n || /^(pm|me|you|unassigned|none|tbd)$/i.test(n)) return;
64
+ const had = out.find((x) => same(x.name, n));
65
+ if (had) { if (GROUPS.indexOf(group) < GROUPS.indexOf(had.group)) { had.group = group; had.why = why; } if (n.length > had.name.length) had.name = n; return; }
66
+ out.push({ name: n, group, why });
67
+ };
68
+ for (const k of ['decider', 'owner', 'sponsor']) {
69
+ const v = record && record[k];
70
+ if (!v) continue;
71
+ for (const n of String(v).replace(/^person:/, '').split(/\s*[,;&]\s*|\s+and\s+/)) add(n.replace(/^person:/, ''), 'decides', `the record names them as ${k}`);
72
+ }
73
+ for (const a of approvals || []) {
74
+ if (!a || a.ini !== ini || !a.who) continue;
75
+ add(a.who, 'agree', a.kind === 'objection' ? `objected to ${one(a.decided || a.text, 60)}` : `sign-off: ${one(a.text, 60)}`);
76
+ }
77
+ for (const p of people || []) {
78
+ const g = p && p.shared && (p.shared.initiatives || []).find((x) => x.id === ini);
79
+ if (!g) continue;
80
+ const src = [...new Set((p.interactions || []).filter((i) => i.initiative === ini).map((i) => ({ jira: 'Jira', notes: 'meeting notes', gather: 'mail', live: 'Live notes', calendar: 'the calendar', plan: 'the plan' })[i.source] || i.source))];
81
+ add(p.name, 'know', `named on this initiative in ${src.join(', ') || 'People'}`);
82
+ }
83
+ // the person's id in People when they are there, so a keep and People agree; else a slug of the name
84
+ for (const d of out) { const p = (people || []).find((x) => same(x.name, d.name)); d.id = p ? p.id : slugOf(d.name); if (p) d.name = p.name; }
85
+ return out;
86
+ }
87
+
88
+ function readLines(dir) {
89
+ if (!dir) return [];
90
+ let text = '';
91
+ try { text = fs.readFileSync(path.join(dir, FILE), 'utf8'); } catch { return []; }
92
+ const out = [];
93
+ for (const l of text.split('\n')) {
94
+ if (!l.trim()) continue;
95
+ try { const o = JSON.parse(l); if (o && KINDS.includes(o.kind) && o.ini && o.person) out.push(o); } catch { /* a torn line is skipped */ }
96
+ }
97
+ return out;
98
+ }
99
+
100
+ /** The PM's presses, folded: one entry per initiative and name. An undo takes back that name's last keep, drop or told. */
101
+ function fold(lines) {
102
+ const steps = new Map(); // key → [line]
103
+ for (const l of lines || []) {
104
+ const k = keyOf(l.ini, l.person);
105
+ if (!steps.has(k)) steps.set(k, []);
106
+ const s = steps.get(k);
107
+ if (l.kind === 'undo') { s.pop(); continue; }
108
+ s.push(l);
109
+ }
110
+ const out = new Map();
111
+ for (const [k, s] of steps) {
112
+ if (!s.length) continue;
113
+ const e = { ini: s[0].ini, id: s[0].person, name: null, group: null, state: null, told: null };
114
+ for (const l of s) {
115
+ if (l.name) e.name = l.name;
116
+ if (l.kind === 'keep') { e.state = 'kept'; e.group = groupOf(l.group) || e.group; }
117
+ else if (l.kind === 'drop') e.state = 'dropped';
118
+ else if (l.kind === 'told') { e.told = newest(e.told, dateOf(l.date || l.at)); }
119
+ }
120
+ out.set(k, e);
121
+ }
122
+ return out;
123
+ }
124
+
125
+ /** The status line the draft update quotes: the record's one-line status, else its goal. */
126
+ const statusOf = (record) => one((record && (record.status_line || record.status || record.goal)) || '', 160);
127
+
128
+ /** The ✦ draft update for one name. The PM sends it, never PMOS. */
129
+ function updateText({ name, title, record, group }) {
130
+ const first = one(name, 80).split(' ')[0];
131
+ const st = statusOf(record);
132
+ const ask = group === 'decides' ? 'Tell me if you want to decide anything before then.' : group === 'agree' ? 'Tell me if anything here does not work for you.' : 'No action needed from you.';
133
+ return one(`Hi ${first}, a short update on ${title}${st ? ': ' + st.replace(/[.\s]+$/, '') : ''}. ${ask}`, 400);
134
+ }
135
+
136
+ function mapOf({ ini, record = {}, people = [], approvals = [], lines = [], now = Date.now() } = {}) {
137
+ const title = one((record && record.title) || ini, 120);
138
+ const marks = fold(lines);
139
+ const drafts = draftsOf({ ini, record, people, approvals });
140
+ const rows = [];
141
+ const seen = new Set();
142
+ const today = new Date(now).toISOString().slice(0, 10);
143
+ const lastOf = (id, name) => {
144
+ const p = (people || []).find((x) => x.id === id) || (people || []).find((x) => same(x.name, name));
145
+ if (!p) return null;
146
+ const here = (p.interactions || []).filter((i) => i.initiative === ini).map((i) => dateOf(i.date)).filter(Boolean).sort().pop();
147
+ return here || dateOf(p.last);
148
+ };
149
+ const push = (d, m) => {
150
+ seen.add(d.id);
151
+ if (m && m.state === 'dropped') return;
152
+ const group = (m && m.group) || d.group || 'know';
153
+ const name = (m && m.name) || d.name;
154
+ const last = newest(lastOf(d.id, name), m && m.told);
155
+ const days = last ? Math.max(0, Math.round((Date.parse(today) - Date.parse(last)) / DAY)) : null;
156
+ const stale = days != null && days >= STALE_DAYS;
157
+ rows.push({ id: d.id, name, group, groupWord: GROUP_WORD[group], kept: !!(m && m.state === 'kept'), why: d.why || 'you kept this name',
158
+ last, days, stale, update: stale ? updateText({ name, title, record, group }) : null });
159
+ };
160
+ for (const d of drafts) push(d, marks.get(keyOf(ini, d.id)));
161
+ // a name the PM kept that no source names any more stays: the PM's keep is the record
162
+ for (const m of marks.values()) if (m.ini === ini && !seen.has(m.id) && m.state === 'kept') push({ id: m.id, name: m.name || m.id, group: m.group, why: 'you kept this name' }, m);
163
+ rows.sort((a, b) => GROUPS.indexOf(a.group) - GROUPS.indexOf(b.group) || a.name.localeCompare(b.name));
164
+ return { ini, title, rows, kept: rows.filter((r) => r.kept).length, drafts: rows.filter((r) => !r.kept).length };
165
+ }
166
+
167
+ function act(dir, input = {}, { by = 'pm', now = Date.now() } = {}) {
168
+ const kind = String(input.kind || '');
169
+ if (!KINDS.includes(kind)) return { ok: false, error: 'keep, drop, told or undo' };
170
+ const ini = one(input.ini, 80), name = one(input.name, 80);
171
+ if (!/^[a-z0-9][a-z0-9-]{0,79}$/.test(ini)) return { ok: false, error: 'Name the initiative by its id.' };
172
+ const person = /^[a-z0-9][a-z0-9-]{0,59}$/.test(String(input.person || '')) ? String(input.person) : name ? slugOf(name) : '';
173
+ if (!person) return { ok: false, error: 'Name the person (their id in People, or their name).' };
174
+ const line = { at: new Date(now).toISOString(), by, kind, ini, person };
175
+ if (name) line.name = name;
176
+ if (kind === 'keep' && input.group != null) {
177
+ const g = groupOf(input.group);
178
+ if (!g) return { ok: false, error: 'The group is decides, agree or know.' };
179
+ line.group = g;
180
+ }
181
+ if (kind === 'told') line.date = dateOf(input.date) || line.at.slice(0, 10);
182
+ if (kind === 'undo' && !readLines(dir).some((l) => l.ini === ini && l.person === person)) return { ok: false, error: 'Nothing to undo for ' + person + '.' };
183
+ if (!dir) return { ok: false, error: 'This product has no records folder.' };
184
+ try { fs.mkdirSync(dir, { recursive: true }); fs.appendFileSync(path.join(dir, FILE), JSON.stringify(line) + '\n'); } catch (e) { return { ok: false, error: 'could not save: ' + ((e && e.message) || e) }; }
185
+ try { console.error(`${TAG} ${kind} ${ini} ${person}${line.group ? ' ' + line.group : ''}`); } catch { /* no console */ }
186
+ return { ok: true, line };
187
+ }
188
+
189
+ const count = (dir) => [...fold(readLines(dir)).values()].filter((e) => e.state === 'kept').length;
190
+
191
+ /* ── the record and the sources, read from a product checkout ── */
192
+ function front(text) {
193
+ const L = String(text || '').split('\n'), out = {};
194
+ if (!/^---\s*$/.test(L[0] || '')) return out;
195
+ for (let i = 1; i < L.length && !/^---\s*$/.test(L[i]); i++) {
196
+ const m = /^([A-Za-z_][\w-]*):\s*(.*)$/.exec(L[i]);
197
+ if (m) out[m[1]] = m[2].trim().replace(/^(["'])(.*)\1$/, '$2');
198
+ }
199
+ return out;
200
+ }
201
+ /** The initiative's frontmatter from planning/initiatives/<id>.md, pmos/state/initiatives/<id>.md or <stateDir>/initiatives/<id>.md. */
202
+ function recordOf(root, ini, stateDir) {
203
+ const dirs = [path.join(root, 'planning', 'initiatives'), path.join(root, 'pmos', 'state', 'initiatives')];
204
+ if (stateDir) dirs.push(path.join(stateDir, 'initiatives'));
205
+ for (const d of dirs) { try { return front(fs.readFileSync(path.join(d, ini + '.md'), 'utf8')); } catch { /* next */ } }
206
+ return null;
207
+ }
208
+ function recordsDirOf(root) {
209
+ try { const { repoScript } = require('./repo-script.js'); return require(repoScript('signals/layout-paths.js')).pathsFor(root).recordsDir; }
210
+ catch { return path.join(root, 'planning', 'records'); }
211
+ }
212
+ /** Everything mapOf needs, read from the checkout at `root`. o: { now, people (a People view, when the caller has one), stateDir, dir }. */
213
+ function read(root, ini, o = {}) {
214
+ const now = o.now || Date.now();
215
+ let people = o.people;
216
+ if (!people) { try { const v = require('./people-store.js').view(root, { now }); people = v && v.ok ? v.people : []; } catch { people = []; } }
217
+ let approvals = [];
218
+ try { approvals = require('./approver-memory.js').itemsOf(root); } catch { approvals = []; }
219
+ const record = recordOf(root, ini, o.stateDir) || {};
220
+ const dir = o.dir || recordsDirOf(root);
221
+ return { ...mapOf({ ini, record, people, approvals, lines: readLines(dir), now }), found: !!Object.keys(record).length };
222
+ }
223
+
224
+ module.exports = { FILE, TAG, KINDS, GROUPS, GROUP_WORD, STALE_DAYS, slugOf, same, groupOf, draftsOf, readLines, fold, mapOf, updateText, act, count, recordOf, recordsDirOf, read };
225
+
226
+ if (require.main === module) {
227
+ const cmd = process.argv[2];
228
+ if (cmd !== 'count') { console.error('usage: node workspace/lib/stakeholder-map.js count [<product checkout>] (stakeholder names kept)'); process.exit(2); }
229
+ const n = count(recordsDirOf(path.resolve(process.argv[3] || process.cwd())));
230
+ console.log(`${TAG} kept ${n}`);
231
+ console.log(String(n));
232
+ }
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+ /* voice-cli.js — `pmos voice`: survey comments and app-store reviews grouped by reason (initiative review-reasons, idea A427).
3
+ * A thin verb over lib/review-reasons.js run(): the same ledger (customer-voice.jsonl in the product's runs folder) that Work's
4
+ * Customer voice block reads, so what a chat adds shows on Work at the next read. Exit codes: 0 done, 1 refused, 2 usage. */
5
+ const RR = require('./review-reasons.js');
6
+
7
+ module.exports = { run: (argv, o) => RR.run(argv, o), COMMANDS: RR.COMMANDS, USAGE: RR.USAGE };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.827.0",
3
+ "version": "0.828.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.827.0",
9
+ "version": "0.828.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.827.0",
3
+ "version": "0.828.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -213,15 +213,19 @@ const TICKETS = {
213
213
  for (const theme of ['light', 'dark']) {
214
214
  const S = await open({ w: 390, h: 844, theme });
215
215
  await openSprint(S.page);
216
- await until(() => S.page.$('.jcrd[data-k="PMOS-142"]'));
216
+ // Wait for the card INSIDE the shown Viewer pane: on a busy runner the card can exist before the pane is shown, and the
217
+ // read below then found no pane and threw (#1883, 2026-11-25). A pane that never shows fails F1 with its reason instead.
218
+ await until(() => S.page.$('#czViewer:not([hidden]) .obody.vw .jcrd[data-k="PMOS-142"]'), 30000);
217
219
  await sleep(400);
218
220
  const f = await S.page.evaluate(() => {
219
221
  const pane = document.querySelector('#czViewer:not([hidden]) .obody.vw');
222
+ if (!pane || !pane.querySelector('.jcrd b')) return { missing: pane ? 'no sprint card in the Viewer pane' : 'no shown Viewer pane' };
220
223
  const small = [...pane.querySelectorAll('button.jcrd,.jseg button,.jbtn')].filter((b) => b.getBoundingClientRect().height && b.getBoundingClientRect().height < 44).map((b) => b.textContent.trim().slice(0, 30));
221
224
  const crd = getComputedStyle(pane.querySelector('.jcrd')).backgroundColor, ink = getComputedStyle(pane.querySelector('.jcrd b')).color;
222
225
  return { wide: document.documentElement.scrollWidth > innerWidth + 1, paneWide: pane.scrollWidth > pane.clientWidth + 1, small, crd, ink };
223
226
  });
224
- ok(`F1 ${theme}: 390 px has no sideways scroll and every target is 44 px or more`, !f.wide && !f.paneWide && !f.small.length, JSON.stringify(f));
227
+ ok(`F1 ${theme}: 390 px has no sideways scroll and every target is 44 px or more`, !f.missing && !f.wide && !f.paneWide && !f.small.length, JSON.stringify(f));
228
+ if (f.missing) { ok(`F2 ${theme}: cards follow the theme`, false, f.missing); await S.ctx.close(); continue; }
225
229
  const lum = (c) => { const m = c.match(/\d+(\.\d+)?/g).map(Number); return (m[0] * 299 + m[1] * 587 + m[2] * 114) / 1000; };
226
230
  ok(`F2 ${theme}: cards follow the theme`, theme === 'dark' ? lum(f.ink) > lum(f.crd) : lum(f.ink) < lum(f.crd), JSON.stringify(f));
227
231
  await S.ctx.close();
@@ -9,9 +9,11 @@
9
9
  * · Drafts after them, each with ✦, its why, its sources, and ✓ keep / ✕ drop. A press offers Undo in the Board's toast.
10
10
  * · While PMOS drafts them: one quiet line. No principle and no draft: no block (zero is silence).
11
11
  * The controls are named bdPrinKeep and bdPrinDrop (the button's name, its value the principle's id; one per row, so no id) and each press
12
- * notes that name in the local use log (noteUse), which counts their use (the bet's kill line). */
12
+ * notes that name in the local use log (noteUse), which counts their use (the bet's kill line).
13
+ * It also makes the Customer voice section (#cVoice, pm/review-reasons.js, idea A427) right after itself and mounts it with the same options. */
13
14
  import { pmPost } from './http.js';
14
15
  import { noteUse } from './use-log.js';
16
+ import * as VOICE from './review-reasons.js'; // Customer voice (idea A427) sits under the principles; this block hosts it so Work's page files stay as they are
15
17
 
16
18
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
17
19
  const SV = (d) => `<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
@@ -43,6 +45,7 @@ export function blockHtml(state) {
43
45
  export async function mount(host, opts = {}) {
44
46
  if (!host) return;
45
47
  const { ws = null, single = true, say = null } = opts;
48
+ voiceHost(host, opts);
46
49
  if (!single) { host.hidden = true; host.innerHTML = ''; return; }
47
50
  let r = null; try { r = await (await fetch('/api/principles' + (ws ? '?ws=' + encodeURIComponent(ws) : ''), { credentials: 'same-origin' })).json(); } catch { r = null; }
48
51
  if (!r || !r.ok) { host.hidden = true; return; } // the block is an extra: a failed read leaves the Board as it was
@@ -60,5 +63,13 @@ export async function mount(host, opts = {}) {
60
63
  };
61
64
  }
62
65
 
66
+ /** Customer voice (pm/review-reasons.js) gets its own section right after this one, made once, and draws itself there. */
67
+ function voiceHost(host, opts) {
68
+ if (!host.parentNode || typeof document === 'undefined') return;
69
+ let v = document.getElementById('cVoice');
70
+ if (!v) { v = document.createElement('section'); v.className = 'bd-sec'; v.id = 'cVoice'; v.setAttribute('aria-label', 'Customer voice'); v.hidden = true; host.after(v); }
71
+ VOICE.mount(v, opts).catch(() => { v.hidden = true; });
72
+ }
73
+
63
74
  /** Draw the block again after a read of the Board. */
64
75
  export const refresh = (host, opts) => mount(host, opts);
@@ -53,6 +53,7 @@
53
53
  .psw-b:hover, .psw-b:focus-visible { background: var(--cz-well); }
54
54
  .psw-b[aria-pressed="true"] { background: var(--cz-bluebg); box-shadow: 0 0 0 2px var(--cz-c-b6c6dc); }
55
55
  .psw-b .ppk-t { box-shadow: none; }
56
+ .psw-pf { color: var(--cz-muted, currentColor); text-decoration: none; } /* the Portfolio link at the end of the row (initiative portfolio) */
56
57
  .psw-dot { position: absolute; top: 1px; right: 1px; width: 8px; height: 8px; border-radius: 50%; background: var(--cz-blue); box-shadow: 0 0 0 2px var(--cz-card); }
57
58
  .hv-psw { padding: 0 0 var(--space-8); }
58
59
  @media (max-width: 760px) { .psw-b { width: 44px; height: 44px; } }
@@ -37,6 +37,7 @@ import * as IF from './inline-fields.js'; // a task's sprint and priority, set
37
37
  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)
38
38
  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)
39
39
  import { noteUse } from './use-log.js';
40
+ import * as SMAP from './stakeholder-map.js'; // the People block: who decides, must agree, needs to know (stakeholder-map, A371)
40
41
  import * as PD from './bd-pop-ds.js'; // the popup on a computer, built from the design system's blocks (initiative work-ds-popup) // the Kind of a file and one row per kind (round 3 point 16), shared with the Library // the rename and its Undo, the same write as the old List (batch 18 item 16)
41
42
 
42
43
  const CSS = new URL('./cozy-pop-work.css', import.meta.url).href, DSCSS = new URL('./bd-pop-ds.css', import.meta.url).href;
@@ -490,7 +491,9 @@ function dsHtml(r, v, o, W, S, C, mode) {
490
491
  const crit = S.sel.size || dropped().has('crit:' + id) ? '' : critSugHtml(CRIT.get(id));
491
492
  // Overview (Wawan, 2026-11-23): Where it stands, The case and its facts in one block across the top; folded or open is the person's choice
492
493
  // one column (artefacts-in-more-menu, Wawan 2026-11-23): the Stages and the breakdown take the full width; the artefacts are in ⋯ (moreItems)
493
- return `<div class="pw pwd">${PD.overviewHtml(W, r, { oid: id, dropped: dropped(), open: ovOpen() })}<div class="pwd-main">${PD.stagesHtml(st, W)}${crit}${wbs}</div></div>`;
494
+ // the People block under the Overview (stakeholder-map, BatchPeopleDS panel 9): drawn from memory, read once per initiative; no name, no block
495
+ const ppl = SMAP.blockFor(id, o.ws, () => { if (artRedraw) artRedraw(); });
496
+ return `<div class="pw pwd">${PD.overviewHtml(W, r, { oid: id, dropped: dropped(), open: ovOpen() })}${ppl}<div class="pwd-main">${PD.stagesHtml(st, W)}${crit}${wbs}</div></div>`;
494
497
  }
495
498
 
496
499
  /** The grouping ✦ the PM said no to, for this initiative: 'group:<stage>'. */
@@ -912,6 +915,8 @@ export function wire(body, h0, x0) {
912
915
  goalsRedraw = artRedraw = wsnRedraw = capRedraw = () => { if (body.isConnected && body.querySelector('.pw')) redraw(); };
913
916
  body.__pwcur = cur; body.__pwredraw = redraw; // ⋯ acts on the popup drawn now (capItems)
914
917
  wireGrip(body);
918
+ // the People block's presses (stakeholder-map), before the popup's own handler below
919
+ body.addEventListener('click', (e) => { SMAP.press(e, body, { say: (t) => { const hh = body.__pwh; if (hh && hh.toast) hh.toast(t); } }); });
915
920
  // a phone: a proposal swiped right says yes, left says no (its own hidden Yes and No presses, so the popup's writes and Undo stay theirs)
916
921
  wireSwipe(body, { on: phone, act: (row, way) => { const b = row.querySelector(way === 'right' ? '[data-sw-yes]' : '[data-sw-no]'); if (b) b.click(); } });
917
922
  body.addEventListener('submit', (e) => {
@@ -22,6 +22,7 @@ import { wireSwipe } from './cozy-phone-swipe.js';
22
22
  let DG = null; // quiet-rows-digest: pm/digest-view.js, loaded on a Monday only (on other days Today loads nothing of the digest)
23
23
  import { noteUse } from './use-log.js'; // your-move (A468): each press on a Your move row is one ym-act line in the local use log (its health number)
24
24
  import * as QB from './quiet-batch.js'; // quiet-rows: Today's batch, the popup (Approve, Skip, Change it first; nothing sent without a press)
25
+ import * as CAP from './five-action-cap.js'; // five-action-cap (A529): a row shows two actions and ⋯; which two comes from the use log, once a week
25
26
  import * as TO from './today-order.js'; // today-order (A310, board BatchMoreBDS panel 30): the same blocks in the day's order, and the pin
26
27
  import * as NL from './cozy-name-links.js'; // name-links (A536): names in a line you typed link to the person, meeting or document, with a small card
27
28
  import * as CC from './change-cues.js'; // idea A313: a short cue on the row that is done, moved or dropped, before the log draws again // the phone: rows and the proposal swipe (phone design, Ph2_today)
@@ -49,6 +50,50 @@ export function mountToday(ctx) {
49
50
  readDigest();
50
51
  readSync();
51
52
  readPin();
53
+ readCap();
54
+ }
55
+ /* five-action-cap: the two a row shows, worked out at most once a week from 30 days of use (GET /api/use-log/cap), kept in this browser */
56
+ const CAP_KEY = 'pmos.cap.today-row';
57
+ async function readCap() {
58
+ let saved = null;
59
+ try { saved = JSON.parse(localStorage.getItem(CAP_KEY) || 'null'); } catch { /* no storage: the defaults */ }
60
+ if (!CAP.due(saved, 'today-row')) { TP.setCapShown(saved.ids); return; }
61
+ const r = await ctx.pmGet('/api/use-log/cap?place=today-row').catch(() => null);
62
+ if (!r || !r.ok) return;
63
+ const ids = CAP.pick('today-row', r.counts, r.span);
64
+ try { localStorage.setItem(CAP_KEY, JSON.stringify({ ids, at: new Date().toISOString() })); } catch { /* kept for this visit only */ }
65
+ if (!saved || JSON.stringify(saved.ids) !== JSON.stringify(ids)) console.info('[five-action-cap] Today row shows ' + ids.join(', '));
66
+ TP.setCapShown(ids); draw();
67
+ }
68
+ /** A row's ⋯: the menu of what the row does not show, Change first. A press runs the row's own act; each is one today-row-more-<act> line. */
69
+ function capMenu(r, btn) {
70
+ document.querySelectorAll('.td-dp').forEach((x) => x.remove());
71
+ const j = r.job && ['Reply', 'Decide', 'Send'].includes(r.job);
72
+ const cap = CAP.todayRow([j ? 'open' : '', 'done', 'tomorrow', 'date'], [...btn.closest('.acts').querySelectorAll('[data-td]')].map((x) => x.dataset.td));
73
+ const box = document.createElement('div');
74
+ box.className = 'td-dp td-fp'; box.setAttribute('role', 'dialog'); box.setAttribute('aria-label', 'More: ' + r.title);
75
+ box.innerHTML = CAP.menuHtml(r.key, cap.more, { ...CAP.WORDS, open: r.job || 'Open' });
76
+ document.body.appendChild(box);
77
+ btn.setAttribute('aria-expanded', 'true');
78
+ const b = btn.getBoundingClientRect();
79
+ box.style.top = Math.min(innerHeight - box.offsetHeight - 12, b.bottom + 6) + 'px'; box.style.left = Math.max(12, b.right - box.offsetWidth) + 'px';
80
+ const close = (back) => { box.remove(); removeEventListener('pointerdown', out, true); if (btn.isConnected) { btn.setAttribute('aria-expanded', 'false'); if (back) btn.focus(); } };
81
+ const out = (e) => { if (!box.contains(e.target)) close(false); };
82
+ addEventListener('pointerdown', out, true);
83
+ const items = () => [...box.querySelectorAll('[role="menuitem"]')];
84
+ box.addEventListener('keydown', (e) => {
85
+ if (e.key === 'Escape') { e.stopPropagation(); close(true); return; }
86
+ if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp') return;
87
+ const L = items(), i = L.indexOf(document.activeElement); e.preventDefault();
88
+ L[(i + (e.key === 'ArrowDown' ? 1 : L.length - 1)) % L.length].focus();
89
+ });
90
+ box.addEventListener('click', (e) => {
91
+ const c = e.target.closest('[data-td]'); if (!c) return;
92
+ close(false);
93
+ noteUse('today-row-more-' + c.dataset.td);
94
+ run(c.dataset.td, r.key, btn, true);
95
+ });
96
+ const f = items()[0]; if (f) f.focus();
52
97
  }
53
98
  /* today-order (A310): the pinned order (GET /api/today-order, lib/today-order.js), the one store `pmos today order` writes too */
54
99
  async function readPin() {
@@ -633,7 +678,7 @@ export function mountToday(ctx) {
633
678
  // a phone: a row or the proposal swiped; the act is the one its button had on a desk, said in the toast with Undo
634
679
  wireSwipe(el, { on: phone, act: (row, way) => { const act = row.dataset[way === 'right' ? 'swRight' : 'swLeft']; if (act) run(act, row.dataset.key || '', { dataset: {}, disabled: false, isConnected: false }); } });
635
680
  }
636
- async function run(act, key, b) {
681
+ async function run(act, key, b, viaMore) {
637
682
  if (act === 'line') { console.info('[quiet-rows-line] dashed line opened'); return; } // the link opens Work › Line, which counts the open (qr-line)
638
683
  if (act === 'cal') { ctx.openCalendar(); return; }
639
684
  if (act === 'ord-pin') { pinPress(b); return; } // today-order: pin or unpin the order
@@ -721,6 +766,8 @@ export function mountToday(ctx) {
721
766
  if (act === 'q-remind') { remindQuestion(r.ref); return; }
722
767
  if (act === 'open') { open(r); return; }
723
768
  if (act === 'so-open') { signoffOpen(r); return; }
769
+ if (!viaMore && (act === 'done' || act === 'tomorrow' || act === 'date')) noteUse('today-row-' + act); // five-action-cap: a press on a shown button
770
+ if (act === 'cap-more') { capMenu(r, b); return; }
724
771
  if (act === 'date') { chooseDate(r, b); return; }
725
772
  if (act === 'file') { chooseFile(r, b); return; } // capture-to-initiative: the filed chip's change
726
773
  if (X.busy.has(key)) return;
@@ -9,7 +9,8 @@
9
9
  * (pm-tabs: All, Reply, Do, Decide, Send with counts, a zero tab left out), the capture Input (pm-input), then the groups: Your move
10
10
  * (the Now group, pm-group now: ranked rows with a ✦ why, five and a fold; its first row lit), Today (pm-group), and Later folded (pm-fold "N can wait"), PMOS handled folded last.
11
11
  * Row a ListRow (pm-li): the kind icon, the title, a why line ("for <work> · due <date>", or who waits), a late Badge (pm-badge alert),
12
- * and on hover or focus icon Buttons: first by job (Done, Reply, Decide, Send), then Move to tomorrow and Set a date. A ✦ Suggestion
12
+ * and on hover or focus icon Buttons: first by job (Done, Reply, Decide, Send), then Put off a day; three at most, the rest
13
+ * under ⋯ with Set a date in its Change group (five-action-cap, pm/five-action-cap.js). A ✦ Suggestion
13
14
  * under the row when PMOS proposes something on it (drop it, looks answered, draft them).
14
15
  * Side a Timeline block (pm-block flat) with the day's events only: past ones dashed (pm-ev over), the rest raised, the now line in the
15
16
  * alert colour, a link to Events; a meeting with a call has the play Button (join and record in one press, meeting-buddy). Below it,
@@ -18,7 +19,11 @@
18
19
 
19
20
  import { dashModel as lineDash, dashHtml as lineDashHtml } from './line-view.js'; // quiet-rows-line: Your move ends with the line's dashed line
20
21
  import { groupsHtml as questionGroups, phoneGroupsHtml as phoneQuestionGroups } from './open-questions-view.js'; // open-questions-today (A420)
21
- import { linkedHtml } from './cozy-name-links.js'; // name-links (A536): names in a line you typed link to the person, meeting or document
22
+ import { linkedHtml } from './cozy-name-links.js';
23
+ import * as CAP from './five-action-cap.js'; // five-action-cap (A529): a row shows three at most on hover, two actions and ⋯
24
+ /** The two a Today row shows (pm/five-action-cap.js pick, from the use log; the app sets it once a week). */
25
+ let CAP_SHOWN = [...CAP.PLACES['today-row'].def];
26
+ export function setCapShown(ids) { if (Array.isArray(ids) && ids.length) CAP_SHOWN = ids.slice(0, CAP.PLACES['today-row'].slots); } // name-links (A536): names in a line you typed link to the person, meeting or document
22
27
 
23
28
  /** What a right-click on a Today row names (initiative ask-anywhere): its initiative when it has one, else the row itself. */
24
29
  function askOf(r) {
@@ -94,8 +99,11 @@ export function rowHtml(r, o = {}) {
94
99
  else if (r.src === 'lab') acts = ib('lab-keep', 'Keep it: start an initiative from ' + t, I.yes, r.key) + ib('lab-drop', 'Drop it: ' + t, I.no, r.key);
95
100
  else {
96
101
  const j = JOB_ACT[r.job];
97
- acts = (j ? ib(j[0], j[1] + ': ' + t, j[2], r.key) : '') + ib('done', 'Done: ' + t, I.done, r.key)
98
- + ib('tomorrow', 'Move to tomorrow: ' + t, I.tomorrow, r.key) + ib('date', 'Set a date: ' + t, I.date, r.key, ' aria-haspopup="dialog"');
102
+ // five-action-cap: two show (a job keeps its place first) and ⋯ holds the rest, its Change group first; nothing is lost
103
+ const B = { open: j ? ib(j[0], j[1] + ': ' + t, j[2], r.key) : '', done: ib('done', 'Done: ' + t, I.done, r.key),
104
+ tomorrow: ib('tomorrow', 'Put off a day: ' + t, I.tomorrow, r.key), date: ib('date', 'Set a date: ' + t, I.date, r.key, ' aria-haspopup="dialog"') };
105
+ const cap = CAP.todayRow([j ? 'open' : '', 'done', 'tomorrow', 'date'], CAP_SHOWN);
106
+ acts = cap.shown.map((k) => B[k]).join('') + (cap.more.length ? CAP.moreButton(r.key, t) : '');
99
107
  }
100
108
  }
101
109
  const cls = ['td-li', 'pm-li', o.lit && !r.done ? 'now' : '', r.done ? 'done' : '', r.bullet === 'note' || r.src === 'note' ? 'note' : '', r.src === 'lab' ? 'lab' : '', r.member ? 'mem nest' : ''].filter(Boolean).join(' ');
@@ -0,0 +1,104 @@
1
+ /* pm/five-action-cap.js — Work and Today get the work popup's five-action limit (five-action-cap, idea A529; board BoardHomeCapDS, agreed
2
+ * 2026-11-25). PURE: lists and strings, no DOM and no reads. The popup's own cap is pm/pop-cap.js; this module carries the same rule to
3
+ * the other places that change most.
4
+ *
5
+ * ONE RULE a page header shows five actions at most (HEAD_MAX); a card or row shows three at most on hover (ROW_MAX): two actions and ⋯.
6
+ * The rest go under ⋯, whose first group, Change, holds every change action not shown. Set the date and Stage are never
7
+ * dropped from both places (the A498 lesson, #1821). A new action replaces one or goes under ⋯.
8
+ * WHICH ONES the ones used most in the last 30 days (the local use log, `<place>-<action>` presses), worked out at most once a week;
9
+ * before 30 days of use, the place's defaults (Today row: Done, Put off a day).
10
+ *
11
+ * PLACES { 'today-row': { max, slots, acts, def, change, keep, label }, 'work-head': … }
12
+ * pick(place, counts, span) → the ids shown: the most used in 30 days, else the defaults
13
+ * due(saved, place, now) → true when the shown ids are worked out again (none saved, unknown ids, or a week old)
14
+ * todayRow(avail, shown) → { shown: [ids], more: [{ group, items: [ids] }] } for one Today row. avail: the actions this row has,
15
+ * job first ('open' for Reply, Decide or Send). A job keeps its place first; the slots left take the shown ids.
16
+ * lost(full, shown, more) → the ids of full that are neither shown nor under ⋯ (the guard: always [])
17
+ * countRowButtons(html) → the buttons of a row's hover set (<span class="acts …">)
18
+ * countHeadActions(html) → the actions of a page header: its buttons and chips, not the path, not ⋯
19
+ * moreButton(key, label) → the row's ⋯ (icon only, aria-label)
20
+ * menuHtml(key, groups, words) → the ⋯ menu (pm-menu): its groups and items, each a button with its words
21
+ * The UI says PMOS, never Claude. Every icon button carries aria-label. */
22
+ export const HEAD_MAX = 5;
23
+ export const ROW_MAX = 3; // two actions and ⋯
24
+ export const SPAN_DAYS = 30;
25
+ // The use log keeps 30 days and prunes once a day (lib/use-log.js), so a full log's oldest line is 29 to 30 whole days old: 29 counts as full.
26
+ export const FULL_DAYS = SPAN_DAYS - 1;
27
+ export const WEEK = 7 * 864e5;
28
+
29
+ /** The places. acts: every action the place can show; def: the shown ones before 30 days of use; change: the change actions (they go in the
30
+ * Change group of ⋯ when not shown); keep: never dropped from both shown and ⋯. */
31
+ export const PLACES = Object.freeze({
32
+ 'today-row': Object.freeze({ max: ROW_MAX, slots: 2, acts: ['done', 'tomorrow', 'date'], def: ['done', 'tomorrow'], change: ['date', 'tomorrow', 'done'], keep: ['date'], label: 'Today row' }),
33
+ 'work-head': Object.freeze({ max: HEAD_MAX, slots: 5, acts: ['view', 'ask', 'find', 'filter', 'new'], def: ['view', 'ask', 'find', 'filter', 'new'], change: [], keep: [], label: 'Work header' }),
34
+ });
35
+ /** The words of each Today row action, as the row says them. */
36
+ export const WORDS = Object.freeze({ done: 'Done', tomorrow: 'Put off a day', date: 'Set a date', open: 'Open' });
37
+
38
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
39
+
40
+ /** The shown ids of a place. counts: { 'today-row-done': 3, … } or { done: 3 }; span: the whole days the use log covers. */
41
+ export function pick(place, counts, span) {
42
+ const P = PLACES[place]; if (!P) return [];
43
+ if (!(Number(span) >= FULL_DAYS) || !counts) return [...P.def];
44
+ const n = (k) => Number(counts[place + '-' + k] != null ? counts[place + '-' + k] : counts[k]) || 0;
45
+ const used = P.acts.filter((k) => n(k) > 0).sort((a, b) => n(b) - n(a) || P.acts.indexOf(a) - P.acts.indexOf(b));
46
+ const out = used.slice(0, P.slots);
47
+ for (const k of P.def) if (out.length < P.slots && !out.includes(k)) out.push(k);
48
+ for (const k of P.acts) if (out.length < P.slots && !out.includes(k)) out.push(k);
49
+ return out;
50
+ }
51
+ /** Work the shown ids out again? None saved, a list that is not the place's size of known ids, or saved a week or more ago. */
52
+ export function due(saved, place, now = Date.now()) {
53
+ const P = PLACES[place];
54
+ if (!P || !saved || !Array.isArray(saved.ids) || saved.ids.length !== P.slots || !saved.ids.every((k) => P.acts.includes(k))) return true;
55
+ const at = Date.parse(saved.at || '');
56
+ return !(at > 0) || now - at >= WEEK;
57
+ }
58
+
59
+ /** One Today row. avail: the actions it has, in its own order (a job act 'open' first when it has one). shown: pick('today-row', …).
60
+ * Up to three actions: all show, as before, unless the row has more than ROW_MAX; then two show and ⋯ holds the rest. With the default
61
+ * pick a plain row (Done, Put off a day, Set a date) shows Done, Put off a day and ⋯, as the board draws it. */
62
+ export function todayRow(avail, shown = PLACES['today-row'].def) {
63
+ const P = PLACES['today-row'], A = (avail || []).filter(Boolean);
64
+ const job = A[0] && !P.acts.includes(A[0]) ? A[0] : null;
65
+ const rest = A.filter((k) => k !== job);
66
+ if (A.length <= 2) return { shown: A, more: [] }; // nothing to fold: zero is silence
67
+ const out = job ? [job] : [];
68
+ for (const k of shown || []) if (out.length < P.slots && rest.includes(k) && !out.includes(k)) out.push(k);
69
+ for (const k of rest) if (out.length < P.slots && !out.includes(k)) out.push(k);
70
+ const left = rest.filter((k) => !out.includes(k));
71
+ const change = P.change.filter((k) => left.includes(k));
72
+ const other = left.filter((k) => !change.includes(k));
73
+ return { shown: out, more: [{ group: 'Change', items: change }, { group: 'More', items: other }].filter((g) => g.items.length) };
74
+ }
75
+ /** The guard: the ids of full that are neither shown nor under ⋯. */
76
+ export function lost(full, shown, more) {
77
+ const both = new Set([...(shown || []), ...(more || []).flatMap((g) => g.items)]);
78
+ return (full || []).filter((k) => !both.has(k));
79
+ }
80
+
81
+ /** The buttons of a row's hover set: the <span class="acts …"> of a ListRow. */
82
+ export function countRowButtons(html) {
83
+ const m = /<span class="acts[^"]*">([\s\S]*?)<\/span>(?=<\/div>|$)/.exec(String(html || ''));
84
+ return m ? (m[1].match(/<button\b/g) || []).length : 0;
85
+ }
86
+ /** The actions of a page header: its buttons (an icon button or a chip), not the path (the product picker moves you), not ⋯ (moreBtn, More)
87
+ * and not a button inside a menu the header opens. */
88
+ export function countHeadActions(html) {
89
+ let s = String(html || '').replace(/<nav\b[\s\S]*?<\/nav>/g, '');
90
+ s = s.replace(/<span[^>]*role="group"[^>]*>[\s\S]*?<\/span>/g, '');
91
+ return (s.match(/<button\b(?![^>]*\b(id="moreBtn"|aria-label="More")\b)[^>]*>/g) || []).length;
92
+ }
93
+
94
+ const svg = (d) => `<svg class="pm-ic" aria-hidden="true" width="16" height="16" viewBox="0 0 24 24"><path d="${d}"/></svg>`;
95
+ export const MORE_ICON = 'M6 12h.01M12 12h.01M18 12h.01';
96
+ /** The row's ⋯: icon only, with its words for a screen reader. */
97
+ export function moreButton(key, label) {
98
+ return `<button type="button" class="td-ib pm-btn" data-td="cap-more" data-key="${esc(key)}" aria-haspopup="menu" aria-expanded="false" aria-label="${esc('More: ' + label)}" title="More">${svg(MORE_ICON)}</button>`;
99
+ }
100
+ /** The ⋯ menu (pm-menu): a label per group, then each action as a menu item that runs the row's own act (data-td). */
101
+ export function menuHtml(key, groups, words = WORDS) {
102
+ return `<div class="pm-menu td-capm" role="menu" aria-label="More actions">${(groups || []).map((g) => `<p class="pm-meta td-capg">${esc(g.group)}</p>`
103
+ + g.items.map((k) => `<button type="button" role="menuitem" class="pm-btn ghost" data-td="${esc(k)}" data-key="${esc(key)}"${k === 'date' ? ' aria-haspopup="dialog"' : ''}>${esc(words[k] || k)}</button>`).join('')).join('')}</div>`;
104
+ }