create-pmos 0.613.0 → 0.615.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/package.json +27 -39
  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/changelog.json +26 -0
  7. package/workspace/guide/cli.md +2 -1
  8. package/workspace/guide/layout.md +24 -10
  9. package/workspace/guide/settings-and-switches.md +1 -0
  10. package/workspace/lib/events-place.js +46 -10
  11. package/workspace/lib/mention-cli.js +6 -3
  12. package/workspace/lib/mention-store.js +49 -10
  13. package/workspace/lib/routes-events-place.js +2 -1
  14. package/workspace/package-lock.json +2 -2
  15. package/workspace/package.json +1 -1
  16. package/workspace/public/pm/cozy-events-view.js +23 -4
  17. package/workspace/public/pm/cozy-events.js +8 -2
  18. package/workspace/public/pm/cozy-home-rows.css +55 -0
  19. package/workspace/public/pm/cozy-nav.js +15 -2
  20. package/workspace/public/pm/cozy-pop-work.css +3 -0
  21. package/workspace/public/pm/cozy-pop-work.js +5 -3
  22. package/workspace/public/pm/cozy-today-app.js +119 -12
  23. package/workspace/public/pm/cozy-today-model.js +278 -21
  24. package/workspace/public/pm/cozy-today-page.css +74 -15
  25. package/workspace/public/pm/cozy-today-view.js +89 -31
  26. package/workspace/public/pm/home-app.js +14 -6
  27. package/workspace/public/pm/home-data.js +1 -1
  28. package/workspace/public/pm/home-ini.js +17 -1
  29. package/workspace/public/pm/home-mentions.js +121 -6
  30. package/workspace/public/pm/ini-edit.js +2 -0
  31. package/workspace/public/pm/ini-view.css +2 -0
  32. package/workspace/public/pm/mention-one-model.js +115 -0
  33. package/workspace/public/pm/pop-work-model.js +17 -11
  34. package/workspace/public/pm/scope-chip.js +5 -2
  35. package/workspace/run-tests.js +11 -4
  36. package/workspace/server.js +8 -0
  37. package/workspace/skills/morning-brief.skill +1 -1
  38. package/workspace/test-run.js +2 -0
@@ -4,8 +4,11 @@
4
4
  *
5
5
  * The job of Today: show the few things only the PM can move today, and let them finish or move each one here, so nothing is left hanging.
6
6
  *
7
- * logModel(o) → { rows, done, counts, line } Today's log, kept the Bullet Journal way
7
+ * logModel(o) → { rows, first, todayRows, wait, done, counts, types, merged, line } Today's log, kept the Bullet Journal way, in
8
+ * three groups (Do first, Today, Can wait; groupLog) with a Type for each line
9
+ * overviewModel(L, A) → { said, suggest, chips } the Overview on top: where to start and why, PMOS's suggestions, the type chips
8
10
  * agendaModel(o) → { items, from, to, now, sub, empty } today's agenda, one column of hours
11
+ * headModel(now) → { when, hello } the page head
9
12
  * dayKey(ms) · addDays(day, n) · whenWord(...)
10
13
  *
11
14
  * WHERE THE ROWS COME FROM. Nothing here is invented: every row is a record PMOS already reads, or a line the PM typed.
@@ -25,6 +28,7 @@
25
28
  * more, PMOS suggests to drop it (one ✦ line under the row, ✓ ✕), unless the PM kept it in the last CARRY_DROP days.
26
29
  * FIRST ("!"). What the PM marked first, a verdict or a grill finding on shipped or late work (move-rank's ranks 1 and 2), and a send that
27
30
  * goes out today. The rest follow in the rank's order. Done rows close the table. */
31
+ import { didLeft, notASentence, asWritten, askTitle, proofText } from './mention-one-model.js'; // what PMOS did on an ask, from records (round 3 point 13); the title when no sentence can be made
28
32
 
29
33
  export const CARRY_DROP = 30; // days carried before PMOS suggests to drop it
30
34
  export const LATE_DAYS = 14; // a row carried this long reads late (the one colour in the When column)
@@ -44,18 +48,91 @@ const between = (a, b) => { const x = dayMs(a), y = dayMs(b); return x == null |
44
48
  /** "2 Nov", or "2 Nov 2025" outside this year. */
45
49
  const dm = (k, today) => { const m = DAY_RE.exec(String(k || '')); return m ? +m[3] + ' ' + MON[+m[2] - 1] + (m[1] !== String(today).slice(0, 4) ? ' ' + m[1] : '') : ''; };
46
50
 
47
- /** The words of the When column. o: { late (days late of a dated task), due, carried (days), time, send } */
51
+ /** The words of the When column: a date or a time only, else nothing (the why is said once, in the line under the title; design check of
52
+ * round 3). o: { late (days late of a dated task), due, carried (days), time, send } */
48
53
  export function whenWord(o, today) {
49
54
  if (o.time) return o.time;
50
- if (o.late > 0) return dm(o.due, today) + ', ' + plural(o.late, 'day', 'days') + ' late';
51
- if (o.carried > 0) return 'carried ' + plural(o.carried, 'day', 'days');
55
+ if (o.late > 0) return dm(o.due, today);
52
56
  if (o.send) return o.send;
53
- if (o.due && o.due === today) return 'today';
54
57
  return '';
55
58
  }
56
59
 
57
- const SEND_KINDS = new Set(['outbox', 'mention']);
58
- const jobOfAsk = (r) => (r.kind === 'call' ? (r.call && r.call.kind === 'update' ? 'Send' : 'Decide') : SEND_KINDS.has(r.kind) ? 'Send' : 'Decide');
60
+ const SEND_KINDS = new Set(['outbox']);
61
+ // a call the PM makes up their mind on is Decide; a thing the PM does (draft, write, award, run) is Do
62
+ const DECIDE_RE = /^(decide|confirm|choose|pick|approve|accept|sign|agree|review|keep|did\b)/i;
63
+ const jobOfAsk = (r) => (r.kind === 'call' ? (r.call && r.call.kind === 'update' ? 'Send' : DECIDE_RE.test(String((r.call && r.call.name) || r.title || '')) ? 'Decide' : 'Do')
64
+ : r.kind === 'mention' ? 'Reply' : SEND_KINDS.has(r.kind) ? 'Send' : r.kind === 'kr' || r.kind === 'extra' ? 'Do' : 'Decide');
65
+ const cap1 = (s) => String(s || '').replace(/^[a-z]/, (c) => c.toUpperCase());
66
+ /** An ask's What and Work, split as the board says them: the rank names a row "<work>: <what>" (a verdict, a grill finding, a meeting's or a
67
+ * program's milestone changes, the changes to keep); What is the thing to do, Work the initiative or program it is about. */
68
+ export function splitAsk(r, workName) {
69
+ const t = String(r.title || '');
70
+ if (r.kind === 'call') { const n = String((r.call && r.call.name) || t); return { what: /^draft\b/i.test(n) && !/let PMOS/i.test(n) ? n + ', or let PMOS draft it' : n, work: '' }; }
71
+ if (r.kind === 'verdict') {
72
+ const m = /^(.*): did it work\?/.exec(t);
73
+ if (!m) return { what: t, work: workName || '' };
74
+ // "Did the Okta migration work?"; a name that starts with its article keeps it once; a name that reads as a step is quoted
75
+ const n = m[1].trim(), art = /^(the|a|an)\s/i.test(n), step = /^\S+\s+(the|a|an|to|my|our|your)\s/i.test(n);
76
+ return { what: art ? 'Did ' + n.replace(/^\S+/, (w) => w.toLowerCase()) + ' work?' : step ? 'Did “' + n + '” work?' : 'Did the ' + n + ' work?', work: workName || '' };
77
+ }
78
+ if (!['grill', 'other', 'meeting'].includes(r.kind)) return { what: t, work: '' };
79
+ const i = t.indexOf(': ');
80
+ if (i < 1) return { what: t, work: '' };
81
+ const w = t.slice(0, i); let what = t.slice(i + 2);
82
+ let m;
83
+ if ((m = /^(.+) to confirm$/.exec(what))) what = 'Confirm ' + m[1];
84
+ else if ((m = /^(.+) to keep$/.exec(what))) what = 'Keep ' + m[1];
85
+ else if ((m = /^(.+) from your meetings$/.exec(what))) what = 'Confirm ' + m[1] + ' from your meetings';
86
+ return { what: cap1(what), work: w };
87
+ }
88
+
89
+ /* ── an ask from a person: who, then the ask (round 2 of Today, Wawan on his real data) ── */
90
+ const NOBODY = /^(someone|somebody|unknown|anyone|they|pm|me)$/i;
91
+ /** The first names of who asked: "Suhas,", "Someone" and the like are cleaned or left out. */
92
+ export function whoOf(m) {
93
+ const raw = Array.isArray(m && m.people) && m.people.length ? m.people : [(m && m.who) || ''];
94
+ const out = [];
95
+ for (const x of raw) { const n = String(x || '').trim().split(/\s+/)[0].replace(/[^\p{L}\p{N}'’-]+$/u, '').replace(/^[^\p{L}\p{N}]+/u, ''); if (n && !NOBODY.test(n) && !out.includes(n)) out.push(n); }
96
+ return out;
97
+ }
98
+ const names = (L) => (L.length <= 2 ? L.join(' and ') : L[0] + ' and ' + (L.length - 1) + ' others');
99
+ /** The ask in sentence case, said once: "asks asks" is one "asks", a stray "Someone:" goes. */
100
+ export function askText(m) {
101
+ // the ask itself first (round 3: a gist that describes the ask is the popup's sentence, not the row's title)
102
+ let t = String((m && ((m.ask ? 'asks ' + String(m.ask).replace(/^[A-Z](?=[a-z])/, (c) => c.toLowerCase()) : '') || m.gist || (m.text ? '“' + m.text + '”' : ''))) || '').replace(/\s+/g, ' ').trim();
103
+ t = t.replace(/^(?:[\p{L}'’-]+[\s,]*[:,][\s,:]*)?(?=asks\b)/iu, '').replace(/\b(asks?)(\s+\1\b)+/gi, '$1').replace(/^(someone|somebody)\s+/i, '').replace(/[.?!]+$/, '')
104
+ .replace(/^asks?\s+(?=\S)/i, ''); // the Type column says Ask: the title starts with the ask itself
105
+ if (notASentence(t)) return asWritten(m); // no clean sentence: the first words as written (design check of round 3)
106
+ return cap1(t);
107
+ }
108
+ const askWords = (t) => String(t || '').toLowerCase().replace(/^asks?\s+/, '').replace(/[^\p{L}\p{N}\s]+/gu, ' ').split(/\s+/).filter((w) => w.length > 2 && !/^(the|and|for|you|your|asks?|whether|does|can|what|when|with|that|this|from|pm)$/.test(w));
109
+ /** Two asks say the same thing: the same words, or most of them (at least four words, 80% shared). */
110
+ export function sameAsk(a, b) {
111
+ const x = askWords(a), y = askWords(b);
112
+ if (!x.length || !y.length) return false;
113
+ if (x.join(' ') === y.join(' ')) return true;
114
+ if (x.length < 4 || y.length < 4) return false;
115
+ const A = new Set(x), B = new Set(y); let n = 0; for (const w of A) if (B.has(w)) n++;
116
+ return n / Math.max(A.size, B.size) >= 0.8;
117
+ }
118
+
119
+ /* ── the type of a line: one word and a small sign in the Type column; the chips of the Overview count them ── */
120
+ export const TYPES = ['Ask', 'Decision', 'Check', 'Milestone', 'Task', 'Report', 'Note'];
121
+ function typeOf(r) {
122
+ const ref = r.ref || {};
123
+ if (r.bullet === 'note' || r.src === 'note') return 'Note';
124
+ if (r.src === 'draft') return 'Report';
125
+ if (r.src === 'lab') return 'Decision';
126
+ if (r.src !== 'ask') return 'Task';
127
+ switch (ref.kind) {
128
+ case 'mention': return 'Ask';
129
+ case 'verdict': return 'Check';
130
+ case 'meeting': return ref.ms ? 'Milestone' : 'Decision';
131
+ case 'grill': case 'other': case 'owner': return 'Decision';
132
+ case 'call': return ref.call && ref.call.kind === 'update' ? 'Report' : r.job === 'Decide' ? 'Decision' : 'Task';
133
+ default: return r.job === 'Decide' ? 'Decision' : 'Task';
134
+ }
135
+ }
59
136
 
60
137
  /**
61
138
  * o: { rank: { rows, wait } (rankMove), move: home-list move rows, items: my-work-premium Today rows ({ key, id, title, ini, at, due?, overdue }),
@@ -66,7 +143,7 @@ const jobOfAsk = (r) => (r.kind === 'call' ? (r.call && r.call.kind === 'update'
66
143
  export function logModel(o = {}) {
67
144
  const now = o.now || Date.now(), today = dayKey(now);
68
145
  const marks = o.marks || {}, titleOf = typeof o.titleOf === 'function' ? o.titleOf : () => '';
69
- const out = [], seen = new Set();
146
+ const out = [], seen = new Set(), old = [];
70
147
  const work = (ini, fallback) => (ini ? titleOf(ini) || fallback || '' : fallback || '');
71
148
  const put = (r) => {
72
149
  if (!r.key || seen.has(r.key)) return;
@@ -75,8 +152,11 @@ export function logModel(o = {}) {
75
152
  if (m.dropped) return;
76
153
  if (m.until && m.until > today) return;
77
154
  const done = !!m.done || !!r.done;
78
- const drop = !done && r.carried >= CARRY_DROP && !(m.kept && between(m.kept, today) < CARRY_DROP) && r.src !== 'lab';
79
- out.push({ first: false, bullet: 'task', work: '', ini: null, ws: '', job: '', when: '', late: false, carried: 0, dates: 'mark', ...r, done, drop });
155
+ const kept = !!(m.kept && between(m.kept, today) < CARRY_DROP);
156
+ const drop = !done && r.carried >= CARRY_DROP && !kept && r.src !== 'lab';
157
+ const row = { first: false, bullet: 'task', work: '', ini: null, ws: '', job: '', when: '', late: false, carried: 0, dates: 'mark', keys: [r.key], ...r, done, drop, kept };
158
+ if (!row.type) row.type = typeOf(row);
159
+ out.push(row);
80
160
  };
81
161
  // the asks, in the rank's order: the first five, then Can wait
82
162
  const rank = o.rank || {};
@@ -87,9 +167,26 @@ export function logModel(o = {}) {
87
167
  const c = r.kind === 'call' ? r.call || {} : null;
88
168
  if (c) callIds.add(c.id);
89
169
  const carried = c ? 0 : Math.max(0, r.days || 0);
90
- const send = c && c.when ? 'goes out ' + c.when : '';
91
- put({ key: c ? 'call:' + c.id : r.key, src: 'ask', bullet: 'task', title: r.title || (c && c.name) || '', ini: r.ini || (c && c.ini) || null, ws: r.ws || '',
92
- work: work(r.ini || (c && c.ini), c ? c.sub : (r.shared || [])[0] || ''), job: jobOfAsk(r), carried, late: carried >= LATE_DAYS,
170
+ const send = c && c.when ? c.when : '';
171
+ const sp = splitAsk(r, r.ini ? titleOf(r.ini) : '');
172
+ if (r.kind === 'mention') {
173
+ const m = r.mention || {}, who = whoOf(m), ask = askText(m) || String(r.title || '');
174
+ const twin = out.find((x) => x.type === 'Ask' && !x.done && sameAsk(x.ask, ask));
175
+ if (twin) { // the same ask once: the people together, the oldest wait, every key behind it (a mark goes to each)
176
+ for (const n of who) if (!twin.who.includes(n)) twin.who.push(n);
177
+ twin.title = (twin.who.length ? names(twin.who) + ': ' : '') + twin.ask;
178
+ if (carried > twin.carried) { twin.carried = carried; twin.late = carried >= LATE_DAYS; twin.when = whenWord({ carried }, today); }
179
+ if (!seen.has(r.key)) { seen.add(r.key); twin.keys.push(r.key); twin.merged = (twin.merged || 1) + 1; }
180
+ continue;
181
+ }
182
+ // Work: the record that links the mention to its work, its initiative or the task made from it (design check of round 3, point 4)
183
+ put({ key: r.key, keys: [r.key], src: 'ask', bullet: 'task', title: (who.length ? names(who) + ': ' : /^“/.test(ask) ? 'Someone: ' : '') + ask, who, ask, type: 'Ask', ini: r.ini || m.initiative || (m.task && m.task.initiative) || null, ws: r.ws || '',
184
+ work: work(r.ini || m.initiative || (m.task && m.task.initiative), (r.shared || [])[0] || ''), job: 'Reply', carried, late: carried >= LATE_DAYS, when: whenWord({ carried }, today), ref: r,
185
+ did: didLeft(m).did, ...(m.looks ? { looks: { who: String(m.looks.who || '').trim().split(/\s+/)[0], text: m.looks.text } } : {}) });
186
+ continue;
187
+ }
188
+ put({ key: c ? 'call:' + c.id : r.key, src: 'ask', bullet: 'task', title: sp.what || r.title || (c && c.name) || '', ini: r.ini || (c && c.ini) || null, ws: r.ws || '',
189
+ work: work(r.ini || (c && c.ini), c ? c.sub : (r.shared || [])[0] || '') || sp.work, job: jobOfAsk(r), carried, late: carried >= LATE_DAYS,
93
190
  when: whenWord({ carried, send }, today), first: r.rank <= 2 || (c && c.kind === 'update' && /^(today|now)/i.test(String(c.when || ''))) || false, ref: r });
94
191
  }
95
192
  // the rest of Your move: the PM's own late tasks and the next steps (a call is in the asks already; an item is in the items)
@@ -97,6 +194,8 @@ export function logModel(o = {}) {
97
194
  if (!r || !r.id || callIds.has(r.id) || r.call || r.kind === 'item' || r.kind === 'update' || r.kind === 'session') continue;
98
195
  const due = r.due || (r.task && r.task.end) || '';
99
196
  const late = r.kind === 'task' && due && due < today ? between(due, today) : 0;
197
+ // a task whose date passed long ago and nobody touched (an old import) is not a Today row: one ✦ line in the Overview (round 3 point 12)
198
+ if (late > OLD_TASK_DAYS) { const m = marks[r.id] || {}; if (!m.dropped && !(m.kept && between(m.kept, today) < CARRY_DROP)) old.push(r.id); if (!(m.kept && between(m.kept, today) < CARRY_DROP)) continue; }
100
199
  put({ key: r.id, src: 'move', bullet: 'task', title: r.name, ini: r.ini || null, work: work(r.ini, r.sub), job: 'Do', late: late > 0, carried: late,
101
200
  when: whenWord({ late, due }, today), dates: r.kind === 'task' ? 'task' : 'mark', ref: r });
102
201
  }
@@ -108,7 +207,7 @@ export function logModel(o = {}) {
108
207
  put({ key: 'work:' + it.id, src: 'item', bullet: 'task', title: it.title, ini: it.ini || null, work: work(it.ini, ''), job: 'Do', carried, late: !!it.overdue || carried >= LATE_DAYS,
109
208
  when: whenWord({ carried, due: it.due }, today), dates: 'item', ref: it });
110
209
  }
111
- for (const d of o.drafts || []) if (d && d.id) put({ key: 'draft:' + d.id, src: 'draft', bullet: 'task', title: d.title, ini: d.ini || null, work: work(d.ini, ''), job: 'Send', ref: d });
210
+ for (const d of o.drafts || []) if (d && d.id) put({ key: 'draft:' + d.id, src: 'draft', bullet: 'task', title: d.title, ini: d.ini || null, work: work(d.ini, ''), job: 'Send', did: ['finished the draft'], ref: d });
112
211
  if (o.review && o.review.title) put({ key: 'review:' + today, src: 'review', bullet: 'task', title: o.review.title, job: 'Do', ref: o.review });
113
212
  // what the PM typed: a task, an event or a note, carried from the day it was written until it is done
114
213
  for (const e of o.own || []) {
@@ -122,15 +221,128 @@ export function logModel(o = {}) {
122
221
  for (const [k, m] of Object.entries(marks)) {
123
222
  if (!m || !m.done || seen.has(k) || !m.snap) continue;
124
223
  seen.add(k);
125
- out.push({ key: k, src: 'gone', bullet: 'task', first: false, title: m.snap.title || '', work: m.snap.work || '', ini: null, ws: '', job: m.snap.job || '', when: '', late: false, carried: 0, done: true, drop: false, dates: 'mark', ref: null });
224
+ out.push({ key: k, keys: [k], src: 'gone', bullet: 'task', type: m.snap.type || 'Task', first: false, title: m.snap.title || '', work: m.snap.work || '', ini: null, ws: '', job: m.snap.job || '', when: '', late: false, carried: 0, done: true, drop: false, dates: 'mark', ref: null });
126
225
  }
226
+ // PMOS's own note at the foot: the ✦ that expired after 14 days with no answer (move-rank's expired), said once, with no action
227
+ const ex = (rank.expired || []).length;
228
+ if (ex) out.push({ key: 'expired:' + today, keys: ['expired:' + today], src: 'note', bullet: 'note', type: 'Note', first: false, title: plural(ex, 'ask', 'asks') + ' expired after 14 days with no answer. PMOS wrote why in History',
229
+ work: '', ini: null, ws: '', job: 'Note', when: '', late: false, carried: 0, done: false, drop: false, dates: 'mark', ref: null });
127
230
  const open = out.filter((r) => !r.done), done = out.filter((r) => r.done);
128
- const rows = open.filter((r) => r.first).concat(open.filter((r) => !r.first));
129
231
  const n = (j) => open.filter((r) => r.job === j).length;
130
- const counts = { decide: n('Decide'), do: n('Do'), send: n('Send'), notes: open.filter((r) => r.bullet === 'note').length, events: open.filter((r) => r.bullet === 'event').length };
232
+ const counts = { decide: n('Decide'), do: n('Do'), reply: n('Reply'), send: n('Send'), notes: open.filter((r) => r.bullet === 'note').length, events: open.filter((r) => r.bullet === 'event').length };
131
233
  // one quiet line counts the log; a part that is zero is left out
132
- const line = [counts.decide && counts.decide + ' to decide', counts.do && counts.do + ' to do', counts.send && counts.send + ' to send'].filter(Boolean).join(' · ');
133
- return { rows: rows.concat(done), open: rows.length, done: done.length, counts, line, today };
234
+ const line = [counts.decide && counts.decide + ' to decide', counts.do && counts.do + ' to do', counts.reply && counts.reply + ' to reply', counts.send && counts.send + ' to send'].filter(Boolean).join(' · ');
235
+ const types = {}; for (const r of open) types[r.type] = (types[r.type] || 0) + 1;
236
+ const G = groupLog(open, today);
237
+ // every row says why it is on Today, in a short phrase after its title (round 3 point 12); Do first keeps the reason that ranked it
238
+ for (const r of open) if (!r.reason) { const w = whyOf(r, today); if (w) r.reason = w; }
239
+ for (const r of G.first) r.group = 'first'; for (const r of G.today) r.group = 'today'; for (const r of G.wait) r.group = 'wait';
240
+ for (const r of done) r.group = 'today';
241
+ const merged = open.reduce((k, r) => k + (r.merged ? r.merged - 1 : 0), 0);
242
+ return { rows: G.first.concat(G.today, done, G.wait), first: G.first, todayRows: G.today.concat(done), wait: G.wait, open: open.length, done: done.length, counts, types, merged, line, today, old };
243
+ }
244
+ /** PMOS HANDLED (design check of round 3, point 6): the asks the self check cleared today from proof (his reply, a closed ticket, the ask
245
+ * taken back), as the folded last group, each with Undo. answered: the Mentions answered list; o: { today, now, cleared: ids PMOS saw
246
+ * leave Today today }. A row: { id, title, proof }. An ask whose proof is from today, or that PMOS saw leave today, is one of them. */
247
+ export function handledModel(answered, o = {}) {
248
+ const today = o.today || dayKey(o.now || Date.now()), cleared = new Set(o.cleared || []);
249
+ return (answered || []).filter((m) => m && m.auto && m.proof && (cleared.has(m.id) || dayKey(Date.parse(m.proof.at || '') || 0) === today))
250
+ .map((m) => { const who = (Array.isArray(m.people) && m.people.length ? m.people : [m.who || '']).map((x) => String(x).trim().split(/\s+/)[0]).filter(Boolean);
251
+ return { id: m.id, title: (who.length ? names(who) + ': ' : '') + askTitle(m), proof: proofText(m.proof, o.now) }; });
252
+ }
253
+ /** A task late more than this many days is an old import, not a Today row (round 3 point 12). */
254
+ export const OLD_TASK_DAYS = 30;
255
+ const addDay = (d, n) => { const t = new Date(d + 'T12:00:00'); t.setDate(t.getDate() + n); return dayKey(t.getTime()); };
256
+ /** Why a row is on Today, as a short phrase (round 3 point 12): Due today, 3 days late, Waits on you 13 days, You said today, … '' when
257
+ * nothing says why. */
258
+ export function whyOf(r, today) {
259
+ const ref = r.ref || {}, c = ref.call || null;
260
+ if (r.src === 'own') return r.bullet === 'note' ? '' : r.carried ? 'You said it ' + plural(r.carried, 'day', 'days') + ' ago' : 'You said today';
261
+ if (r.src === 'move' || r.src === 'item') {
262
+ const due = ref.due || (ref.task && ref.task.end) || '';
263
+ if (due && due < today) return plural(between(due, today), 'day', 'days') + ' late';
264
+ if (due === today) return r.ref && (r.ref.ms || (r.ref.task && r.ref.task.milestone)) ? 'Milestone today' : 'Due today';
265
+ if (due && due === addDay(today, 1)) return 'Due tomorrow';
266
+ if (r.src === 'item') return r.carried ? 'You put it on today ' + plural(r.carried, 'day', 'days') + ' ago' : 'You put it on today';
267
+ return '';
268
+ }
269
+ if (r.type === 'Ask') return r.carried ? (r.who && r.who.length ? names(r.who) + ' ' + (r.who.length > 1 ? 'wait' : 'waits') + ' on you ' : 'Waits on you ') + plural(r.carried, 'day', 'days') : 'Asked today';
270
+ if (r.src === 'draft') return 'PMOS finished it, needs your look';
271
+ if (r.src === 'review') return 'Your weekly review is open';
272
+ if (r.src === 'lab') return 'PMOS found it, keep or drop';
273
+ if (c) {
274
+ if (c.kind === 'update') return c.when ? 'Goes out ' + c.when : 'Ready to send';
275
+ if (c.kind === 'session' && (c.state === 'blocked' || c.state === 'needs')) return 'A session waits on you';
276
+ return r.job === 'Decide' ? 'Decision needed' : 'Waits on you';
277
+ }
278
+ if (r.type === 'Check') return r.carried ? 'Check due ' + plural(r.carried, 'day', 'days') + ' ago' : 'Check due today';
279
+ if (r.type === 'Milestone') return 'Milestone changes to confirm';
280
+ if (r.type === 'Decision') return 'Decision needed';
281
+ return '';
282
+ }
283
+
284
+ /* ── where to start: the three groups of the log (round 2 of Today) ──
285
+ * DO FIRST, five lines at most, each with the reason PMOS picked it, read from the line itself (never guessed):
286
+ * 1 the PM marked it first · 2 a date that is late · 3 a date that is today, or a send that goes out today · 4 a session that waits on the PM
287
+ * (its work is blocked) · 5 the person who waits longest (an ask, a day or more).
288
+ * A line PMOS suggests to drop, a note and a Lab finding are never in it.
289
+ * TODAY: the rest that is new today (carried 0 days: dated today, logged today, filed today), then what was done today.
290
+ * CAN WAIT: the rest, by type (the order of TYPES) and then the oldest first; folded to one line. */
291
+ export const FIRST_CAP = 5;
292
+ function reasonOf(r, today) {
293
+ const ref = r.ref || {}, c = ref.call || null;
294
+ if (r.first && r.src === 'own') return [1, 0, 'You marked it first'];
295
+ if (r.dates !== 'mark' && r.late && r.carried > 0) return [2, r.carried, plural(r.carried, 'day', 'days') + ' late'];
296
+ const due = ref.due || (ref.task && ref.task.end) || '';
297
+ if (due && due === today) return [3, 0, 'Due today'];
298
+ if (c && c.kind === 'update' && /^(today|now)/i.test(String(c.when || ''))) return [3, 0, 'Goes out ' + c.when];
299
+ if (c && (c.state === 'blocked' || c.state === 'needs') && c.kind === 'session') return [4, 0, 'A session waits on you; its work stops until you answer'];
300
+ if (r.type === 'Ask' && r.carried >= 1) return [5, r.carried, (r.who && r.who.length ? names(r.who) : 'They') + ' ' + (r.who && r.who.length > 1 ? 'wait' : 'waits') + ' on you ' + plural(r.carried, 'day', 'days')];
301
+ return null;
302
+ }
303
+ export function groupLog(open, today) {
304
+ const cand = [];
305
+ for (const r of open) {
306
+ // an ask that looks answered (someone else may have answered it, round 3 point 10d) is not first and not today: it waits for his ✓ ✕
307
+ if (r.drop || r.looks || r.bullet === 'note' || r.src === 'lab' || r.src === 'note' || (r.type === 'Ask' && !(r.who && r.who.length))) continue;
308
+ const w = reasonOf(r, today); if (w) cand.push({ r, k: w[0], d: w[1], why: w[2] });
309
+ }
310
+ cand.sort((a, b) => a.k - b.k || b.d - a.d);
311
+ const first = cand.slice(0, FIRST_CAP).map((x) => { x.r.reason = x.why; return x.r; });
312
+ const inFirst = new Set(first);
313
+ const rest = open.filter((r) => !inFirst.has(r));
314
+ // an ask with no person behind it can wait: nobody waits on the answer
315
+ const todayRows = rest.filter((r) => !r.drop && !r.looks && r.bullet !== 'note' && r.src !== 'note' && (r.carried || 0) === 0 && !r.late && !(r.type === 'Ask' && !(r.who && r.who.length)));
316
+ const inToday = new Set(todayRows);
317
+ const order = (t) => { const i = TYPES.indexOf(t); return i < 0 ? TYPES.length : i; };
318
+ const wait = rest.filter((r) => !inToday.has(r)).sort((a, b) => order(a.type) - order(b.type) || (b.carried || 0) - (a.carried || 0));
319
+ return { first, today: todayRows, wait };
320
+ }
321
+
322
+ /** The Overview at the top of Today (written by PMOS, ✦): one or two sentences, the suggestions with ✓ ✕, and the type chips.
323
+ * Proven-only: the sentence names only the lines Do first picked, with their reasons; with none, it says only the counts and the free time.
324
+ * L: logModel(), A: agendaModel(). → { said, suggest: [{ key, text, act, keys }], chips: [{ type, n }], today: the lines for today } */
325
+ export const OLD_CHECK_DAYS = 60;
326
+ const clipT = (t, n) => { t = String(t || ''); return t.length > n ? t.slice(0, n - 1).replace(/\s+\S*$/, '') + '…' : t; };
327
+ export function overviewModel(L, A = {}) {
328
+ const parts = [];
329
+ // the lines for today: Do first and what waits today (not done, not a note); the rail's number on every place
330
+ const forToday = (L.first || []).length + (L.todayRows || []).filter((r) => !r.done && r.type !== 'Note').length;
331
+ if (L.open) parts.push(plural(L.open, 'line is', 'lines are') + ' open' + (forToday && forToday < L.open ? ', ' + forToday + ' of them for today.' : '.'));
332
+ // an ask is said by who asked ("Chen’s ask, 22 days"); another line by its title, clipped, with its reason
333
+ const said = new Set();
334
+ const top = (L.first || []).slice(0, 3).map((r) => (r.type === 'Ask' && r.who && r.who.length && !said.has(names(r.who)) && said.add(names(r.who)) ? names(r.who) + '’s ask (' + plural(r.carried, 'day', 'days') + ')'
335
+ : clipT(r.title, 48) + ' (' + r.reason.replace(/^(Late|Due|Goes|You|A)\b/, (w) => w.toLowerCase()) + ')'));
336
+ if (top.length) parts.push('Start with ' + (top.length === 1 ? top[0] : top.slice(0, -1).join(', ') + ' and ' + top[top.length - 1]) + '.');
337
+ const freeW = A.free ? 'You have ' + durWord(A.free) + ' free' : '';
338
+ const nextW = A.next ? (A.nextFirst ? 'your first meeting is at ' : 'your next meeting is at ') + A.next : '';
339
+ if (freeW || nextW) parts.push(cap1([freeW, nextW].filter(Boolean).join('; ')) + '.');
340
+ const suggest = [];
341
+ const old = (L.rows || []).filter((r) => !r.done && r.type === 'Check' && !r.kept && (r.carried || 0) > OLD_CHECK_DAYS);
342
+ if ((L.old || []).length) suggest.push({ key: 'old-tasks', text: plural(L.old.length, 'old task has', 'old tasks have') + ' passed dates by more than ' + OLD_TASK_DAYS + ' days, so they are not on Today. Clear them from Today', act: 'drop', keys: L.old });
343
+ if (old.length) suggest.push({ key: 'drop-old-checks', text: 'Drop the ' + plural(old.length, 'check', 'checks') + ' due more than ' + OLD_CHECK_DAYS + ' days ago', act: 'drop', keys: old.map((r) => r.key) });
344
+ const chips = TYPES.filter((t) => (L.types || {})[t]).map((t) => ({ type: t, n: L.types[t] }));
345
+ return { said: parts.join(' '), suggest, chips, today: forToday };
134
346
  }
135
347
 
136
348
  /* ── today's agenda ── */
@@ -163,14 +375,59 @@ export function agendaModel(o = {}) {
163
375
  const [h, mi] = e.time.split(':').map(Number); const a = new Date(now); a.setHours(h, mi, 0, 0);
164
376
  items.push({ key: e.key, kind: 'own', title: e.text, sub: e.time + ' · your event', a: a.getTime(), b: a.getTime() + 30 * 60000, ini: null, ref: e });
165
377
  }
378
+ // the reports that go out today, at their time (GET /api/events-place: a schedule that fires today)
379
+ for (const r of o.reports || []) {
380
+ if (!r || !r.time || !/^\d{2}:\d{2}$/.test(r.time)) continue;
381
+ const [h, mi] = r.time.split(':').map(Number); const a = new Date(now); a.setHours(h, mi, 0, 0);
382
+ items.push({ key: 'r:' + (r.key || r.title), kind: 'report', title: r.title || 'A report', sub: r.time + ' · the report goes out', a: a.getTime(), b: a.getTime() + 30 * 60000, ini: null, ref: r });
383
+ }
166
384
  items.sort((x, y) => x.a - y.a);
385
+ // focus time: the first open row of the log, in the first free stretch of 30 minutes or more from now until 18:00 (a dashed box)
386
+ const F = o.focus;
387
+ if (F && F.key && F.title) {
388
+ const end = new Date(now); end.setHours(18, 0, 0, 0);
389
+ const d8 = new Date(now); d8.setHours(8, 0, 0, 0); // focus time is in the working day: from now, never before 08:00
390
+ let at = Math.max(Math.ceil(now / (5 * 60000)) * 5 * 60000, d8.getTime()), got = null;
391
+ for (const x of items.filter((y) => y.kind !== 'report')) {
392
+ if (x.b <= at) continue;
393
+ if (x.a - at >= 30 * 60000) { got = [at, Math.min(x.a, end.getTime())]; break; }
394
+ at = Math.max(at, x.b);
395
+ }
396
+ if (!got && end.getTime() - at >= 30 * 60000) got = [at, end.getTime()];
397
+ if (got && got[1] - got[0] >= 30 * 60000) {
398
+ items.push({ key: 'f:' + F.key, kind: 'focus', title: F.title, sub: hm(got[0]) + ' to ' + hm(got[1]) + ' · focus time PMOS holds for this call', a: got[0], b: got[1], ini: null, ref: F, row: F.key });
399
+ items.sort((x, y) => x.a - y.a);
400
+ }
401
+ }
167
402
  const first = items.length ? new Date(items[0].a).getHours() : 8, last = items.length ? Math.max(...items.map((x) => new Date(x.b - 1).getHours() + 1)) : 18;
168
403
  const from = Math.min(8, first), to = Math.max(18, Math.min(24, last));
169
404
  const base = new Date(now); base.setHours(from, 0, 0, 0);
170
405
  const H = 60 * 60000;
171
406
  for (const x of items) { x.top = (x.a - base.getTime()) / H; x.h = Math.max(0.5, (x.b - x.a) / H); x.past = x.b <= now; x.nowOn = x.a <= now && now < x.b; }
407
+ // side by side, never on top of each other: items whose boxes meet share the width (a box is at least 40 px, about MIN_BOX minutes, tall, so a short
408
+ // meeting is never cut by the next one); each gets its column and the number of columns of its cluster
409
+ const MIN_BOX = 40 * 60000, endOf = (x) => Math.max(x.b, x.a + MIN_BOX);
410
+ let cluster = [], cEnd = -Infinity;
411
+ const close = () => { const n = Math.max(1, ...cluster.map((x) => x.col + 1)); for (const x of cluster) x.cols = n; cluster = []; };
412
+ for (const x of items) {
413
+ if (x.a >= cEnd) { close(); cEnd = -Infinity; }
414
+ const used = new Set(cluster.filter((y) => endOf(y) > x.a).map((y) => y.col));
415
+ let c = 0; while (used.has(c)) c++;
416
+ x.col = c; cluster.push(x); cEnd = Math.max(cEnd, endOf(x));
417
+ }
418
+ close();
172
419
  const t = (now - base.getTime()) / H;
173
- const d = new Date(now), free = freeMinutes(items, now);
420
+ const d = new Date(now), free = freeMinutes(items.filter((x) => x.kind !== 'focus' && x.kind !== 'report'), now);
174
421
  const sub = DOW[d.getDay()] + ' ' + d.getDate() + ' ' + MON[d.getMonth()] + (free ? ' · ' + durWord(free) + ' free' : '');
175
- return { items, from, to, now: t >= 0 && t <= to - from ? t : null, sub, empty: !items.length };
422
+ const meets = items.filter((x) => x.kind === 'meeting' || x.kind === 'own');
423
+ const nx = meets.find((x) => x.a >= now);
424
+ return { items, from, to, now: t >= 0 && t <= to - from ? t : null, sub, empty: !items.length, free, next: nx ? hm(nx.a) : '', nextFirst: !!nx && !meets.some((x) => x.a < now) };
425
+ }
426
+
427
+ const DOW_LONG = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
428
+ const MON_LONG = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
429
+ /** The page head: "Wednesday 18 November · 16:23" and the greeting of the hour. */
430
+ export function headModel(now = Date.now()) {
431
+ const d = new Date(now), h = d.getHours();
432
+ return { when: DOW_LONG[d.getDay()] + ' ' + d.getDate() + ' ' + MON_LONG[d.getMonth()] + ' · ' + hm(now), hello: h < 5 || h >= 18 ? 'Good evening' : h < 12 ? 'Good morning' : 'Good afternoon' };
176
433
  }
@@ -7,7 +7,8 @@
7
7
  body.cz-today #hmDesk > .hm-list, body.cz-today #hmDesk > .hm-chat, body.cz-today #hmDesk > .cz-pn-div, body.cz-today #hmUnfold, body.cz-today .hm-top { display: none !important; }
8
8
  /* the white page panel: the only big container, beside the rail (as the Board's) */
9
9
  body.cz-home.cz-today #hmDesk { display: block; overflow: auto; top: 16px; right: 16px; bottom: 16px; left: var(--cz-railx, 16px); padding: 28px 32px 32px; background: var(--cz-card); border-radius: 28px; box-shadow: var(--cz-lift); }
10
- body.cz-today .td-page { display: block; max-width: 1360px; margin: 0 auto; }
10
+ /* the page starts at the left edge of the panel, like Work and Library; on a wide screen the log stops at about 1100 px */
11
+ body.cz-today .td-page { display: block; margin: 0; }
11
12
  /* a thing that still opens beside the page (the PM's "open work beside the page", a deep link) slides over Today on the right:
12
13
  the one slide-over of the panel rule, so Today is never squeezed or covered by a column it does not own */
13
14
  body.cz-today #hmDesk > .hm-vw { position: fixed; top: 16px; right: 16px; bottom: 16px; z-index: 40; border-radius: 24px; box-shadow: var(--cz-lift); background: var(--cz-card); }
@@ -15,14 +16,36 @@
15
16
  }
16
17
  .td-page[hidden] { display: none !important; }
17
18
 
18
- .td { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; font-family: var(--cz-sans); color: var(--cz-ink); }
19
+ .td { display: grid; grid-template-columns: minmax(0, 1100px) 320px; justify-content: start; gap: 28px; align-items: start; font-family: var(--cz-sans); color: var(--cz-ink); }
19
20
  @media (max-width: 1100px) { .td { grid-template-columns: minmax(0, 1fr); } }
21
+ .td-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
22
+
23
+ /* the Overview: one grey box, written by PMOS (✦), as the popup's Overview */
24
+ .td-ov { border-radius: 20px; background: var(--cz-well); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
25
+ .td-ov h2 { font-size: var(--fs-label); font-weight: var(--fw-strong); letter-spacing: .06em; text-transform: uppercase; color: var(--cz-ink3); }
26
+ .td-ov h2 b { color: var(--cz-blueink); }
27
+ .td-ov p { margin: 0; font-size: var(--fs-row); line-height: var(--lh-row); color: var(--cz-ink); max-width: 860px; }
28
+ .td-ovs { display: flex; align-items: center; gap: 8px; font-size: var(--fs-meta); color: var(--cz-ink2); }
29
+ .td-ovs b { color: var(--cz-blueink); font-weight: var(--fw-strong); }
30
+ .td-ovs .td-ib { width: 26px; height: 26px; border-radius: 999px; background: var(--cz-card); box-shadow: inset 0 0 0 1px var(--cz-hair); }
31
+ .td-chips { display: flex; flex-wrap: wrap; gap: 6px; }
32
+ .td-chip { border: 0; border-radius: 999px; padding: 4px 11px; background: var(--cz-card); box-shadow: inset 0 0 0 1px var(--cz-hair); font: inherit; font-size: var(--fs-meta); color: var(--cz-ink2); cursor: pointer; }
33
+ .td-chip b { font-weight: var(--fw-strong); color: var(--cz-ink); margin-left: 2px; }
34
+ .td-chip.on { background: var(--cz-ink); color: var(--cz-card); box-shadow: none; }
35
+ .td-chip.on b { color: var(--cz-card); }
36
+ .td-chip:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
20
37
  .td h2 { margin: 0; font-size: var(--fs-section); font-weight: var(--fw-strong); line-height: var(--lh-section); color: var(--cz-ink); }
21
38
  .td-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
22
39
  .td button { font-family: var(--cz-sans); }
23
40
 
24
- /* the title and its one quiet line */
25
- .td-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
41
+ /* the page head: the day and the time, small, then the greeting */
42
+ .td-top { display: flex; flex-direction: column; gap: 2px; margin: 0 0 18px; font-family: var(--cz-sans); }
43
+ .td-when { font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink3); letter-spacing: .04em; text-transform: uppercase; }
44
+ .td-top h1 { margin: 0; font-size: var(--fs-display); font-weight: var(--fw-strong); line-height: 1.2; color: var(--cz-ink); }
45
+
46
+ /* the log's title line: "Today's log · 12" at the left, the jobs at the right */
47
+ .td-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px; }
48
+ .td-h h2 { font-size: var(--fs-label); font-weight: var(--fw-strong); letter-spacing: .06em; text-transform: uppercase; color: var(--cz-ink3); margin-right: auto; }
26
49
  .td-sum { font-size: var(--fs-meta); color: var(--cz-ink3); }
27
50
 
28
51
  /* the capture line */
@@ -38,7 +61,9 @@
38
61
 
39
62
  /* the log: one card, one row height, one text size */
40
63
  .td-tt { border-radius: 16px; box-shadow: inset 0 0 0 1px var(--cz-hair); background: var(--cz-card); overflow: hidden; }
41
- .td-r { display: grid; grid-template-columns: 18px 20px minmax(0, 1fr) minmax(0, 160px) 56px 128px 92px; align-items: center; column-gap: 8px; min-height: 44px; padding: 0 12px; font-size: var(--fs-row); line-height: var(--lh-row); }
64
+ .td-r { display: grid; grid-template-columns: 18px 20px minmax(0, 1fr) 100px minmax(0, 150px) 52px 120px 92px; align-items: center; column-gap: 8px; min-height: 44px; padding: 0 12px; font-size: var(--fs-row); line-height: var(--lh-row); }
65
+ .td-tt.nowork .td-r { grid-template-columns: 18px 20px minmax(0, 1fr) 100px 52px 120px 92px; }
66
+ .td-tt.nowork .td-w, .td-tt.nowork .td-wh { display: none; }
42
67
  .td-r + .td-r { box-shadow: inset 0 1px 0 var(--cz-hair); }
43
68
  .td-hd { min-height: 36px; background: var(--cz-well); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink3); }
44
69
  .td-p b { color: var(--cz-late); font-weight: var(--fw-strong); display: block; text-align: center; }
@@ -49,6 +74,17 @@
49
74
  button.td-t { cursor: pointer; }
50
75
  button.td-t:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; border-radius: 4px; }
51
76
  .td-r.note .td-t { font-weight: var(--fw-regular); color: var(--cz-ink2); }
77
+ /* the group rows (Do first, Today, Can wait), grey as Library's */
78
+ .td-gr { display: flex; align-items: center; min-height: 34px; padding: 0 12px; background: var(--cz-well); box-shadow: inset 0 1px 0 var(--cz-hair); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink2); }
79
+ .td-gr em { font-style: normal; font-weight: var(--fw-regular); color: var(--cz-ink3); margin-left: 6px; }
80
+ .td-fold { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
81
+ .td-fold svg { color: var(--cz-ink3); }
82
+ .td-fold[aria-expanded="true"] svg { transform: rotate(180deg); }
83
+ .td-fold:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; border-radius: 4px; }
84
+ .td-rs { display: block; font-size: var(--fs-meta); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
85
+ .td-r.why { padding-top: 6px; padding-bottom: 6px; }
86
+ .td-ty { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--cz-ink2); white-space: nowrap; }
87
+ .td-ty svg { color: var(--cz-ink3); flex: none; }
52
88
  .td-w { font-size: var(--fs-meta); color: var(--cz-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
53
89
  .td-k { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink2); }
54
90
  .td-d { font-size: var(--fs-meta); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@@ -71,30 +107,53 @@ button.td-t:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2
71
107
  .td-sg .td-ib { width: 26px; height: 26px; border-radius: 999px; background: var(--cz-card); box-shadow: inset 0 0 0 1px var(--cz-hair); }
72
108
  .td-sg.lab { color: var(--cz-ink3); }
73
109
  .td-none { margin: 6px 2px; font-size: var(--fs-row); color: var(--cz-ink3); }
74
- .td-more { margin-top: 10px; border: 0; background: none; padding: 4px 2px; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-blueink); cursor: pointer; }
75
110
 
76
- /* today's agenda: one grey box */
77
- .td-ag { border-radius: 20px; background: var(--cz-well); padding: 16px 16px 14px; box-sizing: border-box; }
78
- .td-agh { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; }
111
+ /* today's agenda: one grey box, as tall as the log; the day by hours fills it (a line every hour, a label every two) */
112
+ .td-ag { border-radius: 20px; background: var(--cz-well); padding: 16px 16px 14px; box-sizing: border-box; display: flex; flex-direction: column; }
113
+ .td-agh { display: flex; align-items: baseline; gap: 8px; margin: 0 0 14px; }
114
+ .td-agh h2 { font-size: var(--fs-panel); }
79
115
  .td-agh small { font-size: var(--fs-meta); color: var(--cz-ink3); margin-right: auto; }
80
- .td-agh .td-ib { align-self: center; }
81
- .td-tl { position: relative; height: calc(var(--rows) * var(--px)); margin: 6px 0 4px 46px;
82
- background-image: repeating-linear-gradient(to bottom, var(--cz-hair) 0, var(--cz-hair) 1px, transparent 1px, transparent var(--px)); }
83
- .td-hr { position: absolute; left: -46px; top: var(--y); transform: translateY(-50%); font-size: var(--fs-badge); color: var(--cz-ink3); }
84
- .td-ev { position: absolute; left: 4px; right: 0; top: var(--y); height: var(--h); box-sizing: border-box; overflow: hidden; border: 0; border-radius: 10px; padding: 5px 9px; text-align: left;
116
+ .td-evl { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-blueink); text-decoration: none; }
117
+ .td-evl:hover { text-decoration: underline; }
118
+ .td-evl:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; border-radius: 4px; }
119
+ .td-tl { position: relative; flex: none; height: calc(var(--rows) * 64px); margin: 8px 0 8px 46px;
120
+ background-image: linear-gradient(to bottom, var(--cz-hair) 0, var(--cz-hair) 1px, transparent 1px); background-size: 100% calc(100% / var(--rows)); background-repeat: repeat-y; box-shadow: inset 0 -1px 0 var(--cz-hair); }
121
+ .td-hr { position: absolute; left: -46px; top: var(--t); transform: translateY(-50%); font-size: var(--fs-badge); color: var(--cz-ink3); }
122
+ .td-ev { position: absolute; left: calc(4px + (100% - 4px) * var(--c, 0) / var(--n, 1)); width: calc((100% - 4px) / var(--n, 1) - 3px); top: var(--t); height: max(30px, calc(var(--h) - 3px)); box-sizing: border-box; overflow: hidden; border: 0; border-radius: 10px; padding: 6px 9px; text-align: left;
85
123
  background: var(--cz-card); box-shadow: inset 0 0 0 1px var(--cz-hair); font: inherit; color: var(--cz-ink); display: flex; flex-direction: column; gap: 1px; }
124
+ .td-ev.focus { background: var(--cz-card); box-shadow: none; border: 1.5px dashed var(--cz-blue); }
125
+ .td-ev.report { box-shadow: inset 0 0 0 1px var(--cz-hair); }
126
+ .td-dk, .td-dm { display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 2px; vertical-align: middle; }
127
+ .td-dk { border-radius: 2px; transform: rotate(45deg); background: var(--cz-c-6b4fa3); }
128
+ .td-dm { border-radius: 50%; background: var(--cz-blue); }
129
+ .td-ev small { padding-left: 18px; }
130
+ .td-ev.own small, .td-ev.short small { padding-left: 0; }
86
131
  button.td-ev { cursor: pointer; }
87
132
  button.td-ev:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
88
133
  .td-ev b { font-size: var(--fs-meta); font-weight: var(--fw-strong); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
89
134
  .td-ev small { font-size: var(--fs-badge); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
90
135
  .td-ev.short { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 0; padding-bottom: 0; }
91
136
  .td-ev.short small { flex: none; }
137
+ .td-ev.side { height: max(40px, calc(var(--h) - 3px)); padding: 4px 8px; justify-content: flex-start; }
138
+ .td-ev b, .td-ev small { flex: none; }
139
+ .td-ev.short:not(.side) b { flex: 0 1 auto; min-width: 0; }
140
+ .td-ev.side .td-dm, .td-ev.side .td-dk { display: none; }
141
+ .td-ev.side.short { flex-direction: column; justify-content: center; align-items: stretch; gap: 0; }
142
+ .td-ev.side small { padding-left: 0; }
92
143
  .td-ev.own { background: none; box-shadow: inset 0 0 0 1.5px var(--cz-hair); }
93
144
  .td-ev.on { box-shadow: inset 0 0 0 1.5px var(--cz-blue); }
94
145
  .td-ev.past b { color: var(--cz-ink3); }
95
- .td-now { position: absolute; left: -6px; right: 0; top: var(--y); height: 2px; background: var(--cz-late); }
146
+ .td-now { position: absolute; left: -6px; right: 0; top: var(--t); height: 2px; background: var(--cz-late); }
96
147
  .td-now::before { content: ''; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--cz-late); }
97
148
 
98
149
  /* the date chooser beside a row (set a date) */
99
150
  .td-dp { position: fixed; z-index: 80; display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 14px; background: var(--cz-card); box-shadow: var(--cz-lift); }
100
151
  .td-dp input { font: inherit; font-size: var(--fs-row); color: var(--cz-ink); background: var(--cz-well); border: 0; border-radius: 10px; padding: 6px 8px; color-scheme: light dark; }
152
+ /* round 3 point 13: what PMOS did on a row, a small ✦ with the count before the reason */
153
+ .td-did { display: inline-flex; align-items: center; gap: 2px; margin-right: 8px; color: var(--cz-blueink); font-weight: var(--fw-strong); }
154
+ .td-did b { font-weight: var(--fw-regular); }
155
+
156
+ /* PMOS handled · N (design check of round 3): the asks the self check cleared today, each with Undo */
157
+ .td-undo { border: 0; background: none; padding: 4px 6px; font: inherit; font-size: var(--fs-meta); color: var(--cz-blueink); cursor: pointer; }
158
+ .td-undo:hover, .td-undo:focus-visible { text-decoration: underline; }
159
+ .td-r.hd .td-rs { text-decoration: none; }