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,6 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* briefing-premium-doc-edit-test.js —
|
|
3
|
+
/* briefing-premium-doc-edit-test.js — editing a document and its proposals (initiative briefing-premium-doc-edit; planning/prd/briefing-premium-doc-edit-prd.md E1 to E8),
|
|
4
|
+
* re-pointed to the Agreed design (initiative premium-agreed-design): the document opens as a page in the Home Viewer (pm/premium-vw-doc.js) from the
|
|
5
|
+
* initiative's Files row. Edit is the page's Markdown mode and save row; the Edit log and the Proposals list are a plain section under the page marked
|
|
6
|
+
* "Waiting for design" until the design draws them. The page-level Keep and Undo all are in premium-vw-doc-test.js.
|
|
4
7
|
* Serves the real page from the real server. The initiative model and the /api/doc-sheet routes are answered by a small stateful stand-in, so each press can be
|
|
5
8
|
* read off the request the page sent. The routes' own behaviour (the file, the log, stale, 403) is in briefing-premium-doc-edit.test.js, on a scratch repository.
|
|
6
9
|
* E1 tabs · E2 edit · E3 ask · E4 proposals · E5 after a write · E6 held · E7 honesty · E8 fidelity and floors */
|
|
@@ -28,11 +31,10 @@ const finish = async (code) => {
|
|
|
28
31
|
};
|
|
29
32
|
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
30
33
|
|
|
31
|
-
const MOCKUP = require('./lib/premium-console-type').transform(fs.readFileSync(path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'briefing-artifact.html'), 'utf8'), { faces: false }); // read with the console's type (PM, 2026-10-19), as premium.css is
|
|
32
|
-
const CSS = fs.readFileSync(path.join(__dirname, 'public', 'pm', 'premium.css'), 'utf8');
|
|
33
34
|
const PATH = 'planning/prd/self-serve-v2-prd.md';
|
|
34
35
|
const TEXT = '---\ntype: PRD\ntitle: "Self-serve onboarding v2"\n---\n\n# PRD: Self-serve onboarding v2\n\n## Problem\n\nA partner waits for a person.\n\n## Goal\n\n- a first call without help\n\n## Requirements\n\nR1 a first call\n';
|
|
35
|
-
const
|
|
36
|
+
const AFTER = TEXT.replace('## Goal', '## Summary\n\nPartners reach a first call without help.\n\n## Goal');
|
|
37
|
+
const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'add a one-paragraph summary', at: '2026-10-18T01:00:00Z', hash: 'ha', by: 'agent', why: null, after: AFTER, sections: [
|
|
36
38
|
{ name: 'Summary', kind: 'added', before: '', after: 'Partners reach a first call without help.', current: null, stale: false },
|
|
37
39
|
{ name: 'Goal', kind: 'changed', before: 'x', after: 'y', current: 'z', stale: true }] }, o || {});
|
|
38
40
|
|
|
@@ -71,105 +73,119 @@ const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'ad
|
|
|
71
73
|
if (route === 'ask') { S.ask = { ok: true, id: 'ask-1', state: 'working' }; return send({ ok: true, id: 'ask-1', state: 'working' }); }
|
|
72
74
|
return send({ ok: false, error: 'not in this test' }, 404);
|
|
73
75
|
});
|
|
74
|
-
await page.
|
|
75
|
-
await
|
|
76
|
-
await page.
|
|
77
|
-
await until(() => page.evaluate(() => document.querySelector('
|
|
76
|
+
await page.route('**/api/docs/library*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, kinds: [], files: [{ path: PATH, title: 'Self-serve PRD' }], edges: [] }) }));
|
|
77
|
+
await page.route('**/api/docs?*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, docs: [{ path: PATH, links: [] }] }) }));
|
|
78
|
+
await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&theme=' + theme);
|
|
79
|
+
await until(() => page.evaluate(() => !!document.querySelector('.hm-r[data-id="f:planning/prd/self-serve-v2-prd.md"]')), 15000);
|
|
80
|
+
await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hi-open="docs"]')), 15000);
|
|
81
|
+
if (!(await page.evaluate(() => !!document.querySelector('#hmList [data-hi-open="docs"]').offsetParent))) await page.click('#hmNeeds'); // a phone may show the list in the top bar's sheet
|
|
82
|
+
// the initiative's Core documents group (in place of the Files group, premium-uncovered-features InDocs) opens every document in the Viewer
|
|
83
|
+
await page.click('#hmList [data-hi-open="docs"]');
|
|
84
|
+
await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-ov-open="planning/prd/self-serve-v2-prd.md"]')), 15000);
|
|
85
|
+
await page.click('#czViewer [data-ov-open="planning/prd/self-serve-v2-prd.md"]'); // the PRD opens as a page
|
|
86
|
+
await until(() => page.evaluate(() => document.querySelector('.vwdoc .cf') && document.querySelector('.vwdoc .vwside')));
|
|
78
87
|
return { ctx, page, S };
|
|
79
88
|
};
|
|
80
|
-
const
|
|
81
|
-
const
|
|
89
|
+
const V = '.obody.vw:not([hidden]) .vwdoc';
|
|
90
|
+
const txt = (p, q) => p.evaluate((s) => ((document.querySelector(s) || {}).textContent || '').replace(/\s+/g, ' '), q);
|
|
91
|
+
const side = async (p, k) => { if ((await p.getAttribute(`${V} [data-vd="side:${k}"]`, 'aria-expanded')) !== 'true') await p.click(`${V} [data-vd="side:${k}"]`); await sleep(150); };
|
|
82
92
|
|
|
83
93
|
const A = await open(); const p = A.page;
|
|
84
|
-
ok('0 the
|
|
85
|
-
/* E1
|
|
86
|
-
|
|
87
|
-
ok('E1 the
|
|
88
|
-
ok('E7 the
|
|
94
|
+
ok('0 the document opens as a page in the Viewer', !!(await p.evaluate(() => document.querySelector('#czViewer:not([hidden]) .obody.vw[data-vw="doc:planning/prd/self-serve-v2-prd.md"]'))));
|
|
95
|
+
/* E1 the page's modes and the section under it */
|
|
96
|
+
ok('E1 the page offers Page, Edit and Markdown', await p.evaluate((v) => [...document.querySelectorAll(v + ' .vwseg')].map((b) => b.textContent.trim()).join('|') === 'Page|Edit|Markdown', V));
|
|
97
|
+
ok('E1 under the page are Edit log and Proposals with the open count, marked Waiting for design', await p.evaluate((v) => { const s = document.querySelector(v + ' .vwside'); return !!s && /Waiting for design/.test(s.querySelector('.hx-wait').textContent) && [...s.querySelectorAll('[data-vd^="side:"]')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()).join('|') === 'Edit log|Proposals 1'; }, V));
|
|
98
|
+
ok('E7 the page never says it is read-only', !/Read-only/i.test(await txt(p, V)));
|
|
89
99
|
|
|
90
|
-
/* E2 edit */
|
|
91
|
-
await
|
|
92
|
-
|
|
93
|
-
await p.fill('#dsEd', TEXT + '\nMore.\n');
|
|
94
|
-
ok('E2 a change turns Save on and the note says changed', await p.evaluate(() => !document.querySelector('#dsSave').disabled && /Changed/.test(document.querySelector('#dsNote').textContent)));
|
|
95
|
-
await p.click('#dsSave');
|
|
96
|
-
ok('E2 Save with no reason posts nothing and says why', await p.evaluate(() => /Say why the document changes/.test(document.querySelector('#dsErr').textContent)) && A.S.posts.length === 0);
|
|
97
|
-
ok('E2 the text typed is still there after the refusal', (await p.inputValue('#dsEd')) === TEXT + '\nMore.\n');
|
|
98
|
-
await tab(p, 'read'); await tab(p, 'edit');
|
|
99
|
-
ok('E2 the draft survives a tab switch', (await p.inputValue('#dsEd')) === TEXT + '\nMore.\n');
|
|
100
|
-
await p.fill('#dsWhy', 'add the missing line'); await p.click('#dsSave');
|
|
101
|
-
await until(() => A.S.posts.length);
|
|
102
|
-
const e1 = A.S.posts[0];
|
|
103
|
-
ok('E2 Save posts path, text and why to /api/doc-sheet/edit with the launch headers and the workspace', e1 && e1.route === 'edit' && Object.keys(e1.body).sort().join() === 'path,text,why' && e1.body.path === PATH && e1.body.why === 'add the missing line' && e1.body.text.endsWith('More.\n') && /ws=w1/.test(e1.query) && e1.headers.origin === BASE, JSON.stringify(e1 && { r: e1.route, q: e1.query }));
|
|
104
|
-
/* E5 after a write */
|
|
105
|
-
await until(() => p.evaluate(() => /No changes yet/.test((document.querySelector('#dsNote') || {}).textContent || '')));
|
|
106
|
-
ok('E5 after Save the text is read again from the route and the note says no changes', (await p.inputValue('#dsEd')).endsWith('More.\n') && await p.evaluate(() => document.querySelector('#dsSave').disabled));
|
|
107
|
-
await tab(p, 'log');
|
|
108
|
-
ok('E5 the Edit log shows the new revision with its reason', await until(() => p.evaluate(() => /v2 add the missing line/.test((document.querySelector('#oMain .evl') || {}).textContent || ''))));
|
|
109
|
-
|
|
110
|
-
/* E3 + E4 proposals */
|
|
111
|
-
await tab(p, 'props');
|
|
112
|
-
const pv = await until(() => p.evaluate(() => document.querySelector('.dsp') && { n: document.querySelectorAll('.dsp').length, t: document.querySelector('.dsp').textContent.replace(/\s+/g, ' '), acc: !!document.querySelector('[data-ds^="acc:"]'), rej: !!document.querySelector('[data-ds^="rej:"]'), stale: /Changed since this was proposed/.test(document.querySelector('.dsp').textContent), head: document.querySelector('#oMain .label:nth-of-type(2)') ? '' : '' }));
|
|
113
|
-
ok('E4 an open proposal names who, the request, the added text, and a stale section says so', pv && /The agent/.test(pv.t) && /add a one-paragraph summary/.test(pv.t) && /\+ Partners reach a first call/.test(pv.t) && pv.stale && pv.acc && pv.rej, JSON.stringify(pv));
|
|
114
|
-
ok('E4 the lists say how many are open and closed', await p.evaluate(() => /Open proposals · 1/.test(document.querySelector('#oMain').textContent) && !/Closed ·/.test(document.querySelector('#oMain').textContent)));
|
|
115
|
-
const nAcc = A.S.posts.length;
|
|
116
|
-
await p.click('[data-ds^="acc:"]');
|
|
117
|
-
await until(() => A.S.posts.length > nAcc);
|
|
118
|
-
const ac = A.S.posts[A.S.posts.length - 1];
|
|
119
|
-
ok('E4 Accept posts path, id, hash and only the sections still current', ac.route === 'accept' && Object.keys(ac.body).sort().join() === 'hash,id,path,sections' && ac.body.hash === 'ha' && ac.body.sections.join() === 'Summary', JSON.stringify(ac.body));
|
|
120
|
-
await until(() => p.evaluate(() => /Closed · 1/.test(document.querySelector('#oMain').textContent)));
|
|
121
|
-
ok('E5 after Accept the proposal is listed as closed and accepted, and none is open', await p.evaluate(() => /Open proposals · 0/.test(document.querySelector('#oMain').textContent) && /Accepted/.test(document.querySelector('.dsp.accepted').textContent) && /No open proposals/.test(document.querySelector('#oMain').textContent)));
|
|
122
|
-
if (!(await p.$('#shT [data-sh]'))) await p.click('#shV'); ok('E5 the Proposals count is gone from the menu once none is open', await p.evaluate(() => document.querySelector('#shT [data-sh="props"]').textContent.trim() === 'Proposals'));
|
|
100
|
+
/* E2 edit (the file as Markdown; editing in place is in premium-vw-doc-test.js) */
|
|
101
|
+
ok('E2 while a proposal is open, Edit and Markdown are locked until it is kept or undone', await p.evaluate((v) => [...document.querySelectorAll(v + ' .vwseg')].filter((b) => b.disabled).length === 2, V));
|
|
102
|
+
A.S.posts.length = 0;
|
|
123
103
|
await A.ctx.close();
|
|
124
104
|
|
|
125
|
-
/* E4 stale-all, reject, ask */
|
|
126
105
|
{
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
ok('
|
|
130
|
-
ok('
|
|
131
|
-
await q.click(
|
|
132
|
-
ok('
|
|
133
|
-
await q.click(
|
|
134
|
-
ok('
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
await q.fill(
|
|
141
|
-
|
|
106
|
+
const E = await open({ props: [] }); const q = E.page;
|
|
107
|
+
ok('E1 with no open proposal the count is gone from Proposals', await q.evaluate((v) => document.querySelector(v + ' [data-vd="side:props"]').textContent.trim() === 'Proposals', V));
|
|
108
|
+
ok('E7 the save row says the reason is kept in the Edit log', await (async () => { await q.click(`${V} [data-vd="mode:md"]`); return /Kept in the Edit log/.test(await q.getAttribute(`${V} #vwWhy`, 'placeholder')); })());
|
|
109
|
+
ok('E2 Markdown holds the file as text, with a reason box and Save', (await q.inputValue(`${V} #vwMd`)) === TEXT && !!(await q.$(`${V} #vwWhy`)) && /Save as v2/.test(await txt(q, `${V} .vwsave`)));
|
|
110
|
+
await q.fill(`${V} #vwWhy`, 'add the missing line'); await q.click(`${V} [data-vd="save"]`);
|
|
111
|
+
ok('E2 Save with no change posts nothing and says so', /Nothing has changed yet/.test(await txt(q, `${V} #vwErr`)) && E.S.posts.length === 0);
|
|
112
|
+
await q.fill(`${V} #vwMd`, TEXT + '\nMore.\n'); await q.fill(`${V} #vwWhy`, ''); await q.click(`${V} [data-vd="save"]`);
|
|
113
|
+
ok('E2 Save with no reason posts nothing and says why', /Say why the document changes/.test(await txt(q, `${V} #vwErr`)) && E.S.posts.length === 0);
|
|
114
|
+
ok('E2 the text typed is still there after the refusal', (await q.inputValue(`${V} #vwMd`)) === TEXT + '\nMore.\n');
|
|
115
|
+
await q.click(`${V} [data-vd="mode:read"]`);
|
|
116
|
+
ok('E2 the page says there are changes not saved yet', /not saved yet/.test(await txt(q, V)));
|
|
117
|
+
await q.click(`${V} [data-vd="mode:md"]`);
|
|
118
|
+
ok('E2 the draft survives a mode switch', (await q.inputValue(`${V} #vwMd`)) === TEXT + '\nMore.\n');
|
|
119
|
+
await q.fill(`${V} #vwWhy`, 'add the missing line'); await q.click(`${V} [data-vd="save"]`);
|
|
120
|
+
await until(() => E.S.posts.length);
|
|
121
|
+
const e1 = E.S.posts[0];
|
|
122
|
+
ok('E2 Save posts path, text and why to /api/doc-sheet/edit with the launch headers and the workspace', e1 && e1.route === 'edit' && Object.keys(e1.body).sort().join() === 'path,text,why' && e1.body.path === PATH && e1.body.why === 'add the missing line' && e1.body.text.endsWith('More.\n') && /ws=w1/.test(e1.query) && e1.headers.origin === BASE, JSON.stringify(e1 && { r: e1.route, q: e1.query }));
|
|
123
|
+
/* E5 after a write */
|
|
124
|
+
await until(() => q.evaluate((v) => !document.querySelector(v + ' #vwMd') && /v2/.test((document.querySelector(v + ' .cff') || {}).textContent || ''), V));
|
|
125
|
+
ok('E5 after Save the page is read again from the route and shows v2', /v2/.test(await txt(q, `${V} .cff`)) && /More\./.test(await txt(q, `${V} .cfb`)));
|
|
126
|
+
await side(q, 'log');
|
|
127
|
+
ok('E5 the Edit log shows the new revision with its reason', await until(() => q.evaluate((v) => /v2 add the missing line/.test((document.querySelector(v + ' .vwside .evl') || {}).textContent || ''), V)));
|
|
128
|
+
/* E3 ask */
|
|
129
|
+
await q.click(`${V} [data-vd="askt"]`); await q.fill(`${V} #vwAsk`, 'tighten the goal'); const nA = E.S.posts.length; await q.click(`${V} [data-vd="ask"]`); await until(() => E.S.posts.length > nA);
|
|
130
|
+
const ak = E.S.posts[E.S.posts.length - 1];
|
|
142
131
|
ok('E3 Ask posts path and prompt to /api/doc-sheet/ask', ak.route === 'ask' && Object.keys(ak.body).sort().join() === 'path,prompt' && ak.body.prompt === 'tighten the goal' && /ws=w1/.test(ak.query));
|
|
143
|
-
ok('E3 while it works the
|
|
144
|
-
ok('E3 the page polls the ask by id', await until(() =>
|
|
145
|
-
|
|
146
|
-
ok('E3 a failed ask shows the route\'s own error', await until(() => q.evaluate(() => /The run ended without an answer/.test(document.querySelector(
|
|
132
|
+
ok('E3 while it works the page says the agent can only read', await until(() => q.evaluate((v) => /The agent is reading the document/.test(document.querySelector(v).textContent), V)));
|
|
133
|
+
ok('E3 the page polls the ask by id', await until(() => E.S.gets.some((g) => g.route === 'ask' && /id=ask-1/.test(g.query)), 8000));
|
|
134
|
+
E.S.ask = { ok: true, id: 'ask-1', state: 'failed', error: 'The run ended without an answer. Ask again.' };
|
|
135
|
+
ok('E3 a failed ask shows the route\'s own error', await until(() => q.evaluate((v) => /The run ended without an answer/.test(document.querySelector(v).textContent), V), 8000));
|
|
136
|
+
ok('0 no page error', E.S.errors.length === 0, E.S.errors.join(' | '));
|
|
137
|
+
await E.ctx.close();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* E4 proposals: accept */
|
|
141
|
+
{
|
|
142
|
+
const B = await open(); const q = B.page;
|
|
143
|
+
await side(q, 'props');
|
|
144
|
+
const pv = await q.evaluate((v) => { const d = document.querySelector(v + ' .vwprop'); return d && { t: d.textContent.replace(/\s+/g, ' '), acc: !!d.querySelector('[data-vd^="pacc:"]'), rej: !!d.querySelector('[data-vd^="prej:"]') }; }, V);
|
|
145
|
+
ok('E4 an open proposal names who, the request, the added text, and a stale section says so', pv && /The agent/.test(pv.t) && /add a one-paragraph summary/.test(pv.t) && /\+ Partners reach a first call/.test(pv.t) && /Changed since this was proposed/.test(pv.t) && pv.acc && pv.rej, JSON.stringify(pv));
|
|
146
|
+
ok('E4 the lists say how many are open and closed', /Open proposals · 1/.test(await txt(q, `${V} .vwside`)) && !/Closed ·/.test(await txt(q, `${V} .vwside`)));
|
|
147
|
+
await q.click(`${V} [data-vd^="pacc:"]`);
|
|
148
|
+
await until(() => B.S.posts.length);
|
|
149
|
+
const ac = B.S.posts[B.S.posts.length - 1];
|
|
150
|
+
ok('E4 Accept posts path, id, hash and only the sections still current', ac.route === 'accept' && Object.keys(ac.body).sort().join() === 'hash,id,path,sections' && ac.body.hash === 'ha' && ac.body.sections.join() === 'Summary', JSON.stringify(ac.body));
|
|
151
|
+
await until(() => q.evaluate((v) => /Closed · 1/.test((document.querySelector(v + ' .vwside') || {}).textContent || ''), V));
|
|
152
|
+
ok('E5 after Accept the proposal is listed as closed and accepted, and none is open', await q.evaluate((v) => { const t = document.querySelector(v + ' .vwside').textContent; return /Open proposals · 0/.test(t) && /Accepted/.test(document.querySelector(v + ' .vwprop.accepted').textContent) && /No open proposals/.test(t); }, V));
|
|
153
|
+
ok('E5 the Proposals count is gone once none is open', await q.evaluate((v) => document.querySelector(v + ' [data-vd="side:props"]').textContent.trim() === 'Proposals', V));
|
|
154
|
+
await B.ctx.close();
|
|
155
|
+
}
|
|
156
|
+
/* E4 stale-all, removed, reject */
|
|
157
|
+
{
|
|
158
|
+
const B = await open({ props: [prop({ sections: [{ name: 'Goal', kind: 'changed', before: 'x', after: 'y', current: 'z', stale: true }] }), prop({ id: 'prop-b', hash: 'hb', prompt: 'drop the requirements', after: TEXT.replace(/## Requirements[\s\S]*$/, ''), sections: [{ name: 'Requirements', kind: 'removed', before: 'R1', after: '', current: 'R1', stale: false }] })] });
|
|
159
|
+
const q = B.page; await side(q, 'props');
|
|
160
|
+
ok('E4 a proposal whose every section is stale has no Accept and says so', await q.evaluate((v) => { const d = document.querySelector(v + ' .vwprop[data-prop="prop-a"]'); return d && !d.querySelector('[data-vd^="pacc:"]') && !!d.querySelector('[data-vd^="prej:"]') && /cannot be accepted/.test(d.textContent); }, V));
|
|
161
|
+
ok('E4 a removed section says it removes', /Removes this section/.test(await txt(q, `${V} .vwside`)));
|
|
162
|
+
await q.click(`${V} [data-vd="prej:prop-b"]`);
|
|
163
|
+
ok('E4 Reject asks for a reason first and posts nothing yet', !!(await q.$(`${V} #vwRj`)) && B.S.posts.length === 0);
|
|
164
|
+
await q.click(`${V} [data-vd="prejgo:prop-b"]`);
|
|
165
|
+
ok('E4 Reject with no reason is refused with no post', /Say why you are rejecting it/.test(await txt(q, `${V} #vwSideErr`)) && B.S.posts.length === 0);
|
|
166
|
+
await q.fill(`${V} #vwRj`, 'not needed'); await q.click(`${V} [data-vd="prejgo:prop-b"]`); await until(() => B.S.posts.length);
|
|
167
|
+
ok('E4 Reject posts path, id and why only', B.S.posts[0].route === 'reject' && Object.keys(B.S.posts[0].body).sort().join() === 'id,path,why' && B.S.posts[0].body.why === 'not needed');
|
|
168
|
+
await until(() => q.evaluate((v) => /Closed · 1/.test((document.querySelector(v + ' .vwside') || {}).textContent || ''), V));
|
|
169
|
+
ok('E5 the rejected proposal is closed with its reason', await q.evaluate((v) => { const d = document.querySelector(v + ' .vwprop.rejected'); return !!d && /Rejected/.test(d.textContent) && /not needed/.test(d.textContent); }, V));
|
|
147
170
|
ok('0 no page error', B.S.errors.length === 0, B.S.errors.join(' | '));
|
|
148
171
|
await B.ctx.close();
|
|
149
172
|
}
|
|
150
173
|
/* E5/E4 a refused accept shows the route's reason and reads again */
|
|
151
174
|
{
|
|
152
175
|
const C = await open({ post: (route) => (route === 'accept' ? { status: 409, body: { ok: false, error: 'stale: Summary changed since this proposal was made', reason: 'stale' } } : null) });
|
|
153
|
-
await
|
|
154
|
-
ok('E4 a refused Accept shows the route\'s reason and the proposal stays open', await until(() => C.page.evaluate(() => /stale: Summary changed since this proposal was made/.test((document.querySelector('#
|
|
176
|
+
await side(C.page, 'props'); await C.page.click(`${V} [data-vd^="pacc:"]`);
|
|
177
|
+
ok('E4 a refused Accept shows the route\'s reason and the proposal stays open', await until(() => C.page.evaluate((v) => /stale: Summary changed since this proposal was made/.test((document.querySelector(v + ' #vwSideErr') || {}).textContent || '') && /Open proposals · 1/.test(document.querySelector(v + ' .vwside').textContent), V)));
|
|
155
178
|
await C.ctx.close();
|
|
156
179
|
}
|
|
157
|
-
/* the
|
|
158
|
-
/* E8 fidelity: the page's rules for the new elements equal the mockup's last rule for each class */
|
|
159
|
-
const rule = (src, sel) => { const m = [...src.matchAll(new RegExp('(?:^|[}\\n])\\s*' + sel.replace(/[.#]/g, (c) => '\\' + c) + '\\{([^}]*)\\}', 'g'))].filter((x) => sel !== '.dsfoot' || /justify-content/.test(x[1])); return m.length ? m[m.length - 1][1].replace('border-radius:0 0 14px 14px', 'border-radius:14px').replace(/#6d3fd1/g, 'rgb(109,63,209)').replace(/\s+/g, '') : null; };
|
|
160
|
-
for (const sel of ['.dsed', '.dsy', '.dsfoot', '.dsdf', '#dsAsk']) {
|
|
161
|
-
const a = rule(MOCKUP, sel), b = rule(CSS, sel);
|
|
162
|
-
ok(`E8 ${sel} has the mockup's declarations`, a && b && b.replace(/;$/, '') === a.replace(/;$/, ''), JSON.stringify({ a, b }));
|
|
163
|
-
}
|
|
180
|
+
/* E8 the Agreed design's tokens and the floors: the section uses the cozy marker and the viewer's own controls, at desktop and phone, light and dark */
|
|
164
181
|
for (const [w, h, theme] of [[1280, 900, 'light'], [1280, 900, 'dark'], [390, 844, 'light'], [390, 844, 'dark']]) {
|
|
165
182
|
const R = await open({ w, h, theme });
|
|
166
|
-
for (const t of ['
|
|
167
|
-
await
|
|
168
|
-
|
|
169
|
-
|
|
183
|
+
for (const t of ['log', 'props']) {
|
|
184
|
+
await side(R.page, t);
|
|
185
|
+
if (t === 'props') await R.page.click(`${V} [data-vd="prej:prop-a"]`);
|
|
186
|
+
const f = await R.page.evaluate(([v, phone]) => { const bad = []; const root = document.querySelector(v + ' .vwside'); for (const e of root.querySelectorAll('button,input,textarea')) { const r = e.getBoundingClientRect(); if (r.width && r.height && r.height < (phone ? 44 : 32)) bad.push(e.textContent.trim() || e.id); } return { sx: document.documentElement.scrollWidth - innerWidth, bad, out: [...root.querySelectorAll('.vwprop,input,button')].filter((e) => e.getBoundingClientRect().right > innerWidth + 1).length, wait: getComputedStyle(root.querySelector('.hx-wait')).borderRadius }; }, [V, w < 761]);
|
|
187
|
+
ok(`E8 ${t} at ${w} px ${theme}: no sideways scroll, no small target, nothing past the edge, the cozy marker`, f.sx <= 0 && f.bad.length === 0 && f.out === 0 && f.wait !== '0px', JSON.stringify(f));
|
|
170
188
|
}
|
|
171
|
-
const cs = await R.page.evaluate(() => { const e = document.querySelector('#dsAsk'); const c = getComputedStyle(e); return { r: c.borderRadius, fs: c.fontSize }; });
|
|
172
|
-
ok(`E8 the ask box is 14px rounded, 14px type (the console's body size) at ${w} px ${theme}`, cs.r === '14px' && cs.fs === '14px', JSON.stringify(cs));
|
|
173
189
|
await R.ctx.close();
|
|
174
190
|
}
|
|
175
191
|
finish();
|