create-pmos 0.614.0 → 0.615.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.614.0",
3
+ "version": "0.615.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -33,6 +33,19 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.615.0",
38
+ "at": "2026-11-19T03:15:37.053Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1394,
43
+ "t": "Events audit round 2: product names, report names, old drafts, people's names",
44
+ "s": "Events audit round 2: product names, report names, old drafts, people's names",
45
+ "k": "fix"
46
+ }
47
+ ]
48
+ },
36
49
  {
37
50
  "v": "0.614.0",
38
51
  "at": "2026-11-19T02:50:21.667Z",
@@ -411,31 +424,6 @@
411
424
  "k": "new"
412
425
  }
413
426
  ]
414
- },
415
- {
416
- "v": "0.595.0",
417
- "at": "2026-11-18T02:36:22.728Z",
418
- "f": 4,
419
- "prs": [
420
- {
421
- "n": 1336,
422
- "t": "Keep the meeting share popover's cozy fonts out of the console type check",
423
- "s": "Keep the meeting share popover's cozy fonts out of the console type check",
424
- "k": "fix"
425
- },
426
- {
427
- "n": 1334,
428
- "t": "Show a session's task list from TaskCreate/TaskUpdate",
429
- "s": "Show a session's task list from TaskCreate/TaskUpdate",
430
- "k": "fix"
431
- },
432
- {
433
- "n": 1337,
434
- "t": "Scheduled work shows how often and when next, and the PM sets it",
435
- "s": "Scheduled work shows how often and when next, and the PM sets it",
436
- "k": "new"
437
- }
438
- ]
439
427
  }
440
428
  ]
441
429
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@a3739456
1
+ kernel-source: pmos@4138e5d2
2
2
  assembled: 2026-11-19
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-11-19T02:50:19Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-19T03:15:33Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-11-19T02:50:19Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-19T03:15:33Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-11-19T02:50:19Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-19T03:15:33Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "v": "0.615.0",
4
+ "at": "2026-11-19T03:15:37.053Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1394,
9
+ "t": "Events audit round 2: product names, report names, old drafts, people's names",
10
+ "s": "Events audit round 2: product names, report names, old drafts, people's names",
11
+ "k": "fix"
12
+ }
13
+ ]
14
+ },
2
15
  {
3
16
  "v": "0.614.0",
4
17
  "at": "2026-11-19T02:50:21.667Z",
@@ -109,10 +109,10 @@ Events is one page for everything with a date, from every source PMOS reads: you
109
109
 
110
110
  - Each row starts its grey line with its type: **Meeting**, **Focus time**, **Milestone**, **Task**, **Report** or **Deadline**. A deadline names its source, for example "From Slack · Ang, 18 Nov". Press it to see the line that states the date, with a link to the source.
111
111
 
112
- - **Late** lists the dates that passed. For each one, PMOS suggests what to do: "It looks done. Mark it done" when the work is already in a later stage, a new date from the Jira forecast or from the planned finish, "Moves with" a task of the same stage, or "Drop it" for a task that is 28 days late or more. Press ✓ to do it, or ✕ to say no. PMOS does not suggest the same thing again after a no. **Yes to all** takes every suggestion in one press. Each change has Undo for a moment.
112
+ - **Late** lists the dates that passed. For each one, PMOS suggests what to do: "It looks done. Mark it done" when the work is already in a later stage, a new date from the Jira forecast or from the planned finish, "Moves with" a task of the same stage, or "Drop it" for a task that is 28 days late or more. Press ✓ to do it, or ✕ to say no. PMOS does not suggest the same thing again after a no. **Yes to all** takes every suggestion in view in one press. While the older late dates are folded, it reads **Yes to these 5** and takes only the five you see. Each change has Undo for a moment.
113
113
  - PMOS cannot write a Jira date or an initiative's planned finish, so for those it suggests one of three things. "It looks done. Mark it done" appears when the work is already past Deliver. "Drop this date" appears when the date is 90 days late or more. Either way, Events stops listing the date. For any other late date, PMOS suggests "Ask the owner for a new date", and ✓ adds that ask to your own tasks, due today. A date that is at risk in Coming up gets "Ask the owner if 27 Nov holds".
114
114
  - Late shows the newest five dates first. One line under them, such as "16 more late, the oldest 350 days", opens the rest.
115
- - **Today** holds today's dates, with one press to the act itself: read the draft of a report, mark a task done, or open the work a meeting is about.
115
+ - **Today** holds today's dates, with one press to the act itself: read the draft of a report, mark a task done, or open the work a meeting is about. A report shows by its name and the day in words ("IDPF sprint biweekly update · 28 Oct"). Report drafts more than 14 days old are one row, "9 old report drafts", where PMOS suggests **Drop them** with ✓ and ✕. ✓ takes them off Events, with **Undo**, and the drafts stay in the Library.
116
116
  - **Coming up** holds the next 30 days (meetings: the next 7). A day with three meetings or more is one line, such as "Fri 20 Nov · 5 meetings". Press it to see them. Milestones, tasks, deadlines and reports on that day keep their own rows. Only a date at risk carries a suggestion. A date that needs nothing shows nothing.
117
117
  - Every late or at-risk date has a suggestion. A late task of yours with no later day in any record gets "Move to today". A late Jira ticket gets "Set a new date in Jira", which ✓ adds to your tasks. A late deadline from a source gets "Ask Ang where it stands".
118
118
  - The delivery milestones after that are one line at the bottom, for example "6 delivery milestones in 2027. The next is 3 Mar: …". Press it to see them.
@@ -42,6 +42,8 @@
42
42
  * A Jira item and a plan end: no route here writes them, so what PMOS suggests is kept by Events or is a task for the PM:
43
43
  * met late, and its initiative is in a stage after Deliver: "It looks done. Mark it done". Events stops listing it.
44
44
  * gone late OLD_DAYS days or more: "Drop this date". Events stops listing it.
45
+ * drafts a report draft older than DRAFT_OLD_DAYS is not a row of its own: the old ones are one row, "N old report drafts", with "Drop them"
46
+ * (suggest.keys: each draft's key, marked dropped). A report row says the report's name and the day in words, never a file name.
45
47
  * ask any other late one: "Ask the owner for a new date". Coming up and at risk: "Ask the owner if <day> holds". ✓ adds the ask as the
46
48
  * PM's own task, due today.
47
49
  * EVERY LATE AND AT-RISK ROW HAS ONE (round 2, point 5). What the rules above leave empty:
@@ -79,6 +81,9 @@ function shortDay(d, today) {
79
81
  }
80
82
  const clip = (s, n) => { s = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return s.length > n ? s.slice(0, n - 1).trimEnd() + '…' : s; };
81
83
  const cap = (s) => String(s || '').replace(/[-_]+/g, ' ').replace(/^./, (c) => c.toUpperCase());
84
+ /** A person's name as a name: "vidhi" → "Vidhi", "budi santoso" → "Budi Santoso". A name written with any capital stays as written. */
85
+ const personName = (s) => { const t = String(s || '').trim(); return /[A-Z]/.test(t) ? t : t.replace(/(^|[\s.'-])([a-z])/g, (m, a, c) => a + c.toUpperCase()); };
86
+ const DRAFT_OLD_DAYS = 14;
82
87
 
83
88
  /** The name of a stage key or name, from the row's own workflow when it has one. */
84
89
  function stageName(r, sec) {
@@ -207,22 +212,46 @@ function build(input = {}) {
207
212
  }
208
213
  }
209
214
 
210
- const draftOf = new Map();
211
- for (const d of input.drafts || []) if (d && d.cadence && !draftOf.has(d.cadence)) draftOf.set(d.cadence, d);
215
+ // a report's name, never its file: the schedule's name, else its cadence in words ("idpf-sprint-biweekly-update" → "IDPF sprint biweekly
216
+ // update"; a word that is a product's short name is written in capitals); the date goes beside it in words
217
+ const shorts = new Set(['pmos']);
218
+ for (const b of input.boards || []) for (const w of String(b.name || b.ws || '').toLowerCase().split(/[-_\s]+/)) if (/^[a-z]{2,5}$/.test(w) && w !== 'the') shorts.add(w);
219
+ const nameOfCadence = new Map((input.schedules || []).filter((x) => x && x.cadence && x.name).map((x) => [x.cadence, x.name]));
220
+ const reportName = (cadence) => {
221
+ const n = nameOfCadence.get(cadence);
222
+ if (n) return clip(n, 120);
223
+ const words = String(cadence || 'report').split(/[-_\s]+/).filter(Boolean).map((w) => (shorts.has(w.toLowerCase()) ? w.toUpperCase() : w.toLowerCase()));
224
+ const t = words.join(' ');
225
+ // one word ("weekly") is a cadence, so it is "Weekly report"; more words are the report's own name
226
+ return clip((/^[A-Z]{2,}\b/.test(t) ? t : t.replace(/^./, (c) => c.toUpperCase())) + (words.length === 1 && !/^report$/i.test(t) ? ' report' : ''), 120);
227
+ };
228
+ const draftOf = new Map(); // ws|cadence → the newest draft
229
+ for (const d of input.drafts || []) { const k = (d && d.ws || '') + '|' + (d && d.cadence); if (d && d.cadence && !draftOf.has(k)) draftOf.set(k, d); }
212
230
  // a draft whose report goes out today is said on that report's row, not on a row of its own
213
231
  const outToday = new Set((input.schedules || []).filter((s) => s && isDay(s.next) && day10(s.next) === today).map((s) => s.cadence));
232
+ const oldDrafts = [];
214
233
  for (const d of draftOf.values()) {
215
234
  if (outToday.has(d.cadence)) continue;
216
- put({ key: 'draft:' + (d.ws || '') + '|' + d.cadence + '|' + (d.slot || ''), kind: 'report', date: today, time: null, until: null, title: clip(d.title || cap(d.cadence) + ' report', 120),
217
- line: 'The draft' + (isDay(d.slot) && day10(d.slot) !== today ? ' of ' + shortDay(d.slot, today) : '') + ' waits for you to issue it', product: '', work: null, task: null, own: null, jira: false, canFix: false, editable: false, draft: true,
235
+ const key = 'draft:' + (d.ws || '') + '|' + d.cadence + '|' + (d.slot || '');
236
+ if (gone.has(key)) continue;
237
+ // a draft more than two weeks old is not today's work: the old ones are one line, "N old report drafts", that PMOS offers to drop
238
+ if (isDay(d.slot) && daysBetween(day10(d.slot), today) > DRAFT_OLD_DAYS) { oldDrafts.push(key); continue; }
239
+ put({ key, kind: 'report', date: today, time: null, until: null, title: reportName(d.cadence) + (isDay(d.slot) ? ' · ' + shortDay(d.slot, today) : ''),
240
+ line: 'The draft waits for you to issue it', product: '', work: null, task: null, own: null, jira: false, canFix: false, editable: false, draft: true,
218
241
  scope: d.ws ? ['p:' + d.ws] : [], act: { label: 'Read the draft', href: '/premium-intelligence.html?tab=library' } });
219
242
  }
243
+ if (oldDrafts.length) {
244
+ put({ key: 'drafts:old', kind: 'report', date: today, time: null, until: null, title: oldDrafts.length + ' old report ' + (oldDrafts.length === 1 ? 'draft' : 'drafts'),
245
+ line: 'More than ' + DRAFT_OLD_DAYS + ' days old, not issued', product: '', work: null, task: null, own: null, jira: false, canFix: false, editable: false, draft: true,
246
+ oldDrafts, scope: [], act: { label: 'Read the drafts', href: '/premium-intelligence.html?tab=library' } });
247
+ }
248
+ const draftByCadence = new Map([...draftOf.values()].map((d) => [d.cadence, d]));
220
249
  for (const s of input.schedules || []) {
221
250
  if (!s || !isDay(s.next)) continue;
222
- const name = clip(s.name || cap(s.cadence) + ' report', 120);
223
- const d = draftOf.get(s.cadence);
251
+ const name = reportName(s.cadence) ;
252
+ const d = draftByCadence.get(s.cadence);
224
253
  const waits = d && daysBetween(today, s.next) === 0;
225
- put({ key: 'rep:' + (s.id || s.cadence) + ':' + day10(s.next), kind: 'report', date: s.next, time: /^\d{2}:\d{2}$/.test(String(s.time || '')) ? s.time : null, until: null, title: name,
254
+ put({ key: 'rep:' + (s.id || s.cadence) + ':' + day10(s.next), kind: 'report', date: s.next, time: /^\d{2}:\d{2}$/.test(String(s.time || '')) ? s.time : null, until: null, title: s.name ? clip(s.name, 120) : name,
226
255
  line: [s.cadence ? 'Goes out ' + String(s.cadence).replace(/[-_]+/g, ' ') : 'Goes out', waits ? 'the draft waits for you' : ''].filter(Boolean).join(' · '), product: '', work: null, task: null, own: null, jira: false, canFix: false, editable: false,
227
256
  scope: [], act: waits ? { label: 'Read the draft', href: '/premium-intelligence.html?tab=library' } : null });
228
257
  }
@@ -274,7 +303,7 @@ function build(input = {}) {
274
303
  return declined.has(sig) ? null : { ...s, sig };
275
304
  };
276
305
  // a Jira date or a plan end: Events keeps the PM's answer (met, gone), or the PM asks the owner
277
- const owner = (r) => (r && r.owner && !MINE.test(String(r.owner).trim()) ? clip(r.owner, 40) : 'the owner');
306
+ const owner = (r) => (r && r.owner && !MINE.test(String(r.owner).trim()) ? clip(personName(r.owner), 40) : 'the owner');
278
307
  const askHolds = (x, r, why) => { const who = owner(r), d = shortDay(x.date, today); return say(x, { op: 'ask', ask: 'Ask ' + who + ' if ' + d + ' holds: ' + x.title, text: 'Ask ' + who + ' if ' + d + ' holds', why }); };
279
308
  const noWrite = (x, r) => {
280
309
  if (x.group === 'late') {
@@ -295,7 +324,7 @@ function build(input = {}) {
295
324
  if (x.kind === 'deadline') {
296
325
  if (x.group !== 'late') continue;
297
326
  if (-x.days >= DROP_DAYS) { x.suggest = say(x, { op: 'gone', text: 'Drop this date', why: 'It is ' + (-x.days) + ' days past, and no source names a new one.' }); continue; }
298
- const who = x.who ? clip(x.who, 40) : 'them';
327
+ const who = x.who ? clip(personName(x.who), 40) : 'them';
299
328
  x.suggest = say(x, { op: 'ask', ask: 'Ask ' + who + ' where it stands: ' + x.title, text: 'Ask ' + who + ' where it stands', why: 'The day ' + x.source.from + ' named has passed.' });
300
329
  continue;
301
330
  }
@@ -347,6 +376,13 @@ function build(input = {}) {
347
376
  x.suggest = askHolds(x, x.row, 'The work is at risk.');
348
377
  }
349
378
  }
379
+ // the old report drafts: one suggestion for all of them. ✓ marks each one dropped (Events stops listing it; the files stay), with Undo
380
+ for (const x of items) {
381
+ if (!x.oldDrafts) continue;
382
+ const sig = 'drafts:old|gone|' + x.oldDrafts.length;
383
+ x.suggest = declined.has(sig) ? null : { op: 'gone', keys: x.oldDrafts.slice(), text: 'Drop them', why: 'None was issued, and the newest is more than ' + DRAFT_OLD_DAYS + ' days old. The files stay in the Library.', sig };
384
+ delete x.oldDrafts;
385
+ }
350
386
 
351
387
  const ORDER = { late: 0, today: 1, coming: 2, later: 3 };
352
388
  // Late: the newest first, so the dates you can still save come before the old ones. A day: the dates with no time first, then by time
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.614.0",
3
+ "version": "0.615.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.614.0",
9
+ "version": "0.615.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.614.0",
3
+ "version": "0.615.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",
@@ -16,6 +16,8 @@
16
16
  * KINDS · KIND_LABEL · LATE_SHOWN · shiftMonth(ym, n) · weekOf(day)
17
17
  * Text from records goes through esc(). Every icon-only button has an aria-label. The words say PMOS. */
18
18
 
19
+ import { productName } from './scope-chip.js'; // the one product-name function (audit round 2: names, not ids)
20
+
19
21
  export const TYPES = ['meeting', 'focus', 'milestone', 'task', 'report', 'deadline'];
20
22
  export const KINDS = TYPES; // the filter is by type since round 2
21
23
  export const LATE_SHOWN = 5;
@@ -24,8 +26,16 @@ export const TYPE_WORD = { meeting: 'Meeting', focus: 'Focus time', milestone: '
24
26
  export const TYPE_LABEL = { meeting: 'Meetings', focus: 'Focus time', milestone: 'Milestones', task: 'Tasks', report: 'Reports', deadline: 'Deadlines' };
25
27
  export const KIND_LABEL = TYPE_LABEL;
26
28
  const typeOf = (x) => x.type || x.kind;
29
+ /** The model's line with the product by its display name ("Planned finish · IDPF", not "· pmos-idpf"). */
30
+ export const lineText = (x) => {
31
+ const l = String(x.line || '');
32
+ if (!l || !x.product) return l;
33
+ const ws = (x.work && x.work.ws) || ((x.scope || []).find((t) => /^p:/.test(t)) || '').slice(2);
34
+ const n = ws ? productName(ws, x.product) : x.product;
35
+ return n === x.product ? l : l.split(x.product).join(n);
36
+ };
27
37
  /** The grey line: the type word first, then what the model says. */
28
- export const lineOf = (x) => TYPE_WORD[typeOf(x)] + (x.line ? ' · ' + x.line : '');
38
+ export const lineOf = (x) => TYPE_WORD[typeOf(x)] + (x.line ? ' · ' + lineText(x) : '');
29
39
  const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
30
40
  const MONTH = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
31
41
  const WD = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
@@ -79,7 +89,10 @@ export function rowHtml(x, o = {}) {
79
89
  // a meeting under an opened busy day: only its time, the day row above names the day
80
90
  const d = o.child ? { b: x.time || 'All day', s: x.until ? 'to ' + x.until : '' } : dayCell(x, today);
81
91
  const kindWord = TYPE_WORD[typeOf(x)];
82
- const what = `<b>${esc(x.title)}</b><small><em class="evp-ty">${esc(kindWord)}</em>${x.line ? ' · ' + esc(x.line) : ''}</small>`;
92
+ // a row whose name is its type ("Focus time") does not say the type again
93
+ const same = String(x.title || '').trim().toLowerCase() === String(kindWord || '').toLowerCase();
94
+ const small = same ? (x.line ? `<small>${esc(lineText(x))}</small>` : '') : `<small><em class="evp-ty">${esc(kindWord)}</em>${x.line ? ' · ' + esc(lineText(x)) : ''}</small>`;
95
+ const what = `<b>${esc(x.title)}</b>${small}`;
83
96
  const srcOpen = x.source && o.open && o.open.has('src:' + x.key);
84
97
  const t = x.source ? `<button type="button" class="evp-t" data-evp-src aria-expanded="${srcOpen ? 'true' : 'false'}" aria-label="${esc(x.title)}. ${esc(lineOf(x))}. Show what was said">${what}</button>`
85
98
  : x.work || x.task || x.own || x.link ? `<button type="button" class="evp-t" data-evp-open aria-label="${esc(x.title)}. ${esc(lineOf(x))}. Open it">${what}</button>` : `<span class="evp-t">${what}</span>`;
@@ -153,13 +166,19 @@ export function hiddenHtml(items, o = {}) {
153
166
  }
154
167
  const fold = (key, open, text) => `<button type="button" class="evp-fold" data-evp-fold="${key}" aria-expanded="${open ? 'true' : 'false'}"><i aria-hidden="true">${svg(ICON.go, 14)}</i><span>${text}</span></button>`;
155
168
 
169
+ /** The late rows in view: the newest LATE_SHOWN while the rest are folded, else all. Yes to all takes these. */
170
+ export function lateInView(model, o = {}) {
171
+ const late = groupsOf(model.items, o).late;
172
+ return !o.day && late.length > LATE_SHOWN + 1 && !(o.open && o.open.has('late')) ? late.slice(0, LATE_SHOWN) : late;
173
+ }
156
174
  /** The left side. model: { today, items, later }; o: { show, day, busy } */
157
175
  export function listHtml(model, o = {}) {
158
176
  const today = model.today;
159
177
  const G = groupsOf(model.items, o);
160
- const yes = G.late.filter((x) => x.suggest).length;
161
- const all = yes > 1 ? `<button type="button" class="evp-all" data-evp-all>Yes to all ${yes}</button>` : '';
162
178
  const open = o.open || new Set();
179
+ // Yes to all says yes only to what is in view: "Yes to these 5" while the older late rows are folded (as the Backlog does)
180
+ const seen = lateInView(model, o), yes = seen.filter((x) => x.suggest).length, folded = seen.length < G.late.length;
181
+ const all = yes > 1 ? `<button type="button" class="evp-all" data-evp-all>${folded ? 'Yes to these' : 'Yes to all'} ${yes}</button>` : '';
163
182
  const ro = { today, busy: o.busy, open };
164
183
  let later = '';
165
184
  const on = new Set(o.show || TYPES);
@@ -19,7 +19,7 @@
19
19
  import { mountNav } from './cozy-nav.js';
20
20
  import * as POP from './cozy-popup.js';
21
21
  import { pmGet, pmPost } from './http.js';
22
- import { TYPES, listHtml, calHtml, monthHtml, showHtml, hiddenHtml, countsOf, shiftMonth, esc } from './cozy-events-view.js';
22
+ import { TYPES, listHtml, calHtml, monthHtml, showHtml, hiddenHtml, countsOf, shiftMonth, esc, lateInView } from './cozy-events-view.js';
23
23
  import { readPick } from './cozy-pick.js';
24
24
  import { scopeChipHtml, openScope, matches, narrowed, scopeWords, whenNames } from './scope-chip.js';
25
25
 
@@ -123,6 +123,11 @@ async function apply(x, s) {
123
123
  if (x.own) { const r = await pmPost('/api/pm-items/remove', { id: x.own }); return { ok: r && r.ok !== false, error: r && r.error, undo: () => pmPost('/api/pm-items/undo', { id: x.own }) }; }
124
124
  const r = await setState(x, "Won't do"); return { ok: r && r.ok !== false, error: r && r.error, undo: () => setState(x, was) };
125
125
  }
126
+ if (s.op === 'gone' && Array.isArray(s.keys)) { // the old report drafts: each one marked dropped; the files stay
127
+ const done = [];
128
+ for (const key of s.keys) { const r = await pmPost('/api/events-place/mark', { key, gone: 'dropped' }); if (r && r.ok !== false) done.push(key); else return { ok: false, error: (r && r.error) || 'Nothing was changed.', undo: null }; }
129
+ return { ok: true, undo: async () => { for (const key of done) await pmPost('/api/events-place/mark', { key, gone: false }); } };
130
+ }
126
131
  if (s.op === 'met' || s.op === 'gone') {
127
132
  const r = await pmPost('/api/events-place/mark', { key: x.key, gone: s.op === 'met' ? 'met' : 'dropped' });
128
133
  return { ok: r && r.ok !== false, error: r && r.error, undo: () => pmPost('/api/events-place/mark', { key: x.key, gone: false }) };
@@ -150,7 +155,8 @@ async function yes(x) {
150
155
  }
151
156
  async function yesAll() {
152
157
  const ok = scopeOk();
153
- const list = S.model.items.filter((x) => x.group === 'late' && x.suggest && S.show.includes(x.type || x.kind) && (!ok || ok(x)) && (!S.day || x.date === S.day));
158
+ // only the late rows in view (the list's own rule): while the older ones are folded, the button says "Yes to these N"
159
+ const list = lateInView(S.model, { show: S.show, scopeOk: ok || undefined, day: S.day, open: S.open }).filter((x) => x.suggest);
154
160
  if (!list.length) return;
155
161
  list.forEach((x) => S.busy.add(x.key)); draw();
156
162
  const undos = [];
@@ -16,7 +16,7 @@
16
16
  * picked, or the row is under one of them
17
17
  * narrowed(P, sel) · scopeWords(P, sel, groups) → is anything narrowed · "pmos-cas, Lightbox GA tracking" for a "Showing … only" line
18
18
  * whenNames() → resolves when the display names are in (redraw then) · setNames(workspaces) · productRows(P) → one row per product
19
- * displayName(workspace) → the name every page shows for a workspace (Routine's Product column uses it too)
19
+ * displayName(workspace) → the name every page shows for a workspace · productName(ws, fallback) → the same by workspace id
20
20
  * groups: { programs: [{ id: 'g:…', name, n? }], projects: [{ id: 'j:…', name, product?, n? }] }; a part with no options is left out.
21
21
  * Copy says PMOS. Every press is in the menu; nothing writes but savePick. */
22
22
  import { savePick, codeOf, tonesOf } from './cozy-pick.js'; // its import adds cozy-pick.css, which this menu uses
@@ -52,7 +52,10 @@ export function whenNames() {
52
52
  return namesP;
53
53
  }
54
54
  try { if (typeof document !== 'undefined') whenNames(); } catch { /* no page */ }
55
- const nameOfWs = (p) => (NAMES.get(p.ws) || {}).name || p.name;
55
+ /** The display name of a product by its workspace id, the one name every page prints (Work, Goals, Today, Events, Library, Routine):
56
+ * productName('pmos-idpf-wt', 'mainwt') → 'IDPF'. Before the names are in (whenNames), or for a workspace PMOS does not know, the fallback. */
57
+ export const productName = (ws, fallback = '') => (NAMES.get(ws) || {}).name || fallback;
58
+ const nameOfWs = (p) => productName(p.ws, p.name);
56
59
  const keyOfWs = (p) => (NAMES.get(p.ws) || {}).key || p.ws;
57
60
  /** A project's product by its display name: from its token 'j:<ws>|…', else the name the page gave. */
58
61
  export const projectProduct = (f) => { const m = /^j:([^|]+)\|/.exec(String(f.id || '')), n = m && NAMES.get(m[1]); return (n && n.name) || f.product || ''; };