create-pmos 0.656.0 → 0.658.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.656.0",
3
+ "version": "0.658.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,25 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.658.0",
38
+ "at": "2026-11-22T03:38:17.292Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1441,
43
+ "t": "Goals is built from the design system's blocks",
44
+ "s": "Goals is built from the design system's blocks",
45
+ "k": "new"
46
+ },
47
+ {
48
+ "n": 1443,
49
+ "t": "Events is built from the design system's blocks",
50
+ "s": "Events is built from the design system's blocks",
51
+ "k": "new"
52
+ }
53
+ ]
54
+ },
36
55
  {
37
56
  "v": "0.656.0",
38
57
  "at": "2026-11-22T02:59:28.675Z",
@@ -303,19 +322,6 @@
303
322
  "k": "new"
304
323
  }
305
324
  ]
306
- },
307
- {
308
- "v": "0.631.0",
309
- "at": "2026-11-19T11:03:25.147Z",
310
- "f": 4,
311
- "prs": [
312
- {
313
- "n": 1412,
314
- "t": "Keep a snapshot of every past sprint, with a sprint picker on the Backlog",
315
- "s": "Keep a snapshot of every past sprint, with a sprint picker on the Backlog",
316
- "k": "new"
317
- }
318
- ]
319
325
  }
320
326
  ]
321
327
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@d0f61d65
1
+ kernel-source: pmos@c6e6eef1
2
2
  assembled: 2026-11-22
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-22T02:59:25Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T03:38:13Z"}
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-22T02:59:25Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T03:38:13Z"}
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-22T02:59:25Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T03:38:13Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,23 @@
1
1
  [
2
+ {
3
+ "v": "0.658.0",
4
+ "at": "2026-11-22T03:38:17.292Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1441,
9
+ "t": "Goals is built from the design system's blocks",
10
+ "s": "Goals is built from the design system's blocks",
11
+ "k": "new"
12
+ },
13
+ {
14
+ "n": 1443,
15
+ "t": "Events is built from the design system's blocks",
16
+ "s": "Events is built from the design system's blocks",
17
+ "k": "new"
18
+ }
19
+ ]
20
+ },
2
21
  {
3
22
  "v": "0.656.0",
4
23
  "at": "2026-11-22T02:59:28.675Z",
@@ -169,19 +169,19 @@ The **Product** and **Program** facts go one level up. A program or a product op
169
169
 
170
170
  ## Events
171
171
 
172
- Events is drawn from the PMOS design system. Each group (Late, Today, Coming up) is one card. A suggestion sits in a blue box with ✓ and ✕. Today's date in the small month has a green ring. Undo is the arrow in the toast at the bottom.
172
+ Events is built from the PMOS design system's blocks. The top line is the path, the product chip, then **Search**, **+** and **More** (the month, the week, Show every date, Connectors). The dates are on the left: Late, Today and Coming up, each one card. The month and Show are on the right. A suggestion sits in a blue box with ✓ and ✕. Today's date in the month has a green ring. Undo is the arrow in the toast at the bottom.
173
173
 
174
174
  Events is one page for everything with a date, from every source PMOS reads: your meetings and focus time from the calendar (the same calendar as Today), the milestones and planned finish dates of every initiative and program, your tasks in PMOS and your Jira tickets with a due day, the days a report goes out, and the dates people state in your sources. A date stated in a source is, for example, an ask with a deadline in Slack or email, a date decided in meeting notes, or a release date in Jira or Confluence. PMOS keeps such a date only when the text states the day ("30 Nov"). It does not guess a day from "Friday" or "next week".
175
175
 
176
176
  - Each row starts its grey line with its type: **Meeting**, **Focus time**, **Milestone**, **Task**, **Report** or **Deadline**. A deadline names its source, for example "From Slack · Ang, 18 Nov". Press it to see the line that states the date, with a link to the source.
177
177
 
178
- - **Late** lists the dates that passed. For each one, PMOS suggests what to do: "It looks done. Mark it done" when the work is already in a later stage, a new date from the Jira forecast or from the planned finish, "Moves with" a task of the same stage, or "Drop it" for a task that is 28 days late or more. Press ✓ to do it, or ✕ to say no. PMOS does not suggest the same thing again after a no. **Yes to all** takes every suggestion in view in one press. While the older late dates are folded, it reads **Yes to these 5** and takes only the five you see. Each change has Undo for a moment.
178
+ - **Late** lists the dates that passed. For each one, PMOS suggests what to do: "It looks done. Mark it done" when the work is already in a later stage, a new date from the Jira forecast or from the planned finish, "Moves with" a task of the same stage, or "Drop it" for a task that is 28 days late or more. PMOS's fix is the grey line under the title, after ✦. Each late date has a badge, for example "8 days late". Press ✓ to do it, or ✕ to say no. PMOS does not suggest the same thing again after a no. Over the rows, one blue box says "PMOS has a fix for all 3 late dates": its ✓ takes every suggestion in view in one press, and its ✕ says no to all of them. While the older late dates are folded, it says "these 5" and takes only the five you see. Each change has Undo for a moment.
179
179
  - PMOS cannot write a Jira date or an initiative's planned finish, so for those it suggests one of three things. "It looks done. Mark it done" appears when the work is already past Deliver. "Drop this date" appears when the date is 90 days late or more. Either way, Events stops listing the date. For any other late date, PMOS suggests "Ask the owner for a new date", and ✓ adds that ask to your own tasks, due today. A date that is at risk in Coming up gets "Ask the owner if 27 Nov holds".
180
180
  - Late shows the newest five dates first. One line under them, such as "16 more late, the oldest 350 days", opens the rest.
181
- - **Today** holds today's dates, with one press to the act itself: read the draft of a report, mark a task done, or open the work a meeting is about. A report shows by its name and the day in words ("IDPF sprint biweekly update · 28 Oct"). Report drafts more than 14 days old are one row, "9 old report drafts", where PMOS suggests **Drop them** with ✓ and ✕. ✓ takes them off Events, with **Undo**, and the drafts stay in the Library.
182
- - **Coming up** holds the next 30 days (meetings: the next 7). A day with three meetings or more is one line, such as "Fri 20 Nov · 5 meetings". Press it to see them. Milestones, tasks, deadlines and reports on that day keep their own rows. Only a date at risk carries a suggestion. A date that needs nothing shows nothing.
181
+ - **Today** is a timeline: the dates with no time first, then each one by its time, with a red **now** line between the past and the next ones. Past ones are dashed. Each has one press to the act itself: read the draft of a report, mark a task done, or open the work a meeting is about. A report shows by its name and the day in words ("IDPF sprint biweekly update · 28 Oct"). Report drafts more than 14 days old are one row, "9 old report drafts", where PMOS suggests **Drop them** with ✓ and ✕. ✓ takes them off Events, with **Undo**, and the drafts stay in the Library.
182
+ - **Coming up** holds the next 30 days (meetings: the next 7). A day with three meetings or more is one line, such as "Fri 20 Nov · 5 meetings". Press it to see them. Milestones, tasks, deadlines and reports on that day keep their own rows. Only a date at risk carries a suggestion, in a blue box under its row. A date that needs nothing shows nothing.
183
183
  - Every late or at-risk date has a suggestion. A late task of yours with no later day in any record gets "Move to today". A late Jira ticket gets "Set a new date in Jira", which ✓ adds to your tasks. A late deadline from a source gets "Ask Ang where it stands".
184
- - The delivery milestones after that are one line at the bottom, for example "6 delivery milestones in 2027. The next is 3 Mar: …". Press it to see them.
184
+ - The delivery milestones after that are one line at the bottom of Coming up, for example "Delivery milestones later 6, until 20 Feb". Press it to see them.
185
185
  - A milestone is a diamond. A task is a round dot, a report a small square, and a deadline a purple dot. A meeting is a ring, and focus time is a green ring. Orange is late, amber is at risk.
186
186
  - Point at a row for its tools: a new date, written in place, and the lock. A locked date is fixed: PMOS never suggests a new date for it.
187
187
  - On the right, the small month shows a mark under each day that has a date. Press a day to see only that day; press it again for every day. Press the month name to open the full calendar in the place of the list: **Month** or **Week**, with each day's dates. Press a date to open it, press a day to see that day's rows, and press the back arrow (or Esc) to return to the list.
@@ -219,12 +219,17 @@ The notes of a held meeting look the same wherever you open them: a short summar
219
219
 
220
220
  **Goals** in the navigation answers "Am I on track? What do I do?" for the products you chose at the top left. The product choice and each product's heading show the product's name, such as IDPF, not the name of its folder. When a key result waits on a source, Goals names the tool, such as Confluence, and not a page number. It reads your OKR file as one hierarchy: the North Star, then each objective with its key results, the levers behind them and the initiatives that move them.
221
221
 
222
- 1. The card at the top is the North Star. When PMOS drafted one, press the tick to approve it or the cross to drop it. You can undo either for a moment.
223
- 2. Each key result shows its reading against its target and the days left. A grey dot and a dash mean nothing reads it yet: the line under it says what it waits on. PMOS never shows a number it did not read.
224
- 3. Press a key result to open it with the chat beside it: what PMOS read, the target and time left, the levers, the work that names it, and the source to connect.
225
- 4. Press an initiative to open it. When its outcome check is overdue, the verdict page opens: press the tick and PMOS judges it in the chat.
226
- 5. **Budget** rows show the health budgets that have work in them. **Unlinked** shows the work that names no key result.
227
- 6. Under **⋯**: **Set up** (names to confirm and sources to connect), **Charts and dashboards** (the readings and charts, on the Intelligence page) and **Export CSV**. The filter shows only the key results that slip, are not read, or are read.
222
+ The page is one column of blocks.
223
+
224
+ 1. The top line is the path (**Goals ›** the product), the period, such as Q4 2026, then Search, **+** (New key result) and **⋯**.
225
+ 2. **Where it stands** says what matters now: how many key results are on pace, which one is behind and the work that moves it with its date, a key result with no reading and since when, and the next check. Press a name to open it.
226
+ 3. Under it, PMOS makes one suggestion. It shows **Why**, **PMOS will**, **What changes** and **Based on**. Press the tick to do it, the pencil to change the words first, or the cross to say no. When PMOS drafted a North Star, the tick keeps it and the cross drops it. You can undo either for a moment.
227
+ 4. **North Star**, **Input** and **Guardrail** show their reading, the day it was read and a small line of the readings. A measure that does not exist shows no block.
228
+ 5. **Key results** is one table, grouped by objective, then health budgets, then the work that names no key result. Each row shows the reading against its target, its pace, the work that moves it and its check date. A dash means nothing reads it yet, and the row says what it waits on. PMOS never shows a number it did not read. The tabs show **All**, **Behind**, **No reading** or **On pace**. **Choose columns** adds **Left** (the days left) and **Levers**.
229
+ 6. For work that names no key result, PMOS says which key result it thinks the work moves and the words they share. Press the link button to put the words in the chat box.
230
+ 7. Press a key result to open it with the chat beside it: what PMOS read, the target and time left, the levers, the work that names it, and the source to connect. Press an initiative to open it. When its outcome check is overdue, the verdict page opens.
231
+ 8. **Ask about your goals** at the end is the chat about the product's goals. Ask why a key result is behind, or say a new one.
232
+ 9. Under **⋯**: **Set up** (names to confirm and sources to connect), **Charts and dashboards** (the readings and charts, on the Intelligence page) and **Export CSV**.
228
233
 
229
234
  Reports are routine jobs, so they live in Routine.
230
235
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.656.0",
3
+ "version": "0.658.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.656.0",
9
+ "version": "0.658.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.656.0",
3
+ "version": "0.658.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",
@@ -1,18 +1,24 @@
1
- /* pm/cozy-events-view.js — the markup of Events (slice 6 of the six-place navigation, initiative events-place; board 2, StEvPlan). PURE: no
2
- * DOM, no fetch, so a unit test reads it (events-view.test.mjs).
1
+ /* pm/cozy-events-view.js — the markup of Events (initiative events-place; rebuilt from the PMOS design system's blocks by initiative
2
+ * events-ds-page, board EventsDS on Exploring 3). PURE: no DOM, no fetch, so a unit test reads it (events-view.test.mjs).
3
3
  *
4
- * groupsOf(items, { show, day }) → { late, today, coming, later } the items the page shows, by group; show = the kinds on; day = one day
5
- * listHtml(model, o) the left side: Late (with Yes to all; the newest LATE_SHOWN, then one fold line), Today, Coming up, and the
6
- * later delivery milestones as one fold line. o.open: Set of the folds open ('late', 'later')
7
- * calHtml(model, o) the full calendar in the left column: Month | Week, a back arrow to the list. o: { view, ym, day, show }
8
- * rowHtml(x, today, o) one date: the day, its mark (a diamond for a delivery milestone, round for the rest), what and its kind,
9
- * then what PMOS suggests with ✓ ✕, the act of today, or nothing (a date that needs nothing shows nothing)
10
- * monthHtml(ym, items, o) the small month: a mark under each day that has a date, today ringed, the day picked filled
11
- * showHtml(show, { counts, unread }) Show: the six types (TYPES) with their counts as the filter, which is also the key to the marks; a type whose
12
- * source is not read says so and opens Connectors. countsOf(items, o) · hiddenHtml(items, o): the "Showing …
13
- * only · N more hidden · Show all" line. visible(items, o): the types on and the chip (o.scopeOk)
14
- * Round 2: each row's grey line starts with its type word (lineOf); a coming day with BUSY meetings or more is one line that opens them;
15
- * a date stated in a source opens the line that states it under the row (o.open has 'src:<key>').
4
+ * Main + side. Every group is a system block, and this file writes only the system's part classes (pm-block, pm-li, pm-sug, pm-ev,
5
+ * pm-badge, pm-fold, pm-cal, pm-leg, pm-tabs, pm-btn); the evp-* names beside them are hooks for the page code and the placement sheet.
6
+ * groupsOf(items, { show, day }) → { late, today, coming, later } the items the page shows, by group; show = the types on; day = one day
7
+ * listHtml(model, o) the main column: Late (a List block: one Suggestion "PMOS has a fix for all N late dates" with ✓ ✕, then
8
+ * each row with PMOS's fix as its grey line, a late Badge and ✓ ✕; the newest LATE_SHOWN, then one fold),
9
+ * Today (todayHtml), Coming up (a List block; a Suggestion under a date only where it is at risk; the later
10
+ * delivery milestones as one pm-fold line at its foot). o: { show, day, busy, open, now: 'HH:MM' }
11
+ * todayHtml(rows, o) Today as a Timeline block: the time, then an Event (pm-ev), the now line where the clock is, ended dashed
12
+ * calHtml(model, o) the full calendar in the main column, a Calendar block: Month | Week Tabs, a back arrow to the list
13
+ * rowHtml(x, o) one date as a ListRow: the day, its mark (a diamond for a delivery milestone, round for the rest), the title
14
+ * and its grey line, the late Badge, the acts (✓ ✕, the act of today) and on hover the tools (a new day, Fixed)
15
+ * monthHtml(ym, items, o) the side's Calendar block: the month name (opens the full calendar), ‹ ›, the days with a mark per kind,
16
+ * today ringed, the day picked filled, and the hint
17
+ * showHtml(show, { counts, unread }) Show, a flat block: the six types (TYPES) with their counts as the filter, which is also the key to the
18
+ * marks; a type whose source is not read says so and opens Connectors. countsOf(items, o) · hiddenHtml(items,
19
+ * o): the "Showing … only · N more hidden · Show all" line. visible(items, o): the types on and the chip
20
+ * Each row's grey line starts with its type word (lineOf); a coming day with BUSY meetings or more is one line that opens them; a date
21
+ * stated in a source opens the line that states it under the row (o.open has 'src:<key>').
16
22
  * KINDS · KIND_LABEL · LATE_SHOWN · shiftMonth(ym, n) · weekOf(day)
17
23
  * Text from records goes through esc(). Every icon-only button has an aria-label. The words say PMOS. */
18
24
 
@@ -70,38 +76,46 @@ export function groupsOf(items, o = {}) {
70
76
  return { late: g('late'), today: g('today'), coming: g('coming'), later: g('later') };
71
77
  }
72
78
 
73
- /** The day column: what the date is and how far it is. */
79
+ /** The day column: the date, or the time today. How late a date is goes on its Badge, not here. */
74
80
  function dayCell(x, today) {
75
- if (x.group === 'today' && x.time) return { b: x.time, s: x.until ? 'to ' + x.until : 'Today' };
76
- if (x.group === 'today') return { b: 'Today', s: weekday(x.date) + ' ' + shortDay(x.date, today) };
81
+ if (x.group === 'today' && x.time) return { b: x.time, s: x.until ? 'to ' + x.until : '' };
82
+ if (x.group === 'today') return { b: 'Today', s: '' };
77
83
  const n = between(today, x.date);
78
- if (x.group === 'late') return { b: shortDay(x.date, today), s: -n + ' ' + plural(-n, 'day', 'days') + ' late' };
84
+ if (x.group === 'late') return { b: shortDay(x.date, today), s: '' };
79
85
  return { b: shortDay(x.date, today), s: x.time ? weekday(x.date) + ' ' + x.time : 'in ' + n + ' ' + plural(n, 'day', 'days') };
80
86
  }
81
87
  /** The mark: a diamond for a delivery milestone, round for the rest; the tone says late or at risk. */
82
88
  const MARK = { milestone: 'evp-dm', meeting: 'evp-mt', focus: 'evp-fo', task: 'evp-rd', report: 'evp-rp', deadline: 'evp-dl' };
83
89
  export const markOf = (type, tone) => `<i class="evp-k ${MARK[type] || 'evp-rd'}${tone ? ' ' + tone : ''}" aria-hidden="true"></i>`;
84
90
  export const markHtml = (x) => markOf(typeOf(x), x.tone);
91
+ const STAR = (w = 14) => svg(ICON.spark, w).replace('class="pm-ic"', 'class="pm-ic pm-star"');
85
92
 
86
- /** One date. o: { today, busy: Set<key> of rows whose press is on its way } */
87
- export function rowHtml(x, o = {}) {
88
- const today = o.today;
89
- // a meeting under an opened busy day: only its time, the day row above names the day
90
- const d = o.child ? { b: x.time || 'All day', s: x.until ? 'to ' + x.until : '' } : dayCell(x, today);
93
+ /** The Suggestion part for one date, under its row (Coming up: only where a date is at risk). */
94
+ function sugLine(x) {
95
+ const s = x.suggest;
96
+ return `<div class="evp-sug pm-sug" role="group" aria-label="PMOS suggests" data-key="${esc(x.key)}">${STAR(16)}<span class="say" title="${esc(s.why || '')}">${esc(s.text)}</span>`
97
+ + `<button type="button" class="evp-ib pm-btn primary" data-evp-yes aria-label="Yes: ${esc(s.text)}" title="Yes">${svg(ICON.yes, 16)}</button>`
98
+ + `<button type="button" class="evp-ib pm-btn outline" data-evp-no aria-label="No: ${esc(s.text)}" title="No">${svg(ICON.no, 16)}</button></div>`;
99
+ }
100
+ /** The what of a row: the title (a button when it opens something) and its grey line. In Late the grey line is PMOS's fix (✦). */
101
+ function whatHtml(x, o, fixLine) {
91
102
  const kindWord = TYPE_WORD[typeOf(x)];
92
103
  // a row whose name is its type ("Focus time") does not say the type again
93
104
  const same = String(x.title || '').trim().toLowerCase() === String(kindWord || '').toLowerCase();
94
- const small = same ? (x.line ? `<small>${esc(lineText(x))}</small>` : '') : `<small><em class="evp-ty">${esc(kindWord)}</em>${x.line ? ' · ' + esc(lineText(x)) : ''}</small>`;
95
- const what = `<b>${esc(x.title)}</b>${small}`;
105
+ const w = fixLine ? `<span class="w evp-fixl">${STAR(14)}<span title="${esc(x.suggest.why || '')}">${esc(x.suggest.text)}</span></span>`
106
+ : same ? (x.line ? `<span class="w">${esc(lineText(x))}</span>` : '') : `<span class="w"><em class="evp-ty">${esc(kindWord)}</em>${x.line ? ' · ' + esc(lineText(x)) : ''}</span>`;
107
+ const t = `<span class="t">${esc(x.title)}</span>`;
96
108
  const srcOpen = x.source && o.open && o.open.has('src:' + x.key);
97
- const t = x.source ? `<button type="button" class="evp-t" data-evp-src aria-expanded="${srcOpen ? 'true' : 'false'}" aria-label="${esc(x.title)}. ${esc(lineOf(x))}. Show what was said">${what}</button>`
98
- : x.work || x.task || x.own || x.link ? `<button type="button" class="evp-t" data-evp-open aria-label="${esc(x.title)}. ${esc(lineOf(x))}. Open it">${what}</button>` : `<span class="evp-t">${what}</span>`;
109
+ if (x.source) return `<button type="button" class="evp-t txt" data-evp-src aria-expanded="${srcOpen ? 'true' : 'false'}" aria-label="${esc(x.title)}. ${esc(lineOf(x))}. Show what was said">${t}${w}</button>`;
110
+ if (x.work || x.task || x.own || x.link) return `<button type="button" class="evp-t txt" data-evp-open aria-label="${esc(x.title)}. ${esc(lineOf(x))}. Open it">${t}${w}</button>`;
111
+ return `<span class="evp-t txt">${t}${w}</span>`;
112
+ }
113
+ /** A row's acts: ✓ ✕ for PMOS's fix in Late (always shown), else the act of today; then the tools (a new day, Fixed) on hover. */
114
+ function actsHtml(x, o, fixLine) {
99
115
  let a = '';
100
- if (x.suggest) {
101
- const s = x.suggest;
102
- a = `<span class="evp-sg"><i class="evp-sp pm-star" aria-hidden="true">${svg(ICON.spark, 14)}</i><span class="say" title="${esc(s.why || '')}">${esc(s.text)}</span></span>`
103
- + `<button type="button" class="evp-ib evp-yes pm-btn primary" data-evp-yes aria-label="Yes: ${esc(s.text)}" title="Yes">${svg(ICON.yes, 15)}</button>`
104
- + `<button type="button" class="evp-ib pm-btn outline" data-evp-no aria-label="No: ${esc(s.text)}" title="No">${svg(ICON.no, 15)}</button>`;
116
+ if (fixLine) {
117
+ a = `<button type="button" class="evp-ib pm-btn" data-evp-yes aria-label="Yes: ${esc(x.suggest.text)}" title="Yes, do it">${svg(ICON.yes, 16)}</button>`
118
+ + `<button type="button" class="evp-ib pm-btn" data-evp-no aria-label="No: ${esc(x.suggest.text)}" title="No">${svg(ICON.no, 16)}</button>`;
105
119
  } else if (x.act && x.act.href) {
106
120
  a = `<a class="evp-go pm-chip" href="${esc(x.act.href)}">${esc(x.act.label)}${svg(ICON.go, 14)}</a>`;
107
121
  } else if (x.group === 'today' && x.kind === 'meeting' && x.work && x.work.title) {
@@ -110,23 +124,40 @@ export function rowHtml(x, o = {}) {
110
124
  } else if (x.group === 'today' && (x.task || x.own)) {
111
125
  a = `<button type="button" class="evp-ib pm-btn" data-evp-done aria-label="Mark it done: ${esc(x.title)}" title="Mark it done">${svg(ICON.done, 16)}</button>`;
112
126
  }
113
- // the tools show on a row you point at or step to: a new day (edit in place) and Fixed
114
127
  const tools = (x.editable && !(x.fixed && x.kind === 'milestone') ? `<label class="evp-ib evp-dt pm-btn" title="Set a date"><span class="vh">Set a date for ${esc(x.title)}</span>${svg(ICON.date, 15)}<input type="date" data-evp-date value="${esc(x.date)}" /></label>` : '')
115
128
  + (x.canFix ? `<button type="button" class="evp-ib evp-fx pm-btn" data-evp-fix aria-pressed="${x.fixed ? 'true' : 'false'}" aria-label="${x.fixed ? 'Fixed date. Press to let PMOS suggest a new date' : 'Mark as a fixed date'}" title="${x.fixed ? 'Fixed date' : 'Fixed date: never move it'}">${svg(ICON.lock, 15)}</button>` : '');
116
- // a date stated in a source opens the line that states it, under the row: who said it, when, and a link to the source
117
- // the sentence from the source only when it says more than the title; else who and when, and the link (say it once)
118
- const said = x.source && x.source.text && x.source.text.trim().toLowerCase() !== String(x.title).trim().toLowerCase() ? `<q>${esc(x.source.text)}</q>` : '';
119
- const src = srcOpen ? `<div class="evp-src" data-key="${esc(x.key)}">${said}<span>${esc([x.source.who, x.source.said ? shortDay(x.source.said, today) : ''].filter(Boolean).join(', '))}</span>`
129
+ return (a ? `<span class="evp-a">${a}</span>` : '') + (tools ? `<span class="evp-tl acts">${tools}</span>` : '');
130
+ }
131
+ /** The line a date stated in a source opens, under the row: who said it, when, and a link to the source. The sentence only when it says
132
+ * more than the title (say it once). */
133
+ function srcHtml(x, o) {
134
+ if (!(x.source && o.open && o.open.has('src:' + x.key))) return '';
135
+ const said = x.source.text && x.source.text.trim().toLowerCase() !== String(x.title).trim().toLowerCase() ? `<q>${esc(x.source.text)}</q>` : '';
136
+ return `<div class="evp-src pm-meta" data-key="${esc(x.key)}">${said}<span>${esc([x.source.who, x.source.said ? shortDay(x.source.said, o.today) : ''].filter(Boolean).join(', '))}</span>`
120
137
  + (x.source.link ? `<a class="evp-go pm-chip" href="${esc(x.source.link)}" target="_blank" rel="noopener">Open in ${esc(x.source.from)}${svg(ICON.go, 14)}</a>` : '')
121
- + (x.work ? `<button type="button" class="evp-go pm-chip" data-evp-open>Open the work${svg(ICON.go, 14)}</button>` : '') + '</div>' : '';
138
+ + (x.work ? `<button type="button" class="evp-go pm-chip" data-evp-open>Open the work${svg(ICON.go, 14)}</button>` : '') + '</div>';
139
+ }
140
+
141
+ /** One date, as a ListRow: the day, its mark, what (title and grey line), the late Badge, the acts. Late puts PMOS's fix in the grey line
142
+ * with ✓ ✕ on the row; Coming up puts a suggestion in a Suggestion part under the row. o: { today, busy: Set<key> on its way, open } */
143
+ export function rowHtml(x, o = {}) {
144
+ const today = o.today;
145
+ // a meeting under an opened busy day: only its time, the day row above names the day
146
+ const d = o.child ? { b: x.time || 'All day', s: x.until ? 'to ' + x.until : '' } : dayCell(x, today);
147
+ const fixLine = !!(x.suggest && x.group === 'late');
148
+ const late = x.group === 'late' ? -between(today, x.date) : 0;
149
+ const badge = late > 0 ? `<span class="pm-badge alert">${late} ${plural(late, 'day', 'days')} late</span>` : ''; // at risk shows as the mark's tone and, where PMOS has a fix, the Suggestion under the row
150
+ const kindWord = TYPE_WORD[typeOf(x)];
122
151
  return `<div class="evp-r${o.child ? ' evp-kid' : ''}${x.fixed ? ' fixed' : ''}${o.busy && o.busy.has(x.key) ? ' busy' : ''} pm-li" data-key="${esc(x.key)}" data-kind="${esc(x.kind)}" data-type="${esc(typeOf(x))}" aria-label="${esc(kindWord)}">`
123
- + `<span class="evp-d ${x.tone || ''}"><b>${esc(d.b)}</b><small>${esc(d.s)}${x.fixed ? ' · fixed' : ''}</small></span>${markHtml(x)}${t}`
124
- + `<span class="evp-a${x.suggest ? ' pm-sug' : ''}">${a}</span><span class="evp-tl">${tools}</span></div>${src}`;
152
+ + `<span class="evp-d ${x.tone || ''}"><b>${esc(d.b)}</b>${d.s || x.fixed ? `<small>${esc(d.s)}${x.fixed ? (d.s ? ' · ' : '') + 'fixed' : ''}</small>` : ''}</span>${markHtml(x)}${whatHtml(x, o, fixLine)}`
153
+ + `${badge}${actsHtml(x, o, fixLine)}</div>${srcHtml(x, o)}${x.suggest && !fixLine ? sugLine(x) : ''}`;
125
154
  }
126
155
 
127
- function groupHtml(key, label, rows, o, head = '', tail = '', n = rows.length, body = null) {
128
- if (!rows.length) return ''; // zero is silence
129
- return `<section class="evp-g evp-${key} pm-block list" aria-label="${esc(label)}"><div class="head"><h2 class="pm-h">${esc(label)}<small>${n}</small></h2><span class="sp"></span>${head}</div><div class="evp-b rows">${body != null ? body : rows.map((x) => rowHtml(x, o)).join('')}</div>${tail}</section>`;
156
+ /** A List block: its heading and count, then the rows. Zero is silence. */
157
+ function groupHtml(key, label, rows, o, lead = '', tail = '', n = rows.length, body = null, sub = '') {
158
+ if (!rows.length) return '';
159
+ return `<section class="evp-g evp-${key} pm-block list" aria-label="${esc(label)}"><div class="head"><h2 class="pm-h">${esc(label)}</h2>${sub || (n ? `<span class="pm-meta">${n}</span>` : '')}<span class="sp"></span></div>`
160
+ + `${lead}<div class="evp-b rows">${body != null ? body : rows.map((x) => rowHtml(x, o)).join('')}</div>${tail}</section>`;
130
161
  }
131
162
  const isMeet = (x) => x.kind === 'meeting';
132
163
  /** Coming up: a day with BUSY meetings or more is one line, "Fri 20 Nov · 5 meetings", that opens them; every other date keeps its row. */
@@ -143,11 +174,30 @@ function comingBody(rows, o) {
143
174
  done.add(x.date);
144
175
  const k = 'day:' + x.date, isOpen = open.has(k), dayRows = rows.filter((y) => y.date === x.date && isMeet(y));
145
176
  const word = dayRows.every((y) => typeOf(y) === 'focus') ? plural(n, 'focus time', 'focus times') : plural(n, 'meeting', 'meetings');
146
- html += `<button type="button" class="evp-r evp-day pm-li" data-evp-fold="${esc(k)}" aria-expanded="${isOpen ? 'true' : 'false'}"><span class="evp-d"><b>${esc(shortDay(x.date, o.today))}</b><small>${esc(weekday(x.date))}</small></span>${markOf('meeting')}<span class="evp-t"><b>${esc(weekday(x.date) + ' ' + shortDay(x.date, o.today))} · ${n} ${word}</b><small>${esc(dayRows.slice(0, 3).map((y) => (y.time ? y.time + ' ' : '') + y.title).join(', ') + (n > 3 ? ', …' : ''))}</small></span><i class="evp-fi" aria-hidden="true">${svg(ICON.go, 14)}</i></button>`;
177
+ html += `<button type="button" class="evp-r evp-day pm-li" data-evp-fold="${esc(k)}" aria-expanded="${isOpen ? 'true' : 'false'}"><span class="evp-d"><b>${esc(shortDay(x.date, o.today))}</b><small>${esc(weekday(x.date))}</small></span>${markOf('meeting')}<span class="txt"><span class="t">${esc(weekday(x.date) + ' ' + shortDay(x.date, o.today))} · ${n} ${word}</span><span class="w">${esc(dayRows.slice(0, 3).map((y) => (y.time ? y.time + ' ' : '') + y.title).join(', ') + (n > 3 ? ', …' : ''))}</span></span><i class="evp-fi" aria-hidden="true">${svg(ICON.go, 14)}</i></button>`;
147
178
  if (isOpen) html += dayRows.map((y) => rowHtml(y, { ...o, child: true })).join('');
148
179
  }
149
180
  return html;
150
181
  }
182
+ /** Today as a Timeline block: the dates with no time first, then each timed one by its time as an Event, the now line where the clock is,
183
+ * an Event that has ended dashed. o.now: 'HH:MM' (the page's clock); no clock, no now line. */
184
+ export function todayHtml(rows, o = {}) {
185
+ if (!rows.length) return '';
186
+ const untimed = rows.filter((x) => !x.time), timed = rows.filter((x) => x.time).sort((a, b) => String(a.time).localeCompare(String(b.time)));
187
+ const now = /^\d{2}:\d{2}$/.test(String(o.now || '')) ? o.now : null;
188
+ const ev = (x) => {
189
+ const over = now && (x.until || x.time) < now;
190
+ const fixLine = !!x.suggest;
191
+ return `<div class="evp-tr${o.busy && o.busy.has(x.key) ? ' busy' : ''}" data-key="${esc(x.key)}" data-kind="${esc(x.kind)}" data-type="${esc(typeOf(x))}"><span class="evp-tm pm-meta">${esc(x.time || (x.kind === 'meeting' ? 'All day' : 'Due'))}</span>`
192
+ + `<div class="evp-ev pm-ev${over ? ' over' : ''}${x.fixed ? ' fixed' : ''}">${markHtml(x)}${whatHtml(x, o, fixLine)}${actsHtml(x, o, fixLine)}</div></div>${srcHtml(x, o)}`;
193
+ };
194
+ const line = '<div class="evp-tr evp-nowl" aria-label="Now"><span class="evp-tm pm-meta">now</span><span class="evp-nl" aria-hidden="true"></span></div>';
195
+ let body = untimed.map(ev).join(''), placed = !now;
196
+ for (const x of timed) { if (!placed && x.time > now) { body += line; placed = true; } body += ev(x); }
197
+ if (!placed && timed.length) body += line;
198
+ const day = o.today ? weekday(o.today) + ' ' + shortDay(o.today, o.today) : '';
199
+ return `<section class="evp-g evp-now pm-block" aria-label="Today"><div class="head"><h2 class="pm-h">Today</h2><span class="pm-meta">${esc(day)}</span><span class="sp"></span></div><div class="evp-tl-list">${body}</div></section>`;
200
+ }
151
201
  /** The line over the list when a filter hides dates: "Showing milestones only · 14 more hidden · Show all". o: { show, scopeOk, scopeWords } */
152
202
  export function hiddenHtml(items, o = {}) {
153
203
  const on = new Set(o.show || TYPES);
@@ -162,34 +212,37 @@ export function hiddenHtml(items, o = {}) {
162
212
  // few types on: name them ("milestones only"); most on: name what is off ("all but meetings")
163
213
  const tw = !typesCut ? (scoped ? 'the dates' : '') : onL.length <= 3 ? and(onL) : 'all but ' + and(offL);
164
214
  const what = tw + (scoped ? ' of ' + o.scopeWords : '') + (typesCut && onL.length > 3 ? '' : ' only');
165
- return `<p class="evp-hid" role="status">Showing ${esc(what)} · ${hidden} more hidden · <button type="button" data-evp-showall>Show all</button></p>`;
215
+ return `<p class="evp-hid pm-meta" role="status">Showing ${esc(what)} · ${hidden} more hidden · <button type="button" class="pm-chip" data-evp-showall>Show all</button></p>`;
166
216
  }
167
- const fold = (key, open, text) => `<button type="button" class="evp-fold pm-fold" data-evp-fold="${key}" aria-expanded="${open ? 'true' : 'false'}"><i aria-hidden="true">${svg(ICON.go, 14)}</i><span>${text}</span></button>`;
217
+ const fold = (key, open, text, sub = '') => `<button type="button" class="evp-fold pm-fold" data-evp-fold="${key}" aria-expanded="${open ? 'true' : 'false'}"><i aria-hidden="true">${svg(ICON.go, 14)}</i><span>${text}</span>${sub ? `<span class="evp-fsub">${sub}</span>` : ''}</button>`;
168
218
 
169
219
  /** The late rows in view: the newest LATE_SHOWN while the rest are folded, else all. Yes to all takes these. */
170
220
  export function lateInView(model, o = {}) {
171
221
  const late = groupsOf(model.items, o).late;
172
222
  return !o.day && late.length > LATE_SHOWN + 1 && !(o.open && o.open.has('late')) ? late.slice(0, LATE_SHOWN) : late;
173
223
  }
174
- /** The left side. model: { today, items, later }; o: { show, day, busy } */
224
+ /** The main column. model: { today, items, later }; o: { show, day, busy, open, now } */
175
225
  export function listHtml(model, o = {}) {
176
226
  const today = model.today;
177
227
  const G = groupsOf(model.items, o);
178
228
  const open = o.open || new Set();
179
- // Yes to all says yes only to what is in view: "Yes to these 5" while the older late rows are folded (as the Backlog does)
229
+ // the one Suggestion over Late: yes (and no) only to what is in view, "these 5" while the older late rows are folded (as the Backlog does)
180
230
  const seen = lateInView(model, o), yes = seen.filter((x) => x.suggest).length, folded = seen.length < G.late.length;
181
- const all = yes > 1 ? `<button type="button" class="evp-all pm-chip" data-evp-all>${folded ? 'Yes to these' : 'Yes to all'} ${yes}</button>` : '';
231
+ const which = folded ? 'these ' + yes : yes === seen.length ? 'all ' + yes : yes;
232
+ const all = yes > 1 ? `<div class="evp-all pm-sug" role="group" aria-label="PMOS suggests">${STAR(16)}<span class="say">PMOS has a fix for ${which} late dates. Each one is under its row.</span>`
233
+ + `<button type="button" class="evp-ib pm-btn primary" data-evp-all aria-label="Yes to ${which}" title="Yes to ${which}">${svg(ICON.yes, 16)}</button>`
234
+ + `<button type="button" class="evp-ib pm-btn outline" data-evp-noall aria-label="No to ${which}" title="No">${svg(ICON.no, 16)}</button></div>` : '';
182
235
  const ro = { today, busy: o.busy, open };
183
236
  let later = '';
184
237
  const on = new Set(o.show || TYPES);
185
238
  if (o.day) {
186
239
  later = G.later.length ? groupHtml('later', 'Later', G.later, ro) : '';
187
240
  } else if (on.has('milestone') && G.later.some((x) => x.kind === 'milestone')) {
188
- // the far milestones the filters let through (the chip narrows this line too)
189
- const far = G.later.filter((x) => x.kind === 'milestone'), n = far.length, nx = far[0];
241
+ // the far milestones the filters let through (the chip narrows this line too): one fold line at the foot of Coming up
242
+ const far = G.later.filter((x) => x.kind === 'milestone'), n = far.length, last = far[far.length - 1];
190
243
  const years = [...new Set(far.map((x) => x.date.slice(0, 4)))], year = years.length === 1 && years[0] !== String(today).slice(0, 4) ? years[0] : null;
191
- later = fold('later', open.has('later'), `${n} ${plural(n, 'delivery milestone', 'delivery milestones')} ${year ? 'in ' + esc(year) : 'after the next 30 days'}. The next is ${esc(year ? shortDay(nx.date) : shortDay(nx.date, today))}: ${esc(nx.title)}`)
192
- + (open.has('later') && far.length ? `<div class="evp-b evp-far pm-block list"><div class="rows">${far.map((x) => rowHtml(x, ro)).join('')}</div></div>` : '');
244
+ later = fold('later', open.has('later'), year ? `Delivery milestones in ${esc(year)}` : 'Delivery milestones later', `${n}, until ${esc(shortDay(last.date, today))}`)
245
+ + (open.has('later') && far.length ? `<div class="evp-b evp-far rows">${far.map((x) => rowHtml(x, ro)).join('')}</div>` : '');
193
246
  }
194
247
  // Late: the newest first (the model sorts them), LATE_SHOWN of them, then one line that opens the rest
195
248
  let lateRows = G.late, lateTail = '';
@@ -198,7 +251,9 @@ export function listHtml(model, o = {}) {
198
251
  if (!open.has('late')) lateRows = G.late.slice(0, LATE_SHOWN);
199
252
  lateTail = fold('late', open.has('late'), open.has('late') ? 'Show only the newest ' + LATE_SHOWN : `${rest} more late, the oldest ${oldest} ${plural(oldest, 'day', 'days')}`);
200
253
  }
201
- const body = groupHtml('late', 'Late', lateRows, ro, all, lateTail, G.late.length) + groupHtml('now', 'Today', G.today, ro) + groupHtml('coming', 'Coming up', G.coming, ro, '', '', G.coming.length, o.day ? null : comingBody(G.coming, ro)) + later;
254
+ const coming = G.coming.length ? groupHtml('coming', 'Coming up', G.coming, ro, '', o.day ? '' : later, 0, o.day ? null : comingBody(G.coming, ro))
255
+ : !o.day && later ? `<section class="evp-g evp-coming pm-block list" aria-label="Coming up"><div class="head"><h2 class="pm-h">Coming up</h2><span class="sp"></span></div>${later}</section>` : '';
256
+ const body = groupHtml('late', 'Late', lateRows, ro, all, lateTail, G.late.length) + todayHtml(G.today, { ...ro, now: o.now }) + coming + (o.day ? later : '');
202
257
  if (body) return body;
203
258
  if (o.day) return `<p class="evp-quiet pm-meta">Nothing has a date on ${esc(weekday(o.day) + ' ' + shortDay(o.day, today))}.</p>`;
204
259
  return '<p class="evp-quiet pm-meta">Nothing is late, and nothing has a date in the next 30 days.</p>';
@@ -210,15 +265,17 @@ export function shiftMonth(ym, n) {
210
265
  const t = y * 12 + (m - 1) + n;
211
266
  return Math.floor(t / 12) + '-' + String((t % 12) + 1).padStart(2, '0');
212
267
  }
213
- /** The small month of ym ('YYYY-MM'), Monday first. o: { today, day, show } */
268
+ /** The Calendar block of ym ('YYYY-MM'), Monday first: the month name opens the full calendar (Month and Week), ‹ › move it; a mark per
269
+ * kind under each day that has a date, today ringed, the day picked filled. o: { today, day, show } */
214
270
  export function monthHtml(ym, items, o = {}) {
215
271
  const [y, m] = ym.split('-').map(Number);
216
272
  const byDay = new Map();
217
273
  for (const x of visible(items, o)) { if (!byDay.has(x.date)) byDay.set(x.date, []); byDay.get(x.date).push(x); }
218
274
  const first = Date.UTC(y, m - 1, 1);
219
275
  const lead = (new Date(first).getUTCDay() + 6) % 7;
220
- let cells = ['M', 'T', 'W', 'T', 'F', 'S', 'S'].map((d) => `<span class="evp-mh" aria-hidden="true">${d}</span>`).join('');
221
- for (let i = 0; i < 42; i++) {
276
+ const len = new Date(Date.UTC(y, m, 0)).getUTCDate(), cellsN = Math.ceil((lead + len) / 7) * 7; // whole weeks only
277
+ let cells = ['M', 'T', 'W', 'T', 'F', 'S', 'S'].map((d) => `<span class="pm-meta" aria-hidden="true">${d}</span>`).join('');
278
+ for (let i = 0; i < cellsN; i++) {
222
279
  const t = new Date(first + (i - lead) * 86400000);
223
280
  const k = t.toISOString().slice(0, 10), out = t.getUTCMonth() !== m - 1;
224
281
  const xs = byDay.get(k) || [];
@@ -226,22 +283,25 @@ export function monthHtml(ym, items, o = {}) {
226
283
  const seen = new Set(), marks = [];
227
284
  for (const x of xs) { const sig = typeOf(x) + '|' + (x.tone || ''); if (!seen.has(sig) && marks.length < 3) { seen.add(sig); marks.push(markHtml(x)); } }
228
285
  const lab = `${t.getUTCDate()} ${MONTH[t.getUTCMonth()]}${xs.length ? ', ' + xs.length + ' ' + plural(xs.length, 'date', 'dates') : ''}`;
229
- cells += `<button type="button" class="evp-md${out ? ' out' : ''}${k === o.today ? ' now' : ''}${k === o.day ? ' on' : ''}" data-evp-day="${k}" aria-pressed="${k === o.day ? 'true' : 'false'}" aria-label="${esc(lab)}">${t.getUTCDate()}<em>${marks.join('')}</em></button>`;
286
+ cells += `<button type="button" class="evp-md${out ? ' out' : ''}${k === o.today ? ' today' : ''}${k === o.day ? ' on' : ''}" data-evp-day="${k}" aria-pressed="${k === o.day ? 'true' : 'false'}" aria-label="${esc(lab)}">${t.getUTCDate()}<em>${marks.join('')}</em></button>`;
230
287
  }
231
- return `<div class="evp-mt-top"><button type="button" class="evp-mn" data-evp-full aria-label="${MONTH[m - 1]} ${y}. Open the full calendar">${MONTH[m - 1]} ${y}</button><button type="button" class="evp-ib pm-btn" data-evp-month="-1" aria-label="The month before" title="The month before">${svg(ICON.back, 16)}</button><button type="button" class="evp-ib pm-btn" data-evp-month="1" aria-label="The month after" title="The month after">${svg(ICON.go, 16)}</button></div>`
232
- + `<div class="evp-mg" role="group" aria-label="${MONTH[m - 1]} ${y}">${cells}</div>`;
288
+ return `<section class="evp-month pm-block" aria-label="${MONTH[m - 1]} ${y}"><div class="head"><button type="button" class="evp-mn pm-tab" data-evp-full aria-label="${MONTH[m - 1]} ${y}. Open the full calendar">${MONTH[m - 1]}${String(y) !== String(o.today || '').slice(0, 4) ? ' ' + y : ''}</button><span class="sp"></span>`
289
+ + `<button type="button" class="evp-ib pm-btn" data-evp-month="-1" aria-label="The month before" title="The month before">${svg(ICON.back, 16)}</button><button type="button" class="evp-ib pm-btn" data-evp-month="1" aria-label="The month after" title="The month after">${svg(ICON.go, 16)}</button></div>`
290
+ + `<div class="evp-mg pm-cal" role="group" aria-label="${MONTH[m - 1]} ${y}">${cells}</div>`
291
+ + '<p class="evp-hint pm-meta">Press a day to see only that day. Press the month for Month and Week.</p></section>';
233
292
  }
234
293
 
235
- /** The key: each type with its mark and how many dates it has, each a switch (every type is on until the PM presses it). A type whose
236
- * source PMOS does not read says so ("Meetings · calendar not connected") and its press opens Settings › Connectors. o: { counts, unread } */
294
+ /** Show: each type with its mark and how many dates it has, each a switch (every type is on until the PM presses it). It is the filter and
295
+ * the key to the marks at once. A type whose source PMOS does not read says so ("Meetings · calendar not connected") and its press opens
296
+ * Settings › Connectors. o: { counts, unread } */
237
297
  export function showHtml(show, o = {}) {
238
298
  const on = new Set(show || TYPES), counts = o.counts || {}, unread = o.unread || {};
239
299
  const rows = TYPES.map((k) => {
240
- if (unread[k] && !counts[k]) return `<button type="button" class="evp-un" data-evp-connect aria-label="${esc(TYPE_LABEL[k])}: ${esc(unread[k])}. Open Connectors">${markOf(k)}<span>${esc(TYPE_LABEL[k])} · ${esc(unread[k])}</span><span class="evp-on" aria-hidden="true">${svg(ICON.go, 14)}</span></button>`;
241
- return `<button type="button" data-evp-show="${k}" aria-pressed="${on.has(k) ? 'true' : 'false'}">${markOf(k)}${esc(TYPE_LABEL[k])}${counts[k] ? `<small>${counts[k]}</small>` : ''}<span class="evp-on" aria-hidden="true">${on.has(k) ? svg(ICON.yes, 14) : ''}</span></button>`;
300
+ if (unread[k] && !counts[k]) return `<button type="button" class="evp-un" data-evp-connect aria-label="${esc(TYPE_LABEL[k])}: ${esc(unread[k])}. Open Connectors">${markOf(k)}<span>${esc(TYPE_LABEL[k])} · ${esc(unread[k])}</span>${svg(ICON.go, 14)}</button>`;
301
+ return `<button type="button" data-evp-show="${k}" aria-pressed="${on.has(k) ? 'true' : 'false'}">${markOf(k)}${esc(TYPE_LABEL[k])}${counts[k] ? `<small>${counts[k]}</small>` : ''}</button>`;
242
302
  });
243
- return `<h3 class="evp-sh pm-h-sm">Show</h3><div class="evp-f" role="group" aria-label="Show">${rows.join('')}</div>`
244
- + '<div class="evp-key"><span><i class="evp-k evp-rd late" aria-hidden="true"></i>Late</span><span><i class="evp-k evp-rd risk" aria-hidden="true"></i>At risk</span></div>';
303
+ return `<section class="evp-show pm-block flat" aria-label="Show"><h3 class="pm-h-sm">Show</h3><div class="evp-f pm-leg" role="group" aria-label="Show">${rows.join('')}</div>`
304
+ + '<div class="evp-key pm-meta"><span><i class="evp-k evp-rd late" aria-hidden="true"></i>Late</span><span><i class="evp-k evp-rd risk" aria-hidden="true"></i>At risk</span></div></section>';
245
305
  }
246
306
  /** How many dates of each type the page lists (Late, Today, Coming up and the far milestones), under the chip. */
247
307
  export function countsOf(items, o = {}) {
@@ -259,12 +319,13 @@ const addDays = (d, n) => new Date(ms(d) + n * 86400000).toISOString().slice(0,
259
319
  /** One date in a calendar cell: its mark and its title; a press opens it, as a row does. */
260
320
  const chipHtml = (x) => `<button type="button" class="evp-cc${x.tone ? ' ' + x.tone : ''}" data-key="${esc(x.key)}" data-evp-open aria-label="${esc(x.title)}. ${esc(lineOf(x))}. Open it">${markHtml(x)}<span>${x.time ? esc(x.time) + ' ' : ''}${esc(x.title)}</span></button>`;
261
321
 
262
- /** The full calendar in the left column. model: { today, items }; o: { view: 'month' | 'week', ym, day, show } */
263
- export function calHtml(model, o = {}) {
322
+ /** The full calendar in the main column, a Calendar block. model: { today, items }; o: { view: 'month' | 'week', ym, day, show } */
323
+ export const calHtml = (model, o = {}) => `<section class="evp-cal pm-block" aria-label="Calendar">${calBody(model, o)}</section>`;
324
+ function calBody(model, o = {}) {
264
325
  const today = model.today, view = o.view === 'week' ? 'week' : 'month';
265
326
  const byDay = new Map();
266
327
  for (const x of visible(model.items, o)) { if (!byDay.has(x.date)) byDay.set(x.date, []); byDay.get(x.date).push(x); }
267
- const seg = `<div class="pm-tabs evp-seg" role="group" aria-label="Calendar view">${['month', 'week'].map((v) => `<button type="button" class="pm-tab" data-evp-view="${v}" aria-pressed="${v === view ? 'true' : 'false'}">${v === 'month' ? 'Month' : 'Week'}</button>`).join('')}</div>`;
328
+ const seg = `<div class="pm-tabs evp-seg" role="tablist" aria-label="Calendar view">${['month', 'week'].map((v) => `<button type="button" role="tab" class="pm-tab" data-evp-view="${v}" aria-selected="${v === view ? 'true' : 'false'}">${v === 'month' ? 'Month' : 'Week'}</button>`).join('')}</div>`;
268
329
  const back = `<button type="button" class="evp-ib pm-btn" data-evp-list aria-label="Back to the list" title="Back to the list">${svg(ICON.back, 18)}</button>`;
269
330
  const dayBtn = (k, label) => `<button type="button" class="evp-cd${k === today ? ' now' : ''}" data-evp-day="${k}" aria-label="${esc(label)}. See only this day">${new Date(ms(k)).getUTCDate()}</button>`;
270
331
  if (view === 'week') {