create-pmos 0.314.0 → 0.316.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 +1 -1
- 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/briefing-premium-adddoc-test.js +3 -1
- package/workspace/briefing-premium-board-test.js +3 -1
- package/workspace/briefing-premium-calendar-2-test.js +3 -1
- package/workspace/briefing-premium-calendar-3-test.js +3 -1
- package/workspace/briefing-premium-calendar-test.js +3 -1
- package/workspace/briefing-premium-doc-edit-test.js +2 -2
- package/workspace/briefing-premium-initiative-test.js +3 -1
- package/workspace/briefing-premium-insights-test.js +3 -1
- package/workspace/briefing-premium-metrics-test.js +3 -1
- package/workspace/briefing-premium-sources-test.js +3 -1
- package/workspace/briefing-premium-test.js +3 -1
- package/workspace/briefing-premium-work-test.js +50 -36
- package/workspace/guide/briefing-premium.md +10 -8
- package/workspace/lib/briefing-premium-drafts.js +21 -1
- package/workspace/lib/headless.js +4 -2
- package/workspace/lib/my-work-premium.js +37 -23
- package/workspace/lib/orchestrator-checker.js +116 -0
- package/workspace/lib/orchestrator-health.js +5 -3
- package/workspace/lib/orchestrator-keeprate.js +104 -0
- package/workspace/lib/premium-console-type.js +71 -0
- package/workspace/lib/routes-orchestrator.js +7 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-welcome-test.js +4 -2
- package/workspace/premium-work-depth-test.js +21 -18
- package/workspace/public/pm/premium-insights.css +32 -31
- package/workspace/public/pm/premium-work.js +48 -49
- package/workspace/public/pm/premium.css +412 -394
- package/workspace/public/premium-work.html +16 -26
- package/workspace/server.js +43 -2
- package/workspace/skills/calendar-sync.skill +1 -0
- package/workspace/skills/jira-sync.skill +1 -0
- package/workspace/skills/morning-brief.skill +1 -0
- package/workspace/skills/my-work-read.skill +1 -0
- package/workspace/test-lists/agent-orchestrator-c.json +13 -0
- package/workspace/test-lists/premium-console-type.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.316.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": {
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-19T13:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T13:57:37Z"}
|
|
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-10-19T13:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T13:57:37Z"}
|
|
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-10-19T13:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T13:57:37Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -7,6 +7,8 @@ const fs = require('fs');
|
|
|
7
7
|
const path = require('path');
|
|
8
8
|
const { spawn } = require('child_process');
|
|
9
9
|
const { findBrowser } = require('./lib/find-browser');
|
|
10
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
11
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
10
12
|
const T = require('./test-run').configure({ name: 'briefing-premium-adddoc' });
|
|
11
13
|
const BP = require('./lib/board-premium.js');
|
|
12
14
|
const IP = require('./lib/initiative-premium.js');
|
|
@@ -141,7 +143,7 @@ const PAGES = {
|
|
|
141
143
|
const grab = (pg) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s] of pairs) { const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { width: e.offsetWidth, height: e.offsetHeight, cw: e.clientWidth, sh: e.scrollHeight }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [PAIRS, PROPS]);
|
|
142
144
|
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
143
145
|
const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
|
|
144
|
-
await m.goto('file://' + MOCKUP);
|
|
146
|
+
await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
|
|
145
147
|
await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
|
|
146
148
|
await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="init"]').click(); }, th);
|
|
147
149
|
await until(() => m.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0)); await sleep(500);
|
|
@@ -8,6 +8,8 @@ const fs = require('fs');
|
|
|
8
8
|
const path = require('path');
|
|
9
9
|
const { spawn } = require('child_process');
|
|
10
10
|
const { findBrowser } = require('./lib/find-browser');
|
|
11
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
12
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
11
13
|
const T = require('./test-run').configure({ name: 'briefing-premium-board' });
|
|
12
14
|
const BP = require('./lib/board-premium.js');
|
|
13
15
|
const F = require('./fixtures/board-premium-facts.js');
|
|
@@ -254,7 +256,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
254
256
|
const grab = (pg) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s0] of pairs) { const s = (n === 'rail' || n === 'dock') ? s0 : 'main.stage:not([hidden]) ' + s0; const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [PAIRS, PROPS]);
|
|
255
257
|
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
256
258
|
const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
|
|
257
|
-
await m.goto('file://' + MOCKUP);
|
|
259
|
+
await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
|
|
258
260
|
await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
|
|
259
261
|
await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="init"]').click(); }, th);
|
|
260
262
|
await until(() => m.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0)); await sleep(900);
|
|
@@ -9,6 +9,8 @@ const fs = require('fs');
|
|
|
9
9
|
const path = require('path');
|
|
10
10
|
const { spawn } = require('child_process');
|
|
11
11
|
const { findBrowser } = require('./lib/find-browser');
|
|
12
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
13
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
12
14
|
const T = require('./test-run').configure({ name: 'briefing-premium-calendar-2' });
|
|
13
15
|
const B = require('./lib/briefing-premium.js');
|
|
14
16
|
const F = require('./fixtures/briefing-premium-facts.js');
|
|
@@ -217,7 +219,7 @@ const SUGGEST = { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/prd/p
|
|
|
217
219
|
}
|
|
218
220
|
const css = (page, sel) => page.evaluate((s) => { const e = document.querySelector(s); if (!e) return null; const c = getComputedStyle(e); return ['fontWeight', 'borderRadius'].map((k) => c[k]).join('|'); }, sel);
|
|
219
221
|
const mk = await browser.newContext({ viewport: { width: 1280, height: 900 } }); const mp = await mk.newPage();
|
|
220
|
-
await mp.setContent(MOCKUP); await mp.waitForTimeout(500);
|
|
222
|
+
await mp.setContent(MOCKUP); await CT.applyToPage(mp, CT_VENDOR); await mp.waitForTimeout(500);
|
|
221
223
|
const ctaM = await mp.evaluate(() => { const b = document.createElement('button'); b.className = 'cta'; document.body.appendChild(b); const c = getComputedStyle(b); return c.fontWeight + '|' + c.borderRadius; });
|
|
222
224
|
const addM = await mp.evaluate(() => { const b = document.createElement('button'); b.className = 'addb'; document.body.appendChild(b); const c = getComputedStyle(b); return c.fontWeight + '|' + c.borderRadius; }), F1 = await open(), addB = await css(F1.page, '#mmAdd');
|
|
223
225
|
await F1.page.click('#mmAdd'); await until(() => F1.page.evaluate(() => /Premium UX PRD/.test(document.querySelector('#mmSug').textContent))); await F1.page.click('#mmSug [data-pick]');
|
|
@@ -10,6 +10,8 @@ const fs = require('fs');
|
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const { spawn } = require('child_process');
|
|
12
12
|
const { findBrowser } = require('./lib/find-browser');
|
|
13
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
14
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
13
15
|
const T = require('./test-run').configure({ name: 'briefing-premium-calendar-3' });
|
|
14
16
|
const B = require('./lib/briefing-premium.js');
|
|
15
17
|
const F = require('./fixtures/briefing-premium-facts.js');
|
|
@@ -354,7 +356,7 @@ const RECORDER = () => {
|
|
|
354
356
|
await P.ctx.close();
|
|
355
357
|
}
|
|
356
358
|
const mk = await browser.newContext({ viewport: { width: 1280, height: 900 } }); const mp = await mk.newPage();
|
|
357
|
-
await mp.setContent(MOCKUP); await mp.waitForTimeout(500);
|
|
359
|
+
await mp.setContent(MOCKUP); await CT.applyToPage(mp, CT_VENDOR); await mp.waitForTimeout(500);
|
|
358
360
|
const chipCss = (pg) => pg.evaluate(() => { const c = document.querySelector('.recchip, #recChip'); if (!c) return null; const k = getComputedStyle(c); const b = c.querySelector('button'); const bs = b ? getComputedStyle(b) : null; return [k.position, k.borderRadius, k.fontSize, k.fontWeight, k.display, bs && bs.borderRadius, bs && bs.fontWeight].join('|'); });
|
|
359
361
|
const chipM = await mp.evaluate(() => { const c = document.querySelector('#recChip'); c.hidden = false; c.innerHTML = '<i></i><span>Recording x</span><button>Open</button><button>Stop</button>'; const k = getComputedStyle(c), b = getComputedStyle(c.querySelector('button')); return [k.position, k.borderRadius, k.fontSize, k.fontWeight, k.display, b.borderRadius, b.fontWeight].join('|'); });
|
|
360
362
|
const Fx = await open({ notes: [live] }); await until(async () => /marked recording/.test((await chip(Fx.page)) || ''));
|
|
@@ -9,6 +9,8 @@ const fs = require('fs');
|
|
|
9
9
|
const path = require('path');
|
|
10
10
|
const { spawn } = require('child_process');
|
|
11
11
|
const { findBrowser } = require('./lib/find-browser');
|
|
12
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
13
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
12
14
|
const T = require('./test-run').configure({ name: 'briefing-premium-calendar' });
|
|
13
15
|
const B = require('./lib/briefing-premium.js');
|
|
14
16
|
const F = require('./fixtures/briefing-premium-facts.js');
|
|
@@ -207,7 +209,7 @@ const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-
|
|
|
207
209
|
}
|
|
208
210
|
const css = (page, sel) => page.evaluate((s) => { const e = document.querySelector(s); if (!e) return null; const c = getComputedStyle(e); return ['fontSize', 'fontWeight', 'letterSpacing', 'textTransform', 'borderRadius', 'paddingTop', 'color'].map((k) => c[k]).join('|'); }, sel);
|
|
209
211
|
const mk = await browser.newContext({ viewport: { width: 1280, height: 900 } }); const mp = await mk.newPage();
|
|
210
|
-
await mp.setContent(MOCKUP); await mp.waitForTimeout(500);
|
|
212
|
+
await mp.setContent(MOCKUP); await CT.applyToPage(mp, CT_VENDOR); await mp.waitForTimeout(500);
|
|
211
213
|
const F1 = await open();
|
|
212
214
|
const pairs = [['#todayCard', '#todayCard'], ['#tl .ev b', '#tl .ev b'], ['#tl .nowl', '#tl .nowl']];
|
|
213
215
|
for (const [a, b] of pairs) { const x = await css(mp, a), y = await css(F1.page, b); ok('C10 fidelity: ' + a + ' keeps the mockup\'s computed style at 1280 px', x === y || (x === null && true), x + ' vs ' + y); }
|
|
@@ -28,7 +28,7 @@ const finish = async (code) => {
|
|
|
28
28
|
};
|
|
29
29
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
30
30
|
|
|
31
|
-
const MOCKUP = fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'briefing-artifact.html'), 'utf8');
|
|
31
|
+
const MOCKUP = require('./lib/premium-console-type').transform(fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'briefing-artifact.html'), 'utf8'), { faces: false }); // read with the console's type (PM, 2026-10-19), as premium.css is
|
|
32
32
|
const CSS = fs.readFileSync(path.join(__dirname, 'public', 'pm', 'premium.css'), 'utf8');
|
|
33
33
|
const PATH = 'planning/prd/self-serve-v2-prd.md';
|
|
34
34
|
const TEXT = '---\ntype: PRD\ntitle: "Self-serve onboarding v2"\n---\n\n# PRD: Self-serve onboarding v2\n\n## Problem\n\nA partner waits for a person.\n\n## Goal\n\n- a first call without help\n\n## Requirements\n\nR1 a first call\n';
|
|
@@ -169,7 +169,7 @@ const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'ad
|
|
|
169
169
|
ok(`E8 ${t} tab at ${w} px ${theme}: no sideways scroll, no tiny target, nothing past the edge`, f.sx <= 0 && f.bad.length === 0 && f.out === 0, JSON.stringify(f));
|
|
170
170
|
}
|
|
171
171
|
const cs = await R.page.evaluate(() => { const e = document.querySelector('#dsAsk'); const c = getComputedStyle(e); return { r: c.borderRadius, fs: c.fontSize }; });
|
|
172
|
-
ok(`E8 the ask box is 14px rounded,
|
|
172
|
+
ok(`E8 the ask box is 14px rounded, 14px type (the console's body size) at ${w} px ${theme}`, cs.r === '14px' && cs.fs === '14px', JSON.stringify(cs));
|
|
173
173
|
await R.ctx.close();
|
|
174
174
|
}
|
|
175
175
|
finish();
|
|
@@ -8,6 +8,8 @@ const fs = require('fs');
|
|
|
8
8
|
const path = require('path');
|
|
9
9
|
const { spawn } = require('child_process');
|
|
10
10
|
const { findBrowser } = require('./lib/find-browser');
|
|
11
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
12
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
11
13
|
const T = require('./test-run').configure({ name: 'briefing-premium-initiative' });
|
|
12
14
|
const IP = require('./lib/initiative-premium.js');
|
|
13
15
|
const F = require('./fixtures/initiative-premium-facts.js');
|
|
@@ -328,7 +330,7 @@ const HEALTH = { ok: true, path: 'planning/prd/self-serve-v2-prd.md', health: {
|
|
|
328
330
|
const grab = (pg) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s0] of pairs) { const s = (n === 'rail' || n === 'dock') ? s0 : 'main.stage:not([hidden]) ' + s0; const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [PAIRS, PROPS]);
|
|
329
331
|
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
330
332
|
const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
|
|
331
|
-
await m.goto('file://' + MOCKUP);
|
|
333
|
+
await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
|
|
332
334
|
await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
|
|
333
335
|
await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="init"]').click(); }, th);
|
|
334
336
|
await until(() => m.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0)); await sleep(500);
|
|
@@ -9,6 +9,8 @@ const os = require('os');
|
|
|
9
9
|
const path = require('path');
|
|
10
10
|
const { spawn } = require('child_process');
|
|
11
11
|
const { findBrowser } = require('./lib/find-browser');
|
|
12
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
13
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
12
14
|
const T = require('./test-run').configure({ name: 'briefing-premium-insights' });
|
|
13
15
|
const IP = require('./lib/insights-premium.js');
|
|
14
16
|
const F = require('./fixtures/insights-premium-facts.js');
|
|
@@ -282,7 +284,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
282
284
|
const grab = (pg, which) => pg.evaluate(([pairs, props, idx]) => { const o = {}; for (const pr of pairs) { const n = pr[0], s0 = pr[idx]; const s = (n === 'rail' || n === 'dock') ? s0 : 'main.stage:not([hidden]) ' + s0; const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [PAIRS, PROPS, which]);
|
|
283
285
|
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
284
286
|
const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
|
|
285
|
-
await m.goto('file://' + MOCKUP);
|
|
287
|
+
await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
|
|
286
288
|
await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
|
|
287
289
|
await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="ins"]').click(); }, th);
|
|
288
290
|
await until(() => m.evaluate(() => document.querySelectorAll('#nMain .mt1').length > 0)); await sleep(900);
|
|
@@ -8,6 +8,8 @@ const fs = require('fs');
|
|
|
8
8
|
const path = require('path');
|
|
9
9
|
const { spawn } = require('child_process');
|
|
10
10
|
const { findBrowser } = require('./lib/find-browser');
|
|
11
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
12
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
11
13
|
const T = require('./test-run').configure({ name: 'briefing-premium-metrics' });
|
|
12
14
|
const BP = require('./lib/board-premium.js');
|
|
13
15
|
const MP = require('./lib/board-metrics-premium.js');
|
|
@@ -196,7 +198,7 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
|
|
|
196
198
|
const grab = (pg) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s] of pairs) { const e = document.querySelector('main.stage:not([hidden]) ' + s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [SEL, PROPS]);
|
|
197
199
|
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
198
200
|
const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
|
|
199
|
-
await m.goto('file://' + MOCKUP);
|
|
201
|
+
await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
|
|
200
202
|
await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
|
|
201
203
|
await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="init"]').click(); }, th);
|
|
202
204
|
await until(() => m.evaluate(() => document.querySelectorAll('#cMet .mt1').length > 0));
|
|
@@ -11,6 +11,8 @@ const os = require('os');
|
|
|
11
11
|
const path = require('path');
|
|
12
12
|
const { spawn, spawnSync } = require('child_process');
|
|
13
13
|
const { findBrowser } = require('./lib/find-browser');
|
|
14
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
15
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
14
16
|
const T = require('./test-run').configure({ name: 'briefing-premium-sources' });
|
|
15
17
|
|
|
16
18
|
const BASE = T.BASE;
|
|
@@ -133,7 +135,7 @@ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
|
|
|
133
135
|
const grab = (pg, sel) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s] of pairs) { const e = /^#tl/.test(s) && window.__ev ? window.__ev(s) : document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [sel, PROPS]);
|
|
134
136
|
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
135
137
|
const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
|
|
136
|
-
await m.goto('file://' + MOCKUP);
|
|
138
|
+
await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
|
|
137
139
|
await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 1 && document.querySelectorAll('#tl .ev').length > 0));
|
|
138
140
|
await m.evaluate((t) => { document.documentElement.dataset.theme = t; }, th);
|
|
139
141
|
const R = await open({ w, h, theme: th });
|
|
@@ -20,6 +20,8 @@ const fs = require('fs');
|
|
|
20
20
|
const path = require('path');
|
|
21
21
|
const { spawn } = require('child_process');
|
|
22
22
|
const { findBrowser } = require('./lib/find-browser');
|
|
23
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
24
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
23
25
|
const T = require('./test-run').configure({ name: 'briefing-premium' });
|
|
24
26
|
const B = require('./lib/briefing-premium.js');
|
|
25
27
|
const F = require('./fixtures/briefing-premium-facts.js');
|
|
@@ -560,7 +562,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
560
562
|
const grab = (pg) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s] of pairs) { const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [PAIRS, PROPS]);
|
|
561
563
|
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
562
564
|
const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
|
|
563
|
-
await m.goto('file://' + MOCKUP);
|
|
565
|
+
await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
|
|
564
566
|
await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0 && document.querySelectorAll('#tl .ev').length > 0));
|
|
565
567
|
await m.evaluate((t) => { document.documentElement.dataset.theme = t; }, th);
|
|
566
568
|
const R = await open({ w, h, theme: th });
|
|
@@ -10,6 +10,8 @@ const fs = require('fs');
|
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const { spawn } = require('child_process');
|
|
12
12
|
const { findBrowser } = require('./lib/find-browser');
|
|
13
|
+
const CT = require('./lib/premium-console-type'); // the mockup is read with the console's type (PM, 2026-10-19), as premium.css is
|
|
14
|
+
const CT_VENDOR = 'file://' + path.join(__dirname, 'public', 'vendor') + '/';
|
|
13
15
|
const T = require('./test-run').configure({ name: 'briefing-premium-work' });
|
|
14
16
|
const WP = require('./lib/my-work-premium.js');
|
|
15
17
|
const F = require('./fixtures/my-work-premium-facts.js');
|
|
@@ -17,6 +19,8 @@ const F = require('./fixtures/my-work-premium-facts.js');
|
|
|
17
19
|
const BASE = T.BASE;
|
|
18
20
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
19
21
|
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
22
|
+
/* the Work queue shows one tab at a time: bring up the tab that holds a row before pressing it (each press redraws the tab row, so the button is found again) */
|
|
23
|
+
const showKey = (pg, key) => pg.evaluate((key) => { const has = () => document.querySelector(`#qBody .wrow[data-key="${key}"], #waitBody .wrow[data-key="${key}"]`); if (has()) return true; for (const k of [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.dataset.tab)) { document.querySelector(`#qTabs [data-tab="${k}"]`).click(); if (has()) return true; } return false; }, key);
|
|
20
24
|
const results = [];
|
|
21
25
|
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
22
26
|
const more = async (pg) => { if (await pg.locator('#card [data-p="more"][aria-expanded="false"]').count()) await pg.click('#card [data-p="more"]'); };
|
|
@@ -53,12 +57,12 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
53
57
|
await page.route('**/api/pm-items/**', (r) => { const rq = r.request(); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); r.fulfill({ status: answer.status, contentType: 'application/json', body: JSON.stringify(answer.body) }); });
|
|
54
58
|
await page.route('**/api/briefing-premium/**', (r) => { const rq = r.request(); if (rq.method() === 'GET') return r.fulfill({ contentType: 'application/json', body: JSON.stringify(thread) }); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}'), headers: rq.headers() }); return r.fulfill({ status: answer.status, contentType: 'application/json', body: JSON.stringify(answer.body) }); });
|
|
55
59
|
await page.goto(BASE + '/premium-work.html?theme=' + theme);
|
|
56
|
-
const up = await until(() => page.evaluate(() => document.querySelectorAll('#
|
|
60
|
+
const up = await until(() => page.evaluate(() => document.querySelectorAll('#qBody .wrow').length > 0), 20000);
|
|
57
61
|
return { ctx, page, errors, posts, up, setModel: (m) => { current = m; }, set: (a) => { answer = a; }, setThread: (t) => { thread = t; }, gets: () => gets };
|
|
58
62
|
};
|
|
59
63
|
|
|
60
64
|
const A = await open();
|
|
61
|
-
ok('0 the page draws the
|
|
65
|
+
ok('0 the page draws the Work queue', A.up);
|
|
62
66
|
if (!A.up) return finish(1);
|
|
63
67
|
const p = A.page, M = mk();
|
|
64
68
|
const txt = (s) => p.evaluate((q) => (document.querySelector(q) || {}).textContent || '', s);
|
|
@@ -92,26 +96,33 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
92
96
|
/* M10 */
|
|
93
97
|
ok('M10 the header says what is real and that Jira and Slack appear only when read', /^Real data · as of 18:05/.test(await txt('#snap')) && /only when an agent session has read them/.test(await txt('#snap')));
|
|
94
98
|
|
|
95
|
-
/* M4 */
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
ok('M4
|
|
99
|
-
ok('M4
|
|
100
|
-
ok('M4
|
|
101
|
-
|
|
99
|
+
/* M4 the Work queue: one card, a tab for each place a thing waits */
|
|
100
|
+
const qtab = (k) => p.click(`#qTabs [data-tab="${k}"]`);
|
|
101
|
+
const q = await p.evaluate(() => ({ tabs: [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.textContent), sel: [...document.querySelectorAll('#qTabs [aria-selected="true"]')].map((b) => b.dataset.tab), tops: new Set([...document.querySelectorAll('#qTabs .qtb')].map((b) => Math.round(b.getBoundingClientRect().top))).size, cap: document.querySelector('#qCap').textContent, first: [...document.querySelectorAll('.tgf')].map((x) => x.closest('.wrow').dataset.key), titles: [...document.querySelectorAll('#qBody .wtit')].map((x) => x.textContent.replace('Do this first', '')), chips: [...document.querySelectorAll('#qBody .due')].map((x) => x.textContent), od: [...document.querySelectorAll('#qBody .due.od')].length, ck: [...document.querySelectorAll('#qBody .wck')].map((b) => Math.round(b.getBoundingClientRect().height)), cols: getComputedStyle(document.querySelector('#qBody')).gridTemplateColumns.split(' ').length, old: ['#plate', '#agCard', '#trayCard'].filter((x) => document.querySelector(x)), title: document.querySelector('#hQueue').textContent }));
|
|
102
|
+
ok('M4 one Work queue card replaces On your plate, With agents and the tray', q.title === 'Work queue' && q.old.length === 0, JSON.stringify(q));
|
|
103
|
+
ok('M4 seven tabs in one pill row with their counts, and the card opens on Today', q.tabs.join() === 'Today3,Inbox4,Agents3,Upcoming2,Someday1,Kept0,Done0' && q.sel.join() === 'today' && q.tops === 1, JSON.stringify(q));
|
|
104
|
+
ok('M4 Today holds its rows in two columns, with a due chip only where a date was set; the overdue one says so', q.cols === 2 && q.titles.length === 3 && q.titles[0] === 'Sign off the fit-out contractor shortlist' && q.chips.join() === 'Overdue · 15 Oct,Today' && q.od === 1, JSON.stringify(q));
|
|
105
|
+
ok('M4 "Do this first" tags the overdue item only, and a check circle is 44 px', q.first.length === 1 && q.first[0] === 'work:wbs:alpha:4.2' && q.ck.length === 3 && q.ck.every((h) => h >= 44), JSON.stringify([q.first, q.ck]));
|
|
106
|
+
const dec = await p.evaluate(() => { const b = document.querySelector('#qBody .wrow[data-key="work:wbs:alpha:4.2"] .wck'); const r = b.closest('.wrow'); return { dec: b.classList.contains('dec'), eye: !!b.querySelector('circle'), label: b.getAttribute('aria-label'), first: r.classList.contains('first'), tagBlock: getComputedStyle(r.querySelector('.tgf')).display, bar: getComputedStyle(r).boxShadow !== 'none', others: [...document.querySelectorAll('#qBody .wck')].filter((x) => x !== b).every((x) => !x.classList.contains('dec')) }; });
|
|
102
107
|
ok('M4 an item whose agent draft is ready has a highlighted eye circle (not a check), the first overdue row carries the ember bar and its tag sits on its own line', dec.dec && dec.eye && /^Review the agent draft/.test(dec.label) && dec.first && dec.tagBlock === 'block' && dec.bar && dec.others, JSON.stringify(dec));
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
await qtab('inbox');
|
|
109
|
+
const ib = await p.evaluate(() => ({ labels: [...document.querySelectorAll('#qBody .wsec .label')].map((x) => x.textContent), counts: [...document.querySelectorAll('#qBody .wsec em')].map((x) => x.textContent), glyphs: [...document.querySelectorAll('#qBody .inb .wgl')].map((x) => x.title), titles: [...document.querySelectorAll('#qBody .wtit')].map((x) => x.textContent), checks: document.querySelectorAll('#qBody .wck').length, note: document.querySelector('#qNote').textContent, focus: document.activeElement && document.activeElement.dataset.tab }));
|
|
110
|
+
ok('M4 Inbox holds what is new from Jira and Slack, then what you added, each with its source; nothing there has a check', ib.labels.join() === 'New from Jira and Slack,Added by you' && /^3 · counts to clear/.test(ib.counts[0]) && /^1 · not counted/.test(ib.counts[1]) && ib.glyphs.join() === 'Jira,Jira,Slack,Yours' && ib.titles[3] === 'Is the payment-step experiment worth another week?' && ib.checks === 0 && /counts to clear only once you place it/.test(ib.note) && ib.focus === 'inbox', JSON.stringify(ib));
|
|
111
|
+
await p.focus('#qTabs [data-tab="inbox"]'); await p.keyboard.press('ArrowRight');
|
|
112
|
+
ok('M4 the arrow keys move between tabs', await p.evaluate(() => document.activeElement.dataset.tab === 'agents' && document.querySelector('#qTabs [aria-selected="true"]').dataset.tab === 'agents'));
|
|
105
113
|
ok('M4 the add box has no Enter label', !(await p.evaluate(() => !!document.querySelector('#cap kbd'))));
|
|
106
|
-
ok('M4 no suggestion, no estimate and no demo label is drawn', !(await p.evaluate(() => /Accept all|~\d+ min|demo/i.test(document.querySelector('#
|
|
114
|
+
ok('M4 no suggestion, no estimate and no demo label is drawn', !(await p.evaluate(() => /Accept all|~\d+ min|demo|fold the laundry|on the shelf|composts/i.test(document.querySelector('#queue').textContent))));
|
|
107
115
|
|
|
108
|
-
/* M5 */
|
|
109
|
-
const ag = await p.evaluate(() => ({ tiles: [...document.querySelectorAll('#
|
|
110
|
-
ok('M5 three counts from the agent field and the rows that are running or ready', ag.tiles.join() === '1Running,1Failed,1To review' && ag.hot === 0 && ag.rows.length === 3 && /draft ready to review/.test(ag.rows[0]) && /the run failed/.test(ag.rows.join()) &&
|
|
111
|
-
ok('M5 the
|
|
112
|
-
const tile = async (k) => { await p.click(`#
|
|
116
|
+
/* M5 the Agents tab */
|
|
117
|
+
const ag = await p.evaluate(() => ({ shown: !document.querySelector('#qPipe').hidden, tiles: [...document.querySelectorAll('#qPipe .pst')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()), hot: document.querySelectorAll('#qPipe .pst.hot').length, rows: [...document.querySelectorAll('#qBody .ws')].map((x) => x.textContent), cap: document.querySelector('#qCap').textContent, hold: document.querySelector('#qNote').textContent, buttons: [...document.querySelectorAll('#qBody button')].map((b) => b.textContent).join('|') }));
|
|
118
|
+
ok('M5 the Agents tab shows three counts from the agent field and the rows that are running, failed or ready', ag.shown && ag.tiles.join() === '1Running,1Failed,1To review' && ag.hot === 0 && ag.rows.length === 3 && /draft ready to review/.test(ag.rows[0]) && /the run failed/.test(ag.rows.join()) && /one draft to review/.test(ag.cap), JSON.stringify(ag));
|
|
119
|
+
ok('M5 the Agents tab offers no press of its own, and says nothing is posted before a confirm', !/\b(Give to agent|Approve|Revise|Retry)\b/i.test(ag.buttons) && /Nothing is posted until you confirm it/.test(ag.hold));
|
|
120
|
+
const tile = async (k) => { await p.click(`#qPipe [data-ag="${k}"]`); return p.evaluate(() => ({ pressed: [...document.querySelectorAll('#qPipe [aria-pressed="true"]')].map((b) => b.dataset.ag), rows: [...document.querySelectorAll('#qBody .ws')].map((x) => x.textContent), focus: document.activeElement && document.activeElement.dataset.ag })); };
|
|
113
121
|
const tf = await tile('failed'), tr = await tile('ready'), tc = await tile('ready');
|
|
114
122
|
ok('M5 a count filters the list to that state, a second press shows every item again, and focus stays on the tile', tf.pressed.join() === 'failed' && tf.rows.length === 1 && /the run failed/.test(tf.rows[0]) && tr.pressed.join() === 'ready' && tr.rows.length === 1 && /draft ready to review/.test(tr.rows[0]) && tc.pressed.length === 0 && tc.rows.length === 3 && tc.focus === 'ready', JSON.stringify({ tf, tr, tc }));
|
|
123
|
+
await qtab('upcoming');
|
|
124
|
+
ok('M5 the counts show only on the Agents tab', await p.evaluate(() => document.querySelector('#qPipe').hidden && document.querySelectorAll('#qBody .wrow').length === 2));
|
|
125
|
+
await qtab('today');
|
|
115
126
|
|
|
116
127
|
/* M6 */
|
|
117
128
|
const wt = await p.evaluate(() => ({ cap: document.querySelector('#waitCap').textContent, rows: [...document.querySelectorAll('#waitBody .wtit')].map((x) => x.textContent), subs: [...document.querySelectorAll('#waitBody .ws')].map((x) => x.textContent), nudge: /Nudge/.test(document.querySelector('#waitCard').textContent) }));
|
|
@@ -122,31 +133,32 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
122
133
|
ok('M7 the untouched card counts the items from the review list', !rv.hidden && /^2 items have sat untouched for 7 days/.test(rv.txt), JSON.stringify(rv));
|
|
123
134
|
|
|
124
135
|
/* M9 */
|
|
125
|
-
ok('M9 the hero, the
|
|
136
|
+
ok('M9 the hero, the Work queue and the dock agree on one count', await p.evaluate(() => /^7 to clear/.test(document.querySelector('#qCap').textContent) && document.querySelector('#dN').textContent === '7' && document.querySelector('#dLab').textContent === 'to clear'));
|
|
126
137
|
|
|
127
138
|
/* M3 add */
|
|
128
139
|
A.set({ status: 200, body: { ok: true, item: { id: 'item-new', title: 'Reply to Lee', due: null, priority: 'P1' } } });
|
|
129
140
|
{ const v = F.view(); v.work.inbox.push(F.it('item-new', 'Reply to Lee', { priority: 'P1' })); A.setModel(WP.build({ v, now: F.NOW })); }
|
|
130
141
|
await p.fill('#capIn', 'Reply to Lee !p1'); await p.press('#capIn', 'Enter');
|
|
131
|
-
ok('M3 one line is posted to the Work page\'s add route, and the page shows what was read', await until(() => A.posts.some((x) => x.path === '/api/pm-items/add' && x.body.line === 'Reply to Lee !p1' && Object.keys(x.body).join() === 'line')) && await until(() => txt('#capHint').then((t) => /Added: Reply to Lee \(P1\)\. It is in your
|
|
132
|
-
ok('M3 a new item lands in the
|
|
142
|
+
ok('M3 one line is posted to the Work page\'s add route, and the page shows what was read', await until(() => A.posts.some((x) => x.path === '/api/pm-items/add' && x.body.line === 'Reply to Lee !p1' && Object.keys(x.body).join() === 'line')) && await until(() => txt('#capHint').then((t) => /Added: Reply to Lee \(P1\)\. It is in your inbox until you place it\./.test(t))));
|
|
143
|
+
ok('M3 a new item lands in the Inbox tab under Added by you, and its dialog opens at once so it can be placed', await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on') && document.querySelector('#dTitle').textContent === 'Reply to Lee' && /Inbox, added by you/.test(document.querySelector('#oMain').textContent) && document.querySelector('#qBody').dataset.tab === 'inbox' && !!document.querySelector('#qBody [data-key="work:item-new"]')), 6000));
|
|
133
144
|
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))); A.setModel(mk());
|
|
134
145
|
const n0 = A.posts.length; await p.fill('#capIn', ' '); await p.press('#capIn', 'Enter'); await sleep(200);
|
|
135
146
|
ok('M3 an empty line is not posted', A.posts.length === n0 && /Write one line/.test(await txt('#capHint')));
|
|
147
|
+
await qtab('today'); // a line with no date opened the queue on Inbox
|
|
136
148
|
|
|
137
149
|
/* M8 presses from a check circle, and from the dialog */
|
|
138
150
|
{
|
|
139
151
|
const n = A.posts.length;
|
|
140
|
-
await p.locator('.wrow[data-key="work:wbs:alpha:4.2"] .wck.dec').click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
152
|
+
await showKey(p, 'work:wbs:alpha:4.2'); await p.locator('.wrow[data-key="work:wbs:alpha:4.2"] .wck.dec').click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
141
153
|
ok('M8 the eye circle opens the item to review the draft and posts nothing', A.posts.length === n && (await p.textContent('#dTitle')) === 'Sign off the fit-out contractor shortlist' && /Agent draft · not checked/.test(await p.textContent('#oMain')));
|
|
142
154
|
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
143
155
|
}
|
|
144
|
-
const openKey = async (key) => { await p.locator(`.wrow[data-key="${key}"] .wrh`).first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700); };
|
|
156
|
+
const openKey = async (key) => { await showKey(p, key); await p.locator(`.wrow[data-key="${key}"] .wrh`).first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(700); };
|
|
145
157
|
const shut = async () => { await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))); };
|
|
146
158
|
const lastPost = () => A.posts[A.posts.length - 1];
|
|
147
159
|
A.set({ status: 200, body: { ok: true } });
|
|
148
160
|
const g0 = A.gets();
|
|
149
|
-
await p.locator('.wrow[data-key="work:item-bbbbbbbbbbb2"] .wck').click();
|
|
161
|
+
await showKey(p, 'work:item-bbbbbbbbbbb2'); await p.locator('.wrow[data-key="work:item-bbbbbbbbbbb2"] .wck').click();
|
|
150
162
|
ok('M8 a check circle posts Done with the item id only, offers Undo, and the page reads again', await until(() => A.posts.some((x) => x.path === '/api/pm-items/done' && Object.keys(x.body).join() === 'id' && x.body.id === 'item-bbbbbbbbbbb2')) && await until(() => p.evaluate(() => /Undo/.test(document.querySelector('#toast').textContent))) && await until(() => A.gets() > g0));
|
|
151
163
|
await p.locator('#toast .undo').click();
|
|
152
164
|
ok('M8 Undo posts Reopen for that item', await until(() => A.posts.some((x) => x.path === '/api/pm-items/reopen' && x.body.id === 'item-bbbbbbbbbbb2')));
|
|
@@ -200,7 +212,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
200
212
|
/* M2 / M4 degraded: an empty list */
|
|
201
213
|
{
|
|
202
214
|
const E = await open({ model: WP.build({ v: { today: '2026-10-16', work: {} }, now: F.NOW }) });
|
|
203
|
-
ok('M2 an empty list says so, in one sentence, and the
|
|
215
|
+
ok('M2 an empty list says so, in one sentence, and the Work queue says nothing is placed for today', await E.page.evaluate(() => document.querySelector('#brief').textContent === 'Your list is empty.' && /Nothing is placed for today/.test(document.querySelector('#qBody').textContent) && document.querySelector('#revCard').hidden && /Nobody owes you anything/.test(document.querySelector('#waitBody').textContent) && document.querySelector('#dN').textContent === '0'));
|
|
204
216
|
await E.ctx.close();
|
|
205
217
|
}
|
|
206
218
|
{
|
|
@@ -208,13 +220,13 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
208
220
|
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage();
|
|
209
221
|
await pg.route('**/api/my-work-premium', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, state: 'error', error: 'the list could not be read' }) }));
|
|
210
222
|
await pg.goto(BASE + '/premium-work.html');
|
|
211
|
-
ok('M10 a failed read says why and shows nothing instead of a guess', await until(() => pg.evaluate(() => /The reason: the list could not be read/.test(document.querySelector('#brief').textContent) && document.querySelectorAll('#
|
|
223
|
+
ok('M10 a failed read says why and shows nothing instead of a guess', await until(() => pg.evaluate(() => /The reason: the list could not be read/.test(document.querySelector('#brief').textContent) && document.querySelectorAll('#qBody .wrow').length === 0), 5000));
|
|
212
224
|
await ctx.close();
|
|
213
225
|
}
|
|
214
226
|
|
|
215
227
|
{
|
|
216
228
|
const R = await open({ w: 820, h: 1000 }), t = R.page;
|
|
217
|
-
await t.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => t.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(900);
|
|
229
|
+
await showKey(t, 'work:item-aaaaaaaaaaa1'); await t.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => t.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(900);
|
|
218
230
|
const g = await t.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth, tabs: getComputedStyle(document.querySelector('#dTabs')).display }; });
|
|
219
231
|
ok('M12 on a tablet (820 px) the dialog is centred with a 12 px margin, and the Detail / Conversation switch is shown', Math.abs(g.l - (g.vw - g.w) / 2) <= 2 && g.w === g.vw - 24 && g.tabs !== 'none', JSON.stringify(g));
|
|
220
232
|
await R.ctx.close();
|
|
@@ -222,7 +234,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
222
234
|
/* M12 floors on a phone, both themes */
|
|
223
235
|
for (const theme of ['light', 'dark']) {
|
|
224
236
|
const R = await open({ w: 390, h: 844, theme }), q = R.page;
|
|
225
|
-
await q.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(800);
|
|
237
|
+
await showKey(q, 'work:item-aaaaaaaaaaa1'); await q.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(800);
|
|
226
238
|
const geo = () => q.evaluate(() => { const r = document.querySelector('#dlg').getBoundingClientRect(); return { l: Math.round(r.left), w: Math.round(r.width), vw: innerWidth }; });
|
|
227
239
|
const g1 = await geo();
|
|
228
240
|
ok(`M12 at 390 px (${theme}) the dialog opens on Detail at the full width of the screen`, g1.l === 0 && g1.w === g1.vw, JSON.stringify(g1));
|
|
@@ -232,12 +244,12 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
232
244
|
const m = await q.evaluate(() => { const hs = (sel) => [...document.querySelectorAll(sel)].map((b) => Math.round(b.getBoundingClientRect().height)); return { over: document.documentElement.scrollWidth > innerWidth + 1 || document.querySelector('#dlg').scrollWidth > document.querySelector('#dlg').clientWidth + 1, small: [].concat(hs('#card .cta'), hs('#card .seg2 button'), hs('#wOn'), hs('.askbar input'), hs('#askGo')).filter((h) => h < 44) }; });
|
|
233
245
|
ok(`M12 at 390 px (${theme}) the dialog has no sideways scroll and every control is 44 px`, !m.over && m.small.length === 0, JSON.stringify(m));
|
|
234
246
|
await q.keyboard.press('Escape'); await sleep(300);
|
|
235
|
-
const pg = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('.wck, .capb, .wrh, #revBtn, .fchip')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height < 44 && b.getBoundingClientRect().height > 0).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)) }));
|
|
247
|
+
const pg = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('.wck, .capb, .wrh, #revBtn, .fchip, .qtb')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height < 44 && b.getBoundingClientRect().height > 0).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)) }));
|
|
236
248
|
ok(`M12 at 390 px (${theme}) the page has no sideways scroll and every control is 44 px`, !pg.over && pg.small.length === 0, JSON.stringify(pg));
|
|
237
249
|
await R.ctx.close();
|
|
238
250
|
}
|
|
239
251
|
{
|
|
240
|
-
const R = await open(); await R.page.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').first().focus();
|
|
252
|
+
const R = await open(); await showKey(R.page, 'work:item-aaaaaaaaaaa1'); await R.page.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').first().focus();
|
|
241
253
|
await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
242
254
|
ok('M12 the page behind a dialog is inert, Escape closes it and focus returns to the row', await R.page.evaluate(() => ['.rail', 'main.stage', '#dock'].every((s) => document.querySelector(s).inert)) && (await R.page.keyboard.press('Escape'), await until(() => R.page.evaluate(() => !document.querySelector('#dlg').classList.contains('on') && document.activeElement.classList.contains('wrh')))));
|
|
243
255
|
await R.ctx.close();
|
|
@@ -250,11 +262,11 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
250
262
|
await pg.goto(BASE + '/premium-work.html');
|
|
251
263
|
ok('E1 on an empty scratch state the real page says the list is empty', await until(() => pg.evaluate(() => document.querySelector('#brief').textContent === 'Your list is empty.'), 20000));
|
|
252
264
|
await pg.fill('#capIn', 'Reply to Rina about SSO !p1'); await pg.press('#capIn', 'Enter');
|
|
253
|
-
ok('E2 an added line comes back through the real routes in the
|
|
265
|
+
ok('E2 an added line comes back through the real routes in the Inbox tab, with its priority, not counted to clear, and its dialog opens', await until(() => pg.evaluate(() => document.querySelector('#qBody').dataset.tab === 'inbox' && /Reply to Rina about SSO/.test(document.querySelector('#qBody').textContent) && /P1/.test(document.querySelector('#qBody').textContent) && /Added by you/.test(document.querySelector('#qBody').textContent) && document.querySelector('#dN').textContent === '0' && document.querySelector('#dlg').classList.contains('on')), 15000));
|
|
254
266
|
await sleep(700);
|
|
255
267
|
await pg.locator('#card [data-p="flag"]').click();
|
|
256
|
-
ok('E3 Do today, pressed in that dialog, moves it from the
|
|
257
|
-
await pg.locator('#
|
|
268
|
+
ok('E3 Do today, pressed in that dialog, moves it from the Inbox to Today through the real route', await until(() => pg.evaluate(() => document.querySelector('#qTabs [data-tab="today"]').textContent === 'Today1' && document.querySelector('#qTabs [data-tab="inbox"]').textContent === 'Inbox0' && document.querySelector('#dN').textContent === '1'), 15000));
|
|
269
|
+
await pg.click('#qTabs [data-tab="today"]'); await pg.locator('#qBody .wck').first().click();
|
|
258
270
|
ok('E4 the check circle marks it done, and the list is empty again', await until(() => pg.evaluate(() => document.querySelector('#brief').textContent === 'Your list is empty.' && document.querySelector('#dN').textContent === '0'), 15000));
|
|
259
271
|
const api = await fetch(BASE + '/api/my-work-premium').then((r) => r.json());
|
|
260
272
|
ok('E5 the model route answers ready with the list the Work page reads', api.ok && api.state === 'ready' && api.model.dock.needs === 0);
|
|
@@ -270,20 +282,22 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
270
282
|
/* M12 fidelity against the mockup: computed style and geometry of the regions both pages have */
|
|
271
283
|
if (!fs.existsSync(MOCKUP)) ok('M12 the mockup is in the repository', false, MOCKUP);
|
|
272
284
|
else {
|
|
273
|
-
|
|
274
|
-
const
|
|
285
|
+
/* the Work queue (PM, 2026-10-19) replaced the mockup's plate with one full-width card, so its parts are matched by style and not by place */
|
|
286
|
+
const PAIRS = [['rail', '.rail'], ['name', '.top .name'], ['date', '.hero .date'], ['brief', '.brief'], ['cap', '.cap'], ['capin', '.cap input'], ['capbtn', '.cap .capb'], ['plate', '#plate', '#queue'], ['heading', '#hPlate', '#hQueue'], ['row', '#plateBody .wrow:not(.first)', '#qBody .wrow:not(.first)'], ['title', '#plateBody .wrow:not(.first) .wtit', '#qBody .wrow:not(.first) .wtit'], ['sub', '#plateBody .wrow:not(.first) .ws', '#qBody .wrow:not(.first) .ws'], ['due', '#plateBody .due:not(.od)', '#qBody .due:not(.od)'], ['waitrow', '#waitBody .wrow'], ['dock', '.dock']];
|
|
287
|
+
const QUEUE = ['plate', 'heading', 'row', 'title', 'sub', 'due', 'waitrow'];
|
|
288
|
+
const SKIP_GEOM = { 1280: QUEUE, 390: QUEUE };
|
|
275
289
|
const PROPS = ['fontSize', 'fontWeight', 'fontFamily', 'color', 'backgroundColor', 'borderRadius', 'paddingTop', 'paddingLeft', 'letterSpacing', 'lineHeight', 'boxShadow', 'backdropFilter', 'borderTopColor'];
|
|
276
290
|
const grab = (pg, pairs) => pg.evaluate(([pairs, props]) => { const o = {}; for (const [n, s0] of pairs) { const s = (n === 'rail' || n === 'dock') ? s0 : 'main.stage:not([hidden]) ' + s0; const e = document.querySelector(s); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e), r = e.getBoundingClientRect(), v = { left: Math.round(r.left), width: Math.round(r.width) }; props.forEach((k) => { v[k] = cs[k]; }); o[n] = v; } return o; }, [pairs, PROPS]);
|
|
277
291
|
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
278
292
|
const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
|
|
279
|
-
await m.goto('file://' + MOCKUP);
|
|
293
|
+
await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
|
|
280
294
|
await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
|
|
281
295
|
await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="work"]').click(); }, th);
|
|
282
296
|
await until(() => m.evaluate(() => document.querySelectorAll('#plateBody .wrow').length > 0)); await sleep(900);
|
|
283
297
|
const R = await open({ w, h, theme: th }); await sleep(500);
|
|
284
298
|
/* a theme change starts a .3 s box-shadow transition; on a slow runner it can still be running, so let every animation finish before reading styles */
|
|
285
299
|
for (const pg of [m, R.page]) await pg.evaluate(() => Promise.all(document.getAnimations().filter((a) => a.effect && a.effect.getComputedTiming().iterations !== Infinity).map((a) => a.finished.catch(() => null)))).catch(() => null);
|
|
286
|
-
const a = await grab(m, PAIRS), c = await grab(R.page, PAIRS), diffs = [];
|
|
300
|
+
const a = await grab(m, PAIRS.map(([n, s0]) => [n, s0])), c = await grab(R.page, PAIRS.map(([n, s0, s1]) => [n, s1 || s0])), diffs = [];
|
|
287
301
|
for (const [n] of PAIRS) {
|
|
288
302
|
if (!a[n] || !c[n]) { diffs.push(n + ' missing'); continue; }
|
|
289
303
|
for (const k of Object.keys(a[n])) {
|