create-pmos 0.427.0 → 0.428.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 +13 -13
- 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-programs-test.js +16 -2
- package/workspace/briefing-premium-board-test.js +25 -20
- package/workspace/briefing-premium-test.js +2 -1
- package/workspace/changelog.json +12 -0
- package/workspace/guide/briefing-premium.md +4 -2
- package/workspace/guide/home.md +32 -7
- package/workspace/guide/programs.md +1 -0
- package/workspace/home-other-product-test.js +12 -2
- package/workspace/lib/routes-meeting-material.js +22 -1
- package/workspace/lib/settings-store.js +14 -0
- package/workspace/milestone-pins-test.js +13 -0
- package/workspace/milestone-suggest-test.js +10 -4
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +40 -13
- package/workspace/premium-rec-tab-test.js +8 -0
- package/workspace/premium-vw-item-test.js +7 -3
- package/workspace/premium-vw-jira-test.js +2 -1
- package/workspace/program-charter-test.js +1 -1
- package/workspace/program-leave-test.js +2 -2
- package/workspace/program-order-test.js +3 -2
- package/workspace/program-panel-test.js +2 -1
- package/workspace/public/pm/bd-acts.js +20 -26
- package/workspace/public/pm/bd-ini-panel.js +90 -32
- package/workspace/public/pm/bd-pin-card.js +4 -1
- package/workspace/public/pm/bd-span.js +22 -12
- package/workspace/public/pm/cozy-rec-tab.js +12 -3
- package/workspace/public/pm/cozy-viewer.js +157 -23
- package/workspace/public/pm/cozy-vw-shell.css +13 -0
- package/workspace/public/pm/hi-pop.css +82 -0
- package/workspace/public/pm/hi-pop.js +65 -0
- package/workspace/public/pm/home-app.js +55 -26
- package/workspace/public/pm/home-ini.css +6 -76
- package/workspace/public/pm/home-ini.js +50 -68
- package/workspace/public/pm/home-list.js +29 -3
- package/workspace/public/pm/home-today.js +18 -7
- package/workspace/public/pm/ini-more.js +67 -0
- package/workspace/public/pm/ini-view-model.js +3 -2
- package/workspace/public/pm/ini-view.css +3 -1
- package/workspace/public/pm/ini-view.js +7 -5
- package/workspace/public/pm/order-model.js +85 -0
- package/workspace/public/pm/premium-board.js +57 -11
- package/workspace/public/pm/premium-insights.js +11 -1
- package/workspace/public/pm/premium-vw-item.js +3 -1
- package/workspace/public/pm/premium-vw-jira.js +2 -0
- package/workspace/public/pm/prog-order.js +15 -2
- package/workspace/public/pm/sort-order.css +17 -0
- package/workspace/public/pm/sort-order.js +108 -0
- package/workspace/public/pm/tk-view.js +3 -2
- package/workspace/public/pm/wf-page.js +1 -1
- package/workspace/public/premium-board.html +1 -0
- package/workspace/sort-order-test.js +201 -0
- package/workspace/stage-card-test.js +1 -0
- package/workspace/task-card-test.js +1 -1
- package/workspace/test-lists/sort-order.json +6 -0
- package/workspace/test-lists/viewer-trail.json +5 -0
- package/workspace/tk-tasks-test.js +5 -3
- package/workspace/viewer-trail-test.js +145 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* viewer-trail-test.js — one trail for ← →, the browser's Back and Forward and a phone's back swipe (feedback batch 14 item 7; canvas
|
|
4
|
+
* Exploring · Navigation NvADesk, NvAPhone, NvAPhoneTrail, NvAFlow). Serves the real Home page from the real server with the Briefing model
|
|
5
|
+
* answered by a stand-in, then drives window.czViewer with real presses: a press inside the Viewer drills in, a press on the page starts a
|
|
6
|
+
* new trail.
|
|
7
|
+
* D drill-in by a press inside · B ← and its name · F → only after a back, dropped by a new open · H the browser's Back and Forward walk
|
|
8
|
+
* the same trail, Back at the first item closes · L the trail list (hover on a desk, hold on a phone) jumps · N a press outside starts a
|
|
9
|
+
* new trail · C close takes the trail's entries off · P a phone: ← at the first item closes. Every wait polls the page. */
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const { spawn } = require('child_process');
|
|
12
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
13
|
+
const T = require('./test-run').configure({ name: 'viewer-trail' });
|
|
14
|
+
const B = require('./lib/briefing-premium.js');
|
|
15
|
+
const F = require('./fixtures/briefing-premium-facts.js');
|
|
16
|
+
|
|
17
|
+
const BASE = T.BASE;
|
|
18
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
19
|
+
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
20
|
+
const results = [];
|
|
21
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
22
|
+
let srv = null; let browser = null;
|
|
23
|
+
const finish = async (code) => {
|
|
24
|
+
if (browser) await browser.close().catch(() => {});
|
|
25
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
26
|
+
T.killTmux();
|
|
27
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
28
|
+
console.log(`\n${results.length - bad}/${results.length} viewer-trail assertions passed`);
|
|
29
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
30
|
+
};
|
|
31
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
32
|
+
|
|
33
|
+
(async () => {
|
|
34
|
+
const exe = process.env.PMOS_CHROMIUM || findBrowser();
|
|
35
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
36
|
+
let chromium;
|
|
37
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
38
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
39
|
+
await T.waitForServer(BASE);
|
|
40
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
41
|
+
|
|
42
|
+
/* Home, plus two test presses: one on the page (outside the Viewer) and items whose own rows open the next item (inside it). */
|
|
43
|
+
const open = async ({ w = 1440, h = 900, touch = false } = {}) => {
|
|
44
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: touch });
|
|
45
|
+
const page = await ctx.newPage();
|
|
46
|
+
const S = { errors: [] };
|
|
47
|
+
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
48
|
+
await page.route('**/api/briefing-premium*', (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: B.build(F.facts()), as_of: Date.now() }) }));
|
|
49
|
+
await page.goto(BASE + '/premium.html?theme=light');
|
|
50
|
+
S.up = await until(() => page.evaluate(() => document.querySelectorAll('#hmList .hm-r').length > 0 && !!window.czViewer), 20000);
|
|
51
|
+
await page.evaluate(() => {
|
|
52
|
+
const item = (x) => ({ id: 't:' + x, kind: 'Ticket', title: 'Item ' + x, icon: 'jira',
|
|
53
|
+
html: `<p>${x}</p>${['A', 'B', 'C', 'D', 'E'].filter((y) => y !== x).map((y) => `<button type="button" data-tgo="${y}">${y}</button>`).join('')}` });
|
|
54
|
+
window.__item = item;
|
|
55
|
+
document.addEventListener('click', (e) => { const b = e.target.closest('[data-tgo]'); if (b) setTimeout(() => window.czViewer.open(item(b.dataset.tgo)), 30); }); // a module that reads first
|
|
56
|
+
const o = document.createElement('div'); o.id = 'tOut'; o.style.cssText = 'position:fixed;left:8px;bottom:8px;z-index:1;display:flex;gap:4px';
|
|
57
|
+
o.innerHTML = '<button type="button" data-tgo="A">A</button><button type="button" data-tgo="E">E</button>';
|
|
58
|
+
document.body.append(o);
|
|
59
|
+
});
|
|
60
|
+
return { page, ctx, S };
|
|
61
|
+
};
|
|
62
|
+
const st = (page) => page.evaluate(() => {
|
|
63
|
+
const v = document.querySelector('#czViewer'), q = (s) => v && v.querySelector(s);
|
|
64
|
+
return { open: !!v && !v.hidden, title: (q('#czVwTitle') || {}).textContent || '', back: q('[data-cz-vw="back"]') ? q('[data-cz-vw="back"]').getAttribute('aria-label') : null,
|
|
65
|
+
fwd: q('[data-cz-vw="fwd"]') ? q('[data-cz-vw="fwd"]').getAttribute('aria-label') : null, trail: window.czViewer.trail(), h: history.state && history.state.czvw ? history.state.czvw.i : null, s: history.state && history.state.czvw ? history.state.czvw.s : null, len: history.length };
|
|
66
|
+
});
|
|
67
|
+
const at = (page, title) => until(async () => { const s = await st(page); return s.open && s.title === title ? s : null; });
|
|
68
|
+
const press = async (page, x, inside = true) => { await page.click(inside ? `#czViewer [data-tgo="${x}"]` : `#tOut [data-tgo="${x}"]`); return at(page, 'Item ' + x); };
|
|
69
|
+
|
|
70
|
+
{
|
|
71
|
+
const { page, ctx, S } = await open();
|
|
72
|
+
ok('0 Home loads with the Viewer', S.up);
|
|
73
|
+
const len0 = await page.evaluate(() => history.length), s0 = (await st(page)).s; // the page's own entry (Home may draw its day in the Viewer)
|
|
74
|
+
let s = await press(page, 'A', false);
|
|
75
|
+
ok('N a press on the page opens a new trail: on a desk no ← at its first item', s && s.back === null && s.fwd === null && s.h === 0 && s.len === len0 + 1, JSON.stringify(s));
|
|
76
|
+
await press(page, 'B'); s = await press(page, 'C');
|
|
77
|
+
ok('D a press inside the Viewer keeps the item behind it, and ← names where it goes', s && s.back === 'Back to Item B' && JSON.stringify(s.trail.back) === '["Item B","Item A"]' && s.h === 2, JSON.stringify(s));
|
|
78
|
+
await page.click('#czViewer [data-cz-vw="back"]');
|
|
79
|
+
s = await at(page, 'Item B');
|
|
80
|
+
ok('B ← goes one step back; → shows after a back and names where it goes', s && s.back === 'Back to Item A' && s.fwd === 'Forward to Item C', JSON.stringify(s));
|
|
81
|
+
ok('H the history follows ←', await until(async () => (await st(page)).h === 1), JSON.stringify(await st(page)));
|
|
82
|
+
await page.goBack();
|
|
83
|
+
s = await at(page, 'Item A');
|
|
84
|
+
ok('H the browser\'s Back walks the same trail', s && s.back === null && JSON.stringify(s.trail.ahead) === '["Item B","Item C"]', JSON.stringify(s));
|
|
85
|
+
await page.goForward(); s = await at(page, 'Item B');
|
|
86
|
+
await page.goForward(); s = await at(page, 'Item C');
|
|
87
|
+
ok('H the browser\'s Forward walks it again, to the end', s && s.fwd === null && s.back === 'Back to Item B', JSON.stringify(s));
|
|
88
|
+
await page.click('#czViewer [data-cz-vw="fwd"]').catch(() => {});
|
|
89
|
+
await page.click('#czViewer [data-cz-vw="back"]'); await at(page, 'Item B');
|
|
90
|
+
s = await press(page, 'D');
|
|
91
|
+
ok('F a new open from inside drops the steps ahead: no →', s && s.fwd === null && JSON.stringify(s.trail.back) === '["Item B","Item A"]', JSON.stringify(s));
|
|
92
|
+
await page.goBack(); s = await at(page, 'Item B');
|
|
93
|
+
ok('F the browser\'s Forward leads to the new step, not the dropped one', s && s.fwd === 'Forward to Item D', JSON.stringify(s));
|
|
94
|
+
await page.goForward(); await at(page, 'Item D');
|
|
95
|
+
|
|
96
|
+
// the trail list: hover ← on a desk
|
|
97
|
+
await page.hover('#czViewer [data-cz-vw="back"]');
|
|
98
|
+
const list = await until(() => page.evaluate(() => { const m = document.querySelector('#czViewer .cz-vw-trail'); return m ? [...m.querySelectorAll('button')].map((b) => b.textContent.trim() + (b.classList.contains('here') ? '*' : '')) : null; }), 3000);
|
|
99
|
+
ok('L hovering ← lists the trail, newest first, ending at the page it started on', JSON.stringify(list) === '["Item D*","Item B","Item A","Home"]', JSON.stringify(list));
|
|
100
|
+
await page.click('#czViewer .cz-vw-trail [data-cz-vw-go="-2"]');
|
|
101
|
+
s = await at(page, 'Item A');
|
|
102
|
+
ok('L a press in the list jumps there, and → leads back along it', s && s.fwd === 'Forward to Item B' && JSON.stringify(s.trail.ahead) === '["Item B","Item D"]', JSON.stringify(s));
|
|
103
|
+
ok('L the history moved with the jump', await until(async () => (await st(page)).h === 0), JSON.stringify(await st(page)));
|
|
104
|
+
|
|
105
|
+
// Back at the first item closes, and the page is as it was
|
|
106
|
+
await page.goBack();
|
|
107
|
+
ok('H Back at the trail\'s first item closes the Viewer', await until(async () => !(await st(page)).open), JSON.stringify(await st(page)));
|
|
108
|
+
await page.goForward();
|
|
109
|
+
ok('C Forward after that does not bring a closed item back', await until(async () => { const x = await st(page); return !x.open && x.s === s0; }), JSON.stringify(await st(page)));
|
|
110
|
+
|
|
111
|
+
// a press outside starts a new trail; close takes the trail's entries off
|
|
112
|
+
await press(page, 'A', false); await press(page, 'B'); s = await press(page, 'E', false);
|
|
113
|
+
ok('N a press on the page while the Viewer is open starts a new trail in place of the old one', s && s.back === null && s.trail.back.length === 0 && s.h === 0, JSON.stringify(s));
|
|
114
|
+
await press(page, 'C');
|
|
115
|
+
await page.click('#czViewer [data-cz-vw="close"]');
|
|
116
|
+
ok('C × closes and the trail\'s entries come off: the page\'s own entry is the one shown', await until(async () => { const x = await st(page); return !x.open && x.s === s0; }), JSON.stringify(await st(page)));
|
|
117
|
+
await page.goForward().catch(() => {});
|
|
118
|
+
ok('C Forward after a close does not reopen it', await until(async () => !(await st(page)).open), JSON.stringify(await st(page)));
|
|
119
|
+
ok('0 no page errors', S.errors.length === 0, S.errors.join(' | '));
|
|
120
|
+
await ctx.close();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* P a phone: ← at the first item closes; hold ← for the trail as a sheet */
|
|
124
|
+
{
|
|
125
|
+
const { page, ctx, S } = await open({ w: 390, h: 844, touch: true });
|
|
126
|
+
let s = await press(page, 'A', false);
|
|
127
|
+
ok('P on a phone ← at the trail\'s first item closes the Viewer', s && s.back === 'Close the viewer', JSON.stringify(s));
|
|
128
|
+
await press(page, 'B'); s = await press(page, 'C');
|
|
129
|
+
ok('P ← names the item it goes back to', s && s.back === 'Back to Item B', JSON.stringify(s));
|
|
130
|
+
await page.evaluate(() => document.querySelector('#czViewer [data-cz-vw="back"]').dispatchEvent(new PointerEvent('pointerdown', { pointerType: 'touch', bubbles: true })));
|
|
131
|
+
const sheet = await until(() => page.evaluate(() => { const m = document.querySelector('#czViewer .cz-vw-trail'); if (!m) return null; const r = m.getBoundingClientRect(); return { n: m.querySelectorAll('button').length, bottom: Math.round(r.bottom), w: Math.round(r.width) }; }), 3000);
|
|
132
|
+
ok('P holding ← shows the trail as a sheet along the bottom', sheet && sheet.n === 4 && sheet.bottom === 844 && sheet.w === 390, JSON.stringify(sheet));
|
|
133
|
+
await page.evaluate(() => document.querySelector('#czViewer [data-cz-vw="back"]').dispatchEvent(new PointerEvent('pointerup', { pointerType: 'touch', bubbles: true })));
|
|
134
|
+
await page.click('#czViewer .cz-vw-trail [data-cz-vw-go="-3"]');
|
|
135
|
+
ok('P the page row in the list closes the Viewer', await until(async () => !(await st(page)).open), JSON.stringify(await st(page)));
|
|
136
|
+
await press(page, 'A', false); await press(page, 'B');
|
|
137
|
+
await page.goBack(); s = await at(page, 'Item A');
|
|
138
|
+
ok('P the back swipe (the browser\'s Back) goes one step back', !!s, JSON.stringify(await st(page)));
|
|
139
|
+
await page.click('#czViewer [data-cz-vw="back"]');
|
|
140
|
+
ok('P then ← at the first item closes', await until(async () => !(await st(page)).open), JSON.stringify(await st(page)));
|
|
141
|
+
ok('P no page errors', S.errors.length === 0, S.errors.join(' | '));
|
|
142
|
+
await ctx.close();
|
|
143
|
+
}
|
|
144
|
+
finish();
|
|
145
|
+
})();
|