create-pmos 0.646.0 → 0.647.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 +14 -14
- package/payload/KIT-VERSION +1 -1
- package/payload/design-system/ui/components/Suggestion/README.md +8 -0
- package/payload/design-system/ui/components/Timeline/README.md +8 -0
- package/payload/design-system/ui/components/bundle.css +38 -0
- 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 +13 -0
- package/workspace/design-system/ui/components/Suggestion/README.md +8 -0
- package/workspace/design-system/ui/components/Timeline/README.md +8 -0
- package/workspace/design-system/ui/components/bundle.css +38 -0
- package/workspace/guide/layout.md +10 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-backlog.js +21 -11
- package/workspace/public/pm/bd-ds.css +0 -7
- package/workspace/public/pm/bd-span.js +10 -5
- package/workspace/public/pm/bd-stands.js +165 -0
- package/workspace/public/pm/bd-work-ds.css +107 -0
- package/workspace/public/pm/bd-work.css +8 -77
- package/workspace/public/pm/bd-work.js +79 -46
- package/workspace/public/pm/komorebi.css +39 -0
- package/workspace/public/pm/premium-board.js +57 -10
- package/workspace/public/pm/readonly.js +3 -0
- package/workspace/public/premium-board.html +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.647.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,19 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.647.0",
|
|
38
|
+
"at": "2026-11-20T05:31:50.958Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1429,
|
|
43
|
+
"t": "Work's Initiatives tab built from design system blocks",
|
|
44
|
+
"s": "Work's Initiatives tab built from design system blocks",
|
|
45
|
+
"k": "new"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
36
49
|
{
|
|
37
50
|
"v": "0.646.0",
|
|
38
51
|
"at": "2026-11-20T03:32:31.987Z",
|
|
@@ -303,19 +316,6 @@
|
|
|
303
316
|
"k": "new"
|
|
304
317
|
}
|
|
305
318
|
]
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
"v": "0.620.0",
|
|
309
|
-
"at": "2026-11-19T04:33:41.427Z",
|
|
310
|
-
"f": 4,
|
|
311
|
-
"prs": [
|
|
312
|
-
{
|
|
313
|
-
"n": 1399,
|
|
314
|
-
"t": "Shared copy draws Work, one view, and nothing private leaks",
|
|
315
|
-
"s": "Shared copy draws Work, one view, and nothing private leaks",
|
|
316
|
-
"k": "new"
|
|
317
|
-
}
|
|
318
|
-
]
|
|
319
319
|
}
|
|
320
320
|
]
|
|
321
321
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -12,3 +12,11 @@ One thing PMOS proposes, with Yes (primary) and No (outline). Blue-tint ground a
|
|
|
12
12
|
- Yes applies the change at once, the suggestion folds away, and a Toast offers Undo.
|
|
13
13
|
- No folds it away and PMOS remembers ("Won’t suggest this again for this initiative").
|
|
14
14
|
- Hover on the ✦ shows why PMOS suggests it, in one line.
|
|
15
|
+
|
|
16
|
+
## Expanded form (`pm-sug x`)
|
|
17
|
+
|
|
18
|
+
When a Suggestion changes dates, people or what is sent, it opens in the expanded form so the person can check it before Yes (Wawan: "user can't just trust to accept or reject"):
|
|
19
|
+
|
|
20
|
+
- A title: what PMOS proposes, in one line.
|
|
21
|
+
- Rows (a `dl`): **Why** with its evidence, **PMOS will** with the exact steps (anything sent outside is shown first), **What changes**, and **Based on** with the sources in muted text. A row with nothing to say is left out.
|
|
22
|
+
- The answers, right-aligned: Change it first (pencil), Yes (primary), No (outline). Icon-only, with their names as labels.
|
|
@@ -13,3 +13,11 @@ Things in time order. Used for: the agenda, an events day, milestones, PMOS’s
|
|
|
13
13
|
|
|
14
14
|
- The now line moves with the clock; the list scrolls to now when the page opens.
|
|
15
15
|
- Hover an event for detail; click opens it beside. Past events are quiet; the next one is raised.
|
|
16
|
+
|
|
17
|
+
## In a table, and the date line
|
|
18
|
+
|
|
19
|
+
The Work boards draw time in two more places, from the same marks:
|
|
20
|
+
|
|
21
|
+
- **Table timeline** (`pm-gt` inside a Table cell): done bars in leaf (`.b.dn`), now in blue (`.b.nw`), planned in well with a hairline (`.b`), and the today line (`pm-now`, alert). It scrolls sideways with a trackpad, a drag, or Earlier / Go to today / Later; no scrollbar is drawn.
|
|
22
|
+
- **Milestone** (`pm-dia`): a diamond. Late is alert (`.late`), done is leaf (`.dn`). Milestones less than 8 days apart merge into one numbered mark (`.n`, the number centred in it) that lists them on hover.
|
|
23
|
+
- **Date line** (`pm-dline`): the next milestones on one line, each a diamond with its date (mono), its name and what it belongs to. A label that would touch the one before it drops to the next row with a dashed lead. A milestone past the visible range folds into a `+N` mark (`pm-more`) at the right end with its month above it; once the line is scrolled, a matching mark shows at the left end. The line follows the table's scale.
|
|
@@ -53,12 +53,50 @@ body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-s
|
|
|
53
53
|
.pm-sug{display:flex;align-items:center;gap:10px;background:var(--blue-tint);border-radius:var(--radius-md);padding:4px 4px 4px 12px;font-size:13px}
|
|
54
54
|
.pm-sug .say{flex:1}
|
|
55
55
|
.pm-star{color:var(--blue)}
|
|
56
|
+
.pm-sug.x{flex-direction:column;align-items:stretch;gap:10px;padding:14px 16px}
|
|
57
|
+
.pm-sug.x .ttl{display:flex;align-items:center;gap:8px;font-weight:600}
|
|
58
|
+
.pm-sug.x .ttl .pm-ic{color:var(--blue)}
|
|
59
|
+
.pm-sug.x dl{display:grid;grid-template-columns:110px 1fr;gap:6px 12px;margin:0;font-size:14px;line-height:20px}
|
|
60
|
+
.pm-sug.x dt{color:var(--muted)}
|
|
61
|
+
.pm-sug.x dd{margin:0;min-width:0}
|
|
62
|
+
.pm-sug.x dd ul{margin:0;padding-left:18px}
|
|
63
|
+
.pm-sug.x dd li{margin:0 0 2px}
|
|
64
|
+
.pm-sug.x dd.src{color:var(--muted)}
|
|
65
|
+
.pm-sug.x .ans{display:flex;gap:8px;justify-content:flex-end}
|
|
56
66
|
.pm-ev{border:1px solid var(--line);border-radius:var(--radius-md);background:var(--card);box-shadow:var(--raise);padding:6px 10px;display:flex;flex-direction:column;line-height:1.35;font-size:13px}
|
|
57
67
|
.pm-ev b{font-weight:600}
|
|
58
68
|
.pm-ev.over{background:none;box-shadow:none;border-style:dashed;color:var(--muted)}
|
|
59
69
|
.pm-fold{height:44px;display:flex;align-items:center;gap:8px;padding:0 14px;border:0;border-top:1px dashed var(--line);background:none;width:100%;font:inherit;font-size:13px;font-weight:600;color:var(--muted);text-align:left;cursor:pointer}
|
|
60
70
|
.pm-group{height:32px;display:flex;align-items:center;gap:8px;padding:0 14px;font-size:13px;font-weight:600;background:var(--well);color:var(--muted)}
|
|
61
71
|
.pm-group.now{background:var(--leaf-tint);color:var(--ink)}
|
|
72
|
+
.pm-dia{position:absolute;top:50%;width:12px;height:12px;margin:-6px 0 0 -6px;padding:0;transform:rotate(45deg);background:var(--card);border:2px solid var(--ink);border-radius:2px;box-sizing:border-box;cursor:pointer;z-index:2}
|
|
73
|
+
.pm-dia.late{border-color:var(--alert)}
|
|
74
|
+
.pm-dia.dn{background:var(--leaf);border-color:var(--leaf)}
|
|
75
|
+
.pm-dia.n{width:18px;height:18px;margin:-9px 0 0 -9px;background:var(--ink);border-color:var(--ink);display:flex;align-items:center;justify-content:center}
|
|
76
|
+
.pm-dia.n>b{transform:rotate(-45deg);color:var(--card);font-size:11px;line-height:1;font-weight:600}
|
|
77
|
+
.pm-dia:focus-visible{outline:none;box-shadow:var(--glow)}
|
|
78
|
+
.pm-now{position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;background:var(--alert);z-index:1}
|
|
79
|
+
.pm-now>span{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);font-size:13px;font-style:normal;font-weight:600;color:var(--alert);white-space:nowrap}
|
|
80
|
+
.pm-gt{position:relative;height:24px}
|
|
81
|
+
.pm-gt>.b{position:absolute;top:7px;height:10px;border-radius:var(--radius-pill);background:var(--well);box-shadow:inset 0 0 0 1px var(--line)}
|
|
82
|
+
.pm-gt>.b.dn{background:var(--leaf);box-shadow:none}
|
|
83
|
+
.pm-gt>.b.nw{background:var(--blue);box-shadow:none}
|
|
84
|
+
.pm-dline{position:relative;padding:0 40px 0 8px}
|
|
85
|
+
.pm-dline .axis{position:relative;height:20px;font-size:13px;color:var(--muted)}
|
|
86
|
+
.pm-dline .axis .tk{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}
|
|
87
|
+
.pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 86px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
|
|
88
|
+
.pm-dline .line>.pm-now{bottom:auto;height:34px;top:-8px}
|
|
89
|
+
.pm-dline .ms{position:absolute;top:0;width:0}
|
|
90
|
+
.pm-dline .ms>.pm-dia{top:12px}
|
|
91
|
+
.pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 86px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:220px;font-size:13px;line-height:20px}
|
|
92
|
+
.pm-dline .ms .lb b{font-size:15px;line-height:24px;font-weight:600}
|
|
93
|
+
.pm-dline .ms .lb .code{font-family:var(--font-mono);color:var(--muted)}
|
|
94
|
+
.pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 86px + 6px);border-left:1px dashed var(--line)}
|
|
95
|
+
.pm-dline .ms.late .lb .code{color:var(--alert)}
|
|
96
|
+
.pm-more{position:absolute;top:20px;display:flex;flex-direction:column;align-items:center;gap:2px;border:0;background:none;padding:0;font:inherit;font-size:13px;color:var(--muted);cursor:pointer}
|
|
97
|
+
.pm-more.r{right:0}.pm-more.l{left:-8px}
|
|
98
|
+
.pm-more b{min-width:24px;height:20px;padding:0 6px;border-radius:var(--radius-pill);background:var(--ink);color:var(--card);font-size:11px;line-height:20px;font-weight:600}
|
|
99
|
+
.pm-more:focus-visible{outline:none;box-shadow:var(--glow);border-radius:var(--radius-sm)}
|
|
62
100
|
/* Blocks */
|
|
63
101
|
.pm-block{background:var(--card);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--raise);padding:16px 18px;display:flex;flex-direction:column;gap:12px;min-width:0}
|
|
64
102
|
.pm-block.flat{background:var(--well);box-shadow:none;border-color:transparent}
|
|
@@ -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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-20T05:31:47Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-20T05:31:47Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-20T05:31:47Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.647.0",
|
|
4
|
+
"at": "2026-11-20T05:31:50.958Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1429,
|
|
9
|
+
"t": "Work's Initiatives tab built from design system blocks",
|
|
10
|
+
"s": "Work's Initiatives tab built from design system blocks",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
2
15
|
{
|
|
3
16
|
"v": "0.646.0",
|
|
4
17
|
"at": "2026-11-20T03:32:31.987Z",
|
|
@@ -12,3 +12,11 @@ One thing PMOS proposes, with Yes (primary) and No (outline). Blue-tint ground a
|
|
|
12
12
|
- Yes applies the change at once, the suggestion folds away, and a Toast offers Undo.
|
|
13
13
|
- No folds it away and PMOS remembers ("Won’t suggest this again for this initiative").
|
|
14
14
|
- Hover on the ✦ shows why PMOS suggests it, in one line.
|
|
15
|
+
|
|
16
|
+
## Expanded form (`pm-sug x`)
|
|
17
|
+
|
|
18
|
+
When a Suggestion changes dates, people or what is sent, it opens in the expanded form so the person can check it before Yes (Wawan: "user can't just trust to accept or reject"):
|
|
19
|
+
|
|
20
|
+
- A title: what PMOS proposes, in one line.
|
|
21
|
+
- Rows (a `dl`): **Why** with its evidence, **PMOS will** with the exact steps (anything sent outside is shown first), **What changes**, and **Based on** with the sources in muted text. A row with nothing to say is left out.
|
|
22
|
+
- The answers, right-aligned: Change it first (pencil), Yes (primary), No (outline). Icon-only, with their names as labels.
|
|
@@ -13,3 +13,11 @@ Things in time order. Used for: the agenda, an events day, milestones, PMOS’s
|
|
|
13
13
|
|
|
14
14
|
- The now line moves with the clock; the list scrolls to now when the page opens.
|
|
15
15
|
- Hover an event for detail; click opens it beside. Past events are quiet; the next one is raised.
|
|
16
|
+
|
|
17
|
+
## In a table, and the date line
|
|
18
|
+
|
|
19
|
+
The Work boards draw time in two more places, from the same marks:
|
|
20
|
+
|
|
21
|
+
- **Table timeline** (`pm-gt` inside a Table cell): done bars in leaf (`.b.dn`), now in blue (`.b.nw`), planned in well with a hairline (`.b`), and the today line (`pm-now`, alert). It scrolls sideways with a trackpad, a drag, or Earlier / Go to today / Later; no scrollbar is drawn.
|
|
22
|
+
- **Milestone** (`pm-dia`): a diamond. Late is alert (`.late`), done is leaf (`.dn`). Milestones less than 8 days apart merge into one numbered mark (`.n`, the number centred in it) that lists them on hover.
|
|
23
|
+
- **Date line** (`pm-dline`): the next milestones on one line, each a diamond with its date (mono), its name and what it belongs to. A label that would touch the one before it drops to the next row with a dashed lead. A milestone past the visible range folds into a `+N` mark (`pm-more`) at the right end with its month above it; once the line is scrolled, a matching mark shows at the left end. The line follows the table's scale.
|
|
@@ -53,12 +53,50 @@ body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-s
|
|
|
53
53
|
.pm-sug{display:flex;align-items:center;gap:10px;background:var(--blue-tint);border-radius:var(--radius-md);padding:4px 4px 4px 12px;font-size:13px}
|
|
54
54
|
.pm-sug .say{flex:1}
|
|
55
55
|
.pm-star{color:var(--blue)}
|
|
56
|
+
.pm-sug.x{flex-direction:column;align-items:stretch;gap:10px;padding:14px 16px}
|
|
57
|
+
.pm-sug.x .ttl{display:flex;align-items:center;gap:8px;font-weight:600}
|
|
58
|
+
.pm-sug.x .ttl .pm-ic{color:var(--blue)}
|
|
59
|
+
.pm-sug.x dl{display:grid;grid-template-columns:110px 1fr;gap:6px 12px;margin:0;font-size:14px;line-height:20px}
|
|
60
|
+
.pm-sug.x dt{color:var(--muted)}
|
|
61
|
+
.pm-sug.x dd{margin:0;min-width:0}
|
|
62
|
+
.pm-sug.x dd ul{margin:0;padding-left:18px}
|
|
63
|
+
.pm-sug.x dd li{margin:0 0 2px}
|
|
64
|
+
.pm-sug.x dd.src{color:var(--muted)}
|
|
65
|
+
.pm-sug.x .ans{display:flex;gap:8px;justify-content:flex-end}
|
|
56
66
|
.pm-ev{border:1px solid var(--line);border-radius:var(--radius-md);background:var(--card);box-shadow:var(--raise);padding:6px 10px;display:flex;flex-direction:column;line-height:1.35;font-size:13px}
|
|
57
67
|
.pm-ev b{font-weight:600}
|
|
58
68
|
.pm-ev.over{background:none;box-shadow:none;border-style:dashed;color:var(--muted)}
|
|
59
69
|
.pm-fold{height:44px;display:flex;align-items:center;gap:8px;padding:0 14px;border:0;border-top:1px dashed var(--line);background:none;width:100%;font:inherit;font-size:13px;font-weight:600;color:var(--muted);text-align:left;cursor:pointer}
|
|
60
70
|
.pm-group{height:32px;display:flex;align-items:center;gap:8px;padding:0 14px;font-size:13px;font-weight:600;background:var(--well);color:var(--muted)}
|
|
61
71
|
.pm-group.now{background:var(--leaf-tint);color:var(--ink)}
|
|
72
|
+
.pm-dia{position:absolute;top:50%;width:12px;height:12px;margin:-6px 0 0 -6px;padding:0;transform:rotate(45deg);background:var(--card);border:2px solid var(--ink);border-radius:2px;box-sizing:border-box;cursor:pointer;z-index:2}
|
|
73
|
+
.pm-dia.late{border-color:var(--alert)}
|
|
74
|
+
.pm-dia.dn{background:var(--leaf);border-color:var(--leaf)}
|
|
75
|
+
.pm-dia.n{width:18px;height:18px;margin:-9px 0 0 -9px;background:var(--ink);border-color:var(--ink);display:flex;align-items:center;justify-content:center}
|
|
76
|
+
.pm-dia.n>b{transform:rotate(-45deg);color:var(--card);font-size:11px;line-height:1;font-weight:600}
|
|
77
|
+
.pm-dia:focus-visible{outline:none;box-shadow:var(--glow)}
|
|
78
|
+
.pm-now{position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;background:var(--alert);z-index:1}
|
|
79
|
+
.pm-now>span{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);font-size:13px;font-style:normal;font-weight:600;color:var(--alert);white-space:nowrap}
|
|
80
|
+
.pm-gt{position:relative;height:24px}
|
|
81
|
+
.pm-gt>.b{position:absolute;top:7px;height:10px;border-radius:var(--radius-pill);background:var(--well);box-shadow:inset 0 0 0 1px var(--line)}
|
|
82
|
+
.pm-gt>.b.dn{background:var(--leaf);box-shadow:none}
|
|
83
|
+
.pm-gt>.b.nw{background:var(--blue);box-shadow:none}
|
|
84
|
+
.pm-dline{position:relative;padding:0 40px 0 8px}
|
|
85
|
+
.pm-dline .axis{position:relative;height:20px;font-size:13px;color:var(--muted)}
|
|
86
|
+
.pm-dline .axis .tk{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}
|
|
87
|
+
.pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 86px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
|
|
88
|
+
.pm-dline .line>.pm-now{bottom:auto;height:34px;top:-8px}
|
|
89
|
+
.pm-dline .ms{position:absolute;top:0;width:0}
|
|
90
|
+
.pm-dline .ms>.pm-dia{top:12px}
|
|
91
|
+
.pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 86px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:220px;font-size:13px;line-height:20px}
|
|
92
|
+
.pm-dline .ms .lb b{font-size:15px;line-height:24px;font-weight:600}
|
|
93
|
+
.pm-dline .ms .lb .code{font-family:var(--font-mono);color:var(--muted)}
|
|
94
|
+
.pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 86px + 6px);border-left:1px dashed var(--line)}
|
|
95
|
+
.pm-dline .ms.late .lb .code{color:var(--alert)}
|
|
96
|
+
.pm-more{position:absolute;top:20px;display:flex;flex-direction:column;align-items:center;gap:2px;border:0;background:none;padding:0;font:inherit;font-size:13px;color:var(--muted);cursor:pointer}
|
|
97
|
+
.pm-more.r{right:0}.pm-more.l{left:-8px}
|
|
98
|
+
.pm-more b{min-width:24px;height:20px;padding:0 6px;border-radius:var(--radius-pill);background:var(--ink);color:var(--card);font-size:11px;line-height:20px;font-weight:600}
|
|
99
|
+
.pm-more:focus-visible{outline:none;box-shadow:var(--glow);border-radius:var(--radius-sm)}
|
|
62
100
|
/* Blocks */
|
|
63
101
|
.pm-block{background:var(--card);border:1px solid var(--line);border-radius:var(--radius-card);box-shadow:var(--raise);padding:16px 18px;display:flex;flex-direction:column;gap:12px;min-width:0}
|
|
64
102
|
.pm-block.flat{background:var(--well);box-shadow:none;border-color:transparent}
|
|
@@ -84,6 +84,16 @@ Under the agenda, after a meeting PMOS recorded and filed in the last 3 hours, a
|
|
|
84
84
|
|
|
85
85
|
On a phone, Today is one page with no boxes: the overview, the next event with **Record**, and the log. Swipe a row to the right to do or accept it, and to the left to drop it or put it off. Each swipe has **Undo**.
|
|
86
86
|
|
|
87
|
+
## Work
|
|
88
|
+
|
|
89
|
+
On a computer, Work is built from the parts of the PMOS design system. The top line shows the path (**Work ›** and the product; press the product to switch it), the tabs **Initiatives**, **Backlog** and **This sprint**, then Search, New initiative and More.
|
|
90
|
+
|
|
91
|
+
**Initiatives** has three blocks:
|
|
92
|
+
|
|
93
|
+
- **Where it stands.** One paragraph that says what is happening and why it matters: an initiative past its milestone, with the cause from the record (a Jira ticket that is blocked, a step that waits on you), an initiative that sat in a stage with no dates and for how long, and the next decision point. Press a name to open the initiative. Under it, PMOS shows one suggestion from its open proposals, with **Why**, **PMOS will** (the exact steps), **What changes** and **Based on** (the sources). The pencil opens the initiative so you can change the proposal first, ✓ does it (with Undo), and ✕ drops it. When nothing needs saying, the block does not show.
|
|
94
|
+
- **Initiatives.** A table with the columns you choose (the tune icon also sorts and filters). Press a column heading to sort by it. The timeline shows done in green, now in blue and planned in grey, with a red line for today. A milestone is a diamond on its initiative's row; a late one is red. Milestones less than 8 days apart are one numbered diamond: point at it to see them. Pick the scale with **Week**, **Month**, **Quarter**, **Year** or **Full**. Move the timeline with the arrows, with a sideways swipe on a trackpad, or by dragging it; the middle arrow goes back to today. A late date has a red badge, for example "8 days late". Closed initiatives fold into one line at the end.
|
|
95
|
+
- **Next milestones.** The next five milestones of all initiatives on one line, on the same scale as the table, each with its date, its name and its initiative. Labels that are too close move down a row. A milestone after the end of the line is in the **+N** mark at the right: press it to move the line on. When the line has moved, a mark at the left moves it back. Press a diamond to open the milestone.
|
|
96
|
+
|
|
87
97
|
## The Viewer
|
|
88
98
|
|
|
89
99
|
The Viewer shows one item: an initiative, a program, a task, a document, a meeting, a report, Your day or a page of this guide.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.647.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.647.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -48,15 +48,23 @@ const put = (k, v) => { try { const s = box(); if (s) s.setItem(k, JSON.stringif
|
|
|
48
48
|
const scopeKey = () => (A ? A.scope().map((s) => s.ws + '|' + (s.board || '')).sort().join(',') : '');
|
|
49
49
|
const uidOf = (t) => t.ws + '|' + t.board + '|' + t.id;
|
|
50
50
|
|
|
51
|
-
/**
|
|
52
|
-
|
|
51
|
+
/** Work's tab now (WorkDS: Initiatives, Backlog, This sprint): the address first (?work=backlog, ?work=sprint), then what the PM chose for
|
|
52
|
+
* this pick. → 'ini' | 'bk' | 'sp' */
|
|
53
|
+
export function tabOf() {
|
|
53
54
|
const q = new URLSearchParams(location.search).get('work');
|
|
54
|
-
if (q === 'backlog') return
|
|
55
|
-
if (q === '
|
|
56
|
-
|
|
55
|
+
if (q === 'backlog') return 'bk';
|
|
56
|
+
if (q === 'sprint') return 'sp';
|
|
57
|
+
if (q === 'initiatives') return 'ini';
|
|
58
|
+
const v = (get(KEY, {}) || {})[scopeKey()];
|
|
59
|
+
return v === 'bk' || v === 'sp' ? v : 'ini';
|
|
57
60
|
}
|
|
61
|
+
/** Is a task tab (Backlog or This sprint) the view now? */
|
|
62
|
+
export const on = () => tabOf() !== 'ini';
|
|
58
63
|
function setOn(v) {
|
|
59
|
-
|
|
64
|
+
v = v === true ? 'bk' : v === false ? 'ini' : v;
|
|
65
|
+
const m = get(KEY, {}) || {}; m[scopeKey()] = v; put(KEY, m);
|
|
66
|
+
// This sprint is the task list with the sprint on: the band over it (pm/bd-sprint.js); Backlog is the list without it
|
|
67
|
+
if (v === 'sp') CHIPS.add('sprint'); else if (v === 'bk') CHIPS.delete('sprint');
|
|
60
68
|
const q = new URLSearchParams(location.search); if (q.has('work')) { q.delete('work'); const s = q.toString(); history.replaceState(history.state, '', location.pathname + (s ? '?' + s : '')); }
|
|
61
69
|
apply();
|
|
62
70
|
}
|
|
@@ -95,12 +103,14 @@ export async function load() {
|
|
|
95
103
|
/* ── the switch in Work's header ──────────────────────────────────────────────────────────────────────────────── */
|
|
96
104
|
function drawSwitch() {
|
|
97
105
|
if (!sw) return;
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
106
|
+
const t = tabOf(), tb = (k, n) => `<button type="button" role="tab" aria-selected="${t === k}" class="pm-tab${t === k ? ' on' : ''}" data-bksw="${k}">${n}</button>`;
|
|
107
|
+
// one Tabs part for the three (WorkDS); no count on a tab: Where it stands says what matters (say it once)
|
|
108
|
+
sw.innerHTML = tb('ini', 'Initiatives') + tb('bk', 'Backlog') + tb('sp', 'This sprint');
|
|
101
109
|
}
|
|
102
110
|
function apply() {
|
|
103
111
|
const bk = on();
|
|
112
|
+
if (tabOf() === 'sp') CHIPS.add('sprint');
|
|
113
|
+
document.body.classList.toggle('sp-on', tabOf() === 'sp');
|
|
104
114
|
document.body.classList.toggle('bk-on', bk);
|
|
105
115
|
if (host) host.hidden = !bk;
|
|
106
116
|
drawSwitch();
|
|
@@ -527,9 +537,9 @@ export function sync(api) {
|
|
|
527
537
|
sw = document.createElement('span'); sw.className = 'bk-sw pm-tabs'; // the system's Tabs (design-system ui/components/Tabs) sw.setAttribute('role', 'tablist'); sw.setAttribute('aria-label', 'Work');
|
|
528
538
|
// on a desk the switch sits in the toolbar after the product picker; on a phone the toolbar is full, so it takes its own line above the list
|
|
529
539
|
const PH = matchMedia('(max-width: 760px)');
|
|
530
|
-
const place = () => { if (PH.matches) ib.insertAdjacentElement('beforebegin', sw); else crumb.insertAdjacentElement('afterend', sw); sw.classList.toggle('bk-sw-row', PH.matches); };
|
|
540
|
+
const place = () => { if (PH.matches) ib.insertAdjacentElement('beforebegin', sw); else (crumb.closest('.wk-path') || crumb).insertAdjacentElement('afterend', sw); sw.classList.toggle('bk-sw-row', PH.matches); };
|
|
531
541
|
place(); PH.addEventListener('change', place);
|
|
532
|
-
sw.addEventListener('click', (e) => { const b = e.target.closest('[data-bksw]'); if (b) setOn(b.dataset.bksw
|
|
542
|
+
sw.addEventListener('click', (e) => { const b = e.target.closest('[data-bksw]'); if (b) setOn(b.dataset.bksw); });
|
|
533
543
|
host = document.createElement('div'); host.id = 'bkBody'; host.className = 'bk-host'; host.hidden = true;
|
|
534
544
|
ib.insertAdjacentElement('afterend', host);
|
|
535
545
|
host.addEventListener('click', (e) => { press(e); });
|
|
@@ -47,13 +47,6 @@ body.bd-page.pm-ds > :not(#czNav, .pv-scrim, .pv-ov) :focus-visible { outline: n
|
|
|
47
47
|
.bd-page.pm-ds .bk-sw .pm-tab.on { box-shadow: var(--raise); }
|
|
48
48
|
.bd-page.pm-ds .bk-sw .k { font-weight: var(--fw-regular); color: var(--muted); }
|
|
49
49
|
|
|
50
|
-
/* Table: the Work grid and the Backlog list. Column heads are label-size, muted; lines are the system's line; a row lights on hover. */
|
|
51
|
-
.bd-page.pm-ds .wk-h { border-radius: var(--radius-card) var(--radius-card) 0 0; color: var(--muted); }
|
|
52
|
-
.bd-page.pm-ds .wk-g { background: var(--well); color: var(--muted); }
|
|
53
|
-
@media (hover: hover) { .bd-page.pm-ds .wk-r:not(.wk-h):not(.wk-g):hover { background: var(--well); } }
|
|
54
|
-
.bd-page.pm-ds .wk-now { background: var(--alert); opacity: 1; }
|
|
55
|
-
.bd-page.pm-ds .wk-nowl { background: var(--alert); color: var(--card); }
|
|
56
|
-
|
|
57
50
|
/* Menu: the View menu, the stage menu, the milestone lists, the Backlog's small popovers and the Publish popover sit on the system's Menu
|
|
58
51
|
* surface: card, medium corners, lift. */
|
|
59
52
|
.bd-page.pm-ds :is(.wk-menu, .wk-stm, .tg-msp, .bk-pop, .bppop) { border-radius: var(--radius-md); background: var(--card); box-shadow: var(--lift); }
|
|
@@ -221,7 +221,7 @@ const slipWords = (r, e) => { const p = r.plan, b = p && day(p.end), n = p && p.
|
|
|
221
221
|
* (pm/cozy-pop-work.js), so the bar has one design everywhere (Wawan, 2026-11-19). X: a date → its percent of the box; the markup sits in a
|
|
222
222
|
* position:relative box of the row's height. o: { pxPct: px per 1 % of the box, reach: days in which ◇s merge, mode: 'all' | 'pinned',
|
|
223
223
|
* label: false drops the end label, phone } → html */
|
|
224
|
-
export const rowBar = (r, X, now, o = {}) => qBar(r, X, now, !!o.phone, md, o.pxPct || 0, { reach: o.reach || 7, mode: o.mode || 'all', noLabel: o.label === false });
|
|
224
|
+
export const rowBar = (r, X, now, o = {}) => qBar(r, X, now, !!o.phone, md, o.pxPct || 0, { reach: o.reach || 7, mode: o.mode || 'all', noLabel: o.label === false, endIn: !!o.endIn });
|
|
225
225
|
function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
|
|
226
226
|
const s = day(r.start), e = day(r.end), fr = fcRange(r), fc = r.forecast ? null : r.track && day(r.track.forecast), tone = toneOf(r);
|
|
227
227
|
const tm = taskMarks(r, X, now, phone, pxPct, ms), et = tm.end, note = markWords(r, now);
|
|
@@ -249,7 +249,7 @@ function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
|
|
|
249
249
|
const name = landsOf(r, et), eTitle = name + ' · ' + md(ed) + (et && et.stage ? ' · ◆ ' + et.stage : '') + (et && et.done ? ' · done' : isLate ? ' · late' : '');
|
|
250
250
|
// nothing lands (batch 25 item 13): a workflow with no ◆ stage and no dated milestone draws no ◇ and no label; the bar's own end says it
|
|
251
251
|
if (!name) return out + planMarks(r, X, phone, fmt);
|
|
252
|
-
out += `<button type="button" class="tg-end${et && et.done ? ' dn' : ''}${isLate ? ' late' : ''}" data-ms-pick="${esc(r.key)}" data-ms-id="${esc(et ? et.id : '')}" style="left:${P(X(ed))}" aria-haspopup="dialog" aria-label="${esc(eTitle + '. Milestones of ' + r.title)}" title="${esc(eTitle + (clash ? '. ' + clash : ''))}"></button>`;
|
|
252
|
+
if (!tm.endMerged) out += `<button type="button" class="tg-end${et && et.done ? ' dn' : ''}${isLate ? ' late' : ''}" data-ms-pick="${esc(r.key)}" data-ms-id="${esc(et ? et.id : '')}" style="left:${P(X(ed))}" aria-haspopup="dialog" aria-label="${esc(eTitle + '. Milestones of ' + r.title)}" title="${esc(eTitle + (clash ? '. ' + clash : ''))}"></button>`;
|
|
253
253
|
// with the Next milestone column on, the column names it and the bar's end has no label (StsA8Board); the ◇ keeps the words as its hover
|
|
254
254
|
if (!ms.noLabel) out += endLabel(Math.max(X(e), X(ed), over ? X(now) : 0, late ? X(fc) : 0, fr ? X(fr.high) : 0), name, ed, isLate ? 'late' : risk, now, pxPct, hover, slipHtml(r));
|
|
255
255
|
} else if (fc) {
|
|
@@ -398,9 +398,14 @@ function taskMarks(r, X, now, phone, pxPct, ms) {
|
|
|
398
398
|
const M = (r.milestones || []).filter((m) => day(m.date));
|
|
399
399
|
if (!M.length) return { html: '', end: null };
|
|
400
400
|
const end = endTask(r, M, ms.reach || 0), show = new Set(shownMs(r, ms.mode || 'pinned').map((m) => m.id));
|
|
401
|
-
|
|
401
|
+
// Work (WorkDS, ms.endIn): the end ◇ merges with milestones less than `reach` days from it, into one numbered mark
|
|
402
|
+
const withEnd = !!(ms.endIn && end);
|
|
403
|
+
const L = M.filter((m) => (withEnd && end && m.id === end.id) || ((!end || m.id !== end.id) && show.has(m.id))).map((m) => ({ ...m, late: msLate(m, now, r), stage: msStage(r, m) }))
|
|
402
404
|
.filter((m) => { const x = X(day(m.date)); return x > 0 && x < 100; });
|
|
403
|
-
const
|
|
405
|
+
const C0 = mergeClose(L, Math.max(1, ms.reach || 7));
|
|
406
|
+
const hasEnd = (c) => withEnd && c.items.some((m) => m.id === end.id);
|
|
407
|
+
// the end alone stays the end ◇ qBar draws; merged with others it is drawn here, once, as part of the count
|
|
408
|
+
const C = C0.filter((c) => !(hasEnd(c) && c.n < 2)), endMerged = C.some(hasEnd);
|
|
404
409
|
const html = C.map((c) => {
|
|
405
410
|
const x = P(X(day(c.date))), tone = c.late ? ' late' : c.done ? ' dn' : '';
|
|
406
411
|
const one = c.items[0], words = (m) => m.name + ' · ' + md(day(m.date)) + (m.stage ? ' · ◆ ' + m.stage : '') + (m.late ? ' · late' : m.done ? ' · done' : '');
|
|
@@ -408,7 +413,7 @@ function taskMarks(r, X, now, phone, pxPct, ms) {
|
|
|
408
413
|
? `<button type="button" class="tg-tmc${tone}" data-ms-row="${esc(r.key)}" data-ms-ids="${esc(c.items.map((m) => m.id).join(' '))}" style="left:${x}" aria-haspopup="menu" aria-label="${esc(c.n + ' milestones, ' + c.range + ': ' + c.items.map((m) => m.name).join(', '))}" title="${esc(c.items.map(words).join('\n'))}"><b aria-hidden="true">${c.n}</b></button>`
|
|
409
414
|
: `<button type="button" class="tg-tm${tone}" data-ms-pick="${esc(r.key)}" data-ms-id="${esc(one.id)}" style="left:${x}" aria-haspopup="dialog" aria-label="${esc('Milestone ' + words(one) + '. Milestones of ' + r.title)}" title="${esc(words(one))}"></button>`;
|
|
410
415
|
}).join('');
|
|
411
|
-
return { html, end };
|
|
416
|
+
return { html, end, endMerged };
|
|
412
417
|
}
|
|
413
418
|
|
|
414
419
|
/* ── the product lane (feedback batch 11 item 17; canvas PlmA1Board, PlmA2Folded, PlmA3Phone) ──
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/* pm/bd-stands.js — the blocks Work opens with and ends on (initiative work-design-system-blocks; Exploring 3 page "work", boards WorkDS,
|
|
2
|
+
* WorkSprintDS, WorkBacklogDS; brief design-system/work-rebuild/brief.md). Built only from PMOS Komorebi parts (workspace/design-system/ui).
|
|
3
|
+
*
|
|
4
|
+
* · Where it stands: a Summary block (pm-block). It says what is happening and why it matters: the cause, what is at risk and the next
|
|
5
|
+
* decision point, with each initiative's name a link that opens it. Never counts alone. The words come from the record only: a late
|
|
6
|
+
* milestone and its days, what blocks it in Jira or waits on the PM, a stage with no dates and how long it has sat there, the next
|
|
7
|
+
* milestone. Nothing is invented; with nothing to say, the block says nothing (zero is silence).
|
|
8
|
+
* · One Suggestion after it, in the expanded form (pm-sug x): a title, Why (with its evidence), PMOS will (the exact steps), What changes
|
|
9
|
+
* and Based on (the sources), then Change it first (pencil), Yes (primary) and No (outline). Wawan: "user can't just trust to accept or
|
|
10
|
+
* reject". The Suggestion is one of PMOS's open proposals on the initiatives on screen (lib/proposals.js, r.props), the one on the most
|
|
11
|
+
* urgent initiative first; none open, none drawn.
|
|
12
|
+
* · Next milestones: a date line (pm-dline) under the Initiatives table with the next 5 milestones of all initiatives, each a diamond, its
|
|
13
|
+
* date, its name and its initiative. Close labels drop to a second row with a dashed lead; a milestone past the visible range is a +N mark
|
|
14
|
+
* at the right end with its month above it, and once the line is scrolled a matching mark shows at the left end. It follows the table's
|
|
15
|
+
* scale (the window the page gives).
|
|
16
|
+
* Everything here is pure: the page (pm/premium-board.js) passes the rows and the window and wires the presses by their data- attributes. */
|
|
17
|
+
|
|
18
|
+
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
19
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
20
|
+
const DAY = 864e5;
|
|
21
|
+
const SV = (d, n = 16) => `<svg class="pm-ic" width="${n}" height="${n}" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
22
|
+
export const I = {
|
|
23
|
+
star: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z', pen: 'M4 20h4L19 9l-4-4L4 16z', ok: 'M5 12.5l4.5 4.5L19 7.5',
|
|
24
|
+
x: 'M6 6l12 12M18 6L6 18', plus: 'M12 5v14M5 12h14',
|
|
25
|
+
};
|
|
26
|
+
export const day = (v) => { if (v instanceof Date) return new Date(v.getFullYear(), v.getMonth(), v.getDate()); const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; };
|
|
27
|
+
/** "12 Nov", and the year when it is not this year. */
|
|
28
|
+
export const dm = (d, now = new Date()) => d.getDate() + ' ' + MON[d.getMonth()] + (d.getFullYear() !== now.getFullYear() ? ' ' + d.getFullYear() : '');
|
|
29
|
+
const days = (n) => n + (n === 1 ? ' day' : ' days');
|
|
30
|
+
const weeks = (n) => { const w = Math.round(n / 7); return w <= 1 ? (n === 1 ? '1 day' : n < 7 ? n + ' days' : '1 week') : w + ' weeks'; };
|
|
31
|
+
const closed = (r) => !!(r.closed || r.status === 'done');
|
|
32
|
+
const stageOf = (r) => String((r.acts && r.acts.stage) || r.stage || '');
|
|
33
|
+
const link = (r) => `<a href="#" data-wkopen="${esc(r.key)}">${esc(r.title)}</a>`;
|
|
34
|
+
|
|
35
|
+
/** The open milestones of a row with a date, earliest first. */
|
|
36
|
+
export const openMs = (r) => (r.milestones || []).filter((m) => m && !m.done && day(m.date)).sort((a, b) => day(a.date) - day(b.date));
|
|
37
|
+
|
|
38
|
+
/* ── Where it stands ──────────────────────────────────────────────────────────────────────────────────────────── */
|
|
39
|
+
/** One sentence for each initiative that needs saying, most urgent first, at most three, then the next decision point. → [html] */
|
|
40
|
+
export function standsOf(rows, now = new Date()) {
|
|
41
|
+
const t = day(now), open = (rows || []).filter((r) => r && !closed(r));
|
|
42
|
+
const said = new Set(), out = [];
|
|
43
|
+
// 1. late: the next milestone (or the plan's end) has passed. The cause, from the record: tickets blocked in Jira, or what waits on the PM.
|
|
44
|
+
const late = open.map((r) => {
|
|
45
|
+
const m = openMs(r)[0], d = m ? day(m.date) : (r.over && day(r.end)) || null;
|
|
46
|
+
return d && d < t ? { r, m, d, over: Math.round((t - d) / DAY) } : null;
|
|
47
|
+
}).filter(Boolean).sort((a, b) => b.over - a.over);
|
|
48
|
+
for (const x of late.slice(0, 2)) {
|
|
49
|
+
const tk = x.r.track || {}, what = x.m ? `its ${esc(dm(x.d, now))} ${esc(x.m.name || 'milestone')}` : `its planned end on ${esc(dm(x.d, now))}`;
|
|
50
|
+
const cause = tk.blocked ? ` because ${tk.blocked === 1 ? 'a Jira ticket is' : tk.blocked + ' Jira tickets are'} blocked`
|
|
51
|
+
: tk.you && tk.you.text ? ` and waits on you: ${esc(String(tk.you.text).replace(/^Your turn\s*·\s*/i, '').replace(/\.$/, ''))}` : '';
|
|
52
|
+
out.push(`${link(x.r)} is ${days(x.over)} past ${what}${cause}.`); said.add(x.r.key);
|
|
53
|
+
}
|
|
54
|
+
// 2. at risk, with a date still ahead
|
|
55
|
+
for (const r of open.filter((r) => !said.has(r.key) && r.status === 'at risk').slice(0, out.length ? 1 : 2)) {
|
|
56
|
+
const m = openMs(r)[0], d = m ? day(m.date) : day(r.end);
|
|
57
|
+
if (d && d >= t) { out.push(`${link(r)} is at risk for ${m ? esc(m.name || 'its milestone') + ' on ' : 'its end on '}${esc(dm(d, now))}.`); said.add(r.key); }
|
|
58
|
+
}
|
|
59
|
+
// 3. sitting in a stage with no dates: how long, from the day it moved there
|
|
60
|
+
for (const r of open.filter((r) => !said.has(r.key) && !day(r.start) && !day(r.end) && !openMs(r).length)) {
|
|
61
|
+
if (out.length >= 3) break;
|
|
62
|
+
const mv = day(r.acts && r.acts.movedOn), n = mv ? Math.round((t - mv) / DAY) : null, st = stageOf(r);
|
|
63
|
+
out.push(n != null && n > 0
|
|
64
|
+
? `${link(r)} has sat in ${esc(st || 'its stage')} for ${weeks(n)} with no dates, so nothing shows when it will move.`
|
|
65
|
+
: `${link(r)} has no dates yet${st ? ' in ' + esc(st) : ''}, so nothing shows when it will move.`);
|
|
66
|
+
said.add(r.key);
|
|
67
|
+
}
|
|
68
|
+
// 4. the next decision point: the earliest milestone still ahead, of any initiative on screen
|
|
69
|
+
const next = open.flatMap((r) => openMs(r).filter((m) => day(m.date) >= t).map((m) => ({ r, m, d: day(m.date) }))).sort((a, b) => a.d - b.d)[0];
|
|
70
|
+
if (next) {
|
|
71
|
+
const n = Math.round((next.d - t) / DAY);
|
|
72
|
+
out.push(`The next decision point is ${esc(next.m.name || 'a milestone')} for ${link(next.r)} on ${esc(dm(next.d, now))}${n === 0 ? ', today' : n === 1 ? ', tomorrow' : n <= 14 ? ', in ' + days(n) : ''}.`);
|
|
73
|
+
} else if (!out.length && open.length) out.push(`Every initiative here is on its dates, and none has a milestone ahead yet.`);
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* ── the Suggestion: one of PMOS's open proposals ───────────────────────────────────────────────────────────────── */
|
|
78
|
+
const URG = (r, now) => { const t = day(now), m = openMs(r)[0], d = m ? day(m.date) : r.over ? day(r.end) : null; return d && d < t ? 0 : r.status === 'at risk' ? 1 : (r.track && r.track.you) ? 2 : 3; };
|
|
79
|
+
/** The open proposal to show: the most urgent initiative's first one (its groups come in the Viewer's order). → { r, p } | null */
|
|
80
|
+
export function pickProp(rows, now = new Date()) {
|
|
81
|
+
const C = (rows || []).filter((r) => r && !closed(r) && r.props && (r.props.groups || []).length).sort((a, b) => URG(a, now) - URG(b, now));
|
|
82
|
+
for (const r of C) for (const g of r.props.groups) for (const p of g.props || []) if (p && p.id && p.group !== 'links' && (p.title || (p.items || []).length)) return { r, p };
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
const dt = (v, now) => { const d = day(v); return d ? dm(d, now) : String(v || ''); };
|
|
86
|
+
/** A proposal in the Suggestion's words: { title, why, will: [text], changes, basis }. Every line comes from the proposal; one it lacks is left out. */
|
|
87
|
+
export function sugOf(r, p, now = new Date()) {
|
|
88
|
+
const items = (p.items || []).filter(Boolean);
|
|
89
|
+
const will = items.slice(0, 4).map((x) => (x.from || x.to) && p.group === 'dates'
|
|
90
|
+
? `Move ${x.title || 'the task'}${x.from ? ' from ' + dt(x.from, now) : ''} to ${dt(x.to, now)}${x.jira ? ' (a comment on the Jira ticket; Jira is not changed)' : ''}`
|
|
91
|
+
: p.group === 'names' && x.from && x.to ? `Rename ${x.from} to ${x.to}` : String(x.title || ''));
|
|
92
|
+
if (items.length > 4) will.push(`and ${items.length - 4} more`);
|
|
93
|
+
if (p.ask && p.ask.owner) will.push(`Ask ${p.ask.owner} first; you see the message before it goes`);
|
|
94
|
+
const changes = p.plan && (p.plan.from || p.plan.to) ? `${p.stage ? p.stage + ' ' : 'The plan '}ends ${dt(p.plan.to, now)}${p.plan.from ? ' instead of ' + dt(p.plan.from, now) : ''}.` : '';
|
|
95
|
+
const basis = (p.sources || []).map((s) => (s && (s.label || s.name)) || '').filter(Boolean).join(', ');
|
|
96
|
+
const title = String(p.title || '').trim() || (will[0] || '');
|
|
97
|
+
return { title: title + (title && !title.includes(r.title) ? ` (${r.title})` : ''), why: String(p.why || '').trim(), will: title === will[0] && will.length === 1 ? [] : will, changes, basis };
|
|
98
|
+
}
|
|
99
|
+
/** The expanded Suggestion (pm-sug x). s: sugOf(); data: the attributes its answers carry (the page knows which proposal). */
|
|
100
|
+
export function sugHtml(s, data = '') {
|
|
101
|
+
if (!s || !s.title) return '';
|
|
102
|
+
const row = (k, v, cls = '') => (v ? `<dt>${k}</dt><dd${cls ? ` class="${cls}"` : ''}>${v}</dd>` : '');
|
|
103
|
+
return `<div class="pm-sug x" role="group" aria-label="PMOS suggests">`
|
|
104
|
+
+ `<div class="ttl">${SV(I.star)}<b class="say">${esc(s.title)}</b></div>`
|
|
105
|
+
+ `<dl>${row('Why', esc(s.why))}${row('PMOS will', s.will.length ? `<ul>${s.will.map((w) => `<li>${esc(w)}</li>`).join('')}</ul>` : '')}${row('What changes', esc(s.changes))}${row('Based on', esc(s.basis), 'src')}</dl>`
|
|
106
|
+
+ `<div class="ans"><button type="button" class="pm-btn" data-wksug="edit" ${data} aria-label="Change it first" title="Change it first">${SV(I.pen)}</button>`
|
|
107
|
+
+ `<button type="button" class="pm-btn primary" data-wksug="yes" ${data} aria-label="Yes, do it" title="Yes, do it">${SV(I.ok)}</button>`
|
|
108
|
+
+ `<button type="button" class="pm-btn outline" data-wksug="no" ${data} aria-label="No" title="No">${SV(I.x)}</button></div></div>`;
|
|
109
|
+
}
|
|
110
|
+
/** The Where it stands block: the sentences, then one Suggestion. Nothing to say and nothing suggested: no block. */
|
|
111
|
+
export function standsHtml(rows, o = {}) {
|
|
112
|
+
const now = o.now || new Date(), S = standsOf(rows, now);
|
|
113
|
+
const pk = o.sug === false ? null : pickProp(rows, now), sug = pk ? sugHtml(sugOf(pk.r, pk.p, now), `data-ini="${esc(pk.r.id)}" data-key="${esc(pk.r.key)}" data-pid="${esc(pk.p.id)}" data-sig="${esc(pk.p.sig || '')}"`) : '';
|
|
114
|
+
if (!S.length && !sug) return '';
|
|
115
|
+
return `<section class="pm-block wk-stands" aria-label="Where it stands"><h2 class="pm-h-sm pm-row">${SV(I.star).replace('pm-ic', 'pm-ic pm-star')}Where it stands</h2>`
|
|
116
|
+
+ (S.length ? `<p class="wk-say">${S.join(' ')}</p>` : '') + sug + '</section>';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* ── Next milestones: the date line ─────────────────────────────────────────────────────────────────────────── */
|
|
120
|
+
/** The next milestones of all initiatives from `from` on, earliest first. → [{ r, m, d, late }] */
|
|
121
|
+
export function nextMilestones(rows, now = new Date()) {
|
|
122
|
+
const t = day(now);
|
|
123
|
+
return (rows || []).filter((r) => r && !closed(r)).flatMap((r) => openMs(r).map((m) => ({ r, m, d: day(m.date), late: day(m.date) < t })))
|
|
124
|
+
.sort((a, b) => a.d - b.d);
|
|
125
|
+
}
|
|
126
|
+
/** Where the labels go: a label that would touch the one before it on its row drops to the next row (with a dashed lead). PURE.
|
|
127
|
+
* xs: the marks' positions in % of the line; w: a label's width in %. → [row index] */
|
|
128
|
+
export function stack(xs, w = 18) {
|
|
129
|
+
const ends = [], out = [];
|
|
130
|
+
for (const x of xs) { let k = 0; while (ends[k] != null && x < ends[k]) k++; ends[k] = x + w; out.push(k); }
|
|
131
|
+
return out;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The date line. items: nextMilestones(); W: the table's window { from, to }; o: { now, shift: how many milestones past the window's start
|
|
135
|
+
* were scrolled over (the left mark), title, sub, add: true draws + (New milestone) }. Shows the first 5 inside the window; the rest past
|
|
136
|
+
* the right end fold into +N with the month of the first of them above it.
|
|
137
|
+
*/
|
|
138
|
+
export function dlineHtml(items, W, o = {}) {
|
|
139
|
+
const now = o.now || new Date(), t = day(now), span = +W.to - +W.from || 1;
|
|
140
|
+
const X = (d) => ((+d - +W.from) / span) * 100, P = (x) => Math.max(0, Math.min(100, x)).toFixed(2) + '%';
|
|
141
|
+
const before = items.filter((x) => x.d < W.from && x.d >= t), inside = items.filter((x) => x.d >= W.from && x.d <= W.to), after = items.filter((x) => x.d > W.to);
|
|
142
|
+
const shown = inside.slice(0, 5), rest = inside.slice(5).concat(after);
|
|
143
|
+
// the month ticks along the line, the same as the table's
|
|
144
|
+
const ticks = [];
|
|
145
|
+
for (let d = new Date(W.from.getFullYear(), W.from.getMonth(), 1); d <= W.to; d = new Date(d.getFullYear(), d.getMonth() + 1, 1)) if (d >= W.from) ticks.push(d);
|
|
146
|
+
const step = ticks.length > 8 ? Math.ceil(ticks.length / 8) : 1;
|
|
147
|
+
const tk = ticks.filter((_, i) => i % step === 0).map((d) => `<span class="tk" style="left:${P(X(d))}">${esc(MON[d.getMonth()] + (d.getMonth() === 0 ? ' ' + d.getFullYear() : ''))}</span>`).join('');
|
|
148
|
+
const nowM = t >= W.from && t <= W.to ? `<i class="pm-now" style="left:${P(X(t))}"><span>${esc(dm(t, now))}</span></i>` : '';
|
|
149
|
+
const rowsOf = stack(shown.map((x) => X(x.d)), o.lw ? (180 / o.lw) * 100 : 14); // a label is about 180 px wide
|
|
150
|
+
const marks = shown.map((x, i) => {
|
|
151
|
+
const k = rowsOf[i], name = x.m.name || 'Milestone';
|
|
152
|
+
return `<div class="ms${x.late ? ' late' : ''}${k ? ' low' : ''}" style="left:${P(X(x.d))};--row:${k}">`
|
|
153
|
+
// a read-only copy draws the diamond as a mark, not a button: its card can pin a milestone
|
|
154
|
+
+ (o.ro ? `<span class="pm-dia${x.late ? ' late' : ''}" role="img" aria-label="${esc(name + ', ' + dm(x.d, now) + ', ' + x.r.title + (x.late ? ', late' : ''))}"></span>`
|
|
155
|
+
: `<button type="button" class="pm-dia${x.late ? ' late' : ''}" data-ms-pick="${esc(x.r.key)}" data-ms-id="${esc(x.m.id || '')}" aria-label="${esc(name + ', ' + dm(x.d, now) + ', ' + x.r.title + (x.late ? ', late' : ''))}" title="${esc(name + ' · ' + x.r.title)}"></button>`)
|
|
156
|
+
+ `<span class="lb"><span class="code">${esc(dm(x.d, now))}</span><b>${esc(name)}</b><span class="pm-meta">${esc(x.r.title)}</span>${x.late ? `<span class="pm-badge alert">${days(Math.round((t - x.d) / DAY))} late</span>` : ''}</span></div>`;
|
|
157
|
+
}).join('');
|
|
158
|
+
const lo = before.length ? `<button type="button" class="pm-more l" data-wkdl="back" aria-label="${esc(before.length + ' earlier: scroll back')}" title="${esc(before.map((x) => x.m.name).join(', '))}"><span>${esc(MON[before[before.length - 1].d.getMonth()])}</span><b>+${before.length}</b></button>` : '';
|
|
159
|
+
const hi = rest.length ? `<button type="button" class="pm-more r" data-wkdl="on" aria-label="${esc(rest.length + ' later: scroll on')}" title="${esc(rest.map((x) => x.m.name + ' · ' + dm(x.d, now)).join('\n'))}"><span>${esc(MON[rest[0].d.getMonth()])}</span><b>+${rest.length}</b></button>` : '';
|
|
160
|
+
const rowsN = Math.max(1, ...rowsOf.map((k) => k + 1));
|
|
161
|
+
return `<section class="pm-block wk-next" aria-label="${esc(o.title || 'Next milestones')}"><div class="head"><h2 class="pm-h">${esc(o.title || 'Next milestones')}</h2>${o.sub ? `<span class="pm-meta">${esc(o.sub)}</span>` : ''}<span class="sp"></span>`
|
|
162
|
+
+ (o.add ? `<button type="button" class="pm-btn" data-wkdl="add" aria-label="New milestone" title="New milestone">${SV(I.plus)}</button>` : '') + `</div>`
|
|
163
|
+
+ (items.length ? `<div class="pm-dline" style="--rows:${rowsN}"><div class="axis">${tk}</div><div class="line">${nowM}${marks}</div>${lo}${hi}</div>`
|
|
164
|
+
: `<p class="pm-meta">No milestone ahead yet.</p>`) + '</section>';
|
|
165
|
+
}
|