create-pmos 0.424.0 → 0.426.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 (110) hide show
  1. package/package.json +25 -25
  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/board-deliveries-test.js +153 -0
  7. package/workspace/board-programs-test.js +60 -36
  8. package/workspace/board-shot.js +4 -3
  9. package/workspace/briefing-premium-board-test.js +9 -6
  10. package/workspace/briefing-premium-insights-test.js +31 -15
  11. package/workspace/briefing-premium-products-test.js +46 -43
  12. package/workspace/calm-timeline-test.js +190 -0
  13. package/workspace/changelog.json +24 -0
  14. package/workspace/ev-everywhere-test.js +3 -1
  15. package/workspace/guide/briefing-premium.md +3 -2
  16. package/workspace/guide/claude-proposes.md +16 -1
  17. package/workspace/guide/home.md +2 -2
  18. package/workspace/guide/index.md +1 -0
  19. package/workspace/guide/notes.md +39 -1
  20. package/workspace/guide/present-in-a-meeting.md +57 -0
  21. package/workspace/guide/programs.md +4 -3
  22. package/workspace/lib/board-premium.js +3 -1
  23. package/workspace/lib/briefing-premium-products.js +18 -4
  24. package/workspace/lib/chat-file-locate.js +40 -2
  25. package/workspace/lib/engine/boards.js +8 -2
  26. package/workspace/lib/idle-close.js +60 -0
  27. package/workspace/lib/loose-proposals.js +302 -0
  28. package/workspace/lib/meeting-focus.js +64 -14
  29. package/workspace/lib/my-work-premium.js +1 -1
  30. package/workspace/lib/proposal-runs.js +77 -2
  31. package/workspace/lib/propose-cli.js +42 -1
  32. package/workspace/lib/route-modules.js +1 -0
  33. package/workspace/lib/routes-boards.js +16 -4
  34. package/workspace/lib/routes-brief-page.js +9 -1
  35. package/workspace/lib/routes-briefing-premium.js +19 -0
  36. package/workspace/lib/routes-loose.js +210 -0
  37. package/workspace/lib/routes-meeting-focus.js +28 -6
  38. package/workspace/lib/routes-pm-items.js +27 -17
  39. package/workspace/lib/settings-store.js +2 -1
  40. package/workspace/lib/task-cli.js +18 -11
  41. package/workspace/milestone-pins-test.js +170 -0
  42. package/workspace/package-lock.json +2 -2
  43. package/workspace/package.json +1 -1
  44. package/workspace/premium-board-actions-test.js +2 -1
  45. package/workspace/premium-briefing-depth-test.js +2 -2
  46. package/workspace/premium-chat-term-test.js +13 -2
  47. package/workspace/premium-core-doc-issue-test.js +1 -1
  48. package/workspace/premium-rec-now-test.js +153 -0
  49. package/workspace/premium-rec-tab-test.js +167 -0
  50. package/workspace/product-lane-test.js +30 -17
  51. package/workspace/public/pm/bd-acts.js +6 -3
  52. package/workspace/public/pm/bd-deliveries.js +218 -0
  53. package/workspace/public/pm/bd-pin-card.css +16 -0
  54. package/workspace/public/pm/bd-pin-card.js +80 -0
  55. package/workspace/public/pm/bd-pins.js +33 -0
  56. package/workspace/public/pm/bd-pop.js +2 -0
  57. package/workspace/public/pm/bd-prog.js +5 -4
  58. package/workspace/public/pm/bd-span.js +140 -102
  59. package/workspace/public/pm/cozy-aud.css +9 -0
  60. package/workspace/public/pm/cozy-aud.js +80 -0
  61. package/workspace/public/pm/cozy-board.css +73 -11
  62. package/workspace/public/pm/cozy-home.css +16 -1
  63. package/workspace/public/pm/cozy-live-pill.js +3 -0
  64. package/workspace/public/pm/cozy-pick.css +41 -0
  65. package/workspace/public/pm/cozy-pick.js +134 -0
  66. package/workspace/public/pm/cozy-rec-bridge.js +32 -0
  67. package/workspace/public/pm/cozy-rec-now.css +104 -0
  68. package/workspace/public/pm/cozy-rec-now.js +330 -0
  69. package/workspace/public/pm/cozy-rec-present.css +69 -0
  70. package/workspace/public/pm/cozy-rec-present.js +467 -0
  71. package/workspace/public/pm/cozy-rec-tab.css +90 -0
  72. package/workspace/public/pm/cozy-rec-tab.js +219 -0
  73. package/workspace/public/pm/cozy-settings.js +8 -2
  74. package/workspace/public/pm/cozy-today.css +4 -0
  75. package/workspace/public/pm/home-app.js +51 -22
  76. package/workspace/public/pm/home-data.js +5 -3
  77. package/workspace/public/pm/home-list.js +63 -15
  78. package/workspace/public/pm/home-more.js +2 -31
  79. package/workspace/public/pm/home-today.js +19 -9
  80. package/workspace/public/pm/ini-tasks.js +4 -1
  81. package/workspace/public/pm/live-model.js +1 -1
  82. package/workspace/public/pm/loose-props.css +54 -0
  83. package/workspace/public/pm/loose-props.js +262 -0
  84. package/workspace/public/pm/premium-board.js +65 -30
  85. package/workspace/public/pm/premium-insights.js +42 -24
  86. package/workspace/public/pm/premium-meeting.js +17 -4
  87. package/workspace/public/pm/premium-mtg-present.js +4 -3
  88. package/workspace/public/pm/premium-report-read.js +2 -0
  89. package/workspace/public/pm/premium-vw-mtg.js +15 -7
  90. package/workspace/public/pm/rec-state.js +13 -5
  91. package/workspace/public/pm/rec-tab-core.js +92 -0
  92. package/workspace/public/pm/term-view.js +81 -10
  93. package/workspace/public/pm/view-notes.js +9 -0
  94. package/workspace/public/premium-aud.html +22 -0
  95. package/workspace/public/premium-board.html +2 -0
  96. package/workspace/public/premium-insights.html +2 -1
  97. package/workspace/public/premium-rec.html +30 -0
  98. package/workspace/public/premium.html +1 -0
  99. package/workspace/rec-present-test.js +229 -0
  100. package/workspace/server.js +116 -7
  101. package/workspace/skills/loose-propose.skill +39 -0
  102. package/workspace/task-milestones-test.js +15 -6
  103. package/workspace/test-lists/board-deliveries.json +13 -0
  104. package/workspace/test-lists/calm-timeline.json +5 -0
  105. package/workspace/test-lists/loose-props.json +9 -0
  106. package/workspace/test-lists/milestone-pins.json +6 -0
  107. package/workspace/test-lists/rec-now.json +6 -0
  108. package/workspace/test-lists/rec-present.json +13 -0
  109. package/workspace/test-lists/recording-tab.json +13 -0
  110. package/workspace/timeline-holds-test.js +44 -42
@@ -0,0 +1,80 @@
1
+ /* pm/bd-pin-card.js — choose which milestones the Board timeline shows (feedback batch 13 item 4, calmer timeline A5: XcalmA5Milestones).
2
+ * the ◇ card a press on a row's ◇ (`[data-ms-pick]`, drawn by pm/bd-span.js) opens a card under it: the milestone's name, its date and
3
+ * "N of M milestones on the timeline", then every milestone of the initiative with a pin toggle. A toggle writes the pin at
4
+ * once (POST /api/boards/tasks/edit { pinned }, a task-pin line on the board ledger) and draws the timeline again.
5
+ * the Filter filterGroup() is the Filter's "Milestones on the timeline: Pinned · All · None" (timeline only; pm/bd-acts.js shows it).
6
+ * Which milestones are pinned is pm/bd-pins.js's rule: the PM's own pin wins, else only the row's last milestone shows. */
7
+ import { pmPost } from './http.js';
8
+ import { esc } from './premium-shell.js';
9
+ import * as Pop from './bd-pop.js';
10
+ import { isPinned, shownMs, msMode, setMsMode, MS_MODES } from './bd-pins.js';
11
+
12
+ const PIN = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 17v5M8 3h8l-1 5 3 4H6l3-4z"/></svg>';
13
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
14
+ let A = null; // the page, as pm/bd-acts.js has it: { M(), rowOf(key), redraw(), load(), say(msg) }
15
+ export function init(api) { A = api; }
16
+
17
+ const todayIso = () => { const M = A.M(); return M && M.today ? String(M.today).slice(0, 10) : new Date().toISOString().slice(0, 10); };
18
+ /** "Jun 1", with the year only when it is not this year: "Jun 1 ’27". */
19
+ const when = (iso) => { const y = iso.slice(0, 4); return MON[+iso.slice(5, 7) - 1] + ' ' + +iso.slice(8, 10) + (y !== todayIso().slice(0, 4) ? ' ’' + y.slice(2) : ''); };
20
+ const dated = (r) => ((r && r.milestones) || []).filter((m) => m && /^\d{4}-\d{2}-\d{2}/.test(String(m.date || ''))).slice().sort((a, b) => String(a.date).localeCompare(String(b.date)));
21
+ /** The board an initiative belongs to: its own product's with All products picked, else this board (as pm/bd-acts.js own()). */
22
+ const own = (id) => { const M = A.M(), r = (M.rows || []).find((x) => x.id === id && x.ws); return r ? { ws: r.ws, board: r.boardId } : { ws: M.board.ws, board: M.board.id }; };
23
+
24
+ let cur = null; // the open card: { key, id } (the row and the milestone pressed)
25
+ function cardHtml(r, msId) {
26
+ const L = dated(r), today = todayIso();
27
+ if (!L.length) return `<p class="bd-pc-h">${esc(r.title)}</p><p class="bd-amut bd-pc-sub">No milestone yet. Flag a task as a milestone ◇ in the initiative's Tasks.</p>`;
28
+ const m0 = L.find((m) => m.id === msId) || null, on = shownMs(r).length;
29
+ const head = m0 ? `<p class="bd-pc-h">${esc(m0.name)}</p><p class="bd-amut bd-pc-sub">${esc(when(m0.date))} · ${on} of ${L.length} ${L.length === 1 ? 'milestone' : 'milestones'} on the timeline</p>`
30
+ : `<p class="bd-pc-h">${esc(r.title)}</p><p class="bd-amut bd-pc-sub">${on} of ${L.length} ${L.length === 1 ? 'milestone' : 'milestones'} on the timeline</p>`;
31
+ const row = (m) => {
32
+ const p = isPinned(r, m), late = !m.done && m.date < today;
33
+ const say = (p ? 'Shown on the timeline: ' : 'Show on the timeline: ') + m.name;
34
+ return `<div class="bd-pc-r${p ? ' on' : ''}"><i class="tg-tm-i${m.done ? ' dn' : late ? ' late' : ''}" aria-hidden="true"></i><span class="bd-pc-n">${esc(m.name)}<small${late ? ' class="late"' : ''}>${esc(when(m.date))}</small></span>`
35
+ + `<button type="button" class="bd-pc-pin${p ? ' on' : ''}" data-pin-ms="${esc(m.id)}" aria-pressed="${p}" aria-label="${esc(say)}" title="${p ? 'Shown on the timeline' : 'Show on the timeline'}">${PIN}</button></div>`;
36
+ };
37
+ return head + L.map(row).join('');
38
+ }
39
+ /** Opens the ◇ card under `btn` for row `key`; `msId` is the milestone pressed ('' = the row's ◇ with no task of its own). */
40
+ export function openCard(btn, key, msId) {
41
+ const r = A.rowOf(key); if (!r) return;
42
+ cur = { key, id: msId || '' };
43
+ Pop.open(cardHtml(r, cur.id), btn, { label: 'Milestones of ' + r.title, width: 300, cls: 'bd-pc', focus: '[data-pin-ms]', onClose: () => { cur = null; } });
44
+ }
45
+ async function toggle(b) {
46
+ const r = cur && A.rowOf(cur.key), m = r && dated(r).find((x) => x.id === b.dataset.pinMs);
47
+ if (!m) return;
48
+ const next = !isPinned(r, m), was = m.pinned, key = cur.key, id = cur.id;
49
+ // at once on the page; the write follows, and a refused one puts it back
50
+ m.pinned = next; redrawAll(key, id, m.id);
51
+ const res = await pmPost('/api/boards/tasks/edit', { ...own(r.id), task: m.id, pinned: next }).catch(() => null);
52
+ if (!res || res.ok !== true) { if (was === undefined) delete m.pinned; else m.pinned = was; redrawAll(key, id, m.id); A.say((res && res.error) || 'The pin was not saved. The server did not say why.'); return; }
53
+ await A.load();
54
+ if (cur && cur.key === key) redrawAll(key, id, m.id, true);
55
+ }
56
+ /** The timeline and the open card again; the card stays on the ◇ it opened from (drawn anew) and the focus on the toggle pressed. */
57
+ function redrawAll(key, id, focusId, noTimeline) {
58
+ if (!noTimeline) A.redraw();
59
+ const r = A.rowOf(key); if (!r || !Pop.isOpen()) return;
60
+ const sel = `[data-ms-pick="${CSS.escape(key)}"]`, btns = [...document.querySelectorAll(sel)];
61
+ const anchor = btns.find((x) => (x.dataset.msId || '') === id) || btns[0];
62
+ if (anchor) Pop.anchor(anchor);
63
+ Pop.redraw(cardHtml(r, id));
64
+ const f = Pop.el().querySelector(`[data-pin-ms="${CSS.escape(focusId)}"]`); if (f) f.focus({ preventScroll: true });
65
+ }
66
+
67
+ /** The Filter's group (timeline only): "Milestones on the timeline: Pinned · All · None", the choice remembered per person. */
68
+ export function filterGroup() {
69
+ const m = msMode();
70
+ return `<p class="bd-mlbl">Milestones on the timeline</p><div class="bd-fg" role="radiogroup" aria-label="Milestones on the timeline">${MS_MODES.map(([k, n]) => `<button type="button" class="bd-chip${k === m ? ' on' : ''}" role="radio" aria-checked="${k === m}" data-msmode="${k}">${n}</button>`).join('')}</div>`
71
+ + '<p class="bd-amut bd-mnote">Pinned = the last milestone, plus any you pin.</p>';
72
+ }
73
+ /** A Filter press on Pinned, All or None; the caller draws the Filter and the page again. */
74
+ export function pickMode(b) { setMsMode(b.dataset.msmode); }
75
+
76
+ document.addEventListener('click', (e) => {
77
+ if (!A || !A.M()) return;
78
+ const pk = e.target.closest('[data-ms-pick]'); if (pk) { e.preventDefault(); openCard(pk, pk.dataset.msPick, pk.dataset.msId || ''); return; }
79
+ const pn = e.target.closest('[data-pin-ms]'); if (pn && Pop.isOpen() && Pop.el().contains(pn)) toggle(pn);
80
+ });
@@ -0,0 +1,33 @@
1
+ /* pm/bd-pins.js — which milestones the Board timeline draws (feedback batch 13 item 4, calmer timeline A5: XcalmA5Milestones).
2
+ * An initiative can have many milestone tasks (iterations, a release, evaluations). The timeline draws only the pinned ones; by default that is
3
+ * the last one. Filter switches the whole Board: "Milestones on the timeline: Pinned · All · None", remembered per person.
4
+ * isPinned(r, m) a milestone's own pin (m.pinned true or false) wins; else only the row's last dated milestone is pinned
5
+ * shownMs(r, mode) the row's dated milestones the timeline draws, by date
6
+ * msMode() · setMsMode the Filter choice: 'pinned' (the default), 'all' or 'none'
7
+ * Pure apart from the remembered choice. */
8
+ const MODE_KEY = 'pmos.board.msMode';
9
+ export const MS_MODES = [['pinned', 'Pinned'], ['all', 'All'], ['none', 'None']];
10
+ const isDay = (v) => /^\d{4}-\d{2}-\d{2}/.test(String(v || ''));
11
+ const datedMs = (r) => (r && Array.isArray(r.milestones) ? r.milestones : []).filter((m) => m && isDay(m.date)).slice().sort((a, b) => String(a.date).localeCompare(String(b.date)));
12
+
13
+ /** Whether the timeline draws this milestone while Filter says Pinned. */
14
+ export function isPinned(r, m) {
15
+ if (typeof m.pinned === 'boolean') return m.pinned;
16
+ const M = datedMs(r);
17
+ return !!M.length && M[M.length - 1].id === m.id;
18
+ }
19
+ /** The row's dated milestones the timeline draws: none, all, or the pinned ones. */
20
+ export function shownMs(r, mode = msMode()) {
21
+ if (mode === 'none') return [];
22
+ const M = datedMs(r);
23
+ return mode === 'all' ? M : M.filter((m) => isPinned(r, m));
24
+ }
25
+ let MODE = null;
26
+ export function msMode() {
27
+ if (MODE === null) { let v = null; try { v = localStorage.getItem(MODE_KEY); } catch { v = null; } MODE = MS_MODES.some(([k]) => k === v) ? v : 'pinned'; }
28
+ return MODE;
29
+ }
30
+ export function setMsMode(m) {
31
+ MODE = MS_MODES.some(([k]) => k === m) ? m : 'pinned';
32
+ try { localStorage.setItem(MODE_KEY, MODE); } catch { /* no storage: the choice lasts until the reload */ }
33
+ }
@@ -55,5 +55,7 @@ export function close(back) {
55
55
  if (from) { from.setAttribute('aria-expanded', 'false'); if (back && document.contains(from)) from.focus({ preventScroll: true }); }
56
56
  const cb = onClose; from = null; onClose = null; if (cb) cb();
57
57
  }
58
+ /** The open card's button is drawn anew (the page redrew under it): the card stays and follows the new one. */
59
+ export function anchor(btn) { if (!host || host.hidden || !btn) return; from = btn; btn.setAttribute('aria-expanded', 'true'); }
58
60
  export const isOpen = () => !!host && !host.hidden;
59
61
  export const el = () => host;
@@ -11,7 +11,7 @@
11
11
  * mergeBoards(list) All products: one Board model from every product's model, each row keeping its own product
12
12
  * bandHtml(g, st, o) the stage track's program row: tile, title, products, your count, its spread, its next milestones
13
13
  * prodHtml(g, o) · subHtml(name) a product group's head row (tile, name, goal dots, chevron) and a program's product sub-row
14
- * prodCell(g) the head's fold button alone (the timeline's product lane, batch 11 item 17)
14
+ * prodCell(g, dots) the head's fold button alone (the timeline's product lane, batch 11 item 17); dots replace the goal dots
15
15
  * goalsFrom(fn) · goalsHtml(name) the goal dots of a product head, from Home's source (pm/home-list.js goalsOf); fn(name) gives its rows
16
16
  *
17
17
  * A program has no stage of its own (PM, 2026-10-23): the band shows only what its initiatives say. With one product picked, the program shows
@@ -171,9 +171,10 @@ export function prodHtml(g, cls = 'bt-prd') {
171
171
  return `<div class="${cls}${folded(g.key) ? ' closed' : ''}" role="row">${prodCell(g)}</div>`;
172
172
  }
173
173
  /** The fold button of a product head alone: the timeline's product lane (batch 11 item 17, PlmA1Board) puts it in the name cell, its track beside it. */
174
- export function prodCell(g) {
175
- const open = !folded(g.key), gl = open ? goalsHtml(g.name) : '';
176
- return `<button type="button" class="bd-prdb" data-fold="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(g.name)}, ${g.rows.length} ${plural(g.rows.length, 'initiative', 'initiatives')}. ${open ? 'Fold' : 'Show'}">${tileHtml(g.name)}<span>${esc(g.name)}</span>${gl}${open ? '' : `<span class="n">${g.rows.length}</span>`}${SV(open ? CHEV_D : CHEV_R)}</button>`;
174
+ export function prodCell(g, dots) {
175
+ // the calm timeline (batch 13 item 4) passes its own dots: none while open, one per initiative off track while folded
176
+ const open = !folded(g.key), gl = dots !== undefined ? dots : open ? goalsHtml(g.name) : '';
177
+ return `<button type="button" class="bd-prdb" data-fold="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(g.name)}, ${g.rows.length} ${plural(g.rows.length, 'initiative', 'initiatives')}. ${open ? 'Fold' : 'Show'}">${tileHtml(g.name)}<span>${esc(g.name)}</span>${gl}${open || dots !== undefined ? '' : `<span class="n">${g.rows.length}</span>`}${SV(open ? CHEV_D : CHEV_R)}</button>`;
177
178
  }
178
179
  /** The goal dots of a product's head (PgBoard .gd), from the same source as Home's product header (pm/home-list.js goalsOf): one per KR or
179
180
  * budget its open initiatives anchor to, green on track, amber at risk. With no goal anchored, nothing is drawn. The page sets the rows. */