create-pmos 0.469.0 → 0.471.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 +27 -27
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-publish-ui-test.js +161 -0
- package/workspace/board-shared-ui-test.js +155 -0
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/changelog.json +26 -0
- package/workspace/guide/published-board.md +51 -3
- package/workspace/lib/board-publish-choices.js +25 -0
- package/workspace/lib/boards-host.js +20 -4
- package/workspace/lib/boards-teams.js +99 -0
- package/workspace/lib/routes-board-publish.js +44 -7
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-publish.css +44 -0
- package/workspace/public/pm/bd-publish.js +152 -0
- package/workspace/public/pm/bd-shared.css +31 -0
- package/workspace/public/pm/bd-shared.js +153 -0
- package/workspace/public/pm/premium-board.js +16 -4
- package/workspace/public/pm/readonly.js +1 -1
- package/workspace/public/premium-board.html +3 -0
- package/workspace/test-lists/board-publish-b.json +4 -2
- package/workspace/test-lists/board-publish-d.json +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.471.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -32,6 +32,32 @@
|
|
|
32
32
|
"audit"
|
|
33
33
|
],
|
|
34
34
|
"pmosChanges": [
|
|
35
|
+
{
|
|
36
|
+
"v": "0.471.0",
|
|
37
|
+
"at": "2026-10-31T13:21:46.914Z",
|
|
38
|
+
"f": 3,
|
|
39
|
+
"prs": [
|
|
40
|
+
{
|
|
41
|
+
"n": 1124,
|
|
42
|
+
"t": "The Shared tab on the Board — join a team, read its boards, open one (board-publish slice 4)",
|
|
43
|
+
"s": "The Shared tab on the Board — join a team, read its boards, open one (board-publish slice 4)",
|
|
44
|
+
"k": "new"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"v": "0.470.0",
|
|
50
|
+
"at": "2026-10-31T12:11:04.375Z",
|
|
51
|
+
"f": 3,
|
|
52
|
+
"prs": [
|
|
53
|
+
{
|
|
54
|
+
"n": 1123,
|
|
55
|
+
"t": "The Publish popover on the Board (board-publish slice 2, page side)",
|
|
56
|
+
"s": "The Publish popover on the Board (board-publish slice 2, page side)",
|
|
57
|
+
"k": "new"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
35
61
|
{
|
|
36
62
|
"v": "0.469.0",
|
|
37
63
|
"at": "2026-10-31T10:43:44.457Z",
|
|
@@ -271,32 +297,6 @@
|
|
|
271
297
|
"k": "new"
|
|
272
298
|
}
|
|
273
299
|
]
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
"v": "0.451.0",
|
|
277
|
-
"at": "2026-10-29T08:45:28.582Z",
|
|
278
|
-
"f": 3,
|
|
279
|
-
"prs": [
|
|
280
|
-
{
|
|
281
|
-
"n": 1097,
|
|
282
|
-
"t": "Catch up to Claude Code 2.1.312",
|
|
283
|
-
"s": "Catch up to Claude Code 2.1.312",
|
|
284
|
-
"k": "x"
|
|
285
|
-
}
|
|
286
|
-
]
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
"v": "0.450.0",
|
|
290
|
-
"at": "2026-10-29T08:38:00.644Z",
|
|
291
|
-
"f": 3,
|
|
292
|
-
"prs": [
|
|
293
|
-
{
|
|
294
|
-
"n": 1096,
|
|
295
|
-
"t": "Grill runs go to the Claude API; --changed narrows further",
|
|
296
|
-
"s": "Grill runs go to the Claude API; --changed narrows further",
|
|
297
|
-
"k": "new"
|
|
298
|
-
}
|
|
299
|
-
]
|
|
300
300
|
}
|
|
301
301
|
]
|
|
302
302
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-31T13:21:43Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-31T13:21:43Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-31T13:21:43Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* board-publish-ui — the Publish popover on the Board (initiative board-publish, slice 2, page side; planning/prd/board-publish-prd.md P1 to P5; design
|
|
4
|
+
* prototype/board-publish/publish-popover-design.html). Serves the real page from the real server. The Board's model and the workspace's /api/board-publish
|
|
5
|
+
* and /api/settings answers are served by the test (the server side is tested in board-publish-host.test.js), so each press is checked on what the page SENDS.
|
|
6
|
+
* A the button: one board only, never in the read-only Board, a count only when there are open links · B no host: the address is asked in place ·
|
|
7
|
+
* C the form: chips, the initiative picker, password, ends · D publish: what is sent, working, the link ready, Done · E problems · F open links ·
|
|
8
|
+
* G a phone: a sheet, no sideways scroll · H Escape and a press outside close it */
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const { spawn } = require('child_process');
|
|
11
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
12
|
+
const T = require('./test-run').configure({ name: 'board-publish-ui' });
|
|
13
|
+
const BP = require('./lib/board-premium.js');
|
|
14
|
+
const F = require('./fixtures/board-premium-facts.js');
|
|
15
|
+
const Pack = require('./lib/board-pack.js');
|
|
16
|
+
|
|
17
|
+
let n = 0; let bad = 0;
|
|
18
|
+
const ok = (name, cond, extra = '') => { n++; if (!cond) bad++; console.log(`${cond ? ' ✓' : ' ✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 300) : ''}`); };
|
|
19
|
+
|
|
20
|
+
(async () => {
|
|
21
|
+
const { chromium } = require('playwright-core');
|
|
22
|
+
const srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
23
|
+
const finish = async (browser, code) => { try { if (browser) await browser.close(); } catch { /* gone */ } try { srv.kill('SIGKILL'); } catch { /* gone */ } T.killTmux(); console.log(`\n${n - bad}/${n} board-publish-ui assertions passed`); process.exit(code !== undefined ? code : (bad ? 1 : 0)); };
|
|
24
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(null, 1); });
|
|
25
|
+
await T.waitForServer(T.BASE);
|
|
26
|
+
const browser = await chromium.launch({ executablePath: findBrowser() });
|
|
27
|
+
|
|
28
|
+
const model = BP.build(F.programFacts('idpf'));
|
|
29
|
+
const BOARD = '/api/board-premium?ws=idpf&board=idpf';
|
|
30
|
+
const LINKS = [{ id: 'link00000001abcdefgh', url: 'https://boards.test/b/link00000001abcdefgh', team: 'Product', name: 'IDPF', kind: 'product', made: '2026-10-31T10:00:00Z', ends: new Date(Date.now() + 6 * 86400000).toISOString(), views: 3 },
|
|
31
|
+
{ id: 'link00000002abcdefgh', url: 'https://boards.test/b/link00000002abcdefgh', team: '', name: 'Project Ascent', kind: 'program', made: '2026-10-30T10:00:00Z', ends: new Date(Date.now() + 20 * 3600000).toISOString(), views: 1 }];
|
|
32
|
+
// the workspace's answers, set by each section
|
|
33
|
+
const W = { host: 'boards.test', links: [], posts: [], settings: [], publish: null, settingsAnswer: null };
|
|
34
|
+
const open = async (w, h, url, init) => {
|
|
35
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
36
|
+
const reqs = []; ctx.on('request', (r) => reqs.push({ m: r.method(), u: r.url().replace(T.BASE, '') }));
|
|
37
|
+
await ctx.route((u) => /\/api\/board-premium/.test(u.toString()), (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model, as_of: 1 }) }));
|
|
38
|
+
await ctx.route((u) => new URL(u).pathname === '/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: F.programs() }) }));
|
|
39
|
+
await ctx.route((u) => new URL(u).pathname === '/api/board-publish', (r) => {
|
|
40
|
+
if (r.request().method() === 'GET') return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, host: W.host, days: [1, 7, 30], password: 'harbor-lime-47', links: W.links,
|
|
41
|
+
choices: { products: [{ id: 'idpf', label: 'IDPF' }], programs: [{ id: 'project-ascent', label: 'Project Ascent' }], initiatives: (model.rows || []).filter((x) => x.id).slice(0, 3).map((x) => ({ id: x.id, label: x.title || x.id })) } }) });
|
|
42
|
+
const body = JSON.parse(r.request().postData() || '{}'); W.posts.push({ p: '/api/board-publish', body });
|
|
43
|
+
return r.fulfill({ status: W.publish ? W.publish.status : 200, contentType: 'application/json', body: JSON.stringify(W.publish ? W.publish.body : { ok: true, id: 'link00000003abcdefgh', url: 'https://boards.test/b/link00000003abcdefgh', ends: new Date(Date.now() + 7 * 86400000).toISOString() }) });
|
|
44
|
+
});
|
|
45
|
+
await ctx.route((u) => /\/api\/board-publish\/(republish|off)$/.test(new URL(u).pathname), (r) => { W.posts.push({ p: new URL(r.request().url()).pathname, body: JSON.parse(r.request().postData() || '{}') }); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, ends: LINKS[0].ends }) }); });
|
|
46
|
+
await ctx.route((u) => new URL(u).pathname === '/api/board-publish/host', (r) => { const b = JSON.parse(r.request().postData() || '{}'); W.settings.push({ key: 'boards.host', value: b.host }); r.fulfill({ contentType: 'application/json', status: W.settingsAnswer ? 400 : 200, body: JSON.stringify(W.settingsAnswer || { ok: true, host: b.host }) }); });
|
|
47
|
+
const errs = []; const p = await ctx.newPage(); p.on('pageerror', (e) => errs.push(e.message));
|
|
48
|
+
await p.addInitScript(() => { try { localStorage.setItem('pmos.board.view', 'time'); localStorage.setItem('pmos.board.grouping', 'program'); } catch (e) { /* none */ } });
|
|
49
|
+
await p.goto(T.BASE + url); await p.waitForSelector('.tg-n.ini2', { timeout: 15000 }).catch(() => {}); await p.waitForTimeout(500);
|
|
50
|
+
return { ctx, p, reqs, errs };
|
|
51
|
+
};
|
|
52
|
+
const pop = (p) => p.locator('.bppop');
|
|
53
|
+
|
|
54
|
+
console.log('A the button');
|
|
55
|
+
W.links = []; W.host = 'boards.test';
|
|
56
|
+
let s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf');
|
|
57
|
+
ok('A1 the Publish button is drawn on a single board, with a label that says what it does', await s.p.locator('#bdPublish').isVisible() && /Publish a read-only copy/.test(await s.p.locator('#bdPublish').getAttribute('aria-label')));
|
|
58
|
+
ok('A2 with no open links there is no count (zero is silence)', await s.p.locator('#bdPublish .bpn').isHidden());
|
|
59
|
+
await s.ctx.close();
|
|
60
|
+
W.links = LINKS; s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.waitForTimeout(600);
|
|
61
|
+
ok('A3 with open links the button shows how many, and the label says so', (await s.p.locator('#bdPublish .bpn').textContent()) === '2' && /2 open links/.test(await s.p.locator('#bdPublish').getAttribute('aria-label')), await s.p.locator('#bdPublish').getAttribute('aria-label'));
|
|
62
|
+
await s.ctx.close();
|
|
63
|
+
s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf&all=1');
|
|
64
|
+
ok('A4 the All products page does not draw it', await s.p.locator('#bdPublish').isHidden());
|
|
65
|
+
await s.ctx.close();
|
|
66
|
+
{
|
|
67
|
+
const pack = Pack.buildPack({ ws: 'idpf', board: 'idpf', selection: [{ kind: 'product', id: 'idpf' }], meta: { by: 'W', at: 'x', ends: 'y', viewer: 'test' }, answers: { [BOARD]: { ok: true, state: 'ready', model, as_of: 1 }, '/api/programs': { ok: true, programs: F.programs() } } });
|
|
68
|
+
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } }); const reqs = []; ctx.on('request', (r) => reqs.push(new URL(r.url()).pathname));
|
|
69
|
+
await ctx.route((u) => new URL(u).pathname === '/__pack/p.json', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(pack) }));
|
|
70
|
+
const p = await ctx.newPage(); await p.goto(T.BASE + '/premium-board.html?ws=idpf&board=idpf&pack=/__pack/p.json'); await p.waitForSelector('.tg-n.ini2', { timeout: 15000 }).catch(() => {}); await p.waitForTimeout(600);
|
|
71
|
+
ok('A5 the read-only Board does not draw it and asks nothing of /api/board-publish', (await p.locator('#bdPublish').isHidden()) && !reqs.some((u) => /board-publish/.test(u)), reqs.filter((u) => /board-publish/.test(u)).join(','));
|
|
72
|
+
await ctx.close();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
console.log('B no host');
|
|
76
|
+
W.links = []; W.host = null; W.settings = []; W.settingsAnswer = null;
|
|
77
|
+
s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.click('#bdPublish'); await s.p.waitForSelector('#bpHost');
|
|
78
|
+
ok('B1 with no host the popover says what is needed and asks for the address in place, with no Publish button', /needs a board host/.test(await pop(s.p).textContent()) && await s.p.locator('#bpHost').isVisible() && (await pop(s.p).locator('[data-bp="make"]').count()) === 0);
|
|
79
|
+
W.settingsAnswer = { ok: false, error: 'Use an https address with no path, such as https://boards.example.com.' };
|
|
80
|
+
await s.p.fill('#bpHost', 'http://example.com'); await s.p.click('[data-bp="savehost"]'); await s.p.waitForSelector('.bperr');
|
|
81
|
+
ok('B2 a refused address shows the sentence and keeps what was typed', /https address/.test(await s.p.locator('.bperr').textContent()) && (await s.p.inputValue('#bpHost')) === 'http://example.com');
|
|
82
|
+
W.settingsAnswer = null; W.host = 'boards.test';
|
|
83
|
+
await s.p.fill('#bpHost', 'https://boards.test'); await s.p.click('[data-bp="savehost"]'); await s.p.waitForSelector('[data-bp="make"]', { timeout: 5000 });
|
|
84
|
+
ok('B3 a saved address is sent to the host route and the form shows', W.settings.some((x) => x.key === 'boards.host' && x.value === 'https://boards.test'));
|
|
85
|
+
await s.p.click('[data-bp="changehost"]'); await s.p.waitForSelector('#bpHost');
|
|
86
|
+
ok('B4 the Change button on the form asks for the address again', (await pop(s.p).locator('[data-bp="make"]').count()) === 0);
|
|
87
|
+
await s.ctx.close();
|
|
88
|
+
|
|
89
|
+
console.log('C the form');
|
|
90
|
+
W.links = []; W.host = 'boards.test'; W.posts = [];
|
|
91
|
+
s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.click('#bdPublish'); await s.p.waitForSelector('[data-bp="make"]');
|
|
92
|
+
ok('C1 the board\'s product is picked, its programs are offered, and the note names the host and what leaves', (await s.p.locator('[data-bp-sel="product:idpf"]').getAttribute('aria-pressed')) === 'true' && (await s.p.locator('[data-bp-sel="program:project-ascent"]').getAttribute('aria-pressed')) === 'false' && /boards\.test/.test(await s.p.locator('.bpnote').first().textContent()) && /titles, stages, dates, owners and task names/.test(await pop(s.p).textContent()));
|
|
93
|
+
ok('C2 the password is on with a generated one, and Ends is 7 days', (await s.p.locator('[data-bp="pw"]').getAttribute('aria-checked')) === 'true' && (await s.p.inputValue('#bpPass')) === 'harbor-lime-47' && (await s.p.locator('[data-bp-days="7"]').getAttribute('aria-pressed')) === 'true');
|
|
94
|
+
await s.p.click('[data-bp-sel="product:idpf"]');
|
|
95
|
+
ok('C3 with nothing picked Publish cannot be pressed', await s.p.locator('[data-bp="make"]').isDisabled());
|
|
96
|
+
await s.p.click('[data-bp="ini"]'); const first = await s.p.locator('[data-bp-add]').first().getAttribute('data-bp-add'); await s.p.click('[data-bp-add]');
|
|
97
|
+
ok('C4 the initiative picker adds a chip for the initiative picked', (await s.p.locator('[data-bp-sel="initiative:' + first + '"]').getAttribute('aria-pressed')) === 'true' && !(await s.p.locator('.bpmenu').count()));
|
|
98
|
+
await s.p.click('[data-bp="pw"]');
|
|
99
|
+
ok('C5 turning the password off removes its field', (await s.p.locator('#bpPass').count()) === 0 && (await s.p.locator('[data-bp="pw"]').getAttribute('aria-checked')) === 'false');
|
|
100
|
+
await s.p.click('[data-bp="pw"]'); await s.p.click('[data-bp="newpw"]');
|
|
101
|
+
ok('C6 New asks for another generated password', (await s.p.inputValue('#bpPass')).length > 0);
|
|
102
|
+
|
|
103
|
+
console.log('D publish');
|
|
104
|
+
await s.p.click('[data-bp-sel="program:project-ascent"]'); await s.p.fill('#bpTeam', 'Product'); await s.p.click('[data-bp-days="30"]'); await s.p.fill('#bpPass', 'my-own-password-1');
|
|
105
|
+
await s.p.click('[data-bp="make"]'); await s.p.waitForSelector('[data-bp="copy"]');
|
|
106
|
+
const sent = W.posts[0] && W.posts[0].body;
|
|
107
|
+
ok('D1 a press sends what was picked, the team, the typed password and the days', sent && sent.ws === 'idpf' && sent.team === 'Product' && sent.password === 'my-own-password-1' && sent.days === 30 && sent.select.some((x) => x.kind === 'program' && x.id === 'project-ascent') && sent.select.some((x) => x.kind === 'initiative' && x.id === first), JSON.stringify(sent));
|
|
108
|
+
const t = await pop(s.p).textContent();
|
|
109
|
+
ok('D2 the link is ready: the link, the password once, one Copy button, and the note says it is shown once', /boards\.test\/b\/link00000003/.test(t) && /my-own-password-1/.test(t) && /Copy link and password/.test(t) && /only time it is shown/.test(t) && /for the Product team/.test(t));
|
|
110
|
+
await s.ctx.grantPermissions(['clipboard-read', 'clipboard-write']).catch(() => {});
|
|
111
|
+
await s.p.click('[data-bp="copy"]'); await s.p.waitForTimeout(300);
|
|
112
|
+
ok('D3 Copy says it copied (or says how to copy by hand)', /Copied|Select the text/.test(await s.p.locator('.bpok').textContent()));
|
|
113
|
+
await s.p.click('[data-bp="done"]'); await s.p.waitForSelector('[data-bp="make"]');
|
|
114
|
+
ok('D4 Done returns to the form with a new generated password', (await s.p.locator('#bpPass').count()) === 1);
|
|
115
|
+
await s.p.click('[data-bp="pw"]'); await s.p.click('[data-bp="make"]'); await s.p.waitForSelector('[data-bp="copy"]');
|
|
116
|
+
ok('D5 with the password off the request carries none, and the page shows only the link', W.posts[W.posts.length - 1].body.password === '' && !/Copy link and password/.test(await pop(s.p).textContent()) && /Copy link/.test(await pop(s.p).textContent()));
|
|
117
|
+
await s.ctx.close();
|
|
118
|
+
|
|
119
|
+
console.log('E problems');
|
|
120
|
+
W.links = []; s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.click('#bdPublish'); await s.p.waitForSelector('[data-bp="make"]');
|
|
121
|
+
W.publish = { status: 422, body: { ok: false, error: 'This board holds what looks like a secret (aws-access-key). Remove it, then publish again.', secrets: ['aws-access-key'] } };
|
|
122
|
+
await s.p.fill('#bpTeam', 'Product'); await s.p.click('[data-bp="make"]'); await s.p.waitForSelector('.bperr');
|
|
123
|
+
ok('E1 a refusal shows the plain sentence and the form stays filled', /aws-access-key/.test(await s.p.locator('.bperr').textContent()) && (await s.p.inputValue('#bpTeam')) === 'Product' && await s.p.locator('[data-bp-sel="product:idpf"]').isVisible());
|
|
124
|
+
W.publish = { status: 429, body: { ok: false, error: 'You have 20 open links. Turn one off first.' } };
|
|
125
|
+
await s.p.click('[data-bp="make"]'); await s.p.waitForFunction(() => /20 open links/.test((document.querySelector('.bperr') || {}).textContent || ''));
|
|
126
|
+
ok('E2 a limit from the host is shown as the host said it', true);
|
|
127
|
+
W.publish = null; await s.ctx.close();
|
|
128
|
+
|
|
129
|
+
console.log('F open links');
|
|
130
|
+
W.links = LINKS.map((l) => Object.assign({}, l)); W.posts = [];
|
|
131
|
+
s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.click('#bdPublish'); await s.p.waitForSelector('[data-bp-re]');
|
|
132
|
+
ok('F1 the open links are listed under the form, each with when it ends and its views', (await s.p.locator('.bprow').count()) === 2 && /Open links · 2/.test(await pop(s.p).textContent()) && /3 views/.test(await pop(s.p).textContent()));
|
|
133
|
+
ok('F2 a link that ends within a day and a half shows its date in the warning style', (await s.p.locator('.bprow em.soon').count()) === 1);
|
|
134
|
+
await s.p.locator('[data-bp-re]').first().click(); await s.p.waitForTimeout(400);
|
|
135
|
+
ok('F3 Republish sends the link\'s id', W.posts.some((x) => /republish$/.test(x.p) && x.body.id === LINKS[0].id), JSON.stringify(W.posts));
|
|
136
|
+
await s.p.locator('[data-bp-off]').first().click();
|
|
137
|
+
ok('F4 the first Turn off press only asks "Sure?" and sends nothing', /Sure\? Turn off/.test(await s.p.locator('[data-bp-off]').first().textContent()) && !W.posts.some((x) => /off$/.test(x.p)));
|
|
138
|
+
await s.p.locator('[data-bp-off]').first().click(); await s.p.waitForTimeout(400);
|
|
139
|
+
ok('F5 the second press turns it off and the row goes', W.posts.some((x) => /off$/.test(x.p) && x.body.id === LINKS[0].id) && (await s.p.locator('.bprow').count()) === 1);
|
|
140
|
+
await s.ctx.close();
|
|
141
|
+
|
|
142
|
+
console.log('G a phone');
|
|
143
|
+
W.links = []; s = await open(390, 844, '/premium-board.html?ws=idpf&board=idpf');
|
|
144
|
+
ok('G0 the toolbar button is not drawn on a phone (the toolbar has no room); the sheet is what a narrow window shows', await s.p.locator('#bdPublish').isHidden());
|
|
145
|
+
await s.p.evaluate(() => import('/pm/bd-publish.js').then((M) => M.open(document.querySelector('#bdPublish'), { ws: 'idpf', board: 'idpf' }))); await s.p.waitForSelector('[data-bp="make"]');
|
|
146
|
+
const box = await pop(s.p).evaluate((e) => { const r = e.getBoundingClientRect(); return { l: r.left, r: r.right, b: r.bottom, w: innerWidth, h: innerHeight, side: document.documentElement.scrollWidth > innerWidth + 1 }; });
|
|
147
|
+
ok('G1 the popover is a sheet at the bottom of the screen, the screen\'s width, with no sideways scroll', box.l === 0 && Math.round(box.r) === box.w && Math.round(box.b) === box.h && !box.side, JSON.stringify(box));
|
|
148
|
+
const small = await pop(s.p).locator('button:visible, input:visible').evaluateAll((els) => els.filter((e) => e.getBoundingClientRect().height < 34 && !e.matches('input[type=hidden]')).map((e) => e.className + ':' + Math.round(e.getBoundingClientRect().height)));
|
|
149
|
+
ok('G2 every control on the phone is at least 34 px high', small.length === 0, small.join(' '));
|
|
150
|
+
await s.ctx.close();
|
|
151
|
+
|
|
152
|
+
console.log('H closing');
|
|
153
|
+
W.links = []; s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.click('#bdPublish'); await s.p.waitForSelector('[data-bp="make"]');
|
|
154
|
+
await s.p.keyboard.press('Escape'); await s.p.waitForTimeout(200);
|
|
155
|
+
ok('H1 Escape closes it and puts the focus back on the button', (await pop(s.p).count()) === 0 && (await s.p.evaluate(() => document.activeElement && document.activeElement.id)) === 'bdPublish');
|
|
156
|
+
await s.p.click('#bdPublish'); await s.p.waitForSelector('[data-bp="make"]'); await s.p.mouse.click(5, 400); await s.p.waitForTimeout(200);
|
|
157
|
+
ok('H2 a press outside closes it', (await pop(s.p).count()) === 0);
|
|
158
|
+
ok('H3 no page error in any section', s.errs.length === 0, s.errs.join(' | '));
|
|
159
|
+
await s.ctx.close();
|
|
160
|
+
await finish(browser);
|
|
161
|
+
})();
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* board-shared-ui — the Shared tab of the Board (initiative board-publish, slice 4; planning/prd/board-publish-prd.md T1 to T6; design
|
|
4
|
+
* prototype/board-publish/shared-view-design.html). Serves the real page from the real server. The workspace's /api/board-publish answers are served by
|
|
5
|
+
* the test (the server side is tested in board-publish-teams.test.js against the real host), so each press is checked on what the page SENDS and draws.
|
|
6
|
+
* A the tab and its number · B join · C the list · D a team that cannot be read · E leave · F reads happen on open and on Refresh only · G a phone */
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
10
|
+
const T = require('./test-run').configure({ name: 'board-shared-ui' });
|
|
11
|
+
const BP = require('./lib/board-premium.js');
|
|
12
|
+
const F = require('./fixtures/board-premium-facts.js');
|
|
13
|
+
const Pack = require('./lib/board-pack.js');
|
|
14
|
+
|
|
15
|
+
let n = 0; let bad = 0;
|
|
16
|
+
const ok = (name, cond, extra = '') => { n++; if (!cond) bad++; console.log(`${cond ? ' ✓' : ' ✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 300) : ''}`); };
|
|
17
|
+
const iso = (ms) => new Date(Date.now() + ms).toISOString();
|
|
18
|
+
|
|
19
|
+
(async () => {
|
|
20
|
+
const { chromium } = require('playwright-core');
|
|
21
|
+
const srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
22
|
+
const finish = async (browser, code) => { try { if (browser) await browser.close(); } catch { /* gone */ } try { srv.kill('SIGKILL'); } catch { /* gone */ } T.killTmux(); console.log(`\n${n - bad}/${n} board-shared-ui assertions passed`); process.exit(code !== undefined ? code : (bad ? 1 : 0)); };
|
|
23
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(null, 1); });
|
|
24
|
+
await T.waitForServer(T.BASE);
|
|
25
|
+
const browser = await chromium.launch({ executablePath: findBrowser() });
|
|
26
|
+
const model = BP.build(F.programFacts('idpf'));
|
|
27
|
+
const BOARD = '/api/board-premium?ws=idpf&board=idpf';
|
|
28
|
+
|
|
29
|
+
const MINE = [{ id: 'mine0000000000000001', url: 'https://boards.test/b/mine0000000000000001', team: 'Product', name: 'IDPF', kind: 'product', by: 'Wawan', made: iso(-86400000), ends: iso(6 * 86400000), views: 3 },
|
|
30
|
+
{ id: 'mine0000000000000002', url: 'https://boards.test/b/mine0000000000000002', team: 'Product', name: 'Project Ascent', kind: 'program', by: 'Wawan', made: iso(-2 * 86400000), ends: iso(20 * 3600000), views: 11 }];
|
|
31
|
+
const TEAM_OK = { team: 'Product', host: 'boards.test', ok: true, links: [
|
|
32
|
+
{ id: 'team0000000000000001', name: 'Descope feature parity', kind: 'initiative', by: 'Dimas', made: iso(-3 * 86400000), ends: iso(20 * 3600000), views: 7 },
|
|
33
|
+
{ id: 'team0000000000000002', name: 'Payments redesign', kind: 'program', by: 'Anya', made: iso(-4 * 86400000), ends: iso(5 * 86400000), views: 4 },
|
|
34
|
+
{ id: 'team0000000000000003', name: 'Legacy IdP sunset', kind: 'initiative', by: 'Mei', made: iso(-12 * 86400000), ends: iso(-86400000), views: 9 },
|
|
35
|
+
Object.assign({}, { id: 'mine0000000000000001', name: 'IDPF', kind: 'product', by: 'Wawan', made: iso(-86400000), ends: iso(6 * 86400000), views: 3 })] };
|
|
36
|
+
const W = { yours: [], teams: [], names: [], posts: [], reads: 0, joinAnswer: null, popup: null };
|
|
37
|
+
const open = async (w, h, url, init) => {
|
|
38
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
39
|
+
await ctx.route((u) => /\/api\/board-premium/.test(u.toString()), (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model, as_of: 1 }) }));
|
|
40
|
+
await ctx.route((u) => new URL(u).pathname === '/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: F.programs() }) }));
|
|
41
|
+
await ctx.route((u) => new URL(u).pathname === '/api/board-publish', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, host: 'boards.test', days: [1, 7, 30], password: 'x', links: W.yours, teams: W.names, choices: null }) }));
|
|
42
|
+
await ctx.route((u) => new URL(u).pathname === '/api/board-publish/shared', (r) => { W.reads++; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, readAt: new Date().toISOString(), yours: W.yours, teams: W.teams }) }); });
|
|
43
|
+
await ctx.route((u) => /\/api\/board-publish\/(join|leave|open|republish|off)$/.test(new URL(u).pathname), (r) => {
|
|
44
|
+
const p = new URL(r.request().url()).pathname; const body = JSON.parse(r.request().postData() || '{}'); W.posts.push({ p, body });
|
|
45
|
+
if (p.endsWith('/join')) { const a = W.joinAnswer; if (a) return r.fulfill({ contentType: 'application/json', status: a.status || 400, body: JSON.stringify(a.body) }); W.names = ['Product']; W.teams = [JSON.parse(JSON.stringify(TEAM_OK))]; return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, team: 'Product' }) }); }
|
|
46
|
+
if (p.endsWith('/open')) return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, url: 'https://boards.test/b/' + body.id + '?t=ONETIME' }) });
|
|
47
|
+
if (p.endsWith('/leave')) { W.names = []; W.teams = []; }
|
|
48
|
+
if (p.endsWith('/off')) { W.yours = W.yours.filter((l) => l.id !== body.id); W.teams.forEach((t) => { if (t.links) t.links = t.links.filter((l) => l.id !== body.id); }); }
|
|
49
|
+
return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true }) });
|
|
50
|
+
});
|
|
51
|
+
await ctx.route('https://boards.test/**', (r) => r.fulfill({ contentType: 'text/html', body: '<title>host</title><p>the board</p>' }));
|
|
52
|
+
const errs = []; const p = await ctx.newPage(); p.on('pageerror', (e) => errs.push(e.message));
|
|
53
|
+
const reqs = []; ctx.on('request', (r) => reqs.push(new URL(r.url()).pathname));
|
|
54
|
+
await p.addInitScript(() => { try { localStorage.setItem('pmos.board.view', 'list'); localStorage.setItem('pmos.board.grouping', 'program'); } catch (e) { /* none */ } });
|
|
55
|
+
await p.goto(T.BASE + url); await p.waitForSelector('#tabShared', { timeout: 15000 }).catch(() => {}); await p.waitForTimeout(700);
|
|
56
|
+
return { ctx, p, errs, reqs };
|
|
57
|
+
};
|
|
58
|
+
const reset = (o = {}) => { Object.assign(W, { yours: [], teams: [], names: [], posts: [], reads: 0, joinAnswer: null }, o); };
|
|
59
|
+
|
|
60
|
+
console.log('A the tab and its number');
|
|
61
|
+
reset();
|
|
62
|
+
let s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf');
|
|
63
|
+
ok('A1 Shared is a tab beside Initiatives and Documents, and has no number when there is nothing', await s.p.locator('#tabShared').isVisible() && /^Shared\s*$/.test((await s.p.locator('#tabShared').textContent()).trim()));
|
|
64
|
+
ok('A2 opening the tab with nothing joined asks nothing of any host beyond the read, and shows one sentence and the invite field', await (async () => { await s.p.click('#tabShared'); await s.p.waitForSelector('#shInvite'); return /Join a team to see its boards/.test(await s.p.locator('#cShared').textContent()) && (await s.p.locator('#cShared .bd-dt').count()) === 0; })());
|
|
65
|
+
ok('A3 the other tabs are hidden while it is open, and Initiatives comes back', await s.p.locator('#cIni').isHidden() && await s.p.locator('#cDocs').isHidden() && (await (async () => { await s.p.click('#tabIni'); return s.p.locator('#cShared').isHidden(); })()));
|
|
66
|
+
await s.ctx.close();
|
|
67
|
+
reset({ yours: MINE, names: ['Product'] }); s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf');
|
|
68
|
+
ok('A4 at load the number is your own open links, from this computer only (no host was asked)', (await s.p.locator('#nShared').textContent()) === '2' && W.reads === 0, await s.p.locator('#nShared').textContent());
|
|
69
|
+
await s.ctx.close();
|
|
70
|
+
{
|
|
71
|
+
const pack = Pack.buildPack({ ws: 'idpf', board: 'idpf', selection: [{ kind: 'product', id: 'idpf' }], meta: { by: 'W', at: 'x', ends: 'y', viewer: 'test' }, answers: { [BOARD]: { ok: true, state: 'ready', model, as_of: 1 }, '/api/programs': { ok: true, programs: F.programs() } } });
|
|
72
|
+
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } }); const reqs = []; ctx.on('request', (r) => reqs.push(new URL(r.url()).pathname));
|
|
73
|
+
await ctx.route((u) => new URL(u).pathname === '/__pack/p.json', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(pack) }));
|
|
74
|
+
const p = await ctx.newPage(); await p.goto(T.BASE + '/premium-board.html?ws=idpf&board=idpf&pack=/__pack/p.json'); await p.waitForSelector('.tg-n.ini2', { timeout: 15000 }).catch(() => {}); await p.waitForTimeout(600);
|
|
75
|
+
ok('A5 the read-only Board does not draw the tab and asks nothing of /api/board-publish', (await p.locator('#tabShared').isHidden()) && !reqs.some((u) => /board-publish/.test(u)));
|
|
76
|
+
await ctx.close();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
console.log('B join');
|
|
80
|
+
reset(); s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.click('#tabShared'); await s.p.waitForSelector('#shInvite');
|
|
81
|
+
W.joinAnswer = { status: 400, body: { ok: false, error: 'This is not an invite link. It looks like https://boards.example.com/join#Team.password.' } };
|
|
82
|
+
await s.p.fill('#shInvite', 'hello'); await s.p.click('[data-sh="join"]'); await s.p.waitForSelector('[role="alert"]');
|
|
83
|
+
ok('B1 a refused invite shows the sentence under the field and keeps what was pasted', /not an invite link/.test(await s.p.locator('#cShared [role="alert"]').textContent()) && (await s.p.inputValue('#shInvite')) === 'hello' && W.posts[0].body.invite === 'hello');
|
|
84
|
+
await s.p.click('[data-sh="typed"]'); await s.p.waitForSelector('#shHost');
|
|
85
|
+
W.joinAnswer = { status: 429, body: { ok: false, kind: 'locked', error: 'Too many wrong tries. Try again in 12 minutes.' } };
|
|
86
|
+
await s.p.fill('#shHost', 'https://boards.pm-os.app'); await s.p.fill('#shTeam', 'Product'); await s.p.fill('#shPass', 'harbor-lime-47'); await s.p.click('[data-sh="join"]'); await s.p.waitForFunction(() => /12 minutes/.test((document.querySelector('#cShared [role="alert"]') || {}).textContent || ''));
|
|
87
|
+
const last = W.posts[W.posts.length - 1].body;
|
|
88
|
+
ok('B2 the typed way sends the host, team and password, and a lockout is shown with its minutes', last.host === 'https://boards.pm-os.app' && last.team === 'Product' && last.password === 'harbor-lime-47');
|
|
89
|
+
W.joinAnswer = null; await s.p.click('[data-sh="paste"]'); await s.p.fill('#shInvite', 'https://boards.test/join#Product.harbor-lime-47'); await s.p.click('[data-sh="join"]'); await s.p.waitForSelector('.bdsh-table');
|
|
90
|
+
ok('B3 a join that works reads the team and shows its list; the tab gets its number', (await s.p.locator('#nShared').textContent()) === '3' && /Joined Product/.test(await s.p.locator('#cShared').textContent()), await s.p.locator('#nShared').textContent());
|
|
91
|
+
await s.ctx.close();
|
|
92
|
+
|
|
93
|
+
console.log('C the list');
|
|
94
|
+
reset({ yours: MINE, names: ['Product'], teams: [JSON.parse(JSON.stringify(TEAM_OK))] }); s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.click('#tabShared'); await s.p.waitForSelector('.bdsh-table');
|
|
95
|
+
const chips = await s.p.locator('#cShared .bd-dchips .bd-chip').allTextContents();
|
|
96
|
+
ok('C1 the chips are All, Yours and one per team; counts leave out an ended copy, and your own link published to a team is one copy, not two', JSON.stringify(chips.map((x) => x.trim())) === JSON.stringify(['All 4', 'Yours 2', 'Product 4']), JSON.stringify(chips));
|
|
97
|
+
const names = await s.p.locator('#cShared .bdsh-table .bd-dlink').allTextContents();
|
|
98
|
+
ok('C2 your own links come first, then the team\'s, and an ended copy last; your link in the team list is not drawn twice', JSON.stringify(names) === JSON.stringify(['IDPF', 'Project Ascent', 'Descope feature parity', 'Payments redesign', 'Legacy IdP sunset']), JSON.stringify(names));
|
|
99
|
+
ok('C3 an ended copy is dimmed and is not a button; a copy that ends within a day and a half shows the Board\'s warning dot', (await s.p.locator('#cShared .bdsh-table .bdsh-gone').count()) === 1 && (await s.p.locator('#cShared .bdsh-table .bdsh-gone button.bd-dlink').count()) === 0 && (await s.p.locator('#cShared .bdsh-table .s-risk').count()) === 2);
|
|
100
|
+
ok('C4 the line under the table says where and when it was read', /Read from boards\.test just now/.test(await s.p.locator('#cShared .bdsh-fine').last().textContent()), await s.p.locator('#cShared .bdsh-fine').last().textContent());
|
|
101
|
+
const popup = s.p.waitForEvent('popup'); await s.p.locator('#cShared .bdsh-table [data-sh-open="team0000000000000001"]').click(); const pg = await popup; await pg.waitForURL(/ONETIME/, { timeout: 8000 }).catch(() => {});
|
|
102
|
+
const o = W.posts.find((x) => x.p.endsWith('/open'));
|
|
103
|
+
ok('C5 a press on a team\'s board asks for a one-time address and opens it in a new tab', o && o.body.team === 'Product' && o.body.id === 'team0000000000000001' && /boards\.test\/b\/team0000000000000001\?t=ONETIME/.test(pg.url()), pg.url());
|
|
104
|
+
await pg.close();
|
|
105
|
+
await s.p.locator('#cShared .bdsh-table [data-sh-re]').first().click(); await s.p.waitForTimeout(500);
|
|
106
|
+
ok('C6 Republish sends the link\'s id and the list is read again', W.posts.some((x) => x.p.endsWith('/republish') && x.body.id === MINE[0].id) && /Republished/.test(await s.p.locator('#cShared').textContent()));
|
|
107
|
+
await s.p.locator('#cShared .bdsh-table [data-sh-off]').first().click();
|
|
108
|
+
ok('C7 the first Turn off press asks "Sure?" and sends nothing', /Sure\? Turn off/.test(await s.p.locator('#cShared [data-sh-off]').first().textContent()) && !W.posts.some((x) => x.p.endsWith('/off')));
|
|
109
|
+
await s.p.locator('#cShared .bdsh-table [data-sh-off]').first().click(); await s.p.waitForTimeout(500);
|
|
110
|
+
ok('C8 the second press turns it off and the row goes', W.posts.some((x) => x.p.endsWith('/off') && x.body.id === MINE[0].id) && !(await s.p.locator('#cShared .bdsh-table').textContent()).includes('IDPF'));
|
|
111
|
+
await s.p.click('[data-sh-sel="mine"]');
|
|
112
|
+
ok('C9 the Yours chip shows only your own links', (await s.p.locator('#cShared .bdsh-table .bd-dlink').count()) === 1);
|
|
113
|
+
await s.ctx.close();
|
|
114
|
+
|
|
115
|
+
console.log('D a team that cannot be read');
|
|
116
|
+
const BAD = { team: 'Growth', host: 'boards.test', ok: false, kind: 'password', error: 'The team password no longer works. Ask for a new invite link.' };
|
|
117
|
+
reset({ yours: [], names: ['Product', 'Growth'], teams: [JSON.parse(JSON.stringify(TEAM_OK)), BAD] }); s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.click('#tabShared'); await s.p.waitForSelector('.bdsh-ban');
|
|
118
|
+
ok('D1 the failing team shows one line that says why and what to do, no old rows, and the other team still draws', /Growth: The team password no longer works/.test(await s.p.locator('.bdsh-ban').textContent()) && (await s.p.locator('#cShared .bdsh-table .bd-dlink').count()) === 4 && /Paste a new invite link/.test(await s.p.locator('.bdsh-ban .bd-btn').textContent()));
|
|
119
|
+
ok('D2 its chip has no count', (await s.p.locator('[data-sh-sel="Growth"]').textContent()).trim() === 'Growth');
|
|
120
|
+
await s.p.click('.bdsh-ban .bd-btn'); await s.p.waitForSelector('#shInvite');
|
|
121
|
+
ok('D3 Paste a new invite link opens the invite field', await s.p.locator('#shInvite').isVisible());
|
|
122
|
+
W.teams = [JSON.parse(JSON.stringify(TEAM_OK)), { team: 'Growth', host: 'boards.test', ok: false, kind: 'locked', error: 'Too many wrong tries. Try again in 9 minutes.' }];
|
|
123
|
+
await s.p.click('[data-sh="closejoin"]'); await s.p.click('[data-sh="refresh"] >> nth=0').catch(() => {}); await s.p.waitForTimeout(400);
|
|
124
|
+
ok('D4 a locked team says the minutes and offers Refresh', /9 minutes/.test(await s.p.locator('.bdsh-ban').textContent()) && /Refresh/.test(await s.p.locator('.bdsh-ban .bd-btn').textContent()));
|
|
125
|
+
await s.ctx.close();
|
|
126
|
+
|
|
127
|
+
console.log('E leave');
|
|
128
|
+
reset({ yours: [], names: ['Product'], teams: [JSON.parse(JSON.stringify(TEAM_OK))] }); s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.click('#tabShared'); await s.p.waitForSelector('.bdsh-table'); await s.p.click('[data-sh-sel="Product"]');
|
|
129
|
+
ok('E1 a team\'s chip adds Refresh, Paste a new invite link and Leave team', (await s.p.locator('.bdsh-tl .bd-btn').allTextContents()).map((x) => x.trim()).join('|') === 'Refresh|Paste a new invite link|Leave team');
|
|
130
|
+
await s.p.click('[data-sh-leave="Product"]');
|
|
131
|
+
ok('E2 the first press asks "Sure?", says what leaving does, and sends nothing', /Sure\? Leave Product/.test(await s.p.locator('[data-sh-leave]').textContent()) && /only forgets the team's password on this computer/.test(await s.p.locator('#cShared').textContent()) && !W.posts.some((x) => x.p.endsWith('/leave')));
|
|
132
|
+
await s.p.click('[data-sh-leave="Product"]'); await s.p.waitForSelector('#shInvite');
|
|
133
|
+
ok('E3 the second press leaves: the team is gone and the tab asks to join again', W.posts.some((x) => x.p.endsWith('/leave') && x.body.team === 'Product') && await s.p.locator('#shInvite').isVisible());
|
|
134
|
+
await s.ctx.close();
|
|
135
|
+
|
|
136
|
+
console.log('F reads');
|
|
137
|
+
reset({ yours: [], names: ['Product'], teams: [JSON.parse(JSON.stringify(TEAM_OK))] }); s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf');
|
|
138
|
+
ok('F1 nothing is read from a host at load', W.reads === 0);
|
|
139
|
+
await s.p.click('#tabShared'); await s.p.waitForSelector('.bdsh-table'); const first = W.reads; await s.p.waitForTimeout(1500);
|
|
140
|
+
ok('F2 opening the tab reads once and nothing polls', first === 1 && W.reads === 1, W.reads);
|
|
141
|
+
await s.p.locator('#cShared .bdsh-lk').click(); await s.p.waitForTimeout(500);
|
|
142
|
+
ok('F3 Refresh reads again', W.reads === 2, W.reads);
|
|
143
|
+
await s.ctx.close();
|
|
144
|
+
|
|
145
|
+
console.log('G a phone');
|
|
146
|
+
reset({ yours: MINE, names: ['Product'], teams: [JSON.parse(JSON.stringify(TEAM_OK))] }); s = await open(390, 844, '/premium-board.html?ws=idpf&board=idpf');
|
|
147
|
+
ok('G1 on a phone Shared is a chip after Docs, and it opens the tab', await (async () => { await s.p.waitForSelector('#chShared'); const after = await s.p.evaluate(() => document.getElementById('chShared').previousElementSibling && document.getElementById('chShared').previousElementSibling.id); await s.p.click('#chShared'); await s.p.waitForSelector('.bdsh-cards .bdsh-card'); return after === 'chDocs'; })());
|
|
148
|
+
const g = await s.p.evaluate(() => ({ side: document.documentElement.scrollWidth > innerWidth + 1, table: getComputedStyle(document.querySelector('.bdsh-table')).display, cards: document.querySelectorAll('.bdsh-card').length }));
|
|
149
|
+
ok('G2 a row is a card: the table is not drawn, there is no sideways scroll', g.table === 'none' && g.cards === 5 && !g.side, JSON.stringify(g));
|
|
150
|
+
const small = await s.p.locator('#cShared button:visible').evaluateAll((els) => els.filter((e) => e.getBoundingClientRect().height < 34).map((e) => e.className + ':' + Math.round(e.getBoundingClientRect().height)));
|
|
151
|
+
ok('G3 every control on the phone is at least 34 px high', small.length === 0, small.join(' '));
|
|
152
|
+
ok('G4 no page error in any section', s.errs.length === 0, s.errs.join(' | '));
|
|
153
|
+
await s.ctx.close();
|
|
154
|
+
await finish(browser);
|
|
155
|
+
})();
|
|
@@ -435,7 +435,7 @@ const IVREAD = () => {
|
|
|
435
435
|
const R = await open({ w: 390, h: 844, theme, model: BP.build(FJ.facts()) }), q = R.page;
|
|
436
436
|
const m = await q.evaluate(() => { const small = [...document.querySelectorAll('#ibTabs button, #ibBody .bt-nm, #bdChipset .bd-chip, .bd-tab, #newIni, #bdFind, #bdView')].filter((b) => !b.closest('[hidden]') && b.getBoundingClientRect().height > 0 && b.getBoundingClientRect().height < 44).map((b) => b.className + ':' + Math.round(b.getBoundingClientRect().height)); const fab = document.querySelector('#czFab').getBoundingClientRect(); return { over: document.documentElement.scrollWidth > innerWidth + 1, small, fabRight: Math.round(innerWidth - fab.right), top: Math.round(document.querySelector('.bd-hd').getBoundingClientRect().height), chips: [...document.querySelectorAll('#bdChipset .bd-chip')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()), title: getComputedStyle(document.querySelector('.bd-title')).display }; });
|
|
437
437
|
ok(`B13 at 390 px (${theme}) the page has no sideways scroll, the top bar is one line with "Board", the menu sits bottom right, and every control is 44 px`, !m.over && m.small.length === 0 && m.fabRight < 40 && m.top <= 56 && m.title !== 'none', JSON.stringify(m));
|
|
438
|
-
ok(`B13 at 390 px (${theme}) the chips lead with This sprint, then the Jira read time and the new asks, and end with the documents`, m.chips[0] === 'Sprint 24 only' && /^Jira \d+ days$/.test(m.chips[1]) && m.chips[2] === '1 new ask' && m.chips[m.chips.length -
|
|
438
|
+
ok(`B13 at 390 px (${theme}) the chips lead with This sprint, then the Jira read time and the new asks, and end with the documents and Shared`, m.chips[0] === 'Sprint 24 only' && /^Jira \d+ days$/.test(m.chips[1]) && m.chips[2] === '1 new ask' && m.chips[m.chips.length - 2] === 'Docs 6' && m.chips[m.chips.length - 1] === 'Shared', JSON.stringify(m.chips));
|
|
439
439
|
const pl = await q.evaluate(() => ({ groups: [...document.querySelectorAll('#ibBody .bd-ghd')].map((g) => g.textContent.replace(/\s+/g, ' ').trim()), seg: [...document.querySelectorAll('#ibBody [data-pv]')].map((b) => b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join(), note: /Timeline needs a wider screen/.test(document.querySelector('#ibBody').textContent), small: [...document.querySelectorAll('#ibBody [data-pv], #ibBody .bd-lrow')].filter((b) => b.getBoundingClientRect().height < 44).length }));
|
|
440
440
|
ok(`B13 at 390 px (${theme}) the phone opens on the List, grouped your turn first, with List, By stage, Track and Timeline (BdPhone, TsCPhone)`, pl.groups.join('|') === 'At risk or late4|On track3' && pl.seg === 'List*,By stage,Track,Timeline' && !pl.note && pl.small === 0, JSON.stringify(pl));
|
|
441
441
|
await q.click('#bdView'); const s2 = await q.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelectorAll('#ibBody .bd-scols.ph .bd-scol').length + (((document.querySelector('#ibBody .bd-sempty') || {}).textContent || '').replace(/^Nothing on screen in /, '').match(/[A-Z][a-z]+/g) || []).length === 8);
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.471.0",
|
|
4
|
+
"at": "2026-10-31T13:21:46.914Z",
|
|
5
|
+
"f": 3,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1124,
|
|
9
|
+
"t": "The Shared tab on the Board — join a team, read its boards, open one (board-publish slice 4)",
|
|
10
|
+
"s": "The Shared tab on the Board — join a team, read its boards, open one (board-publish slice 4)",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"v": "0.470.0",
|
|
17
|
+
"at": "2026-10-31T12:11:04.375Z",
|
|
18
|
+
"f": 3,
|
|
19
|
+
"prs": [
|
|
20
|
+
{
|
|
21
|
+
"n": 1123,
|
|
22
|
+
"t": "The Publish popover on the Board (board-publish slice 2, page side)",
|
|
23
|
+
"s": "The Publish popover on the Board (board-publish slice 2, page side)",
|
|
24
|
+
"k": "new"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
2
28
|
{
|
|
3
29
|
"v": "0.469.0",
|
|
4
30
|
"at": "2026-10-31T10:43:44.457Z",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Published board: a read-only copy of a Board"
|
|
4
|
-
description: "What a published board is, what a reader sees and cannot do, and how to preview one
|
|
4
|
+
description: "What a published board is, how to publish one from the Board, what a reader sees and cannot do, and how to preview one."
|
|
5
5
|
timestamp: 2026-10-31
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -9,13 +9,61 @@ timestamp: 2026-10-31
|
|
|
9
9
|
|
|
10
10
|
A **published board** is a copy of the Board that a teammate can read. It shows the Timeline of the products, programs or initiatives that you pick. It is a snapshot. It does not change after it is taken.
|
|
11
11
|
|
|
12
|
-
This version has the read-only Board and the **data pack** that feeds it. The
|
|
12
|
+
This version has the **Publish** button on the Board, the **Shared** tab, the read-only Board and the **data pack** that feeds it. The shared host must be set up first.
|
|
13
|
+
|
|
14
|
+
## Publish a board
|
|
15
|
+
|
|
16
|
+
Press the share icon on the Board's toolbar. A popover opens under it. The button shows a number when you have open links. It shows nothing when you have none.
|
|
17
|
+
|
|
18
|
+
The button is not on a narrow screen (720 px or less) and not on the All products page. Open one product to publish from it.
|
|
19
|
+
|
|
20
|
+
1. **Set the host.** The first time, the popover asks for the address of the board host. Ask the person who runs it. Write it as `https://boards.example.com`. The **Change** button on the form sets it again. If the computer has the `PMOS_BOARDS_HOST` variable, the variable is used.
|
|
21
|
+
2. **What to share.** The product of this board is picked. Press a program to add it. Press **An initiative** to pick one initiative. Press a picked chip again to remove it. **Publish** stays off while nothing is picked.
|
|
22
|
+
3. **Team.** Type the name of a team, or leave it empty. The host tells you when there is no team with that name.
|
|
23
|
+
4. **Password.** It is on, with a password that PMOS made. Press **New** for another one, or write your own. Turn the switch off for a link with no password.
|
|
24
|
+
5. **Ends.** The link ends after 1, 7 or 30 days.
|
|
25
|
+
6. **Publish.** PMOS looks for a key or a token in the copy first. If it finds one, nothing is sent. The message names the kind of secret and never shows it. Then PMOS sends the copy to the host.
|
|
26
|
+
|
|
27
|
+
When the link is ready, the popover shows the link and the password. Press **Copy link and password**. PMOS does not keep the password. This is the only time it is shown. Send the password in a different message. Press **Done** to publish another copy.
|
|
28
|
+
|
|
29
|
+
The copy holds the titles, stages, dates, owners and task names of what you picked. The host can read them.
|
|
30
|
+
|
|
31
|
+
Under the form, **Open links** lists each link that has not ended. It shows the team, the end date and the number of views. A link that ends within a day and a half shows its date in red.
|
|
32
|
+
|
|
33
|
+
- **Republish** makes the copy again from today's board. The link and the password stay the same.
|
|
34
|
+
- **Turn off** asks you to press a second time. Then the host deletes the copy at once.
|
|
35
|
+
|
|
36
|
+
Only you can publish, republish or turn off a link, with a press on the page. An agent session cannot.
|
|
37
|
+
|
|
38
|
+
## The Shared tab
|
|
39
|
+
|
|
40
|
+
**Shared** is a tab of the Board, beside **Initiatives** and **Documents**. It lists the boards that people published to your teams, and your own links. On a phone it is a chip after **Docs**. The tab shows a number when there are open copies. Before you read a team, the number is your own open links.
|
|
41
|
+
|
|
42
|
+
**Join a team.** The person who makes a team gets an invite link and sends it to you. It looks like `https://boards.example.com/join#Team.password`. Open **Shared**, paste the link in the field and press **Join**. PMOS asks the host first. It keeps the team only if the password works. You do not need to set the host address first: the invite link has it.
|
|
43
|
+
|
|
44
|
+
To join without the link, press **Type the team name and password instead**. Write the host address, the team name and the team password.
|
|
45
|
+
|
|
46
|
+
PMOS keeps the team and its password on this computer only. It does not show the password again.
|
|
47
|
+
|
|
48
|
+
**Read the list.** PMOS reads each team from its host when you open the tab and when you press **Refresh**. It does not read in between. The line under the table says which host and when.
|
|
49
|
+
|
|
50
|
+
The chips are **All**, **Yours** and one for each team. **Yours** shows only when you have open links. A chip shows how many open copies the team has.
|
|
51
|
+
|
|
52
|
+
- **A board.** Press the name of a board to open its copy in a new browser tab. You do not type the password of the link. A copy that has ended is dimmed and does not open.
|
|
53
|
+
- **Yours.** Your own links have **Republish** and **Turn off**, the same as in the Publish popover. **Turn off** asks you to press a second time.
|
|
54
|
+
- **A date in red.** The copy ends within a day and a half.
|
|
55
|
+
|
|
56
|
+
**A team that cannot be read.** One line shows in its place. It says if the team password was changed, if the host locked the team after too many wrong tries, or if the host did not answer. Press **Paste a new invite link** or **Refresh**. The other teams still show. PMOS shows no old rows for a team it cannot read.
|
|
57
|
+
|
|
58
|
+
**Leave a team.** Press the chip of the team. Then press **Leave team**, and press it a second time. PMOS forgets the team and its password on this computer. The copies that you published stay on the host. Join again with the invite link.
|
|
59
|
+
|
|
60
|
+
The tab is not in the read-only Board. A reader sees no Shared tab.
|
|
13
61
|
|
|
14
62
|
## What a reader sees
|
|
15
63
|
|
|
16
64
|
- The Timeline, as you see it in the workspace. It opens on today.
|
|
17
65
|
- The span picker, the Deliveries lane, and the folds of a program and a product.
|
|
18
|
-
- One line above the Board. It names the selection, the date of the copy, who shared it and when the link ends.
|
|
66
|
+
- One line above the Board. It names the selection, the date of the copy, who shared it and when the link ends.
|
|
19
67
|
- A viewer for each initiative. Press the name of an initiative to open it. The viewer shows the stage card, About and Tasks. Tasks show as a List or as a Timeline, grouped by stage, owner or status.
|
|
20
68
|
- The panel divider and the panel layout: full screen, split or slide over.
|
|
21
69
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* board-publish-choices.js — what can be published from a board (initiative board-publish, slice 2, page side; PRD P1): its product, the programs that hold
|
|
3
|
+
* one of its initiatives, and its initiatives. Read from the Board's own routes, the way lib/board-pack-route.js reads them.
|
|
4
|
+
* choicesOf(req, ctx, ws, board) -> { products, programs, initiatives } | null while the board is still being read */
|
|
5
|
+
const BoardPremium = require('./routes-board-premium.js');
|
|
6
|
+
const Programs = require('./routes-programs.js');
|
|
7
|
+
|
|
8
|
+
/** GET `pathAndQuery` from a route module's own handler and return its body. */
|
|
9
|
+
async function via(mod, pathAndQuery, req, ctx) {
|
|
10
|
+
let out = null;
|
|
11
|
+
const c = Object.assign({}, ctx, { json: (res, obj) => { out = obj; } });
|
|
12
|
+
const handled = await mod.handle({ method: 'GET', headers: (req && req.headers) || {} }, {}, new URL('http://local' + pathAndQuery), c);
|
|
13
|
+
return handled === false ? null : out;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async function choicesOf(req, ctx, ws, board) {
|
|
17
|
+
const b = await via(BoardPremium, '/api/board-premium?ws=' + encodeURIComponent(ws) + '&board=' + encodeURIComponent(board), req, ctx);
|
|
18
|
+
if (!b || b.ok === false || !b.model) return null;
|
|
19
|
+
const rows = (b.model.rows || []).filter((r) => r && r.id); const have = new Set(rows.map((r) => r.id));
|
|
20
|
+
const pg = await via(Programs, '/api/programs', req, ctx);
|
|
21
|
+
const programs = ((pg && pg.programs) || []).filter((p) => p && p.id && (p.members || []).some((m) => m && m.ws === ws && have.has(m.initiative))).map((p) => ({ id: p.id, label: p.title || p.id }));
|
|
22
|
+
return { products: [{ id: board, label: (b.model.board && b.model.board.name) || board }], programs, initiatives: rows.map((r) => ({ id: r.id, label: r.title || r.id })) };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = { choicesOf };
|