create-pmos 0.610.0 → 0.611.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 +50 -14
- 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-columns-test.js +2 -1
- package/workspace/board-deliveries-test.js +2 -1
- package/workspace/board-programs-test.js +7 -3
- package/workspace/board-publish-ui-test.js +2 -1
- package/workspace/board-shared-ui-test.js +2 -1
- package/workspace/board-workflows-test.js +2 -1
- package/workspace/briefing-premium-board-test.js +3 -2
- package/workspace/briefing-premium-doc-edit-test.js +2 -1
- package/workspace/briefing-premium-insights-test.js +4 -3
- package/workspace/briefing-premium-test.js +3 -2
- package/workspace/calm-timeline-test.js +2 -1
- package/workspace/changelog.json +49 -0
- package/workspace/core-docs-workflow-test.js +2 -1
- package/workspace/ev-everywhere-test.js +3 -2
- package/workspace/guide/home.md +2 -2
- package/workspace/guide/index.md +4 -0
- package/workspace/guide/layout.md +62 -2
- package/workspace/guide/programs.md +16 -2
- package/workspace/guide/routine.md +50 -0
- package/workspace/guide/scheduled-tasks-and-cli.md +1 -1
- package/workspace/guide/settings-and-switches.md +1 -1
- package/workspace/impact-screens-test.js +3 -1
- package/workspace/ini-workflow-test.js +2 -1
- package/workspace/lib/classic-board.js +15 -0
- package/workspace/lib/events-place.js +216 -0
- package/workspace/lib/library-items.js +78 -0
- package/workspace/lib/notes.js +6 -1
- package/workspace/lib/route-modules.js +4 -0
- package/workspace/lib/routes-events-place.js +166 -0
- package/workspace/lib/routes-library.js +89 -0
- package/workspace/lib/routes-pop-work.js +39 -0
- package/workspace/lib/routes-report-setups.js +20 -0
- package/workspace/lib/routes-today-log.js +48 -0
- package/workspace/lib/routine-reports.js +52 -0
- package/workspace/lib/today-log.js +131 -0
- package/workspace/live-pill-round-test.js +10 -7
- package/workspace/metric-drafts-ui-test.js +3 -1
- package/workspace/milestone-pins-test.js +2 -1
- package/workspace/milestone-suggest-test.js +3 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/panels-test.js +2 -1
- package/workspace/premium-board-actions-test.js +3 -1
- package/workspace/premium-rec-tab-test.js +2 -1
- package/workspace/premium-vw-backlog-test.js +3 -1
- package/workspace/premium-vw-item-test.js +3 -1
- package/workspace/premium-vw-jira-test.js +3 -1
- package/workspace/product-lane-test.js +2 -1
- package/workspace/program-charter-test.js +3 -1
- package/workspace/program-leave-test.js +2 -1
- package/workspace/program-order-test.js +2 -1
- package/workspace/program-panel-test.js +3 -1
- package/workspace/public/pm/bd-ini-panel.js +72 -7
- package/workspace/public/pm/bd-prog-panel.js +55 -8
- package/workspace/public/pm/bd-work.css +130 -0
- package/workspace/public/pm/bd-work.js +356 -0
- package/workspace/public/pm/cozy-ev.css +2 -1
- package/workspace/public/pm/cozy-events-view.js +142 -0
- package/workspace/public/pm/cozy-events.css +107 -0
- package/workspace/public/pm/cozy-events.js +210 -0
- package/workspace/public/pm/cozy-evmodel.js +1 -1
- package/workspace/public/pm/cozy-library.css +36 -0
- package/workspace/public/pm/cozy-live-pill.js +1 -0
- package/workspace/public/pm/cozy-nav.js +5 -5
- package/workspace/public/pm/cozy-pop-work.css +165 -0
- package/workspace/public/pm/cozy-pop-work.js +427 -0
- package/workspace/public/pm/cozy-routine-model.js +111 -0
- package/workspace/public/pm/cozy-routine-pop.js +196 -0
- package/workspace/public/pm/cozy-routine.css +102 -0
- package/workspace/public/pm/cozy-routine.js +156 -0
- package/workspace/public/pm/cozy-schedwork.js +6 -5
- package/workspace/public/pm/cozy-today-app.js +236 -0
- package/workspace/public/pm/cozy-today-model.js +176 -0
- package/workspace/public/pm/cozy-today-page.css +100 -0
- package/workspace/public/pm/cozy-today-view.js +76 -0
- package/workspace/public/pm/home-app.js +18 -3
- package/workspace/public/pm/home-ini.js +36 -5
- package/workspace/public/pm/library-model.js +69 -0
- package/workspace/public/pm/library-open.js +34 -0
- package/workspace/public/pm/pop-work-model.js +335 -0
- package/workspace/public/pm/premium-board.js +130 -8
- package/workspace/public/pm/premium-library.js +122 -0
- package/workspace/public/premium-board.html +1 -0
- package/workspace/public/premium-events.html +42 -0
- package/workspace/public/premium-library.html +31 -0
- package/workspace/public/premium-routine.html +31 -0
- package/workspace/public/today.html +50 -0
- package/workspace/ready-dash-ui-test.js +3 -1
- package/workspace/rename-test.js +2 -1
- package/workspace/run-tests.js +4 -1
- package/workspace/server.js +3 -2
- package/workspace/sort-order-test.js +2 -1
- package/workspace/split-merge-ui-test.js +3 -1
- package/workspace/stage-card-tasks-test.js +3 -1
- package/workspace/stage-card-test.js +2 -1
- package/workspace/task-delete-test.js +2 -1
- package/workspace/task-links-test.js +2 -1
- package/workspace/task-milestones-test.js +4 -2
- package/workspace/task-plans-test.js +3 -1
- package/workspace/task-press-test.js +3 -1
- package/workspace/task-views-test.js +3 -1
- package/workspace/test-lists/events-place.json +11 -0
- package/workspace/test-lists/library-place.json +9 -0
- package/workspace/test-lists/pop-work.json +9 -0
- package/workspace/test-lists/routine-place.json +9 -0
- package/workspace/test-lists/today-log.json +9 -0
- package/workspace/test-lists/work-view.json +9 -0
- package/workspace/timeline-holds-test.js +3 -1
- package/workspace/tk-tasks-test.js +2 -1
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* the stage card, Proves it worked, Early signal and Guardrail as Now → Target; ✓ keeps all; the folded "Success measure · Set before the
|
|
10
10
|
* build · 3" with Undo · S the type scale only · H on a phone. PMOS_SHOTS=<dir> also saves the screenshots. */
|
|
11
11
|
const path = require('path');
|
|
12
|
+
const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
|
|
13
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
12
14
|
const fs = require('fs');
|
|
13
15
|
const { spawn } = require('child_process');
|
|
14
16
|
const { findBrowser } = require('./lib/find-browser');
|
|
@@ -64,7 +66,7 @@ const INITIATIVE = () => ({
|
|
|
64
66
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
65
67
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
66
68
|
await T.waitForServer(BASE);
|
|
67
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
69
|
+
browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
|
|
68
70
|
if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
|
|
69
71
|
const shot = async (p, name) => { if (SHOTS) { await sleep(450); await p.screenshot({ path: path.join(SHOTS, name + '.png') }); } };
|
|
70
72
|
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* P the phone: the card is a bottom sheet
|
|
12
12
|
* SHOTS_4B=<dir>: the card and the Filter, desktop and phone, into <dir>. */
|
|
13
13
|
const path = require('path');
|
|
14
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
14
15
|
const { spawn } = require('child_process');
|
|
15
16
|
const { findBrowser } = require('./lib/find-browser');
|
|
16
17
|
const T = require('./test-run').configure({ name: 'milestone-pins' });
|
|
@@ -54,7 +55,7 @@ const ITEMS = [
|
|
|
54
55
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
55
56
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
56
57
|
await T.waitForServer(BASE);
|
|
57
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
58
|
+
browser = classicBoard(await chromium.launch({ executablePath: exe }));
|
|
58
59
|
|
|
59
60
|
/** The Board on the timeline. o: { w, h, phone, refuse, view } */
|
|
60
61
|
const open = async (o = {}) => {
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* Save writes it and answers the suggestion; last checked and Check now · Z nothing to suggest, nothing shows · K the ◆ dates are reported once
|
|
9
9
|
* · M Home's program card leads with its milestone changes · H on a phone. PMOS_SHOTS=<dir> also saves the screenshots the frames are compared with. */
|
|
10
10
|
const path = require('path');
|
|
11
|
+
const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
|
|
12
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
11
13
|
const fs = require('fs');
|
|
12
14
|
const { spawn } = require('child_process');
|
|
13
15
|
const { findBrowser } = require('./lib/find-browser');
|
|
@@ -55,7 +57,7 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
|
|
|
55
57
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
56
58
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
57
59
|
await T.waitForServer(BASE);
|
|
58
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
60
|
+
browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
|
|
59
61
|
if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
|
|
60
62
|
const shot = async (p, name) => { if (SHOTS) await p.screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
61
63
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.611.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.611.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
package/workspace/panels-test.js
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* P13 the Live pill's list docks on the right by its grab bar, and a press moves it back (batch 26 item 4)
|
|
26
26
|
* Screenshots go to PMOS_SHOTS when it is set. Every wait polls the page. */
|
|
27
27
|
const fs = require('fs');
|
|
28
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
28
29
|
const path = require('path');
|
|
29
30
|
const { spawn } = require('child_process');
|
|
30
31
|
const { findBrowser } = require('./lib/find-browser');
|
|
@@ -61,7 +62,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
61
62
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the panels suite cannot run'); return finish(1); }
|
|
62
63
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
63
64
|
await T.waitForServer(BASE);
|
|
64
|
-
browser = besidePage(await chromium.launch({ executablePath: exe }));
|
|
65
|
+
browser = classicBoard(besidePage(await chromium.launch({ executablePath: exe })));
|
|
65
66
|
|
|
66
67
|
const open = async ({ w = 1440, h = 900, dark = false, ctx = null, q = '', at = '/premium.html', ready = () => { document.querySelectorAll('#hmList .hv-fold[aria-expanded="false"]').forEach((b) => b.click()); return !!window.czPanels && document.querySelectorAll('#hmList .hv-r.ini .hm-rm').length > 2; } } = {}) => {
|
|
67
68
|
// Home shows only the rows with a call (home-nav-rows-with-a-call): the default ready opens every folded group, so the rows this suite drags are there
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* T triage (accept, decline) · N New initiative · M move and Undo · L hold, resume, cancel, reopen, archive, restore · I the initiative page's bar
|
|
8
8
|
* S the PMOS-self board (a model answer, since only the embedded checkout is self) · P the POST allow-list and the refusals · F floors */
|
|
9
9
|
const fs = require('fs');
|
|
10
|
+
const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
|
|
11
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
10
12
|
const path = require('path');
|
|
11
13
|
const { spawn } = require('child_process');
|
|
12
14
|
const { findBrowser } = require('./lib/find-browser');
|
|
@@ -72,7 +74,7 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
|
|
|
72
74
|
const a2 = await post('/api/boards/asks/add', { line: 'Can the portal get a dark mode', source: 'Support inbox' });
|
|
73
75
|
ok('setup two asks are on the board', a1.status === 200 && a2.status === 200, JSON.stringify([a1, a2]));
|
|
74
76
|
|
|
75
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
77
|
+
browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
|
|
76
78
|
const open = async (url, { w = 1280, h = 900 } = {}) => {
|
|
77
79
|
const ctx = await openMission(await browser.newContext({ viewport: { width: w, height: h } }));
|
|
78
80
|
await ctx.addInitScript(() => { try { localStorage.setItem('pmos.premium.openAs', 'popup'); } catch { /* none */ } });
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* T5 Pause, Resume, Stop · T6 a phone
|
|
11
11
|
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
12
12
|
const path = require('path');
|
|
13
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
13
14
|
const { spawn } = require('child_process');
|
|
14
15
|
const { findBrowser } = require('./lib/find-browser');
|
|
15
16
|
const T = require('./test-run').configure({ name: 'premium-rec-tab' });
|
|
@@ -64,7 +65,7 @@ async function context(o = {}) {
|
|
|
64
65
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
65
66
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
66
67
|
await T.waitForServer(BASE);
|
|
67
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
68
|
+
browser = classicBoard(await chromium.launch({ executablePath: exe }));
|
|
68
69
|
const W = F.world();
|
|
69
70
|
const posted = (S, pth) => S.posts.filter((x) => x.path === pth);
|
|
70
71
|
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* viewer still offers it: the sprint view's "Open the backlog", with the sprint view opened through its module over a task dialog of the
|
|
6
6
|
* initiative page. GET /api/boards/sprints and the page models are stand-ins. The Board is checked to carry none of it. Every wait polls the page; no fixed sleep stands in for a state. */
|
|
7
7
|
const path = require('path');
|
|
8
|
+
const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
|
|
9
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
8
10
|
const { spawn } = require('child_process');
|
|
9
11
|
const { findBrowser } = require('./lib/find-browser');
|
|
10
12
|
const { openMission } = require('./lib/open-mission');
|
|
@@ -44,7 +46,7 @@ const SPRINTS = { ok: true, source: 'jira', readAt: '2026-10-19T09:00:00Z', velo
|
|
|
44
46
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
45
47
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
46
48
|
await T.waitForServer(BASE);
|
|
47
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
49
|
+
browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
|
|
48
50
|
|
|
49
51
|
const open = async ({ w = 1280, h = 900, theme = 'light', sprints = SPRINTS } = {}) => {
|
|
50
52
|
const ctx = await openMission(await browser.newContext({ viewport: { width: w, height: h } }));
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* Overview offers Open the full record and opens each task; inside the record a task opens in its place, and the task's initiative link brings the record back.
|
|
7
7
|
* Every wait polls the page; no fixed sleep stands in for a state. */
|
|
8
8
|
const path = require('path');
|
|
9
|
+
const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
|
|
10
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
9
11
|
const { spawn } = require('child_process');
|
|
10
12
|
const { findBrowser } = require('./lib/find-browser');
|
|
11
13
|
const { openMission } = require('./lib/open-mission');
|
|
@@ -38,7 +40,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
38
40
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
39
41
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
40
42
|
await T.waitForServer(BASE);
|
|
41
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
43
|
+
browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
|
|
42
44
|
const MODEL = IP.build(F.facts());
|
|
43
45
|
|
|
44
46
|
const open = async ({ w = 1280, h = 900, theme = 'light', answer = null } = {}) => {
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* so the sprint view is opened through its module (openSprint) over a task dialog of the initiative page, which loads the same view.
|
|
9
9
|
* F floors: 390 px with no sideways scroll, 44 px targets, light and dark, no write */
|
|
10
10
|
const path = require('path');
|
|
11
|
+
const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
|
|
12
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
11
13
|
const { spawn } = require('child_process');
|
|
12
14
|
const { findBrowser } = require('./lib/find-browser');
|
|
13
15
|
const { openMission } = require('./lib/open-mission');
|
|
@@ -67,7 +69,7 @@ const TICKETS = {
|
|
|
67
69
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
68
70
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_NO_OPEN: '1' }) });
|
|
69
71
|
await T.waitForServer(BASE);
|
|
70
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
72
|
+
browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
|
|
71
73
|
|
|
72
74
|
const model = (sprints) => BP.build(F.facts({ sprints }));
|
|
73
75
|
const IMODEL = IP.build(IF.facts());
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* Q the phone: ◇ only; a tap on the folded lane opens a sheet with the product's milestones in date order
|
|
16
16
|
* SHOTS_17=<dir>: the Board, the counted ◇'s list, folded and the phone sheet, into <dir>. */
|
|
17
17
|
const path = require('path');
|
|
18
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
18
19
|
const { spawn } = require('child_process');
|
|
19
20
|
const { findBrowser } = require('./lib/find-browser');
|
|
20
21
|
const T = require('./test-run').configure({ name: 'product-lane' });
|
|
@@ -69,7 +70,7 @@ function model() {
|
|
|
69
70
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
70
71
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
71
72
|
await T.waitForServer(BASE);
|
|
72
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
73
|
+
browser = classicBoard(await chromium.launch({ executablePath: exe }));
|
|
73
74
|
|
|
74
75
|
/** The Board on the timeline, All products. o: { w, h, span, phone, fold } */
|
|
75
76
|
const open = async (o = {}) => {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* P the picker by product with each ◆ Deliver day; an earlier milestone date warns · X what stops a save · D the drafts · N the name ·
|
|
10
10
|
* O "Open again" on a done check · H on a phone. PMOS_SHOTS=<dir> also saves the screenshots the frames are compared with. */
|
|
11
11
|
const path = require('path');
|
|
12
|
+
const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
|
|
13
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
12
14
|
const fs = require('fs');
|
|
13
15
|
const { spawn } = require('child_process');
|
|
14
16
|
const { findBrowser } = require('./lib/find-browser');
|
|
@@ -41,7 +43,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
41
43
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
42
44
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
43
45
|
await T.waitForServer(BASE);
|
|
44
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
46
|
+
browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
|
|
45
47
|
if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
|
|
46
48
|
const shot = async (p, name) => { if (SHOTS) await p.screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
47
49
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* its place; Move to another program lists the other program with its count; a phone's ⋯ holds the same items
|
|
10
10
|
* H Home: the initiative page's ⋯ holds the same two items; an initiative in no program keeps Turn into a program and has neither */
|
|
11
11
|
const fs = require('fs');
|
|
12
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
12
13
|
const os = require('os');
|
|
13
14
|
const path = require('path');
|
|
14
15
|
const { Readable } = require('stream');
|
|
@@ -78,7 +79,7 @@ const waitsOf = (id) => ((R.all(rctx).find((p) => p.id === 'project-ascent') ||
|
|
|
78
79
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
79
80
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
80
81
|
await T.waitForServer(BASE);
|
|
81
|
-
browser = besidePage(await chromium.launch({ executablePath: exe }));
|
|
82
|
+
browser = classicBoard(besidePage(await chromium.launch({ executablePath: exe })));
|
|
82
83
|
|
|
83
84
|
const board = async (o = {}) => {
|
|
84
85
|
seed();
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* (the programs, products and a product's initiatives are Home's and the Board's own lists, [data-po-list^="@"]: sort-order-test.js)
|
|
9
9
|
* H Home: the program group lists the same order; the grip moves a row there too; a phone holds the row, then drags it */
|
|
10
10
|
const path = require('path');
|
|
11
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
11
12
|
const { spawn } = require('child_process');
|
|
12
13
|
const { findBrowser } = require('./lib/find-browser');
|
|
13
14
|
const T = require('./test-run').configure({ name: 'program-order' });
|
|
@@ -53,7 +54,7 @@ const routePrograms = async (page) => {
|
|
|
53
54
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
54
55
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
55
56
|
await T.waitForServer(BASE);
|
|
56
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
57
|
+
browser = classicBoard(await chromium.launch({ executablePath: exe }));
|
|
57
58
|
|
|
58
59
|
const board = async (o = {}) => {
|
|
59
60
|
const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 }, hasTouch: !!o.touch });
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* KRs (GET /api/boards/anchors), the Insights goals (GET /api/insights-premium) and the PMOS tasks (GET /api/boards/items) answer from
|
|
14
14
|
* fixtures/program-ascent.js. */
|
|
15
15
|
const path = require('path');
|
|
16
|
+
const { besidePage } = require('./lib/beside-page'); // these checks read the full page beside the page; in the popup work shows its three parts (nav slice 3)
|
|
17
|
+
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
16
18
|
const { spawn } = require('child_process');
|
|
17
19
|
const { findBrowser } = require('./lib/find-browser');
|
|
18
20
|
const { openMission } = require('./lib/open-mission');
|
|
@@ -44,7 +46,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
44
46
|
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
45
47
|
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
46
48
|
await T.waitForServer(BASE);
|
|
47
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
49
|
+
browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
|
|
48
50
|
|
|
49
51
|
const open = async ({ w = 1440, h = 900, qs = '?ws=idpf&program=project-ascent', ctx = null, programs = F.programs() } = {}) => {
|
|
50
52
|
const c = ctx || await openMission(await browser.newContext({ viewport: { width: w, height: h } }));
|
|
@@ -38,6 +38,9 @@ import * as MD from './home-ini-model.js'; // the stage move's rules, as Home
|
|
|
38
38
|
import * as WF from './ini-wf.js'; // D99: Change workflow, Won't do, Back to Triage, Archive, the same popovers as Home's
|
|
39
39
|
import { openPop, closePop, undoToast, ensureCss as ensurePopCss } from './hi-pop.js';
|
|
40
40
|
import { readyOf } from './bd-acts.js'; // how much of the step is ready, beside the next stage in the stage picker
|
|
41
|
+
import * as PW from './cozy-pop-work.js'; // what the popup shows for work (slice 3 of the six-place navigation): in the popup, in place of the old page
|
|
42
|
+
import * as PP from './ini-props.js'; // everything PMOS suggests, as a drill-in (the popup's ⋯)
|
|
43
|
+
import { stageName } from './stage-chip.js';
|
|
41
44
|
import { iniMore as iniMoreOf, iniText, stagePick, deleteSaid, DELETE_MS } from './ini-more.js'; // the one initiative ⋯ menu and stage picker (batch 14 item 5, batch 16 item 5c)
|
|
42
45
|
|
|
43
46
|
let O = null;
|
|
@@ -181,9 +184,10 @@ function dashFor(r) {
|
|
|
181
184
|
}
|
|
182
185
|
return DASH.get(r.key);
|
|
183
186
|
}
|
|
184
|
-
function iniBody(r) {
|
|
187
|
+
function iniBody(r, body) {
|
|
185
188
|
const h = dashFor(r);
|
|
186
189
|
if (h && h.shows()) return h.html(() => '');
|
|
190
|
+
if (PW.on(body)) return PW.html(r, viewOf(r), popOpts(r));
|
|
187
191
|
const md = (v) => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][+v.slice(5, 7) - 1] + ' ' + +v.slice(8, 10) + (+v.slice(0, 4) !== new Date().getFullYear() ? ' ’' + v.slice(2, 4) : '');
|
|
188
192
|
const self = !!((O.M() || {}).board || {}).self, M = O.M() || {};
|
|
189
193
|
// what left the ⋯ for the thing it changes (batch 16 item 5c): the workflow chip, the dashed +, the stage chip, the dates chip, Jira's ↻
|
|
@@ -193,10 +197,65 @@ function iniBody(r) {
|
|
|
193
197
|
next: !!(r.id && v.stage.next && O.moreAct && !self), docs: docs.length ? { n: docs.length } : null, tail: TL.tailHtml(r, { VW, today: M.today }),
|
|
194
198
|
wf: !!r.id && !self && !r.ended, person: !!r.id, stagePick: !!r.id, planDates: !!r.id, jira: !!M.jira });
|
|
195
199
|
}
|
|
200
|
+
/** What pm/cozy-pop-work.js reads for the row: the Board's steps and day, the core documents, the product and the program. */
|
|
201
|
+
function popOpts(r) {
|
|
202
|
+
const M = O.M() || {}, B = M.board || {}, p = O.programOf ? O.programOf(r) : null;
|
|
203
|
+
return { steps: M.steps || [], today: M.today, docs: ((r.id && PAGE.get(r.id)) || {}).docs || [], product: r.wsName || (r.ws && r.ws !== B.ws ? r.ws : (M.product && M.product.name) || B.name || B.ws) || '', program: p ? { id: p.id, title: p.title } : null, canProduct: true, ws: r.ws || B.ws || '', id: r.id || '' };
|
|
204
|
+
}
|
|
205
|
+
/** The popup's own presses for the row: every part of the old page as a drill-in (so nothing is lost), and everything PMOS suggests. */
|
|
206
|
+
function popExtra(r) {
|
|
207
|
+
if (!r) return {};
|
|
208
|
+
const H = { where: () => where(O.rowOf(r.key) || r), reload: () => (O.reload ? O.reload() : null), toast: (m, u) => (O.toast ? O.toast(m, u) : null) };
|
|
209
|
+
return {
|
|
210
|
+
allParts: () => {
|
|
211
|
+
const x = O.rowOf(r.key) || r;
|
|
212
|
+
VW.drill();
|
|
213
|
+
VW.open({ kind: 'Initiative', title: x.title, icon: 'goal', id: 'all:' + vidOf(x), back: true,
|
|
214
|
+
render: (b) => { b.dataset.pwAll = '1'; const y = O.rowOf(r.key) || x; b.innerHTML = iniBody(y, b); wire(b, y.key); } });
|
|
215
|
+
},
|
|
216
|
+
props: r.id ? () => { const x = O.rowOf(r.key) || r; VW.drill(); PP.open(viewOf(x), H); } : null,
|
|
217
|
+
product: () => openProduct(O.rowOf(r.key) || r),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/** The product one level up, in the same popup (board 27): its programs, then the initiatives in no program, with the timeline. A row goes one
|
|
221
|
+
* level down. Read from the Board's own model, so nothing new is fetched. */
|
|
222
|
+
function productOf(ws) {
|
|
223
|
+
const M = O.M() || {}, B = M.board || {}, today = M.today;
|
|
224
|
+
const all = (M.rows || []).filter((x) => x.id && !x.archived && (x.ws || B.ws || '') === ws); // the board's own row (no id) is not work
|
|
225
|
+
const progs = new Map(), loose = [];
|
|
226
|
+
for (const x of all) { const p = O.programOf ? O.programOf(x) : null; if (p) { if (!progs.has(p.id)) progs.set(p.id, { p, rows: [] }); progs.get(p.id).rows.push(x); } else loose.push(x); }
|
|
227
|
+
const lo = (rs) => rs.map((x) => String(x.start || '').slice(0, 10)).filter(Boolean).sort()[0] || '';
|
|
228
|
+
const hi = (rs) => rs.map((x) => String(x.end || '').slice(0, 10)).filter(Boolean).sort().pop() || '';
|
|
229
|
+
const done = (x) => x.status === 'done' || !!x.closed;
|
|
230
|
+
const rows = [];
|
|
231
|
+
for (const { p, rows: rs } of progs.values()) rows.push({ id: p.id, kind: 'program', title: p.title, stage: '', count: rs.length + (rs.length === 1 ? ' initiative' : ' initiatives'), start: lo(rs), end: hi(rs), done: rs.every(done) });
|
|
232
|
+
for (const x of loose) rows.push({ id: x.key, kind: 'ini', title: x.title, stage: stageName(x) || (x.track && x.track.label) || '', start: String(x.start || '').slice(0, 10), end: String(x.end || '').slice(0, 10), done: done(x) });
|
|
233
|
+
const name = (all[0] && all[0].wsName) || (ws === B.ws ? (M.product && M.product.name) || B.name : '') || ws;
|
|
234
|
+
const late = rows.filter((x) => x.end && !x.done && today && x.end < today).length;
|
|
235
|
+
const facts = [{ k: 'Programs', v: String(progs.size) }, { k: 'Initiatives', v: String(all.length), note: late ? late + ' late' : '', warn: late > 0 }];
|
|
236
|
+
const mo = (d) => (d ? new Date(d + 'T12:00:00Z').toLocaleDateString('en-GB', { month: 'short', year: 'numeric', timeZone: 'UTC' }) : '');
|
|
237
|
+
if (lo(all) || hi(all)) facts.push({ k: 'Dates', v: [mo(lo(all)), mo(hi(all))].filter(Boolean).join(' to ') });
|
|
238
|
+
const said = all.length ? all.length + (all.length === 1 ? ' initiative' : ' initiatives') + (progs.size ? ' in ' + progs.size + (progs.size === 1 ? ' program' : ' programs') + (loose.length ? ' and ' + loose.length + ' on their own' : '') : '') + (late ? ', ' + late + ' late.' : ', none late.') : 'No initiative is in it yet.';
|
|
239
|
+
return { kind: 'product', title: name, summary: said, facts, rows, docs: [], today };
|
|
240
|
+
}
|
|
241
|
+
function openProduct(r) {
|
|
242
|
+
const M = O.M() || {}, ws = r.ws || (M.board || {}).ws || '';
|
|
243
|
+
const L0 = productOf(ws);
|
|
244
|
+
VW.drill();
|
|
245
|
+
VW.open({ kind: 'Product', title: L0.title, icon: 'goal', id: 'product:' + ws, back: true,
|
|
246
|
+
render: (body) => {
|
|
247
|
+
const L = productOf(ws);
|
|
248
|
+
body.innerHTML = PW.levelHtml(L, { today: L.today, add: false });
|
|
249
|
+
PW.wireLevel(body, {
|
|
250
|
+
redraw: () => { const t = body.scrollTop, L2 = productOf(ws); body.innerHTML = PW.levelHtml(L2, { today: L2.today, add: false }); body.scrollTop = t; },
|
|
251
|
+
go: (kind, id, b) => { if (kind === 'program' && O.openProgram) { VW.drill(); O.openProgram(id, b); } else if (kind === 'ini' && O.openIniId) { const x = O.rowOf(id); VW.drill(); if (x && x.id) O.openIniId(x.id); } },
|
|
252
|
+
}, () => productOf(ws));
|
|
253
|
+
} });
|
|
254
|
+
}
|
|
196
255
|
/** Presses inside the shown item: the view's own (pm/ini-view.js), a ticket's drill-in, the PRD-change question. A [data-doc] goes to the page's handler. */
|
|
197
256
|
function wire(body, key) {
|
|
198
|
-
const redraw = () => { const r = O.rowOf(key); if (!r || (cur && cur.tk)) return; const top = body.scrollTop; body.innerHTML = iniBody(r); body.scrollTop = top; };
|
|
199
|
-
|
|
257
|
+
const redraw = () => { const r = O.rowOf(key); if (!r || (cur && cur.tk && !body.dataset.pwAll)) return; const top = body.scrollTop; body.innerHTML = iniBody(r, body); body.scrollTop = top; };
|
|
258
|
+
const H = {
|
|
200
259
|
// planned versus actual (batch 11 item 8, pm/ini-versions.js): where a draft's writes go, the read after Make live, the toast with Undo
|
|
201
260
|
where: () => { const r = O.rowOf(key), M = O.M() || {}; return { ws: (r && r.ws) || (M.board && M.board.ws), board: (r && r.boardId) || (M.board && M.board.id) }; },
|
|
202
261
|
reload: () => (O.reload ? O.reload() : null),
|
|
@@ -239,7 +298,13 @@ function wire(body, key) {
|
|
|
239
298
|
openIni: (id) => { if (O.openIniId) O.openIniId(id); },
|
|
240
299
|
doc: (path) => O.viewDoc(path),
|
|
241
300
|
redraw,
|
|
242
|
-
}
|
|
301
|
+
};
|
|
302
|
+
// in the popup: what the popup shows for work (pm/cozy-pop-work.js), with the same handlers; else the old page
|
|
303
|
+
if (PW.on(body)) {
|
|
304
|
+
PW.wire(body, { ...H, ...popExtra(O.rowOf(key)) }, { r: () => O.rowOf(key), v: () => { const r = O.rowOf(key); return r ? viewOf(r) : null; }, o: () => { const r = O.rowOf(key); return r ? popOpts(r) : {}; } });
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
wireView(body, H);
|
|
243
308
|
body.onclick = (e) => {
|
|
244
309
|
const r = O.rowOf(key); if (!r) return;
|
|
245
310
|
const tk = e.target.closest('[data-tk]'); if (tk) { const k = ((r.track && r.track.tickets) || []).find((x) => x.key === tk.dataset.tk); if (k) openTicket(r, k); return; }
|
|
@@ -262,7 +327,7 @@ export function openIni(r, from, o = {}) {
|
|
|
262
327
|
// on a desk it opens in the one popup with Ask PMOS about it beside it (slice 2 of the six-place navigation); a phone keeps its sheet
|
|
263
328
|
const B = (O.M() || {}).board || {};
|
|
264
329
|
VW.open({ kind: 'Initiative', title: r.title, icon: 'goal', wrap: true, id: vidOf(r), pop: { id: r.id || '', kind: 'initiative', title: r.title, ws: r.ws || B.ws || undefined },
|
|
265
|
-
discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: () =>
|
|
330
|
+
discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: () => { const x = O.rowOf(r.key) || r, b = VW.bodyOf(vidOf(x)); return (PW.on(b) ? PW.moreItems(null, popExtra(x)) : []).concat(iniMore(x)); }, rename: O.rename ? O.rename(r) : null,
|
|
266
331
|
// the kind of work (batch 29 item 11, KdV1-3): its glyph stands before Discuss; a tap opens the three kinds. A published copy
|
|
267
332
|
// (pm/readonly.js) cannot change it, so it has no press: the Board's icon still names the kind
|
|
268
333
|
presses: (window.PMOS_READONLY ? [] : [WK.pressOf(r.kind)]).concat(dashFor(r) ? dashFor(r).presses() : []), onPress: (a, b) => {
|
|
@@ -273,7 +338,7 @@ export function openIni(r, from, o = {}) {
|
|
|
273
338
|
apply: (k) => { const y = O.rowOf(r.key) || x; y.kind = k; VW.setPresses(vidOf(y), [WK.pressOf(k)].concat(dashFor(y) ? dashFor(y).presses() : [])); if (O.redraw) O.redraw(); refresh(true); },
|
|
274
339
|
reload: async () => { if (O.reload) await O.reload(); } }), !!((O.M() || {}).board || {}).factory);
|
|
275
340
|
},
|
|
276
|
-
render: (body) => { const x = O.rowOf(r.key) || r; cur = { key: x.key, tk: null, vid: vidOf(x) }; O.onShow(x.key, from); body.innerHTML = iniBody(x); wire(body, x.key); { const h = dashFor(x); if (h) h.wire(body); } if (adding === x.key) { const f = body.querySelector('#ivAddTask'); if (f && document.activeElement !== f) f.focus(); } },
|
|
341
|
+
render: (body) => { const x = O.rowOf(r.key) || r; cur = { key: x.key, tk: null, vid: vidOf(x) }; O.onShow(x.key, from); body.innerHTML = iniBody(x, body); wire(body, x.key); { const h = dashFor(x); if (h) h.wire(body); } if (adding === x.key) { const f = body.querySelector('#ivAddTask'); if (f && document.activeElement !== f) f.focus(); } },
|
|
277
342
|
onClose: () => { if (cur && cur.key === r.key && !cur.tk) { cur = null; O.onHide(); } } });
|
|
278
343
|
}
|
|
279
344
|
|
|
@@ -307,7 +372,7 @@ export function refresh(force) {
|
|
|
307
372
|
const b = VW.bodyOf(vidOf(r)); if (!b || (!force && document.activeElement && b.contains(document.activeElement))) return;
|
|
308
373
|
if (cur.tk) return; // the ticket Viewer reads its own records (tk-view.js); Read Jira again opens it fresh
|
|
309
374
|
const top = b.scrollTop;
|
|
310
|
-
b.innerHTML = iniBody(r);
|
|
375
|
+
b.innerHTML = iniBody(r, b);
|
|
311
376
|
b.scrollTop = top;
|
|
312
377
|
}
|
|
313
378
|
/** Close the initiative's own Viewer (never the chat beside it). A ticket drilled in shows under its own id: the Viewer used last, as before. */
|
|
@@ -40,7 +40,8 @@ import * as MSG from './ms-suggest.js';
|
|
|
40
40
|
import * as MD from './metric-drafts.js'; // the goal Claude drafts when the charter has none (batch 15 item 1, canvas Iq9Program)
|
|
41
41
|
import * as DB from './dash-view.js'; // the page model's parts: the reports and the proposals (batch 17 item 1)
|
|
42
42
|
import { stageName } from './stage-chip.js'; // W1: the one stage
|
|
43
|
-
import * as PV from './prog-page.js';
|
|
43
|
+
import * as PV from './prog-page.js';
|
|
44
|
+
import * as PW from './cozy-pop-work.js'; // in the popup: the program one level up, the same three parts as an initiative (slice 3, board 26) // the one program page: the top and four tabs (batch 21 item 2, canvas RdProgL–RdProgP)
|
|
44
45
|
|
|
45
46
|
const SV = (d, w) => `<svg viewBox="0 0 24 24" width="${w || 18}" height="${w || 18}" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
46
47
|
const I = {
|
|
@@ -413,6 +414,7 @@ function draw(keepFocus) {
|
|
|
413
414
|
const p = progOf(cur.id); if (!p) { VW.close(); return; }
|
|
414
415
|
readAway(p); readMore(p); readDrafts(p);
|
|
415
416
|
const b = VW.body(); if (!b) return;
|
|
417
|
+
if (PW.on(b)) { const t = b.scrollTop, L = levelOf(cur.id); if (L) { b.innerHTML = PW.levelHtml(L, { today: L.today, add: false }); b.scrollTop = t; } return; } // the program in the popup (board 26)
|
|
416
418
|
const f = keepFocus && document.activeElement && b.contains(document.activeElement) ? document.activeElement : null;
|
|
417
419
|
const sel = f ? (f.dataset.pp ? `[data-pp="${f.dataset.pp}"]` + (f.dataset.fold ? `[data-fold="${CSS.escape(f.dataset.fold)}"]` : '') + (f.dataset.key ? `[data-key="${CSS.escape(f.dataset.key)}"]` : '') + (f.dataset.ms ? `[data-ms="${CSS.escape(f.dataset.ms)}"]` : '') : f.dataset.czsFold ? `[data-czs-fold="${CSS.escape(f.dataset.czsFold)}"]` : null) : null;
|
|
418
420
|
const top = b.scrollTop;
|
|
@@ -474,9 +476,59 @@ function openPanel(id, from, via) {
|
|
|
474
476
|
rename.save = ((save) => async (title, x) => { const r = await save(title, x); if (!r.ok) return r; p.title = r.title; rename.value = r.title; return { ...r, title: titleOf(p) }; })(rename.save);
|
|
475
477
|
rename.value = p.title;
|
|
476
478
|
VW.open({ kind: 'Program', title: titleOf(p), icon: I.prog, id: 'program:' + id,
|
|
477
|
-
|
|
479
|
+
// on a desk the program opens in the one popup, the chat about it beside it (slice 3 of the six-place navigation, board 26)
|
|
480
|
+
pop: RO ? undefined : { id: p.id, kind: 'program', title: p.title, ws: p.home || board().ws || undefined },
|
|
481
|
+
discuss: true, more: () => (PW.on(VW.bodyOf('program:' + id)) ? [{ label: 'Every part', on: () => allParts(id) }, { sep: true }] : []).concat(moreOf(progOf(id) || p)), rename,
|
|
478
482
|
render: (body) => {
|
|
479
483
|
{ const q = progOf(id); if (q && VW.current() && VW.current().title !== titleOf(q)) VW.retitle('program:' + id, titleOf(q)); } // a rename in the charter, on ←
|
|
484
|
+
if (PW.on(body)) { levelDraw(body, id, from); return; }
|
|
485
|
+
oldDraw(body, id, from);
|
|
486
|
+
},
|
|
487
|
+
onClose: () => {
|
|
488
|
+
document.querySelectorAll('#ibBody [data-prow].sel').forEach((x) => x.classList.remove('sel'));
|
|
489
|
+
cur = null;
|
|
490
|
+
} });
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
/** The program in the popup (board 26): Overview, its initiatives with the timeline, its artefacts. A row opens the initiative in the same popup. */
|
|
494
|
+
function levelOf(id) {
|
|
495
|
+
const p = progOf(id); if (!p) return null;
|
|
496
|
+
const st = programState(p, rowsOf);
|
|
497
|
+
const rows = st.inis.map((i) => ({ id: i.id, kind: 'ini', ws: i.ws, title: i.title, stage: stageName(i.row) || (i.row.track && i.row.track.label) || i.stage || '', start: i.row.start || '', end: i.row.end || '', done: i.row.status === 'done' || !!i.row.closed }));
|
|
498
|
+
const today = (O.M() || {}).today;
|
|
499
|
+
const late = rows.filter((x) => x.end && !x.done && today && x.end < today).length;
|
|
500
|
+
const nx = st.next;
|
|
501
|
+
const facts = [];
|
|
502
|
+
if (p.goal) facts.push({ k: 'Outcome', v: p.goal });
|
|
503
|
+
if (st.products && st.products.length) facts.push({ k: st.products.length > 1 ? 'Products' : 'Product', v: st.products.map((x) => x.name || x).join(', ') });
|
|
504
|
+
if (st.span && st.span.label) facts.push({ k: 'Dates', v: st.span.label });
|
|
505
|
+
if (nx) facts.push({ k: 'Next milestone', v: nx.name, note: nx.day || '', warn: !!nx.late });
|
|
506
|
+
if (rows.length) facts.push({ k: 'Initiatives', v: String(rows.length), note: late ? late + ' late' : '', warn: late > 0 });
|
|
507
|
+
if (p.owner) facts.push({ k: 'Owner', v: p.owner });
|
|
508
|
+
const said = [p.goal ? p.goal.replace(/\.?$/, '.') : '', rows.length ? (late ? late + ' of ' + rows.length + (rows.length === 1 ? ' initiative is' : ' initiatives are') + ' late.' : rows.length + (rows.length === 1 ? ' initiative' : ' initiatives') + ', none late.') : 'No initiative is in it yet.', nx ? 'Next: ' + nx.name + (nx.day ? ', ' + nx.day : '') + '.' : ''].filter(Boolean).join(' ');
|
|
509
|
+
const docs = [{ title: 'Charter', kind: 'Document', when: '', charter: true }].concat(docsOf(st).map((d) => ({ title: d.name, kind: 'Document · ' + d.ini, when: '', path: d.path })));
|
|
510
|
+
return { kind: 'program', title: p.title, summary: said, facts, rows, docs, today };
|
|
511
|
+
}
|
|
512
|
+
function levelDraw(body, id, from) {
|
|
513
|
+
cur = { id, from: from || (cur && cur.id === id && cur.from) || null };
|
|
514
|
+
const L = levelOf(id); if (!L) { body.innerHTML = ''; return; }
|
|
515
|
+
body.innerHTML = PW.levelHtml(L, { today: L.today, add: false });
|
|
516
|
+
PW.wireLevel(body, {
|
|
517
|
+
redraw: () => { const t = body.scrollTop; const L2 = levelOf(id); if (L2) { body.innerHTML = PW.levelHtml(L2, { today: L2.today, add: false }); body.scrollTop = t; } },
|
|
518
|
+
go: (kind, iid) => { if (kind === 'ini') { VW.drill(); O.openIni(iid, null); } },
|
|
519
|
+
doc: (path) => { const a = document.createElement('button'); a.dataset.doc = path; a.hidden = true; document.body.appendChild(a); a.click(); a.remove(); },
|
|
520
|
+
art: (a) => { if (!a || !a.charter) return false; const q = progOf(id); if (q) openCharter(q); return true; },
|
|
521
|
+
}, () => levelOf(id));
|
|
522
|
+
}
|
|
523
|
+
/** Every part of the old program page, as a drill-in of the popup (so nothing is lost). */
|
|
524
|
+
function allParts(id) {
|
|
525
|
+
const p = progOf(id); if (!p) return;
|
|
526
|
+
VW.drill();
|
|
527
|
+
VW.open({ kind: 'Program', title: titleOf(p), icon: I.prog, id: 'program-all:' + id, back: true, more: moreOf(p),
|
|
528
|
+
render: (body) => { body.dataset.pwAll = '1'; oldDraw(body, id, null); } });
|
|
529
|
+
}
|
|
530
|
+
function oldDraw(body, id, from) {
|
|
531
|
+
{
|
|
480
532
|
cur = { id, from: from && !(VW.body() && VW.body().contains(from)) ? from : (cur && cur.id === id && cur.from) || null };
|
|
481
533
|
body.classList.add('pp-vw');
|
|
482
534
|
const q = progOf(id); if (q) { readAway(q); readMore(q); readDrafts(q); body.innerHTML = viewHtml(q); }
|
|
@@ -491,12 +543,7 @@ function openPanel(id, from, via) {
|
|
|
491
543
|
body.onclick = (e) => { if (e.target.closest('[data-db], [data-pv]')) return; const d = e.target.closest('[data-md]'); if (d && body.contains(d) && !d.disabled) { MD.press(d, { redraw: () => draw(), toast: (t) => O.say(t) }); return; } const m = e.target.closest('[data-ms-act]'); if (m && body.contains(m) && !m.disabled) { suggestPress(m); return; } const b = e.target.closest('[data-pp]'); if (b && body.contains(b)) press(b); };
|
|
492
544
|
body.onsubmit = submit;
|
|
493
545
|
document.querySelectorAll('#ibBody [data-prow]').forEach((x) => x.classList.toggle('sel', x.dataset.prow === id));
|
|
494
|
-
|
|
495
|
-
onClose: () => {
|
|
496
|
-
document.querySelectorAll('#ibBody [data-prow].sel').forEach((x) => x.classList.remove('sel'));
|
|
497
|
-
cur = null;
|
|
498
|
-
} });
|
|
499
|
-
return true;
|
|
546
|
+
}
|
|
500
547
|
}
|
|
501
548
|
function setFold(k) { if (fold.has(k)) fold.delete(k); else fold.add(k); keepFold(); draw(true); }
|
|
502
549
|
/** Opens one folding row (the track's clusters open Milestones, "N more tasks" opens On its initiatives) and scrolls to it. */
|