create-pmos 0.678.0 → 0.679.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/Timeline/README.md +1 -1
- package/payload/design-system/ui/components/bundle.css +7 -3
- 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/Timeline/README.md +1 -1
- package/workspace/design-system/ui/components/bundle.css +7 -3
- package/workspace/guide/layout.md +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-stands.js +59 -25
- package/workspace/public/pm/komorebi.css +7 -3
- package/workspace/public/pm/premium-board.js +19 -7
- package/workspace/public/pm/readonly.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.679.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.679.0",
|
|
38
|
+
"at": "2026-11-22T06:54:44.843Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1475,
|
|
43
|
+
"t": "Next milestones labels never overlap, and the strip scrolls apart from the table",
|
|
44
|
+
"s": "/mnt/project-files/milestones-strip/after-1440.png, all 9 milestones from 20 Nov 2026 to 15 Nov 2027 on one width, 0 overlaps (measured from the labels' bounding boxes), no horizontal scroll.",
|
|
45
|
+
"k": "fix"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
36
49
|
{
|
|
37
50
|
"v": "0.678.0",
|
|
38
51
|
"at": "2026-11-22T06:40:11.793Z",
|
|
@@ -363,19 +376,6 @@
|
|
|
363
376
|
"k": "new"
|
|
364
377
|
}
|
|
365
378
|
]
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
"v": "0.645.0",
|
|
369
|
-
"at": "2026-11-20T02:59:30.947Z",
|
|
370
|
-
"f": 4,
|
|
371
|
-
"prs": [
|
|
372
|
-
{
|
|
373
|
-
"n": 1427,
|
|
374
|
-
"t": "The Viewer card's parts on the PMOS design system, and the Funnel chart kind",
|
|
375
|
-
"s": "The Viewer card's parts on the PMOS design system, and the Funnel chart kind",
|
|
376
|
-
"k": "new"
|
|
377
|
-
}
|
|
378
|
-
]
|
|
379
379
|
}
|
|
380
380
|
]
|
|
381
381
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -20,4 +20,4 @@ The Work boards draw time in two more places, from the same marks:
|
|
|
20
20
|
|
|
21
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
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.
|
|
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. Each label has one fixed height: the date with its late badge beside it, then the name and the owner on one line each (cut with an ellipsis; the full words are in its title). A label never touches another: it drops to the first row where it touches none, with a dashed lead, and one near the right end reads to the left of its mark (`flip`). Milestones outside the line's window fold into `+N` marks (`pm-more`) at the ends, each with its nearest month above it. The line keeps its own window, apart from the table's: it opens on today and fits the next ten milestones on the full width, and a scroll on it moves only the line.
|
|
@@ -84,14 +84,18 @@ body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-s
|
|
|
84
84
|
.pm-dline{position:relative;padding:0 40px 0 8px}
|
|
85
85
|
.pm-dline .axis{position:relative;height:20px;font-size:13px;color:var(--muted)}
|
|
86
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) *
|
|
87
|
+
.pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 76px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
|
|
88
88
|
.pm-dline .line>.pm-now{bottom:auto;height:34px;top:-8px}
|
|
89
89
|
.pm-dline .ms{position:absolute;top:0;width:0}
|
|
90
90
|
.pm-dline .ms>.pm-dia{top:12px}
|
|
91
|
-
.pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) *
|
|
91
|
+
.pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 76px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:200px;height:68px;font-size:13px;line-height:20px;overflow:hidden}
|
|
92
|
+
.pm-dline .ms.flip .lb{left:auto;right:-6px;align-items:flex-end;text-align:right}
|
|
93
|
+
.pm-dline .ms .lb .hd{display:flex;align-items:center;gap:6px;height:22px}
|
|
94
|
+
.pm-dline .ms .lb .pm-badge{height:20px;padding:0 6px;font-size:12px}
|
|
95
|
+
.pm-dline .ms .lb b,.pm-dline .ms .lb .pm-meta{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
92
96
|
.pm-dline .ms .lb b{font-size:15px;line-height:24px;font-weight:600}
|
|
93
97
|
.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) *
|
|
98
|
+
.pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 76px + 6px);border-left:1px dashed var(--line)}
|
|
95
99
|
.pm-dline .ms.late .lb .code{color:var(--alert)}
|
|
96
100
|
.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
101
|
.pm-more.r{right:0}.pm-more.l{left:-8px}
|
|
@@ -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-22T06:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T06:54:41Z"}
|
|
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-22T06:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T06:54:41Z"}
|
|
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-22T06:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T06:54:41Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.679.0",
|
|
4
|
+
"at": "2026-11-22T06:54:44.843Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1475,
|
|
9
|
+
"t": "Next milestones labels never overlap, and the strip scrolls apart from the table",
|
|
10
|
+
"s": "/mnt/project-files/milestones-strip/after-1440.png, all 9 milestones from 20 Nov 2026 to 15 Nov 2027 on one width, 0 overlaps (measured from the labels' bounding boxes), no horizontal scroll.",
|
|
11
|
+
"k": "fix"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
2
15
|
{
|
|
3
16
|
"v": "0.678.0",
|
|
4
17
|
"at": "2026-11-22T06:40:11.793Z",
|
|
@@ -20,4 +20,4 @@ The Work boards draw time in two more places, from the same marks:
|
|
|
20
20
|
|
|
21
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
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.
|
|
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. Each label has one fixed height: the date with its late badge beside it, then the name and the owner on one line each (cut with an ellipsis; the full words are in its title). A label never touches another: it drops to the first row where it touches none, with a dashed lead, and one near the right end reads to the left of its mark (`flip`). Milestones outside the line's window fold into `+N` marks (`pm-more`) at the ends, each with its nearest month above it. The line keeps its own window, apart from the table's: it opens on today and fits the next ten milestones on the full width, and a scroll on it moves only the line.
|
|
@@ -84,14 +84,18 @@ body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-s
|
|
|
84
84
|
.pm-dline{position:relative;padding:0 40px 0 8px}
|
|
85
85
|
.pm-dline .axis{position:relative;height:20px;font-size:13px;color:var(--muted)}
|
|
86
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) *
|
|
87
|
+
.pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 76px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
|
|
88
88
|
.pm-dline .line>.pm-now{bottom:auto;height:34px;top:-8px}
|
|
89
89
|
.pm-dline .ms{position:absolute;top:0;width:0}
|
|
90
90
|
.pm-dline .ms>.pm-dia{top:12px}
|
|
91
|
-
.pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) *
|
|
91
|
+
.pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 76px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:200px;height:68px;font-size:13px;line-height:20px;overflow:hidden}
|
|
92
|
+
.pm-dline .ms.flip .lb{left:auto;right:-6px;align-items:flex-end;text-align:right}
|
|
93
|
+
.pm-dline .ms .lb .hd{display:flex;align-items:center;gap:6px;height:22px}
|
|
94
|
+
.pm-dline .ms .lb .pm-badge{height:20px;padding:0 6px;font-size:12px}
|
|
95
|
+
.pm-dline .ms .lb b,.pm-dline .ms .lb .pm-meta{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
92
96
|
.pm-dline .ms .lb b{font-size:15px;line-height:24px;font-weight:600}
|
|
93
97
|
.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) *
|
|
98
|
+
.pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 76px + 6px);border-left:1px dashed var(--line)}
|
|
95
99
|
.pm-dline .ms.late .lb .code{color:var(--alert)}
|
|
96
100
|
.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
101
|
.pm-more.r{right:0}.pm-more.l{left:-8px}
|
|
@@ -92,7 +92,7 @@ On a computer, Work is built from the parts of the PMOS design system. The top l
|
|
|
92
92
|
|
|
93
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
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
|
|
95
|
+
- **Next milestones.** The next ten milestones of all initiatives on one line, each with its date, its name and its initiative. The line has its own time range, apart from the table: it starts at today (or at a milestone that became late in the last 30 days) and ends at the last of the ten, so they all show across the full width without scrolling. Labels never cover each other: a label that is too close moves down a row, and a label near the right end reads to the left of its diamond. Scroll sideways on the line (or drag it) to move only the line. A milestone outside the line is in a **+N** mark at the end: press it to move the line there. After the line moves, the button at the top right puts it back at today. Press a diamond to open the milestone.
|
|
96
96
|
|
|
97
97
|
**Backlog** is the open work outside the sprint, in one rank across initiatives.
|
|
98
98
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.679.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.679.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
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
11
|
* urgent initiative first; none open, none drawn.
|
|
12
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.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* date, its name and its initiative. A label never touches another: a close one drops to the first free row with a dashed lead, and one
|
|
14
|
+
* near the right end reads to the left of its mark. The strip keeps its own window (dlineWindow), apart from the table's: it opens on
|
|
15
|
+
* today and fits the next 10 milestones on the full width; a scroll on it moves only the strip; the ones outside are +N marks at the ends.
|
|
16
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
17
|
|
|
18
18
|
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
@@ -21,7 +21,7 @@ const DAY = 864e5;
|
|
|
21
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
22
|
export const I = {
|
|
23
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',
|
|
24
|
+
x: 'M6 6l12 12M18 6L6 18', plus: 'M12 5v14M5 12h14', fit: 'M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5',
|
|
25
25
|
};
|
|
26
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
27
|
/** "12 Nov", and the year when it is not this year. */
|
|
@@ -126,39 +126,73 @@ export function nextMilestones(rows, now = new Date()) {
|
|
|
126
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
127
|
* xs: the marks' positions in % of the line; w: a label's width in %. → [row index] */
|
|
128
128
|
export function stack(xs, w = 18) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
return place(xs, w).map((p) => p.row);
|
|
130
|
+
}
|
|
131
|
+
/** Where each label goes. A label reads to the right of its mark; one that would pass the line's right end reads to the left of it (flip).
|
|
132
|
+
* A label that would touch any label already on a row drops to the first row where it touches none. Two marks on the same date never
|
|
133
|
+
* share a row. PURE. xs: the marks' positions in % of the line, earliest first; w: a label's width in %; gap: the space kept between
|
|
134
|
+
* two labels in %. → [{ row, flip }] */
|
|
135
|
+
export function place(xs, w = 18, gap = 0) {
|
|
136
|
+
const rows = [];
|
|
137
|
+
return xs.map((x) => {
|
|
138
|
+
const flip = x + w > 100 && x - w >= 0, a = flip ? x - w : x, b = flip ? x : x + w;
|
|
139
|
+
let k = 0;
|
|
140
|
+
while (rows[k] && rows[k].some(([c, d]) => a < d + gap && c < b + gap)) k++;
|
|
141
|
+
(rows[k] = rows[k] || []).push([a, b]);
|
|
142
|
+
return { row: k, flip };
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The strip's own window, apart from the table's (Wawan 2026-11-22: "the scroll should be independent from the gantt chart ... as much as
|
|
147
|
+
* possible contained on the full page and no scroll"). It opens on today, or on the earliest milestone that went late in the last 30 days,
|
|
148
|
+
* and ends on the `max`-th milestone ahead, so every one of them shows on the full width with nothing to scroll. off: how far the PM
|
|
149
|
+
* scrolled the strip, in ms. PURE. items: nextMilestones(). → { from, to, fit: the window before the scroll }
|
|
150
|
+
*/
|
|
151
|
+
export function dlineWindow(items, now = new Date(), o = {}) {
|
|
152
|
+
const t = day(now), max = o.max || 10, recent = +t - 30 * DAY;
|
|
153
|
+
const near = (items || []).filter((x) => +x.d >= recent).slice(0, max);
|
|
154
|
+
let from = near.length ? Math.min(+t, +near[0].d) : +t;
|
|
155
|
+
let to = near.length ? Math.max(+near[near.length - 1].d, +t) : +t;
|
|
156
|
+
if (to - from < 28 * DAY) to = from + 28 * DAY; // at least four weeks, so close dates still spread
|
|
157
|
+
const pad = (to - from) * 0.02; from -= pad; to += pad;
|
|
158
|
+
const off = +o.off || 0;
|
|
159
|
+
return { from: new Date(from + off), to: new Date(to + off), fit: { from: new Date(from), to: new Date(to) } };
|
|
132
160
|
}
|
|
133
161
|
/**
|
|
134
|
-
* The date line. items: nextMilestones(); W: the
|
|
135
|
-
*
|
|
136
|
-
* the
|
|
162
|
+
* The date line. items: nextMilestones(); W: the strip's window { from, to } (dlineWindow); o: { now, title, sub, add: true draws +
|
|
163
|
+
* (New milestone), lw: the line's width in px, max: how many marks to draw (10), moved: the strip was scrolled (draws Fit) }. Shows the
|
|
164
|
+
* first `max` inside the window; the ones before it and past it fold into +N marks at the ends, each with the month of its nearest one.
|
|
165
|
+
* Each +N carries data-at, the start the window moves to when it is pressed.
|
|
137
166
|
*/
|
|
138
167
|
export function dlineHtml(items, W, o = {}) {
|
|
139
|
-
const now = o.now || new Date(), t = day(now), span = +W.to - +W.from || 1;
|
|
168
|
+
const now = o.now || new Date(), t = day(now), span = +W.to - +W.from || 1, max = o.max || 10;
|
|
140
169
|
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
|
|
142
|
-
const shown = inside.slice(0,
|
|
143
|
-
// the month ticks along the line
|
|
170
|
+
const before = items.filter((x) => x.d < W.from), inside = items.filter((x) => x.d >= W.from && x.d <= W.to), after = items.filter((x) => x.d > W.to);
|
|
171
|
+
const shown = inside.slice(0, max), rest = inside.slice(max).concat(after);
|
|
172
|
+
// the month ticks along the line
|
|
144
173
|
const ticks = [];
|
|
145
174
|
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
175
|
const step = ticks.length > 8 ? Math.ceil(ticks.length / 8) : 1;
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
const
|
|
176
|
+
// a month name too close to today's date gives way to it (two words on one spot read as neither)
|
|
177
|
+
const inNow = t >= W.from && t <= W.to, lwT = o.lw || 1200;
|
|
178
|
+
const tk = ticks.filter((d, i) => i % step === 0 && !(inNow && Math.abs(X(d) - X(t)) * lwT / 100 < 70)).map((d) => `<span class="tk" style="left:${P(X(d))}">${esc(MON[d.getMonth()] + (d.getMonth() === 0 ? ' ' + d.getFullYear() : ''))}</span>`).join('');
|
|
179
|
+
const nowM = inNow ? `<i class="pm-now" style="left:${P(X(t))}"><span>${esc(dm(t, now))}</span></i>` : '';
|
|
180
|
+
// a label is 200 px wide at most (pm-dline .lb), with 16 px kept between two labels
|
|
181
|
+
const lw = o.lw || 1200, at = place(shown.map((x) => X(x.d)), (200 / lw) * 100, (16 / lw) * 100);
|
|
150
182
|
const marks = shown.map((x, i) => {
|
|
151
|
-
const k =
|
|
152
|
-
|
|
183
|
+
const { row: k, flip } = at[i], name = x.m.name || 'Milestone', when = dm(x.d, now);
|
|
184
|
+
const say = name + ', ' + when + ', ' + x.r.title + (x.late ? ', late' : '');
|
|
185
|
+
return `<div class="ms${x.late ? ' late' : ''}${k ? ' low' : ''}${flip ? ' flip' : ''}" style="left:${P(X(x.d))};--row:${k}">`
|
|
153
186
|
// 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(
|
|
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(
|
|
156
|
-
+ `<span class="lb"
|
|
187
|
+
+ (o.ro ? `<span class="pm-dia${x.late ? ' late' : ''}" role="img" aria-label="${esc(say)}"></span>`
|
|
188
|
+
: `<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(say)}" title="${esc(name + ' · ' + x.r.title)}"></button>`)
|
|
189
|
+
+ `<span class="lb" title="${esc(name + ' · ' + x.r.title)}"><span class="hd"><span class="code">${esc(when)}</span>${x.late ? `<span class="pm-badge alert">${days(Math.round((t - x.d) / DAY))} late</span>` : ''}</span><b>${esc(name)}</b><span class="pm-meta">${esc(x.r.title)}</span></span></div>`;
|
|
157
190
|
}).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('
|
|
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, ...
|
|
191
|
+
const lo = before.length ? `<button type="button" class="pm-more l" data-wkdl="back" data-at="${+before[before.length - 1].d - span * 0.8}" aria-label="${esc(before.length + ' earlier: scroll back')}" title="${esc(before.map((x) => x.m.name + ' · ' + dm(x.d, now)).join('\n'))}"><span>${esc(MON[before[before.length - 1].d.getMonth()])}</span><b>+${before.length}</b></button>` : '';
|
|
192
|
+
const hi = rest.length ? `<button type="button" class="pm-more r" data-wkdl="on" data-at="${+rest[0].d - span * 0.05}" 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>` : '';
|
|
193
|
+
const rowsN = Math.max(1, ...at.map((p) => p.row + 1));
|
|
161
194
|
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>`
|
|
195
|
+
+ (o.moved ? `<button type="button" class="pm-btn" data-wkdl="fit" aria-label="Show from today" title="Show from today">${SV(I.fit)}</button>` : '')
|
|
162
196
|
+ (o.add ? `<button type="button" class="pm-btn" data-wkdl="add" aria-label="New milestone" title="New milestone">${SV(I.plus)}</button>` : '') + `</div>`
|
|
163
197
|
+ (items.length ? `<div class="pm-dline" style="--rows:${rowsN}"><div class="axis">${tk}</div><div class="line">${nowM}${marks}</div>${lo}${hi}</div>`
|
|
164
198
|
: `<p class="pm-meta">No milestone ahead yet.</p>`) + '</section>';
|
|
@@ -92,14 +92,18 @@
|
|
|
92
92
|
.pm-ds .pm-dline{position:relative;padding:0 40px 0 8px}
|
|
93
93
|
.pm-ds .pm-dline .axis{position:relative;height:20px;font-size:13px;color:var(--muted)}
|
|
94
94
|
.pm-ds .pm-dline .axis .tk{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}
|
|
95
|
-
.pm-ds .pm-dline .line{position:relative;height:calc(24px + var(--rows,1) *
|
|
95
|
+
.pm-ds .pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 76px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
|
|
96
96
|
.pm-ds .pm-dline .line>.pm-now{bottom:auto;height:34px;top:-8px}
|
|
97
97
|
.pm-ds .pm-dline .ms{position:absolute;top:0;width:0}
|
|
98
98
|
.pm-ds .pm-dline .ms>.pm-dia{top:12px}
|
|
99
|
-
.pm-ds .pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) *
|
|
99
|
+
.pm-ds .pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 76px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:200px;height:68px;font-size:13px;line-height:20px;overflow:hidden}
|
|
100
|
+
.pm-ds .pm-dline .ms.flip .lb{left:auto;right:-6px;align-items:flex-end;text-align:right}
|
|
101
|
+
.pm-ds .pm-dline .ms .lb .hd{display:flex;align-items:center;gap:6px;height:22px}
|
|
102
|
+
.pm-ds .pm-dline .ms .lb .pm-badge{height:20px;padding:0 6px;font-size:12px}
|
|
103
|
+
.pm-ds .pm-dline .ms .lb b, .pm-ds .pm-dline .ms .lb .pm-meta{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
100
104
|
.pm-ds .pm-dline .ms .lb b{font-size:15px;line-height:24px;font-weight:600}
|
|
101
105
|
.pm-ds .pm-dline .ms .lb .code{font-family:var(--font-mono);color:var(--muted)}
|
|
102
|
-
.pm-ds .pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) *
|
|
106
|
+
.pm-ds .pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 76px + 6px);border-left:1px dashed var(--line)}
|
|
103
107
|
.pm-ds .pm-dline .ms.late .lb .code{color:var(--alert)}
|
|
104
108
|
.pm-ds .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}
|
|
105
109
|
.pm-ds .pm-more.r{right:0}
|
|
@@ -623,8 +623,14 @@ function drawWork(L) {
|
|
|
623
623
|
goalGroups: (rows) => (GOALS ? GL.asGroups(rows, GOALS, (rs) => sortInis(pk, rs, lay, INI_ACC)) : null),
|
|
624
624
|
canMove: (r) => !ROC && !!(r.track && r.acts && (r.acts.stages || []).length > 1) });
|
|
625
625
|
const W = WV.lastWindow(), vis = WV.filterRows(L, { product: wkProduct, programOf: wkProgOf });
|
|
626
|
-
|
|
627
|
-
|
|
626
|
+
if (!W || WV.read().tl === false) return ST.standsHtml(vis, { sug: !ROC }) + list;
|
|
627
|
+
// the Next milestones strip keeps its own window, apart from the table's (Wawan 2026-11-22): it fits the next milestones on the full width
|
|
628
|
+
const NM = ST.nextMilestones(vis), DW = ST.dlineWindow(NM, new Date(), { off: DL_OFF });
|
|
629
|
+
DL_W = DW;
|
|
630
|
+
return ST.standsHtml(vis, { sug: !ROC }) + list + ST.dlineHtml(NM, DW, { sub: 'all initiatives', ro: ROC, moved: !!DL_OFF, lw: ($('#ibBody').clientWidth || innerWidth) - 90 });
|
|
631
|
+
}
|
|
632
|
+
/** How far the PM scrolled the Next milestones strip, in ms (0: it fits from today), and the window it was last drawn with. */
|
|
633
|
+
let DL_OFF = 0, DL_W = null;
|
|
628
634
|
/** The Suggestion's answers (WorkDS): Yes keeps the proposal (POST /api/proposals/keep, Undo in the toast), No drops it (POST
|
|
629
635
|
* /api/proposals/drop), the pencil opens the initiative, where its proposals can be changed before they are kept. */
|
|
630
636
|
async function sugPress(b) {
|
|
@@ -647,14 +653,19 @@ async function sugPress(b) {
|
|
|
647
653
|
* also press what is under it. */
|
|
648
654
|
{
|
|
649
655
|
const body = $('#ibBody'); let drag = null, raf = 0, moved = false;
|
|
650
|
-
|
|
656
|
+
// the table and the Next milestones strip scroll apart: each moves its own window (the strip's is DL_OFF, in ms)
|
|
657
|
+
const pxDays = (dl) => {
|
|
658
|
+
if (dl) { const x = $('#ibBody .pm-dline .line'), w = x ? x.getBoundingClientRect().width : 0; return DL_W && w ? (DL_W.to - DL_W.from) / 864e5 / w : 0; }
|
|
659
|
+
const W = WV.lastWindow(), x = $('#ibBody .wk-i .wk-bw') || $('#ibBody .wk-tl'); const w = x ? x.getBoundingClientRect().width : 0; return W && w ? (W.to - W.from) / 864e5 / w : 0;
|
|
660
|
+
};
|
|
661
|
+
const move = (dl, d) => { if (dl) DL_OFF += d * 864e5; else WV.scrollBy(d); };
|
|
651
662
|
const redraw = () => { if (raf) return; raf = requestAnimationFrame(() => { raf = 0; drawInit(); }); };
|
|
652
663
|
body.addEventListener('wheel', (e) => {
|
|
653
664
|
if (curView() !== 'work' || !e.target.closest('.wk-x, .pm-dline') || Math.abs(e.deltaX) <= Math.abs(e.deltaY)) return;
|
|
654
|
-
e.preventDefault(); const k = pxDays(); if (!k) return;
|
|
665
|
+
e.preventDefault(); const dl = !!e.target.closest('.pm-dline'), k = pxDays(dl); if (!k) return; move(dl, e.deltaX * k); redraw();
|
|
655
666
|
}, { passive: false });
|
|
656
|
-
body.addEventListener('pointerdown', (e) => { if (curView() !== 'work' || e.button !== 0 || !e.target.closest('.wk-x, .pm-dline') || e.target.closest('button')) return; drag = { x: e.clientX, k: pxDays() }; moved = false; });
|
|
657
|
-
addEventListener('pointermove', (e) => { if (!drag || !drag.k) return; const dx = e.clientX - drag.x; if (!moved && Math.abs(dx) < 5) return; moved = true; document.body.classList.add('wk-drag');
|
|
667
|
+
body.addEventListener('pointerdown', (e) => { if (curView() !== 'work' || e.button !== 0 || !e.target.closest('.wk-x, .pm-dline') || e.target.closest('button')) return; const dl = !!e.target.closest('.pm-dline'); drag = { x: e.clientX, dl, k: pxDays(dl) }; moved = false; });
|
|
668
|
+
addEventListener('pointermove', (e) => { if (!drag || !drag.k) return; const dx = e.clientX - drag.x; if (!moved && Math.abs(dx) < 5) return; moved = true; document.body.classList.add('wk-drag'); move(drag.dl, -dx * drag.k); drag.x = e.clientX; redraw(); });
|
|
658
669
|
addEventListener('pointerup', () => { if (!drag) return; drag = null; document.body.classList.remove('wk-drag'); if (moved) setTimeout(() => { moved = false; }, 0); });
|
|
659
670
|
body.addEventListener('click', (e) => { if (moved) { e.stopImmediatePropagation(); e.preventDefault(); } }, true);
|
|
660
671
|
}
|
|
@@ -890,7 +901,8 @@ $('#ibBody').addEventListener('click', (e) => {
|
|
|
890
901
|
if (curView() === 'work') {
|
|
891
902
|
const op = e.target.closest('[data-wkopen]'); if (op) { e.preventDefault(); openIni(rowOf(op.dataset.wkopen), op); return; }
|
|
892
903
|
const sg = e.target.closest('[data-wksug]'); if (sg) { sugPress(sg); return; }
|
|
893
|
-
|
|
904
|
+
// the strip's +N marks and Fit move only the strip, never the table
|
|
905
|
+
const dl = e.target.closest('[data-wkdl]'); if (dl && dl.dataset.wkdl !== 'add') { DL_OFF = dl.dataset.wkdl === 'fit' || !DL_W ? 0 : DL_OFF + (+dl.dataset.at - +DL_W.from); drawInit(); const n = $(`#ibBody [data-wkdl="${dl.dataset.wkdl}"]`) || $('#ibBody .wk-next .pm-more') || $('#ibBody [data-wknav="today"]'); if (n) n.focus(); return; }
|
|
894
906
|
if (workPress(e)) return;
|
|
895
907
|
}
|
|
896
908
|
if (e.target.closest('#fold, [data-mefold]')) { foldOpen = !foldOpen; drawInit(); const f = $('#fold') || $('#ibBody [data-mefold]'); if (f) f.focus(); return; }
|
|
@@ -35,7 +35,7 @@ export const VIEW_CONTROLS = [
|
|
|
35
35
|
'.wk-hd', '[data-wkspan]', '[data-wkspick]', '[data-wktl]', '[data-wkclosed]', '.wk-i[data-key]', '[data-wkbar] .tg-bar', '[data-wkbar] .wk-bar', '.wk-card', '[data-wkclear]',
|
|
36
36
|
// WorkDS (initiative work-ds-initiatives): Where it stands' names (open the initiative), the scale tabs, Earlier / Go to today / Later,
|
|
37
37
|
// Choose columns (the copy's filter and sort), the timeline switch in it, the Next milestones line's +N marks
|
|
38
|
-
'[data-wkopen]', '[data-wknav]', '[data-wkmenu]', '.wk-menu [data-wktlsw]', '[data-wkdl="on"]', '[data-wkdl="back"]',
|
|
38
|
+
'[data-wkopen]', '[data-wknav]', '[data-wkmenu]', '.wk-menu [data-wktlsw]', '[data-wkdl="on"]', '[data-wkdl="back"]', '[data-wkdl="fit"]',
|
|
39
39
|
'#bdFind', '#roFind', '#bdFilter', '.wk-menu [data-wkf]', '.wk-menu [data-wkmore]', '.wk-menu [data-wksortp]', '.wk-menu [data-wksortx]', '.wk-menu [data-wkreset]',
|
|
40
40
|
// the popup of a row, read only (Part A 4): its close and its edge, Details, a stage's fold, the done and far folds
|
|
41
41
|
// its path and ← back to the page it came from (the design-system popup, #1432: "Work ›" and "Back to Work") only navigate
|