create-pmos 0.657.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 +9 -3
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +8 -2
- package/workspace/guide/layout.md +5 -5
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-events-view.js +130 -69
- package/workspace/public/pm/cozy-events.css +90 -83
- package/workspace/public/pm/cozy-events.js +44 -15
- package/workspace/public/premium-events.html +20 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "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": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
36
|
{
|
|
37
|
-
"v": "0.
|
|
38
|
-
"at": "2026-11-22T03:
|
|
37
|
+
"v": "0.658.0",
|
|
38
|
+
"at": "2026-11-22T03:38:17.292Z",
|
|
39
39
|
"f": 4,
|
|
40
40
|
"prs": [
|
|
41
41
|
{
|
|
@@ -43,6 +43,12 @@
|
|
|
43
43
|
"t": "Goals is built from the design system's blocks",
|
|
44
44
|
"s": "Goals is built from the design system's blocks",
|
|
45
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"
|
|
46
52
|
}
|
|
47
53
|
]
|
|
48
54
|
},
|
package/payload/KIT-VERSION
CHANGED
|
@@ -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-22T03:
|
|
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-22T03:
|
|
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-22T03:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T03:38:13Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"v": "0.
|
|
4
|
-
"at": "2026-11-22T03:
|
|
3
|
+
"v": "0.658.0",
|
|
4
|
+
"at": "2026-11-22T03:38:17.292Z",
|
|
5
5
|
"f": 4,
|
|
6
6
|
"prs": [
|
|
7
7
|
{
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
"t": "Goals is built from the design system's blocks",
|
|
10
10
|
"s": "Goals is built from the design system's blocks",
|
|
11
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"
|
|
12
18
|
}
|
|
13
19
|
]
|
|
14
20
|
},
|
|
@@ -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
|
|
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.
|
|
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**
|
|
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 "
|
|
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.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "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.
|
|
9
|
+
"version": "0.658.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
/* pm/cozy-events-view.js — the markup of Events (
|
|
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
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
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:
|
|
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 : '
|
|
76
|
-
if (x.group === 'today') return { b: 'Today', s:
|
|
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:
|
|
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
|
-
/**
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
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
|
|
95
|
-
|
|
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
|
-
|
|
98
|
-
|
|
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 (
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
|
124
|
-
+
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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="
|
|
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
|
|
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
|
|
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
|
-
//
|
|
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
|
|
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,
|
|
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'),
|
|
192
|
-
+ (open.has('later') && far.length ? `<div class="evp-b evp-far
|
|
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
|
|
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
|
|
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
|
-
|
|
221
|
-
|
|
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 ? '
|
|
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 `<
|
|
232
|
-
+ `<
|
|
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
|
-
/**
|
|
236
|
-
* source PMOS does not read says so ("Meetings · calendar not connected") and its press opens
|
|
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
|
|
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>` : ''}
|
|
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 `<
|
|
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
|
|
263
|
-
export
|
|
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="
|
|
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') {
|
|
@@ -1,52 +1,75 @@
|
|
|
1
|
-
/* cozy-events.css — Events (
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* pm-
|
|
5
|
-
*
|
|
1
|
+
/* cozy-events.css — Events (initiative events-place), rebuilt from the PMOS design system's blocks (events-ds-page, board EventsDS on
|
|
2
|
+
* Exploring 3). The parts come from pm/komorebi.css: Late and Coming up are List blocks (pm-block list, rows pm-li, the late Badge
|
|
3
|
+
* pm-badge alert, the fold pm-fold), the suggestions are the Suggestion part (pm-sug, a primary Yes and an outline No), Today is a Timeline
|
|
4
|
+
* block (pm-block with pm-ev Events), the side is a Calendar block (pm-block with pm-cal) and Show a flat block (pm-leg), More is a Menu
|
|
5
|
+
* (pm-menu), icon buttons are pm-btn, Month | Week is Tabs and the toast is pm-toast. This sheet only places them and draws what no part
|
|
6
|
+
* has: the type marks, the now line's length and the full calendar's cells. System tokens only. */
|
|
6
7
|
.evp .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
8
|
+
|
|
9
|
+
/* the top line: the path, the product chip, the day picked, then Search, + and More */
|
|
7
10
|
.evp-hd { display: flex; align-items: center; gap: 12px; min-height: 44px; }
|
|
8
|
-
.evp-
|
|
11
|
+
.evp-h1 { margin: 0; font: inherit; }
|
|
12
|
+
.evp-sp { flex: 1; }
|
|
9
13
|
.evp-dayf { margin: 0; gap: 4px; padding: 0 2px 0 10px; height: 32px; background: var(--blue-tint); color: var(--ink); }
|
|
10
14
|
.evp-dayf[hidden] { display: none; }
|
|
11
15
|
.evp-dayf b { font-weight: var(--fw-strong); color: var(--blue); }
|
|
12
|
-
.evp-
|
|
13
|
-
|
|
14
|
-
.evp-
|
|
16
|
+
.evp-mw { position: relative; }
|
|
17
|
+
.evp-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; }
|
|
18
|
+
.evp-menu[hidden] { display: none; }
|
|
19
|
+
.evp-menu button:focus-visible { outline: none; box-shadow: var(--glow); }
|
|
20
|
+
|
|
21
|
+
/* Main + side */
|
|
22
|
+
.evp-grid { display: grid; grid-template-columns: minmax(0, 1100px) 340px; gap: var(--space-16); align-items: start; }
|
|
15
23
|
.evp-left { min-width: 0; display: flex; flex-direction: column; gap: var(--space-16); }
|
|
24
|
+
.evp-side { display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; }
|
|
16
25
|
#evpList { display: flex; flex-direction: column; gap: var(--space-16); }
|
|
17
26
|
#evpList:empty, #evpHid:empty { display: none; }
|
|
18
|
-
.evp .evp-ib.evp-dt { position: relative; }
|
|
19
|
-
.evp .evp-dt input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
|
|
20
|
-
.evp-t:focus-visible, .evp-md:focus-visible, .evp-f button:focus-visible, .evp-mn:focus-visible, .evp-cc:focus-visible, .evp-cd:focus-visible, .evp-cm:focus-visible { outline: none; box-shadow: var(--glow); }
|
|
21
|
-
@media (hover: hover) { .evp-t:hover b { text-decoration: underline; text-underline-offset: 3px; } .evp-mn:hover { text-decoration: underline; text-underline-offset: 3px; } }
|
|
22
|
-
|
|
23
|
-
/* a group: a List block; its heading carries the count, Yes to all sits at the right of the head */
|
|
24
|
-
.evp .evp-g h2 small { margin-left: 8px; font-size: var(--fs-meta); font-weight: var(--fw-regular); color: var(--muted); }
|
|
25
|
-
.evp .evp-late h2 small { color: var(--alert); }
|
|
26
|
-
.evp .evp-all { height: 32px; padding: 0 12px; border: 0; font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--blue); background: var(--blue-tint); cursor: pointer; }
|
|
27
|
-
.evp .evp-far { margin-top: var(--space-8); }
|
|
28
27
|
|
|
29
|
-
/* a row: a ListRow
|
|
30
|
-
.evp .evp-r
|
|
31
|
-
.evp
|
|
32
|
-
.evp-d b {
|
|
33
|
-
.evp-d small { font-
|
|
34
|
-
.evp-
|
|
35
|
-
.evp-t { all: unset; box-sizing: border-box; min-width: 0; cursor: default; display: block; }
|
|
28
|
+
/* a row: a ListRow, day · mark · what · Badge · acts. The tools (a new day, Fixed) show on a row you point at or step into. */
|
|
29
|
+
.evp .evp-r.busy, .evp .evp-tr.busy { opacity: .55; pointer-events: none; }
|
|
30
|
+
.evp-d { flex: none; width: 64px; display: flex; flex-direction: column; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: 20px; color: var(--muted); }
|
|
31
|
+
.evp-d b { font-weight: var(--fw-regular); white-space: nowrap; }
|
|
32
|
+
.evp-d small { font-family: var(--font-sans); font-size: var(--fs-meta); }
|
|
33
|
+
.evp-t { all: unset; box-sizing: border-box; cursor: default; }
|
|
36
34
|
button.evp-t { cursor: pointer; }
|
|
37
|
-
.evp-t
|
|
38
|
-
|
|
39
|
-
.evp-
|
|
40
|
-
.evp-
|
|
41
|
-
.evp-
|
|
35
|
+
.evp-t:focus-visible { outline: none; box-shadow: var(--glow); border-radius: var(--radius-sm); }
|
|
36
|
+
@media (hover: hover) { button.evp-t:hover .t { text-decoration: underline; text-underline-offset: 3px; } }
|
|
37
|
+
.evp-ty { font-style: normal; font-weight: var(--fw-regular); }
|
|
38
|
+
.evp-fixl { display: flex; align-items: center; gap: 6px; color: var(--ink); }
|
|
39
|
+
.evp-fixl > span { overflow: hidden; text-overflow: ellipsis; }
|
|
40
|
+
.evp-a { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
|
|
42
41
|
.evp .evp-go { height: 32px; gap: 4px; padding: 0 6px 0 12px; border: 0; font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--blue); text-decoration: none; cursor: pointer; }
|
|
43
|
-
.evp .evp-go:focus-visible, .evp
|
|
44
|
-
|
|
45
|
-
.evp-
|
|
46
|
-
.evp
|
|
47
|
-
@media (hover: hover) { .evp-r:hover .evp-tl { opacity: 1; } }
|
|
48
|
-
@media (hover: none) { .evp-tl { opacity: 1; } }
|
|
42
|
+
.evp .evp-go:focus-visible, .evp-hid button:focus-visible { outline: none; box-shadow: var(--glow); }
|
|
43
|
+
.evp .evp-ib.evp-dt { position: relative; }
|
|
44
|
+
.evp .evp-dt input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
|
|
45
|
+
.evp .evp-r.fixed .evp-tl { display: flex; }
|
|
49
46
|
.evp .evp-r.fixed .evp-fx { color: var(--blue); }
|
|
47
|
+
@media (hover: none) { .evp .evp-r .evp-tl { display: flex; } }
|
|
48
|
+
|
|
49
|
+
/* the Suggestion parts: the one over Late sits inside the block's padding; one under a date lines up with the title */
|
|
50
|
+
.evp-all { margin: 0 16px 6px; }
|
|
51
|
+
.evp-sug { margin: 2px 16px 8px 104px; }
|
|
52
|
+
.evp-sug .pm-star, .evp-all .pm-star { flex: none; }
|
|
53
|
+
|
|
54
|
+
/* Today: a Timeline block. Each line is the time, then an Event; the now line runs across the Events' column */
|
|
55
|
+
.evp-tl-list { display: flex; flex-direction: column; gap: 10px; }
|
|
56
|
+
.evp-tr { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; }
|
|
57
|
+
.evp-tm { font-family: var(--font-mono); white-space: nowrap; }
|
|
58
|
+
.evp .evp-ev { flex-direction: row; align-items: center; gap: 10px; }
|
|
59
|
+
.evp-ev .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
60
|
+
.evp-ev .t { font-weight: var(--fw-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
61
|
+
.evp-ev .w { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
62
|
+
.evp-ev .evp-tl { display: none; gap: 2px; }
|
|
63
|
+
.evp-ev:hover .evp-tl, .evp-ev:focus-within .evp-tl, .evp-ev.fixed .evp-tl { display: flex; }
|
|
64
|
+
.evp-nowl .evp-tm { color: var(--alert); }
|
|
65
|
+
.evp-nl { height: 2px; background: var(--alert); border-radius: 2px; }
|
|
66
|
+
|
|
67
|
+
/* the fold lines: the rest of Late, and the later delivery milestones at the foot of Coming up */
|
|
68
|
+
.evp .evp-fold i { display: inline-grid; transition: transform var(--duration-quick) var(--ease-drift); }
|
|
69
|
+
.evp .evp-fold[aria-expanded="true"] i { transform: rotate(90deg); }
|
|
70
|
+
.evp .evp-fold:focus-visible { outline: none; box-shadow: var(--glow); }
|
|
71
|
+
.evp-fsub { font-weight: var(--fw-regular); }
|
|
72
|
+
.evp .evp-far { padding: 0 8px 8px; }
|
|
50
73
|
|
|
51
74
|
/* the marks, one per type, the same in the rows, the small month and the key (chart roles from charts.css):
|
|
52
75
|
* a diamond for a delivery milestone, round for a task, a ring for a meeting, a leaf ring for focus time, a square for a report */
|
|
@@ -62,69 +85,59 @@ button.evp-t { cursor: pointer; }
|
|
|
62
85
|
.evp-k.evp-mt.late, .evp-k.evp-fo.late { background: transparent; box-shadow: inset 0 0 0 2px var(--chart-risk); }
|
|
63
86
|
.evp-ty { font-style: normal; font-weight: var(--fw-strong); color: var(--ink); }
|
|
64
87
|
/* the line over the list when a filter hides dates */
|
|
65
|
-
.evp-hid { margin: 0;
|
|
66
|
-
.evp-hid button {
|
|
88
|
+
.evp-hid { margin: 0; }
|
|
89
|
+
.evp-hid button { border: 0; font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--blue); background: var(--blue-tint); cursor: pointer; }
|
|
67
90
|
/* a coming day with many meetings: one line that opens them */
|
|
68
|
-
.evp .evp-day { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
|
|
91
|
+
.evp .evp-day { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
|
|
69
92
|
.evp .evp-day:focus-visible { outline: none; box-shadow: var(--glow); }
|
|
70
93
|
.evp-fi { display: inline-grid; color: var(--muted); transition: transform var(--duration-quick) var(--ease-drift); }
|
|
71
94
|
.evp-day[aria-expanded="true"] .evp-fi { transform: rotate(90deg); }
|
|
72
95
|
/* a date stated in a source: the line that states it, under the row */
|
|
73
|
-
.evp-src { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding:
|
|
96
|
+
.evp-src { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 0 16px 10px 104px; }
|
|
74
97
|
.evp-src q { flex: 1 1 100%; color: var(--ink); }
|
|
98
|
+
.evp-tl-list .evp-src { padding-left: 66px; }
|
|
75
99
|
.evp .evp-r.evp-kid { padding-left: 32px; min-height: 44px; }
|
|
76
|
-
.evp .evp-r.evp-kid .evp-d b { font-size: var(--fs-meta); }
|
|
77
100
|
|
|
78
|
-
.evp-more { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 2px; font-size: var(--fs-meta); color: var(--muted); }
|
|
79
101
|
.evp-quiet { margin: 8px 0; }
|
|
80
102
|
.evp-note { margin: 0; color: var(--alert); }
|
|
81
103
|
.evp-note[hidden] { display: none; }
|
|
82
104
|
|
|
83
|
-
/* the fold lines: the rest of Late, and the far delivery milestones */
|
|
84
|
-
.evp .evp-fold i { display: inline-grid; transition: transform var(--duration-quick) var(--ease-drift); }
|
|
85
|
-
.evp .evp-fold[aria-expanded="true"] i { transform: rotate(90deg); }
|
|
86
|
-
.evp .evp-fold:focus-visible { outline: none; box-shadow: var(--glow); }
|
|
87
|
-
.evp > .evp-grid .evp-left > #evpList > .evp-fold { border-top: 0; border-radius: var(--radius-md); } /* the far milestones line stands alone */
|
|
88
|
-
|
|
89
105
|
/* your own date, written in place */
|
|
90
106
|
.evp-new { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 8px; align-items: center; margin: 0; padding: 8px; border-radius: var(--radius-card); background: var(--card); border: 1px solid var(--line); box-shadow: var(--raise); }
|
|
91
107
|
.evp-new[hidden] { display: none; }
|
|
92
108
|
.evp-new .pm-input { min-width: 0; }
|
|
93
109
|
|
|
94
|
-
/* the
|
|
95
|
-
.evp .evp-
|
|
96
|
-
.evp-
|
|
97
|
-
.evp-
|
|
98
|
-
.evp-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
.evp-md { all: unset; box-sizing: border-box; cursor: pointer; height: 40px; border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: var(--fs-meta); color: var(--ink); transition: background var(--duration-quick) var(--ease-out); }
|
|
102
|
-
@media (hover: hover) { .evp-md:hover { background: var(--card); } }
|
|
110
|
+
/* the side: the Calendar block (buttons in the pm-cal grid: today ringed, the day picked filled, a mark per kind under a day), then Show */
|
|
111
|
+
.evp .evp-mn { font-size: var(--fs-body); color: var(--ink); }
|
|
112
|
+
.evp-mn:focus-visible { outline: none; box-shadow: var(--glow); }
|
|
113
|
+
.evp-mg .pm-meta { height: 28px; line-height: 28px; }
|
|
114
|
+
.evp-md { all: unset; box-sizing: border-box; cursor: pointer; height: 36px; border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: var(--fs-meta); color: var(--ink); }
|
|
115
|
+
@media (hover: hover) { .evp-md:hover { background: var(--well); } }
|
|
116
|
+
.evp-md:focus-visible { outline: none; box-shadow: var(--glow); }
|
|
103
117
|
.evp-md.out { color: var(--muted); }
|
|
104
|
-
.evp-md.
|
|
118
|
+
.evp-md.today { box-shadow: var(--glow); font-weight: var(--fw-strong); }
|
|
105
119
|
.evp-md.on { background: var(--blue); color: var(--on-blue); }
|
|
106
|
-
.evp-md em { display: flex; gap: 3px; height:
|
|
107
|
-
.evp-md em .evp-k { width:
|
|
120
|
+
.evp-md em { display: flex; gap: 3px; height: 5px; }
|
|
121
|
+
.evp-md em .evp-k { width: 5px; height: 5px; }
|
|
108
122
|
.evp-md.on em .evp-k { background: var(--on-blue); box-shadow: none; }
|
|
109
|
-
.evp-
|
|
110
|
-
.evp-
|
|
111
|
-
.evp-f
|
|
112
|
-
.evp-f button
|
|
113
|
-
.evp-
|
|
114
|
-
.evp-f button small { font-size: var(--fs-meta); color: var(--muted); }
|
|
115
|
-
.evp-f button.evp-un { color: var(--muted);
|
|
116
|
-
.evp-f button.evp-un
|
|
117
|
-
.evp-key { display: flex; flex-wrap: wrap; gap: 6px 14px;
|
|
123
|
+
.evp-hint { margin: 0; }
|
|
124
|
+
.evp-show { gap: 8px; }
|
|
125
|
+
.evp .evp-f { flex-direction: column; gap: 2px; }
|
|
126
|
+
.evp .evp-f button { display: flex; height: 32px; padding: 0 8px; }
|
|
127
|
+
.evp .evp-f i.evp-k { width: 8px; height: 8px; } /* the key shows the same mark as the rows, not the legend's line */
|
|
128
|
+
.evp .evp-f button small { margin-left: auto; font-size: var(--fs-meta); color: var(--muted); }
|
|
129
|
+
.evp .evp-f button.evp-un { color: var(--muted); }
|
|
130
|
+
.evp .evp-f button.evp-un svg { margin-left: auto; color: var(--blue); }
|
|
131
|
+
.evp-key { display: flex; flex-wrap: wrap; gap: 6px 14px; }
|
|
118
132
|
.evp-key span { display: inline-flex; align-items: center; gap: 6px; }
|
|
119
|
-
.evp-hint { margin: 12px 0 0; }
|
|
120
133
|
|
|
121
134
|
/* the full calendar, in the left column: Calendar with Month | Week as Tabs */
|
|
122
135
|
.evp-ch { display: flex; align-items: center; gap: 2px; }
|
|
123
136
|
.evp-ch h2 { margin: 0 auto 0 4px; }
|
|
124
137
|
.evp-seg { margin-left: 8px; }
|
|
125
|
-
.evp .pm-tab[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--raise); }
|
|
126
138
|
.evp .pm-tab:focus-visible { outline: none; box-shadow: var(--glow); }
|
|
127
139
|
.evp-fm { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: var(--radius-card); border: 1px solid var(--line); background: var(--card); overflow: hidden; }
|
|
140
|
+
.evp-mh { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--muted); text-align: center; }
|
|
128
141
|
.evp-fm .evp-mh { padding: 8px 0 6px; }
|
|
129
142
|
.evp-mc { min-height: 104px; min-width: 0; padding: 4px; box-shadow: inset 1px 1px 0 var(--line); display: flex; flex-direction: column; gap: 2px; }
|
|
130
143
|
.evp-mc.out { background: var(--well); }
|
|
@@ -154,14 +167,11 @@ button.evp-t { cursor: pointer; }
|
|
|
154
167
|
|
|
155
168
|
/* the phone: the month and Show go under the dates */
|
|
156
169
|
@media (max-width: 760px) {
|
|
157
|
-
.evp-grid { grid-template-columns: minmax(0, 1fr);
|
|
158
|
-
.evp .evp-r {
|
|
159
|
-
.evp
|
|
160
|
-
.evp .evp-
|
|
161
|
-
.evp-
|
|
162
|
-
.evp-tl { min-width: 0; justify-content: flex-start; }
|
|
163
|
-
.evp-a .evp-sg { flex: 1 1 100%; } /* the suggestion on its own line, then ✓ ✕ together */
|
|
164
|
-
.evp-a { flex-wrap: wrap; white-space: normal; }
|
|
170
|
+
.evp-grid { grid-template-columns: minmax(0, 1fr); }
|
|
171
|
+
.evp .evp-r { flex-wrap: wrap; row-gap: 4px; padding: 8px 12px; }
|
|
172
|
+
.evp .evp-r .txt { flex: 1 1 calc(100% - 100px); }
|
|
173
|
+
.evp-sug, .evp-src { margin-left: 16px; padding-left: 16px; }
|
|
174
|
+
.evp-sug { flex-wrap: wrap; }
|
|
165
175
|
.evp-new { grid-template-columns: minmax(0, 1fr) auto; }
|
|
166
176
|
.evp-new input[type="date"] { grid-column: 1; }
|
|
167
177
|
.evp-ch { flex-wrap: wrap; }
|
|
@@ -171,9 +181,6 @@ button.evp-t { cursor: pointer; }
|
|
|
171
181
|
.evp-wc { min-height: 0; }
|
|
172
182
|
.evp .pm-btn { width: 44px; height: 44px; }
|
|
173
183
|
}
|
|
174
|
-
@media (max-width: 760px) and (hover: hover) {
|
|
175
|
-
.evp-r:not(:hover):not(:focus-within):not(.fixed) .evp-tl { display: none; } /* a narrow window: no empty line for tools you are not pointing at */
|
|
176
|
-
}
|
|
177
184
|
@media (prefers-reduced-motion: reduce) {
|
|
178
185
|
.evp .evp-toast { transform: translate(-50%, 0); }
|
|
179
186
|
.evp .evp-toast.on .timer { animation: none; }
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
/* pm/cozy-events.js — Events, the place for everything with a date (
|
|
2
|
-
*
|
|
1
|
+
/* pm/cozy-events.js — Events, the place for everything with a date (initiative events-place; rebuilt from the PMOS design system's blocks by
|
|
2
|
+
* initiative events-ds-page, board EventsDS on Exploring 3; the markup is pm/cozy-events-view.js, pure).
|
|
3
3
|
*
|
|
4
|
-
* One page
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* One page, Main + side. The top line is the path, the product chip (pm/scope-chip.js: product, program and project), the day picked (with
|
|
5
|
+
* × to show every day), then Search (the one search, pm/cozy-search.js), + (your own date, written in place: a PM item with a due day) and
|
|
6
|
+
* More (the month, the week, Show every date, Connectors). Main: Late, a List block: one Suggestion "PMOS has a fix for all N late dates"
|
|
7
|
+
* with ✓ (Yes to all) and ✕ (No to all), then each row with PMOS's fix under its title and ✓ ✕. Today, a Timeline block with the now line
|
|
8
|
+
* (redrawn each minute). Coming up, a List block: a suggestion only under a date at risk; the later delivery milestones are one fold line.
|
|
9
|
+
* Side: the Calendar block (press a day to see only that day, again for every day; press the month for the full calendar, Month | Week,
|
|
10
|
+
* in the main column, the back arrow returns to the list) and Show: the types as the filter, which is the key to the marks too. PMOS
|
|
11
|
+
* remembers the types you turned off (localStorage 'pmos.events.hide.v2'; every type is on until pressed). When a filter hides dates one line
|
|
12
|
+
* says so, with Show all.
|
|
10
13
|
*
|
|
11
14
|
* Reads GET /api/events-place (lib/routes-events-place.js); 202 means a Board is still being read, and the page asks again. Writes only on a
|
|
12
15
|
* press, through the routes that exist: ✓ on a suggestion is POST /api/boards/tasks/state (Done, Won't do) or /api/boards/tasks/edit (a new
|
|
13
16
|
* due day) for a PMOS task, and /api/pm-items/* for your own item; each has Undo for a moment. ✕ and Fixed are POST /api/events-place/mark.
|
|
14
17
|
* A date PMOS cannot write (a Jira date, a plan end): ✓ on "Mark it done" or "Drop this date" is a mark too (Events stops listing it), and ✓ on
|
|
15
|
-
* "Ask the owner …" adds that ask as your own item, due today. Late shows its newest five, then one line that opens the rest
|
|
16
|
-
*
|
|
17
|
-
* returns to the list; a day shows that day's rows). Pressing a row opens its work in the one popup (pm/cozy-popup.js) with Ask PMOS beside
|
|
18
|
-
* it. The markup is pm/cozy-events-view.js (pure). */
|
|
18
|
+
* "Ask the owner …" adds that ask as your own item, due today. Late shows its newest five, then one line that opens the rest. Pressing a row
|
|
19
|
+
* opens its work in the one popup (pm/cozy-popup.js) with Ask PMOS beside it. */
|
|
19
20
|
import { mountNav } from './cozy-nav.js';
|
|
20
21
|
import * as POP from './cozy-popup.js';
|
|
21
22
|
import { pmGet, pmPost } from './http.js';
|
|
@@ -34,7 +35,7 @@ const store = {
|
|
|
34
35
|
};
|
|
35
36
|
const $ = (s) => document.querySelector(s);
|
|
36
37
|
store.set('pmos.events.show', null);
|
|
37
|
-
const S = { model: null, show: readShow(), P: null, sel: readSel(), day: null, ym: null, busy: new Set(), open: new Set(), cal: null, wk: null, tries: 0, timer: 0, toastT: 0 };
|
|
38
|
+
const S = { model: null, clock: 0, show: readShow(), P: null, sel: readSel(), day: null, ym: null, busy: new Set(), open: new Set(), cal: null, wk: null, tries: 0, timer: 0, toastT: 0 };
|
|
38
39
|
|
|
39
40
|
function readShow() {
|
|
40
41
|
const off = new Set(String(store.get(HIDE_KEY) || '').split(',').filter(Boolean));
|
|
@@ -73,6 +74,9 @@ async function load() {
|
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
/* ── drawing ── */
|
|
77
|
+
const nowHM = () => { const d = new Date(); return String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0'); };
|
|
78
|
+
// the now line moves with the clock: redraw each minute (a draw keeps every open fold and filter)
|
|
79
|
+
S.clock = setInterval(() => { if (document.visibilityState === 'visible' && S.model && !S.cal) draw(); }, 60000);
|
|
76
80
|
function draw() {
|
|
77
81
|
const M = S.model; if (!M) return;
|
|
78
82
|
const F = filt();
|
|
@@ -82,7 +86,7 @@ function draw() {
|
|
|
82
86
|
S.sel = { programs: S.sel.programs.filter((t) => known.has(t)), projects: S.sel.projects.filter((t) => known.has(t)) };
|
|
83
87
|
$('#evpScope').innerHTML = scopeChipHtml(S.P, S.sel, { id: 'evpScopeChip', groups });
|
|
84
88
|
$('#evpHid').innerHTML = S.cal ? '' : hiddenHtml(M.items, { ...F, scopeWords: F.scopeOk ? scopeWords(S.P, S.sel, groups) : '' });
|
|
85
|
-
$('#evpList').innerHTML = S.cal ? calHtml(M, { view: S.cal, ym: S.ym, day: S.wk, ...F }) : listHtml(M, { ...F, day: S.day, busy: S.busy, open: S.open });
|
|
89
|
+
$('#evpList').innerHTML = S.cal ? calHtml(M, { view: S.cal, ym: S.ym, day: S.wk, ...F }) : listHtml(M, { ...F, day: S.day, busy: S.busy, open: S.open, now: nowHM() });
|
|
86
90
|
$('#evpList').classList.toggle('evp-cal', !!S.cal);
|
|
87
91
|
$('#evpMonth').innerHTML = monthHtml(S.ym, M.items, { today: M.today, day: S.day, ...F });
|
|
88
92
|
$('#evpShow').innerHTML = showHtml(S.show, { counts: countsOf(M.items, { scopeOk: F.scopeOk }), unread: M.unread || {} });
|
|
@@ -173,6 +177,17 @@ async function no(x) {
|
|
|
173
177
|
say('PMOS will not suggest this again.', () => pmPost('/api/events-place/mark', { sig, no: false }));
|
|
174
178
|
load();
|
|
175
179
|
}
|
|
180
|
+
/** ✕ on the Suggestion over Late: no to each fix in view, with one Undo. */
|
|
181
|
+
async function noAll() {
|
|
182
|
+
const ok = scopeOk();
|
|
183
|
+
const list = lateInView(S.model, { show: S.show, scopeOk: ok || undefined, day: S.day, open: S.open }).filter((x) => x.suggest);
|
|
184
|
+
if (!list.length) return;
|
|
185
|
+
const sigs = [];
|
|
186
|
+
for (const x of list) { const r = await pmPost('/api/events-place/mark', { sig: x.suggest.sig, no: true }); if (r && r.ok !== false) sigs.push(x.suggest.sig); }
|
|
187
|
+
if (!sigs.length) { say('Nothing was changed.'); return; }
|
|
188
|
+
say('PMOS will not suggest ' + (sigs.length === 1 ? 'this' : 'these ' + sigs.length) + ' again.', async () => { for (const sig of sigs) await pmPost('/api/events-place/mark', { sig, no: false }); });
|
|
189
|
+
load();
|
|
190
|
+
}
|
|
176
191
|
async function fix(x) {
|
|
177
192
|
const r = await pmPost('/api/events-place/mark', { key: x.key, fixed: !x.fixed });
|
|
178
193
|
if (!r || r.ok === false) { say((r && r.error) || 'Nothing was changed.'); return; }
|
|
@@ -223,11 +238,23 @@ async function addSave(e) {
|
|
|
223
238
|
load();
|
|
224
239
|
}
|
|
225
240
|
|
|
241
|
+
/* ── More: a menu under its button ── */
|
|
242
|
+
function menu(show) {
|
|
243
|
+
const m = $('#evpMenu'), b = document.querySelector('[data-evp-more]');
|
|
244
|
+
if (!m || !b) return;
|
|
245
|
+
m.hidden = !show; b.setAttribute('aria-expanded', show ? 'true' : 'false');
|
|
246
|
+
if (show) { const f = m.querySelector('button'); if (f) f.focus(); }
|
|
247
|
+
}
|
|
248
|
+
|
|
226
249
|
/* ── presses ── */
|
|
227
250
|
document.addEventListener('click', (e) => {
|
|
228
251
|
const t = e.target;
|
|
229
252
|
if (!t || !t.closest) return;
|
|
230
|
-
|
|
253
|
+
if (t.closest('[data-evp-more]')) { menu($('#evpMenu').hidden); return; }
|
|
254
|
+
const inMenu = !!t.closest('#evpMenu');
|
|
255
|
+
if (!inMenu) menu(false); else setTimeout(() => menu(false));
|
|
256
|
+
if (t.closest('[data-evp-search]')) { import('./cozy-search.js').then((M) => M.openSearch({})); return; }
|
|
257
|
+
const b = t.closest('[data-evp-noall],[data-evp-yes],[data-evp-no],[data-evp-all],[data-evp-fix],[data-evp-done],[data-evp-open],[data-evp-src],[data-evp-day],[data-evp-month],[data-evp-week],[data-evp-show],[data-evp-showall],[data-evp-connect],[data-evp-add],[data-evp-clear],[data-evp-fold],[data-evp-full],[data-evp-view],[data-evp-list],#evpScopeChip,.evp-dt');
|
|
231
258
|
if (!b) return;
|
|
232
259
|
const x = itemOf(b);
|
|
233
260
|
if (b.id === 'evpScopeChip') {
|
|
@@ -253,6 +280,7 @@ document.addEventListener('click', (e) => {
|
|
|
253
280
|
if (b.matches('[data-evp-yes]')) yes(x);
|
|
254
281
|
else if (b.matches('[data-evp-no]')) no(x);
|
|
255
282
|
else if (b.matches('[data-evp-all]')) yesAll();
|
|
283
|
+
else if (b.matches('[data-evp-noall]')) noAll();
|
|
256
284
|
else if (b.matches('[data-evp-fix]')) fix(x);
|
|
257
285
|
else if (b.matches('[data-evp-done]')) done(x);
|
|
258
286
|
else if (b.matches('[data-evp-open]')) open(x);
|
|
@@ -277,6 +305,7 @@ document.addEventListener('click', (e) => {
|
|
|
277
305
|
document.addEventListener('change', (e) => { const i = e.target; if (i && i.matches && i.matches('[data-evp-date]')) redate(itemOf(i), i.value); });
|
|
278
306
|
$('#evpAdd').addEventListener('submit', addSave);
|
|
279
307
|
$('#evpAdd').addEventListener('keydown', (e) => { if (e.key === 'Escape') { e.currentTarget.reset(); e.currentTarget.hidden = true; } });
|
|
308
|
+
document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !$('#evpMenu').hidden) { e.preventDefault(); menu(false); document.querySelector('[data-evp-more]').focus(); } });
|
|
280
309
|
document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && S.cal && !e.defaultPrevented && !document.querySelector('.cz-pop:not([hidden])')) { S.cal = null; draw(); } });
|
|
281
310
|
document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'visible' && S.model) load(); });
|
|
282
311
|
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
<meta name="pmos-nonce" content="" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
7
7
|
<title>PMOS · Events</title>
|
|
8
|
-
<!-- Events (
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
<!-- Events (initiative events-place; rebuilt from the design system's blocks by events-ds-page, board EventsDS on Exploring 3): everything
|
|
9
|
+
with a date in one page. Main + side. The top line is the path, the product chip, then Search, + and More. Main: Late, Today (a Timeline)
|
|
10
|
+
and Coming up, each a block. Side: the Calendar block and Show. It reads GET /api/events-place; the page is drawn from the PMOS design
|
|
11
|
+
system (Komorebi: pm-ds on the page panel, brand, charts and komorebi sheets); the page code is pm/cozy-events.js and its markup
|
|
12
|
+
pm/cozy-events-view.js. -->
|
|
11
13
|
<link rel="preload" href="/vendor/plus-jakarta-sans-var.woff2" as="font" type="font/woff2" crossorigin />
|
|
12
14
|
<link rel="stylesheet" href="/pm/brand.css" />
|
|
13
15
|
<link rel="stylesheet" href="/pm/charts.css" />
|
|
@@ -18,10 +20,21 @@
|
|
|
18
20
|
<body class="cz evp-page">
|
|
19
21
|
<main class="cz-panel stage evp pm-ds" id="stage">
|
|
20
22
|
<div class="evp-hd">
|
|
21
|
-
<h1 class="
|
|
23
|
+
<nav class="pm-path" aria-label="Path"><h1 class="evp-h1"><b>Events</b></h1></nav>
|
|
22
24
|
<div class="evp-scope" id="evpScope"></div>
|
|
23
|
-
<p class="evp-dayf pm-chip" id="evpDay" hidden>Only <b></b><button type="button" class="evp-ib pm-btn" data-evp-clear aria-label="Show every day" title="Show every day"><svg class="pm-ic" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg></button></p>
|
|
24
|
-
<
|
|
25
|
+
<p class="evp-dayf pm-chip" id="evpDay" hidden>Only <b></b><button type="button" class="evp-ib pm-btn" data-evp-clear aria-label="Show every day" title="Show every day"><svg class="pm-ic" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M6 6l12 12M18 6L6 18"/></svg></button></p>
|
|
26
|
+
<span class="evp-sp"></span>
|
|
27
|
+
<button type="button" class="evp-ib pm-btn" data-evp-search aria-label="Search" title="Search"><svg class="pm-ic" aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM21 21l-5-5"/></svg></button>
|
|
28
|
+
<button type="button" class="evp-ib evp-add pm-btn" data-evp-add aria-label="Add your own date" title="Add your own date"><svg class="pm-ic" aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14M5 12h14"/></svg></button>
|
|
29
|
+
<span class="evp-mw">
|
|
30
|
+
<button type="button" class="evp-ib pm-btn" data-evp-more aria-haspopup="menu" aria-expanded="false" aria-controls="evpMenu" aria-label="More" title="More"><svg class="pm-ic" aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h.01M12 12h.01M19 12h.01"/></svg></button>
|
|
31
|
+
<div class="evp-menu pm-menu" id="evpMenu" role="menu" aria-label="More" hidden>
|
|
32
|
+
<button type="button" role="menuitem" data-evp-view="month"><svg class="pm-ic" aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 5.5h16v14H4zM4 10h16M8.5 3.5v4M15.5 3.5v4"/></svg>The month</button>
|
|
33
|
+
<button type="button" role="menuitem" data-evp-view="week"><svg class="pm-ic" aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 5.5h16v14H4zM4 10h16M10 10v9.5M14 10v9.5"/></svg>The week</button>
|
|
34
|
+
<button type="button" role="menuitem" data-evp-showall><svg class="pm-ic" aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12zM12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z"/></svg>Show every date</button>
|
|
35
|
+
<button type="button" role="menuitem" data-evp-connect><svg class="pm-ic" aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M9 7V3M15 7V3M6 7h12v5a6 6 0 0 1-12 0zM12 18v3"/></svg>Connectors</button>
|
|
36
|
+
</div>
|
|
37
|
+
</span>
|
|
25
38
|
</div>
|
|
26
39
|
<div class="evp-grid">
|
|
27
40
|
<div class="evp-left">
|
|
@@ -34,10 +47,9 @@
|
|
|
34
47
|
<div id="evpHid"></div>
|
|
35
48
|
<div id="evpList" aria-live="polite"><p class="evp-quiet pm-meta" role="status">Reading the dates.</p></div>
|
|
36
49
|
</div>
|
|
37
|
-
<aside class="evp-side
|
|
50
|
+
<aside class="evp-side" aria-label="The month">
|
|
38
51
|
<div id="evpMonth"></div>
|
|
39
52
|
<div id="evpShow"></div>
|
|
40
|
-
<p class="evp-hint pm-meta">Press a type to hide it or show it. Press a day to see only that day. Press the month to open the full calendar.</p>
|
|
41
53
|
</aside>
|
|
42
54
|
</div>
|
|
43
55
|
<div class="evp-toast pm-toast" id="toast" role="status" aria-live="polite"></div>
|