create-pmos 0.396.0 → 0.398.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 +25 -25
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/nine-stages.js +49 -20
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +103 -74
- package/workspace/briefing-premium-board-test.js +316 -154
- package/workspace/briefing-premium-calendar-2-test.js +135 -195
- package/workspace/briefing-premium-calendar-3-test.js +143 -413
- package/workspace/briefing-premium-calendar-test.js +86 -185
- package/workspace/briefing-premium-doc-edit-test.js +95 -83
- package/workspace/briefing-premium-initiative-test.js +166 -294
- package/workspace/briefing-premium-insights-test.js +351 -214
- package/workspace/briefing-premium-metrics-test.js +53 -118
- package/workspace/briefing-premium-products-test.js +40 -27
- package/workspace/briefing-premium-sources-test.js +91 -52
- package/workspace/briefing-premium-test.js +150 -633
- package/workspace/briefing-premium-work-test.js +88 -269
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/board-premium-facts.js +2 -1
- package/workspace/fixtures/board-premium-jira.js +28 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/initiative-premium-facts.js +2 -1
- package/workspace/fixtures/initiatives-api/list.json +30 -42
- package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
- package/workspace/fixtures/initiatives-api/sheet.json +10 -14
- package/workspace/fixtures/insights-premium-facts.js +11 -2
- package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +47 -0
- package/workspace/guide/index.md +2 -0
- package/workspace/guide/lifecycle.md +51 -0
- package/workspace/home-shot.js +38 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-premium.js +160 -3
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/engine/boards.js +15 -14
- package/workspace/lib/engine/nine-stages.js +49 -20
- package/workspace/lib/engine/signals/detectors.js +13 -11
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +126 -1
- package/workspace/lib/insights-records.js +101 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/route-modules.js +4 -0
- package/workspace/lib/routes-board-premium.js +3 -2
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-initiatives.js +1 -1
- package/workspace/lib/routes-insights-premium.js +19 -3
- package/workspace/lib/routes-insights-records.js +129 -0
- package/workspace/lib/routes-notes.js +1 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
- package/workspace/lib/viewer-meeting.js +205 -0
- package/workspace/lib/viewer-report.js +89 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-agreed-viewer-shots.js +76 -0
- package/workspace/premium-board-actions-test.js +85 -73
- package/workspace/premium-briefing-depth-test.js +66 -53
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +35 -36
- package/workspace/premium-chat-context-test.js +22 -19
- package/workspace/premium-chat-goal-view-test.js +28 -26
- package/workspace/premium-chat-notes-test.js +29 -33
- package/workspace/premium-chat-report-tab-test.js +35 -25
- package/workspace/premium-chat-term-test.js +16 -14
- package/workspace/premium-chat-viewer-test.js +60 -53
- package/workspace/premium-core-doc-issue-test.js +50 -41
- package/workspace/premium-html-viewer-test.js +17 -18
- package/workspace/premium-phone-card-test.js +8 -2
- package/workspace/premium-phone-room-test.js +42 -31
- package/workspace/premium-report-read-test.js +115 -197
- package/workspace/premium-viewer-download-test.js +19 -22
- package/workspace/premium-viewer-flicker-test.js +11 -16
- package/workspace/premium-viewer-share-test.js +6 -9
- package/workspace/premium-viewer-test.js +41 -60
- package/workspace/premium-vw-backlog-test.js +53 -31
- package/workspace/premium-vw-cal-test.js +82 -123
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +12 -11
- package/workspace/premium-vw-item-test.js +50 -48
- package/workspace/premium-vw-jira-test.js +55 -26
- package/workspace/premium-vw-meet-test.js +118 -187
- package/workspace/premium-vw-notes-test.js +85 -107
- package/workspace/premium-vw-rec-test.js +72 -193
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +63 -51
- package/workspace/public/pm/bd-acts.js +305 -0
- package/workspace/public/pm/bd-span.js +224 -0
- package/workspace/public/pm/bd-stages.js +47 -0
- package/workspace/public/pm/c3-doc-sheet.js +1 -1
- package/workspace/public/pm/c3-md.js +3 -395
- package/workspace/public/pm/c3-phone-detail.js +1 -1
- package/workspace/public/pm/c3-phone-model.js +3 -68
- package/workspace/public/pm/chat-term.js +3 -3
- package/workspace/public/pm/cozy-board.css +640 -0
- package/workspace/public/pm/cozy-home.css +580 -0
- package/workspace/public/pm/cozy-home.js +172 -0
- package/workspace/public/pm/cozy-initiative.css +138 -0
- package/workspace/public/pm/cozy-insights.css +421 -0
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +65 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-viewer.css +143 -0
- package/workspace/public/pm/cozy-viewer.js +144 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +254 -0
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +905 -0
- package/workspace/public/pm/home-around.js +515 -0
- package/workspace/public/pm/home-chat.js +459 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-more.js +249 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-work.js +519 -0
- package/workspace/public/pm/lifecycle-lens-model.js +45 -27
- package/workspace/public/pm/lifecycle-lens.js +22 -11
- package/workspace/public/pm/phone-moment.js +69 -0
- package/workspace/public/pm/pm-work-view.js +1 -1
- package/workspace/public/pm/premium-attach.js +4 -0
- package/workspace/public/pm/premium-board.js +544 -253
- package/workspace/public/pm/premium-brief.js +1 -1
- package/workspace/public/pm/premium-chart-tab.js +110 -62
- package/workspace/public/pm/premium-chat.js +17 -10
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +25 -21
- package/workspace/public/pm/premium-initiative-head.js +138 -0
- package/workspace/public/pm/premium-initiative.js +28 -4
- package/workspace/public/pm/premium-insights.js +950 -440
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-notes.js +1 -1
- package/workspace/public/pm/premium-report-frame.css +20 -0
- package/workspace/public/pm/premium-report-read.js +509 -480
- package/workspace/public/pm/premium-report-tab.js +87 -63
- package/workspace/public/pm/premium-shell.js +107 -124
- package/workspace/public/pm/premium-viewer.js +27 -1
- package/workspace/public/pm/premium-vw-cal.js +187 -48
- package/workspace/public/pm/premium-vw-doc.css +6 -0
- package/workspace/public/pm/premium-vw-doc.js +40 -2
- package/workspace/public/pm/premium-vw-file.js +2 -2
- package/workspace/public/pm/premium-vw-jira-model.js +22 -5
- package/workspace/public/pm/premium-vw-jira.css +11 -0
- package/workspace/public/pm/premium-vw-jira.js +11 -4
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +731 -0
- package/workspace/public/pm/premium-vw-notes.js +56 -69
- package/workspace/public/pm/premium-vw-open.js +35 -0
- package/workspace/public/pm/premium-vw-page.js +16 -0
- package/workspace/public/pm/premium-vw-rec.js +11 -215
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +57 -64
- package/workspace/public/premium-chat.html +7 -33
- package/workspace/public/premium-initiative.html +8 -41
- package/workspace/public/premium-insights.html +63 -62
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium-work.html +6 -72
- package/workspace/public/premium.html +21 -66
- package/workspace/public/vendor/nunito-var.woff2 +0 -0
- package/workspace/server.js +25 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/premium-agreed-viewer.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/third-party/README.md +1 -0
- package/workspace/public/pm/premium-work.js +0 -719
- package/workspace/public/pm/premium.js +0 -1133
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
/* briefing-premium-work-test.js — the premium My work page (initiative briefing-premium-work; planning/prd/briefing-premium-work-prd.md M1 to M12).
|
|
4
|
-
*
|
|
5
|
-
* (
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
* Re-pointed by premium-agreed-design: My work is no longer a page. /premium-work.html opens Home, and My work is a minimal view in the Viewer
|
|
5
|
+
* (home-more.js openMyWork, from the place menu's More), marked "Waiting for design": four tabs (Your list, Waiting on others, Weekly review,
|
|
6
|
+
* Untouched), Done on each of your rows, and one add box. The old page's hero, dialog fields (When, Waiting on, Keep, Drop), Undo and the
|
|
7
|
+
* per-item agent are not in the Agreed design and are not drawn; their routes stay and the last block still drives them for real.
|
|
8
|
+
* Serves the real page from the real server. Most checks answer GET /api/my-work-premium with the model lib/my-work-premium.js builds from a
|
|
9
|
+
* fixture (fixtures/my-work-premium-facts.js) and answer the presses themselves; the last block drives the real routes of a scratch state folder.
|
|
10
|
+
* M1 the address and the way in · M3 add · M4 your list · M6 waiting · M7 review and untouched · M8 Done · M10 a failed read · M11 a refusal
|
|
11
|
+
* M12 floors at 390 · E1-E7 the real routes */
|
|
10
12
|
const path = require('path');
|
|
11
13
|
const { spawn } = require('child_process');
|
|
12
14
|
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') + '/';
|
|
15
15
|
const T = require('./test-run').configure({ name: 'briefing-premium-work' });
|
|
16
16
|
const WP = require('./lib/my-work-premium.js');
|
|
17
17
|
const F = require('./fixtures/my-work-premium-facts.js');
|
|
18
18
|
|
|
19
19
|
const BASE = T.BASE;
|
|
20
20
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
21
|
-
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) {
|
|
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, #qMenu .qtb')].map((b) => b.dataset.tab)) { document.querySelector(`#qTabs [data-tab="${k}"], #qMenu [data-tab="${k}"]`).click(); if (has()) return true; } return false; }, key);
|
|
21
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
24
22
|
const results = [];
|
|
25
|
-
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
26
|
-
/* the dialog's fields (premium-simple-ui): a field opens its panel; When holds Today, Not yet, Not before and Someday */
|
|
27
|
-
/* the fields sit in a sheet behind Edit ▾ in the dialog's switch row, closed by default (PM, 2026-10-20) */
|
|
28
|
-
const sheet = async (pg) => { if (await pg.locator('#iTog[aria-expanded="false"]').count()) await pg.click('#iTog'); };
|
|
29
|
-
const field = async (pg, k) => { await sheet(pg); if (await pg.locator(`#card .ffd[data-k="${k}"][aria-expanded="false"]`).count()) await pg.click(`#card .ffd[data-k="${k}"]`); };
|
|
30
|
-
const more = (pg) => field(pg, 'when');
|
|
23
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
31
24
|
let srv = null; let browser = null;
|
|
32
25
|
const finish = async (code) => {
|
|
33
26
|
if (browser) await browser.close().catch(() => {});
|
|
@@ -40,7 +33,8 @@ const finish = async (code) => {
|
|
|
40
33
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
41
34
|
|
|
42
35
|
const mk = () => WP.build({ v: F.view(), now: F.NOW });
|
|
43
|
-
const
|
|
36
|
+
const MW = '#czViewer:not([hidden])';
|
|
37
|
+
const view = () => { const v = document.querySelector('#czViewer:not([hidden])'); if (!v) return null; return { kind: (v.querySelector('.cz-vw-kind') || {}).textContent, wait: !!v.querySelector('.hx-wait'), tab: (v.querySelector('.hx-tabs [aria-selected="true"]') || {}).textContent || '', tabs: [...v.querySelectorAll('.hx-tabs [role=tab]')].map((b) => b.textContent), rows: [...v.querySelectorAll('.hx-row b, .hx-row strong')].map((b) => b.textContent), text: v.textContent.replace(/\s+/g, ' '), done: v.querySelectorAll('[data-done]').length }; };
|
|
44
38
|
|
|
45
39
|
(async () => {
|
|
46
40
|
const exe = findBrowser();
|
|
@@ -51,283 +45,108 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
51
45
|
await T.waitForServer(BASE);
|
|
52
46
|
browser = await chromium.launch({ executablePath: exe });
|
|
53
47
|
|
|
54
|
-
/* a page whose list and presses the test answers */
|
|
55
|
-
const open = async ({ w = 1280, h = 900, theme = 'light', model = mk() } = {}) => {
|
|
56
|
-
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
48
|
+
/* a page whose list and presses the test answers; My work is opened the way the PM opens it: the place menu, More, My work */
|
|
49
|
+
const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), fail = false, real = false } = {}) => {
|
|
50
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: theme, hasTouch: w < 1000 });
|
|
57
51
|
const page = await ctx.newPage();
|
|
58
|
-
|
|
52
|
+
const errors = [], posts = []; let answer = { status: 200, body: { ok: true } };
|
|
59
53
|
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
if (!real) {
|
|
55
|
+
await page.route('**/api/my-work-premium*', (r) => r.fulfill({ status: fail ? 500 : 200, contentType: 'application/json', body: JSON.stringify(fail ? { ok: false, error: 'the list could not be read' } : { ok: true, state: 'ready', model, as_of: Date.now() }) }));
|
|
56
|
+
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) }); });
|
|
57
|
+
}
|
|
63
58
|
await page.goto(BASE + '/premium-work.html?theme=' + theme);
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
await until(() => page.evaluate(() => /\/premium\.html$/.test(location.pathname) && !!document.querySelector('#czFab')), 15000);
|
|
60
|
+
await sleep(600);
|
|
61
|
+
await page.click('#czFab'); await page.click('[data-cz-more]');
|
|
62
|
+
await page.locator('#hmMenu button, #czViewer button').filter({ hasText: 'My work' }).first().click();
|
|
63
|
+
const up = await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return !!v && /My work/.test(v.textContent) && !/Reading your list/.test(v.textContent); }), 15000);
|
|
64
|
+
return { ctx, page, errors, posts, up, set: (a) => { answer = a; } };
|
|
66
65
|
};
|
|
67
66
|
|
|
67
|
+
const M = mk();
|
|
68
68
|
const A = await open();
|
|
69
|
-
|
|
69
|
+
const p = A.page;
|
|
70
|
+
ok('0 My work opens in the Viewer', !!A.up);
|
|
70
71
|
if (!A.up) return finish(1);
|
|
71
|
-
const p = A.page, M = mk();
|
|
72
|
-
const txt = (s) => p.evaluate((q) => (document.querySelector(q) || {}).textContent || '', s);
|
|
73
|
-
|
|
74
72
|
/* M1 */
|
|
75
|
-
|
|
76
|
-
ok('M1 the
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
ok('
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
ok('M1 the Briefing button opens the Briefing page', await until(() => /\/premium\.html$/.test(r2.page.url()), 5000), r2.page.url());
|
|
84
|
-
await r2.ctx.close();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* M2 */
|
|
88
|
-
const hero = await p.evaluate(() => ({ text: document.querySelector('#brief').textContent, k: [...document.querySelectorAll('#brief .k')].map((x) => x.textContent) }));
|
|
89
|
-
ok('M2 the hero is the model\'s sentences, numbers marked', hero.text === M.hero.map((s) => s.parts.map((x) => x.t).join('')).join(' ') && hero.k.length >= 5, hero.text);
|
|
90
|
-
ok('M2 the hero says what the records hold', /Three new in your inbox, one overdue, one due today\./.test(hero.text) && /longest for 8 days/.test(hero.text));
|
|
91
|
-
|
|
92
|
-
/* M10 */
|
|
93
|
-
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
|
-
|
|
95
|
-
/* M4 the Work queue: one card, a tab for each place a thing waits */
|
|
96
|
-
const qtab = async (k) => { if (!(await p.locator(`#qTabs [data-tab="${k}"]`).count())) await p.click('#qMore'); await p.click(`#qTabs [data-tab="${k}"], #qMenu [data-tab="${k}"]`); };
|
|
97
|
-
const q = await p.evaluate(() => ({ tabs: [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.textContent), rest: [...document.querySelectorAll('#qMenu .qtb')].map((b) => b.textContent), menuShut: document.querySelector('#qMenu').hidden && document.querySelector('#qMore').getAttribute('aria-expanded') === 'false', 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 }));
|
|
98
|
-
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));
|
|
99
|
-
ok('M4 Today and Inbox sit in one pill row with their counts; Upcoming, Someday, Kept and Done wait under a shut More (no Agents tab); the card opens on Today', q.tabs.join() === 'Today3,Inbox4' && q.rest.join() === 'Upcoming2,Someday1,Kept0,Done0' && q.menuShut && q.sel.join() === 'today' && q.tops === 1, JSON.stringify(q));
|
|
100
|
-
await p.click('#qMore'); await p.click('#qMenu [data-tab="someday"]');
|
|
101
|
-
const mo = await p.evaluate(() => ({ row: [...document.querySelectorAll('#qTabs .qtb')].map((b) => b.dataset.tab), sel: document.querySelector('#qTabs [aria-selected="true"]').dataset.tab, shut: document.querySelector('#qMenu').hidden, n: document.querySelectorAll('#qBody .wrow').length }));
|
|
102
|
-
ok('M4 a tab picked under More takes its place in the row, is chosen, and the menu shuts', mo.row.join() === 'today,inbox,someday' && mo.sel === 'someday' && mo.shut && mo.n === 1, JSON.stringify(mo));
|
|
103
|
-
await qtab('today');
|
|
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')) }; });
|
|
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));
|
|
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 === 'upcoming' && document.querySelector('#qTabs [aria-selected="true"]').dataset.tab === 'upcoming'));
|
|
113
|
-
ok('M4 the add box has no Enter label', !(await p.evaluate(() => !!document.querySelector('#cap kbd'))));
|
|
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))));
|
|
115
|
-
|
|
116
|
-
/* M5 no Agents tab: the agent's state is a chip on the row, in the tab where the item waits (PM, 2026-10-20) */
|
|
117
|
-
const chips = () => p.evaluate(() => [...document.querySelectorAll('#qBody .wrow')].map((r) => [r.dataset.key, (r.querySelector('.wag') || {}).textContent || ''].join('=')).filter((x) => !/=$/.test(x)));
|
|
118
|
-
const upc = await chips();
|
|
119
|
-
await qtab('today'); const tdc = await chips();
|
|
120
|
-
ok('M5 a failed run shows "Agent stopped" on its Upcoming row; Today shows "Draft ready" and "Agent working"; there are no counts tiles', upc.join() === 'work:item-ccccccccccc2=Agent stopped' && tdc.sort().join() === 'work:item-bbbbbbbbbbb3=Agent working,work:wbs:alpha:4.2=Draft ready' && !(await p.evaluate(() => !!document.querySelector('#qPipe'))), JSON.stringify({ upc, tdc }));
|
|
121
|
-
await qtab('today');
|
|
122
|
-
|
|
73
|
+
ok('M1 /premium-work.html opens Home, the place menu marks Home and nothing on the page is the old My work page', await p.evaluate(() => /\/premium\.html$/.test(location.pathname) && /Home/.test((document.querySelector('#czMenu [aria-current="page"]') || {}).textContent || '') && !document.querySelector('#qBody, #capIn, nav.rail')));
|
|
74
|
+
ok('M1 the page is still served at /premium-work and /premium-work.html', (await fetch(BASE + '/premium-work', { redirect: 'manual' })).status === 302 && (await fetch(BASE + '/premium-work.html')).status === 200);
|
|
75
|
+
/* M4 */
|
|
76
|
+
const v0 = await p.evaluate(view);
|
|
77
|
+
ok('M4 My work is a minimal view marked Waiting for design, with four tabs, on Your list', v0.kind === 'My work' && v0.wait && v0.tabs.join() === 'Your list,Waiting on others,Weekly review,Untouched' && v0.tab === 'Your list', JSON.stringify(v0));
|
|
78
|
+
const mine = M.queue.tabs.filter((t) => t.key !== 'kept' && t.key !== 'done').flatMap((t) => t.groups.flatMap((g) => g.rows || []));
|
|
79
|
+
ok('M4 Your list holds every row of the queue but Kept and Done, each with Done', mine.every((r) => v0.text.includes(r.title)) && v0.done === mine.length, JSON.stringify({ want: mine.length, done: v0.done }));
|
|
80
|
+
ok('M4 no suggestion, no estimate and no demo label is drawn', !/Accept all|~\d+ min|demo|fold the laundry|on the shelf|composts/i.test(v0.text));
|
|
123
81
|
/* M6 */
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
82
|
+
await p.click(`${MW} [data-tab="waiting"]`);
|
|
83
|
+
const v1 = await p.evaluate(view);
|
|
84
|
+
ok('M6 Waiting on others lists who owes the PM, longest first', v1.tab === 'Waiting on others' && v1.text.indexOf(M.waiting.rows[0].title) >= 0 && v1.text.indexOf(M.waiting.rows[0].title) < v1.text.indexOf(M.waiting.rows[1].title), JSON.stringify(v1));
|
|
127
85
|
/* M7 */
|
|
128
|
-
|
|
129
|
-
ok('M7
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
ok('
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
await p.fill('#
|
|
138
|
-
|
|
139
|
-
ok('M3
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
ok('
|
|
144
|
-
{ const R2 = await open({ w: 390, h: 844 }); const hid = await R2.page.evaluate(() => getComputedStyle(document.querySelector('#capHint')).display); await R2.page.focus('#capIn'); const shown = await R2.page.evaluate(() => getComputedStyle(document.querySelector('#capHint')).display);
|
|
145
|
-
ok('M3 the hint under the add box is hidden on load and shows while the box has focus (premium-calmer-first-screen)', hid === 'none' && shown !== 'none', JSON.stringify([hid, shown])); await R2.ctx.close(); }
|
|
146
|
-
await qtab('today'); // a line with no date opened the queue on Inbox
|
|
147
|
-
|
|
148
|
-
/* M8 presses from a check circle, and from the dialog */
|
|
149
|
-
{
|
|
150
|
-
const n = A.posts.length;
|
|
151
|
-
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);
|
|
152
|
-
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')));
|
|
153
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
154
|
-
}
|
|
155
|
-
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); };
|
|
156
|
-
const shut = async () => { await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))); };
|
|
157
|
-
const lastPost = () => A.posts[A.posts.length - 1];
|
|
158
|
-
A.set({ status: 200, body: { ok: true } });
|
|
159
|
-
const g0 = A.gets();
|
|
160
|
-
await showKey(p, 'work:item-bbbbbbbbbbb2'); await p.locator('.wrow[data-key="work:item-bbbbbbbbbbb2"] .wck').click();
|
|
161
|
-
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));
|
|
162
|
-
await p.locator('#toast .undo').click();
|
|
163
|
-
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')));
|
|
164
|
-
await openKey('work:item-aaaaaaaaaaa1');
|
|
165
|
-
const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, mod: document.querySelector('#dlg').getAttribute('aria-modal'), ask: !!document.querySelector('#askGo'),
|
|
166
|
-
fields: [...document.querySelectorAll('#card .ffd small')].map((x) => x.textContent).join(), when: document.querySelector('#card .ffd[data-k="when"] b').textContent,
|
|
167
|
-
bar: [...document.querySelectorAll('#card .ibrow button, #card .fbar button')].map((b) => b.textContent.trim()).join(), solid: [...document.querySelectorAll('#card .cta')].length,
|
|
168
|
-
shut: document.querySelector('#iSheet').hidden && !document.querySelector('#dBody .ffd'), row: !!document.querySelector('#dTabs #card [data-p="done"]') }));
|
|
169
|
-
await more(p); dlg.opts = await p.evaluate(() => [...document.querySelectorAll('#card .fmenu .fopt > span')].map((x) => x.textContent).join());
|
|
170
|
-
await field(p, 'wait'); dlg.wDis = await p.evaluate(() => document.querySelector('#wBtn').disabled);
|
|
171
|
-
ok('M8 a dialog shows Edit ▾ and Done in its switch row, the fields closed behind Edit and out of the conversation; the fields are the agent, When, Waiting on, Who does it, Priority · Due; When holds Today, Not yet, Not before and Someday; Waiting needs a name', dlg.title === 'Decide how partial refunds are handled'
|
|
172
|
-
&& dlg.fields === 'The agent,When,Waiting on,Who does it,Priority · Due' && /^Inbox/.test(dlg.when) && dlg.bar === 'EditInbox,Done,Drop it' && dlg.solid === 1 && dlg.shut && dlg.row
|
|
173
|
-
&& dlg.opts === 'Today,Later today,Tomorrow,Next week,Not before a date…,Someday' && dlg.mod === 'true' && dlg.ask && dlg.wDis, JSON.stringify(dlg));
|
|
174
|
-
await more(p);
|
|
175
|
-
await p.locator('#card [data-p="notyet"][data-when="tomorrow"]').click();
|
|
176
|
-
ok('M8 Not yet posts the item and the day, and closes the dialog', await until(() => A.posts.some((x) => x.path === '/api/pm-items/notyet' && x.body.id === 'item-aaaaaaaaaaa1' && x.body.when === 'tomorrow' && Object.keys(x.body).sort().join() === 'id,when')) && await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on'))));
|
|
177
|
-
for (const [sel, route, check] of [['[data-p="flag"]', '/api/pm-items/flag', (b) => b.flagged === true], ['[data-p="xt"][data-k="someday"]', '/api/pm-items/someday', (b) => Object.keys(b).join() === 'id'], ['[data-p="done"]', '/api/pm-items/done', (b) => Object.keys(b).join() === 'id'], ['[data-p="remove"]', '/api/pm-items/remove', (b) => Object.keys(b).join() === 'id']]) {
|
|
178
|
-
await openKey('work:item-aaaaaaaaaaa2'); const n = A.posts.length;
|
|
179
|
-
if (sel.includes('someday') || sel.includes('flag')) await more(p);
|
|
180
|
-
if (sel.includes('remove')) await sheet(p);
|
|
181
|
-
await p.locator('#card ' + sel).click();
|
|
182
|
-
ok(`M8 ${route.split('/').pop()} posts exactly what the Work page's route takes`, await until(() => A.posts.length > n && lastPost().path === route && lastPost().body.id === 'item-aaaaaaaaaaa2' && check(lastPost().body)), JSON.stringify(lastPost()));
|
|
183
|
-
await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
184
|
-
}
|
|
185
|
-
ok('M8 Done and Drop offer Undo for a short time', await p.evaluate(() => /Undo/.test(document.querySelector('#toast').textContent)));
|
|
186
|
-
await openKey('work:item-aaaaaaaaaaa3'); await field(p, 'wait'); await p.fill('#wOn', ' Priya ');
|
|
187
|
-
ok('M8 Waiting needs a name', await p.evaluate(() => !document.querySelector('#wBtn').disabled));
|
|
188
|
-
await p.click('#wBtn');
|
|
189
|
-
ok('M8 Waiting posts the name', await until(() => A.posts.some((x) => x.path === '/api/pm-items/waiting' && x.body.id === 'item-aaaaaaaaaaa3' && x.body.on === 'Priya')));
|
|
190
|
-
await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
191
|
-
await openKey('work:item-ddddddddddd1');
|
|
192
|
-
ok('M7 an item on the review list offers Keep, and Keep posts it', await p.evaluate(() => !!document.querySelector('#card [data-p="keep"]')));
|
|
193
|
-
await sheet(p); await p.click('#card [data-p="keep"]');
|
|
194
|
-
ok('M7 Keep posts the item id only', await until(() => A.posts.some((x) => x.path === '/api/pm-items/keep' && Object.keys(x.body).join() === 'id' && x.body.id === 'item-ddddddddddd1')));
|
|
195
|
-
await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
86
|
+
await p.click(`${MW} [data-tab="review"]`);
|
|
87
|
+
ok('M7 Weekly review says what the review holds', (await p.evaluate(view)).text.includes(M.friday.cap));
|
|
88
|
+
await p.click(`${MW} [data-tab="stale"]`);
|
|
89
|
+
const v2 = await p.evaluate(view);
|
|
90
|
+
ok('M7 Untouched counts the items from the review list and lists the ones the list holds', v2.text.includes(M.review.n + ' items have sat untouched for ' + M.review.days + ' days') && v2.done >= 1 && v2.done <= M.review.ids.length, JSON.stringify(v2));
|
|
91
|
+
/* M3 */
|
|
92
|
+
await p.click(`${MW} [data-tab="yours"]`);
|
|
93
|
+
await p.click(`${MW} [data-x="add"]`);
|
|
94
|
+
ok('M3 an empty line is not posted', A.posts.length === 0);
|
|
95
|
+
await p.fill('#hxLine', 'Call Ana tomorrow');
|
|
96
|
+
await p.click(`${MW} [data-x="add"]`);
|
|
97
|
+
ok('M3 one line is posted to the add route, and the view says so', !!(await until(() => A.posts.find((x) => x.path === '/api/pm-items/add' && x.body.line === 'Call Ana tomorrow'))) && !!(await until(() => p.evaluate(() => /Added\./.test(document.querySelector('#czViewer').textContent)))));
|
|
98
|
+
/* M8 */
|
|
99
|
+
const id = mine[1].id;
|
|
100
|
+
await p.click(`${MW} [data-done="${id}"]`);
|
|
101
|
+
ok('M8 Done posts the item id only, and the view says Done.', !!(await until(() => A.posts.find((x) => x.path === '/api/pm-items/done' && Object.keys(x.body).join() === 'id' && x.body.id === id))) && !!(await until(() => p.evaluate(() => /Done\./.test(document.querySelector('#czViewer').textContent)))));
|
|
196
102
|
ok('M8 no press carried a writer field', A.posts.every((x) => !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)));
|
|
197
103
|
const mint = await T.nonce(BASE);
|
|
198
|
-
ok('M8 every press carried the launch nonce', !!mint && A.posts.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
ok('M11 a refused press shows the route\'s reason, keeps the dialog open and turns the buttons back on', await until(() => p.evaluate(() => !document.querySelector('#cardErr').hidden && /already done/.test(document.querySelector('#cardErr').textContent) && document.querySelector('#dlg').classList.contains('on') && !document.querySelector('#card [data-p="done"]').disabled)));
|
|
204
|
-
A.set({ status: 200, body: { ok: true } });
|
|
205
|
-
|
|
206
|
-
/* agent beside the item */
|
|
207
|
-
A.setThread({ ok: true, working: false, turns: [{ id: 'bq-1', q: 'What is this about?', state: 'answered', a: 'It is about <b>shipping</b>.' }] });
|
|
208
|
-
await shut(); await openKey('work:item-aaaaaaaaaaa1');
|
|
209
|
-
ok('A1 the read-only agent is beside the item: its answer is labelled and shown as text', await until(() => p.evaluate(() => /Earlier read-only answer/.test(document.querySelector('#dBody .stream').textContent) && document.querySelector('#dBody .stream').textContent.includes('<b>shipping</b>')), 5000));
|
|
210
|
-
A.setThread({ ok: true, working: false, turns: [] });
|
|
211
|
-
await p.fill('#askIn', 'Why is this here?'); const nA = A.posts.length; await p.press('#askIn', 'Enter');
|
|
212
|
-
ok('A1 a question posts the item key and the text, and nothing else', await until(() => A.posts.length > nA && lastPost().path === '/api/briefing-premium/ask' && lastPost().body.key === 'work:item-aaaaaaaaaaa1' && lastPost().body.text === 'Why is this here?' && Object.keys(lastPost().body).sort().join() === 'key,text'), JSON.stringify(lastPost()));
|
|
213
|
-
await shut();
|
|
214
|
-
|
|
104
|
+
ok('M8 every press carried the launch nonce', !!mint && A.posts.every((x) => x.headers['x-pmos-nonce'] === mint));
|
|
105
|
+
/* M11 */
|
|
106
|
+
A.set({ status: 409, body: { ok: false, error: 'That item is already done.' } });
|
|
107
|
+
await p.click(`${MW} [data-done="${mine[2].id}"]`);
|
|
108
|
+
ok('M11 a refused press shows the route\'s reason', !!(await until(() => p.evaluate(() => /already done/.test(document.querySelector('#czViewer').textContent)))));
|
|
215
109
|
ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
216
110
|
await A.ctx.close();
|
|
217
111
|
|
|
218
|
-
/*
|
|
219
|
-
{
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
await E.ctx.close();
|
|
223
|
-
}
|
|
224
|
-
{
|
|
225
|
-
// a failed read says why and draws nothing
|
|
226
|
-
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage();
|
|
227
|
-
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' }) }));
|
|
228
|
-
await pg.goto(BASE + '/premium-work.html');
|
|
229
|
-
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));
|
|
230
|
-
await ctx.close();
|
|
231
|
-
}
|
|
112
|
+
/* M10 */
|
|
113
|
+
{ const E = await open({ fail: true });
|
|
114
|
+
ok('M10 a failed read says why and shows nothing instead of a guess', !!(await until(() => E.page.evaluate(() => /Your list could not be read: the list could not be read/.test(document.querySelector('#czViewer').textContent) && !document.querySelector('#czViewer [data-done]')))));
|
|
115
|
+
await E.ctx.close(); }
|
|
232
116
|
|
|
233
|
-
|
|
234
|
-
const R = await open({ w: 820, h: 1000 }), t = R.page;
|
|
235
|
-
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);
|
|
236
|
-
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 }; });
|
|
237
|
-
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));
|
|
238
|
-
await R.ctx.close();
|
|
239
|
-
}
|
|
240
|
-
/* M12 floors on a phone, both themes */
|
|
117
|
+
/* M12 floors at 390, both themes */
|
|
241
118
|
for (const theme of ['light', 'dark']) {
|
|
242
|
-
const
|
|
243
|
-
await
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
/* the compact head (Wawan's phone, 2026-10-20): every dialog opens with a short head, so the detail gets most of the screen; a press on the title shows it whole */
|
|
248
|
-
const hd = () => q.evaluate(() => { const t = document.querySelector('#dTitle'), lh = parseFloat(getComputedStyle(t).lineHeight); return { cmp: document.querySelector('#dlg').classList.contains('cmp'), eye: getComputedStyle(document.querySelector('#dEye')).display, lines: Math.round(t.getBoundingClientRect().height / lh), top: Math.round(document.querySelector('#dOut').getBoundingClientRect().top), full: document.querySelector('#dlg').classList.contains('tfull') }; });
|
|
249
|
-
const h1 = await hd(); await q.click('#dTitle'); const h2 = await hd(); await q.click('#dTitle'); const h3 = await hd();
|
|
250
|
-
ok(`M12 at 390 px (${theme}) the item dialog has the compact head: no eyebrow, a title of two lines at most, the detail starting in the top third`, h1.cmp && h1.eye === 'none' && h1.lines <= 2 && h1.top < 844 / 3, JSON.stringify(h1));
|
|
251
|
-
ok(`M12 at 390 px (${theme}) a press on the title shows the whole head, and a second press clamps it again`, h2.full && h2.eye !== 'none' && !h3.full && h3.eye === 'none', JSON.stringify([h2, h3]));
|
|
252
|
-
await q.click('#dTabs [data-t="chat"]'); await sleep(900);
|
|
253
|
-
const g2 = await geo();
|
|
254
|
-
ok(`M12 at 390 px (${theme}) with the conversation brought in it is still full width`, g2.l === 0 && g2.w === g2.vw && await q.evaluate(() => document.querySelector('#dTabs [data-t="chat"]').getAttribute('aria-pressed') === 'true' && getComputedStyle(document.querySelector('#dBody')).display !== 'none' && getComputedStyle(document.querySelector('#dOut')).display === 'none'), JSON.stringify(g2));
|
|
255
|
-
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('#askIn'), hs('#askGo')).filter((h) => h < 44) }; });
|
|
256
|
-
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));
|
|
257
|
-
await q.keyboard.press('Escape'); await sleep(300);
|
|
258
|
-
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)) }));
|
|
259
|
-
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));
|
|
260
|
-
const tb = await q.evaluate(() => ({ rows: new Set([...document.querySelectorAll('#qTabs .qtb')].map((b) => Math.round(b.getBoundingClientRect().top))).size, scrolls: getComputedStyle(document.querySelector('#qTabs')).overflowX }));
|
|
261
|
-
ok(`M12 at 390 px (${theme}) the Work queue tabs are one row that scrolls sideways, never two`, tb.rows === 1 && tb.scrolls === 'auto', JSON.stringify(tb));
|
|
262
|
-
/* the rail after the keyboard (Wawan's phone, 2026-10-20): leaving a field nudges the scroll by a pixel and back, so iOS places the fixed rail at the bottom again */
|
|
263
|
-
await q.evaluate(() => { const y = document.querySelector('#qBody').getBoundingClientRect().top + scrollY - 250; scrollTo(0, y); window.__ys = []; addEventListener('scroll', () => window.__ys.push(scrollY)); });
|
|
264
|
-
await sleep(200); const y0 = await q.evaluate(() => scrollY);
|
|
265
|
-
await q.evaluate(() => { const i = document.querySelector('#capIn'); i.focus({ preventScroll: true }); i.blur(); }); await sleep(600);
|
|
266
|
-
const kb = await q.evaluate(() => { const r = document.querySelector('.rail').getBoundingClientRect(); return { ys: window.__ys, y: scrollY, bottom: Math.round(innerHeight - r.bottom) }; });
|
|
267
|
-
ok(`M12 at 390 px (${theme}) leaving a field settles the fixed layer: a one-pixel scroll and back, and the rail stays 12 px off the bottom`, kb.ys.length >= 2 && kb.y === y0 && kb.bottom === 12, JSON.stringify({ y0, ...kb }));
|
|
268
|
-
await R.ctx.close();
|
|
269
|
-
}
|
|
270
|
-
{
|
|
271
|
-
const R = await open(); await showKey(R.page, 'work:item-aaaaaaaaaaa1'); await R.page.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').first().focus();
|
|
272
|
-
await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
273
|
-
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')))));
|
|
274
|
-
await R.ctx.close();
|
|
119
|
+
const P = await open({ w: 390, h: 844, theme });
|
|
120
|
+
const f = await P.page.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'), r = v.getBoundingClientRect(); return { w: Math.round(r.width), over: document.documentElement.scrollWidth - innerWidth, small: [...v.querySelectorAll('button')].filter((b) => b.offsetParent !== null && b.getBoundingClientRect().height < 43.5).map((b) => b.textContent.trim()).slice(0, 5) }; });
|
|
121
|
+
ok(`M12 (${theme}) on a phone My work covers the screen, with no sideways scroll and 44 px buttons`, f.w >= 380 && f.over <= 0 && f.small.length === 0, JSON.stringify(f));
|
|
122
|
+
ok(`M12 (${theme}) no page error`, P.errors.length === 0, P.errors.join(' | '));
|
|
123
|
+
await P.ctx.close();
|
|
275
124
|
}
|
|
276
125
|
|
|
277
126
|
/* the real routes, over a scratch state folder: add, read back, mark done, read back */
|
|
278
127
|
{
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
await pg.
|
|
282
|
-
ok('
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
await
|
|
287
|
-
ok('
|
|
288
|
-
await pg.click('#qTabs [data-tab="today"]'); await pg.locator('#qBody .wck').first().click();
|
|
289
|
-
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));
|
|
128
|
+
const R = await open({ real: true }), pg = R.page;
|
|
129
|
+
ok('E1 on an empty scratch state the real view says the list is empty', !!(await until(() => pg.evaluate(() => /Nothing on your list/.test(document.querySelector('#czViewer').textContent)), 20000)));
|
|
130
|
+
await pg.fill('#hxLine', 'Reply to Rina about SSO !p1'); await pg.click(`${MW} [data-x="add"]`);
|
|
131
|
+
ok('E2 an added line comes back through the real routes on Your list', !!(await until(() => pg.evaluate(() => /Reply to Rina about SSO/.test(document.querySelector('#czViewer').textContent) && !!document.querySelector('#czViewer [data-done]')), 20000)), await pg.evaluate(() => document.querySelector('#czViewer').textContent.slice(0, 300)));
|
|
132
|
+
const api0 = await fetch(BASE + '/api/my-work-premium').then((r) => r.json());
|
|
133
|
+
const all0 = api0.model.queue.tabs.flatMap((t) => t.groups.flatMap((g) => g.rows || []));
|
|
134
|
+
ok('E3 the real model holds it with its priority', all0.some((r) => /Reply to Rina about SSO/.test(r.title) && /P1/i.test(JSON.stringify(r))), JSON.stringify(all0).slice(0, 400));
|
|
135
|
+
await pg.locator(`${MW} [data-done]`).first().click();
|
|
136
|
+
ok('E4 Done marks it done, and the list is empty again', !!(await until(() => pg.evaluate(() => /Nothing on your list/.test(document.querySelector('#czViewer').textContent)), 15000)));
|
|
290
137
|
const api = await fetch(BASE + '/api/my-work-premium').then((r) => r.json());
|
|
291
|
-
ok('E5 the model route answers ready with the list the
|
|
138
|
+
ok('E5 the model route answers ready with the list the view reads', api.ok && api.state === 'ready' && api.model.dock.needs === 0);
|
|
292
139
|
const hdr = await T.pressHeaders(BASE);
|
|
293
140
|
const ask = await fetch(BASE + '/api/briefing-premium/ask', { method: 'POST', headers: hdr, body: JSON.stringify({ key: 'work:item-ghost', text: 'q' }) }).then((r) => r.status);
|
|
294
|
-
ok('E6 a question about an item that is not on the
|
|
141
|
+
ok('E6 a question about an item that is not on the list starts nothing (404)', ask === 404, String(ask));
|
|
295
142
|
const post = await fetch(BASE + '/api/my-work-premium', { method: 'POST', headers: hdr, body: '{}' }).then((r) => r.status);
|
|
296
143
|
ok('E7 the model route is read-only', post === 405, String(post));
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
/* M12 fidelity against the mockup: computed style and geometry of the regions both pages have */
|
|
302
|
-
if (!fs.existsSync(MOCKUP)) ok('M12 the mockup is in the repository', false, MOCKUP);
|
|
303
|
-
else {
|
|
304
|
-
/* 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 */
|
|
305
|
-
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']];
|
|
306
|
-
const QUEUE = ['plate', 'heading', 'row', 'title', 'sub', 'due', 'waitrow'];
|
|
307
|
-
const SKIP_GEOM = { 1280: QUEUE, 390: QUEUE };
|
|
308
|
-
const PROPS = ['fontSize', 'fontWeight', 'fontFamily', 'color', 'backgroundColor', 'borderRadius', 'paddingTop', 'paddingLeft', 'letterSpacing', 'lineHeight', 'boxShadow', 'backdropFilter', 'borderTopColor'];
|
|
309
|
-
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]);
|
|
310
|
-
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
311
|
-
const m = await (await browser.newContext({ viewport: { width: w, height: h } })).newPage();
|
|
312
|
-
await m.goto('file://' + MOCKUP); await CT.applyToPage(m, CT_VENDOR);
|
|
313
|
-
await until(() => m.evaluate(() => document.querySelectorAll('#rank .rr').length > 0));
|
|
314
|
-
await m.evaluate((t) => { document.documentElement.dataset.theme = t; document.querySelector('.pl[data-p="work"]').click(); }, th);
|
|
315
|
-
await until(() => m.evaluate(() => document.querySelectorAll('#plateBody .wrow').length > 0)); await sleep(900);
|
|
316
|
-
const R = await open({ w, h, theme: th }); await sleep(500);
|
|
317
|
-
/* 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 */
|
|
318
|
-
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);
|
|
319
|
-
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 = [];
|
|
320
|
-
for (const [n] of PAIRS) {
|
|
321
|
-
if (!a[n] || !c[n]) { diffs.push(n + ' missing'); continue; }
|
|
322
|
-
for (const k of Object.keys(a[n])) {
|
|
323
|
-
const geom = k === 'left' || k === 'width';
|
|
324
|
-
if (geom && (SKIP_GEOM[w].includes(n) || ['brief', 'title', 'sub', 'due', 'label', 'glyph', 'waitrow', 'tile', 'capin'].includes(n) && k === 'width' || ['brief', 'title', 'sub'].includes(n) && k === 'left')) continue;
|
|
325
|
-
if (geom ? Math.abs(a[n][k] - c[n][k]) > 2 : a[n][k] !== c[n][k]) diffs.push(`${n}.${k} ${a[n][k]} | ${c[n][k]}`);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
ok(`M12 styles and geometry match the mockup at ${w} px, ${th}`, diffs.length === 0, diffs.join(' ; '));
|
|
329
|
-
await m.context().close(); await R.ctx.close();
|
|
144
|
+
for (const [route, body] of [['notyet', { id: 'item-ghost', until: 'tomorrow' }], ['waiting', { id: 'item-ghost', on: 'Priya' }], ['keep', { id: 'item-ghost' }]]) {
|
|
145
|
+
const s = await fetch(BASE + '/api/pm-items/' + route, { method: 'POST', headers: hdr, body: JSON.stringify(body) }).then((r) => r.status);
|
|
146
|
+
ok(`E8 the ${route} route the old dialog pressed still answers, and refuses an item it does not hold`, s >= 400 && s < 500, String(s));
|
|
330
147
|
}
|
|
148
|
+
ok('0 no page error against the real routes', R.errors.length === 0, R.errors.join(' | '));
|
|
149
|
+
await R.ctx.close();
|
|
331
150
|
}
|
|
332
151
|
return finish();
|
|
333
|
-
})()
|
|
152
|
+
})();
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.398.0",
|
|
4
|
+
"at": "2026-10-23T04:45:54.728Z",
|
|
5
|
+
"f": 2,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1012,
|
|
9
|
+
"t": "Rebuild Home, Viewer, Board and Insights to the Agreed design",
|
|
10
|
+
"s": "Rebuild Home, Viewer, Board and Insights to the Agreed design"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"v": "0.397.0",
|
|
16
|
+
"at": "2026-10-22T20:10:19.514Z",
|
|
17
|
+
"f": 2,
|
|
18
|
+
"prs": [
|
|
19
|
+
{
|
|
20
|
+
"n": 1011,
|
|
21
|
+
"t": "The premium pages follow the Agreed design",
|
|
22
|
+
"s": "The premium pages follow the Agreed design"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
2
26
|
{
|
|
3
27
|
"v": "0.396.0",
|
|
4
28
|
"at": "2026-10-22T10:57:02.235Z",
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
/* fixtures/board-premium-facts.js — the facts lib/board-premium.js builds from, for a plausible board on 17 Oct 2026, 09:12 local. Shapes follow the routes
|
|
3
3
|
* of lib/routes-boards.js and lib/routes-core-docs.js. Seven initiatives are loaded of nine open; one is late with a recorded end date in the past. */
|
|
4
4
|
const NOW = new Date(2026, 9, 17, 9, 12).getTime();
|
|
5
|
-
|
|
5
|
+
// The eight lifecycle steps (premium-agreed-design L1): six stages and two milestones, as scripts/boards.js SELF_LADDER draws them.
|
|
6
|
+
const WF = ['Triage', 'Discover', 'Plan', 'Prioritize', 'Build', 'Deliver', 'Monitor', 'Evaluate'].map((name, i) => ({ name, cat: ['Discover', 'Discover', 'Plan', 'Plan', 'Do', 'Do', 'Learn', 'Learn'][i], ...(name === 'Deliver' || name === 'Evaluate' ? { milestone: true } : {}) }));
|
|
6
7
|
const row = (id, title, o = {}) => ({ id, title, lane: 'feature', stage: 'Build', cat: 'Do', owner: null, anchor: 'q3-2026:o1:kr1', horizon: 'now', status: 'on track', start: null, end: null, progress: null, warnings: [], rank: 0, health: 'on', updated: '2026-10-15T08:00:00.000Z', reading: 'build', stageSource: 'derived', dupOf: null, ...o });
|
|
7
8
|
const ROWS = [
|
|
8
9
|
row('self-serve-v2', 'Self-serve onboarding v2', { owner: 'Dara', stage: 'Build', status: 'late', start: '2026-09-01', end: '2026-10-10', progress: 62 }),
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* fixtures/board-premium-jira.js — the board-premium facts with a Jira reading (initiative premium-agreed-design, B1 B2): an active sprint whose
|
|
3
|
+
* tickets belong to two initiatives (one flagged blocked, with points), a pushed ticket from the work items, a next release and an open ask.
|
|
4
|
+
* Built on fixtures/board-premium-facts.js; the dates sit around its NOW (17 Oct 2026). */
|
|
5
|
+
const F = require('./board-premium-facts.js');
|
|
6
|
+
|
|
7
|
+
const issue = (key, summary, status, category, initiative, o = {}) => ({ key, summary, status, category, initiative, flagged: false, reason: null, points: null, url: 'https://jira.example/browse/' + key, ...o });
|
|
8
|
+
function facts(o = {}) {
|
|
9
|
+
return F.facts({
|
|
10
|
+
sprints: { source: 'jira', readAt: new Date(F.NOW - 12 * 60000).toISOString(), sprints: [{
|
|
11
|
+
name: 'Sprint 24', state: 'active', start: '2026-10-12', end: '2026-10-23', counts: { todo: 2, doing: 2, done: 3 }, goal: 'Self-serve onboarding reaches beta',
|
|
12
|
+
issues: [
|
|
13
|
+
issue('ONB-31', 'Welcome checklist', 'Done', 'done', 'self-serve-v2', { points: 3 }),
|
|
14
|
+
issue('ONB-32', 'Invite teammates step', 'Done', 'done', 'self-serve-v2', { points: 2 }),
|
|
15
|
+
issue('ONB-34', 'Empty states', 'In Review', 'doing', 'self-serve-v2', { points: 3 }),
|
|
16
|
+
issue('ONB-35', 'Billing step', 'In Progress', 'doing', 'self-serve-v2', { points: 3 }),
|
|
17
|
+
issue('ONB-36', 'Phone layout', 'To Do', 'todo', 'self-serve-v2', { points: 2 }),
|
|
18
|
+
issue('SSO-12', 'SAML errors', 'Blocked', 'doing', 'sso-partners', { flagged: true, reason: 'Waiting on PLAT-88' }),
|
|
19
|
+
issue('SSO-10', 'Okta config', 'Done', 'done', 'sso-partners'),
|
|
20
|
+
],
|
|
21
|
+
}, { name: 'Sprint 25', state: 'future', start: '2026-10-26', end: '2026-11-06', counts: { todo: 1, doing: 0, done: 0 }, issues: [issue('SSO-14', 'Partner docs', 'To Do', 'todo', 'sso-partners')] }] },
|
|
22
|
+
items: [{ uid: 'SSO-15', key: 'SSO-15', kind: 'Task', src: 'jira', title: 'Audit the SSO logs', status: 'In review', blocked: false, owner: null, ini: 'sso-partners' }],
|
|
23
|
+
nextRelease: { id: 'v2.4', name: 'v2.4', type: 'minor', at: '2026-11-04T00:00:00Z', ini: ['sso-partners'] },
|
|
24
|
+
asks: [{ id: 'a1', line: 'Finance wants a CSV of failed payouts each morning', source: 'Email from Rina', by: 'pm', at: '2026-10-16T08:00:00Z', state: 'open', draft: { title: 'Failed payouts CSV', lane: 'feature' } }],
|
|
25
|
+
...o,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
module.exports = { facts, NOW: F.NOW };
|