create-pmos 0.609.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 (145) hide show
  1. package/package.json +69 -27
  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 +9 -5
  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-adddoc-test.js +2 -1
  13. package/workspace/briefing-premium-board-test.js +10 -9
  14. package/workspace/briefing-premium-doc-edit-test.js +2 -1
  15. package/workspace/briefing-premium-initiative-test.js +7 -6
  16. package/workspace/briefing-premium-insights-test.js +12 -11
  17. package/workspace/briefing-premium-products-test.js +4 -2
  18. package/workspace/briefing-premium-sources-test.js +1 -1
  19. package/workspace/briefing-premium-test.js +6 -5
  20. package/workspace/briefing-premium-work-test.js +1 -1
  21. package/workspace/calm-timeline-test.js +2 -1
  22. package/workspace/changelog.json +68 -0
  23. package/workspace/core-docs-workflow-test.js +2 -1
  24. package/workspace/ev-everywhere-test.js +11 -10
  25. package/workspace/guide/home.md +2 -2
  26. package/workspace/guide/index.md +4 -0
  27. package/workspace/guide/layout.md +92 -11
  28. package/workspace/guide/programs.md +16 -2
  29. package/workspace/guide/routine.md +50 -0
  30. package/workspace/guide/scheduled-tasks-and-cli.md +1 -1
  31. package/workspace/guide/settings-and-switches.md +1 -1
  32. package/workspace/home-other-product-test.js +2 -1
  33. package/workspace/home-railcard-test.js +2 -1
  34. package/workspace/impact-screens-test.js +3 -1
  35. package/workspace/ini-workflow-test.js +2 -1
  36. package/workspace/lib/beside-page.js +15 -0
  37. package/workspace/lib/classic-board.js +15 -0
  38. package/workspace/lib/events-place.js +216 -0
  39. package/workspace/lib/library-items.js +78 -0
  40. package/workspace/lib/notes.js +6 -1
  41. package/workspace/lib/route-modules.js +4 -0
  42. package/workspace/lib/routes-events-place.js +166 -0
  43. package/workspace/lib/routes-library.js +89 -0
  44. package/workspace/lib/routes-pop-work.js +39 -0
  45. package/workspace/lib/routes-report-setups.js +20 -0
  46. package/workspace/lib/routes-today-log.js +48 -0
  47. package/workspace/lib/routine-reports.js +52 -0
  48. package/workspace/lib/today-log.js +131 -0
  49. package/workspace/live-pill-round-test.js +11 -9
  50. package/workspace/metric-drafts-ui-test.js +3 -1
  51. package/workspace/milestone-pins-test.js +2 -1
  52. package/workspace/milestone-suggest-test.js +3 -1
  53. package/workspace/package-lock.json +2 -2
  54. package/workspace/package.json +1 -1
  55. package/workspace/panels-test.js +6 -4
  56. package/workspace/premium-board-actions-test.js +3 -1
  57. package/workspace/premium-chat-context-test.js +6 -6
  58. package/workspace/premium-chat-line-test.js +1 -1
  59. package/workspace/premium-chat-notes-test.js +1 -1
  60. package/workspace/premium-core-doc-issue-test.js +2 -1
  61. package/workspace/premium-rec-tab-test.js +2 -1
  62. package/workspace/premium-vw-backlog-test.js +3 -1
  63. package/workspace/premium-vw-cal-test.js +1 -1
  64. package/workspace/premium-vw-doc-test.js +2 -1
  65. package/workspace/premium-vw-item-test.js +3 -1
  66. package/workspace/premium-vw-jira-test.js +3 -1
  67. package/workspace/product-lane-test.js +2 -1
  68. package/workspace/program-charter-test.js +3 -1
  69. package/workspace/program-leave-test.js +3 -1
  70. package/workspace/program-order-test.js +2 -1
  71. package/workspace/program-panel-test.js +5 -3
  72. package/workspace/public/pm/bd-ini-panel.js +75 -8
  73. package/workspace/public/pm/bd-prog-panel.js +55 -8
  74. package/workspace/public/pm/bd-scroll.js +4 -2
  75. package/workspace/public/pm/bd-work.css +130 -0
  76. package/workspace/public/pm/bd-work.js +356 -0
  77. package/workspace/public/pm/cozy-board.css +3 -0
  78. package/workspace/public/pm/cozy-ev.css +52 -0
  79. package/workspace/public/pm/cozy-events-view.js +142 -0
  80. package/workspace/public/pm/cozy-events.css +107 -0
  81. package/workspace/public/pm/cozy-events.js +210 -0
  82. package/workspace/public/pm/cozy-evmodel.js +1 -1
  83. package/workspace/public/pm/cozy-library.css +36 -0
  84. package/workspace/public/pm/cozy-live-pill.js +3 -1
  85. package/workspace/public/pm/cozy-nav.js +70 -7
  86. package/workspace/public/pm/cozy-panels.js +1 -1
  87. package/workspace/public/pm/cozy-pick.css +3 -0
  88. package/workspace/public/pm/cozy-pick.js +6 -2
  89. package/workspace/public/pm/cozy-pop-work.css +165 -0
  90. package/workspace/public/pm/cozy-pop-work.js +427 -0
  91. package/workspace/public/pm/cozy-popup.css +113 -0
  92. package/workspace/public/pm/cozy-popup.js +408 -0
  93. package/workspace/public/pm/cozy-routine-model.js +111 -0
  94. package/workspace/public/pm/cozy-routine-pop.js +196 -0
  95. package/workspace/public/pm/cozy-routine.css +102 -0
  96. package/workspace/public/pm/cozy-routine.js +156 -0
  97. package/workspace/public/pm/cozy-schedwork.js +6 -5
  98. package/workspace/public/pm/cozy-settings.js +10 -1
  99. package/workspace/public/pm/cozy-today-app.js +236 -0
  100. package/workspace/public/pm/cozy-today-model.js +176 -0
  101. package/workspace/public/pm/cozy-today-page.css +100 -0
  102. package/workspace/public/pm/cozy-today-view.js +76 -0
  103. package/workspace/public/pm/cozy-viewer.js +66 -18
  104. package/workspace/public/pm/home-app.js +29 -6
  105. package/workspace/public/pm/home-ini.js +39 -7
  106. package/workspace/public/pm/library-model.js +69 -0
  107. package/workspace/public/pm/library-open.js +34 -0
  108. package/workspace/public/pm/page-chat.js +16 -4
  109. package/workspace/public/pm/pop-sessions.js +65 -0
  110. package/workspace/public/pm/pop-work-model.js +335 -0
  111. package/workspace/public/pm/premium-board.js +137 -11
  112. package/workspace/public/pm/premium-insights.js +14 -2
  113. package/workspace/public/pm/premium-library.js +122 -0
  114. package/workspace/public/pm/premium-shell.js +1 -1
  115. package/workspace/public/premium-board.html +1 -0
  116. package/workspace/public/premium-events.html +42 -0
  117. package/workspace/public/premium-library.html +31 -0
  118. package/workspace/public/premium-routine.html +31 -0
  119. package/workspace/public/today.html +50 -0
  120. package/workspace/ready-dash-ui-test.js +3 -1
  121. package/workspace/rename-test.js +2 -1
  122. package/workspace/run-tests.js +4 -1
  123. package/workspace/server.js +3 -2
  124. package/workspace/sort-order-test.js +2 -1
  125. package/workspace/split-merge-ui-test.js +3 -1
  126. package/workspace/stage-card-tasks-test.js +5 -3
  127. package/workspace/stage-card-test.js +2 -1
  128. package/workspace/task-card-test.js +2 -1
  129. package/workspace/task-delete-test.js +3 -1
  130. package/workspace/task-links-test.js +4 -2
  131. package/workspace/task-milestones-test.js +4 -2
  132. package/workspace/task-plans-test.js +3 -1
  133. package/workspace/task-press-test.js +3 -1
  134. package/workspace/task-views-test.js +10 -8
  135. package/workspace/test-lists/events-place.json +11 -0
  136. package/workspace/test-lists/library-place.json +9 -0
  137. package/workspace/test-lists/one-popup.json +9 -0
  138. package/workspace/test-lists/pop-work.json +9 -0
  139. package/workspace/test-lists/routine-place.json +9 -0
  140. package/workspace/test-lists/today-log.json +9 -0
  141. package/workspace/test-lists/work-view.json +9 -0
  142. package/workspace/timeline-holds-test.js +3 -1
  143. package/workspace/tk-tasks-test.js +3 -1
  144. package/workspace/viewer-trail-test.js +1 -1
  145. package/workspace/workflows-setup-test.js +1 -1
@@ -0,0 +1,142 @@
1
+ /* pm/cozy-events-view.js — the markup of Events (slice 6 of the six-place navigation, initiative events-place; board 2, StEvPlan). PURE: no
2
+ * DOM, no fetch, so a unit test reads it (events-view.test.mjs).
3
+ *
4
+ * groupsOf(items, { show, day }) → { late, today, coming, later } the items the page shows, by group; show = the kinds on; day = one day
5
+ * listHtml(model, o) the left side: Late (with Yes to all), Today, Coming up, and the later delivery milestones as one line
6
+ * rowHtml(x, today, o) one date: the day, its mark (a diamond for a delivery milestone, round for the rest), what and its kind,
7
+ * then what PMOS suggests with ✓ ✕, the act of today, or nothing (a date that needs nothing shows nothing)
8
+ * monthHtml(ym, items, o) the small month: a mark under each day that has a date, today ringed, the day picked filled
9
+ * showHtml(show) Show: the four kinds as the filter, which is also the key to the marks
10
+ * KINDS · KIND_LABEL · shiftMonth(ym, n)
11
+ * Text from records goes through esc(). Every icon-only button has an aria-label. The words say PMOS. */
12
+
13
+ export const KINDS = ['milestone', 'task', 'report', 'meeting'];
14
+ export const KIND_LABEL = { milestone: 'Delivery milestones', task: 'Tasks', report: 'Reports', meeting: 'Meetings and focus time' };
15
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
16
+ const MONTH = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
17
+ const WD = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
18
+
19
+ export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
20
+ const svg = (d, w = 16) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
21
+ export const ICON = {
22
+ yes: 'M5 12.5l4.5 4.5L19 7.5', no: 'M6 6l12 12M18 6L6 18', go: 'M9 6l6 6-6 6', back: 'M15 6l-6 6 6 6', plus: 'M12 5v14M5 12h14',
23
+ lock: 'M7 11V8a5 5 0 0 1 10 0v3M5.5 11h13v9h-13z', date: 'M7 5.5h10a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3zM4 10h16M8.5 3.5v4M15.5 3.5v4',
24
+ done: 'M12 3.5a8.5 8.5 0 1 0 0 17a8.5 8.5 0 1 0 0-17M8.5 12.2l2.4 2.4 4.6-5', spark: 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z',
25
+ };
26
+
27
+ const ms = (d) => Date.parse(String(d).slice(0, 10) + 'T00:00:00Z');
28
+ const between = (a, b) => Math.round((ms(b) - ms(a)) / 86400000);
29
+ const plural = (n, one, many) => (n === 1 ? one : many);
30
+ export function shortDay(d, today) {
31
+ const [y, m, dd] = String(d).slice(0, 10).split('-').map(Number);
32
+ return dd + ' ' + MON[m - 1] + (today && String(y) !== String(today).slice(0, 4) ? ' ' + y : '');
33
+ }
34
+ const weekday = (d) => WD[new Date(ms(d)).getUTCDay()];
35
+
36
+ /** The items the page shows, by group. show: the kinds that are on (a Set or array); day: 'YYYY-MM-DD' to show only that day. */
37
+ export function groupsOf(items, { show = KINDS, day = null } = {}) {
38
+ const on = new Set(show);
39
+ const list = (items || []).filter((x) => on.has(x.kind) && (!day || x.date === day));
40
+ const g = (k) => list.filter((x) => x.group === k);
41
+ return { late: g('late'), today: g('today'), coming: g('coming'), later: g('later') };
42
+ }
43
+
44
+ /** The day column: what the date is and how far it is. */
45
+ function dayCell(x, today) {
46
+ if (x.group === 'today' && x.time) return { b: x.time, s: x.until ? 'to ' + x.until : 'Today' };
47
+ if (x.group === 'today') return { b: 'Today', s: weekday(x.date) + ' ' + shortDay(x.date, today) };
48
+ const n = between(today, x.date);
49
+ if (x.group === 'late') return { b: shortDay(x.date, today), s: -n + ' ' + plural(-n, 'day', 'days') + ' late' };
50
+ return { b: shortDay(x.date, today), s: x.time ? weekday(x.date) + ' ' + x.time : 'in ' + n + ' ' + plural(n, 'day', 'days') };
51
+ }
52
+ /** The mark: a diamond for a delivery milestone, round for the rest; the tone says late or at risk. */
53
+ export const markHtml = (x) => `<i class="evp-k ${x.kind === 'milestone' ? 'evp-dm' : x.kind === 'meeting' ? 'evp-mt' : 'evp-rd'}${x.tone ? ' ' + x.tone : ''}" aria-hidden="true"></i>`;
54
+
55
+ /** One date. o: { today, busy: Set<key> of rows whose press is on its way } */
56
+ export function rowHtml(x, o = {}) {
57
+ const today = o.today;
58
+ const d = dayCell(x, today);
59
+ const kindWord = x.kind === 'milestone' ? 'Delivery milestone' : x.kind === 'task' ? 'Task' : x.kind === 'report' ? 'Report' : 'Meeting';
60
+ const what = `<b>${esc(x.title)}</b><small>${esc(x.line)}</small>`;
61
+ const t = x.work || x.task || x.own ? `<button type="button" class="evp-t" data-evp-open aria-label="${esc(x.title)}. ${esc(x.line)}. Open it">${what}</button>` : `<span class="evp-t">${what}</span>`;
62
+ let a = '';
63
+ if (x.suggest) {
64
+ const s = x.suggest;
65
+ a = `<span class="evp-sg"><i class="evp-sp" aria-hidden="true">${svg(ICON.spark, 14)}</i><span title="${esc(s.why || '')}">${esc(s.text)}</span></span>`
66
+ + `<button type="button" class="evp-ib evp-yes" data-evp-yes aria-label="Yes: ${esc(s.text)}" title="Yes">${svg(ICON.yes, 15)}</button>`
67
+ + `<button type="button" class="evp-ib" data-evp-no aria-label="No: ${esc(s.text)}" title="No">${svg(ICON.no, 15)}</button>`;
68
+ } else if (x.act && x.act.href) {
69
+ a = `<a class="evp-go" href="${esc(x.act.href)}">${esc(x.act.label)}${svg(ICON.go, 14)}</a>`;
70
+ } else if (x.group === 'today' && (x.task || x.own)) {
71
+ a = `<button type="button" class="evp-ib" data-evp-done aria-label="Mark it done: ${esc(x.title)}" title="Mark it done">${svg(ICON.done, 16)}</button>`;
72
+ }
73
+ // the tools show on a row you point at or step to: a new day (edit in place) and Fixed
74
+ const tools = (x.editable && !(x.fixed && x.kind === 'milestone') ? `<label class="evp-ib evp-dt" title="Set a date"><span class="vh">Set a date for ${esc(x.title)}</span>${svg(ICON.date, 15)}<input type="date" data-evp-date value="${esc(x.date)}" /></label>` : '')
75
+ + (x.canFix ? `<button type="button" class="evp-ib evp-fx" data-evp-fix aria-pressed="${x.fixed ? 'true' : 'false'}" aria-label="${x.fixed ? 'Fixed date. Press to let PMOS suggest a new date' : 'Mark as a fixed date'}" title="${x.fixed ? 'Fixed date' : 'Fixed date: never move it'}">${svg(ICON.lock, 15)}</button>` : '');
76
+ return `<div class="evp-r${x.fixed ? ' fixed' : ''}${o.busy && o.busy.has(x.key) ? ' busy' : ''}" data-key="${esc(x.key)}" data-kind="${esc(x.kind)}" aria-label="${esc(kindWord)}">`
77
+ + `<span class="evp-d ${x.tone || ''}"><b>${esc(d.b)}</b><small>${esc(d.s)}${x.fixed ? ' · fixed' : ''}</small></span>${markHtml(x)}${t}`
78
+ + `<span class="evp-a">${a}</span><span class="evp-tl">${tools}</span></div>`;
79
+ }
80
+
81
+ function groupHtml(key, label, rows, o, head = '') {
82
+ if (!rows.length) return ''; // zero is silence
83
+ return `<section class="evp-g evp-${key}" aria-label="${esc(label)}"><h2>${esc(label)}<small>${rows.length}</small>${head}</h2><div class="evp-b">${rows.map((x) => rowHtml(x, o)).join('')}</div></section>`;
84
+ }
85
+
86
+ /** The left side. model: { today, items, later }; o: { show, day, busy } */
87
+ export function listHtml(model, o = {}) {
88
+ const today = model.today;
89
+ const G = groupsOf(model.items, o);
90
+ const yes = G.late.filter((x) => x.suggest).length;
91
+ const all = yes > 1 ? `<button type="button" class="evp-all" data-evp-all>Yes to all ${yes}</button>` : '';
92
+ const ro = { today, busy: o.busy };
93
+ let later = '';
94
+ const on = new Set(o.show || KINDS);
95
+ if (o.day) {
96
+ later = G.later.length ? groupHtml('later', 'Later', G.later, ro) : '';
97
+ } else if (on.has('milestone') && model.later && model.later.count && model.later.next) {
98
+ const n = model.later.count, nx = model.later.next;
99
+ later = `<p class="evp-more">${n} ${plural(n, 'delivery milestone', 'delivery milestones')} after the next 30 days. The next is ${esc(shortDay(nx.date, today))}: ${esc(nx.title)}</p>`;
100
+ }
101
+ const body = groupHtml('late', 'Late', G.late, ro, all) + groupHtml('now', 'Today', G.today, ro) + groupHtml('coming', 'Coming up', G.coming, ro) + later;
102
+ if (body) return body;
103
+ if (o.day) return `<p class="evp-quiet">Nothing has a date on ${esc(weekday(o.day) + ' ' + shortDay(o.day, today))}.</p>`;
104
+ return '<p class="evp-quiet">Nothing is late, and nothing has a date in the next 30 days.</p>';
105
+ }
106
+
107
+ /** 'YYYY-MM' moved by n months. */
108
+ export function shiftMonth(ym, n) {
109
+ const [y, m] = ym.split('-').map(Number);
110
+ const t = y * 12 + (m - 1) + n;
111
+ return Math.floor(t / 12) + '-' + String((t % 12) + 1).padStart(2, '0');
112
+ }
113
+ /** The small month of ym ('YYYY-MM'), Monday first. o: { today, day, show } */
114
+ export function monthHtml(ym, items, o = {}) {
115
+ const [y, m] = ym.split('-').map(Number);
116
+ const on = new Set(o.show || KINDS);
117
+ const byDay = new Map();
118
+ for (const x of items || []) { if (!on.has(x.kind)) continue; if (!byDay.has(x.date)) byDay.set(x.date, []); byDay.get(x.date).push(x); }
119
+ const first = Date.UTC(y, m - 1, 1);
120
+ const lead = (new Date(first).getUTCDay() + 6) % 7;
121
+ let cells = ['M', 'T', 'W', 'T', 'F', 'S', 'S'].map((d) => `<span class="evp-mh" aria-hidden="true">${d}</span>`).join('');
122
+ for (let i = 0; i < 42; i++) {
123
+ const t = new Date(first + (i - lead) * 86400000);
124
+ const k = t.toISOString().slice(0, 10), out = t.getUTCMonth() !== m - 1;
125
+ const xs = byDay.get(k) || [];
126
+ // one mark per kind and tone, at most three: the day is the map, not the list
127
+ const seen = new Set(), marks = [];
128
+ for (const x of xs) { const sig = x.kind + '|' + (x.tone || ''); if (!seen.has(sig) && marks.length < 3) { seen.add(sig); marks.push(markHtml(x)); } }
129
+ const lab = `${t.getUTCDate()} ${MONTH[t.getUTCMonth()]}${xs.length ? ', ' + xs.length + ' ' + plural(xs.length, 'date', 'dates') : ''}`;
130
+ cells += `<button type="button" class="evp-md${out ? ' out' : ''}${k === o.today ? ' now' : ''}${k === o.day ? ' on' : ''}" data-evp-day="${k}" aria-pressed="${k === o.day ? 'true' : 'false'}" aria-label="${esc(lab)}">${t.getUTCDate()}<em>${marks.join('')}</em></button>`;
131
+ }
132
+ return `<div class="evp-mt-top"><b>${MONTH[m - 1]} ${y}</b><button type="button" class="evp-ib" data-evp-month="-1" aria-label="The month before" title="The month before">${svg(ICON.back, 16)}</button><button type="button" class="evp-ib" data-evp-month="1" aria-label="The month after" title="The month after">${svg(ICON.go, 16)}</button></div>`
133
+ + `<div class="evp-mg" role="group" aria-label="${MONTH[m - 1]} ${y}">${cells}</div>`;
134
+ }
135
+
136
+ /** Show: the four kinds, each a switch; it is the key to the marks too. */
137
+ export function showHtml(show) {
138
+ const on = new Set(show || KINDS);
139
+ const mk = { milestone: 'evp-dm', task: 'evp-rd', report: 'evp-rd', meeting: 'evp-mt' };
140
+ return `<h3 class="evp-sh">Show</h3><div class="evp-f" role="group" aria-label="Show">${KINDS.map((k) => `<button type="button" data-evp-show="${k}" aria-pressed="${on.has(k) ? 'true' : 'false'}"><i class="evp-k ${mk[k]}" aria-hidden="true"></i>${esc(KIND_LABEL[k])}<span class="evp-on" aria-hidden="true">${on.has(k) ? svg(ICON.yes, 14) : ''}</span></button>`).join('')}</div>`
141
+ + '<div class="evp-key"><span><i class="evp-k evp-rd late" aria-hidden="true"></i>Late</span><span><i class="evp-k evp-rd risk" aria-hidden="true"></i>At risk</span></div>';
142
+ }
@@ -0,0 +1,107 @@
1
+ /* cozy-events.css — Events (slice 6 of the six-place navigation, initiative events-place; board 2, StEvPlan). One container: the white page
2
+ * panel; the dates sit in one card per group with a thin border; the small month and Show sit in one grey box on the right. Tokens only. */
3
+ .evp-page .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
4
+ .evp-hd { display: flex; align-items: center; gap: 12px; min-height: 44px; }
5
+ .evp-hd h1 { margin: 0 auto 0 0; font-size: var(--fs-page); font-weight: var(--fw-page); line-height: var(--lh-page); }
6
+ .evp-dayf { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--cz-ink2); background: var(--cz-bluebg); border-radius: 999px; padding: 2px 4px 2px 12px; }
7
+ .evp-dayf[hidden] { display: none; }
8
+ .evp-dayf b { font-weight: var(--fw-strong); color: var(--cz-blueink); }
9
+ .evp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 28px; align-items: start; }
10
+ .evp-left { min-width: 0; }
11
+
12
+ /* the icon buttons */
13
+ .evp-ib { all: unset; box-sizing: border-box; cursor: pointer; position: relative; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--cz-ink2); flex: none; }
14
+ .evp-ib:focus-visible, .evp-t:focus-visible, .evp-md:focus-visible, .evp-f button:focus-visible, .evp-all:focus-visible, .evp-go:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
15
+ .evp-a .evp-ib { background: var(--cz-card); box-shadow: inset 0 0 0 1px var(--cz-hair); }
16
+ .evp-ib.evp-yes { color: var(--cz-ok); }
17
+ .evp-add { width: 36px; height: 36px; border-radius: 12px; color: var(--cz-blueink); }
18
+ @media (hover: hover) { .evp-ib:hover { background: var(--cz-well2); } .evp-t:hover b { text-decoration: underline; text-underline-offset: 3px; } .evp-md:hover { background: var(--cz-card); } }
19
+
20
+ /* the groups */
21
+ .evp-g { margin: 0 0 20px; }
22
+ .evp-g h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: var(--fs-label); font-weight: var(--fw-label); letter-spacing: .06em; text-transform: uppercase; color: var(--cz-ink3); }
23
+ .evp-g h2 small { font-size: var(--fs-label); font-weight: var(--fw-label); }
24
+ .evp-late h2 { color: var(--cz-late); }
25
+ .evp-now h2 { color: var(--cz-blueink); }
26
+ .evp-all { all: unset; box-sizing: border-box; cursor: pointer; margin-left: auto; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--cz-well); font-size: var(--fs-meta); font-weight: var(--fw-strong); letter-spacing: 0; text-transform: none; color: var(--cz-ink); }
27
+ .evp-b { border-radius: 16px; box-shadow: inset 0 0 0 1px var(--cz-hair); background: var(--cz-card); overflow: hidden; }
28
+ .evp-now .evp-b { background: var(--cz-bluebg); box-shadow: none; }
29
+
30
+ /* a row */
31
+ .evp-r { display: grid; grid-template-columns: 104px 10px minmax(0, 1fr) auto auto; align-items: center; column-gap: 14px; min-height: 60px; padding: 6px 12px 6px 16px; box-sizing: border-box; }
32
+ .evp-r + .evp-r { box-shadow: inset 0 1px 0 var(--cz-hair); }
33
+ .evp-r.busy { opacity: .55; pointer-events: none; }
34
+ .evp-d b { display: block; font-size: var(--fs-row); font-weight: var(--fw-row); }
35
+ .evp-d small { font-size: var(--fs-meta); color: var(--cz-ink3); }
36
+ .evp-d.late small { color: var(--cz-late); }
37
+ .evp-d.risk small { color: var(--cz-risk); }
38
+ .evp-t { all: unset; box-sizing: border-box; min-width: 0; cursor: default; display: block; }
39
+ button.evp-t { cursor: pointer; }
40
+ .evp-t b { display: block; font-size: var(--fs-row); font-weight: var(--fw-row); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
41
+ .evp-t small { display: block; margin-top: 1px; font-size: var(--fs-meta); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
42
+ .evp-a { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-meta); color: var(--cz-ink2); white-space: nowrap; }
43
+ .evp-sg { display: inline-flex; align-items: center; gap: 6px; }
44
+ .evp-sp { display: inline-grid; color: var(--cz-blueink); }
45
+ .evp-go { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px 0 14px; border-radius: 999px; background: var(--cz-card); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink); text-decoration: none; }
46
+ /* the tools: a new day and Fixed, shown on a row you point at or step into; a fixed row keeps its lock */
47
+ .evp-tl { display: inline-flex; align-items: center; gap: 2px; opacity: 0; }
48
+ .evp-r:focus-within .evp-tl, .evp-r.fixed .evp-tl { opacity: 1; }
49
+ @media (hover: hover) { .evp-r:hover .evp-tl { opacity: 1; } }
50
+ @media (hover: none) { .evp-tl { opacity: 1; } }
51
+ .evp-r.fixed .evp-fx { color: var(--cz-blueink); }
52
+ .evp-dt input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
53
+
54
+ /* the marks: a diamond for a delivery milestone, round for a task or a report, a ring for a meeting or focus time */
55
+ .evp-k { display: inline-block; width: 8px; height: 8px; flex: none; background: var(--cz-blueink); }
56
+ .evp-k.evp-dm { transform: rotate(45deg); border-radius: 2px; }
57
+ .evp-k.evp-rd { border-radius: 50%; background: var(--cz-blue); }
58
+ .evp-k.evp-mt { border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 2px var(--cz-blue); }
59
+ .evp-k.late { background: var(--cz-dot-late); }
60
+ .evp-k.risk { background: var(--cz-dot-risk); }
61
+ .evp-k.evp-mt.late { background: transparent; box-shadow: inset 0 0 0 2px var(--cz-dot-late); }
62
+
63
+ .evp-more { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 2px; font-size: var(--fs-meta); color: var(--cz-ink2); }
64
+ .evp-quiet { margin: 8px 0; font-size: var(--fs-body); color: var(--cz-ink3); }
65
+ .evp-note { margin: 0 0 12px; font-size: var(--fs-meta); color: var(--cz-risk); }
66
+
67
+ /* your own date, written in place */
68
+ .evp-new { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 8px; align-items: center; margin: 0 0 16px; padding: 8px 8px 8px 14px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--cz-hair); }
69
+ .evp-new[hidden] { display: none; }
70
+ .evp-new input { box-sizing: border-box; height: 36px; border: 0; background: var(--cz-well); border-radius: 10px; padding: 0 10px; font: inherit; font-size: var(--fs-body); color: var(--cz-ink); min-width: 0; }
71
+
72
+ /* the grey box: the small month, then Show */
73
+ .evp-side { border-radius: 20px; background: var(--cz-well); padding: 16px; }
74
+ .evp-mt-top { display: flex; align-items: center; gap: 4px; margin: 0 0 10px; }
75
+ .evp-mt-top b { margin-right: auto; font-size: var(--fs-section); font-weight: var(--fw-section); }
76
+ .evp-mg { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; }
77
+ .evp-mh { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink3); text-align: center; padding-bottom: 4px; }
78
+ .evp-md { all: unset; box-sizing: border-box; cursor: pointer; height: 40px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: var(--fs-meta); color: var(--cz-ink); }
79
+ .evp-md.out { color: var(--cz-ink3); }
80
+ .evp-md.now { background: var(--cz-card); box-shadow: inset 0 0 0 1.5px var(--cz-blue); color: var(--cz-blueink); font-weight: var(--fw-strong); }
81
+ .evp-md.on { background: var(--cz-blue); color: var(--cz-onsolid); }
82
+ .evp-md em { display: flex; gap: 3px; height: 6px; }
83
+ .evp-md em .evp-k { width: 6px; height: 6px; }
84
+ .evp-md.on em .evp-k { background: var(--cz-onsolid); box-shadow: none; }
85
+ .evp-sh { margin: 16px 0 6px; font-size: var(--fs-label); font-weight: var(--fw-label); letter-spacing: .06em; text-transform: uppercase; color: var(--cz-ink3); }
86
+ .evp-f { display: grid; gap: 4px; }
87
+ .evp-f button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--cz-card); font-size: var(--fs-meta); color: var(--cz-ink); }
88
+ .evp-f button[aria-pressed="false"] { background: transparent; color: var(--cz-ink3); }
89
+ .evp-on { margin-left: auto; display: inline-grid; color: var(--cz-blueink); }
90
+ .evp-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; font-size: var(--fs-meta); color: var(--cz-ink2); }
91
+ .evp-key span { display: inline-flex; align-items: center; gap: 6px; }
92
+ .evp-hint { margin: 12px 0 0; font-size: var(--fs-meta); color: var(--cz-ink3); }
93
+
94
+ /* the toast with Undo */
95
+ .evp-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 80; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 14px; background: var(--cz-ink); color: var(--cz-card); font-size: var(--fs-meta); box-shadow: var(--cz-float); transition: opacity .18s, transform .18s; }
96
+ .evp-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
97
+ .evp-undo { all: unset; cursor: pointer; font-weight: var(--fw-strong); color: var(--cz-card); text-decoration: underline; text-underline-offset: 3px; }
98
+
99
+ /* the phone: the month and Show go under the dates */
100
+ @media (max-width: 760px) {
101
+ .evp-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
102
+ .evp-r { grid-template-columns: 76px 10px minmax(0, 1fr); row-gap: 6px; padding: 8px 12px; }
103
+ .evp-a, .evp-tl { grid-column: 3; justify-self: start; }
104
+ .evp-a { flex-wrap: wrap; white-space: normal; }
105
+ .evp-new { grid-template-columns: minmax(0, 1fr) auto; }
106
+ .evp-new input[type="date"] { grid-column: 1; }
107
+ }
@@ -0,0 +1,210 @@
1
+ /* pm/cozy-events.js — Events, the place for everything with a date (slice 6 of the six-place navigation, initiative events-place; board 2,
2
+ * StEvPlan, on Exploring 2; build plan /mnt/project-files/nav-structure/build-plan.md).
3
+ *
4
+ * One page with no views. Left: the dates grouped by what you do about them. Late: what PMOS suggests for each (✓ ✕), and Yes to all. Today: one
5
+ * press to the act itself. Coming up: a suggestion only where a date is at risk. The later delivery milestones are one quiet line. Right, in
6
+ * one grey box: a small month (press a day to see only that day; press it again for every day), then Show: the four kinds as the filter, which
7
+ * is the key to the marks too. PMOS remembers Show (localStorage 'pmos.events.show'). The + adds your own date (a PM item with a due day).
8
+ *
9
+ * Reads GET /api/events-place (lib/routes-events-place.js); 202 means a Board is still being read, and the page asks again. Writes only on a
10
+ * press, through the routes that exist: ✓ on a suggestion is POST /api/boards/tasks/state (Done, Won't do) or /api/boards/tasks/edit (a new
11
+ * due day) for a PMOS task, and /api/pm-items/* for your own item; each has Undo for a moment. ✕ and Fixed are POST /api/events-place/mark.
12
+ * Pressing a row opens its work in the one popup (pm/cozy-popup.js) with Ask PMOS beside it. The markup is pm/cozy-events-view.js (pure). */
13
+ import { mountNav } from './cozy-nav.js';
14
+ import * as POP from './cozy-popup.js';
15
+ import { pmGet, pmPost } from './http.js';
16
+ import { KINDS, listHtml, monthHtml, showHtml, shiftMonth, esc } from './cozy-events-view.js';
17
+
18
+ const SHOW_KEY = 'pmos.events.show';
19
+ const UNDO_MS = 6000;
20
+ const store = {
21
+ get(k) { try { return localStorage.getItem(k); } catch { return null; } },
22
+ set(k, v) { try { if (v == null) localStorage.removeItem(k); else localStorage.setItem(k, v); } catch { /* a private window */ } },
23
+ };
24
+ const $ = (s) => document.querySelector(s);
25
+ const S = { model: null, show: readShow(), day: null, ym: null, busy: new Set(), tries: 0, timer: 0, toastT: 0 };
26
+
27
+ function readShow() {
28
+ const v = store.get(SHOW_KEY);
29
+ if (!v) return [...KINDS];
30
+ const on = v.split(',').filter((k) => KINDS.includes(k));
31
+ return on.length ? on : [...KINDS];
32
+ }
33
+
34
+ mountNav('events', document);
35
+
36
+ /* ── reading ── */
37
+ async function load() {
38
+ clearTimeout(S.timer);
39
+ const r = await pmGet('/api/events-place');
40
+ if (r && r.ok && r.state === 'reading') {
41
+ if (!S.model) $('#evpList').innerHTML = '<p class="evp-quiet" role="status">Reading the dates from every product.</p>';
42
+ S.timer = setTimeout(load, Math.min(4000, 400 * 2 ** S.tries++));
43
+ return;
44
+ }
45
+ S.tries = 0;
46
+ if (!r || !r.ok) {
47
+ if (!S.model) $('#evpList').innerHTML = `<p class="evp-quiet" role="alert"><b>The dates could not be read</b>, so this page shows nothing rather than guess.${r && r.error ? ' The reason: ' + esc(r.error) : ''}</p>`;
48
+ S.timer = setTimeout(load, 15000);
49
+ return;
50
+ }
51
+ S.model = r;
52
+ if (!S.ym) S.ym = String(r.today).slice(0, 7);
53
+ draw();
54
+ }
55
+
56
+ /* ── drawing ── */
57
+ function draw() {
58
+ const M = S.model; if (!M) return;
59
+ $('#evpList').innerHTML = listHtml(M, { show: S.show, day: S.day, busy: S.busy });
60
+ $('#evpMonth').innerHTML = monthHtml(S.ym, M.items, { today: M.today, day: S.day, show: S.show });
61
+ $('#evpShow').innerHTML = showHtml(S.show);
62
+ const miss = (M.missing || []).length ? 'Not read: ' + M.missing.join(', ') + '.' : '';
63
+ const note = $('#evpNote'); note.textContent = miss; note.hidden = !miss;
64
+ const day = $('#evpDay');
65
+ if (S.day) { day.hidden = false; day.querySelector('b').textContent = new Date(S.day + 'T00:00:00').toLocaleDateString(undefined, { weekday: 'short', day: 'numeric', month: 'short' }); } else day.hidden = true;
66
+ }
67
+ const itemOf = (el) => { const r = el && el.closest('[data-key]'); return r && S.model ? S.model.items.find((x) => x.key === r.dataset.key) : null; };
68
+
69
+ /* ── the toast with Undo ── */
70
+ function say(text, undo) {
71
+ const t = $('#toast');
72
+ clearTimeout(S.toastT);
73
+ t.innerHTML = `<span>${esc(text)}</span>${undo ? '<button type="button" class="evp-undo">Undo</button>' : ''}`;
74
+ t.classList.add('on');
75
+ const b = t.querySelector('.evp-undo');
76
+ if (b) b.onclick = async () => { t.classList.remove('on'); await undo(); load(); };
77
+ S.toastT = setTimeout(() => t.classList.remove('on'), UNDO_MS);
78
+ }
79
+
80
+ /* ── the writes, each through a route that exists ── */
81
+ const taskBody = (x) => ({ ws: x.task.ws, board: x.task.board, task: x.task.uid });
82
+ async function setState(x, state) { return pmPost('/api/boards/tasks/state', { ...taskBody(x), state }); }
83
+ async function setDue(x, due) {
84
+ if (x.own) return pmPost('/api/pm-items/edit', { id: x.own, fields: { due } });
85
+ return pmPost('/api/boards/tasks/edit', { ...taskBody(x), due });
86
+ }
87
+ /** Apply one suggestion. → { ok, undo, error } */
88
+ async function apply(x, s) {
89
+ const was = x.task && x.task.status ? x.task.status : 'To do';
90
+ if (s.op === 'done') {
91
+ if (x.own) { const r = await pmPost('/api/pm-items/done', { id: x.own }); return { ok: r && r.ok !== false, error: r && r.error, undo: () => pmPost('/api/pm-items/reopen', { id: x.own }) }; }
92
+ const r = await setState(x, 'Done'); return { ok: r && r.ok !== false, error: r && r.error, undo: () => setState(x, was) };
93
+ }
94
+ if (s.op === 'drop') {
95
+ 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 }) }; }
96
+ const r = await setState(x, "Won't do"); return { ok: r && r.ok !== false, error: r && r.error, undo: () => setState(x, was) };
97
+ }
98
+ if (s.op === 'move' && s.to) {
99
+ const r = await setDue(x, s.to); return { ok: r && r.ok !== false, error: r && r.error, undo: () => setDue(x, x.date) };
100
+ }
101
+ return { ok: false, error: 'PMOS cannot make this change here. Open the work to change it.' };
102
+ }
103
+ async function yes(x) {
104
+ if (!x || !x.suggest) return;
105
+ S.busy.add(x.key); draw();
106
+ const out = await apply(x, x.suggest);
107
+ S.busy.delete(x.key);
108
+ if (!out.ok) { say(out.error || 'Nothing was changed.'); draw(); return; }
109
+ say(x.suggest.text + ': ' + x.title + '.', out.undo);
110
+ load();
111
+ }
112
+ async function yesAll() {
113
+ const list = S.model.items.filter((x) => x.group === 'late' && x.suggest && S.show.includes(x.kind) && (!S.day || x.date === S.day));
114
+ if (!list.length) return;
115
+ list.forEach((x) => S.busy.add(x.key)); draw();
116
+ const undos = [];
117
+ let failed = 0;
118
+ for (const x of list) { const o = await apply(x, x.suggest); if (o.ok) undos.push(o.undo); else failed++; S.busy.delete(x.key); }
119
+ say(undos.length + ' ' + (undos.length === 1 ? 'change' : 'changes') + ' made' + (failed ? ', ' + failed + ' could not be made' : '') + '.', undos.length ? async () => { for (const u of undos.reverse()) await u(); } : null);
120
+ load();
121
+ }
122
+ async function no(x) {
123
+ if (!x || !x.suggest) return;
124
+ const sig = x.suggest.sig;
125
+ const r = await pmPost('/api/events-place/mark', { sig, no: true });
126
+ if (!r || r.ok === false) { say((r && r.error) || 'Nothing was changed.'); return; }
127
+ say('PMOS will not suggest this again.', () => pmPost('/api/events-place/mark', { sig, no: false }));
128
+ load();
129
+ }
130
+ async function fix(x) {
131
+ const r = await pmPost('/api/events-place/mark', { key: x.key, fixed: !x.fixed });
132
+ if (!r || r.ok === false) { say((r && r.error) || 'Nothing was changed.'); return; }
133
+ say(x.fixed ? 'PMOS may suggest a new date for it again.' : 'Fixed. PMOS will never suggest a new date for it.', () => pmPost('/api/events-place/mark', { key: x.key, fixed: !!x.fixed }));
134
+ load();
135
+ }
136
+ async function done(x) {
137
+ const out = await apply(x, { op: 'done' });
138
+ if (!out.ok) { say(out.error || 'Nothing was changed.'); return; }
139
+ say('Done: ' + x.title + '.', out.undo);
140
+ load();
141
+ }
142
+ async function redate(x, due) {
143
+ if (!due || due === x.date) return;
144
+ const r = await setDue(x, due);
145
+ if (!r || r.ok === false) { say((r && r.error) || 'Nothing was changed.'); return; }
146
+ say('New date: ' + x.title + '.', () => setDue(x, x.date));
147
+ load();
148
+ }
149
+ function open(x) {
150
+ if (!x) return;
151
+ if (x.own && !x.work) return;
152
+ const w = x.work;
153
+ if (!w) return;
154
+ const about = { id: w.id, kind: 'initiative', title: w.title || undefined, ws: w.ws || undefined };
155
+ POP.openWork({ about, open: () => import('./premium-vw-item.js').then((M) => (x.task && x.kind === 'task'
156
+ ? M.openWorkItem({ kind: 'task', ini: w.id, key: 'task:' + x.task.uid, ws: w.ws, board: w.board })
157
+ : M.openWorkItem({ kind: 'initiative', id: w.id, ws: w.ws, board: w.board, title: w.title || undefined }))) });
158
+ }
159
+
160
+ /* ── the + : your own date, written in place ── */
161
+ function addOpen() {
162
+ const f = $('#evpAdd');
163
+ f.hidden = false;
164
+ if (!f.elements.when.value && S.model) f.elements.when.value = S.day || S.model.today;
165
+ f.elements.what.focus();
166
+ }
167
+ async function addSave(e) {
168
+ e.preventDefault();
169
+ const f = $('#evpAdd'), what = f.elements.what.value.trim(), when = f.elements.when.value;
170
+ if (!what || !when) { (what ? f.elements.when : f.elements.what).focus(); return; }
171
+ const r = await pmPost('/api/pm-items/add', { line: what });
172
+ const id = r && r.item && r.item.id;
173
+ if (!id) { say((r && r.error) || 'It could not be added.'); return; }
174
+ await pmPost('/api/pm-items/edit', { id, fields: { due: when } });
175
+ f.reset(); f.hidden = true;
176
+ say('Added: ' + what + '.', () => pmPost('/api/pm-items/remove', { id }));
177
+ load();
178
+ }
179
+
180
+ /* ── presses ── */
181
+ document.addEventListener('click', (e) => {
182
+ const t = e.target;
183
+ if (!t || !t.closest) return;
184
+ const b = t.closest('[data-evp-yes],[data-evp-no],[data-evp-all],[data-evp-fix],[data-evp-done],[data-evp-open],[data-evp-day],[data-evp-month],[data-evp-show],[data-evp-add],[data-evp-clear],.evp-dt');
185
+ if (!b) return;
186
+ const x = itemOf(b);
187
+ if (b.matches('[data-evp-yes]')) yes(x);
188
+ else if (b.matches('[data-evp-no]')) no(x);
189
+ else if (b.matches('[data-evp-all]')) yesAll();
190
+ else if (b.matches('[data-evp-fix]')) fix(x);
191
+ else if (b.matches('[data-evp-done]')) done(x);
192
+ else if (b.matches('[data-evp-open]')) open(x);
193
+ else if (b.matches('[data-evp-day]')) { S.day = S.day === b.dataset.evpDay ? null : b.dataset.evpDay; draw(); }
194
+ else if (b.matches('[data-evp-month]')) { S.ym = shiftMonth(S.ym, Number(b.dataset.evpMonth)); draw(); }
195
+ else if (b.matches('[data-evp-clear]')) { S.day = null; draw(); }
196
+ else if (b.matches('[data-evp-add]')) addOpen();
197
+ else if (b.matches('[data-evp-show]')) {
198
+ const k = b.dataset.evpShow, on = new Set(S.show);
199
+ if (on.has(k)) on.delete(k); else on.add(k);
200
+ S.show = KINDS.filter((x) => on.has(x));
201
+ store.set(SHOW_KEY, S.show.length === KINDS.length ? null : S.show.join(',') || 'none');
202
+ draw();
203
+ } else if (b.matches('.evp-dt')) { const i = b.querySelector('input'); if (i && typeof i.showPicker === 'function') { e.preventDefault(); try { i.showPicker(); } catch { i.focus(); } } }
204
+ });
205
+ document.addEventListener('change', (e) => { const i = e.target; if (i && i.matches && i.matches('[data-evp-date]')) redate(itemOf(i), i.value); });
206
+ $('#evpAdd').addEventListener('submit', addSave);
207
+ $('#evpAdd').addEventListener('keydown', (e) => { if (e.key === 'Escape') { e.currentTarget.reset(); e.currentTarget.hidden = true; } });
208
+ document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'visible' && S.model) load(); });
209
+
210
+ load();
@@ -18,7 +18,7 @@
18
18
  * wtChip(worktrees) → 'main + 3 worktrees'
19
19
  * initials(name) → 'Mei' · 'DL' (EvInbox's avatars: a short first name, else two initials) */
20
20
 
21
- const PLACE = { home: 'Home', board: 'Board', insights: 'Intelligence', settings: 'Settings' };
21
+ const PLACE = { home: 'Today', board: 'Work', insights: 'Goals', library: 'Library', settings: 'Settings' }; // the places' names since slice 1 of the six places
22
22
  const SRC_NAME = { repository: 'Repository', initiatives: 'Initiatives', calendar: 'Calendar', jira: 'Jira', 'my-work': 'Your tasks', tracker: 'Tracker items', tools: 'Mail, Slack and meeting notes' };
23
23
  const SRC_SUB = { repository: 'This product\'s repository', initiatives: 'Read from the repository', calendar: 'Your calendar', jira: 'The Jira projects of your initiatives', 'my-work': 'The work assigned to you', tracker: 'The tracker items of your initiatives', tools: 'Mail, Slack, Confluence and Wispr Flow' };
24
24
  const PARTS = { jira: 'Board and the Jira-linked initiatives', calendar: 'Today and your meetings', 'my-work': 'Your tasks', tracker: 'The tracker items on Board', tools: 'New for you and the digests', initiatives: 'Home and Board', repository: 'Home and Board' };
@@ -0,0 +1,36 @@
1
+ /* cozy-library.css — Library (initiative library-place, slice 7 of the six-place navigation; board StLibrary). One container: the white panel;
2
+ * the table is one card with a thin border; the title row's controls sit straight on the panel. Colours are the cozy tokens (light and dark). */
3
+ .lb-page .vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
4
+ .lb-bar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
5
+ .lb-find { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 38px; width: 300px; max-width: 46vw; padding: 0 14px; border-radius: 999px; background: var(--cz-well); color: var(--cz-ink3); box-sizing: border-box; flex: none; }
6
+ .lb-find svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; flex: none; }
7
+ .lb-find input { all: unset; flex: 1; min-width: 0; font: inherit; font-size: var(--fs-body); color: var(--cz-ink); }
8
+ .lb-find input::placeholder { color: var(--cz-ink3); }
9
+ .lb-find input::-webkit-search-cancel-button { cursor: pointer; }
10
+ .lb-find:focus-within { box-shadow: 0 0 0 2px var(--cz-blue); }
11
+ .lb-t { border-radius: 16px; background: var(--cz-card); box-shadow: inset 0 0 0 1px var(--cz-hair); overflow: hidden; font-size: var(--fs-body); color: var(--cz-ink); }
12
+ .lb-r { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(120px, 210px) minmax(120px, 230px) 110px; align-items: center; column-gap: 12px; min-height: 46px; padding: 0 18px; box-shadow: inset 0 -1px 0 var(--cz-hair); }
13
+ .lb-r:last-child { box-shadow: none; }
14
+ button.lb-r { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(120px, 210px) minmax(120px, 230px) 110px; align-items: center; column-gap: 12px; min-height: 46px; padding: 0 18px; width: 100%; cursor: pointer; box-shadow: inset 0 -1px 0 var(--cz-hair); }
15
+ button.lb-r:hover { background: var(--cz-well); }
16
+ button.lb-r:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: -2px; }
17
+ .lb-h { min-height: 38px; background: var(--cz-well2, var(--cz-well)); font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink2); }
18
+ .lb-g { min-height: 34px; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink3); background: var(--cz-well); }
19
+ .lb-g > div { grid-column: 1 / -1; }
20
+ .lb-r .ic { color: var(--cz-ink3); display: grid; place-items: center; }
21
+ .lb-r .ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
22
+ .lb-r .n { font-weight: var(--fw-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
23
+ .lb-r .c { color: var(--cz-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
24
+ .lb-r .c.q { color: var(--cz-ink3); }
25
+ .lb-n { margin: 0 6px; font-size: var(--fs-meta); color: var(--cz-ink3); }
26
+ .lb-sk .lb-r i { display: block; height: 10px; border-radius: 6px; background: var(--cz-well); width: 70%; }
27
+ .lb-none { padding: 28px 18px; color: var(--cz-ink3); font-size: var(--fs-body); }
28
+ @media (max-width: 760px) {
29
+ .lb-bar { flex-wrap: wrap; }
30
+ .lb-bar .cz-seg { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
31
+ .lb-bar .cz-seg button { flex: none; white-space: nowrap; }
32
+ .lb-find { order: 3; width: 100%; max-width: none; margin-left: 0; }
33
+ .lb-r, button.lb-r { grid-template-columns: 24px minmax(0, 1fr) 72px; }
34
+ .lb-r > :nth-child(3), .lb-r > :nth-child(4) { display: none; }
35
+ .lb-g { grid-template-columns: 1fr; }
36
+ }
@@ -113,13 +113,15 @@ export function mountLivePill(doc = document, opts = {}) {
113
113
  function draw() {
114
114
  if (!pill) return;
115
115
  const now = items();
116
- if (now.length !== L.n) { L.n = now.length; doc.dispatchEvent(new CustomEvent('cz:live-n', { detail: { n: now.length } })); } // the phone chat's ⋯ says "Live now · N" (batch 31 item 5)
116
+ const asks = now.filter((x) => x.mark === 'ask').length; // the sessions that wait for you: the number on the rail's chat icon (cozy-nav.js)
117
+ if (now.length !== L.n || asks !== L.asks) { L.n = now.length; L.asks = asks; doc.dispatchEvent(new CustomEvent('cz:live-n', { detail: { n: now.length, asks } })); } // the phone chat's ⋯ says "Live now · N" (batch 31 item 5)
117
118
  if (!now.length && !L.open) { pill.hidden = true; tray.hidden = true; scrim.hidden = true; return; }
118
119
  const list = L.open ? keepOrder(L.shown, now) : now;
119
120
  if (L.open && !list.length) { set(false); return; }
120
121
  pill.hidden = !now.length && !L.open;
121
122
  pill.classList.toggle('recp', now.some((x) => x.kind === 'rec' && !x.paused));
122
123
  pill.classList.toggle('asks', now.some((x) => x.mark === 'ask'));
124
+ pill.classList.toggle('lv-away', now.some((x) => x.kind === 'away')); // a panel put away: the one way back, so the pill shows even beside the rail's chat icon
123
125
  pill.setAttribute('aria-label', pillLabel(now, { mac: mac() }));
124
126
  pill.title = tipOf(now);
125
127
  const h = pillHtml(now); if (pill.__h !== h) { pill.__h = h; pill.innerHTML = h; }