create-pmos 0.397.0 → 0.399.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/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +105 -52
- package/workspace/briefing-premium-board-test.js +284 -128
- package/workspace/briefing-premium-calendar-2-test.js +135 -198
- package/workspace/briefing-premium-calendar-3-test.js +143 -418
- package/workspace/briefing-premium-calendar-test.js +85 -196
- package/workspace/briefing-premium-doc-edit-test.js +99 -83
- package/workspace/briefing-premium-initiative-test.js +175 -290
- package/workspace/briefing-premium-insights-test.js +414 -219
- package/workspace/briefing-premium-metrics-test.js +55 -97
- package/workspace/briefing-premium-products-test.js +44 -28
- package/workspace/briefing-premium-sources-test.js +70 -49
- package/workspace/briefing-premium-test.js +155 -648
- package/workspace/briefing-premium-work-test.js +88 -283
- package/workspace/changelog.json +24 -0
- package/workspace/ev-everywhere-test.js +210 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +187 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +68 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-grill.js +63 -0
- package/workspace/lib/board-premium.js +121 -24
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/initiative-layout.js +77 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +64 -15
- package/workspace/lib/insights-records.js +115 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/meeting-points.js +52 -0
- package/workspace/lib/news-for-you.js +88 -0
- package/workspace/lib/notes-series.js +29 -6
- package/workspace/lib/report-confirm.js +48 -0
- package/workspace/lib/route-modules.js +12 -0
- package/workspace/lib/routes-board-docs.js +46 -0
- package/workspace/lib/routes-board-grill.js +90 -0
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-home-review.js +108 -0
- package/workspace/lib/routes-initiative-layout.js +57 -0
- package/workspace/lib/routes-insights-premium.js +16 -4
- package/workspace/lib/routes-insights-records.js +133 -0
- package/workspace/lib/routes-meeting-points.js +37 -0
- package/workspace/lib/routes-news.js +57 -0
- package/workspace/lib/routes-notes.js +3 -1
- package/workspace/lib/routes-report-confirm.js +31 -0
- package/workspace/lib/routes-search.js +38 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/search-index.js +176 -0
- package/workspace/lib/transcript-steps.js +123 -0
- 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-board-actions-test.js +128 -82
- package/workspace/premium-briefing-depth-test.js +104 -90
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +37 -37
- package/workspace/premium-chat-context-test.js +19 -18
- package/workspace/premium-chat-goal-view-test.js +23 -23
- package/workspace/premium-chat-notes-test.js +26 -31
- package/workspace/premium-chat-report-tab-test.js +46 -28
- package/workspace/premium-chat-term-test.js +16 -16
- package/workspace/premium-chat-viewer-test.js +60 -59
- package/workspace/premium-core-doc-issue-test.js +52 -43
- package/workspace/premium-html-viewer-test.js +14 -17
- package/workspace/premium-phone-card-test.js +10 -3
- package/workspace/premium-phone-room-test.js +41 -35
- package/workspace/premium-report-read-test.js +152 -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 -33
- package/workspace/premium-vw-cal-test.js +97 -128
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +17 -10
- package/workspace/premium-vw-item-test.js +50 -49
- package/workspace/premium-vw-jira-test.js +53 -27
- package/workspace/premium-vw-meet-test.js +115 -187
- package/workspace/premium-vw-notes-test.js +88 -109
- package/workspace/premium-vw-rec-test.js +71 -194
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +61 -53
- package/workspace/public/pm/bd-acts.js +383 -0
- package/workspace/public/pm/bd-asks.js +261 -0
- package/workspace/public/pm/bd-pop.js +59 -0
- package/workspace/public/pm/bd-span.js +222 -82
- package/workspace/public/pm/bd-stages.js +25 -11
- package/workspace/public/pm/bd-views.js +169 -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 +798 -230
- package/workspace/public/pm/cozy-ev.css +228 -0
- package/workspace/public/pm/cozy-evmodel.js +106 -0
- package/workspace/public/pm/cozy-evui.js +47 -0
- package/workspace/public/pm/cozy-home.css +570 -142
- package/workspace/public/pm/cozy-home.js +5 -3
- package/workspace/public/pm/cozy-insights.css +437 -170
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +104 -29
- package/workspace/public/pm/cozy-news.js +140 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-search.js +203 -0
- package/workspace/public/pm/cozy-settings.js +198 -0
- package/workspace/public/pm/cozy-sources.js +89 -0
- package/workspace/public/pm/cozy-today.css +217 -0
- package/workspace/public/pm/cozy-viewer.css +3 -3
- package/workspace/public/pm/cozy-viewer.js +145 -0
- package/workspace/public/pm/cozy-vw-mtg.css +350 -0
- package/workspace/public/pm/cozy-vw-rp.css +152 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +83 -1
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +1179 -0
- package/workspace/public/pm/home-around.js +413 -0
- package/workspace/public/pm/home-chat.js +512 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-dictate.js +54 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-ini-model.js +190 -0
- package/workspace/public/pm/home-ini.css +171 -0
- package/workspace/public/pm/home-ini.js +456 -0
- package/workspace/public/pm/home-list.js +276 -0
- package/workspace/public/pm/home-more.js +132 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-review.js +104 -0
- package/workspace/public/pm/home-task.js +67 -0
- package/workspace/public/pm/home-today.js +144 -0
- package/workspace/public/pm/home-work.js +547 -0
- 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 +548 -395
- package/workspace/public/pm/premium-chart-tab.js +109 -62
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +23 -21
- package/workspace/public/pm/premium-insights.js +1102 -581
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-mtg-present.js +138 -0
- package/workspace/public/pm/premium-mtg-replay.js +142 -0
- 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 +669 -476
- package/workspace/public/pm/premium-report-tab.js +116 -67
- package/workspace/public/pm/premium-shell.js +76 -123
- package/workspace/public/pm/premium-viewer.js +22 -1
- package/workspace/public/pm/premium-vw-cal.js +277 -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-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +958 -0
- package/workspace/public/pm/premium-vw-notes.js +116 -68
- 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 -218
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/rp-parts.js +269 -0
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +29 -70
- package/workspace/public/premium-initiative.html +8 -48
- package/workspace/public/premium-insights.html +26 -64
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium.html +18 -107
- package/workspace/r/m1.png +0 -0
- package/workspace/r/m2.png +0 -0
- package/workspace/r/m3.png +0 -0
- package/workspace/r/nl.png +0 -0
- package/workspace/server.js +18 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/initiative-layout.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
- package/workspace/test-lists/premium-uncovered-reports.json +9 -0
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/test-lists/uf-everywhere.json +15 -0
- package/workspace/test-lists/uf-home.json +9 -0
- package/workspace/test-lists/uncovered-board.json +9 -0
- package/workspace/public/pm/premium-work.js +0 -729
- package/workspace/public/pm/premium.js +0 -1146
|
@@ -1,11 +1,15 @@
|
|
|
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
|
-
|
|
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). Re-pointed again by premium-uncovered-features (canvas HmMyWork, HmReview): no
|
|
6
|
+
* "Waiting for design" marker; "My work" beside "Weekly review" at the top, the filters Open, Waiting, Untouched, Kept and Done, Done on each
|
|
7
|
+
* of your rows, and one add box. The old page's hero, dialog fields (When, Waiting on, Keep, Drop), Undo and the
|
|
8
|
+
* 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.
|
|
9
|
+
* 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
|
|
10
|
+
* fixture (fixtures/my-work-premium-facts.js) and answer the presses themselves; the last block drives the real routes of a scratch state folder.
|
|
11
|
+
* 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
|
|
12
|
+
* M12 floors at 390 · E1-E7 the real routes */
|
|
9
13
|
const path = require('path');
|
|
10
14
|
const { spawn } = require('child_process');
|
|
11
15
|
const { findBrowser } = require('./lib/find-browser');
|
|
@@ -15,18 +19,9 @@ const F = require('./fixtures/my-work-premium-facts.js');
|
|
|
15
19
|
|
|
16
20
|
const BASE = T.BASE;
|
|
17
21
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
18
|
-
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) {
|
|
19
|
-
/* 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) */
|
|
20
|
-
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
|
-
/* re-pointed for premium-agreed-design: on a desktop Home the dialog is the docked chat and is always on, so "a dialog is open" below means a row's
|
|
22
|
-
* dialog: #dlg is on and, when docked, not showing your own chat (its eyebrow reads Chat) */
|
|
22
|
+
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); } };
|
|
23
23
|
const results = [];
|
|
24
|
-
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
25
|
-
/* the dialog's fields (premium-simple-ui): a field opens its panel; When holds Today, Not yet, Not before and Someday */
|
|
26
|
-
/* the fields sit in a sheet behind Edit ▾ in the dialog's switch row, closed by default (PM, 2026-10-20) */
|
|
27
|
-
const sheet = async (pg) => { if (await pg.locator('#iTog[aria-expanded="false"]').count()) await pg.click('#iTog'); };
|
|
28
|
-
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}"]`); };
|
|
29
|
-
const more = (pg) => field(pg, 'when');
|
|
24
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
30
25
|
let srv = null; let browser = null;
|
|
31
26
|
const finish = async (code) => {
|
|
32
27
|
if (browser) await browser.close().catch(() => {});
|
|
@@ -39,6 +34,8 @@ const finish = async (code) => {
|
|
|
39
34
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
40
35
|
|
|
41
36
|
const mk = () => WP.build({ v: F.view(), now: F.NOW });
|
|
37
|
+
const MW = '#czViewer:not([hidden])';
|
|
38
|
+
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 }; };
|
|
42
39
|
|
|
43
40
|
(async () => {
|
|
44
41
|
const exe = findBrowser();
|
|
@@ -49,299 +46,107 @@ const mk = () => WP.build({ v: F.view(), now: F.NOW });
|
|
|
49
46
|
await T.waitForServer(BASE);
|
|
50
47
|
browser = await chromium.launch({ executablePath: exe });
|
|
51
48
|
|
|
52
|
-
/* a page whose list and presses the test answers */
|
|
53
|
-
const open = async ({ w = 1280, h = 900, theme = 'light', model = mk() } = {}) => {
|
|
54
|
-
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
49
|
+
/* 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 */
|
|
50
|
+
const open = async ({ w = 1280, h = 900, theme = 'light', model = mk(), fail = false, real = false } = {}) => {
|
|
51
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: theme, hasTouch: w < 1000 });
|
|
55
52
|
const page = await ctx.newPage();
|
|
56
|
-
|
|
53
|
+
const errors = [], posts = []; let answer = { status: 200, body: { ok: true } };
|
|
57
54
|
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
if (!real) {
|
|
56
|
+
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() }) }));
|
|
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) }); });
|
|
58
|
+
}
|
|
61
59
|
await page.goto(BASE + '/premium-work.html?theme=' + theme);
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
await until(() => page.evaluate(() => /\/premium\.html$/.test(location.pathname) && !!document.querySelector('#czFab')), 15000);
|
|
61
|
+
await sleep(600);
|
|
62
|
+
await page.click('#czFab'); await page.click('[data-cz-more]');
|
|
63
|
+
await page.locator('#hmMenu button, #czViewer button').filter({ hasText: 'My work' }).first().click();
|
|
64
|
+
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);
|
|
65
|
+
return { ctx, page, errors, posts, up, set: (a) => { answer = a; } };
|
|
64
66
|
};
|
|
65
67
|
|
|
68
|
+
const M = mk();
|
|
66
69
|
const A = await open();
|
|
67
|
-
|
|
70
|
+
const p = A.page;
|
|
71
|
+
ok('0 My work opens in the Viewer', !!A.up);
|
|
68
72
|
if (!A.up) return finish(1);
|
|
69
|
-
const p = A.page, M = mk();
|
|
70
|
-
const txt = (s) => p.evaluate((q) => (document.querySelector(q) || {}).textContent || '', s);
|
|
71
|
-
|
|
72
73
|
/* M1 */
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
ok('
|
|
80
|
-
ok('
|
|
81
|
-
{
|
|
82
|
-
// re-pointed for premium-agreed-design: the rail is hidden and the floating place menu replaces it; its Home entry opens the Briefing (Home) page
|
|
83
|
-
const r2 = await open(); await r2.page.click('#czFab'); await r2.page.locator('#czMenu a[href="/premium.html"]').click();
|
|
84
|
-
ok('M1 the Briefing button opens the Briefing page', await until(() => /\/premium\.html$/.test(r2.page.url()), 5000), r2.page.url());
|
|
85
|
-
await r2.ctx.close();
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* M2 */
|
|
89
|
-
// re-pointed for premium-agreed-design: My work opens Home, whose hero is the Briefing's; what the list holds is said by the Work queue's caption
|
|
90
|
-
// (the count marked) and its tabs, and the waiting card's caption
|
|
91
|
-
const hero = await p.evaluate(() => ({ text: document.querySelector('#qCap').textContent, k: [...document.querySelectorAll('#qCap b')].map((x) => x.textContent), tabs: [...document.querySelectorAll('#qTabs .qtb, #qMenu .qtb')].map((b) => b.textContent).join(), wait: document.querySelector('#waitCap').textContent }));
|
|
92
|
-
ok('M2 the hero is the model\'s sentences, numbers marked', hero.text === [M.queue.n + ' to clear', ...M.queue.cap].join(' · ') && hero.k.join() === String(M.queue.n), hero.text);
|
|
93
|
-
ok('M2 the hero says what the records hold', /Today3/.test(hero.tabs) && /Inbox4/.test(hero.tabs) && hero.wait === 'longest 8 days', JSON.stringify(hero));
|
|
94
|
-
|
|
95
|
-
/* M10 */
|
|
96
|
-
// re-pointed for premium-agreed-design: Home's header is the Briefing's (its own suites read it), so what is real about the list is said by the
|
|
97
|
-
// Work queue itself: the Inbox names Jira and Slack as the source of what they hold, and the Done tab says their items close there, not here
|
|
98
|
-
{
|
|
99
|
-
const r10 = await open(), pg10 = r10.page;
|
|
100
|
-
await pg10.click('#qTabs [data-tab="inbox"]'); const inb = await pg10.evaluate(() => document.querySelector('#qBody').textContent);
|
|
101
|
-
await pg10.click('#qMore'); await pg10.click('#qMenu [data-tab="done"]'); const dn = await pg10.evaluate(() => document.querySelector('#qNote').textContent);
|
|
102
|
-
ok('M10 the header says what is real and that Jira and Slack appear only when read', /New from Jira and Slack/.test(inb) && /Items from Jira or Slack close there, not here/.test(dn), dn);
|
|
103
|
-
await r10.ctx.close();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/* M4 the Work queue: one card, a tab for each place a thing waits */
|
|
107
|
-
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}"]`); };
|
|
108
|
-
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: new Set([...document.querySelectorAll('#qBody > *')].map((e) => Math.round(e.getBoundingClientRect().left))).size, old: ['#plate', '#agCard', '#trayCard'].filter((x) => document.querySelector(x)), title: document.querySelector('#hQueue').textContent }));
|
|
109
|
-
// re-pointed for premium-agreed-design: on Home the Work queue card is headed "Your list"
|
|
110
|
-
ok('M4 one Work queue card replaces On your plate, With agents and the tray', q.title === 'Your list' && q.old.length === 0, JSON.stringify(q));
|
|
111
|
-
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));
|
|
112
|
-
await p.click('#qMore'); await p.click('#qMenu [data-tab="someday"]');
|
|
113
|
-
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 }));
|
|
114
|
-
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));
|
|
115
|
-
await qtab('today');
|
|
116
|
-
// re-pointed for premium-agreed-design: on a desktop Home the list sits in the left column, so its rows stack in one column
|
|
117
|
-
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 === 1 && 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));
|
|
118
|
-
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]));
|
|
119
|
-
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')) }; });
|
|
120
|
-
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));
|
|
121
|
-
await qtab('inbox');
|
|
122
|
-
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 }));
|
|
123
|
-
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));
|
|
124
|
-
await p.focus('#qTabs [data-tab="inbox"]'); await p.keyboard.press('ArrowRight');
|
|
125
|
-
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'));
|
|
126
|
-
ok('M4 the add box has no Enter label', !(await p.evaluate(() => !!document.querySelector('#cap kbd'))));
|
|
127
|
-
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))));
|
|
128
|
-
|
|
129
|
-
/* 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) */
|
|
130
|
-
const chips = () => p.evaluate(() => [...document.querySelectorAll('#qBody .wrow')].map((r) => [r.dataset.key, (r.querySelector('.wag') || {}).textContent || ''].join('=')).filter((x) => !/=$/.test(x)));
|
|
131
|
-
const upc = await chips();
|
|
132
|
-
await qtab('today'); const tdc = await chips();
|
|
133
|
-
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 }));
|
|
134
|
-
await qtab('today');
|
|
135
|
-
|
|
74
|
+
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')));
|
|
75
|
+
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);
|
|
76
|
+
/* M4 */
|
|
77
|
+
const v0 = await p.evaluate(view);
|
|
78
|
+
ok('M4 My work has no Waiting for design marker; its filters are Open, Waiting, Untouched, Kept and Done, on Open', v0.kind === 'My work' && !v0.wait && v0.tabs.map((t) => t.replace(/ \d+$/, '')).join() === 'Open,Waiting,Untouched,Kept,Done' && v0.tab === 'Open', JSON.stringify(v0));
|
|
79
|
+
const mine = M.queue.tabs.filter((t) => t.key !== 'kept' && t.key !== 'done').flatMap((t) => t.groups.flatMap((g) => g.rows || []));
|
|
80
|
+
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 }));
|
|
81
|
+
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));
|
|
136
82
|
/* M6 */
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
83
|
+
await p.click(`${MW} [data-tab="waiting"]`);
|
|
84
|
+
const v1 = await p.evaluate(view);
|
|
85
|
+
ok('M6 Waiting on others lists who owes the PM, longest first', /^Waiting/.test(v1.tab) && 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));
|
|
140
86
|
/* M7 */
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
await
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
await p.
|
|
155
|
-
|
|
156
|
-
ok('M3 an empty line is not posted', A.posts.length === n0 && /Write one line/.test(await txt('#capHint')));
|
|
157
|
-
ok('M3 a message about a press stays on screen after the box loses focus', await p.evaluate(() => { document.activeElement.blur(); return getComputedStyle(document.querySelector('#capHint')).display !== 'none'; }));
|
|
158
|
-
{ 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);
|
|
159
|
-
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(); }
|
|
160
|
-
await qtab('today'); // a line with no date opened the queue on Inbox
|
|
161
|
-
|
|
162
|
-
/* M8 presses from a check circle, and from the dialog */
|
|
163
|
-
{
|
|
164
|
-
const n = A.posts.length;
|
|
165
|
-
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') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); await sleep(500);
|
|
166
|
-
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')));
|
|
167
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent)))));
|
|
168
|
-
}
|
|
169
|
-
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') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); await sleep(700); };
|
|
170
|
-
const shut = async () => { await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); };
|
|
171
|
-
const lastPost = () => A.posts[A.posts.length - 1];
|
|
172
|
-
A.set({ status: 200, body: { ok: true } });
|
|
173
|
-
const g0 = A.gets();
|
|
174
|
-
await showKey(p, 'work:item-bbbbbbbbbbb2'); await p.locator('.wrow[data-key="work:item-bbbbbbbbbbb2"] .wck').click();
|
|
175
|
-
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));
|
|
176
|
-
await p.locator('#toast .undo').click();
|
|
177
|
-
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')));
|
|
178
|
-
await openKey('work:item-aaaaaaaaaaa1');
|
|
179
|
-
const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, mod: document.querySelector('#dlg').getAttribute('aria-modal'), ask: !!document.querySelector('#askGo'),
|
|
180
|
-
fields: [...document.querySelectorAll('#card .ffd small')].map((x) => x.textContent).join(), when: document.querySelector('#card .ffd[data-k="when"] b').textContent,
|
|
181
|
-
bar: [...document.querySelectorAll('#card .ibrow button, #card .fbar button')].map((b) => b.textContent.trim()).join(), solid: [...document.querySelectorAll('#card .cta')].length,
|
|
182
|
-
shut: document.querySelector('#iSheet').hidden && !document.querySelector('#dBody .ffd'), row: !!document.querySelector('#dTabs #card [data-p="done"]') }));
|
|
183
|
-
await more(p); dlg.opts = await p.evaluate(() => [...document.querySelectorAll('#card .fmenu .fopt > span')].map((x) => x.textContent).join());
|
|
184
|
-
await field(p, 'wait'); dlg.wDis = await p.evaluate(() => document.querySelector('#wBtn').disabled);
|
|
185
|
-
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'
|
|
186
|
-
&& 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
|
|
187
|
-
&& dlg.opts === 'Today,Later today,Tomorrow,Next week,Not before a date…,Someday' && dlg.mod === 'false' /* re-pointed for premium-agreed-design: docked on Home the dialog is not modal (the list beside it stays live) */ && dlg.ask && dlg.wDis, JSON.stringify(dlg));
|
|
188
|
-
await more(p);
|
|
189
|
-
await p.locator('#card [data-p="notyet"][data-when="tomorrow"]').click();
|
|
190
|
-
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') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))));
|
|
191
|
-
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']]) {
|
|
192
|
-
await openKey('work:item-aaaaaaaaaaa2'); const n = A.posts.length;
|
|
193
|
-
if (sel.includes('someday') || sel.includes('flag')) await more(p);
|
|
194
|
-
if (sel.includes('remove')) await sheet(p);
|
|
195
|
-
await p.locator('#card ' + sel).click();
|
|
196
|
-
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()));
|
|
197
|
-
await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent)))));
|
|
198
|
-
}
|
|
199
|
-
ok('M8 Done and Drop offer Undo for a short time', await p.evaluate(() => /Undo/.test(document.querySelector('#toast').textContent)));
|
|
200
|
-
await openKey('work:item-aaaaaaaaaaa3'); await field(p, 'wait'); await p.fill('#wOn', ' Priya ');
|
|
201
|
-
ok('M8 Waiting needs a name', await p.evaluate(() => !document.querySelector('#wBtn').disabled));
|
|
202
|
-
await p.click('#wBtn');
|
|
203
|
-
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')));
|
|
204
|
-
await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent)))));
|
|
205
|
-
await openKey('work:item-ddddddddddd1');
|
|
206
|
-
ok('M7 an item on the review list offers Keep, and Keep posts it', await p.evaluate(() => !!document.querySelector('#card [data-p="keep"]')));
|
|
207
|
-
await sheet(p); await p.click('#card [data-p="keep"]');
|
|
208
|
-
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')));
|
|
209
|
-
await until(() => p.evaluate(() => !(document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent)))));
|
|
87
|
+
ok('M7 "Weekly review" sits beside "My work" at the top of the card', await p.evaluate((V) => [...document.querySelectorAll(V + ' [data-ut-tab]')].map((b) => b.textContent).join() === 'My work,Weekly review', MW));
|
|
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)))));
|
|
210
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)));
|
|
211
103
|
const mint = await T.nonce(BASE);
|
|
212
|
-
ok('M8 every press carried the launch nonce', !!mint && A.posts.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
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.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))) && !document.querySelector('#card [data-p="done"]').disabled)));
|
|
218
|
-
A.set({ status: 200, body: { ok: true } });
|
|
219
|
-
|
|
220
|
-
/* agent beside the item */
|
|
221
|
-
A.setThread({ ok: true, working: false, turns: [{ id: 'bq-1', q: 'What is this about?', state: 'answered', a: 'It is about <b>shipping</b>.' }] });
|
|
222
|
-
await shut(); await openKey('work:item-aaaaaaaaaaa1');
|
|
223
|
-
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));
|
|
224
|
-
A.setThread({ ok: true, working: false, turns: [] });
|
|
225
|
-
await p.fill('#askIn', 'Why is this here?'); const nA = A.posts.length; await p.press('#askIn', 'Enter');
|
|
226
|
-
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()));
|
|
227
|
-
await shut();
|
|
228
|
-
|
|
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)))));
|
|
229
109
|
ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
230
110
|
await A.ctx.close();
|
|
231
111
|
|
|
232
|
-
/*
|
|
233
|
-
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
await E.ctx.close();
|
|
237
|
-
}
|
|
238
|
-
{
|
|
239
|
-
// a failed read says why and draws nothing
|
|
240
|
-
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage();
|
|
241
|
-
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' }) }));
|
|
242
|
-
await pg.goto(BASE + '/premium-work.html');
|
|
243
|
-
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('#qNote').textContent) && document.querySelectorAll('#qBody .wrow').length === 0), 5000)); // re-pointed for premium-agreed-design: on Home the Work queue's note says why
|
|
244
|
-
await ctx.close();
|
|
245
|
-
}
|
|
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(() => /My work 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(); }
|
|
246
116
|
|
|
247
|
-
|
|
248
|
-
const R = await open({ w: 820, h: 1000 }), t = R.page;
|
|
249
|
-
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') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); await sleep(900);
|
|
250
|
-
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 }; });
|
|
251
|
-
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));
|
|
252
|
-
await R.ctx.close();
|
|
253
|
-
}
|
|
254
|
-
/* M12 floors on a phone, both themes */
|
|
117
|
+
/* M12 floors at 390, both themes */
|
|
255
118
|
for (const theme of ['light', 'dark']) {
|
|
256
|
-
const
|
|
257
|
-
await
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
/* 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 */
|
|
262
|
-
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') }; });
|
|
263
|
-
const h1 = await hd(); await q.click('#dTitle'); const h2 = await hd(); await q.click('#dTitle'); const h3 = await hd();
|
|
264
|
-
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));
|
|
265
|
-
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]));
|
|
266
|
-
await q.click('#dTabs [data-t="chat"]'); await sleep(900);
|
|
267
|
-
const g2 = await geo();
|
|
268
|
-
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));
|
|
269
|
-
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) }; });
|
|
270
|
-
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));
|
|
271
|
-
await q.keyboard.press('Escape'); await sleep(300);
|
|
272
|
-
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)) }));
|
|
273
|
-
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));
|
|
274
|
-
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 }));
|
|
275
|
-
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));
|
|
276
|
-
/* 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 */
|
|
277
|
-
await q.evaluate(() => { const y = document.querySelector('#qBody').getBoundingClientRect().top + scrollY - 250; scrollTo(0, y); window.__ys = []; addEventListener('scroll', () => window.__ys.push(scrollY)); });
|
|
278
|
-
await sleep(200); const y0 = await q.evaluate(() => scrollY);
|
|
279
|
-
await q.evaluate(() => { const i = document.querySelector('#capIn'); i.focus({ preventScroll: true }); i.blur(); }); await sleep(600);
|
|
280
|
-
// re-pointed for premium-agreed-design: the floating place menu replaces the rail as the fixed layer; on a phone it sits 24 px off the bottom
|
|
281
|
-
const kb = await q.evaluate(() => { const r = document.querySelector('#czNav').getBoundingClientRect(); return { ys: window.__ys, y: scrollY, bottom: Math.round(innerHeight - r.bottom) }; });
|
|
282
|
-
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 === 24, JSON.stringify({ y0, ...kb }));
|
|
283
|
-
await R.ctx.close();
|
|
284
|
-
}
|
|
285
|
-
{
|
|
286
|
-
// re-pointed for premium-agreed-design: on a desktop Home the dialog is docked beside a live list on purpose, so the modal dialog is checked where it is modal (a tablet, 820 px)
|
|
287
|
-
const R = await open({ w: 820, h: 1000 }); await showKey(R.page, 'work:item-aaaaaaaaaaa1'); await R.page.locator('.wrow[data-key="work:item-aaaaaaaaaaa1"] .wrh').first().focus();
|
|
288
|
-
await R.page.keyboard.press('Enter'); await until(() => R.page.evaluate(() => (document.querySelector('#dlg').classList.contains('on') && !(document.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))))); await sleep(500);
|
|
289
|
-
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.body.classList.contains('cz-dock') && /^Chat/.test(document.querySelector('#dEye').textContent))) && document.activeElement.classList.contains('wrh')))));
|
|
290
|
-
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();
|
|
291
124
|
}
|
|
292
125
|
|
|
293
126
|
/* the real routes, over a scratch state folder: add, read back, mark done, read back */
|
|
294
127
|
{
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
await pg.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
ok('
|
|
302
|
-
await
|
|
303
|
-
await
|
|
304
|
-
ok('E3 Today, picked in the When field of 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' && /^1 to clear/.test(document.querySelector('#qCap').textContent)), 15000));
|
|
305
|
-
await pg.click('#qTabs [data-tab="today"]'); await pg.locator('#qBody .wck').first().click();
|
|
306
|
-
ok('E4 the check circle marks it done, and the list is empty again', await until(() => pg.evaluate(() => document.querySelector('#qBody').textContent === 'Nothing is placed for today.' && /^0 to clear/.test(document.querySelector('#qCap').textContent)), 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 is open/.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 is open/.test(document.querySelector('#czViewer').textContent)), 15000)));
|
|
307
137
|
const api = await fetch(BASE + '/api/my-work-premium').then((r) => r.json());
|
|
308
|
-
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);
|
|
309
139
|
const hdr = await T.pressHeaders(BASE);
|
|
310
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);
|
|
311
|
-
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));
|
|
312
142
|
const post = await fetch(BASE + '/api/my-work-premium', { method: 'POST', headers: hdr, body: '{}' }).then((r) => r.status);
|
|
313
143
|
ok('E7 the model route is read-only', post === 405, String(post));
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
/* M12 fidelity against the design: computed style of the regions the page has.
|
|
319
|
-
* re-pointed for premium-agreed-design: the PM approved the Agreed design (planning/prd/premium-agreed-design-prd.md) in place of the
|
|
320
|
-
* prototype mockup this block used to match, so the reference is now that design's tokens in cozy.css: every region is drawn, set in the
|
|
321
|
-
* design's typeface, its text in one of the design's inks, and the add button filled with the design's blue (or the solid it points at). */
|
|
322
|
-
{
|
|
323
|
-
const REGIONS = [['date', '.hero .date'], ['brief', '.brief'], ['cap', '.cap'], ['capin', '.cap input'], ['capbtn', '.cap .capb'], ['plate', '#queue'], ['heading', '#hQueue'], ['row', '#qBody .wrow:not(.first)'], ['title', '#qBody .wrow:not(.first) .wtit'], ['sub', '#qBody .wrow:not(.first) .ws'], ['due', '#qBody .due:not(.od)'], ['waitrow', '#waitBody .wrow']];
|
|
324
|
-
const INKED = ['date', 'brief', 'capin', 'heading', 'row', 'title', 'sub', 'due', 'waitrow'];
|
|
325
|
-
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
326
|
-
const R = await open({ w, h, theme: th }); await sleep(500);
|
|
327
|
-
await R.page.evaluate(() => Promise.all(document.getAnimations().filter((a) => a.effect && a.effect.getComputedTiming().iterations !== Infinity).map((a) => a.finished.catch(() => null)))).catch(() => null);
|
|
328
|
-
const got = await R.page.evaluate((regions) => {
|
|
329
|
-
const tok = (v, prop) => { const e = document.createElement('i'); e.style.cssText = `position:absolute;visibility:hidden;${prop}:var(${v})`; document.body.appendChild(e); const cs = getComputedStyle(e); const out = prop === 'font-family' ? cs.fontFamily : prop === 'color' ? cs.color : cs.backgroundColor; e.remove(); return out; };
|
|
330
|
-
// the inks are the design's three, plus the page tokens it points at them (cozy-home.css: in dark the page keeps premium.css's dark inks and solid)
|
|
331
|
-
const T = { sans: tok('--cz-sans', 'font-family'), inks: ['--cz-ink', '--cz-ink2', '--cz-ink3', '--ink', '--ink-2', '--ink-3'].map((v) => tok(v, 'color')), blue: [tok('--cz-blueink', 'background-color'), tok('--cz-blue', 'background-color'), tok('--solid', 'background-color')] };
|
|
332
|
-
const o = {}; for (const [n, sel] of regions) { const e = document.querySelector('main.stage:not([hidden]) ' + sel); if (!e) { o[n] = null; continue; } const cs = getComputedStyle(e); o[n] = { fontFamily: cs.fontFamily, color: cs.color, backgroundColor: cs.backgroundColor }; }
|
|
333
|
-
return { T, o };
|
|
334
|
-
}, REGIONS);
|
|
335
|
-
const diffs = [];
|
|
336
|
-
for (const [n] of REGIONS) {
|
|
337
|
-
const v = got.o[n]; if (!v) { diffs.push(n + ' missing'); continue; }
|
|
338
|
-
if (v.fontFamily !== got.T.sans) diffs.push(`${n}.fontFamily ${v.fontFamily} | ${got.T.sans}`);
|
|
339
|
-
if (INKED.includes(n) && !got.T.inks.includes(v.color)) diffs.push(`${n}.color ${v.color} | ${got.T.inks.join(' or ')}`);
|
|
340
|
-
}
|
|
341
|
-
if (got.o.capbtn && !got.T.blue.includes(got.o.capbtn.backgroundColor)) diffs.push(`capbtn.backgroundColor ${got.o.capbtn.backgroundColor} | ${got.T.blue.join(' or ')}`);
|
|
342
|
-
ok(`M12 styles and geometry match the mockup at ${w} px, ${th}`, diffs.length === 0, diffs.join(' ; '));
|
|
343
|
-
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));
|
|
344
147
|
}
|
|
148
|
+
ok('0 no page error against the real routes', R.errors.length === 0, R.errors.join(' | '));
|
|
149
|
+
await R.ctx.close();
|
|
345
150
|
}
|
|
346
151
|
return finish();
|
|
347
|
-
})()
|
|
152
|
+
})();
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.399.0",
|
|
4
|
+
"at": "2026-10-23T08:35:27.575Z",
|
|
5
|
+
"f": 2,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1019,
|
|
9
|
+
"t": "Build the uncovered features from the canvas review",
|
|
10
|
+
"s": "Build the uncovered features from the canvas review"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"v": "0.398.0",
|
|
16
|
+
"at": "2026-10-23T04:45:54.728Z",
|
|
17
|
+
"f": 2,
|
|
18
|
+
"prs": [
|
|
19
|
+
{
|
|
20
|
+
"n": 1012,
|
|
21
|
+
"t": "Rebuild Home, Viewer, Board and Insights to the Agreed design",
|
|
22
|
+
"s": "Rebuild Home, Viewer, Board and Insights to the Agreed design"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
2
26
|
{
|
|
3
27
|
"v": "0.397.0",
|
|
4
28
|
"at": "2026-10-22T20:10:19.514Z",
|