create-pmos 0.441.0 → 0.442.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 +13 -13
- 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/adler-seasons-art-test.js +106 -0
- package/workspace/adler-seasons-test.js +111 -0
- package/workspace/briefing-premium-board-test.js +19 -17
- package/workspace/briefing-premium-initiative-test.js +7 -4
- package/workspace/changelog.json +12 -0
- package/workspace/guide/adler.md +10 -0
- package/workspace/guide/home.md +2 -0
- package/workspace/ini-workflow-test.js +6 -2
- package/workspace/lib/settings-store.js +38 -0
- package/workspace/metric-drafts-ui-test.js +2 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -1
- package/workspace/premium-chat-attach-test.js +2 -0
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-ini-panel.js +2 -2
- package/workspace/public/pm/c3-ini-ui.js +1 -1
- package/workspace/public/pm/cozy-adler.css +21 -0
- package/workspace/public/pm/cozy-adler.js +415 -8
- package/workspace/public/pm/cozy-ev.css +16 -1
- package/workspace/public/pm/cozy-home.css +8 -0
- package/workspace/public/pm/cozy-news.js +1 -1
- package/workspace/public/pm/cozy-seasons.js +318 -0
- package/workspace/public/pm/cozy-settings.js +88 -5
- package/workspace/public/pm/cozy-viewer.js +8 -4
- package/workspace/public/pm/cozy.css +65 -0
- package/workspace/public/pm/dash-view.js +4 -2
- package/workspace/public/pm/home-app.js +8 -2
- package/workspace/public/pm/home-chat.js +1 -1
- package/workspace/public/pm/home-day.js +7 -4
- package/workspace/public/pm/home-ini.js +2 -2
- package/workspace/public/pm/home-mentions.js +1 -1
- package/workspace/public/pm/impact.js +1 -1
- package/workspace/public/pm/ini-groups.js +15 -10
- package/workspace/public/pm/ini-links.js +1 -1
- package/workspace/public/pm/ini-tasks.js +208 -44
- package/workspace/public/pm/ini-view-model.js +8 -2
- package/workspace/public/pm/ini-view.css +305 -1
- package/workspace/public/pm/ini-view.js +190 -80
- package/workspace/public/pm/mission.js +234 -0
- package/workspace/public/pm/premium-board.js +1 -1
- package/workspace/public/pm/premium-welcome.js +2 -2
- package/workspace/public/pm/split-merge.js +1 -1
- package/workspace/public/pm/stage-line.js +2 -2
- package/workspace/split-merge-ui-test.js +1 -1
- package/workspace/stage-card-test.js +48 -11
- package/workspace/task-links-test.js +2 -0
- package/workspace/task-milestones-test.js +5 -1
- package/workspace/task-plans-test.js +3 -3
- package/workspace/task-views-test.js +90 -37
- package/workspace/test-lists/adler-seasons-art.json +13 -0
- package/workspace/test-lists/batch18-adler-seasons.json +13 -0
- package/workspace/test-lists/mission.json +5 -0
- package/workspace/test-lists/viewer-tasks.json +5 -0
- package/workspace/tk-tasks-test.js +25 -30
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/* pm/mission.js — the initiative as a mission (feedback batch 18 item 1, agreed A; canvas In development: XvpL5Rocket, XvpL6RocketDark,
|
|
2
|
+
* XvpE1States, XvpE2Stages, XvpE3TapMs, XvpD1Desktop; the art is mission() in next18/viewer-on-phone-gen/gen_rocket3.py, ported here). It
|
|
3
|
+
* replaces the stage card's one line in the ONE initiative view (pm/ini-view.js): one picture of the whole initiative, 100 px tall.
|
|
4
|
+
*
|
|
5
|
+
* missionOf(L) → the model, from the stage line's model (pm/stage-line.js lineOf): every place is a % of the same line, so the
|
|
6
|
+
* picture and the line never disagree. Pure.
|
|
7
|
+
* missionSvg(M, o) → the SVG. o: { tap (the milestones are presses: a 44 px hit area each) }. Colours are classes (ini-view.css
|
|
8
|
+
* names the --mi-* tokens of cozy.css): no colour is written here.
|
|
9
|
+
* crowded(points, gap) → the ids of the points closer than gap to another one: those are drawn without a press (the tap on the picture
|
|
10
|
+
* opens the list in place instead).
|
|
11
|
+
*
|
|
12
|
+
* THE STORY (xvpA):
|
|
13
|
+
* the ground strip is the stages, on their plan dates: done green, now blue, late orange, on hold grey, dashed with no dates; Today ticks
|
|
14
|
+
* on it. Small flags are the early milestones (gold when passed, grey ahead, orange when late).
|
|
15
|
+
* Discover: a telescope near the left scans for the target planet, which is a "?" until Discover is done.
|
|
16
|
+
* Plan to Build: the rocket is a dashed blueprint on the pad at the start of Build; through the first half of Build it is built from the
|
|
17
|
+
* bottom up (a clip) with sparks. Past Build 50% it lifts off and flies a curve to the planet.
|
|
18
|
+
* The release milestone (the first one named launch, release, rollout or deploy): it lands on the planet and plants a flag. With no such
|
|
19
|
+
* milestone the planet stands at the end of Deliver; with no Build stage it lifts off at the start of the stage the release falls in.
|
|
20
|
+
* The stages say what happened and the dates how far along it is: the rocket stays a blueprint until Build runs, flies once Build is done,
|
|
21
|
+
* and lands only when the release milestone is done (with none, when Deliver is done).
|
|
22
|
+
* Monitor: a dish at the right edge listens, with waves; the last milestone ("Did it work?") lights it green.
|
|
23
|
+
* Motion (draw-in, flame, sparks, scan, twinkle, waves) is CSS; all of it stops under reduced motion and Settings > Adler > Motion: Still. */
|
|
24
|
+
|
|
25
|
+
export const W = 340, H = 100;
|
|
26
|
+
const GY = 78; // the ground line
|
|
27
|
+
export const PX = W - 62, PY = 34; // the target planet, near the right end
|
|
28
|
+
const DX = W - 16; // the dish, at the right edge
|
|
29
|
+
const TX = 30; // the telescope, near the left end
|
|
30
|
+
export const HIT = 44; // a press's square, in px (the picture draws about 1 px a unit)
|
|
31
|
+
export const NEAR = 24; // two presses closer than this are one press on the picture
|
|
32
|
+
export const RELEASE_RE = /\b(launch(es|ed)?|releas(e|es|ed)|roll[- ]?outs?|deploy(s|ed|ment)?)\b/i;
|
|
33
|
+
|
|
34
|
+
const X = (p) => +(6 + (Math.max(0, Math.min(100, p)) * (W - 12)) / 100).toFixed(1);
|
|
35
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
36
|
+
const f1 = (n) => (+n).toFixed(1);
|
|
37
|
+
const clamp = (v, a, b) => Math.max(a, Math.min(b, v));
|
|
38
|
+
const isBuild = (p) => /^build$/i.test(p.key || '') || /\bbuild\b/i.test(p.name || '');
|
|
39
|
+
const isDiscover = (p) => /^discover/i.test(p.key || '') || /\bdiscover/i.test(p.name || '');
|
|
40
|
+
const isDeliver = (p) => /^deliver/i.test(p.key || '') || /\bdeliver/i.test(p.name || '');
|
|
41
|
+
|
|
42
|
+
/** The release milestone among the line's ◇s: the first item (in date order) named for a launch. → { x, item, at } | null */
|
|
43
|
+
export function releaseOf(ms) {
|
|
44
|
+
for (const [at, m] of (ms || []).entries()) for (const it of m.items || []) if (RELEASE_RE.test(it.name || '')) return { x: m.x, item: it, at };
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** The mission's model from the stage line's (lineOf). */
|
|
49
|
+
export function missionOf(L) {
|
|
50
|
+
if (!L) return null;
|
|
51
|
+
const finished = !!L.finished, hold = !!(L.chip && L.chip.pause), empty = !!L.empty;
|
|
52
|
+
const now = (L.parts || []).find((p) => p.cls === 'now');
|
|
53
|
+
const late = !hold && !finished && (!!L.over || (L.ms || []).some((m) => m.late && !m.done && now && m.x >= now.l - 0.5 && m.x <= now.l + now.w + 0.5));
|
|
54
|
+
const parts = (L.parts || []).map((p) => ({ key: p.key, name: p.name, l: p.l, w: p.w, dash: !!p.dash,
|
|
55
|
+
cls: finished || p.cls === 'done' ? 'dn' : p.cls === 'now' ? (hold ? 'hold' : late ? 'late' : 'nw') : 'q' }));
|
|
56
|
+
// where it is: Today's place on the line; past every date when it is done, at the start when the work has not begun
|
|
57
|
+
const t = finished ? 101 : L.today != null ? L.today : L.ended ? 101 : 0;
|
|
58
|
+
const ms = empty ? [] : (L.ms || []);
|
|
59
|
+
const rel = releaseOf(ms);
|
|
60
|
+
const endM = ms.find((m) => m.end) || null;
|
|
61
|
+
const evalItem = endM && endM.items && endM.items[0] && !(rel && rel.item === endM.items[0]) ? endM.items[0] : null;
|
|
62
|
+
// the planet's time: the release milestone, else the end of Deliver, else the end of the line
|
|
63
|
+
const del = parts.find(isDeliver);
|
|
64
|
+
const rx = rel ? rel.x : del ? del.l + del.w : 100;
|
|
65
|
+
// the build: the first half of Build, then lift-off; with no Build, it lifts off where the stage the release falls in starts
|
|
66
|
+
const bp = parts.find(isBuild);
|
|
67
|
+
let bA, lift;
|
|
68
|
+
if (bp) { bA = bp.l; lift = bp.l + bp.w / 2; }
|
|
69
|
+
else {
|
|
70
|
+
const i = parts.reduce((k, p, j) => (p.l <= rx + 0.01 ? j : k), -1);
|
|
71
|
+
lift = i >= 0 ? parts[i].l : rx;
|
|
72
|
+
bA = i > 0 ? parts[i - 1].l : 0;
|
|
73
|
+
}
|
|
74
|
+
if (lift <= bA) bA = Math.max(0, lift - 1);
|
|
75
|
+
// the stages say what happened, the dates only how far it is: it never flies before Build runs, nor lands before the release is done
|
|
76
|
+
// (with no Build: built through the stage before the release's, lifted off once the release's stage runs)
|
|
77
|
+
const ri = bp ? -1 : parts.reduce((k, p, j) => (p.l <= rx + 0.01 ? j : k), -1);
|
|
78
|
+
const builtIn = bp || (ri > 0 ? parts[ri - 1] : null), liftIn = bp ? null : ri >= 0 ? parts[ri] : null;
|
|
79
|
+
const mustFly = bp ? bp.cls === 'dn' : !!(liftIn && liftIn.cls !== 'q');
|
|
80
|
+
const landed = finished || (rel ? !!rel.item.done : del ? del.cls === 'dn' : false);
|
|
81
|
+
let phase, frac = 0, fly = 0;
|
|
82
|
+
if (landed) { phase = 'landed'; fly = 1; }
|
|
83
|
+
else if (!mustFly && builtIn && builtIn.cls === 'q') phase = 'pad';
|
|
84
|
+
else if (!mustFly && t < lift) { frac = t <= bA ? 0 : clamp((t - bA) / (lift - bA), 0, 1); phase = frac > 0 ? 'build' : 'pad'; }
|
|
85
|
+
else if (!mustFly && liftIn && liftIn.cls === 'q') { frac = 1; phase = 'build'; }
|
|
86
|
+
else { phase = 'fly'; fly = clamp((t - lift) / Math.max(0.01, rx - lift), 0.05, 0.95); }
|
|
87
|
+
const disc = parts.find(isDiscover);
|
|
88
|
+
const found = finished || !disc || disc.cls === 'dn';
|
|
89
|
+
const heard = finished || !!(evalItem && evalItem.done);
|
|
90
|
+
// the small flags: every ◇ but the release and the last one (a counted ◇ keeps its other milestones)
|
|
91
|
+
const flags = [];
|
|
92
|
+
ms.forEach((m) => {
|
|
93
|
+
if (m.end) return;
|
|
94
|
+
const items = (m.items || []).filter((it) => !rel || it !== rel.item);
|
|
95
|
+
if (!items.length) return;
|
|
96
|
+
flags.push({ x: m.x, n: items.length, items, name: items.length > 1 ? items.length + ' milestones' : items[0].name, date: items.length > 1 ? '' : items[0].date,
|
|
97
|
+
done: items.every((it) => it.done), late: items.some((it) => it.late) });
|
|
98
|
+
});
|
|
99
|
+
return { empty, hold, late, finished, t, today: !empty && !heard && L.today != null ? L.today : null, parts, flags, found, phase, frac, fly, landed, heard,
|
|
100
|
+
listening: landed && !heard, pad: bA, lift, rx,
|
|
101
|
+
planet: rel ? { id: rel.item.id || '', name: rel.item.name, date: rel.item.date || '', done: !!rel.item.done, late: !!rel.item.late } : null,
|
|
102
|
+
dish: evalItem ? { id: evalItem.id || '', name: evalItem.name, date: evalItem.date || '', done: !!evalItem.done, late: !!evalItem.late } : null };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** The presses' centres, in the picture's units: the flags, the planet and the dish. → [{ key, x, y }] */
|
|
106
|
+
export function pointsOf(M) {
|
|
107
|
+
if (!M) return [];
|
|
108
|
+
const out = M.flags.map((f, i) => ({ key: 'f' + i, x: X(f.x) + 3, y: GY - 4 }));
|
|
109
|
+
if (M.planet) out.push({ key: 'planet', x: PX, y: PY });
|
|
110
|
+
if (M.dish) out.push({ key: 'dish', x: DX - 2, y: GY - 12 });
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
/** The keys of the points closer than gap to another point. */
|
|
114
|
+
export function crowded(points, gap = NEAR) {
|
|
115
|
+
const out = new Set();
|
|
116
|
+
for (let i = 0; i < points.length; i++) for (let j = i + 1; j < points.length; j++) {
|
|
117
|
+
if (Math.hypot(points[i].x - points[j].x, points[i].y - points[j].y) < gap) { out.add(points[i].key); out.add(points[j].key); }
|
|
118
|
+
}
|
|
119
|
+
return out;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const rocketBody = (fin = 'mi-fin') => '<path d="M-5 0 L-5 -18 Q-5 -26 0 -31 Q5 -26 5 -18 L5 0Z" class="mi-rb mi-ln" stroke-width="1.1" stroke-linejoin="round"/>'
|
|
123
|
+
+ `<path d="M-5 -7 L-10 1 L-5 0Z M5 -7 L10 1 L5 0Z" class="${fin} mi-ln" stroke-width=".9" stroke-linejoin="round"/>`
|
|
124
|
+
+ '<circle cx="0" cy="-17" r="2.4" class="mi-win mi-ln" stroke-width=".8"/>';
|
|
125
|
+
const ghostBody = () => '<path d="M-5 0 L-5 -18 Q-5 -26 0 -31 Q5 -26 5 -18 L5 0Z" fill="none" class="mi-gh" stroke-width="1.1" stroke-dasharray="2 2" stroke-linejoin="round"/>'
|
|
126
|
+
+ '<path d="M-5 -7 L-10 1 L-5 0Z M5 -7 L10 1 L5 0Z" fill="none" class="mi-gh" stroke-width=".9" stroke-dasharray="2 2" stroke-linejoin="round"/>'
|
|
127
|
+
+ '<circle cx="0" cy="-17" r="2.4" fill="none" class="mi-gh" stroke-width=".8" stroke-dasharray="2 2"/>';
|
|
128
|
+
|
|
129
|
+
let seq = 0;
|
|
130
|
+
/** The press around one drawn milestone: a 44 px square, the words for a reader, the task it opens. */
|
|
131
|
+
function press(inner, it, x, y, o, key, hold) {
|
|
132
|
+
if (!o.tap || !it || !it.id || hold.has(key)) return `<g aria-hidden="true">${inner}</g>`;
|
|
133
|
+
const words = it.name + (it.date ? ', ' + it.date : '') + (it.late ? ', late' : it.done ? ', done' : '');
|
|
134
|
+
return `<g class="mi-ms" role="button" tabindex="0" data-mi-ms="${esc(it.id)}" data-mi-tip="${esc(it.name)}" data-mi-date="${esc(it.date || '')}" data-mi-x="${f1((x / W) * 100)}" aria-label="${esc('Milestone ' + words + '. Open its task')}">`
|
|
135
|
+
+ `<rect x="${f1(x - HIT / 2)}" y="${f1(y - HIT / 2)}" width="${HIT}" height="${HIT}" fill="transparent"/>${inner}</g>`;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** The SVG of the mission. */
|
|
139
|
+
export function missionSvg(M, o = {}) {
|
|
140
|
+
if (!M) return '';
|
|
141
|
+
const id = 'mi' + (++seq).toString(36);
|
|
142
|
+
const crowd = crowded(pointsOf(M));
|
|
143
|
+
let s = `<defs><linearGradient id="${id}k" x1="0" y1="0" x2="0" y2="1"><stop offset="0" class="mi-s0"/><stop offset="1" class="mi-s1"/></linearGradient>`
|
|
144
|
+
+ `<linearGradient id="${id}x" x1="0" x2="1"><stop offset="0" class="mi-t0"/><stop offset="1" class="mi-t1"/></linearGradient></defs>`;
|
|
145
|
+
s += `<rect x="0" y="0" width="${W}" height="${H}" rx="14" fill="url(#${id}k)"/>`;
|
|
146
|
+
// the stars
|
|
147
|
+
[[30, 12, 1], [84, 26, 0.8], [124, 9, 1.2], [160, 30, 0.9], [250, 12, 1], [292, 30, 0.8], [W - 26, 8, 1]].forEach(([x, y, r], k) => {
|
|
148
|
+
s += `<circle class="mi-tw mi-star mi-d${k}" transform-origin="${x} ${y}" cx="${x}" cy="${y}" r="${r}"/>`;
|
|
149
|
+
});
|
|
150
|
+
// the target planet
|
|
151
|
+
const planet = `<g class="${M.found ? '' : 'mi-seek'}" transform-origin="${PX} ${PY}">`
|
|
152
|
+
+ `<circle cx="${PX}" cy="${PY}" r="12" class="${M.found ? 'mi-pl' : 'mi-pq'}"${M.found ? '' : ' stroke-dasharray="3 3"'} stroke-width="1.4"/>`
|
|
153
|
+
+ (M.found ? `<ellipse cx="${PX}" cy="${PY}" rx="18" ry="4.5" fill="none" class="mi-ring" stroke-width="1.6" transform="rotate(-18 ${PX} ${PY})"/>`
|
|
154
|
+
+ `<circle cx="${PX - 4}" cy="${PY - 3}" r="2.6" class="mi-spot"/><circle cx="${PX + 4}" cy="${PY + 4}" r="1.8" class="mi-spot"/>`
|
|
155
|
+
: `<text x="${PX}" y="${PY + 4}" text-anchor="middle" class="mi-qm">?</text>`) + '</g>';
|
|
156
|
+
s += press(planet, M.planet, PX, PY, o, 'planet', crowd);
|
|
157
|
+
// the ground and the stage strip
|
|
158
|
+
s += `<path d="M0 ${H} L0 ${GY - 2} Q60 ${GY - 5} 130 ${GY - 2} T${W} ${GY - 3} L${W} ${H}Z" class="mi-gr"/>`;
|
|
159
|
+
for (const p of M.parts) {
|
|
160
|
+
const x = X(p.l), w = Math.max(X(p.l + p.w) - x - 2, 3);
|
|
161
|
+
s += p.dash || M.empty ? `<rect x="${f1(x + 1)}" y="${GY + 4}" width="${f1(w)}" height="6" rx="3" fill="none" class="mi-dsh ${p.cls}" stroke-dasharray="2 2"/>`
|
|
162
|
+
: `<rect x="${f1(x + 1)}" y="${GY + 4}" width="${f1(w)}" height="6" rx="3" class="mi-st ${p.cls}"/>`;
|
|
163
|
+
}
|
|
164
|
+
// the small flags
|
|
165
|
+
M.flags.forEach((f, i) => {
|
|
166
|
+
const x = X(f.x);
|
|
167
|
+
const inner = `<rect x="${f1(x - 0.7)}" y="${GY - 8}" width="1.4" height="12" class="mi-pole"/><path d="M${f1(x + 0.7)} ${GY - 8} L${f1(x + 7)} ${GY - 6} L${f1(x + 0.7)} ${GY - 4}Z" class="mi-fl ${f.late ? 'late' : f.done ? 'dn' : 'q'}"/>`;
|
|
168
|
+
s += press(inner, f.n === 1 ? f.items[0] : null, x + 3, GY - 4, o, 'f' + i, crowd);
|
|
169
|
+
});
|
|
170
|
+
// Discover: the telescope looks for the planet
|
|
171
|
+
const still = M.hold || M.empty;
|
|
172
|
+
const seeking = !M.found && !M.hold;
|
|
173
|
+
const ang = (Math.atan2(PY - (GY - 14), PX - TX) * 180) / Math.PI;
|
|
174
|
+
s += `<g aria-hidden="true"><path d="M${TX - 5} ${GY} L${TX} ${GY - 10} L${TX + 5} ${GY} M${TX} ${GY - 10} L${TX} ${GY}" class="mi-ln" stroke-width="1.1" fill="none" stroke-linecap="round"/>`
|
|
175
|
+
+ `<g class="${seeking ? 'mi-scan' : ''}" transform-origin="${TX} ${GY - 12}"><g transform="translate(${TX} ${GY - 12}) rotate(${ang.toFixed(1)})">`
|
|
176
|
+
+ '<rect x="-4" y="-2.6" width="15" height="5.2" rx="2" class="mi-wh mi-ln" stroke-width="1.1"/><rect x="10" y="-3.4" width="3" height="6.8" rx="1" class="mi-lens mi-ln" stroke-width=".9"/></g></g></g>';
|
|
177
|
+
if (seeking && !M.empty) s += `<line class="mi-beam" x1="${TX + 10}" y1="${GY - 19}" x2="${PX - 12}" y2="${PY + 4}" stroke-width="1.2" stroke-dasharray="2 5" aria-hidden="true"/>`;
|
|
178
|
+
// Plan to Build: the pad at the start of Build; the rocket is a blueprint, then built from the bottom up; past Build 50% it flies
|
|
179
|
+
const bx = X(M.pad) + 4;
|
|
180
|
+
const fin = M.late ? 'mi-fin late' : 'mi-fin';
|
|
181
|
+
s += `<g aria-hidden="true"><rect x="${f1(bx - 12)}" y="${GY - 1}" width="24" height="3" rx="1.5" class="mi-pad"/>`
|
|
182
|
+
+ `<path d="M${f1(bx - 14)} ${GY} L${f1(bx - 14)} ${GY - 34} M${f1(bx - 14)} ${GY - 26} L${f1(bx - 6)} ${GY - 26} M${f1(bx - 14)} ${GY - 14} L${f1(bx - 6)} ${GY - 14}" fill="none" class="mi-padl" stroke-width="1.2"/></g>`;
|
|
183
|
+
if (M.phase === 'pad' || M.phase === 'build') {
|
|
184
|
+
let b = `<g transform="translate(${f1(bx)} ${GY - 1})" role="img" aria-label="${esc(M.phase === 'pad' ? 'The rocket, a blueprint on the pad' : 'The rocket, ' + Math.round(M.frac * 100) + '% built')}">`;
|
|
185
|
+
b += `<g opacity="${M.frac === 0 ? 0.5 : 0.35}">${ghostBody()}</g>`;
|
|
186
|
+
if (M.frac > 0) {
|
|
187
|
+
const h = 34 * M.frac;
|
|
188
|
+
b += `<clipPath id="${id}b"><rect x="-12" y="${f1(2 - h)}" width="24" height="${f1(h)}"/></clipPath><g clip-path="url(#${id}b)">${rocketBody(fin)}</g>`;
|
|
189
|
+
if (!still) for (let k = 0; k < 3; k++) b += `<circle class="mi-spark mi-k${k}" cx="${-6 + k * 6}" cy="${f1(2 - h)}" r="1.1"/>`;
|
|
190
|
+
}
|
|
191
|
+
s += b + '</g>';
|
|
192
|
+
} else {
|
|
193
|
+
s += `<g class="mi-puff" aria-hidden="true"><circle cx="${f1(bx - 6)}" cy="${GY - 3}" r="3.5" class="mi-smoke"/><circle cx="${f1(bx + 5)}" cy="${GY - 4}" r="4" class="mi-smoke"/></g>`;
|
|
194
|
+
const p0 = [bx, GY - 20], c1 = [bx + 6, 6], p1 = [PX - 10, PY + 8];
|
|
195
|
+
const bz = (u) => [(1 - u) ** 2 * p0[0] + 2 * (1 - u) * u * c1[0] + u * u * p1[0], (1 - u) ** 2 * p0[1] + 2 * (1 - u) * u * c1[1] + u * u * p1[1]];
|
|
196
|
+
const all = Array.from({ length: 41 }, (_, i) => bz(i / 40)), pts = Array.from({ length: 41 }, (_, i) => bz((i / 40) * M.fly));
|
|
197
|
+
let len = 0; for (let i = 0; i < 40; i++) len += Math.hypot(pts[i + 1][0] - pts[i][0], pts[i + 1][1] - pts[i][1]);
|
|
198
|
+
const d = (P) => 'M' + P.map(([x, y]) => f1(x) + ' ' + f1(y)).join(' L');
|
|
199
|
+
if (!M.landed) s += `<path d="${d(all)}" fill="none" class="mi-path" stroke-width="1.4" stroke-dasharray="1.5 5" aria-hidden="true"/>`;
|
|
200
|
+
s += `<path class="mi-vn" d="${d(pts)}" fill="none" stroke="url(#${id}x)" stroke-width="${M.landed ? 2.4 : 3}" stroke-linecap="round" opacity="${M.landed ? 0.45 : 1}" pathLength="100" aria-hidden="true"/>`;
|
|
201
|
+
let rx, ry, a, flame = '';
|
|
202
|
+
if (M.landed) { rx = PX - 9; ry = PY - 9; a = -25; }
|
|
203
|
+
else {
|
|
204
|
+
[rx, ry] = pts[40];
|
|
205
|
+
a = (Math.atan2(pts[40][1] - pts[38][1], pts[40][0] - pts[38][0]) * 180) / Math.PI + 90;
|
|
206
|
+
if (!M.hold) flame = '<g class="mi-flame"><path d="M-3.4 1 Q0 12 3.4 1Z" class="mi-fo"/><path d="M-1.8 1 Q0 7 1.8 1Z" class="mi-fy"/></g>';
|
|
207
|
+
}
|
|
208
|
+
s += `<g class="${M.landed ? '' : 'mi-rk'}" role="img" aria-label="${M.landed ? 'Landed at the release' : 'Flying to the release'}"><g transform="translate(${f1(rx)} ${f1(ry)}) rotate(${a.toFixed(1)}) scale(.75)">${flame}${rocketBody(fin)}</g></g>`;
|
|
209
|
+
if (M.landed) s += `<g aria-hidden="true"><rect x="${PX + 5}" y="${PY - 24}" width="1.4" height="13" class="mi-pole"/><path class="mi-flag" transform-origin="${PX + 6} ${PY - 23}" d="M${PX + 6.4} ${PY - 24} L${PX + 15} ${PY - 21} L${PX + 6.4} ${PY - 18}Z"/></g>`;
|
|
210
|
+
}
|
|
211
|
+
// Monitor: the dish listens; the last milestone lights it green
|
|
212
|
+
let dish = `<path d="M${DX} ${GY} L${DX} ${GY - 10}" class="mi-ln" stroke-width="1.2"/>`
|
|
213
|
+
+ `<path d="M${DX - 9} ${GY - 18} Q${DX - 2} ${GY - 6} ${DX + 6} ${GY - 10}" class="mi-wh mi-ln" stroke-width="1.1"/>`
|
|
214
|
+
+ `<line x1="${DX - 2}" y1="${GY - 12}" x2="${DX - 7}" y2="${GY - 20}" class="mi-ln" stroke-width="1"/>`
|
|
215
|
+
+ `<circle cx="${DX - 7}" cy="${GY - 21}" r="1.8" class="mi-lamp ${M.heard ? 'on' : M.listening ? 'ls' : ''}"/>`;
|
|
216
|
+
if (M.listening && !M.hold) for (let k = 0; k < 3; k++) dish += `<path class="mi-wave mi-k${k}" d="M${DX - 14 - k * 7} ${GY - 26 - k * 3} q-4 4 0 8" fill="none" stroke-width="1.3" stroke-linecap="round"/>`;
|
|
217
|
+
s += press(dish, M.dish, DX - 2, GY - 12, o, 'dish', crowd);
|
|
218
|
+
// Today
|
|
219
|
+
if (M.today != null) {
|
|
220
|
+
const xt = X(M.today);
|
|
221
|
+
s += `<g role="img" aria-label="Today"><circle class="mi-glow" cx="${xt}" cy="${GY + 7}" r="5"/><line x1="${xt}" y1="${GY + 1}" x2="${xt}" y2="${GY + 13}" class="mi-td" stroke-width="2" stroke-linecap="round"/></g>`;
|
|
222
|
+
}
|
|
223
|
+
if (M.hold) {
|
|
224
|
+
const xt = X(M.t > 100 ? 100 : M.t);
|
|
225
|
+
s += `<g transform="translate(${f1(xt + 6)} ${GY - 12})" class="mi-pz" role="img" aria-label="On hold"><rect x="0" y="0" width="2" height="7" rx="1"/><rect x="4" y="0" width="2" height="7" rx="1"/></g>`;
|
|
226
|
+
}
|
|
227
|
+
return `<svg class="mi-svg" viewBox="0 0 ${W} ${H}" width="100%" preserveAspectRatio="xMidYMid meet" role="group" aria-label="${esc(o.label || 'The initiative as a mission: its stages and milestones')}">${s}</svg>`;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** The current stage's name under the strip (the desktop's two columns): its place, as a % of the picture. → { name, x, late } | null */
|
|
231
|
+
export function nowName(M) {
|
|
232
|
+
const p = M && M.parts.find((q) => q.cls === 'nw' || q.cls === 'late' || q.cls === 'hold');
|
|
233
|
+
return p ? { name: p.name, x: +((X(p.l + p.w / 2) / W) * 100).toFixed(2), late: p.cls === 'late' } : null;
|
|
234
|
+
}
|
|
@@ -82,7 +82,7 @@ PG.goalsFrom((name) => (M ? M.initiatives.list.rows.filter((r) => !M.board.all |
|
|
|
82
82
|
const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
83
83
|
const I = {
|
|
84
84
|
x: 'M6 6l12 12M18 6L6 18', expand: 'M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7', more: 'M5 12h.01M12 12h.01M19 12h.01', go: 'M5 12h14M13 6l6 6-6 6', next: 'M9 6l6 6-6 6',
|
|
85
|
-
ext: 'M14 4h6v6M20 4l-9 9M10 6H5v13h13v-5', refresh: 'M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7', cal: 'M4 6h16v14H4zM4 10h16M9 3v4M15 3v4', jira: '
|
|
85
|
+
ext: 'M14 4h6v6M20 4l-9 9M10 6H5v13h13v-5', refresh: 'M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7', cal: 'M4 6h16v14H4zM4 10h16M9 3v4M15 3v4', jira: 'M4 7h16v3a2 2 0 0 0 0 4v3H4v-3a2 2 0 0 0 0-4z',
|
|
86
86
|
flag: 'M5 21V4M5 4h11l-2 4 2 4H5', note: 'M4 5h16v11h-9l-5 4v-4H4z', spark: 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z',
|
|
87
87
|
doc: 'M6 3h9l4 4v14H6zM14 3v5h5', link: 'M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1', chev: 'M7 10l5 5 5-5', chevUp: 'M7 14l5-5 5 5',
|
|
88
88
|
move: 'M4 12h12M12 6l6 6-6 6M20 5v14', hold: 'M9 5v14M15 5v14', archive: 'M4 5h16v4H4zM6 9v10h12V9M10 13h4',
|
|
@@ -100,7 +100,7 @@ const err = () => (S.error ? `<p class="wl-err" role="alert">${esc(S.error)}</p>
|
|
|
100
100
|
function viewAbout() {
|
|
101
101
|
const a = S.about;
|
|
102
102
|
const f = (k, text, hint, max) => `<label>${text}<input data-f="${k}" maxlength="${max}" value="${esc(a[k])}" placeholder="${esc(hint)}" autocomplete="off"></label>`;
|
|
103
|
-
return `<div class="wl-ad">${adlerScene('morning', 'needs-you', { label: 'Adler says hello' })}</div>${adPrefs()['adler.amount'] === 'off' ? '' : '<p class="wl-hi">Hi, I’m Adler. I do the boring bits, so you get the calls only you can make.</p>'}<h1 id="wlH" tabindex="-1">Welcome to PMOS</h1><p class="wl-lede">Tell PMOS who you are, so your Briefing knows what matters to you. Every field is optional, and you can change them later in the console's Settings.</p>
|
|
103
|
+
return `<div class="wl-ad">${adlerScene('morning', 'needs-you', { label: 'Adler says hello', dress: true })}</div>${adPrefs()['adler.amount'] === 'off' ? '' : '<p class="wl-hi">Hi, I’m Adler. I do the boring bits, so you get the calls only you can make.</p>'}<h1 id="wlH" tabindex="-1">Welcome to PMOS</h1><p class="wl-lede">Tell PMOS who you are, so your Briefing knows what matters to you. Every field is optional, and you can change them later in the console's Settings.</p>
|
|
104
104
|
<div class="wl-f">${f('name', 'Your name', 'For example: Dana', 40)}${f('role', 'Your role', 'For example: Senior PM, Payments', 80)}${f('work', 'What you do', 'In one line, for example: I run checkout and the payment methods', 200)}
|
|
105
105
|
<label>Your job description<textarea data-f="duties" maxlength="1000" placeholder="What you own, decide and deliver. Paste it from your job description if you have one.">${esc(a.duties)}</textarea></label></div>${err()}`
|
|
106
106
|
+ foot('', btn('about', 'Continue', { busy: 'about', busyText: 'Saving' }));
|
|
@@ -116,7 +116,7 @@ function viewSources() {
|
|
|
116
116
|
const rows = [`<li class="wl-row"><span class="wl-ic">${I.folder}</span><span><b>${esc(f.name || 'This folder')}</b><span class="path">${esc(f.root)}</span></span><span class="chip">this folder</span></li>`]
|
|
117
117
|
.concat(S.added.map((a) => `<li class="wl-row"><span class="wl-ic">${I.folder}</span><span><b>${esc(a.name)}</b><span class="path">${esc(a.root)}</span></span><span></span></li>`)).join('');
|
|
118
118
|
if (S.busy === 'scan') {
|
|
119
|
-
return `<div class="wl-ad">${adlerScene('think', 'thinking', { label: false })}</div><h1 id="wlH" tabindex="-1">Reading ${esc(f.name || 'your folder')}</h1><p class="wl-lede">A large folder can take a minute or two. The rest of PMOS keeps working.</p>
|
|
119
|
+
return `<div class="wl-ad">${adlerScene('think', 'thinking', { label: false, dress: true })}</div><h1 id="wlH" tabindex="-1">Reading ${esc(f.name || 'your folder')}</h1><p class="wl-lede">A large folder can take a minute or two. The rest of PMOS keeps working.</p>
|
|
120
120
|
<div class="wl-scan" role="status"><div>${spin('Starting the tools you ticked, then reading the folder')}</div></div>`;
|
|
121
121
|
}
|
|
122
122
|
return `<h1 id="wlH" tabindex="-1">Where does your work live?</h1><p class="wl-lede">PMOS reads your folders and the tools you tick, then shows you your initiatives, your documents and what needs you first.</p>
|
|
@@ -32,7 +32,7 @@ export const ICON = {
|
|
|
32
32
|
merge: 'M5 4v3a5 5 0 0 0 5 5h9M5 20v-3a5 5 0 0 1 5-5M16 9l3 3-3 3',
|
|
33
33
|
stay: 'M5 12l5 5 9-10',
|
|
34
34
|
x: 'M6 6l12 12M18 6L6 18', edit: 'M4 20h4L19 9l-4-4L4 16zM14 6l4 4', ok: 'M5 12.5l4.5 4.5L19 7.5',
|
|
35
|
-
swap: 'M7 4L3 8l4 4M3 8h14M17 20l4-4-4-4M21 16H7', down: 'M7 10l5 5 5-5', jira: '
|
|
35
|
+
swap: 'M7 4L3 8l4 4M3 8h14M17 20l4-4-4-4M21 16H7', down: 'M7 10l5 5 5-5', jira: 'M4 7h16v3a2 2 0 0 0 0 4v3H4v-3a2 2 0 0 0 0-4z', doc: 'M7 3h7l5 5v13H7zM14 3v5h5', task: 'M5 5h14v14H5z',
|
|
36
36
|
};
|
|
37
37
|
const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
|
|
38
38
|
/** "3 tasks · 1 ticket · 1 doc": zero is silence. */
|
|
@@ -235,12 +235,12 @@ export function lineOf(r, o = {}) {
|
|
|
235
235
|
const clash = openHold && openHold.kind === 'open' && E && openHold.b > E ? md(openHold.b, t) : '';
|
|
236
236
|
const L = MS.filter((m) => !endTask || m.id !== endTask.id);
|
|
237
237
|
const reach = Math.max(1, Math.round(((D1 - D0) / DAY) * (NEAR / 100)));
|
|
238
|
-
const C = mergeClose(L.map((m) => ({ ...m })), reach).map((c) => ({ x: X(day(c.date)), n: c.n, items: c.items.map((m) => ({ id: m.id, name: m.name, date: md(m.d, t), done: m.done, late: m.late, ago: m.ago })),
|
|
238
|
+
const C = mergeClose(L.map((m) => ({ ...m })), reach).map((c) => ({ x: X(day(c.date)), n: c.n, items: c.items.map((m) => ({ id: m.id, name: m.name, date: md(m.d, t), done: m.done, late: m.late, ago: m.ago, left: !m.done && m.d >= t ? days(t, m.d) : 0 })),
|
|
239
239
|
name: c.n > 1 ? plural(c.n, 'milestone', 'milestones') : c.first.name, date: md(day(c.date), t), done: c.done, late: c.late, dash: !!draft }));
|
|
240
240
|
const ms = C.slice();
|
|
241
241
|
if (E && !draft) {
|
|
242
242
|
const ED = endTask ? endTask.d : E;
|
|
243
|
-
ms.push({ x: X(ED), n: 1, end: true, atEnd: +ED === +E, items: endTask ? [{ id: endTask.id, name: endTask.name, date: md(ED, t), done: endTask.done, late: endTask.late, ago: endTask.ago }] : [],
|
|
243
|
+
ms.push({ x: X(ED), n: 1, end: true, atEnd: +ED === +E, items: endTask ? [{ id: endTask.id, name: endTask.name, date: md(ED, t), done: endTask.done, late: endTask.late, ago: endTask.ago, left: !endTask.done && ED >= t ? days(t, ED) : 0 }] : [],
|
|
244
244
|
name: endTask ? endTask.name : '', date: md(ED, t), done: finished || !!(endTask && endTask.done), late: !finished && (over || !!clash || !!(endTask && endTask.late)) });
|
|
245
245
|
} else if (draft && E) ms.push({ x: X(E), n: 1, end: true, items: [], name: '', date: md(E, t), done: false, late: false, dash: true });
|
|
246
246
|
ms.sort((p, q) => p.x - q.x);
|
|
@@ -89,7 +89,7 @@ const shot = (p, name) => (SHOTS ? p.screenshot({ path: path.join(SHOTS, name) }
|
|
|
89
89
|
if (!(await p.evaluate(() => !!document.querySelector('#ibBody .sm-dot')))) return finish(1);
|
|
90
90
|
const key = await p.evaluate(() => { const d = document.querySelector('#ibBody .sm-dot'); const b = d && d.closest('[data-key]'); return b ? b.dataset.key : null; });
|
|
91
91
|
await p.click(`#ibBody [data-key="${key}"]`);
|
|
92
|
-
const card = await until(() => p.evaluate(() => { const c = document.querySelector('#czViewer .sm-card'); return c ? { title: c.querySelector('.sm-h b').textContent, btns: [...c.querySelectorAll('[data-sm]')].map((b) => b.getAttribute('aria-label')), after: !!(c.previousElementSibling && c.previousElementSibling.classList.contains('iv-
|
|
92
|
+
const card = await until(() => p.evaluate(() => { const c = document.querySelector('#czViewer .sm-card'); return c ? { title: c.querySelector('.sm-h b').textContent, btns: [...c.querySelectorAll('[data-sm]')].map((b) => b.getAttribute('aria-label')), after: !!c.closest('.iv-cl') && !!(c.previousElementSibling && c.previousElementSibling.classList.contains('iv-card')) } : null; }));
|
|
93
93
|
ok('B the card under the summary: the spark title and ✕ Not now, ✎ Change it first, ✓ Split as suggested', card && /^Split off .+\?$/.test(card.title) && card.btns.join('|') === 'Not now|Change it first|Split as suggested' && card.after, JSON.stringify(card));
|
|
94
94
|
await shot(p, 'board-suggest.png');
|
|
95
95
|
await p.click('#czViewer [data-sm="edit"]');
|
|
@@ -119,27 +119,33 @@ async function pure() {
|
|
|
119
119
|
};
|
|
120
120
|
const V = '#czViewer [data-hi-v="page"]';
|
|
121
121
|
const shot = async (p, name, sel) => { if (!SHOTS) return; await sleep(300); await (sel ? p.locator(sel).first() : p).screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
122
|
-
/* re-pointed (batch
|
|
123
|
-
*
|
|
122
|
+
/* re-pointed (batch 18 item 1, the card and the mission): the card's head names the stage; the mission draws a strip part a stage with the
|
|
123
|
+
* current one marked; a tap on the picture opens in place "N of M done", ⋯ (the stage picker) and → the next stage, then the stages and
|
|
124
|
+
* milestones with their dates. The steps are said once, in Tasks */
|
|
125
|
+
const openMi = async (p) => { if (!(await p.evaluate((v) => !!document.querySelector(v + ' .iv-mio'), V))) await p.click(V + ' [data-iv-mi]', { position: { x: 8, y: 8 } }); await until(() => p.evaluate((v) => !!document.querySelector(v + ' .iv-mio'), V)); };
|
|
124
126
|
const card = (p) => p.evaluate((v) => {
|
|
125
127
|
const c = document.querySelector(v + ' .iv-sc'); const t = (n) => (n ? n.textContent.replace(/\s+/g, ' ').trim() : '');
|
|
126
|
-
const
|
|
127
|
-
return { head: t(c.querySelector('.iv-sch')), stage: t(c.querySelector('.iv-sch > b, .iv-sch .iv-stc b')), chip: !!c.querySelector('.iv-sch [data-iv-stagepick]'),
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
const go = c.querySelector('.iv-scgo');
|
|
129
|
+
return { head: t(c.querySelector('.iv-sch')), stage: t(c.querySelector('.iv-sch > b, .iv-sch .iv-stc b')), chip: !!c.querySelector('.iv-sch [data-iv-stagepick]'),
|
|
130
|
+
bars: c.querySelectorAll('.mi-svg .mi-st, .mi-svg .mi-dsh').length, now: c.querySelectorAll('.mi-svg :is(.mi-st, .mi-dsh):is(.nw, .late, .hold)').length, more: !!c.querySelector('.iv-mio .iv-mo[data-iv-stagepick]'), stageRows: c.querySelectorAll('.iv-mio [data-iv-stage]').length,
|
|
131
|
+
steps: document.querySelectorAll(v + ' .cz-sl').length, pri: document.querySelectorAll(v + ' [data-iv-primary]').length,
|
|
132
|
+
cta: !!document.querySelector(v + ' [data-hm-cta]'), ov: !!document.querySelector(v + ' [data-hm-ov]'), sw: !!c.querySelector('.hi-sw'), tail: go ? go.getAttribute('aria-label') : '', next: !!c.querySelector('[data-iv-next]'), nextTxt: t(go), ms: !!(go && go.dataset.ms), ready: !!(go && go.classList.contains('on')) };
|
|
130
133
|
}, V);
|
|
131
134
|
|
|
132
135
|
/* D1 a desktop: the Build stage of the fixture (the contract waits for you, a Jira ticket open, Deliver next) */
|
|
133
136
|
{
|
|
134
137
|
const A = await open(), p = A.page;
|
|
135
138
|
ok('D1 the initiative\'s page draws the one view\'s stage card', A.up);
|
|
139
|
+
const c0 = await card(p);
|
|
140
|
+
ok('D1 the header names the stage', c0.stage === 'Build', JSON.stringify(c0));
|
|
141
|
+
ok('D1 the mission\'s strip holds one part a stage of the workflow, the current one marked', c0.bars === 8 && c0.now === 1, JSON.stringify(c0));
|
|
142
|
+
ok('D1 the next stage waits in place until the picture is tapped (one primary: the ask\'s)', !c0.next, JSON.stringify(c0));
|
|
143
|
+
await openMi(p);
|
|
136
144
|
const c = await card(p);
|
|
137
|
-
ok('D1 the
|
|
138
|
-
ok('D1 the line holds one part a stage of the workflow, the current one marked', c.bars === 8 && c.now === 1, JSON.stringify(c));
|
|
139
|
-
ok('D1 every part names its stage on hover (the current one says now)', c.titles.length >= 7 && c.titles.every(Boolean) && c.titles.some((x) => /^Build · .*now$/.test(x)), JSON.stringify(c.titles));
|
|
145
|
+
ok('D1 a tap on the picture opens in place: ⋯ for the stage and the next stage; no list of the stages, the picture shows them (Wawan 10:59)', c.more && c.stageRows === 0, JSON.stringify(c));
|
|
140
146
|
ok('D1 the old CTA button, the C overview tile, the switch and the step list are gone from the card; at most one primary on the page', !c.cta && !c.ov && !c.sw && c.steps === 0 && c.pri <= 1, JSON.stringify(c));
|
|
141
147
|
ok('D1 the → names ◆ Deliver, the next stage', c.next && /^Next: ◆ Deliver\. Move to Deliver$/.test(c.tail) && c.ms, c.tail);
|
|
142
|
-
ok('D1 batch 14 item 11: the button shows the next stage\'s name with the → ("◆ Deliver"), not a bare arrow', /◆ Deliver$/.test(c.
|
|
148
|
+
ok('D1 batch 14 item 11: the button shows the next stage\'s name with the → ("◆ Deliver"), not a bare arrow', /◆ Deliver$/.test(c.nextTxt), c.nextTxt);
|
|
143
149
|
await shot(p, 'desk-build', V + ' .iv-sc');
|
|
144
150
|
// batch 16 item 5c (FmI2Stage): the stage's name is a chip; it opens every stage, the switch, then hold, Won't do and Archive (no Cancel)
|
|
145
151
|
ok('D1 batch 16 item 5c: the stage is a chip that changes it', c.chip, JSON.stringify(c));
|
|
@@ -170,6 +176,35 @@ async function pure() {
|
|
|
170
176
|
await A.ctx.close();
|
|
171
177
|
}
|
|
172
178
|
|
|
179
|
+
/* D1b Wawan 10:53 (canvas v586): on a desktop wide enough for two columns the milestones are their own card under the card, always shown:
|
|
180
|
+
* "Milestones N of M done", a tick on each done one, the next one marked, the release said; a row opens its task */
|
|
181
|
+
{
|
|
182
|
+
const TASKS = [{ uid: 'b', title: 'Brief signed off', status: 'Done', end: '2026-07-20', milestone: true, section: 'discover' }, { uid: 'w', title: 'Build the flow', status: 'In progress', start: '2026-09-01', end: '2026-11-20', section: 'build' },
|
|
183
|
+
{ uid: 'r', title: 'Rollout to all workspaces', status: 'To do', end: '2026-12-01', milestone: true, section: 'deliver' }, { uid: 'e', title: 'Did it work?', status: 'To do', end: '2027-02-01', milestone: true, section: 'evaluate' }];
|
|
184
|
+
const f = BF.facts(); f.rows = f.rows.map((r) => (r.id === 'self-serve-v2' ? { ...r, stage: 'Build', start: '2026-06-01', end: '2027-02-01', status: 'on track' } : r));
|
|
185
|
+
const B = BP.build(f), row = B.rows.find((x) => x.id === 'self-serve-v2'); row.tasks = TASKS; row.start = '2026-06-01'; row.end = '2027-02-01';
|
|
186
|
+
const A = await open({ w: 1440, h: 900, board: B }), p = A.page;
|
|
187
|
+
if (!(await p.evaluate((v) => document.querySelector(v + ' .iv').getBoundingClientRect().width >= 820, V))) await p.click('#czViewer [data-cz-vw="wide"]');
|
|
188
|
+
const mc = await until(() => p.evaluate((v) => { const m = document.querySelector(v + ' .iv-cl > .iv-msc'); if (!m || !m.offsetParent) return null; const rows = [...m.querySelectorAll('.iv-msr')];
|
|
189
|
+
return { head: m.querySelector('.iv-msh').textContent.replace(/\s+/g, ' ').trim(), rows: rows.map((r) => r.className.replace('iv-msr', '').trim() + ':' + r.textContent.replace(/\s+/g, ' ').trim()), tick: m.querySelectorAll('.iv-msr.dn .iv-msk.dn svg').length,
|
|
190
|
+
press: rows.every((r) => r.dataset.ivMs && /Open its task$/.test(r.getAttribute('aria-label'))), after: !!(m.previousElementSibling && m.previousElementSibling.classList.contains('iv-card')) }; }, V));
|
|
191
|
+
ok('D1b the Milestones card sits under the card: "Milestones 1 of 3 done", the done one ticked', !!mc && mc.after && /^Milestones ?1 of 3 done$/.test(mc.head) && mc.tick === 1 && /^dn:Brief signed off/.test(mc.rows[0]), JSON.stringify(mc));
|
|
192
|
+
ok('D1b the next one is marked with "in N days", and the release says so', !!mc && /^up:Rollout to all workspacesDec 1 · in \d+ days · release$/.test(mc.rows[1]) && /^:Did it work\?Feb 1/.test(mc.rows[2]), JSON.stringify(mc && mc.rows));
|
|
193
|
+
ok('D1b each row is a press for its task', !!mc && mc.press, JSON.stringify(mc));
|
|
194
|
+
await shot(p, 'desk-milestones');
|
|
195
|
+
// the phone: the same list behind a tap on the mission, under the stage's dates, ⋯ and the next stage (XvpE2Stages, Wawan 10:59)
|
|
196
|
+
const Q = await open({ w: 390, h: 844, board: B }), q = Q.page;
|
|
197
|
+
ok('D1b a phone has no Milestones card', await q.evaluate((v) => { const m = document.querySelector(v + ' .iv-msc'); return !m || !m.offsetParent; }, V));
|
|
198
|
+
await openMi(q);
|
|
199
|
+
const ph = await q.evaluate((v) => { const o = document.querySelector(v + ' .iv-mio'); return { head: o.querySelector('.iv-msh') ? o.querySelector('.iv-msh').textContent.replace(/\s+/g, ' ').trim() : '', rows: [...o.querySelectorAll('.iv-msr')].map((r) => r.className.replace('iv-msr', '').trim() + ':' + r.textContent.replace(/\s+/g, ' ').trim()), more: !!o.querySelector('.iv-mo'), over: document.documentElement.scrollWidth - innerWidth }; }, V);
|
|
200
|
+
ok('D1b a tap on the phone\'s mission opens the same milestones list, under ⋯', /^Milestones ?1 of 3 done$/.test(ph.head) && JSON.stringify(ph.rows) === JSON.stringify(mc && mc.rows) && ph.more && ph.over <= 0, JSON.stringify(ph));
|
|
201
|
+
await shot(q, 'phone-milestones');
|
|
202
|
+
ok('D1b the phone raised no error', Q.errors.length === 0, Q.errors.join(' | '));
|
|
203
|
+
await Q.ctx.close();
|
|
204
|
+
ok('D1b the page raised no error', A.errors.length === 0, A.errors.join(' | '));
|
|
205
|
+
await A.ctx.close();
|
|
206
|
+
}
|
|
207
|
+
|
|
173
208
|
/* D3 the phone, dark: Discover, Plan next (moves on by itself), an agent at work, over its usual time */
|
|
174
209
|
{
|
|
175
210
|
const DB = boardAt('Discover'), since = new Date(Date.parse(DB.today + 'T12:00:00Z') - 9 * 864e5).toISOString().slice(0, 10); // 9 days before the board's own day
|
|
@@ -177,8 +212,9 @@ async function pure() {
|
|
|
177
212
|
const trail = { ok: true, items: { 'self-serve-v2': { since } }, usual: { discover: { n: 5, days: 7 } }, usualBy: {} };
|
|
178
213
|
const A = await open({ w: 390, h: 844, theme: 'dark', model: SCEN.discover(), board: DB, sessions, trail }), p = A.page;
|
|
179
214
|
ok('D3 the phone draws the same card', A.up);
|
|
215
|
+
ok('D3 a phone keeps the milestones behind a tap on the mission: no Milestones card', await p.evaluate((v) => { const m = document.querySelector(v + ' .iv-msc'); return !m || !m.offsetParent; }, V));
|
|
216
|
+
await openMi(p);
|
|
180
217
|
const c = await card(p);
|
|
181
|
-
ok('D3 the clock: "9 of ~7 days", amber when over', c.clock === '9 of ~7 days' && c.late, c.head);
|
|
182
218
|
ok('D3 the → names Plan, the next stage', /^Next: Plan/.test(c.tail) && c.next && !c.ms, c.tail);
|
|
183
219
|
await shot(p, 'phone-discover');
|
|
184
220
|
await p.click(V + ' [data-iv-next]');
|
|
@@ -219,6 +255,7 @@ async function pure() {
|
|
|
219
255
|
/* D5 every step done, a milestone next: the next stage is ◆ Deliver; its sheet moves it with nothing open, and says so with Undo */
|
|
220
256
|
{
|
|
221
257
|
const A = await open({ model: SCEN.ready() }), p = A.page;
|
|
258
|
+
if (!(await card(p)).next) await openMi(p);
|
|
222
259
|
const c = await card(p);
|
|
223
260
|
ok('D5 every step done: the → names ◆ Deliver', A.up && /^Next: ◆ Deliver/.test(c.tail) && c.ms, JSON.stringify(c));
|
|
224
261
|
await shot(p, 'desk-ready', V + ' .iv-sc');
|
|
@@ -204,6 +204,8 @@ function model() {
|
|
|
204
204
|
for (const view of ['list', 'kanban']) {
|
|
205
205
|
const { ctx, page, errors } = await open({ view });
|
|
206
206
|
if (view === 'kanban') { await page.locator('#czViewer [data-iv-kstage]').click(); await page.locator('.tkc.ivq [data-ivq-i="1"]').click(); await page.waitForTimeout(300); }
|
|
207
|
+
// the List folds a stage after 3 tasks (batch 18 item 1): "2 more" shows the rest
|
|
208
|
+
if (view === 'list') { await page.locator('#czViewer .iv-wl > .iv-more').first().click(); await page.waitForTimeout(300); }
|
|
207
209
|
const m = await page.evaluate(() => [...document.querySelectorAll('#czViewer .lk-mt')].map((x) => x.textContent.trim()));
|
|
208
210
|
ok(`L1 ${view}: the link icon and the first task it waits on`, m.includes('Draft the limits spec') && m.includes('Ship the limits API'), JSON.stringify(m));
|
|
209
211
|
await page.locator('#czViewer .lk-mt[data-lk-meta="task-c"]').first().click();
|
|
@@ -159,7 +159,11 @@ const ITEMS = [
|
|
|
159
159
|
await p.click('.ivq-st .ivq-ms'); await p.waitForTimeout(300);
|
|
160
160
|
ok('F pressing ◇ writes milestone true for that task', posts.length === 1 && posts[0].task === 'task-api' && posts[0].milestone === true, JSON.stringify(posts));
|
|
161
161
|
// the Tasks Timeline
|
|
162
|
-
|
|
162
|
+
// the view sheet (batch 18 item 1): the view button, then Timeline
|
|
163
|
+
await p.evaluate(() => { const b = document.querySelector('#czViewer [data-iv-vbtn]'); if (b) b.click(); });
|
|
164
|
+
await p.waitForSelector('.tkc.ivq .ivs', { timeout: 5000 });
|
|
165
|
+
await p.click('.tkc.ivq .ivs [data-ivs-view="timeline"]');
|
|
166
|
+
await p.keyboard.press('Escape');
|
|
163
167
|
await p.waitForSelector('.ivt', { timeout: 5000 });
|
|
164
168
|
await unfold('.ivt-gh[data-iv-fold^="sec:"][aria-expanded="false"]');
|
|
165
169
|
const tv = await p.evaluate(() => ({ ms: [...document.querySelectorAll('.ivt-ms')].map((x) => x.className + '|' + x.textContent), guides: document.querySelectorAll('.ivt-grid i.ms').length, lg: (document.querySelector('.ivt-lg') || {}).textContent || '' }));
|
|
@@ -167,11 +167,11 @@ function model() {
|
|
|
167
167
|
await page.waitForSelector('.vs-pop.sheet', { timeout: 4000 });
|
|
168
168
|
const P = await page.evaluate(() => { const r = document.querySelector('.vs-pop.sheet').getBoundingClientRect(); return { bottom: Math.round(r.bottom), w: Math.round(r.width), scroll: document.documentElement.scrollWidth }; });
|
|
169
169
|
ok('P1 on a phone the menu is a bottom sheet the width of the screen; no sideways scroll', P.bottom === 844 && P.w === 390 && P.scroll <= 390, JSON.stringify(P));
|
|
170
|
-
// batch 11 item 20: the 390 px Tasks header holds the
|
|
170
|
+
// batch 11 item 20, batch 18 item 1: the 390 px Tasks header holds the view button, + and a draft's Make live, all in the Viewer
|
|
171
171
|
await page.locator('.vs-pop [data-vs-show="draft-c1"]').click();
|
|
172
172
|
await page.waitForSelector('#czViewer [data-vs-live]', { timeout: 4000 });
|
|
173
|
-
const H = await page.evaluate(() => { const v = document.querySelector('#czViewer'), b = v.querySelector('.cz-vw-body').getBoundingClientRect(), h = v.querySelector('.iv-th'); const ins = (s) => { const e = h.querySelector(s); if (!e) return 'none'; const r = e.getBoundingClientRect(); return r.width > 0 && r.left >= b.left && r.right <= b.right + 0.5 ? 'in' : 'out'; }; return {
|
|
174
|
-
ok('P3 on a phone the Tasks header fits the
|
|
173
|
+
const H = await page.evaluate(() => { const v = document.querySelector('#czViewer'), b = v.querySelector('.cz-vw-body').getBoundingClientRect(), h = v.querySelector('.iv-th'); const ins = (s) => { const e = h.querySelector(s); if (!e) return 'none'; const r = e.getBoundingClientRect(); return r.width > 0 && r.left >= b.left && r.right <= b.right + 0.5 ? 'in' : 'out'; }; return { view: ins('[data-iv-vbtn]'), seal: ins('[data-vs-live]'), add: h.querySelector('[data-iv-add]') ? ins('[data-iv-add]') : 'in', head: h.scrollWidth - Math.round(h.getBoundingClientRect().width), scroll: document.documentElement.scrollWidth }; });
|
|
174
|
+
ok('P3 on a phone the Tasks header fits the view button, + and Make live', H.view === 'in' && H.seal === 'in' && H.add === 'in' && H.head <= 1 && H.scroll <= 390, JSON.stringify(H));
|
|
175
175
|
await shot(page, 'PvaBuild6PhoneDraft', '#czViewer .iv-th');
|
|
176
176
|
ok('P2 no page error', errors.length === 0, errors.join(' | '));
|
|
177
177
|
await shot(page, 'PvaBuild5Phone');
|