create-pmos 0.610.0 → 0.611.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 (114) hide show
  1. package/package.json +50 -14
  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-columns-test.js +2 -1
  7. package/workspace/board-deliveries-test.js +2 -1
  8. package/workspace/board-programs-test.js +7 -3
  9. package/workspace/board-publish-ui-test.js +2 -1
  10. package/workspace/board-shared-ui-test.js +2 -1
  11. package/workspace/board-workflows-test.js +2 -1
  12. package/workspace/briefing-premium-board-test.js +3 -2
  13. package/workspace/briefing-premium-doc-edit-test.js +2 -1
  14. package/workspace/briefing-premium-insights-test.js +4 -3
  15. package/workspace/briefing-premium-test.js +3 -2
  16. package/workspace/calm-timeline-test.js +2 -1
  17. package/workspace/changelog.json +49 -0
  18. package/workspace/core-docs-workflow-test.js +2 -1
  19. package/workspace/ev-everywhere-test.js +3 -2
  20. package/workspace/guide/home.md +2 -2
  21. package/workspace/guide/index.md +4 -0
  22. package/workspace/guide/layout.md +62 -2
  23. package/workspace/guide/programs.md +16 -2
  24. package/workspace/guide/routine.md +50 -0
  25. package/workspace/guide/scheduled-tasks-and-cli.md +1 -1
  26. package/workspace/guide/settings-and-switches.md +1 -1
  27. package/workspace/impact-screens-test.js +3 -1
  28. package/workspace/ini-workflow-test.js +2 -1
  29. package/workspace/lib/classic-board.js +15 -0
  30. package/workspace/lib/events-place.js +216 -0
  31. package/workspace/lib/library-items.js +78 -0
  32. package/workspace/lib/notes.js +6 -1
  33. package/workspace/lib/route-modules.js +4 -0
  34. package/workspace/lib/routes-events-place.js +166 -0
  35. package/workspace/lib/routes-library.js +89 -0
  36. package/workspace/lib/routes-pop-work.js +39 -0
  37. package/workspace/lib/routes-report-setups.js +20 -0
  38. package/workspace/lib/routes-today-log.js +48 -0
  39. package/workspace/lib/routine-reports.js +52 -0
  40. package/workspace/lib/today-log.js +131 -0
  41. package/workspace/live-pill-round-test.js +10 -7
  42. package/workspace/metric-drafts-ui-test.js +3 -1
  43. package/workspace/milestone-pins-test.js +2 -1
  44. package/workspace/milestone-suggest-test.js +3 -1
  45. package/workspace/package-lock.json +2 -2
  46. package/workspace/package.json +1 -1
  47. package/workspace/panels-test.js +2 -1
  48. package/workspace/premium-board-actions-test.js +3 -1
  49. package/workspace/premium-rec-tab-test.js +2 -1
  50. package/workspace/premium-vw-backlog-test.js +3 -1
  51. package/workspace/premium-vw-item-test.js +3 -1
  52. package/workspace/premium-vw-jira-test.js +3 -1
  53. package/workspace/product-lane-test.js +2 -1
  54. package/workspace/program-charter-test.js +3 -1
  55. package/workspace/program-leave-test.js +2 -1
  56. package/workspace/program-order-test.js +2 -1
  57. package/workspace/program-panel-test.js +3 -1
  58. package/workspace/public/pm/bd-ini-panel.js +72 -7
  59. package/workspace/public/pm/bd-prog-panel.js +55 -8
  60. package/workspace/public/pm/bd-work.css +130 -0
  61. package/workspace/public/pm/bd-work.js +356 -0
  62. package/workspace/public/pm/cozy-ev.css +2 -1
  63. package/workspace/public/pm/cozy-events-view.js +142 -0
  64. package/workspace/public/pm/cozy-events.css +107 -0
  65. package/workspace/public/pm/cozy-events.js +210 -0
  66. package/workspace/public/pm/cozy-evmodel.js +1 -1
  67. package/workspace/public/pm/cozy-library.css +36 -0
  68. package/workspace/public/pm/cozy-live-pill.js +1 -0
  69. package/workspace/public/pm/cozy-nav.js +5 -5
  70. package/workspace/public/pm/cozy-pop-work.css +165 -0
  71. package/workspace/public/pm/cozy-pop-work.js +427 -0
  72. package/workspace/public/pm/cozy-routine-model.js +111 -0
  73. package/workspace/public/pm/cozy-routine-pop.js +196 -0
  74. package/workspace/public/pm/cozy-routine.css +102 -0
  75. package/workspace/public/pm/cozy-routine.js +156 -0
  76. package/workspace/public/pm/cozy-schedwork.js +6 -5
  77. package/workspace/public/pm/cozy-today-app.js +236 -0
  78. package/workspace/public/pm/cozy-today-model.js +176 -0
  79. package/workspace/public/pm/cozy-today-page.css +100 -0
  80. package/workspace/public/pm/cozy-today-view.js +76 -0
  81. package/workspace/public/pm/home-app.js +18 -3
  82. package/workspace/public/pm/home-ini.js +36 -5
  83. package/workspace/public/pm/library-model.js +69 -0
  84. package/workspace/public/pm/library-open.js +34 -0
  85. package/workspace/public/pm/pop-work-model.js +335 -0
  86. package/workspace/public/pm/premium-board.js +130 -8
  87. package/workspace/public/pm/premium-library.js +122 -0
  88. package/workspace/public/premium-board.html +1 -0
  89. package/workspace/public/premium-events.html +42 -0
  90. package/workspace/public/premium-library.html +31 -0
  91. package/workspace/public/premium-routine.html +31 -0
  92. package/workspace/public/today.html +50 -0
  93. package/workspace/ready-dash-ui-test.js +3 -1
  94. package/workspace/rename-test.js +2 -1
  95. package/workspace/run-tests.js +4 -1
  96. package/workspace/server.js +3 -2
  97. package/workspace/sort-order-test.js +2 -1
  98. package/workspace/split-merge-ui-test.js +3 -1
  99. package/workspace/stage-card-tasks-test.js +3 -1
  100. package/workspace/stage-card-test.js +2 -1
  101. package/workspace/task-delete-test.js +2 -1
  102. package/workspace/task-links-test.js +2 -1
  103. package/workspace/task-milestones-test.js +4 -2
  104. package/workspace/task-plans-test.js +3 -1
  105. package/workspace/task-press-test.js +3 -1
  106. package/workspace/task-views-test.js +3 -1
  107. package/workspace/test-lists/events-place.json +11 -0
  108. package/workspace/test-lists/library-place.json +9 -0
  109. package/workspace/test-lists/pop-work.json +9 -0
  110. package/workspace/test-lists/routine-place.json +9 -0
  111. package/workspace/test-lists/today-log.json +9 -0
  112. package/workspace/test-lists/work-view.json +9 -0
  113. package/workspace/timeline-holds-test.js +3 -1
  114. package/workspace/tk-tasks-test.js +2 -1
@@ -0,0 +1,76 @@
1
+ /* pm/cozy-today-view.js — Today, the markup (slice 5 of the six-place navigation; board 1 on Exploring 2; initiative today-log-page).
2
+ * Pure: it turns pm/cozy-today-model.js into HTML, and Node imports it (today-log.test.js). home-app.js draws it into #tdPage on today.html
3
+ * and handles every press (data-td="…").
4
+ *
5
+ * One page, no views (one container rule): the title and the quiet count line sit on the panel; Today's log is one card with a thin
6
+ * border; today's agenda is one grey box on the right.
7
+ * The first line captures a task, an event or a note. Enter only adds the row: it opens no popup and starts no session.
8
+ * A row: "!" when it comes first, its bullet (• task, ○ event, – note, × done, ✦ a PMOS suggestion), What, Work, Job, When, and on
9
+ * hover or focus three plain icons: done, move to tomorrow, set a date. A Lab finding has ✓ (keep: start an initiative) and ✕ (drop).
10
+ * Carried too long, a ✦ line under the row: PMOS suggests to drop it, ✓ ✕.
11
+ * Press a row or an agenda event: the popup on its work (home-app.js).
12
+ * Every icon-only button has an aria-label. The UI says PMOS. Text from records goes through esc(). */
13
+
14
+ export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
15
+ const svg = (d, w = 15, sw = 1.9) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
16
+ export const I = {
17
+ done: 'M5 12.5l4.5 4.5L19 7.5', tomorrow: 'M5 12h14M13 6l6 6-6 6', date: 'M4 5.5h16v14H4zM4 10h16M8.5 3.5v4M15.5 3.5v4', plus: 'M12 6v12M6 12h12',
18
+ yes: 'M5 12.5l4.5 4.5L19 7.5', no: 'M6 6l12 12M18 6L6 18', cal: 'M4 5.5h16v14H4zM4 10h16M8.5 3.5v4M15.5 3.5v4',
19
+ };
20
+ const BULLET = { task: ['•', 'Task'], event: ['○', 'Event'], note: ['–', 'Note'], lab: ['✦', 'PMOS suggests'] };
21
+ const ib = (act, label, d, key, extra = '') => `<button type="button" class="td-ib" data-td="${act}" data-key="${esc(key)}" aria-label="${esc(label)}" title="${esc(label)}"${extra}>${svg(d)}</button>`;
22
+
23
+ /** One row of the log. */
24
+ export function rowHtml(r) {
25
+ const [b, bl] = r.done ? ['×', 'Done'] : BULLET[r.bullet] || BULLET.task;
26
+ const acts = r.done ? '' : r.src === 'lab'
27
+ ? ib('lab-keep', 'Keep it: start an initiative from ' + r.title, I.yes, r.key) + ib('lab-drop', 'Drop it: ' + r.title, I.no, r.key)
28
+ : ib('done', 'Done: ' + r.title, I.done, r.key) + ib('tomorrow', 'Move to tomorrow: ' + r.title, I.tomorrow, r.key) + ib('date', 'Set a date: ' + r.title, I.date, r.key, ' aria-haspopup="dialog"');
29
+ const cls = ['td-r', r.done ? 'done' : '', r.bullet === 'note' ? 'note' : '', r.src === 'lab' ? 'lab' : ''].filter(Boolean).join(' ');
30
+ // a note, an own event and a done row open nothing: their words are the whole of it
31
+ const opens = !r.done && r.src !== 'own' && r.src !== 'gone';
32
+ const title = opens ? `<button type="button" class="td-t" data-td="open" data-key="${esc(r.key)}">${esc(r.title)}</button>` : `<span class="td-t">${esc(r.title)}</span>`;
33
+ const sug = r.drop ? `<div class="td-sg" role="group" aria-label="PMOS suggests"><b aria-hidden="true">✦</b><span>Carried ${esc(r.carried)} days. PMOS suggests: drop it from your log.</span>`
34
+ + ib('drop', 'Drop it', I.yes, r.key) + ib('keep', 'Keep it', I.no, r.key) + '</div>' : '';
35
+ const why = r.src === 'lab' && r.why ? `<div class="td-sg lab"><span>${esc(r.why)}</span></div>` : '';
36
+ return `<div class="${cls}" data-key="${esc(r.key)}" role="row"><span class="td-p" role="cell">${r.first && !r.done ? '<b aria-label="First">!</b>' : ''}</span>`
37
+ + `<span class="td-b" role="cell"><i role="img" aria-label="${esc(bl)}">${b}</i></span><span role="cell" class="td-wt">${title}</span>`
38
+ + `<span class="td-w" role="cell">${esc(r.work)}</span><span class="td-k" role="cell">${esc(r.job)}</span>`
39
+ + `<span class="td-d${r.late && !r.done ? ' late' : ''}" role="cell">${esc(r.when)}</span><span class="td-a" role="cell">${acts}</span>${sug}${why}</div>`;
40
+ }
41
+
42
+ /** Today's log: the title and its count line, the capture line, the one card. L: logModel(). o: { news: N new for you, draft: the line being typed } */
43
+ export function logHtml(L, o = {}) {
44
+ const head = `<div class="td-h"><h2>Today’s log</h2>${L.line ? `<span class="td-sum">${esc(L.line)}</span>` : ''}</div>`;
45
+ const cap = `<form class="td-in" id="tdCapF" autocomplete="off"><label class="td-in-l" for="tdCap">${svg(I.plus, 16)}<span class="td-vh">Log a task, an event or a note</span></label>`
46
+ + `<input id="tdCap" name="line" type="text" maxlength="240" placeholder="Log a task, an event or a note" value="${esc(o.draft || '')}" aria-describedby="tdCapKey" />`
47
+ + `<span class="td-key" id="tdCapKey" aria-label="Start with o for an event, a dash for a note, ! for first">•<em>task</em>o<em>event</em>–<em>note</em>!<em>first</em></span></form>`;
48
+ const rows = L.rows.length ? L.rows.map(rowHtml).join('') : '';
49
+ const table = rows ? `<div class="td-tt" role="table" aria-label="Today’s log"><div class="td-r td-hd" role="row"><span role="columnheader"></span><span role="columnheader"><span class="td-vh">Bullet</span></span><span role="columnheader">What</span><span role="columnheader">Work</span><span role="columnheader">Job</span><span role="columnheader">When</span><span role="columnheader"><span class="td-vh">Actions</span></span></div>${rows}</div>`
50
+ : '<p class="td-none">Nothing waits on you today.</p>';
51
+ const news = o.news > 0 ? `<button type="button" class="td-more" data-td="news">${esc(o.news)} new for you</button>` : '';
52
+ return `<section class="td-log" aria-label="Today’s log">${head}${cap}${table}${news}</section>`;
53
+ }
54
+
55
+ /** Today's agenda in one grey box: the hours, the meetings and the PM's own events, the line for now. A: agendaModel(). */
56
+ export function agendaHtml(A) {
57
+ const PX = 56;
58
+ const hours = [];
59
+ for (let h = A.from; h <= A.to; h += 2) hours.push(`<span class="td-hr" style="--y:${(h - A.from) * PX}px">${String(h).padStart(2, '0')}:00</span>`);
60
+ const ev = A.items.map((x) => {
61
+ const short = x.h * PX < 46; // a short slot says its time and title on one line
62
+ const st = `--y:${Math.round(x.top * PX) + 1}px;--h:${Math.max(30, Math.round(x.h * PX) - 3)}px`;
63
+ const cls = ['td-ev', x.kind, short ? 'short' : '', x.past ? 'past' : '', x.nowOn ? 'on' : ''].filter(Boolean).join(' ');
64
+ const label = x.title + ', ' + x.sub;
65
+ return x.kind === 'own' ? `<div class="${cls}" style="${st}" aria-label="${esc(label)}"><b>${esc(x.title)}</b><small>${esc(x.sub)}</small></div>`
66
+ : `<button type="button" class="${cls}" style="${st}" data-td="ev" data-key="${esc(x.key)}" aria-label="${esc(label)}"><b>${esc(x.title)}</b><small>${esc(x.sub)}</small></button>`;
67
+ }).join('');
68
+ const nowLine = A.now != null ? `<i class="td-now" style="--y:${Math.round(A.now * PX)}px" aria-hidden="true"></i>` : '';
69
+ const grid = A.empty ? '<p class="td-none">No meeting today.</p>'
70
+ : `<div class="td-tl" style="--rows:${A.to - A.from};--px:${PX}px">${hours.join('')}${ev}${nowLine}</div>`;
71
+ return `<aside class="td-ag" aria-label="Today’s agenda"><div class="td-agh"><h2>Today</h2><small>${esc(A.sub)}</small>`
72
+ + `<button type="button" class="td-ib" data-td="cal" aria-label="Open the calendar" title="Open the calendar">${svg(I.cal, 16)}</button></div>${grid}</aside>`;
73
+ }
74
+
75
+ /** The whole page. */
76
+ export function pageHtml(L, A, o = {}) { return `<div class="td">${logHtml(L, o)}${agendaHtml(A)}</div>`; }
@@ -25,6 +25,7 @@ import { mountPanels } from './cozy-panels.js';
25
25
  import { ownTab, bring, tabUrl } from './rec-tab-core.js';
26
26
  import * as VW from './cozy-viewer.js';
27
27
  import * as POP from './cozy-popup.js'; // the one popup: an initiative and Ask PMOS side by side (slice 2 of the six-place navigation)
28
+ import { mountToday } from './cozy-today-app.js'; // Today on a desk (slice 5): today.html is this page with data-today
28
29
  import * as SV from './small-vw.js'; // the small Viewers: a stakeholder, its form, a routine (batch 18 item 2-C)
29
30
  import { pmGet, pmPost, pmHeaders } from './http.js';
30
31
  import * as ST from './story.js';
@@ -89,6 +90,10 @@ const BOARD = P.get('board') || ''; // the Board's expand link names its board
89
90
  const boardQ = (pre = '?') => (BOARD ? pre + 'board=' + encodeURIComponent(BOARD) : '');
90
91
  const PHONE = 760;
91
92
  const isPhone = () => innerWidth <= PHONE;
93
+ /* Today (slice 5 of the six-place navigation): today.html is this page with data-today. On a desk it draws Today's log and agenda in place of
94
+ * the list and the chat column (pm/cozy-today-app.js); a phone keeps Home. TDY is set once the page's presses are defined (below). */
95
+ const TD_PAGE = document.body.hasAttribute('data-today');
96
+ let TDY = null;
92
97
  if (navigator.maxTouchPoints > 0) wireSettle(window); // a touch screen only: on a desktop the page does not scroll and the nudge is not needed
93
98
  const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
94
99
  /** The Everything chip's globe (chief-of-staff C1, board CsA). */
@@ -280,7 +285,8 @@ async function openGrillNews(id) {
280
285
  function otherProducts(D) {
281
286
  const av = (D.brief && D.brief.products && D.brief.products.available) || [];
282
287
  const own = ((D.board && D.board.board) || {}).ws || WS;
283
- return av.filter((a) => a.on && a.ws && a.ws !== own).slice(0, 4);
288
+ // Today reads every product (slice 5 of the six-place navigation): the product pick is Work's and Goals', not Today's
289
+ return av.filter((a) => (a.on || (TD_PAGE && !isPhone())) && a.ws && a.ws !== own).slice(0, 4);
284
290
  }
285
291
  async function loadIni() {
286
292
  const id = S.ini;
@@ -438,7 +444,7 @@ async function readMove() {
438
444
  const auto = await Promise.all(L.map((ws) => pmGet('/api/autonomy' + (ws ? '?ws=' + encodeURIComponent(ws) : '')).catch(() => null)));
439
445
  // C3: the Lab's findings that fit no initiative are a row here (its section on Intelligence is gone)
440
446
  const labs = await Promise.all(PR.map((p, i) => { const b = (p.model.board && p.model.board.id) || ''; const q = [L[i] ? 'ws=' + encodeURIComponent(L[i]) : '', b ? 'board=' + encodeURIComponent(b) : ''].filter(Boolean).join('&');
441
- return pmGet('/api/lab' + (q ? '?' + q : '')).then((r) => (r && r.ok && r.lab && (r.lab.loose || []).length ? { ws: L[i], board: b, n: r.lab.loose.length, say: r.lab.say || '' } : null)).catch(() => null); }));
447
+ return pmGet('/api/lab' + (q ? '?' + q : '')).then((r) => (r && r.ok && r.lab && (r.lab.loose || []).length ? { ws: L[i], board: b, n: r.lab.loose.length, say: r.lab.say || '', items: r.lab.loose.map((f) => ({ id: f.id, title: f.title, why: f.why || '' })) } : null)).catch(() => null); }));
442
448
  L.forEach((ws, i) => {
443
449
  const r = got[i], A = auto[i] && auto[i].ok ? auto[i] : null; if (!r || !r.ok) return;
444
450
  const done = A ? (A.done || []).map((d) => ({ ref: d.ref, ini: d.ini || '', said: d.title || 'done', at: d.at, via: 'autonomy', reason: d.reason || '', way: d.way || '' }))
@@ -906,6 +912,7 @@ function drawList() {
906
912
  document.body.classList.toggle('hm-plist', isPhone() && !S.phoneChat); // a phone: the list is the page until a row opens its conversation (HmPhone)
907
913
  drawRailCard();
908
914
  drawRecTop();
915
+ if (TDY) TDY.draw(); // Today on a desk (today.html): the log and the agenda, from the same reads
909
916
  }
910
917
  /** The list's own fold (batch 20 item 6): kept on this computer, the one thing that folds or unfolds the list. With a Viewer open it is the rail. */
911
918
  function setFold(on) {
@@ -2388,6 +2395,13 @@ mountPanels({
2388
2395
  return false;
2389
2396
  },
2390
2397
  });
2398
+ if (TD_PAGE) TDY = mountToday({ S, VW, POP, pmGet, pmPost, toast, toastUndo, isPhone, now: NOW,
2399
+ rank: () => { S.topRank = rankMove({ ...rankIn(), calls: YD.callsOf((S.M && S.M.move) || []), now: NOW() }); return S.topRank; },
2400
+ rows: () => new Map(allRows().map((r) => [r.id, r])), titleOf: (id) => (iniRowOf(id) ? iniTitle(id) : String(id || '').replace(/[-_]+/g, ' ').replace(/^./, (c) => c.toUpperCase())), hasIni: (id) => !!(id && iniRowOf(id)), boardWs, boardId,
2401
+ goIni: (id) => goIni(id), select: (id) => select(id), movePress: (b) => movePress(b), openFinished, openReviewVw, openMeeting: (m) => openMeeting(m), openCalendar,
2402
+ openInbox: () => MORE.openInbox(searchGo, ''), reload: () => load(), review: () => L.reviewModel(S.D, NOW()), meetings: () => H.todayOf(S.D),
2403
+ news: () => (S.news && S.news.ok ? S.news.count || 0 : 0), chatNow: () => (chat.current ? chat.current() : null),
2404
+ openLab: (f) => import('./cozy-lab-ins.js').then((LB) => LB.openLab({ where: () => ({ ws: f.ws, board: f.board }), iniHref: (id) => '/premium-initiative.html?' + (f.ws ? 'ws=' + encodeURIComponent(f.ws) + '&' : '') + 'id=' + encodeURIComponent(id), toast: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)) })) });
2391
2405
  PHC = mountPhoneCard({ pmGet, pmPost, toast, ws: () => WS || null, openMeeting: (m) => openMeeting(m), skip: ['meeting'] }); drawList();
2392
2406
  drawList(); drawTop();
2393
2407
  { // a conversation the address names opens at once, before the lists are read, so nothing typed or attached lands in the Home chat
@@ -2434,7 +2448,7 @@ load().then(() => {
2434
2448
  else if (about) { openTarget({ ...homeTarget(), key: about, title: (P.get('label') || '').slice(0, 80) || about }); discussed(about, P.get('vid'), P.get('label')); }
2435
2449
  else if (P.get('view') === 'metrics') openMetrics(P.get('ws') || ''); // ?view=metrics: an old link lands on Intelligence › Delivery trends
2436
2450
  else if (S.ini) goIni(S.ini);
2437
- else if (!isPhone() && !blockOpen && !say && !VW.isOpen()) { const first = H.needsOf(S.D)[0]; if (first) select(first.id); } // a card the PM opened while Home was reading stays
2451
+ else if (!isPhone() && !blockOpen && !say && !VW.isOpen() && !TD_PAGE) { const first = H.needsOf(S.D)[0]; if (first) select(first.id); } // Today opens nothing by itself // a card the PM opened while Home was reading stays
2438
2452
  if (blockOpen) {
2439
2453
  const b = { kind: blockOpen[1], id: blockOpen[2] };
2440
2454
  (b.kind === 'report' ? import('./premium-report-tab.js').then((M) => M.openReportTab(b)) : import('./premium-chart-tab.js').then((M) => M.openChartTab(b))).catch(() => toast('That view could not open.'));
@@ -2450,6 +2464,7 @@ load().then(() => {
2450
2464
  const u = new URL(location.href); ['settings', 'new', 'wf', 'stage'].forEach((k) => u.searchParams.delete(k)); history.replaceState(history.state, '', u.pathname + u.search + u.hash);
2451
2465
  }
2452
2466
  if (/^(prop|men|pulse|scan|rep|src)$/.test(P.get('around') || '')) MORE.openAround(P.get('around')); // ?around=<row>: that Around you view (home-around.js)
2467
+ if (TDY) { TDY.read(); readNews(); } // Today's own marks and entries, and the quiet New for you line
2453
2468
  // the Viewer opens now or not at all: the held column goes either way, and the next open holds it only if it opened (SpJ)
2454
2469
  setTimeout(() => { if (!isPhone()) store.set(VW_HELD, VW.isOpen() ? '1' : null); LS.holdViewer($('.hm-vw'), false); }, 0);
2455
2470
  poll();
@@ -34,7 +34,9 @@ import * as SC from './home-stage-card.js';
34
34
  import { viewHtml, wireView } from './ini-view.js'; // the one initiative view, the Board's panel's own renderer
35
35
  import { ensureCss as ensureStepsCss } from './cozy-steps.js'; // stage card D: the card's last node and the move sheet's words // D99: the initiative's own workflow (Change picker, switch, Won't do, Archive)
36
36
  import * as DB from './dash-view.js'; // the ready-made Dashboard view (batch 17 item 1)
37
- import * as TL from './ini-tail.js'; // under Linked, as the Board draws it (UI grill U1): drafted tickets, the PRD drift, Your impact
37
+ import * as TL from './ini-tail.js';
38
+ import * as PW from './cozy-pop-work.js'; // what the popup shows for work (slice 3 of the six-place navigation): in the popup, in place of the old page
39
+ import * as PP from './ini-props.js'; // everything PMOS suggests, as a drill-in (the popup's ⋯) // under Linked, as the Board draws it (UI grill U1): drafted tickets, the PRD drift, Your impact
38
40
 
39
41
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
40
42
  const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
@@ -259,9 +261,32 @@ function holdPop(anchor, id) {
259
261
  }, { label: 'On hold', sheetFocus: '#hiBack' });
260
262
  }
261
263
  /** The one view's presses on Home's page. */
264
+ /** In the popup: what pm/cozy-pop-work.js shows for work, from the same view model and the page's own read. */
265
+ function popOpts(id, M) {
266
+ const v = X.ctx.view(id) || {};
267
+ return { today: v.today, docs: M ? MD.docRows(M) : [], product: (M && M.board && (M.board.name || M.board.ws)) || rowOf(id).ws || '', program: (v.summary && v.summary.program) || null, ws: (M && M.board && M.board.ws) || rowOf(id).ws || '', id };
268
+ }
269
+ function popHtml(id, M) {
270
+ X.ctx.head(id);
271
+ const v = X.ctx.view(id);
272
+ if (!v) return `<div class="hi-v hi-page" data-hi-v="page"><p class="hi-small" role="status">The initiative could not be read.</p></div>`;
273
+ return PW.html({ ...rowOf(id), id }, v, popOpts(id, M)) + '<p class="hi-small" role="status" id="ovMsg"></p>';
274
+ }
275
+ /** The popup's own presses: every part of the old page as a drill-in (so nothing is lost), and everything PMOS suggests. */
276
+ function popExtra(id) {
277
+ const C = X.ctx, H = { where: () => { const M = curM(); return M ? bw(M) : {}; }, reload: async () => { await C.load(); redrawView(); }, toast: (m, u) => (u ? undoToast(m, u) : C.toast(m)) };
278
+ return {
279
+ allParts: () => {
280
+ C.VW.drill();
281
+ C.VW.open({ kind: X.ctx.kindOf(id), title: C.iniTitle(id), icon: 'goal', id: 'all:' + id, back: true,
282
+ render: (b) => { b.dataset.pwAll = '1'; const M = curM(); b.innerHTML = M ? pageHtml(id, M) : ''; wire(b, id); wirePage(b, id); } });
283
+ },
284
+ props: () => { const v = X.ctx.view(id); if (v) PP.open(v, H); },
285
+ };
286
+ }
262
287
  function wirePage(b, id) {
263
288
  const C = X.ctx, say = (m) => C.toast(m);
264
- wireView(b, {
289
+ const H = {
265
290
  redraw: () => redrawView(),
266
291
  // Claude's split or merge card (batch 11 item 14): ✕ Not now, ✎ Change it first, ✓ as suggested; the merged summary's link opens the one that stays
267
292
  sm: (act) => { if (C.smPress) C.smPress(id, act); },
@@ -320,7 +345,13 @@ function wirePage(b, id) {
320
345
  stagePick: (btn) => stageChip(btn, id),
321
346
  planDates: () => { if (C.askIn) C.askIn(id, 'Propose new start and end dates for ' + C.iniTitle(id)); },
322
347
  jira: () => { const M = curM(); if (M) readJira(M); },
323
- });
348
+ };
349
+ if (PW.on(b)) {
350
+ PW.wire(b, { ...H, ...popExtra(id), redraw: () => { b.__pg = null; if (b.dataset.pwAll) return; redrawView(); } },
351
+ { r: () => ({ ...rowOf(id), id }), v: () => X.ctx.view(id), o: () => popOpts(id, curM()) });
352
+ return;
353
+ }
354
+ wireView(b, H);
324
355
  }
325
356
  /** A task of the initiative as the one view reads it: the board row's (status, start, end), else the page's own read (state, start, end). */
326
357
  function taskAt(id, uid) {
@@ -461,7 +492,7 @@ export function iniPage(o = {}) {
461
492
  let rename = X.ctx.renameIni ? X.ctx.renameIni(id, '') : null;
462
493
  if (rename) rename = { ...rename, value: X.ctx.iniTitle(id) };
463
494
  const dh = dashFor(id);
464
- BODY = VW.open({ id: 'ov:' + id, kind: X.ctx.kindOf(id), title: X.ctx.iniTitle(id), icon: 'goal', wrap: true, more: () => pageMore(id), rename, pop: o.pop || undefined,
495
+ BODY = VW.open({ id: 'ov:' + id, kind: X.ctx.kindOf(id), title: X.ctx.iniTitle(id), icon: 'goal', wrap: true, more: () => (PW.on(BODY) ? PW.moreItems(null, popExtra(id)) : []).concat(pageMore(id)), rename, pop: o.pop || undefined,
465
496
  discuss: () => X.ctx.newIn(id), discussHome: true, // the one view (OvViewers): Discuss starts a new session about it, where + New session was
466
497
  // the kind of work (batch 29 item 11, KdV1-3): its glyph stands before Discuss; a tap opens the three kinds
467
498
  presses: [WK.pressOf(kindNow(id))].concat(dh ? dh.presses() : []), onPress: (a, btn) => {
@@ -542,7 +573,7 @@ function draw(b) {
542
573
  const v = X.view;
543
574
  if (v !== 'page') b.__pg = null;
544
575
  if (v === 'page' && dashFor(id) && dashFor(id).shows()) { b.__pg = null; b.innerHTML = dashFor(id).html(() => ''); return; }
545
- if (v === 'page') { const h = pageHtml(id, M); if (b.__pg !== h || !b.firstChild) { b.__pg = h; b.innerHTML = h; } return; }
576
+ if (v === 'page') { const h = PW.on(b) ? popHtml(id, M) : pageHtml(id, M); if (b.__pg !== h || !b.firstChild) { b.__pg = h; b.innerHTML = h; } return; }
546
577
  // Documents is shell A (XvADocs): no tabs, the summary card and folding groups straight in the body
547
578
  if (v === 'docs') { b.innerHTML = docsView(id, M) + '<p class="hi-small" role="status" id="ovMsg"></p>'; return; }
548
579
  // the phone keeps the Documents | Stage switch (PgTkList); in shell A on a desktop the other view sits under ⋯ (XvATasks)
@@ -0,0 +1,69 @@
1
+ /* pm/library-model.js — the Library's table, PURE (initiative library-place, slice 7 of the six-place navigation; boards StLibrary,
2
+ * StLibMeetings, StLibDocs on Exploring 2).
3
+ *
4
+ * FILTERS All · Documents · Meeting notes · Prototypes (a link counts as a document)
5
+ * columns(filter) → { name, third, date } the header: Kind on All; Type, Came out of it, Versions with one kind; Held for meetings
6
+ * third(item, filter) → the third cell: the Kind text on All, else the column that fits the kind
7
+ * when(item, filter) → the date the row is placed by: Held for meeting notes, else Updated
8
+ * groupOf(iso, now) → 'This week' | 'Earlier in <Month>' | 'Older'
9
+ * rows(items, { filter, q, now }) → [{ group, items }] newest first; a group with no row is not there (zero is silence)
10
+ * matches(item, q) → whether the words find the row: name, kind, about, type, what came out of it
11
+ * dayText(iso, now) → '17 Nov' · '8 Sep 2025'
12
+ * The items are GET /api/library-items (lib/library-items.js ITEM). */
13
+
14
+ export const FILTERS = ['All', 'Documents', 'Meeting notes', 'Prototypes'];
15
+ const OF = { All: () => true, Documents: (x) => x.kind === 'doc' || x.kind === 'link', 'Meeting notes': (x) => x.kind === 'meeting', Prototypes: (x) => x.kind === 'proto' };
16
+ const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
17
+ const DAY = 864e5;
18
+
19
+ export function columns(filter) {
20
+ const f = OF[filter] ? filter : 'All';
21
+ return {
22
+ name: { All: 'Name', Documents: 'Document', 'Meeting notes': 'Meeting', Prototypes: 'Prototype' }[f],
23
+ third: { All: 'Kind', Documents: 'Type', 'Meeting notes': 'Came out of it', Prototypes: 'Versions' }[f],
24
+ date: f === 'Meeting notes' ? 'Held' : 'Updated',
25
+ };
26
+ }
27
+ export function third(x, filter) {
28
+ if (!OF[filter] || filter === 'All') return x.kindText || '';
29
+ if (filter === 'Meeting notes' || filter === 'Prototypes') return x.came || '';
30
+ return x.type || x.kindText || '';
31
+ }
32
+ export const when = (x, filter) => (filter === 'Meeting notes' && x.held ? x.held : x.updated) || null;
33
+
34
+ const t = (iso) => { const n = Date.parse(String(iso || '').length === 10 ? iso + 'T12:00:00' : iso); return Number.isFinite(n) ? n : null; };
35
+ export function groupOf(iso, now = Date.now()) {
36
+ const at = t(iso);
37
+ if (at == null) return 'Older';
38
+ const n = new Date(now), start = new Date(n.getFullYear(), n.getMonth(), n.getDate()).getTime();
39
+ if (at >= start - 6 * DAY) return 'This week';
40
+ const d = new Date(at);
41
+ if (d.getFullYear() === n.getFullYear() && d.getMonth() === n.getMonth()) return 'Earlier in ' + MONTHS[n.getMonth()];
42
+ return 'Older';
43
+ }
44
+ export function dayText(iso, now = Date.now()) {
45
+ const at = t(iso); if (at == null) return '';
46
+ const d = new Date(at), y = new Date(now).getFullYear();
47
+ return d.getDate() + ' ' + MONTHS[d.getMonth()].slice(0, 3) + (d.getFullYear() !== y ? ' ' + d.getFullYear() : '');
48
+ }
49
+ const norm = (s) => String(s || '').toLowerCase();
50
+ export function matches(x, q) {
51
+ const words = norm(q).split(/\s+/).filter(Boolean);
52
+ if (!words.length) return true;
53
+ const hay = norm([x.name, x.sub, x.kindText, x.type, x.came, x.about && x.about.title, x.about && x.about.product].join(' '));
54
+ return words.every((w) => hay.includes(w));
55
+ }
56
+ export function rows(items, { filter = 'All', q = '', now = Date.now() } = {}) {
57
+ const ok = OF[filter] || OF.All;
58
+ const list = (items || []).filter((x) => x && ok(x) && matches(x, q))
59
+ .map((x) => ({ x, at: when(x, filter) }))
60
+ .sort((a, b) => (t(b.at) || 0) - (t(a.at) || 0) || String(a.x.name).localeCompare(String(b.x.name)));
61
+ const out = [];
62
+ for (const { x, at } of list) {
63
+ const g = groupOf(at, now);
64
+ let last = out[out.length - 1];
65
+ if (!last || last.group !== g) { last = out.find((o) => o.group === g); if (!last) { last = { group: g, items: [] }; out.push(last); } }
66
+ last.items.push(x);
67
+ }
68
+ return out;
69
+ }
@@ -0,0 +1,34 @@
1
+ /* pm/library-open.js — open one thing that was made, in the one popup (initiative library-place, slice 7 of the six-place navigation).
2
+ * The thing is on the left, in the Viewer that already draws it; the chat on the right is about it (cozy-popup.js openWork → popNext).
3
+ *
4
+ * openItem(item) item = GET /api/library-items ITEM (lib/library-items.js)
5
+ * doc the document as its page (premium-vw-doc.js openDocPage)
6
+ * meeting the meeting notes card: who was there, the summary, decisions and tasks (premium-vw-open.js openMeeting)
7
+ * proto the design canvas of the prototype round (cozy-lab.js openCompare, which draws cozy-proto.js)
8
+ * link a new browser tab; nothing opens in PMOS
9
+ * aboutOf(item) → { id, kind, title, ws } what the chat beside it is about
10
+ * Slice 3's Artefacts table opens its rows with the same openItem. On a phone the Viewer opens as it does today (no popup). */
11
+ import * as POP from './cozy-popup.js';
12
+
13
+ const KIND = { doc: 'document', link: 'link', meeting: 'meeting', proto: 'prototype' };
14
+ export const aboutOf = (x) => ({ id: String(x.id || '').replace(/[^A-Za-z0-9._:-]+/g, '-').slice(0, 100), kind: KIND[x.kind] || 'document', title: x.name || '', ws: (x.about && x.about.ws) || undefined });
15
+
16
+ export function openItem(x) {
17
+ if (!x || !x.open) return false;
18
+ const o = x.open;
19
+ if (o.url) { try { window.open(o.url, '_blank', 'noopener,noreferrer'); } catch { /* a blocked window: nothing opens */ } return true; }
20
+ const go = async () => {
21
+ if (o.doc) {
22
+ const M = await import('./premium-vw-doc.js');
23
+ M.openDocPage({ path: o.doc.path, title: x.name }, { ws: () => o.doc.ws || '', ini: (x.about && x.about.ini) || undefined });
24
+ } else if (o.note) {
25
+ await import('./premium-vw-open.js');
26
+ window.czViews.openMeeting({ note: o.note }, { ws: o.ws || '' });
27
+ } else if (o.proto) {
28
+ const LC = await import('./cozy-lab.js');
29
+ LC.openCompare({ where: { ws: o.proto.ws, board: o.proto.board || '' }, id: o.proto.id });
30
+ }
31
+ };
32
+ POP.openWork({ about: aboutOf(x), open: () => { go().catch((e) => console.error(e)); } });
33
+ return true;
34
+ }