create-pmos 0.645.0 → 0.646.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.645.0",
3
+ "version": "0.646.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -33,6 +33,19 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.646.0",
38
+ "at": "2026-11-20T03:32:31.987Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1428,
43
+ "t": "Today is built from the design system's blocks",
44
+ "s": "Today is built from the design system's blocks",
45
+ "k": "new"
46
+ }
47
+ ]
48
+ },
36
49
  {
37
50
  "v": "0.645.0",
38
51
  "at": "2026-11-20T02:59:30.947Z",
@@ -303,19 +316,6 @@
303
316
  "k": "new"
304
317
  }
305
318
  ]
306
- },
307
- {
308
- "v": "0.619.0",
309
- "at": "2026-11-19T04:21:53.302Z",
310
- "f": 4,
311
- "prs": [
312
- {
313
- "n": 1401,
314
- "t": "A task on Today opens the small task popup on top of its initiative",
315
- "s": "A task on Today opens the small task popup on top of its initiative",
316
- "k": "new"
317
- }
318
- ]
319
319
  }
320
320
  ]
321
321
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@6d0ce06a
1
+ kernel-source: pmos@206e0237
2
2
  assembled: 2026-11-20
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-11-20T02:59:28Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-20T03:32:28Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-11-20T02:59:28Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-20T03:32:28Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-11-20T02:59:28Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-20T03:32:28Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "v": "0.646.0",
4
+ "at": "2026-11-20T03:32:31.987Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1428,
9
+ "t": "Today is built from the design system's blocks",
10
+ "s": "Today is built from the design system's blocks",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
2
15
  {
3
16
  "v": "0.645.0",
4
17
  "at": "2026-11-20T02:59:30.947Z",
@@ -43,27 +43,27 @@ On a phone, **⋯** at the top right of every screen opens the menu: Today, Work
43
43
 
44
44
  ## Today
45
45
 
46
- On a computer, Today is one page that starts at the left of the panel. At the top are the day and the time, and a greeting. Under them, the Overview and Today's log take the left (at most about 1100 px wide). Today's agenda is in one grey box on the right, about 320 px wide. Today is drawn from the PMOS design system: the Overview and the log are white cards with a thin line, and the agenda is a grey box. Today reads every product. Home's old address on a computer (`/premium.html`, and a link that names one item) opens Today.
46
+ On a computer, Today is one page that starts at the left of the panel. At the top are the day and the time, and a greeting. Under them, the Overview and Today's log take the left (at most about 1100 px wide). Today's agenda is in one grey box on the right, about 340 px wide, with the meeting you recorded under it. Today is built from the parts of the PMOS design system: the Overview is a summary card, the log a list card, and the agenda a timeline. Today reads every product. Home's old address on a computer (`/premium.html`, and a link that names one item) opens Today.
47
47
 
48
- The **Overview** is one card written by PMOS (✦). It says how many lines are open, the ones to start with and why, how much free time today has and when your first or next meeting is. It names only what the lines themselves say. Under it, PMOS suggests what to clean up with ✓ ✕, only when it is true, for example "Drop the 2 checks carried more than 60 days". A row of chips counts each type (All, Asks, Decisions, Checks, Milestones, Tasks, Reports, Notes). Press a chip to show only that type; press it again to show all. A type with no lines has no chip.
48
+ The **Overview** is one card written by PMOS (✦). It says how many lines are open, the ones to start with and why, how much free time today has and when your first or next meeting is. It names only what the lines themselves say. The names of the lines to start with are links: press one to open it. Under it, PMOS suggests what to clean up with ✓ ✕, only when it is true, for example "Drop the 2 checks carried more than 60 days".
49
49
 
50
- The log is a table, kept the Bullet Journal way, in three groups:
50
+ The log is a list, kept the Bullet Journal way. Tabs at the top right count the lines by job: **All**, **Reply**, **Do**, **Decide** and **Send**. Press a tab to show only that job; **All** shows all again. A job with no lines has no tab. The lines are in three groups:
51
51
 
52
- - **Do first**: five lines at most, each with the reason PMOS picked it under its title. PMOS picks what you marked first, a date that is late, a date that is today or a send that goes out today, a session that waits on you, and the person who waits longest. A line that PMOS suggests to drop is never in Do first.
52
+ - **Do first**: five lines at most, each with the reason PMOS picked it under its title. Its first line is lit: start there. PMOS picks what you marked first, a date that is late, a date that is today or a send that goes out today, a session that waits on you, and the person who waits longest. A line that PMOS suggests to drop is never in Do first.
53
53
  - **Today**: what is new today (dated today, logged today or asked today), then what you did today.
54
- - **Can wait**: the rest, folded to one line ("66 more · the oldest carried 23 days"). Press it to see them, by type and then the oldest first.
54
+ - **Later**: the rest, folded to one line ("66 can wait · the oldest waits 23 days"). Press it to see them, by type and then the oldest first.
55
55
 
56
- Each row is one short line:
56
+ Each row has two lines:
57
57
 
58
- - The bullet says what it is: **•** a task, **○** an event, **–** a note, **×** done, **✦** something PMOS suggests. **!** marks what you marked first.
59
- - **What** (the thing to do), **Type**, **Work** (the initiative or program it belongs to; the column is left out when no line names one), **Job** and **When**. The type is **Ask** (a person asked you; the line starts with who, then the ask; an ask with no person behind it can wait), **Decision**, **Check** ("did it work?"), **Milestone**, **Task**, **Report** or **Note**. The same ask from the same people shows once, with every name ("Suhas and Betty: …"). One thing shows once, however it reached Today: an item of the morning brief that you put on today, a Jira ticket in your tasks, and a brief item that says what a person asked you are each one row. Done, Move to tomorrow and Set a date act on the whole row. A Jira ticket's Work is its key, for example "CONHUB-233". **Decide** is a call you make up your mind on, **Do** is something you do yourself ("Draft the PRD, or let PMOS draft it"), **Reply** is an answer a person waits for, and **Send** is a thing of yours that is ready to go out. PMOS's own note, such as the asks that expired with no answer, closes the log with the Job **Note**.
58
+ - An icon says what it is: a speech bubble for an **Ask**, a diamond for a **Decision**, a tick for a **Check**, a flag for a **Milestone**, a square for a **Task**, a page for a **Report**, a dash for a **Note**, a circle for your own event, ✦ for something PMOS suggests, and a tick in grey for done. **First** marks what you marked first.
59
+ - The title, then a short line under it: the work it belongs to and its date ("for Tender new CIAM · due 21 Oct"), or who waits ("Suhas waits on you"). A red badge at the right says how late it is ("29 days late") or how long a person waits ("28 days"). The type is **Ask** (a person asked you; the line starts with who, then the ask; an ask with no person behind it can wait), **Decision**, **Check** ("did it work?"), **Milestone**, **Task**, **Report** or **Note**. The same ask from the same people shows once, with every name ("Suhas and Betty: …"). One thing shows once, however it reached Today: an item of the morning brief that you put on today, a Jira ticket in your tasks, and a brief item that says what a person asked you are each one row. Done, Move to tomorrow and Set a date act on the whole row. A Jira ticket's Work is its key, for example "CONHUB-233". **Decide** is a call you make up your mind on, **Do** is something you do yourself ("Draft the PRD, or let PMOS draft it"), **Reply** is an answer a person waits for, and **Send** is a thing of yours that is ready to go out. PMOS's own note, such as the asks that expired with no answer, closes the log with the Job **Note**.
60
60
  - The rows are the calls only you can make, your late tasks, the next steps, your own items for today, the drafts to send, and what you typed yourself.
61
- - The title line counts the log ("Today's log · 12"), with the jobs at the right, for example "5 to decide · 6 to do · 15 to reply · 1 to send".
61
+ - The tabs count the log, so there is no separate count line.
62
62
 
63
63
  To use the log:
64
64
 
65
65
  1. Type a task, an event or a note in the first line and press Enter. Start with **o** for an event (add a time, such as 14:00, to put it on the agenda), with **-** for a note, and with **!** for what comes first. Enter only adds the row. It opens nothing and starts no session.
66
- 2. Point at a row to see its three icons: **Done**, **Move to tomorrow** and **Set a date**. Done gives the row the × bullet. Each change shows Undo for a moment.
66
+ 2. Point at a row to see its icons. The first is its job: **Reply**, **Decide** or **Send** opens the item where you do it, and **Done** marks it done. Then come **Move to tomorrow** and **Set a date**. A done row turns grey. Each change shows Undo for a moment.
67
67
  3. Press a row, or an event in the agenda, to open that one item in the popup. An ask opens that one mention, not the list of mentions. A task opens its initiative at that task, with the task's row lit, and the task itself in a small popup on top; Esc closes only the small popup. A check ("did it work?") opens its initiative. With the popup open, press **j** or **k** (or **↓** and **↑** in an ask) to open the next or the previous row in its place.
68
68
 
69
69
  When the same step waits on several initiatives (for example "Draft the PRD" on six of them), it is one row, "6 initiatives have no PRD", with the ✦ line "PMOS drafts them for you to read": ✓ starts one draft per initiative, ✕ hides the line for a month. Press the row to list the initiatives. A title never shows an id, and Work names a product by its name.
@@ -74,11 +74,13 @@ Every row says why it is on Today, after its title: "Due today", "3 days late",
74
74
 
75
75
  **PMOS checks that an ask still waits on you.** On every read, when Today opens and again when you open the ask, PMOS checks the source. When you replied after the ask, the ticket it points to is closed, or the person took the ask back, the ask leaves Today by itself and a message says how ("You replied Tue 17 Nov: …"), with Undo. A new message from the person after your reply brings it back. An ask with no move for 21 days asks "Still needed?" once.
76
76
 
77
- What you do not finish is carried to the next day, and the When column says for how long ("carried 16 days"). When a row is carried for 30 days, PMOS suggests to drop it from your log. ✓ drops it, ✕ keeps it, and PMOS does not ask again for a month. A task's own date changes only when you set a date on it.
77
+ What you do not finish is carried to the next day, and the badge says for how long. When a row is carried for 30 days, PMOS suggests to drop it from your log. ✓ drops it, ✕ keeps it, and PMOS does not ask again for a month. A task's own date changes only when you set a date on it.
78
78
 
79
79
  Findings that fit no initiative (the Lab) are ✦ rows in the log. ✓ keeps one and starts an initiative from it. ✕ drops it.
80
80
 
81
- The agenda is the day by hours, from 08:00 to 18:00, with a red line at the time now. Meetings that overlap sit side by side, so none covers or cuts another. The box is as tall as its hours. It shows your meetings, the reports that go out today at their time, your own events, and focus time: the free time from now until the next meeting, held for the first row of your log, in a dashed box. Focus time is only ever a gap before a meeting: it never runs past the last one. Press the focus time to open that row. A day with no meeting or event shows one quiet line instead of the hours, for example "No events today · 9 h free". **Events** at the top right opens the Events page. "PMOS did" is not on Today; it moves to Routine.
81
+ The agenda lists the day's events in time order, each with its start time, and a red line with the time now between the past and the next ones. Past events are dashed. The next event says how soon it starts ("in 20 min"). A meeting with a call has a play button: one press joins the call and starts the recording. It shows your meetings, the reports that go out today at their time, your own events, and focus time: the free time from now until the next meeting, held for the first row of your log, in a dashed box. Focus time is only ever a gap before a meeting: it never runs past the last one. Press the focus time to open that row. A day with no meeting or event shows one quiet line, for example "No events today · 9 h free". **Events** at the top right opens the Events page. "PMOS did" is not on Today; it moves to Routine.
82
+
83
+ Under the agenda, after a meeting PMOS recorded and filed in the last 3 hours, a card says what came of it and where PMOS filed it. ✓ keeps it there and the card goes. ✕ takes the recording out of that work, with Undo.
82
84
 
83
85
  On a phone, Today is one page with no boxes: the overview, the next event with **Record**, and the log. Swipe a row to the right to do or accept it, and to the left to drop it or put it off. Each swipe has **Undo**.
84
86
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.645.0",
3
+ "version": "0.646.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.645.0",
9
+ "version": "0.646.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.645.0",
3
+ "version": "0.646.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -22,7 +22,7 @@ import { wireSwipe } from './cozy-phone-swipe.js'; // the phone: rows and the
22
22
 
23
23
  const ASK_SEND = new Set(['session']);
24
24
  export function mountToday(ctx) {
25
- const X = { log: { entries: [], marks: {} }, html: '', model: null, agenda: null, read: false, busy: new Set(), type: '', open: false, hide: new Set(), sopen: new Set(), unfiled: new Set() };
25
+ const X = { log: { entries: [], marks: {} }, html: '', model: null, agenda: null, read: false, busy: new Set(), type: '', job: '', open: false, hide: new Set(), sopen: new Set(), unfiled: new Set(), filedOk: new Set() };
26
26
  const el = document.getElementById('tdPage');
27
27
  // a desk and a phone both draw Today here; a phone draws its own one column (TP.phonePageHtml, board Ph2_today) while no conversation is
28
28
  // open over it (body.hm-plist: home-app.js's phone list state). On a phone Home's list is not drawn on today.html (cozy-today-page.css).
@@ -101,7 +101,9 @@ export function mountToday(ctx) {
101
101
  return;
102
102
  }
103
103
  el.classList.remove('tdp');
104
- const html = TP.pageHtml(L, A, { draft, overview: O, type: X.type, open: X.open || !!X.type, handled: X.type && X.type !== 'Ask' ? [] : handled(), hopen: X.hopen, sopen: [...X.sopen] });
104
+ // the log's Tabs filter by job (All, Reply, Do, Decide, Send); a tab whose count went to zero goes back to All
105
+ if (X.job && !(L.counts || {})[X.job.toLowerCase()]) X.job = '';
106
+ const html = TP.pageHtml(L, A, { draft, overview: O, job: X.job, open: X.open || !!X.job, handled: X.job && X.job !== 'Reply' ? [] : handled(), hopen: X.hopen, sopen: [...X.sopen], filed: filedLine() });
105
107
  if (html === X.html && el.firstChild) return;
106
108
  X.html = html;
107
109
  const st = el.parentNode ? el.parentNode.scrollTop : 0;
@@ -113,14 +115,14 @@ export function mountToday(ctx) {
113
115
  * newest meeting that ended in the last 3 hours and is filed under an initiative; Undo or a later meeting takes the line away. */
114
116
  const FILED_MS = 3 * 3600e3;
115
117
  function filedLine() {
116
- const N = (ctx.notes ? ctx.notes() : []).filter((n) => n && n.state === 'ended' && n.initiative && n.initiative.title && !X.unfiled.has(String(n.id)));
118
+ const N = (ctx.notes ? ctx.notes() : []).filter((n) => n && n.state === 'ended' && n.initiative && n.initiative.title && !X.unfiled.has(String(n.id)) && !X.filedOk.has(String(n.id)));
117
119
  const at = (n) => Date.parse(n.ended_at || n.updated_at || '') || 0;
118
120
  const n = N.sort((a, b) => at(b) - at(a))[0];
119
121
  if (!n || ctx.now() - at(n) > FILED_MS) return null;
120
122
  const ago = ctx.now() - at(n), min = Math.round((Number(n.meeting_ms) || 0) / 60000), t = n.came && n.came.tasks;
121
123
  const d = new Date(at(n)), when = ago < 5 * 60000 ? 'Just now' : String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0');
122
124
  const what = [n.summary ? 'summary' : '', t ? t + (t === 1 ? ' task' : ' tasks') : ''].filter(Boolean).join(' and ');
123
- return { id: String(n.id), title: n.initiative.title, ini: n.initiative.id || null, sub: [when, min ? min + ' min' : '', what].filter(Boolean).join(' · ') };
125
+ return { id: String(n.id), title: n.initiative.title, meeting: n.title || '', ini: n.initiative.id || null, sub: [when, min ? min + ' min' : '', what].filter(Boolean).join(' · ') };
124
126
  }
125
127
  const rowOf = (key) => (X.model ? X.model.rows.flatMap((r) => [r, ...(r.members || [])]).find((r) => r.key === key) : null);
126
128
  const snap = (r) => ({ title: r.title, work: r.work, job: r.job, type: r.type });
@@ -144,7 +146,7 @@ export function mountToday(ctx) {
144
146
  /** The popup's chat hidden for this open (round 3 point 7), until the popup's own per-item rule does it. */
145
147
  const chatOff = () => setTimeout(() => { const h = document.querySelector('.cz-pop:not([hidden]) [data-pop="hide"]'); if (h && !h.closest('.chat-off')) h.click(); }, 60);
146
148
  /** The rows in the order Today shows them, the ones that open something. */
147
- const order = () => { const L = X.model; if (!L) return []; return [...(L.first || []), ...(L.todayRows || []), ...(X.open || X.type ? L.wait || [] : [])].filter((r) => r && !r.done && r.src !== 'note' && r.src !== 'own'); };
149
+ const order = () => { const L = X.model; if (!L) return []; return [...(L.first || []), ...(L.todayRows || []), ...(X.open || X.type || X.job ? L.wait || [] : [])].filter((r) => r && !r.done && r.src !== 'note' && r.src !== 'own' && (!X.job || r.job === X.job)); };
148
150
  /** ↑ ↓ (j k) in the popup: the previous or next Today row opens in its place. true when it stepped. */
149
151
  function step(d) {
150
152
  const list = order(), i = list.findIndex((r) => r.key === X.last);
@@ -362,6 +364,9 @@ export function mountToday(ctx) {
362
364
  await ctx.reloadMentions(); ctx.toast('Back on Today: it still waits on you.'); return;
363
365
  }
364
366
  if (act === 'type') { X.type = X.type === key ? '' : key; draw(); return; }
367
+ if (act === 'job') { X.job = key; draw(); return; }
368
+ // the recorded meeting: ✓ keeps it filed where PMOS put it, and the block leaves Today
369
+ if (act === 'filed-ok') { X.filedOk.add(key); draw(); return; }
365
370
  if (act === 'ov-yes' || act === 'ov-no') {
366
371
  const sg = X.overview && X.overview.suggest.find((x) => x.key === key); if (!sg || X.busy.has(key)) return;
367
372
  X.busy.add(key); b.disabled = true;
@@ -402,7 +402,8 @@ export function groupLog(open, today) {
402
402
 
403
403
  /** The Overview at the top of Today (written by PMOS, ✦): one or two sentences, the suggestions with ✓ ✕, and the type chips.
404
404
  * 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.
405
- * L: logModel(), A: agendaModel(). → { said, suggest: [{ key, text, act, keys }], chips: [{ type, n }], today: the lines for today } */
405
+ * L: logModel(), A: agendaModel(). → { said, suggest: [{ key, text, act, keys }], chips: [{ type, n }], refs: [{ text, key }] the item names said,
406
+ * today: the lines for today } */
406
407
  export const OLD_CHECK_DAYS = 60;
407
408
  const clipT = (t, n) => { t = String(t || ''); return t.length > n ? t.slice(0, n - 1).replace(/\s+\S*$/, '') + '…' : t; };
408
409
  export function overviewModel(L, A = {}) {
@@ -411,9 +412,14 @@ export function overviewModel(L, A = {}) {
411
412
  const forToday = (L.first || []).length + (L.todayRows || []).filter((r) => !r.done && r.type !== 'Note').length;
412
413
  if (L.open) parts.push(plural(L.open, 'line is', 'lines are') + ' open' + (forToday && forToday < L.open ? ', ' + forToday + ' of them for today.' : '.'));
413
414
  // an ask is said by who asked ("Chen’s ask, 22 days"); another line by its title, clipped, with its reason
414
- const said = new Set();
415
- 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') + ')'
416
- : clipT(r.title, 48) + ' (' + r.reason.replace(/^(Late|Due|Goes|You|A)\b/, (w) => w.toLowerCase()) + ')'));
415
+ // refs: the item names in the sentence, so the page makes each one open its item (the Summary block's links)
416
+ const said = new Set(), refs = [];
417
+ const top = (L.first || []).slice(0, 3).map((r) => {
418
+ const ask = r.type === 'Ask' && r.who && r.who.length && !said.has(names(r.who)) && said.add(names(r.who));
419
+ const text = ask ? names(r.who) + '’s ask' : clipT(r.title, 48);
420
+ refs.push({ text, key: r.key });
421
+ return text + ' (' + (ask ? plural(r.carried, 'day', 'days') : r.reason.replace(/^(Late|Due|Goes|You|A)\b/, (w) => w.toLowerCase())) + ')';
422
+ });
417
423
  if (top.length) parts.push('Start with ' + (top.length === 1 ? top[0] : top.slice(0, -1).join(', ') + ' and ' + top[top.length - 1]) + '.');
418
424
  const freeW = A.free ? 'You have ' + durWord(A.free) + ' free' : '';
419
425
  const nextW = A.next ? (A.nextFirst ? 'your first meeting is at ' : 'your next meeting is at ') + A.next : '';
@@ -423,7 +429,7 @@ export function overviewModel(L, A = {}) {
423
429
  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 });
424
430
  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) });
425
431
  const chips = TYPES.filter((t) => (L.types || {})[t]).map((t) => ({ type: t, n: L.types[t] }));
426
- return { said: parts.join(' '), suggest, chips, today: forToday };
432
+ return { said: parts.join(' '), suggest, chips, refs, today: forToday };
427
433
  }
428
434
 
429
435
  /* ── today's agenda ── */
@@ -1,10 +1,11 @@
1
1
  /* pm/cozy-today-page.css — Today, the place (slice 5 of the six-place navigation; board 1 on Exploring 2; pm/cozy-today-view.js draws it).
2
2
  * today.html on a desk: the white page panel (#hmDesk) holds Today only. Home's list and chat column are not drawn; the chat is the
3
3
  * popup's (pm/cozy-popup.js). One container: the log is one card with a thin border, the agenda one grey box on the right.
4
- * Drawn from the PMOS design system (Komorebi; today.html puts pm-ds on the body): the Overview is a Summary block, the log a List block
5
- * (group headings, folds, the Suggestion part, icon Buttons), the agenda a Timeline block of Event parts. This sheet only places the parts
6
- * and names system tokens (ds-bridge.css points the old --cz-* names at them). Nothing animates. A phone draws its own one
7
- * column (.tdp, at the end of this file) in place of Home's list. */
4
+ * Built from the PMOS design system's parts (Komorebi, komorebi.css; agreed design TodayDS on Exploring 3, 2026-11-20): Main + side; the
5
+ * Overview a Summary block, the log a List block (Tabs, Input, ListRows, the Now group, folds, Badges, Suggestions), the agenda a Timeline
6
+ * block of Events, the recorded meeting a Summary block. The parts draw themselves; this sheet only places them on the page and resets
7
+ * the few native elements a part sits on (a title button, the play link). Nothing animates. A phone draws its own one column (.tdp, at the
8
+ * end of this file) in place of Home's list. */
8
9
 
9
10
  @media (min-width: 761px) {
10
11
  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; }
@@ -18,145 +19,59 @@
18
19
  body.cz-today #hmDesk > .hm-vw .cz-vw { width: min(520px, calc(100vw - var(--cz-railx, 16px) - 120px)); flex-basis: auto; }
19
20
  }
20
21
  .td-page[hidden] { display: none !important; }
21
-
22
- .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); }
23
- @media (max-width: 1100px) { .td { grid-template-columns: minmax(0, 1fr); } }
24
- .td-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
25
-
26
- /* the Overview: one grey box, written by PMOS (✦), as the popup's Overview */
27
- /* the Overview: a Summary block (pm-block), written by PMOS (✦); its proposals the Suggestion part, its type filter the Tabs part */
28
- .td-ov h2 b { color: var(--blue); }
29
- .td-ov p { margin: 0; font-size: var(--fs-row); line-height: var(--lh-row); color: var(--ink); max-width: 860px; }
30
- .td-ovs b, .td-sg b { color: var(--blue); font-weight: var(--fw-strong); }
31
- .td-chips { align-self: flex-start; flex-wrap: wrap; }
32
- .td-chip b { font-weight: var(--fw-strong); margin-left: 2px; }
33
- .td-chip.on { background: var(--card); color: var(--ink); box-shadow: var(--raise); } /* the Tabs part's selected tab; a filter press is aria-pressed */
34
- .td h2 { margin: 0; font-size: var(--fs-section); font-weight: var(--fw-strong); line-height: var(--lh-section); color: var(--ink); }
35
22
  .td-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
36
- .td button { font-family: var(--cz-sans); }
37
-
38
- /* the page head: the day and the time, small, then the greeting */
39
- .td-top { display: flex; flex-direction: column; gap: 2px; margin: 0 0 18px; font-family: var(--cz-sans); }
40
- .td-when { font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink3); letter-spacing: .04em; text-transform: uppercase; }
41
- .td-top h1 { margin: 0; font-size: var(--fs-display); font-weight: var(--fw-strong); line-height: 1.2; color: var(--cz-ink); }
42
-
43
- /* the log's title line: "Today's log · 12" at the left, the jobs at the right */
44
- .td-h { align-items: baseline; }
45
- .td-h h2 { margin-right: auto; }
46
- .td-sum { font-size: var(--fs-meta); color: var(--muted); }
47
23
 
48
- /* the capture line */
49
- /* the capture line: the Input part (one line, a border, the focus glow) across the top of the List block */
50
- .td-in { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--card); margin: 0 16px 12px; box-sizing: border-box; }
51
- .td-in:focus-within { box-shadow: var(--glow); }
52
- .td-in-l { display: inline-flex; color: var(--cz-ink3); cursor: text; }
53
- .td-in input { flex: 1 1 auto; min-width: 0; border: 0; background: none; font: inherit; font-size: var(--fs-row); color: var(--cz-ink); outline: none; }
54
- .td-in input::placeholder { color: var(--cz-ink3); }
55
- .td-key { flex: none; font-size: var(--fs-meta); color: var(--cz-ink3); letter-spacing: .02em; white-space: nowrap; }
56
- .td-key em { font-style: normal; margin: 0 10px 0 3px; }
57
- .td-key em:last-child { margin-right: 0; }
58
- @media (max-width: 980px) { .td-key { display: none; } }
24
+ /* Main + side */
25
+ .td { display: grid; grid-template-columns: minmax(0, 1100px) 340px; justify-content: start; gap: 24px; align-items: start; }
26
+ @media (max-width: 1100px) { .td { grid-template-columns: minmax(0, 1fr); } }
27
+ .td-main, .td-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
28
+ .td-top { margin: 0 0 16px; }
29
+ .td-top h1, .td p { margin: 0; }
59
30
 
60
- /* the log: one card, one row height, one text size */
61
- .td-tt { border-top: 1px solid var(--line); }
62
- .td-r { display: grid; grid-template-columns: 18px 20px minmax(0, 5fr) 100px minmax(0, 2fr) 52px 120px 104px; align-items: center; column-gap: 8px; min-height: 44px; padding: 0 12px; font-size: var(--fs-row); line-height: var(--lh-row); }
63
- .td-tt.nowork .td-r { grid-template-columns: 18px 20px minmax(0, 1fr) 100px 52px 120px 104px; }
64
- .td-tt.nowork .td-w, .td-tt.nowork .td-wh { display: none; }
65
- .td-r + .td-r { box-shadow: inset 0 1px 0 var(--cz-hair); }
66
- .td-hd { min-height: 36px; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--muted); } /* the column names on the card; the group headings below are the grey ones */
67
- .td-p b { color: var(--cz-late); font-weight: var(--fw-strong); display: block; text-align: center; }
68
- .td-b i { font-style: normal; display: block; text-align: center; font-size: var(--fs-panel); line-height: 1; color: var(--cz-ink); }
69
- .td-r.lab .td-b i { color: var(--cz-blueink); font-size: var(--fs-badge); }
70
- .td-wt { min-width: 0; }
71
- .td-t { display: block; max-width: 100%; text-align: left; border: 0; background: none; padding: 0; font: inherit; font-weight: var(--fw-strong); color: var(--cz-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
72
- button.td-t { cursor: pointer; }
73
- button.td-t:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; border-radius: 4px; }
74
- .td-r.note .td-t { font-weight: var(--fw-regular); color: var(--cz-ink2); }
75
- /* the group headings (Do first is the lit Now group, then Today) and the folds (Can wait, PMOS handled): the List block's own */
76
- .td-gr em { font-style: normal; font-weight: var(--fw-regular); color: var(--muted); margin-left: 6px; }
77
- .td-gr.fold { display: block; padding: 0; }
78
- .td-fold svg { color: var(--muted); }
79
- .td-fold[aria-expanded="true"] svg { transform: rotate(180deg); }
80
- .td-rs { display: block; font-size: var(--fs-meta); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
81
- .td-r.why { padding-top: 6px; padding-bottom: 6px; }
82
- .td-ty { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--cz-ink2); white-space: nowrap; }
83
- .td-ty svg { color: var(--cz-ink3); flex: none; }
84
- .td-w { font-size: var(--fs-meta); color: var(--cz-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
85
- .td-k { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink2); }
86
- .td-d { font-size: var(--fs-meta); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
87
- .td-d.late { color: var(--cz-late); font-weight: var(--fw-strong); }
88
- .td-a { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; }
89
- .td-r:hover, .td-r:focus-within { background: var(--cz-well); }
90
- .td-hd:hover { background: none; }
91
- .td-r:hover .td-a, .td-r:focus-within .td-a { opacity: 1; }
92
- @media (hover: none) { .td-a { opacity: 1; } }
93
- .td-r:hover .td-a .pm-btn:not(.primary):hover { background: var(--card); } /* a row's hover is the well; its buttons lift to the card */
94
- .td-r.done .td-t, .td-r.done .td-w, .td-r.done .td-k { color: var(--cz-ink3); font-weight: var(--fw-regular); }
95
- .td-r.done .td-b i { color: var(--cz-ink3); }
31
+ /* item names in the Overview's sentence open the item */
32
+ .td-ln { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
96
33
 
97
- /* a suggestion under its row: the Suggestion part, ✦ and one sentence, primary ✓ and outline ✕ */
98
- .td-sg { grid-column: 3 / -1; margin: 0 0 10px; }
99
- .td-sg.lab { background: none; color: var(--muted); padding-left: 0; }
100
- .td-none { margin: 6px 16px 16px; font-size: var(--fs-row); color: var(--cz-ink3); }
34
+ /* Today's log: the tab counts, the capture line, the title button of a row, the kind icon, the Suggestion under a row, the folds */
35
+ .td-n { font-weight: var(--fw-regular); color: var(--muted); }
36
+ .td-in { margin: 0; padding: 0 16px 12px; }
37
+ button.td-t { max-width: 100%; border: 0; background: none; padding: 0; font: inherit; font-weight: var(--fw-strong); color: inherit; text-align: left; cursor: pointer; }
38
+ button.td-t:focus-visible, .td-ln:focus-visible, .td-evl:focus-visible { outline: none; box-shadow: var(--glow); border-radius: var(--radius-sm); }
39
+ .td-t .pm-ic { vertical-align: -2px; margin-left: 4px; color: var(--muted); }
40
+ .td-t[aria-expanded="true"] .pm-ic { transform: rotate(180deg); }
41
+ .td-kind { display: inline-flex; color: var(--muted); }
42
+ .td-li.lab .td-kind { color: var(--blue); }
43
+ .td-li.done .t, .td-li.note .t, .td-li.mem .t { font-weight: var(--fw-regular); }
44
+ .td-li.done .t { color: var(--muted); }
45
+ .td-li:hover .acts .pm-btn:not(.primary):hover { background: var(--card); } /* a row's hover is the well; its buttons lift to the card */
46
+ @media (hover: none) { .td-li .acts { display: flex; } }
47
+ .td-li.hd .w { white-space: normal; overflow-wrap: anywhere; } /* the proof in full: it is why he can trust it */
48
+ .td-li.hd .acts { display: flex; } /* Undo on every handled row */
49
+ .td-did { display: inline-flex; align-items: center; gap: 2px; margin-right: 8px; color: var(--blue); font-weight: var(--fw-strong); }
50
+ .td-did b { font-weight: var(--fw-regular); }
51
+ .rows .td-sg { margin: 2px 8px 8px 42px; } /* a Suggestion under its row lines up with the title */
52
+ .td-fold { width: calc(100% - 32px); margin: 0 16px; }
53
+ .td-fold:last-child { margin-bottom: 8px; }
54
+ .td-fold .pm-ic { margin-left: auto; }
55
+ .td-fold[aria-expanded="true"] .pm-ic { transform: rotate(180deg); }
56
+ .td-none { margin: 0; padding: 4px 16px 16px; }
101
57
 
102
- /* 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) */
103
- .td-ag { box-sizing: border-box; gap: 0; } /* a Timeline block (pm-block flat) */
104
- .td-agh { display: flex; align-items: baseline; gap: 8px; margin: 0 0 14px; }
105
- .td-agh h2 { font-size: var(--fs-panel); }
106
- .td-agh small { font-size: var(--fs-meta); color: var(--cz-ink3); margin-right: auto; }
107
- .td-evl { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-blueink); text-decoration: none; }
108
- .td-evl:hover { text-decoration: underline; }
109
- .td-evl:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; border-radius: 4px; }
110
- .td-tl { position: relative; flex: none; height: calc(var(--rows) * 64px); margin: 8px 0 8px 46px;
111
- 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); }
112
- .td-hr { position: absolute; left: -46px; top: var(--t); transform: translateY(-50%); font-size: var(--fs-badge); color: var(--cz-ink3); }
113
- /* an event: the Event part (pm-ev), placed on the day; focus time PMOS holds is dashed blue, a past one the Event's over state */
114
- .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; text-align: left;
115
- font: inherit; color: var(--ink); gap: 1px; }
116
- .td-ev.focus { background: var(--card); box-shadow: none; border: 1.5px dashed var(--blue); }
117
- .td-dk, .td-dm { display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 2px; vertical-align: middle; }
118
- .td-dk { border-radius: 2px; transform: rotate(45deg); background: var(--cz-c-6b4fa3); }
119
- .td-dm { border-radius: 50%; background: var(--cz-blue); }
120
- .td-ev small { padding-left: 18px; }
121
- .td-ev.own small, .td-ev.short small { padding-left: 0; }
58
+ /* the agenda: each event at its time, the now line where it falls */
59
+ .td-evl { font-size: var(--fs-meta); color: var(--blue); }
60
+ .td-tl { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; }
61
+ .td-evw { display: flex; align-items: center; gap: 6px; min-width: 0; }
62
+ .td-ev { flex: 1; min-width: 0; text-align: left; font: inherit; font-size: var(--fs-meta); color: inherit; }
122
63
  button.td-ev { cursor: pointer; }
123
- button.td-ev:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
124
- .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; }
125
- .td-ev small { font-size: var(--fs-badge); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
126
- .td-ev.short { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 0; padding-bottom: 0; }
127
- .td-ev.short small { flex: none; }
128
- .td-ev.side { height: max(40px, calc(var(--h) - 3px)); padding: 4px 8px; justify-content: flex-start; }
129
- .td-ev b, .td-ev small { flex: none; }
130
- .td-ev.short:not(.side) b { flex: 0 1 auto; min-width: 0; }
131
- .td-ev.side .td-dm, .td-ev.side .td-dk { display: none; }
132
- .td-ev.side.short { flex-direction: column; justify-content: center; align-items: stretch; gap: 0; }
133
- .td-ev.side small { padding-left: 0; }
134
- .td-ev.own { background: none; box-shadow: none; }
135
- .td-ev.on { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
136
- .td-ev.past b { color: var(--cz-ink3); }
137
- /* meeting-buddy: the play icon on a meeting with a call (join and record in one press), at the top right of the meeting's own box */
138
- .td-ev.has-play { padding-right: 40px; }
139
- .td-play { position: absolute; left: calc(4px + (100% - 4px) * (var(--c, 0) + 1) / var(--n, 1) - 35px); top: calc(var(--t) + 1px); width: 28px; height: 28px; text-decoration: none; } /* a primary Button */
140
- .td-now { position: absolute; left: -6px; right: 0; top: var(--t); height: 2px; background: var(--cz-late); }
141
- .td-now::before { content: ''; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--cz-late); }
64
+ button.td-ev:focus-visible { outline: none; box-shadow: var(--glow); }
65
+ .td-ev b, .td-ev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
66
+ .td-ev.focus { border: 1.5px dashed var(--blue); box-shadow: none; } /* focus time PMOS holds */
67
+ .td-ev.on { border-color: var(--blue); }
68
+ .td-nowt { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--alert); }
69
+ .td-now { height: 0; border-top: 2px solid var(--alert); }
70
+ .td-play { text-decoration: none; }
142
71
 
143
72
  /* the date chooser beside a row (set a date) */
144
- .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); }
145
- .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; }
146
- /* round 3 point 13: what PMOS did on a row, a small ✦ with the count before the reason */
147
- .td-did { display: inline-flex; align-items: center; gap: 2px; margin-right: 8px; color: var(--cz-blueink); font-weight: var(--fw-strong); }
148
- .td-did b { font-weight: var(--fw-regular); }
149
-
150
- /* PMOS handled · N (design check of round 3): the asks the self check cleared today, each with Undo */
151
- .td-r.hd .td-rs { text-decoration: none; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; } /* the proof in full: it is why he can trust it */
152
- .td-r.hd .td-a { opacity: 1; } /* Undo on every handled row, not only on hover */
153
- /* audit round 2: the same step for N initiatives lists its members under it when opened; a day with no event is one quiet line */
154
- .td-t svg { vertical-align: -2px; margin-left: 4px; color: var(--cz-ink3); }
155
- .td-t[aria-expanded="true"] svg { transform: rotate(180deg); }
156
- .td-r.mem .td-wt { padding-left: 18px; }
157
- .td-r.mem .td-t { font-weight: var(--fw-regular); }
158
- .td-ag.quiet { align-self: start; }
159
- .td-quiet { margin: 6px 0 0; font-size: var(--fs-row); color: var(--cz-ink2); }
73
+ .td-dp { position: fixed; z-index: 80; display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: var(--radius-md); background: var(--card); box-shadow: var(--lift); }
74
+ .td-dp input { font: inherit; color: var(--ink); background: var(--well); border: 0; border-radius: var(--radius-sm); padding: 6px 8px; color-scheme: light dark; }
160
75
 
161
76
  /* ── Today on a phone (phone design, boards Ph2_today, Ph2_todayzero, Ph2_recdone; pm/cozy-today-view.js phonePageHtml) ──
162
77
  * One column on the white page, a 16 px gutter, no cards and no boxes: hairlines between the parts. Home's list is not drawn on today.html;
@@ -1,146 +1,195 @@
1
- /* pm/cozy-today-view.js — Today, the markup (slice 5 of the six-place navigation; board 1 on Exploring 2; initiative today-log-page).
1
+ /* pm/cozy-today-view.js — Today, the markup (slice 5 of the six-place navigation; initiative today-log-page).
2
2
  * Pure: it turns pm/cozy-today-model.js into HTML, and Node imports it (today-log.test.js). home-app.js draws it into #tdPage on today.html
3
3
  * and handles every press (data-td="…").
4
4
  *
5
- * One page, no views (one container rule): the title and the quiet count line sit on the panel; Today's log is one card with a thin
6
- * border; today's agenda is one grey box on the right.
7
- * The first line captures a task, an event or a note. Enter only adds the row: it opens no popup and starts no session.
8
- * Round 2 (Wawan on his real data): the Overview on top (overviewHtml), the log in three groups (Do first with each reason, Today, and
9
- * Can wait folded to one line), a Type column after What, and Reply for an ask from a person.
10
- * A row: "!" when the PM marked it first, its bullet (• task, ○ event, – note, × done, ✦ a PMOS suggestion), What, Work, Job, When, and on
11
- * hover or focus three plain icons: done, move to tomorrow, set a date. A Lab finding has ✓ (keep: start an initiative) and ✕ (drop).
12
- * Waiting too long, a ✦ line under the row: PMOS suggests to drop it, ✓ ✕.
13
- * Press a row or an agenda event: the popup on its work (home-app.js). A meeting with a call that is not over has a play icon: one
14
- * press opens the call and starts the recording (meeting-buddy).
5
+ * On a desk the page is built only from PMOS design system parts (Komorebi, workspace/design-system/ui; agreed design "TodayDS" on the
6
+ * Exploring 3 canvas, page today, 2026-11-20). Layout Main + side:
7
+ * Main the head (the day, then the greeting); the Overview, a Summary block (pm-block): one sentence whose item names open the item, and
8
+ * PMOS's Suggestions (pm-sug, ✓ primary, ✕ outline); Today's log, a List block (pm-block list): its heading and one set of Tabs
9
+ * (pm-tabs: All, Reply, Do, Decide, Send with counts, a zero tab left out), the capture Input (pm-input), then the groups: Do first
10
+ * (the Now group, pm-group now, its first row lit), Today (pm-group), and Later folded (pm-fold "N can wait"), PMOS handled folded last.
11
+ * Row a ListRow (pm-li): the kind icon, the title, a why line ("for <work> · due <date>", or who waits), a late Badge (pm-badge alert),
12
+ * and on hover or focus icon Buttons: first by job (Done, Reply, Decide, Send), then Move to tomorrow and Set a date. A ✦ Suggestion
13
+ * under the row when PMOS proposes something on it (drop it, looks answered, draft them).
14
+ * Side a Timeline block (pm-block flat) with the day's events only: past ones dashed (pm-ev over), the rest raised, the now line in the
15
+ * alert colour, a link to Events; a meeting with a call has the play Button (join and record in one press, meeting-buddy). Below it,
16
+ * a Summary block for the meeting PMOS recorded and filed, with one Suggestion (keep it filed, or take it out).
15
17
  * Every icon-only button has an aria-label. The UI says PMOS. Text from records goes through esc(). */
16
18
 
17
19
  export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
18
20
  const svg = (d, w = 15, sw = 1.9) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
21
+ /** The system's icon (pm-ic: stroke, size and caps come from the part). */
22
+ const ic = (d, w = 16, cls = '') => `<svg class="pm-ic${cls ? ' ' + cls : ''}" aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24"><path d="${d}"/></svg>`;
19
23
  export const I = {
20
24
  done: 'M5 12.5l4.5 4.5L19 7.5', tomorrow: 'M5 12h14M13 6l6 6-6 6', date: 'M4 5.5h16v14H4zM4 10h16M8.5 3.5v4M15.5 3.5v4', plus: 'M12 6v12M6 12h12',
21
25
  yes: 'M5 12.5l4.5 4.5L19 7.5', no: 'M6 6l12 12M18 6L6 18', cal: 'M4 5.5h16v14H4zM4 10h16M8.5 3.5v4M15.5 3.5v4', more: 'M8 10l4 4 4-4', play: 'M8 5v14l11-7z',
26
+ reply: 'M5 5h14v10H9l-4 4z', decide: 'M12 4l8 8-8 8-8-8z', send: 'M4 12l16-8-6 16-3-7z',
27
+ spark: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z',
28
+ sun: 'M12 3v2M12 19v2M5 5l1.4 1.4M17.6 17.6L19 19M3 12h2M19 12h2M5 19l1.4-1.4M17.6 6.4L19 5M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8z',
22
29
  };
23
- /** The small sign of each type in the Type column (one stroke icon, the word beside it). */
30
+ /** The small sign of each type (one stroke icon). */
24
31
  const TI = {
25
32
  Ask: 'M5 5h14v10H9l-4 4z', Decision: 'M12 4l8 8-8 8-8-8z', Check: 'M5 12.5l4.5 4.5L19 7.5', Milestone: 'M6 20V4M6 5h11l-2.5 3.5L17 12H6',
26
33
  Task: 'M5 5h14v14H5z', Report: 'M7 3.5h7l4 4V20.5H7zM14 3.5v4h4M10 12h5M10 16h5', Note: 'M6 12h12',
27
34
  };
35
+ /** The kind icon of a row on a desk: its type, or what the PM typed (an event, a note), a PMOS finding, or done. */
36
+ const KIND = { event: ['M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16z', 'Event'], note: [TI.Note, 'Note'], lab: [I.spark, 'PMOS suggests'], done: [I.done, 'Done'] };
37
+ const kindOf = (r) => (r.done ? KIND.done : r.src === 'lab' ? KIND.lab : r.bullet === 'event' ? KIND.event : r.bullet === 'note' || r.src === 'note' ? KIND.note : [TI[r.type] || TI.Task, r.type || 'Task']);
28
38
  const BULLET = { task: ['•', 'Task'], event: ['○', 'Event'], note: ['–', 'Note'], lab: ['✦', 'PMOS suggests'] };
29
- const ib = (act, label, d, key, extra = '', v = '') => `<button type="button" class="td-ib pm-btn${v ? ' ' + v : ''}" data-td="${act}" data-key="${esc(key)}" aria-label="${esc(label)}" title="${esc(label)}"${extra}>${svg(d)}</button>`;
39
+ const ib = (act, label, d, key, extra = '', v = '') => `<button type="button" class="td-ib pm-btn${v ? ' ' + v : ''}" data-td="${act}" data-key="${esc(key)}" aria-label="${esc(label)}" title="${esc(label)}"${extra}>${ic(d)}</button>`;
40
+ const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
41
+ /** A Suggestion (pm-sug): ✦, one sentence, ✓ primary and ✕ outline. */
42
+ const sugHtml = (say, yes, no, key, cls = '') => `<div class="td-sg pm-sug${cls ? ' ' + cls : ''}" role="group" aria-label="PMOS suggests">${ic(I.spark, 16, 'pm-star')}<span class="say">${esc(say)}</span>`
43
+ + ib(yes[0], yes[1], I.yes, key, '', 'primary') + ib(no[0], no[1], I.no, key, '', 'outline') + '</div>';
30
44
 
31
- /** One row of the log. */
45
+ /** The late Badge of a row: how long it is late, or how long a person waits; '' when it is not late. */
46
+ export function lateOf(r) {
47
+ if (!r || !r.late || r.done || !(r.carried > 0)) return '';
48
+ return r.type === 'Ask' || (r.src !== 'move' && r.src !== 'item' && !/ late$/.test(r.reason || '')) ? plural(r.carried, 'day', 'days') : plural(r.carried, 'day', 'days') + ' late';
49
+ }
50
+ /** The why line under a title: "for <work> · due <date>", or who waits; what the Badge says is not said again. */
51
+ export function whyLine(r) {
52
+ const badge = lateOf(r);
53
+ let reason = r.reason || '';
54
+ if (badge && /^\d+ days? late$/.test(reason)) reason = '';
55
+ if (badge && r.type === 'Ask') reason = reason.replace(/ \d+ days?$/, '');
56
+ const when = r.when ? (r.late && !r.done && /^\d+ [A-Z][a-z]{2}/.test(r.when) ? 'due ' + r.when : r.when) : '';
57
+ return [r.work ? 'for ' + r.work : '', when, reason].filter(Boolean).join(' · ');
58
+ }
59
+ /** The first action of a row, by its job: Done for a thing to do, else the item opens where the PM replies, decides or sends. */
60
+ const JOB_ACT = { Reply: ['open', 'Reply', I.reply], Decide: ['open', 'Decide', I.decide], Send: ['open', 'Send', I.send] };
61
+
62
+ /** One row of the log: a ListRow (pm-li). o.lit: the lit first row of Do first; o.sopen: its members are listed. */
32
63
  export function rowHtml(r, o = {}) {
33
- const [b, bl] = r.done ? ['×', 'Done'] : BULLET[r.bullet] || BULLET.task;
34
- const acts = r.done || r.src === 'note' ? '' : r.src === 'lab'
35
- ? ib('lab-keep', 'Keep it: start an initiative from ' + r.title, I.yes, r.key) + ib('lab-drop', 'Drop it: ' + r.title, I.no, r.key)
36
- : ib('done', 'Done: ' + r.title, I.done, r.key) + ib('tomorrow', 'Move to tomorrow: ' + r.title, I.tomorrow, r.key) + ib('date', 'Set a date: ' + r.title, I.date, r.key, ' aria-haspopup="dialog"');
37
- const cls = ['td-r', r.done ? 'done' : '', r.bullet === 'note' ? 'note' : '', r.src === 'lab' ? 'lab' : '', r.reason ? 'why' : '', r.member ? 'mem' : ''].filter(Boolean).join(' ');
64
+ const [kd, kl] = kindOf(r);
65
+ const t = r.title;
66
+ let acts = '';
67
+ if (!r.done && r.src !== 'note') {
68
+ if (r.src === 'lab') acts = ib('lab-keep', 'Keep it: start an initiative from ' + t, I.yes, r.key) + ib('lab-drop', 'Drop it: ' + t, I.no, r.key);
69
+ else {
70
+ const j = JOB_ACT[r.job];
71
+ acts = (j ? ib(j[0], j[1] + ': ' + t, j[2], r.key) : '') + ib('done', 'Done: ' + t, I.done, r.key)
72
+ + ib('tomorrow', 'Move to tomorrow: ' + t, I.tomorrow, r.key) + ib('date', 'Set a date: ' + t, I.date, r.key, ' aria-haspopup="dialog"');
73
+ }
74
+ }
75
+ const cls = ['td-li', 'pm-li', o.lit && !r.done ? 'now' : '', r.done ? 'done' : '', r.bullet === 'note' || r.src === 'note' ? 'note' : '', r.src === 'lab' ? 'lab' : '', r.member ? 'mem nest' : ''].filter(Boolean).join(' ');
38
76
  // a note, an own event and a done row open nothing: their words are the whole of it
39
77
  const opens = !r.done && r.src !== 'own' && r.src !== 'gone' && r.src !== 'note';
40
- const title = opens ? `<button type="button" class="td-t" data-td="open" data-key="${esc(r.key)}"${r.members ? ` aria-expanded="${!!o.sopen}"` : ''}>${esc(r.title)}${r.members ? svg(I.more, 13) : ''}</button>` : `<span class="td-t">${esc(r.title)}</span>`;
41
- const sug = r.drop ? `<div class="td-sg pm-sug" role="group" aria-label="PMOS suggests"><b aria-hidden="true">✦</b><span class="say">PMOS suggests: drop it from your log.</span>`
42
- + ib('drop', 'Drop it', I.yes, r.key, '', 'primary') + ib('keep', 'Keep it', I.no, r.key, '', 'outline') + '</div>' : '';
43
- const lk = r.looks && !r.done ? `<div class="td-sg pm-sug" role="group" aria-label="PMOS suggests"><b aria-hidden="true">✦</b><span class="say">Looks answered: ${esc(r.looks.who ? r.looks.who + ' replied' : 'someone replied')} “${esc(r.looks.text)}”. Close it?</span>`
44
- + ib('lk-yes', 'Yes, close it: it is answered', I.yes, r.key, '', 'primary') + ib('lk-no', 'No, it still waits on me', I.no, r.key, '', 'outline') + '</div>' : '';
45
- // the same step for N initiatives: PMOS drafts them, he approves once (audit round 2)
46
- const sj = r.members && r.drafts && !r.done ? `<div class="td-sg pm-sug" role="group" aria-label="PMOS suggests"><b aria-hidden="true">✦</b><span class="say">PMOS drafts them for you to read.</span>`
47
- + ib('same-yes', 'Yes, draft them', I.yes, r.key, '', 'primary') + ib('same-no', 'No, not now', I.no, r.key, '', 'outline') + '</div>' : '';
48
- const why = r.src === 'lab' && r.why ? `<div class="td-sg lab"><span>${esc(r.why)}</span></div>` : '';
78
+ const title = opens ? `<button type="button" class="t td-t" data-td="open" data-key="${esc(r.key)}"${r.members ? ` aria-expanded="${!!o.sopen}"` : ''}>${esc(t)}${r.members ? ic(I.more, 14) : ''}</button>` : `<span class="t td-t">${esc(t)}</span>`;
79
+ const first = r.first && !r.done && r.src === 'own' ? '<span class="pm-badge blue">First</span>' : '';
49
80
  // what PMOS did on it, from records (round 3 point 13): a small ✦ with the count; its words on hover and for a screen reader
50
81
  const did = r.did && r.did.length && !r.done ? `<span class="td-did" title="${esc('PMOS did: ' + r.did.join('; '))}" aria-label="${esc('PMOS did: ' + r.did.join('; '))}"><b aria-hidden="true">✦</b>${r.did.length}</span>` : '';
51
- const reason = r.reason || did ? `<small class="td-rs">${did}${esc(r.reason || '')}</small>` : '';
52
- const type = r.type ? `<span class="td-ty" role="cell">${svg(TI[r.type] || TI.Task, 13, 1.8)}<span>${esc(r.type)}</span></span>` : '<span class="td-ty" role="cell"></span>';
53
- return `<div class="${cls}" data-key="${esc(r.key)}" role="row"><span class="td-p" role="cell">${r.first && !r.done && r.src === 'own' ? '<b aria-label="First">!</b>' : ''}</span>`
54
- + `<span class="td-b" role="cell"><i role="img" aria-label="${esc(bl)}">${b}</i></span><span role="cell" class="td-wt">${title}${reason}</span>${type}`
55
- + `<span class="td-w" role="cell">${esc(r.work)}</span><span class="td-k" role="cell">${esc(r.job)}</span>`
56
- + `<span class="td-d${r.late && !r.done ? ' late' : ''}" role="cell">${esc(r.when)}</span><span class="td-a" role="cell">${acts}</span>${sug}${sj}${lk}${why}</div>`;
82
+ const why = r.member ? '' : whyLine(r);
83
+ const w = why || did ? `<span class="w td-rs">${did}${esc(why)}</span>` : '';
84
+ const late = lateOf(r);
85
+ const row = `<div class="${cls}" data-key="${esc(r.key)}"><span class="td-kind" role="img" aria-label="${esc(kl)}">${ic(kd)}</span><span class="txt">${title}${w}</span>`
86
+ + `${first}${late ? `<span class="pm-badge alert">${esc(late)}</span>` : ''}${acts ? `<span class="acts td-a">${acts}</span>` : ''}</div>`;
87
+ const sug = r.drop ? sugHtml('PMOS suggests: drop it from your log.', ['drop', 'Drop it'], ['keep', 'Keep it'], r.key) : '';
88
+ const lk = r.looks && !r.done ? sugHtml('Looks answered: ' + (r.looks.who ? r.looks.who + ' replied' : 'someone replied') + ' “' + r.looks.text + '”. Close it?', ['lk-yes', 'Yes, close it: it is answered'], ['lk-no', 'No, it still waits on me'], r.key) : '';
89
+ // the same step for N initiatives: PMOS drafts them, he approves once (audit round 2)
90
+ const sj = r.members && r.drafts && !r.done ? sugHtml('PMOS drafts them for you to read.', ['same-yes', 'Yes, draft them'], ['same-no', 'No, not now'], r.key) : '';
91
+ const lab = r.src === 'lab' && r.why ? `<p class="td-sg lab pm-meta">${esc(r.why)}</p>` : '';
92
+ return row + sug + sj + lk + lab;
57
93
  }
58
94
 
59
- /** The Overview, one grey box under the head, written by PMOS (✦): where to start and why, the free time, the suggestions with ✓ ✕,
60
- * and the type chips (with their counts) that filter the log. O: overviewModel(). o.type: the chip that filters now. */
61
- export function overviewHtml(O, o = {}) {
62
- if (!O || (!O.said && !O.chips.length)) return '';
63
- const sug = O.suggest.map((x) => `<div class="td-ovs pm-sug" role="group" aria-label="PMOS suggests"><b aria-hidden="true">✦</b><span class="say">${esc(x.text)}</span>`
64
- + ib('ov-yes', x.text, I.yes, x.key, '', 'primary') + ib('ov-no', 'Keep them: ' + x.text, I.no, x.key, '', 'outline') + '</div>').join('');
65
- const total = O.chips.reduce((n, c) => n + c.n, 0);
66
- const chip = (t, label, n) => `<button type="button" class="td-chip pm-tab${(o.type || '') === t ? ' on' : ''}" data-td="type" data-key="${esc(t)}" aria-pressed="${(o.type || '') === t}">${esc(label)} <b>${esc(n)}</b></button>`;
67
- const chips = O.chips.length > 1 ? `<div class="td-chips pm-tabs" role="group" aria-label="Show one type">${chip('', 'All', total)}${O.chips.map((c) => chip(c.type, PLURAL[c.type] || c.type, c.n)).join('')}</div>` : '';
68
- return `<section class="td-ov pm-block" aria-label="Overview"><h2 class="pm-h-sm pm-row"><b aria-hidden="true">✦</b> Overview</h2>${O.said ? `<p>${esc(O.said)}</p>` : ''}${sug}${chips}</section>`;
95
+ /** The Overview, a Summary block written by PMOS (✦): one sentence whose item names open the item, then PMOS's Suggestions.
96
+ * O: overviewModel(). */
97
+ export function overviewHtml(O) {
98
+ if (!O || (!O.said && !(O.suggest || []).length)) return '';
99
+ let said = esc(O.said || '');
100
+ for (const x of O.refs || []) {
101
+ const t = esc(x.text), at = said.indexOf(t);
102
+ if (at >= 0) said = said.slice(0, at) + `<button type="button" class="td-ln" data-td="open" data-key="${esc(x.key)}">${t}</button>` + said.slice(at + t.length);
103
+ }
104
+ const sug = (O.suggest || []).map((x) => sugHtml(x.text, ['ov-yes', x.text], ['ov-no', 'Keep them: ' + x.text], x.key, 'td-ovs')).join('');
105
+ return `<section class="td-ov pm-block" aria-label="Overview"><h2 class="pm-h-sm pm-row">${ic(I.spark, 16, 'pm-star')}Overview</h2>${said ? `<p>${said}</p>` : ''}${sug}</section>`;
69
106
  }
70
- const PLURAL = { Ask: 'Asks', Decision: 'Decisions', Check: 'Checks', Milestone: 'Milestones', Task: 'Tasks', Report: 'Reports', Note: 'Notes' };
71
-
72
- const HEAD_ROW = '<div class="td-r td-hd" role="row"><span role="columnheader"></span><span role="columnheader"><span class="td-vh">Bullet</span></span><span role="columnheader">What</span><span role="columnheader">Type</span><span role="columnheader" class="td-wh">Work</span><span role="columnheader">Job</span><span role="columnheader">When</span><span role="columnheader"><span class="td-vh">Actions</span></span></div>';
73
- const groupRow = (label, n, now) => `<div class="td-gr pm-group${now ? ' now' : ''}" role="row"><span role="cell">${esc(label)}${n ? ` <em>${esc(n)}</em>` : ''}</span></div>`;
107
+ const PLURAL = { Ask: 'Asks', Decision: 'Decisions', Check: 'Checks', Milestone: 'Milestones', Task: 'Tasks', Report: 'Reports', Note: 'Notes' }; // the phone's type filter
108
+ /** The jobs the log's Tabs filter by, in order. */
109
+ export const JOBS = [['Reply', 'reply'], ['Do', 'do'], ['Decide', 'decide'], ['Send', 'send']];
74
110
 
75
- /** Today's log: the title with its count at the left and the jobs at the right, the capture line, the one card in three groups:
76
- * Do first (each line with its reason), Today, and Can wait folded to one line. L: logModel().
77
- * o: { draft: the line being typed, type: the chip that filters, open: Can wait is unfolded } */
111
+ /** Today's log, a List block: the heading and the Tabs, the capture Input, the groups Do first, Today, Later (folded) and PMOS handled.
112
+ * L: logModel(). o: { draft: the line being typed, job: the tab that filters ('' is All), open: Later is unfolded, handled, hopen, sopen } */
78
113
  export function logHtml(L, o = {}) {
79
- const head = `<div class="td-h head"><h2>Today’s log${L.open ? ' · ' + esc(L.open) : ''}</h2>${L.line ? `<span class="td-sum">${esc(L.line)}</span>` : ''}</div>`;
80
- const cap = `<form class="td-in" id="tdCapF" autocomplete="off"><label class="td-in-l" for="tdCap">${svg(I.plus, 16)}<span class="td-vh">Log a task, an event or a note</span></label>`
81
- + `<input id="tdCap" name="line" type="text" maxlength="240" placeholder="Log a task, an event or a note" value="${esc(o.draft || '')}" aria-describedby="tdCapKey" />`
82
- + `<span class="td-key" id="tdCapKey" aria-label="Start with o for an event, a dash for a note, ! for first">•<em>task</em>o<em>event</em>–<em>note</em>!<em>first</em></span></form>`;
83
- const pick = (rows) => (o.type ? (rows || []).filter((r) => r.type === o.type) : rows || []);
114
+ const c = L.counts || {}, job = o.job || '';
115
+ const tab = (j, label, n) => `<button type="button" class="td-tab pm-tab" role="tab" data-td="job" data-key="${esc(j)}" aria-selected="${job === j}">${esc(label)} <span class="td-n">${esc(n)}</span></button>`;
116
+ const shownJobs = JOBS.filter(([, k]) => c[k]);
117
+ const tabs = shownJobs.length ? `<div class="td-tabs pm-tabs" role="tablist" aria-label="Show one job">${tab('', 'All', L.open || 0)}${shownJobs.map(([j, k]) => tab(j, j, c[k])).join('')}</div>` : '';
118
+ const head = `<div class="head"><h2 class="pm-h">Today’s log</h2><span class="sp"></span>${tabs}</div>`;
119
+ const cap = `<form class="td-in" id="tdCapF" autocomplete="off"><label class="td-vh" for="tdCap">Log a task, an event or a note</label>`
120
+ + `<input id="tdCap" class="pm-input" name="line" type="text" maxlength="240" placeholder="Log a task, an event or a note" value="${esc(o.draft || '')}" aria-describedby="tdCapKey" title="Start with o for an event, a dash for a note, ! for first" />`
121
+ + `<span class="td-vh" id="tdCapKey">Start with o for an event, a dash for a note, ! for first</span></form>`;
122
+ const pick = (rows) => (job ? (rows || []).filter((r) => r.job === job) : rows || []);
84
123
  const so = new Set(o.sopen || []);
85
- const rowHtml1 = (r) => (r.members ? rowHtml(r, { sopen: so.has(r.key) }) + (so.has(r.key) ? r.members.map((m) => rowHtml(m)).join('') : '') : rowHtml(r));
124
+ const one = (r, lit) => (r.members ? rowHtml(r, { sopen: so.has(r.key), lit }) + (so.has(r.key) ? r.members.map((m) => rowHtml(m)).join('') : '') : rowHtml(r, { lit }));
86
125
  const first = pick(L.first), today = pick(L.todayRows), wait = pick(L.wait);
87
126
  let body = '';
88
- if (first.length) body += groupRow('Do first', 0, true) + first.map(rowHtml1).join('');
89
- if (today.length) body += groupRow('Today') + today.map(rowHtml1).join('');
127
+ if (first.length) body += `<div class="td-gr pm-group now">${ic(I.sun, 14)}Do first</div><div class="rows">${first.map((r, i) => one(r, i === 0)).join('')}</div>`;
128
+ if (today.length) body += `<div class="td-gr pm-group">Today</div><div class="rows">${today.map((r) => one(r)).join('')}</div>`;
90
129
  if (wait.length) {
91
130
  const oldest = Math.max(0, ...wait.map((r) => r.carried || 0));
92
- const said = (first.length || today.length ? wait.length + ' more' : plural2(wait.length)) + (oldest ? ' · the oldest waits ' + oldest + (oldest === 1 ? ' day' : ' days') : '');
93
- body += `<div class="td-gr fold" role="row"><span role="cell"><button type="button" class="td-fold pm-fold" data-td="fold" aria-expanded="${!!o.open}">Can wait <em>${esc(said)}</em>${svg(I.more, 14)}</button></span></div>`;
94
- if (o.open) body += wait.map(rowHtml1).join('');
131
+ const said = wait.length + ' can wait' + (oldest ? ' · the oldest waits ' + plural(oldest, 'day', 'days') : '');
132
+ body += `<button type="button" class="td-fold pm-fold" data-td="fold" aria-expanded="${!!o.open}">Later <span class="td-n">${esc(said)}</span>${ic(I.more, 14)}</button>`;
133
+ if (o.open) body += `<div class="rows">${wait.map((r) => one(r)).join('')}</div>`;
95
134
  }
96
135
  // PMOS handled · N: what the self check cleared today, folded last, Undo on each (design check of round 3, point 6)
97
136
  const hd = o.handled || [];
98
137
  if (hd.length) {
99
- body += `<div class="td-gr fold" role="row"><span role="cell"><button type="button" class="td-fold pm-fold" data-td="hfold" aria-expanded="${!!o.hopen}">PMOS handled <em>${esc(hd.length)}</em>${svg(I.more, 14)}</button></span></div>`;
100
- if (o.hopen) body += hd.map((h) => `<div class="td-r done hd" data-key="hd:${esc(h.id)}" role="row"><span class="td-p" role="cell"></span><span class="td-b" role="cell"><i role="img" aria-label="Done">×</i></span>`
101
- + `<span role="cell" class="td-wt"><span class="td-t">${esc(h.title)}</span><small class="td-rs">${esc(h.proof)}</small></span><span class="td-ty" role="cell">${svg(TI.Ask, 13, 1.8)}<span>Ask</span></span>`
102
- + `<span class="td-w" role="cell"></span><span class="td-k" role="cell"></span><span class="td-d" role="cell"></span><span class="td-a" role="cell">`
103
- + `<button type="button" class="td-undo pm-btn" data-td="h-undo" data-key="${esc(h.id)}" aria-label="${esc('Undo: it still waits on me, ' + h.title)}" title="Undo">${svg(PI.undo, 15, 1.8)}</button></span></div>`).join('');
138
+ body += `<button type="button" class="td-fold pm-fold" data-td="hfold" aria-expanded="${!!o.hopen}">PMOS handled <span class="td-n">${esc(hd.length)}</span>${ic(I.more, 14)}</button>`;
139
+ if (o.hopen) body += '<div class="rows">' + hd.map((h) => `<div class="td-li pm-li done hd" data-key="hd:${esc(h.id)}"><span class="td-kind" role="img" aria-label="Done">${ic(I.done)}</span>`
140
+ + `<span class="txt"><span class="t td-t">${esc(h.title)}</span><span class="w td-rs">${esc(h.proof)}</span></span><span class="acts td-a">`
141
+ + `<button type="button" class="td-undo pm-btn" data-td="h-undo" data-key="${esc(h.id)}" aria-label="${esc('Undo: it still waits on me, ' + h.title)}" title="Undo">${ic(PI.undo)}</button></span></div>`).join('') + '</div>';
104
142
  }
105
- // no row in view names its work: the Work column goes, so What gets the room
106
- const shown = first.concat(today, o.open ? wait : []), noWork = shown.length > 0 && shown.every((r) => !r.work);
107
- const table = body ? `<div class="td-tt${noWork ? ' nowork' : ''}" role="table" aria-label="Today’s log">${HEAD_ROW}${body}</div>` : '<p class="td-none">Nothing waits on you today.</p>';
108
- return `<section class="td-log pm-block list" aria-label="Today’s log">${head}${cap}${table}</section>`;
143
+ const list = body || `<p class="td-none pm-meta">${job ? 'Nothing to ' + job.toLowerCase() + ' today.' : 'Nothing waits on you today.'}</p>`;
144
+ return `<section class="td-log pm-block list" aria-label="Today’s log">${head}${cap}${list}</section>`;
109
145
  }
110
- const plural2 = (n) => n + (n === 1 ? ' line' : ' lines');
111
146
 
112
- /** Today's agenda in one grey box: the day by hours (a line every hour, a label every two), the meetings, the reports that go out, the
113
- * PM's own events and the focus time PMOS holds (dashed), and the red line for now. The grid shows on an empty day too. A: agendaModel().
114
- * Places are a share of the day (--t, --h), so the column fills the box, as tall as the log. */
147
+ const hm = (ms) => { const d = new Date(ms); return String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0'); };
148
+ /** Today's agenda, a Timeline block (pm-block flat): the day's events only, each at its time, past ones dashed, the now line in the alert
149
+ * colour where it falls, and a link to Events. No hour grid. A day with no event is one quiet line. A: agendaModel(). */
115
150
  export function agendaHtml(A) {
116
- const H = A.to - A.from, pc = (x) => (Math.round((x / H) * 10000) / 100) + '%';
117
- const hours = [];
118
- for (let h = A.from; h <= A.to; h += 2) hours.push(`<span class="td-hr" style="--t:${pc(h - A.from)}">${String(h).padStart(2, '0')}:00</span>`);
119
- const ev = A.items.map((x) => {
120
- const short = x.h < 0.8; // a short slot says its time and title on one line
121
- const st = `--t:${pc(x.top)};--h:${pc(x.h)};--c:${x.col || 0};--n:${x.cols || 1}`;
122
- const cls = ['td-ev', 'pm-ev', x.kind, short ? 'short' : '', (x.cols || 1) > 1 ? 'side' : '', x.past ? 'past over' : '', x.nowOn ? 'on' : ''].filter(Boolean).join(' ');
123
- const mark = x.kind === 'report' ? '<i class="td-dk" aria-hidden="true"></i>' : x.kind === 'focus' || x.kind === 'meeting' ? '<i class="td-dm" aria-hidden="true"></i>' : '';
151
+ const quiet = A.quiet && !A.items.length;
152
+ const head = `<div class="head"><h2 class="pm-h">Today</h2><span class="pm-meta">${esc(quiet ? A.sub.split(' · ')[0] : A.sub)}</span><span class="sp"></span><a class="td-evl" href="/premium-events.html">Events</a></div>`;
153
+ if (quiet) return `<aside class="td-ag pm-block flat" aria-label="Today’s agenda">${head}<p class="td-quiet pm-meta">${esc(A.quiet)}</p></aside>`;
154
+ const nowMin = A.now != null ? Math.round((A.from + A.now) * 60) : null;
155
+ const nowLine = nowMin != null ? `<span class="td-at td-nowt">${String(Math.floor(nowMin / 60)).padStart(2, '0')}:${String(nowMin % 60).padStart(2, '0')}</span><i class="td-now" aria-hidden="true"></i>` : '';
156
+ let placed = nowMin == null, rows = '';
157
+ for (const x of A.items) {
158
+ if (!placed && x.top > A.now) { rows += nowLine; placed = true; }
159
+ const soon = A.now != null && !x.past && !x.nowOn && x.top > A.now && (x.top - A.now) * 60 <= 60 ? 'in ' + Math.max(1, Math.round((x.top - A.now) * 60)) + ' min · ' : '';
160
+ const cls = ['td-ev', 'pm-ev', x.kind, x.past ? 'past over' : '', x.nowOn ? 'on' : ''].filter(Boolean).join(' ');
124
161
  const label = x.title + ', ' + x.sub;
125
- const inner = `<b>${mark}${esc(x.title)}</b><small>${esc(x.sub)}</small>`;
126
- if (x.kind === 'own' || x.kind === 'report') return `<div class="${cls}" style="${st}" aria-label="${esc(label)}">${inner}</div>`;
127
- if (x.kind === 'focus') return `<button type="button" class="${cls}" style="${st}" data-td="open" data-key="${esc(x.row)}" aria-label="${esc(label)}">${inner}</button>`;
128
- return `<button type="button" class="${cls}${x.play ? ' has-play' : ''}" style="${st}" data-td="ev" data-key="${esc(x.key)}" aria-label="${esc(label)}">${inner}</button>`
129
- // meeting-buddy: one press opens the call and starts the recording. A link, so the browser always opens the call, even when the
130
- // recording tab is held back; cozy-today-app.js starts the recording on the same press.
131
- + (x.play ? `<a class="td-play pm-btn primary" style="${st}" href="${esc(x.join)}" target="_blank" rel="noopener noreferrer" data-td="play" data-key="${esc(x.key)}" aria-label="${esc('Join ' + x.title + ' and record it')}" title="Join and record">${svg(I.play, 13)}</a>` : '');
132
- }).join('');
133
- const nowLine = A.now != null ? `<i class="td-now" style="--t:${pc(A.now)}" aria-hidden="true"></i>` : '';
134
- return `<aside class="td-ag pm-block flat${A.quiet && !A.items.length ? ' quiet' : ''}" aria-label="Today’s agenda"><div class="td-agh"><h2>Today</h2><small>${esc(A.quiet && !A.items.length ? A.sub.split(' · ')[0] : A.sub)}</small>`
135
- + `<a class="td-evl" href="/premium-events.html">Events</a></div>`
136
- + (A.quiet && !A.items.length ? `<p class="td-quiet">${esc(A.quiet)}</p></aside>` : `<div class="td-tl" style="--rows:${H}">${hours.join('')}${ev}${nowLine}</div></aside>`);
162
+ const inner = `<b>${esc(x.title)}</b><span class="pm-meta">${esc(soon + x.sub)}</span>`;
163
+ const ev = x.kind === 'own' || x.kind === 'report' ? `<div class="${cls}" aria-label="${esc(label)}">${inner}</div>`
164
+ : x.kind === 'focus' ? `<button type="button" class="${cls}" data-td="open" data-key="${esc(x.row)}" aria-label="${esc(label)}">${inner}</button>`
165
+ : `<button type="button" class="${cls}" data-td="ev" data-key="${esc(x.key)}" aria-label="${esc(label)}">${inner}</button>`;
166
+ // meeting-buddy: one press opens the call and starts the recording. A link, so the browser always opens the call, even when the
167
+ // recording tab is held back; cozy-today-app.js starts the recording on the same press.
168
+ const play = x.play ? `<a class="td-play pm-btn primary" href="${esc(x.join)}" target="_blank" rel="noopener noreferrer" data-td="play" data-key="${esc(x.key)}" aria-label="${esc('Join ' + x.title + ' and record it')}" title="Join and record">${ic(I.play)}</a>` : '';
169
+ rows += `<span class="td-at pm-meta">${esc(hm(x.a))}</span><div class="td-evw">${ev}${play}</div>`;
170
+ }
171
+ if (!placed) rows += nowLine;
172
+ return `<aside class="td-ag pm-block flat" aria-label="Today’s agenda">${head}<div class="td-tl">${rows}</div></aside>`;
173
+ }
174
+
175
+ /** The meeting PMOS recorded and filed, a Summary block under the agenda with one Suggestion: keep it filed there (✓), or take it out (✕).
176
+ * f: { id, title (the work), meeting, sub } from cozy-today-app.js filedLine(); '' with none. */
177
+ export function filedHtml(f) {
178
+ if (!f) return '';
179
+ return `<section class="td-rec pm-block" aria-label="The meeting you recorded"><h2 class="pm-h-sm pm-row">${ic(I.spark, 16, 'pm-star')}${esc((f.meeting || 'Your meeting') + ', recorded')}</h2>`
180
+ + `<p>${esc((f.sub ? f.sub + '. ' : '') + 'PMOS filed it under ' + f.title + '.')}</p>`
181
+ + sugHtml('Keep it filed under ' + f.title, ['filed-ok', 'Yes, keep it there'], ['filed-undo', 'No, take it out of ' + f.title], f.id) + '</section>';
137
182
  }
138
183
 
139
184
  /** The page head: the day and the time, small, then the greeting. Hd: headModel(). */
140
- export const headHtml = (Hd) => `<header class="td-top"><span class="td-when">${esc(Hd.when)}</span><h1>${esc(Hd.hello)}</h1></header>`;
185
+ export const headHtml = (Hd) => `<header class="td-top"><div class="td-when pm-meta">${esc(Hd.when)}</div><h1 class="title">${esc(Hd.hello)}</h1></header>`;
141
186
 
142
- /** The whole page: the Overview and the log at the left, the agenda beside them. o.overview: overviewModel(). */
143
- export function pageHtml(L, A, o = {}) { return `${o.head ? headHtml(o.head) : ''}<div class="td"><div class="td-main">${o.overview ? overviewHtml(o.overview, o) : ''}${logHtml(L, o)}</div>${agendaHtml(A)}</div>`; }
187
+ /** The whole page, Main + side: the Overview and the log, then the agenda and the recorded meeting beside them.
188
+ * o: { head, overview: overviewModel(), filed, …logHtml's o } */
189
+ export function pageHtml(L, A, o = {}) {
190
+ return `${o.head ? headHtml(o.head) : ''}<div class="td"><div class="td-main">${o.overview ? overviewHtml(o.overview) : ''}${logHtml(L, o)}</div>`
191
+ + `<div class="td-side">${agendaHtml(A)}${filedHtml(o.filed)}</div></div>`;
192
+ }
144
193
 
145
194
  /* ── Today on a phone (phone design, boards Ph2_today, Ph2_todayzero, Ph2_recdone; build brief nav-structure/phone/build-brief-v2.md) ──
146
195
  * One column, no cards and no boxes: the day and the greeting, "Recording filed under …" with Undo after a meeting, the ✦ Overview with at