create-pmos 0.692.0 → 0.694.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.
Files changed (110) hide show
  1. package/package.json +22 -16
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/adler-moments-test.js +3 -35
  7. package/workspace/adler-seasons-test.js +1 -1
  8. package/workspace/briefing-premium-adddoc-test.js +1 -1
  9. package/workspace/briefing-premium-board-test.js +1 -1
  10. package/workspace/briefing-premium-doc-edit-test.js +1 -1
  11. package/workspace/briefing-premium-work-test.js +2 -2
  12. package/workspace/changelog.json +21 -2
  13. package/workspace/chat-asks-test.js +1 -1
  14. package/workspace/core-docs-workflow-test.js +1 -1
  15. package/workspace/ev-everywhere-test.js +3 -14
  16. package/workspace/guide/home.md +2 -2
  17. package/workspace/guide/layout.md +2 -2
  18. package/workspace/guide/settings-and-switches.md +0 -1
  19. package/workspace/impact-screens-test.js +2 -47
  20. package/workspace/ini-workflow-test.js +1 -1
  21. package/workspace/lib/board-grill.js +17 -24
  22. package/workspace/lib/discovery-questions.js +36 -0
  23. package/workspace/lib/routes-board-grill.js +31 -3
  24. package/workspace/live-pill-round-test.js +6 -18
  25. package/workspace/milestone-suggest-test.js +4 -28
  26. package/workspace/news-viewers-test.js +3 -29
  27. package/workspace/package-lock.json +2 -2
  28. package/workspace/package.json +1 -1
  29. package/workspace/premium-board-actions-test.js +3 -3
  30. package/workspace/premium-briefing-depth-test.js +4 -4
  31. package/workspace/premium-chat-attach-test.js +3 -2
  32. package/workspace/premium-chat-chart-tab-test.js +8 -7
  33. package/workspace/premium-chat-context-test.js +3 -1
  34. package/workspace/premium-chat-goal-view-test.js +3 -1
  35. package/workspace/premium-chat-line-test.js +8 -6
  36. package/workspace/premium-chat-report-tab-test.js +13 -5
  37. package/workspace/premium-chat-term-test.js +2 -2
  38. package/workspace/premium-chat-viewer-test.js +10 -16
  39. package/workspace/premium-core-doc-issue-test.js +7 -2
  40. package/workspace/premium-discuss-landing-test.js +9 -5
  41. package/workspace/premium-html-viewer-test.js +7 -3
  42. package/workspace/premium-link-suggest-test.js +6 -10
  43. package/workspace/premium-phone-card-test.js +2 -2
  44. package/workspace/premium-viewer-download-test.js +1 -1
  45. package/workspace/premium-viewer-flicker-test.js +1 -1
  46. package/workspace/premium-viewer-share-test.js +2 -2
  47. package/workspace/premium-viewer-test.js +1 -1
  48. package/workspace/premium-vw-cal-test.js +1 -1
  49. package/workspace/premium-vw-copy-test.js +3 -3
  50. package/workspace/premium-vw-doc-test.js +1 -1
  51. package/workspace/premium-vw-item-test.js +1 -1
  52. package/workspace/premium-work-depth-test.js +2 -2
  53. package/workspace/program-charter-test.js +1 -12
  54. package/workspace/program-leave-test.js +2 -2
  55. package/workspace/program-order-test.js +3 -65
  56. package/workspace/project-onboard-flow-test.js +5 -5
  57. package/workspace/public/pm/bd-asks.js +6 -5
  58. package/workspace/public/pm/cozy-home.css +0 -6
  59. package/workspace/public/pm/cozy-panels.js +2 -6
  60. package/workspace/public/pm/cozy-popup.css +1 -0
  61. package/workspace/public/pm/cozy-popup.js +15 -2
  62. package/workspace/public/pm/cozy-today-page.css +1 -1
  63. package/workspace/public/pm/cozy-today.css +0 -14
  64. package/workspace/public/pm/cozy-viewer.js +14 -38
  65. package/workspace/public/pm/goal-chat.js +2 -2
  66. package/workspace/public/pm/home-app.js +8 -67
  67. package/workspace/public/pm/home-chat.js +1 -1
  68. package/workspace/public/pm/home-ses-name.js +3 -2
  69. package/workspace/public/pm/home-today.js +4 -18
  70. package/workspace/public/pm/ini-view-model.js +2 -2
  71. package/workspace/public/pm/premium-board.js +1 -1
  72. package/workspace/public/premium-intelligence.html +1 -1
  73. package/workspace/public/premium-viewer.html +1 -1
  74. package/workspace/public/premium-workflows.html +1 -1
  75. package/workspace/ready-dash-ui-test.js +1 -1
  76. package/workspace/rename-test.js +2 -2
  77. package/workspace/server.js +11 -12
  78. package/workspace/session-names-test.js +34 -56
  79. package/workspace/sort-order-test.js +2 -71
  80. package/workspace/split-merge-ui-test.js +1 -1
  81. package/workspace/stage-card-tasks-test.js +1 -1
  82. package/workspace/stage-card-test.js +1 -1
  83. package/workspace/task-card-test.js +1 -1
  84. package/workspace/task-press-test.js +1 -1
  85. package/workspace/task-views-test.js +1 -1
  86. package/workspace/test-lists/adler-seasons-art.json +3 -6
  87. package/workspace/test-lists/batch18-asks.json +1 -1
  88. package/workspace/test-lists/briefing-premium.json +1 -11
  89. package/workspace/test-lists/discovery-three-questions.json +5 -0
  90. package/workspace/test-lists/premium-agreed-viewer.json +1 -1
  91. package/workspace/test-run.js +0 -2
  92. package/workspace/test-timings.json +0 -4
  93. package/workspace/tk-tasks-test.js +3 -17
  94. package/workspace/viewer-trail-test.js +2 -2
  95. package/workspace/workflows-setup-test.js +4 -2
  96. package/workspace/adler-seasons-art-test.js +0 -116
  97. package/workspace/briefing-premium-initiative-test.js +0 -289
  98. package/workspace/briefing-premium-products-test.js +0 -209
  99. package/workspace/briefing-premium-sources-test.js +0 -250
  100. package/workspace/briefing-premium-test.js +0 -282
  101. package/workspace/home-other-product-test.js +0 -197
  102. package/workspace/home-pill-test.js +0 -138
  103. package/workspace/home-railcard-test.js +0 -196
  104. package/workspace/home-rows-test.js +0 -389
  105. package/workspace/panels-test.js +0 -454
  106. package/workspace/public/premium.html +0 -48
  107. package/workspace/test-lists/batch18-panels.json +0 -9
  108. package/workspace/test-lists/home-railcard.json +0 -9
  109. package/workspace/test-lists/home-sessions-pill.json +0 -6
  110. package/workspace/test-lists/viewer-home-rows.json +0 -9
@@ -5,8 +5,8 @@
5
5
  * Since premium-agreed-design /premium-chat.html opens Home: the list, the chat, and the Viewer — one cozy card (#czViewer) that shows one
6
6
  * item at a time, so the old tab strip, its "+N" fold and the head's Viewer pill are gone; the chat's "Open the Viewer" button (#hmReopen)
7
7
  * brings back what was closed. On a phone the chat is the page and the Viewer covers it.
8
- * V1 at 1280 Home opens with no Viewer and a wide chat; a file press opens the Viewer beside a chat of at least 360 px (cozy-home.css)
9
- * while the list stays in view; closing it gives the chat its width again
8
+ * V1 at 1280 Today opens the conversation in the popup; a file press opens the Viewer beside a chat of at least 360 px (home-page-retire:
9
+ * Home's desk page with its list is gone)
10
10
  * V2 the Viewer shows the file only, with its name as the title
11
11
  * V3 a closed Viewer leaves the chat's "Open the Viewer" button, which opens the last item again
12
12
  * V4 in a full-screen dialog on another page, a folded viewer unfolds when something opens in it
@@ -61,32 +61,26 @@ const look = () => {
61
61
  await p.route('**/api/briefing-premium/thread**', (r) => r.fulfill({ json: { ok: true, turns: [], session: 's-vw' } }));
62
62
  await p.route('**/api/sessions/conversation**', (r) => r.fulfill({ json: { ok: true, state: 'conv', turn: 'user', messages: ANSWER } }));
63
63
  await p.goto(chat + '&about=work:viewer-test');
64
- await until(() => p.evaluate(() => /\/premium\.html$/.test(location.pathname) && document.querySelectorAll('#hmLog .fpath').length >= 2), 12000);
64
+ await until(() => p.evaluate(() => /\/today\.html$/.test(location.pathname) && document.querySelectorAll('#hmLog .fpath').length >= 2), 12000);
65
65
  await sleep(300);
66
66
  return { p, ctx, errs };
67
67
  };
68
68
  const many = (p) => p.evaluate(async () => { const v = await import('/pm/premium-viewer.js'); for (const n of ['funnel-export.csv', 'support-tickets.md', 'pricing-notes.md', 'a-longer-quarterly-plan.md']) v.vwOpen({ id: 'x:' + n, title: n, html: '<article class="paper doc"><p>' + n + '</p></article>' }); });
69
69
  const closeVw = (p) => p.click('#czViewer [data-cz-vw="close"], #czViewer [data-cz-vw="back"]'); // shell A: × on a desk, ← on a phone
70
70
 
71
+ // at 1280 the chat is the popup's (home-page-retire): its work side shows what opens; ✕ closes the popup, so V1's close and V3's
72
+ // "Open the Viewer" button are phone checks now (Home's desk page with its list is gone)
71
73
  { const { p, ctx, errs } = await open(1280);
72
74
  const s0 = await p.evaluate(look);
73
- ok('V1 at 1280 /premium-chat.html opens Home with the list, no Viewer and the conversation wide', s0.list && s0.shut && s0.out === 0 && s0.conv > 700 && s0.railOff, JSON.stringify(s0));
75
+ const popChat = await p.evaluate(() => !!document.querySelector('.cz-pop:not([hidden]) #hmChat'));
76
+ ok('V1 at 1280 /premium-chat.html opens Today with the conversation in the popup, no file open yet', popChat && s0.conv >= 360 && !/\.md$/.test(s0.title || ''), JSON.stringify(s0));
74
77
  await p.click('#hmLog .fpath >> nth=0');
75
- const s1 = await until(async () => { const v = await p.evaluate(look); return !v.shut && v.title ? v : null; }) || await p.evaluate(look);
76
- ok('V1 a file press opens the Viewer beside a conversation of at least 360 px, and Home\'s list stays in view beside them', !s1.shut && s1.out > 300 && s1.conv >= 360 && s1.list, JSON.stringify(s1));
78
+ const s1 = await until(async () => { const v = await p.evaluate(look); return !v.shut && /signup-drop\.md/.test(v.title || '') ? v : null; }) || await p.evaluate(look);
79
+ ok('V1 a file press opens the Viewer beside a conversation of at least 360 px', !s1.shut && s1.out > 300 && s1.conv >= 360, JSON.stringify(s1));
77
80
  ok('V2 the Viewer shows only the file, with its name as the title, and no tab strip', /signup-drop\.md/.test(s1.title) && !s1.strip, JSON.stringify(s1));
78
- await closeVw(p);
79
- const s2 = await until(async () => { const v = await p.evaluate(look); return v.shut ? v : null; }) || await p.evaluate(look);
80
- ok('V1 closing the Viewer gives the conversation its width and the list stays', s2.shut && s2.out === 0 && s2.conv > 700 && s2.list, JSON.stringify(s2));
81
- await p.click('#hmLog .fpath >> nth=0'); await p.click('#hmLog .fpath >> nth=1'); await sleep(300);
81
+ await p.click('#hmLog .fpath >> nth=1'); await sleep(300);
82
82
  const sb = await until(async () => { const v = await p.evaluate(look); return /signup-fix\.md/.test(v.title || '') ? v : null; }) || await p.evaluate(look);
83
83
  ok('V6 a second file replaces the first in the one Viewer card', /signup-fix\.md/.test(sb.title || '') && !sb.strip && await p.evaluate(() => document.querySelectorAll('#czViewer').length === 1), JSON.stringify(sb));
84
- await closeVw(p);
85
- const s3 = await until(async () => { const v = await p.evaluate(look); return v.shut && v.reopen ? v : null; }) || await p.evaluate(look);
86
- ok('V3 the close leaves the chat\'s "Open the Viewer" button', s3.shut && s3.reopen, JSON.stringify(s3));
87
- await p.click('#hmReopen');
88
- const s4 = await until(async () => { const v = await p.evaluate(look); return !v.shut ? v : null; }) || await p.evaluate(look);
89
- ok('V3 the button opens the last item again', !s4.shut && /signup-fix\.md/.test(s4.title || '') && !s4.reopen, JSON.stringify(s4));
90
84
  if (shots) await p.screenshot({ path: `${shots}/chat-viewer-1280-light.png` });
91
85
  await many(p); await sleep(400);
92
86
  const s5 = await p.evaluate(look);
@@ -96,8 +96,13 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
96
96
  const unfold = (p, sel) => p.evaluate((q) => { const n = document.querySelector(q); const f = n && !n.offsetParent && n.closest('.czs-sec') && n.closest('.czs-sec').querySelector('[data-czs-fold]'); if (f) f.click(); }, sel);
97
97
  const viaMore = async (pg, label) => { const it = (l) => `#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${l}"))`, more = async () => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); }, view = (v) => until(() => pg.evaluate((x) => !!document.querySelector(`#czViewer:not([hidden]) [data-hi-v="${x}"]`), v)); if ((await pg.$('#czViewer:not([hidden]) [data-hi-v="page"]')) && (await pg.$('#czViewer:not([hidden]) [data-iv-docs]')) && !['Split into a new initiative', 'Merge into', 'Program', 'Open on the Board', 'Copy', 'The record', 'Delete'].includes(label)) { await pg.click('#czViewer:not([hidden]) [data-iv-docs]'); await view('docs'); if (label === 'Documents') return; } await more(); for (let i = 0; i < 20 && !(await pg.$(it(label))) && !(await pg.$(it('Stage'))); i++) { await pg.keyboard.press('Escape'); await pg.waitForTimeout(250); await more(); } if (!(await pg.$(it(label))) && (await pg.$(it('Stage')))) { await pg.click(it('Stage')); await view('stage'); if (label === 'Stage') return; await more(); } await pg.click(it(label)); }; // batch 16 item 5c: the page's ⋯ is short; Documents opens from its fold, and the Documents view's ⋯ holds Stage, whose ⋯ holds Documents, Open the full record and Sprint
98
98
  // the initiative's page (canvas HbC): its list row opens it again when the Viewer shows something else
99
- const ovOpen = async (p) => { await until(() => p.evaluate(() => !!document.querySelector('#hmList [data-hm-sel^="i:"][aria-current="true"]')), 60000);
100
- if (!(await p.$('#czViewer:not([hidden]) [data-hi-v="page"]'))) await p.click('#hmList [data-hm-sel^="i:"][aria-current="true"]');
99
+ // on a desktop Today opens the initiative's page by itself (home-page-retire: Home's list is gone); on a phone its list row opens it
100
+ const ovOpen = async (p) => { await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v="page"]') || !!(document.querySelector('#hmList [data-hm-sel^="i:"][aria-current="true"]') || {}).offsetParent), 60000);
101
+ // the Viewer shows something else: the list row on a phone, ← (the trail) on a desktop
102
+ for (let i = 0; i < 4 && !(await p.$('#czViewer:not([hidden]) [data-hi-v="page"]')); i++) {
103
+ if (await p.evaluate(() => !!(document.querySelector('#hmList [data-hm-sel^="i:"][aria-current="true"]') || {}).offsetParent)) { await p.click('#hmList [data-hm-sel^="i:"][aria-current="true"]'); break; }
104
+ await p.click('#czViewer:not([hidden]) [data-cz-vw="back"]'); await sleep(600);
105
+ }
101
106
  await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-hi-v="page"] .iv')), 60000); // the page holds the Tasks (batch 11 item 20)
102
107
  // the Overview opens on Tasks; the core documents are its Documents view (premium-uncovered-features, canvas InDocs)
103
108
  if (await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 30000)) await (async (pg) => { if (await pg.$('#czViewer [data-hi-view="docs"]')) await pg.click('#czViewer [data-hi-view="docs"]'); else await viaMore(pg, 'Documents'); })(p); };
@@ -55,12 +55,15 @@ const json = (r, body, status = 200) => r.fulfill({ status, contentType: 'applic
55
55
  await page.waitForFunction(() => !!window.czViewer, null, { timeout: 15000 });
56
56
  await page.evaluate((it) => window.czViewer.open({ ...it, discuss: true, html: '<p>The item</p>' }), item);
57
57
  await page.click('#czViewer [data-cz-vw="discuss"]');
58
- await page.waitForURL(/\/premium\.html\?/, { timeout: 15000 });
58
+ await page.waitForURL(/\/today\.html\?/, { timeout: 15000 }); // Home's address opens Today (home-page-retire)
59
59
  return new URL(page.url());
60
60
  };
61
+ // on a desktop the popup's chat names the item (home-page-retire)
61
62
  const state = () => page.evaluate(() => ({
62
63
  vw: !!document.querySelector('#czViewer:not([hidden])'), vwTitle: ((document.querySelector('#czViewer .cz-vw-hd') || {}).textContent || '').replace(/\s+/g, ' ').trim(),
63
- top: document.querySelector('#hmTopTitle').textContent, url: location.search,
64
+ top: (document.querySelector('.cz-pop:not([hidden]) .cz-pop-t span') || document.querySelector('#hmTopTitle')).textContent, url: location.search,
65
+ pop: !!document.querySelector('.cz-pop:not([hidden]) #hmChat'), cx: ((document.querySelector('.cz-pop-cx') || {}).textContent || ''),
66
+ log: ((document.querySelector('#hmLog') || {}).textContent || '').replace(/\s+/g, ' ').trim().slice(0, 160), ph: (document.querySelector('#hmIn') || {}).placeholder || '',
64
67
  }));
65
68
 
66
69
  let u = await discussFrom({ kind: 'Initiative', id: 'usage-billing', title: 'Usage-based billing' });
@@ -77,14 +80,15 @@ const json = (r, body, status = 200) => r.fulfill({ status, contentType: 'applic
77
80
  u = await discussFrom({ kind: 'Person', id: 'ana', title: 'Ana Lim' });
78
81
  ok('D1 a kind Home has no key for is a chat key: about=chat:<id>', u.searchParams.get('about') === 'chat:ana', u.search);
79
82
  await sleep(2500); s = await state();
80
- ok('D4 a kind Home has no view for is the chat alone, named by its label', s.top === 'Ana Lim' && !s.vw, JSON.stringify(s));
83
+ ok('D4 a kind Home has no view for is the chat alone, named by its label', s.top === 'Ana Lim' && (!s.vw || (s.pop && /All sessions/.test(s.vwTitle))), // the popup's work side holds the session list (home-page-retire)
84
+ JSON.stringify(s));
81
85
  // bug 2026-10-24: the Board's program panel Discuss named board:program:<id>, which Home sent as a Board row it does not have
82
86
  // ("that row is not on the page"); it lands on the program's own conversation, the one its tasks open
83
87
  await ctx.route(/\/api\/programs(\?.*)?$/, (r) => json(r, { ok: true, programs: [{ id: 'project-ascent', title: 'Project Ascent', members: [], tasks: [], milestones: [] }] }));
84
88
  u = await discussFrom({ kind: 'Program', id: 'program:project-ascent', title: 'Project Ascent' });
85
89
  ok('D6 a program\'s Discuss names it: about=board:program:<id>', u.searchParams.get('about') === 'board:program:project-ascent', u.search);
86
- s = await until(async () => { const v = await page.evaluate(() => { const c = document.querySelector('[data-hm-scope]'); return { top: document.querySelector('#hmTopTitle').textContent, scope: c ? c.textContent.trim() : '' }; }); return /Project Ascent/.test(v.scope) ? v : null; }, 15000)
87
- || await page.evaluate(() => ({ top: document.querySelector('#hmTopTitle').textContent, scope: ((document.querySelector('[data-hm-scope]') || {}).textContent || '').trim() }));
90
+ s = await until(async () => { const v = await page.evaluate(() => { const c = document.querySelector('[data-hm-scope]'); return { top: (document.querySelector('.cz-pop:not([hidden]) .cz-pop-t span') || document.querySelector('#hmTopTitle')).textContent, scope: c ? c.textContent.trim() : '' }; }); return /Project Ascent/.test(v.scope) ? v : null; }, 15000)
91
+ || await page.evaluate(() => ({ top: (document.querySelector('.cz-pop:not([hidden]) .cz-pop-t span') || document.querySelector('#hmTopTitle')).textContent, scope: ((document.querySelector('[data-hm-scope]') || {}).textContent || '').trim() }));
88
92
  ok('D6 a program lands on its own conversation: the chat goes in the program, not All work', s.top === 'Project Ascent' && s.scope === 'In: Project Ascent', JSON.stringify(s));
89
93
  ok('D5 no page error', errors.length === 0, errors.join(' | '));
90
94
  finish();
@@ -87,8 +87,10 @@ const SHOTS = process.env.PMOS_SHOTS || '', TAG = process.env.PMOS_SHOTS_TAG ||
87
87
  return r.fulfill({ status: 200, contentType: f.kind === 'markdown' ? 'text/markdown' : 'text/plain', headers: { 'X-Doc-Kind': f.kind }, body: f.text });
88
88
  });
89
89
  // premium-agreed-design: a chat is Home's own (?about= names the conversation, as a list row does) and a file opens in the Viewer card
90
- await page.goto(BASE + '/premium.html?about=work:html-test&theme=' + theme);
91
- await until(() => page.evaluate(() => !!document.querySelector('#hmLog') && !!document.querySelector('#hmFoot textarea')), 15000);
90
+ // on a desktop the chat opens in the popup (home-page-retire): wait until its box shows
91
+ await page.goto(BASE + '/today.html?about=work:html-test&theme=' + theme);
92
+ await until(() => page.evaluate(() => { const t = document.querySelector('#hmFoot textarea'); return !!document.querySelector('#hmLog') && !!t && t.getClientRects().length > 0; }), 15000);
93
+ await sleep(400);
92
94
  return { ctx, page, errors, out };
93
95
  };
94
96
  const press = (page, file) => page.evaluate((f) => {
@@ -135,7 +137,9 @@ const SHOTS = process.env.PMOS_SHOTS || '', TAG = process.env.PMOS_SHOTS_TAG ||
135
137
  const fr = await frameOf(page);
136
138
  if (fr) await until(() => fr.evaluate(() => document.querySelectorAll('.row').length === 6), 6000);
137
139
  else await sleep(1500);
138
- const geo = await page.evaluate(() => { const f = document.querySelector('#czViewer .obody.vw iframe'), r = f && f.getBoundingClientRect(); const pe = f && f.parentElement, ps = pe && getComputedStyle(pe), b = pe && { width: pe.clientWidth - parseFloat(ps.paddingLeft) - parseFloat(ps.paddingRight) }; return r ? { w: Math.round(r.width), h: Math.round(r.height), col: Math.round(b.width), sx: document.documentElement.scrollWidth - innerWidth } : null; });
140
+ // the frame sizes itself once its document is in (slower on a loaded runner): wait for that, up to 8 s
141
+ const look = () => page.evaluate(() => { const f = document.querySelector('#czViewer .obody.vw iframe'), r = f && f.getBoundingClientRect(); const pe = f && f.parentElement, ps = pe && getComputedStyle(pe), b = pe && { width: pe.clientWidth - parseFloat(ps.paddingLeft) - parseFloat(ps.paddingRight) }; return r ? { w: Math.round(r.width), h: Math.round(r.height), col: Math.round(b.width), sx: document.documentElement.scrollWidth - innerWidth } : null; });
142
+ const geo = await until(async () => { const g = await look(); return g && g.w >= 300 && g.h >= 400 ? g : null; }, 8000) || await look();
139
143
  // re-pointed for premium-agreed-design: on a desktop Home the Viewer sits in the docked chat's column (about 330 px at 1280), so the frame
140
144
  // must fill its file card's content box and keep a readable 300 px, rather than a fixed 500 px that only the old full-width dialog had
141
145
  ok(`H1 at ${w} ${theme} the frame fills the viewer's width and has room to read`, geo && geo.w >= 300 && geo.w >= geo.col - 2 && geo.h >= 400 && geo.sx <= 0, JSON.stringify(geo));
@@ -58,18 +58,18 @@ const json = (r, body, status = 200) => r.fulfill({ status, contentType: 'applic
58
58
  await page.route('**/api/sessions/conversation**', (r) => json(r, { ok: true, state: 'conv', turn: 'user', messages: [{ role: 'user', text: 'The meter double counts', at: Date.now() - 60000 }] }));
59
59
  await page.route('**/api/session/initiative', (r) => { posts.push(JSON.parse(r.request().postData() || '{}')); return json(r, { ok: true }); });
60
60
  };
61
+ // Home's list is gone (home-desk-layout-delete): a session opens from its address, as the live list, a link or a search opens it
61
62
  const openSession = async (page, name) => {
62
- const row = await until(async () => page.$(`#hmList button:has-text("${name}")`), 10000);
63
- if (!row) return false;
64
- await row.click(); await sleep(600); return true;
63
+ const s = SESSIONS.find((x) => x.name === name); if (!s) return false;
64
+ await page.goto(BASE + '/today.html?theme=light&session=' + s.id);
65
+ return !!(await until(() => page.evaluate(() => !!document.querySelector('#hmChat #hmIn')), 10000)) && (await sleep(600), true);
65
66
  };
66
67
  const chip = (page) => page.evaluate(() => { const s = document.querySelector('#hmSug'); return s && !s.hidden ? s.textContent.replace(/\s+/g, ' ').trim() : ''; });
67
68
 
68
69
  const posts = [];
69
70
  let page = await ctx.newPage(); await setup(page, posts);
70
- await page.goto(BASE + '/premium.html?theme=light');
71
71
  const opened = await openSession(page, 'Fix the usage meter on billing');
72
- ok('L1 the loose session opens from the list', opened);
72
+ ok('L1 the loose session opens from its address', opened);
73
73
  ok('L1 the chip names the matching initiative, once, with Link it', /^Looks like Usage-based billing\s*Link it$/.test(await until(() => chip(page))), await chip(page));
74
74
  await openSession(page, 'Lunch plans for Friday');
75
75
  ok('L2 a loose chat that matches no initiative shows no chip', (await chip(page)) === '');
@@ -79,20 +79,16 @@ const json = (r, body, status = 200) => r.fulfill({ status, contentType: 'applic
79
79
  await page.close();
80
80
 
81
81
  page = await ctx.newPage(); await setup(page, posts);
82
- await page.goto(BASE + '/premium.html?theme=light');
83
82
  await openSession(page, 'Fix the usage meter on billing');
84
83
  await until(() => chip(page));
85
84
  await page.click('#hmSug [data-hm-sug="x"]');
86
85
  ok('L4 × hides the chip', (await chip(page)) === '');
87
- await page.reload(); await openSession(page, 'Fix the usage meter on billing'); await sleep(800);
86
+ await openSession(page, 'Fix the usage meter on billing'); await sleep(800);
88
87
  ok('L4 a dismissed guess stays hidden for that chat after a reload', (await chip(page)) === '');
89
88
  await page.close(); await ctx.close();
90
89
 
91
90
  const pctx = await browser.newContext({ viewport: { width: 390, height: 844 }, hasTouch: true });
92
91
  page = await pctx.newPage(); await setup(page, []);
93
- await page.goto(BASE + '/premium.html?theme=light');
94
- const loose = await until(async () => page.$('#hmList button:has-text("Not in an initiative")'), 10000); // the phone folds loose chats into one row
95
- if (loose) { await loose.click(); await sleep(500); }
96
92
  const popen = await openSession(page, 'Fix the usage meter on billing');
97
93
  if (process.env.LS_DEBUG) { console.log('phone open', popen); await page.screenshot({ path: process.env.LS_DEBUG }); }
98
94
  const sz = await until(() => page.evaluate(() => { const b = document.querySelector('#hmSug:not([hidden]) [data-hm-sug="link"]'); if (!b) return null; const r = b.getBoundingClientRect(); return r.width && { w: r.width, h: r.height }; }));
@@ -63,7 +63,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
63
63
  if (u.searchParams.get('view') === 'week' && week) return json(r, week);
64
64
  return json(r, { ok: true, view: u.searchParams.get('view') || 'quarter', cells: [], gantt: [], no_plan: 0, strategy: [], today: DATE });
65
65
  });
66
- await p.goto(`${F.BASE}/premium.html?ws=${encodeURIComponent(ws)}`);
66
+ await p.goto(`${F.BASE}/today.html?ws=${encodeURIComponent(ws)}`);
67
67
  if (width < 641) {
68
68
  await until(() => p.evaluate(() => !!document.querySelector('#hmList')));
69
69
  // testing fixes: the card is no longer in the phone's list. It is the greeting's detail, in the Viewer: the greeting opens it,
@@ -137,7 +137,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
137
137
  await wait(p, /Starts/);
138
138
  await p.click('#phoneCard [data-pha="phopen"]');
139
139
  await sleep(800);
140
- ok('O2 when the calendar does not list it, the meeting still opens from the day\'s record, never in the old dialog and never the console', await p.evaluate(() => !document.querySelector('#dlg.on') && !!document.querySelector('#czViewer:not([hidden])') && /\/premium\.html$/.test(location.pathname)));
140
+ ok('O2 when the calendar does not list it, the meeting still opens from the day\'s record, never in the old dialog and never the console', await p.evaluate(() => !document.querySelector('#dlg.on') && !!document.querySelector('#czViewer:not([hidden])') && /\/today\.html$/.test(location.pathname)));
141
141
  await p.__ctx.close();
142
142
 
143
143
  /* D: Done and Undo, on a real item */
@@ -98,7 +98,7 @@ const SHOTS = process.env.PMOS_SHOTS || '';
98
98
  });
99
99
  await page.route('**/api/doc/export*', (r) => r.fulfill({ status: 200, contentType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', headers: { 'Content-Disposition': 'attachment; filename="2026-10-19.docx"' }, body: 'PK' }));
100
100
  // premium-agreed-design: a chat is Home's own (?about= names the conversation) and a file it names opens in the Viewer card
101
- await page.goto(BASE + '/premium.html?about=work:download-test&theme=' + theme);
101
+ await page.goto(BASE + '/today.html?about=work:download-test&theme=' + theme);
102
102
  await until(() => page.evaluate(() => !!document.querySelector('#hmLog') && !!document.querySelector('#hmFoot textarea')), 15000);
103
103
  return { ctx, page, errors, asked };
104
104
  };
@@ -62,7 +62,7 @@ const SHOTS = process.env.PMOS_SHOTS || '';
62
62
  await page.route('**/api/doc/locate*', json({ ok: true, ws: 'w0', rel: HTMLF, abs: '/Users/pm/pmos/' + HTMLF, name: '2026-10-19.html', mtime: 1, size: REPORT.length }));
63
63
  await page.route('**/api/doc?*', (r) => r.fulfill({ status: 200, contentType: 'text/plain', headers: { 'X-Doc-Kind': 'html' }, body: REPORT }));
64
64
  // premium-agreed-design: the session's conversation is Home's chat (?session= names it) and the file it names opens in the Viewer card
65
- await page.goto(BASE + '/premium.html?session=s-flicker&theme=' + theme);
65
+ await page.goto(BASE + '/today.html?session=s-flicker&theme=' + theme);
66
66
  const fp = await until(() => page.$('#hmLog button.fpath[data-file]'), 15000);
67
67
  if (fp) await fp.evaluate((b) => b.click()); // on a phone the dialog opens on the Detail side, so the press goes through the button's own handler
68
68
  return { ctx, page, errors, conv };
@@ -126,7 +126,7 @@ const SHOTS = process.env.PMOS_SHOTS || '';
126
126
  ok('K3 the copy is under a sandbox CSP and holds the document\'s words', view.status === 200 && /^sandbox[;\s]/.test(view.headers['content-security-policy'] || '') && /default-src 'none'/.test(view.headers['content-security-policy']) && /Download and share a file from the viewer/.test(view.text), view.headers['content-security-policy']);
127
127
  const file = await req(SBASE + S + '/file', { headers: C });
128
128
  ok('K3 Download gives the file\'s own text as an attachment', file.status === 200 && /attachment; filename="premium-viewer-share-prd\.md"/.test(file.headers['content-disposition'] || '') && file.text === fs.readFileSync(path.join(REPO, PRD), 'utf8'));
129
- ok('K3 any other path is 404, including the workspace API', (await req(SBASE + '/')).status === 404 && (await req(SBASE + '/api/shares')).status === 404 && (await req(SBASE + '/s/short')).status === 404 && (await req(SBASE + '/premium.html')).status === 404);
129
+ ok('K3 any other path is 404, including the workspace API', (await req(SBASE + '/')).status === 404 && (await req(SBASE + '/api/shares')).status === 404 && (await req(SBASE + '/s/short')).status === 404 && (await req(SBASE + '/today.html')).status === 404);
130
130
  for (let i = 0; i < 5; i++) await form('wrong-' + i);
131
131
  const locked = await form(PASS);
132
132
  ok('K3 five wrong tries lock the link, even for the right password', locked.status === 429 && /15 minutes/.test(locked.text), locked.status);
@@ -152,7 +152,7 @@ const SHOTS = process.env.PMOS_SHOTS || '';
152
152
  page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
153
153
  await page.route('**/api/brief-page*', (r) => r.fulfill({ contentType: 'application/json', body: '{"ok":false,"error":"off in this suite"}' }));
154
154
  // premium-agreed-design: a chat is Home's own (?about= names the conversation) and a file it names opens in the Viewer card
155
- await page.goto(BASE + '/premium.html?about=work:share-test&theme=' + theme);
155
+ await page.goto(BASE + '/today.html?about=work:share-test&theme=' + theme);
156
156
  await until(() => page.evaluate(() => !!document.querySelector('#hmLog') && !!document.querySelector('#hmFoot textarea')), 15000);
157
157
  await page.evaluate((f) => { const b = document.createElement('button'); b.type = 'button'; b.className = 'fpath'; b.dataset.file = f; b.textContent = f; document.querySelector('#hmLog').append(b); b.click(); }, PRD);
158
158
  await until(() => page.$('#czViewer:not([hidden]) .obody.vw [data-fsh]'), 10000);
@@ -45,7 +45,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
45
45
  const S = { errors: [] };
46
46
  page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
47
47
  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() }) }));
48
- await page.goto(BASE + '/premium.html?theme=' + theme);
48
+ await page.goto(BASE + '/today.html?theme=' + theme);
49
49
  await until(() => page.evaluate(() => document.querySelectorAll('#hmList .hm-r').length > 0 && !!window.czViewer), 20000);
50
50
  await page.evaluate(() => import('/pm/premium-viewer.js'));
51
51
  S.up = await until(() => page.evaluate(() => !!window.__premiumViewer && !!window.czViewer), 10000);
@@ -146,7 +146,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
146
146
  await E.ctx.close();
147
147
 
148
148
  /* C9 on Home, the Viewer widens for the week */
149
- const G = await F.open(browser, BASE, '/premium.html', { w: 1520, h: 900 }); // the rail of places takes 80 px of Home's desk (six-place navigation): at 1520 the side beside the chat is as wide as it was at 1440
149
+ const G = await F.open(browser, BASE, '/today.html', { w: 1520, h: 900 }); // the rail of places takes 80 px of Home's desk (six-place navigation): at 1520 the side beside the chat is as wide as it was at 1440
150
150
  await until(() => G.page.evaluate(() => !!(window.czViews && window.czViews.openCalendar)), 15000);
151
151
  await G.page.evaluate(() => window.czViews.openCalendar());
152
152
  await until(() => G.page.evaluate(() => !!document.querySelector('#czViewer .vzc-dy')), 15000);
@@ -42,12 +42,12 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
42
42
  const S = { errors: [] };
43
43
  page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
44
44
  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() }) }));
45
- await page.goto(BASE + '/premium.html?theme=' + theme);
45
+ await page.goto(BASE + '/today.html?theme=' + theme);
46
46
  S.up = await until(() => page.evaluate(() => document.querySelectorAll('#hmList .hm-r').length > 0 && !!document.querySelector('#hmChat')), 20000);
47
47
  return { page, ctx, S };
48
48
  };
49
49
  /* Home is up: the list and the chat; the copy view opens in the Viewer beside them (there is no row dialog any more) */
50
- const openDialog = async (page) => !!(await until(() => page.evaluate(() => document.querySelectorAll('#hmList .hm-r').length > 0 && !document.querySelector('#dlg.on'))));
50
+ const openDialog = async (page) => !!(await until(() => page.evaluate(() => !!document.getElementById('czFab') && !!document.querySelector('#hmChat') && !document.querySelector('#dlg.on'))));
51
51
  const URL_C = 'https://acme.atlassian.net/wiki/spaces/P/pages/1/Launch+plan', URL_G = 'https://docs.google.com/document/d/1abc/edit', URL_M = 'https://docs.google.com/document/d/9memo/edit';
52
52
  const stand = async (page, S) => {
53
53
  S.sig = 'same'; S.posts = []; S.read = { ok: true, read: null, open: null };
@@ -100,7 +100,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
100
100
  {
101
101
  const { page, ctx, S } = await open({ w: 390, h: 844, theme: 'dark' });
102
102
  await stand(page, S);
103
- ok('R7 Home is up at 390px, with no old dialog', await openDialog(page));
103
+ ok('R7 Today is up at 390px, with no old dialog', await openDialog(page));
104
104
  await openCopy(page, { ws: '', path: 'planning/launch.md', kind: 'google', url: URL_G, title: 'Launch plan (Doc)' });
105
105
  await until(() => page.$('#czViewer:not([hidden]) .obody.vw [data-cp="use"]'));
106
106
  const m = await page.evaluate(() => {
@@ -81,7 +81,7 @@ const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', {
81
81
  if (route === 'ask') { S.ask = { ok: true, id: 'ask-1', state: 'working' }; return send({ ok: true, id: 'ask-1', state: 'working' }); }
82
82
  return send({ ok: false, error: 'not in this test' }, 404);
83
83
  });
84
- await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&theme=' + theme);
84
+ await page.goto(BASE + '/today.html?ini=self-serve-v2&ws=w1&theme=' + theme);
85
85
  if (w <= 760) await everyPart(page);
86
86
  await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-iv-docs]')), 15000); // the initiative's page (canvas HbC)
87
87
  // the page's Documents "Show all N" opens every document in the Viewer
@@ -50,7 +50,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
50
50
  page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
51
51
  await page.route('**/api/initiative-premium*', (r) => { const u = r.request().url(); S.gets.push(u); if (!r.request().headers()['x-pmos-nonce']) S.vgets.push(u); const a = answer ? answer(u, S.gets.filter((x) => x === u).length) : { status: 200, body: { ok: true, state: 'ready', model: MODEL, as_of: Date.now() } }; r.fulfill({ status: a.status, contentType: 'application/json', body: JSON.stringify(a.body) }); });
52
52
  await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
53
- await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
53
+ await page.goto(BASE + '/today.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
54
54
  S.up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-mc') && !!window.__premiumWorkItem), 20000);
55
55
  return { page, ctx, S };
56
56
  };
@@ -67,7 +67,7 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
67
67
  };
68
68
  await page.route('**/api/pm-items/**', rec); await page.route('**/api/pm-jobs/**', rec); await page.route('**/api/my-work/**', rec);
69
69
  await page.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, turns: [], working: false }) }));
70
- await page.goto(BASE + '/premium.html?theme=' + theme);
70
+ await page.goto(BASE + '/today.html?theme=' + theme);
71
71
  await until(() => page.evaluate(() => !!document.querySelector('#czFab')), 15000);
72
72
  await page.evaluate(() => import('/pm/home-work.js').then((M) => { M.openMyWork(); })); // the page itself: Home no longer opens it (testing fixes); an item and Focus open alone
73
73
  const up = await until(() => page.evaluate(() => document.querySelectorAll('#czViewer:not([hidden]) .mw-list .wrow').length > 0), 20000);
@@ -346,7 +346,7 @@ const mk = (edit) => { const v = F.view(); if (edit) edit(v); return WP.build({
346
346
  const get = (u) => fetch(BASE + u).then((r) => r.json());
347
347
  await pg.goto(BASE + '/premium-work.html');
348
348
  // re-pointed for premium-agreed-design: /premium-work.html opens Home; My work is the card from the place menu, and an added line is opened from Your list
349
- await until(() => pg.evaluate(() => /\/premium\.html$/.test(location.pathname) && !!document.querySelector('#czFab')), 15000);
349
+ await until(() => pg.evaluate(() => /\/today\.html$/.test(location.pathname) && !!document.querySelector('#czFab')), 15000);
350
350
  await pg.evaluate(() => import('/pm/home-work.js').then((M) => { M.openMyWork(); })); // the page itself: Home no longer opens it (testing fixes); an item and Focus open alone
351
351
  ok('E1 on an empty scratch state My work says the list is empty and Focus has nothing to suggest', await until(() => pg.evaluate(() => /Nothing is open/.test((document.querySelector('#czViewer .mw-list') || {}).textContent || '') && /Nothing to suggest/.test(document.querySelector('#xFocus .xfq').getAttribute('aria-label'))), 20000));
352
352
  await pg.fill('#hxLine', 'Reply to Rina about SSO !p1'); await pg.click('#czViewer [data-x="add"]');
@@ -47,7 +47,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
47
47
  if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
48
48
  const shot = async (p, name) => { if (SHOTS) await p.screenshot({ path: path.join(SHOTS, name + '.png') }); };
49
49
 
50
- const open = async ({ w = 1440, h = 900, programs = F.programs(), dark = false, home = false } = {}) => {
50
+ const open = async ({ w = 1440, h = 900, programs = F.programs(), dark = false } = {}) => {
51
51
  const c = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: dark ? 'dark' : 'light' });
52
52
  const page = await c.newPage();
53
53
  const errors = [], posts = [];
@@ -60,7 +60,6 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
60
60
  await page.route('**/api/boards/items*', (r) => json(r, { ok: true, items: A.ITEMS[wsOf(r)] || [] }));
61
61
  await page.route('**/api/programs/*', (r) => { const rq = r.request(); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}') }); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
62
62
  await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: '{"ok":false,"error":"not in this check"}' }));
63
- if (home) { await page.goto(BASE + '/premium.html?ws=idpf'); return { page, ctx: c, errors, posts }; }
64
63
  await page.goto(BASE + '/premium-board.html?ws=idpf&program=' + programs[0].id);
65
64
  await until(() => page.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('.pp-vw .pv'); }));
66
65
  // the other product's board lands after the panel opens: the charter lists its initiative once it is read
@@ -229,16 +228,6 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
229
228
  ok('0 no page error on a phone', S.errors.length === 0, S.errors.join(' | '));
230
229
  await S.ctx.close();
231
230
 
232
- /* ── Home: the program heading's name opens the same panel in Home's Viewer, styled, and its charter ── */
233
- const M = await open({ home: true });
234
- const prog = await until(() => M.page.$('#hmList [data-hm-prog]'), 10000);
235
- if (prog) await prog.click();
236
- const hp = await until(() => M.page.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !v.querySelector('.pp-vw .pv')) return null; return { tile: getComputedStyle(v.querySelector('.cz-vw-tile')).backgroundColor, prog: getComputedStyle(document.body).getPropertyValue('--pp-prog').trim() }; }));
237
- ok('M on Home the program heading opens the program panel with its own purple (cozy-panel.css is on Home)', !!hp && !!hp.prog && !/rgba\(0, 0, 0, 0\)|transparent/.test(hp.tile), JSON.stringify(hp));
238
- if (hp) await toCharter(M.page);
239
- ok('M the charter opens from the panel on Home too', !!hp && !!(await charterShown(M.page)));
240
- ok('0 no page error on Home', M.errors.length === 0, M.errors.join(' | '));
241
- await M.ctx.close();
242
231
 
243
232
  if (SHOTS) { // dark, for the look only
244
233
  const K = await open({ dark: true });
@@ -175,14 +175,14 @@ const waitsOf = (id) => ((R.all(rctx).find((p) => p.id === 'project-ascent') ||
175
175
  await page.route('**/api/initiative-premium*', (r) => { const id = new URL(r.request().url()).searchParams.get('id') || ''; const m = IP.build(IF.facts()); r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: { ...m, id, title: id }, as_of: Date.now() }) }); });
176
176
  await routePrograms(page);
177
177
  const am = new Date(); am.setHours(10, 0, 0, 0); await page.clock.setFixedTime(am);
178
- await page.goto(BASE + '/premium.html?theme=light');
178
+ await page.goto(BASE + '/today.html?theme=light');
179
179
  await until(() => page.evaluate(() => !!document.querySelector('#hmList .hv-g.prg [data-po-id]')), 20000);
180
180
  return { ctx, page, errors };
181
181
  };
182
182
  {
183
183
  const { ctx, page: p, errors } = await home();
184
184
  const goPage = async (id) => {
185
- await p.goto(BASE + '/premium.html?theme=light&ini=' + id);
185
+ await p.goto(BASE + '/today.html?theme=light&ini=' + id);
186
186
  return until(() => p.evaluate(() => { const v = document.querySelector('#czViewer'); return !!v && !v.hidden && !!v.querySelector('[data-cz-vw="more"]'); }), 15000);
187
187
  };
188
188
  ok('H the initiative page opens', await goPage('legacy-idp-sunset'));
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- /* program-order-test.js — the order of a program's initiatives on the Board and on Home (feedback batch 3 item 5, option A agreed 2026-10-25;
3
+ /* program-order-test.js — the order of a program's initiatives on the Board (feedback batch 3 item 5, option A agreed 2026-10-25;
4
4
  * canvas RoADrag, RoASuggest, RoAApplied, RoAPhone). Serves the real pages from the real server; GET /api/programs answers Project Ascent
5
5
  * (fixtures/program-ascent.js) and POST /api/programs/order is answered here, from the order the page sent, so a reload reads it back.
6
6
  * B Board: the program's rows follow its order; ✦ shows (with its dot) only while the dates disagree; the suggestion lists the date order with a
7
7
  * reason per row; ✓ applies it, Undo puts the order back; ✕ is "not now" until a date changes; drag by the grip; Alt + ↓ moves a row
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
- * H Home: the program group lists the same order; the grip moves a row there too; a phone holds the row, then drags it */
8
+ * (the programs, products and a product's initiatives are the Board's own lists, [data-po-list^="@"]: sort-order-test.js)
9
+ * Home's program group read the same order; its checks went with Home's page (home-desk-layout-delete). */
10
10
  const path = require('path');
11
11
  const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
12
12
  const { spawn } = require('child_process');
@@ -119,67 +119,5 @@ const routePrograms = async (page) => {
119
119
  await ctx.close();
120
120
  }
121
121
 
122
- /* H — Home: the same order, the grip, and a phone's hold-then-drag */
123
- const home = async (o = {}) => {
124
- const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 }, hasTouch: !!o.touch, isMobile: !!o.touch });
125
- const page = await ctx.newPage();
126
- const errors = [];
127
- page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
128
- const json = (body) => (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(body) });
129
- await page.route(/\/api\/briefing-premium(\?.*)?$/, json({ ok: true, state: 'ready', model: B.build(HF.facts()), as_of: Date.now() }));
130
- await page.route('**/api/briefing-premium/thread**', json({ ok: true, turns: [], working: false }));
131
- await page.route('**/api/board-premium*', (r) => { const q = new URL(r.request().url()).searchParams; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(F.programFacts(q.get('ws') || 'idpf')), as_of: Date.now() }) }); });
132
- await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
133
- await routePrograms(page);
134
- const am = new Date(); am.setHours(10, 0, 0, 0); await page.clock.setFixedTime(am);
135
- await page.goto(BASE + '/premium.html?theme=light');
136
- // Home shows only the rows with a call (home-nav-rows-with-a-call): open the program's "N more" so every row of its order shows
137
- await until(() => page.evaluate(() => { document.querySelectorAll('#hmList .hv-g.prg .hv-fold[aria-expanded="false"]').forEach((b) => b.click()); return !!document.querySelector('#hmList .hv-g.prg [data-po-id]') && document.body.dataset.hmTop === '1'; }), 20000);
138
- return { ctx, page, errors };
139
- };
140
- const hkids = (p) => p.evaluate(() => [...document.querySelectorAll('#hmList .hv-g.prg [data-po-id]')].map((r) => r.dataset.poId));
141
- {
142
- ORDER = ['legacy-idp-sunset', 'descope-parity'];
143
- const n0 = posts.length;
144
- const { ctx, page: p, errors } = await home();
145
- ok('H Home\'s program group lists the program\'s order (not your turn first)', (await hkids(p)).join() === 'legacy-idp-sunset,descope-parity', JSON.stringify(await hkids(p)));
146
- ok('H ✦ sits in the open program header', !!(await p.$('#hmList .hv-g.prg .hv-gh [data-po-sug]')));
147
- if (process.env.SHOTS) { await p.hover('#hmList [data-po-id="descope-parity"]'); await p.screenshot({ path: process.env.SHOTS + '/home-desk.png' }); }
148
- await p.hover('#hmList [data-po-id="descope-parity"]');
149
- const g = await p.locator('#hmList [data-po-id="descope-parity"] [data-po-grip]').boundingBox();
150
- const top = await p.locator('#hmList [data-po-id="legacy-idp-sunset"]').boundingBox();
151
- await p.mouse.move(g.x + g.width / 2, g.y + g.height / 2); await p.mouse.down();
152
- await p.mouse.move(g.x + g.width / 2, top.y + 6, { steps: 6 }); await p.mouse.up();
153
- await until(async () => (await hkids(p))[0] === 'descope-parity');
154
- ok('H the grip moves a row on Home too: one write, and the list follows it', posts.length === n0 + 1 && (await hkids(p)).join() === 'descope-parity,legacy-idp-sunset', JSON.stringify({ k: await hkids(p), posts: posts.slice(n0) }));
155
- ok('H no page error', !errors.length, errors.join(' | '));
156
- await ctx.close();
157
- }
158
- {
159
- ORDER = ['legacy-idp-sunset', 'descope-parity'];
160
- const n0 = posts.length;
161
- const { ctx, page: p, errors } = await home({ w: 390, h: 844, touch: true });
162
- const grips = await p.evaluate(() => [...document.querySelectorAll('#hmList [data-po-grip]')].filter((g) => getComputedStyle(g).display !== 'none').length);
163
- ok('H phone: no grip shows (hold the row instead)', grips === 0, String(grips));
164
- // a hold, then a drag, through the touch events the page reads (CDP touch input)
165
- // the top of Home (Your move, Waiting on others) sits above the groups: bring the rows into view first
166
- await p.evaluate(() => document.querySelector('#hmList [data-po-id="descope-parity"]').scrollIntoView({ block: 'center' }));
167
- const s = await p.locator('#hmList [data-po-id="descope-parity"]').boundingBox();
168
- const t = await p.locator('#hmList [data-po-id="legacy-idp-sunset"]').boundingBox();
169
- const cdp = await ctx.newCDPSession(p);
170
- const pt = (y) => [{ x: s.x + s.width / 2, y }];
171
- await cdp.send('Input.dispatchTouchEvent', { type: 'touchStart', touchPoints: pt(s.y + s.height / 2) });
172
- await sleep(600);
173
- const lifted = await p.evaluate(() => !!document.querySelector('[data-po-id="descope-parity"].po-lift'));
174
- if (process.env.SHOTS) await p.screenshot({ path: process.env.SHOTS + '/home-phone-hold.png' });
175
- for (let k = 1; k <= 6; k++) await cdp.send('Input.dispatchTouchEvent', { type: 'touchMove', touchPoints: pt(s.y + s.height / 2 - ((s.y + s.height / 2 - (t.y + 6)) * k) / 6) });
176
- await cdp.send('Input.dispatchTouchEvent', { type: 'touchEnd', touchPoints: [] });
177
- await until(async () => (await hkids(p))[0] === 'descope-parity');
178
- ok('H phone: hold the row, it lifts; drag it up and the order saves', lifted && posts.length === n0 + 1 && (await hkids(p)).join() === 'descope-parity,legacy-idp-sunset', JSON.stringify({ lifted, k: await hkids(p), posts: posts.slice(n0) }));
179
- const wide = await p.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1);
180
- ok('H phone: no sideways scroll', wide);
181
- ok('H phone: no page error', !errors.length, errors.join(' | '));
182
- await ctx.close();
183
- }
184
122
  finish();
185
123
  })();
@@ -38,11 +38,11 @@ const shot = async (p, name) => { if (SHOTS) { fs.mkdirSync(SHOTS, { recursive:
38
38
  const press = (act) => p.locator(`#obChat [data-ob="${act}"]`).last().click();
39
39
  const say = async (pg, text) => { await pg.fill('#obChat textarea', text); await pg.keyboard.press('Enter'); };
40
40
 
41
- await step('The old Welcome page opens the Home conversation; the login is checked by itself and the composer is open', async () => {
41
+ await step('The old Welcome page opens the setup conversation on Today; the login is checked by itself and the composer is open', async () => {
42
42
  await p.goto(T.BASE + '/premium-welcome.html?ws=x&step=sources');
43
- assert.match(p.url(), /\/premium\.html\?onboard=1$/);
43
+ assert.match(p.url(), /\/today\.html\?onboard=1$/);
44
44
  await p.waitForSelector('#obChat .ob-prop');
45
- assert(await p.locator('#hmChat').isHidden(), 'one chat at a time'); assert(await p.locator('#hmList').isVisible(), 'the list stays');
45
+ assert(await p.locator('#hmChat').isHidden(), 'one chat at a time'); assert(await p.locator('#tdPage').isVisible(), 'Today stays behind the popup');
46
46
  assert.match(await p.locator('#obChat .ob-prop').innerText(), /Sign in to Claude Code/, 'only a failed check asks');
47
47
  assert(!(await p.locator('#obChat input[name="ob-login"]').count()), 'no login picker on the first screen');
48
48
  assert(await p.locator('#obChat textarea').isEnabled(), 'the composer is open from the first screen');
@@ -116,7 +116,7 @@ const shot = async (p, name) => { if (SHOTS) { fs.mkdirSync(SHOTS, { recursive:
116
116
  await p.waitForSelector('#rvChat .rv-ticks'); await p.waitForSelector('#rvChat .rv-draft'); // B2: Home opens on the reveal, with the drafted initiative
117
117
  await p.waitForFunction(() => /Checkout redesign/i.test(document.querySelector('#hmList').innerText), null, { timeout: 15000 });
118
118
  const ph = await (await browser.newContext({ viewport: { width: 390, height: 844 } })).newPage();
119
- await ph.goto(T.BASE + '/premium.html?onboard=1'); await ph.waitForSelector('#obChat .ob-fund'); await shot(ph, 'onboard-5-fundamentals-phone');
119
+ await ph.goto(T.BASE + '/today.html?onboard=1'); await ph.waitForSelector('#obChat .ob-fund'); await shot(ph, 'onboard-5-fundamentals-phone');
120
120
  assert(await ph.locator('#obChat').isVisible()); await ph.close();
121
121
  });
122
122
  await step('The same folder again is reused as existing PMOS, never reinstalled', async () => {
@@ -125,7 +125,7 @@ const shot = async (p, name) => { if (SHOTS) { fs.mkdirSync(SHOTS, { recursive:
125
125
  const h = await T.pressHeaders(T.BASE);
126
126
  await fetch(T.BASE + '/api/onboard/reset', { method: 'POST', headers: h, body: '{}' });
127
127
  const ph = await (await browser.newContext({ viewport: { width: 390, height: 844 } })).newPage();
128
- await ph.goto(T.BASE + '/premium.html?onboard=1');
128
+ await ph.goto(T.BASE + '/today.html?onboard=1');
129
129
  await ph.waitForSelector('#obChat .ob-good', { timeout: 15000 });
130
130
  await say(ph, `Checkout redesign. The folder is ${root}`);
131
131
  await ph.waitForSelector('#obChat [data-ob="plan-yes"]', { timeout: 15000 });
@@ -9,8 +9,9 @@
9
9
  * says so. Create: POST /api/boards/asks/add then /asks/accept (it starts in the first stage), then POST /api/board-grill/start
10
10
  * and POST /api/proposals/look (Claude looks for it elsewhere; batch 12 item 4)
11
11
  * and /file for the material.
12
- * First questions (BdGrill) the same panel, right after: what PMOS took from the Why and the material, then only the open questions, one at a
13
- * time (POST /api/board-grill/answer). Later (POST /api/board-grill/later) keeps them as the initiative's next step.
12
+ * First questions (BdGrill) the same panel, right after: what PMOS took from the Why and the material, then the three discovery questions
13
+ * (who has this problem, how do we know, what would change our mind; bet A459), one at a time (POST
14
+ * /api/board-grill/answer: each answer becomes the Experiment's evidence or kill condition). Later (POST /api/board-grill/later) keeps them as the initiative's next step.
14
15
  * Nothing is sent to anyone: a decline keeps its reason in the board ledger. */
15
16
  import { pmPost } from './http.js';
16
17
  import { $, $$, esc } from './premium-shell.js';
@@ -303,7 +304,7 @@ function grillHtml() {
303
304
  const last = Q.at >= qs.length - 1;
304
305
  return `<div class="pk-h"><div class="pk-ht"><p class="pk-eye">${esc(Q.stage)} · ${Q.fresh ? 'just created' : 'open questions'}</p><h2 id="pkTitle">${esc(Q.title)}</h2></div><div class="pk-tools"><button type="button" class="bd-ib" data-grill="later" aria-label="Close. The questions stay as this initiative’s next step" title="Close">${SV(I.x)}</button></div></div>`
305
306
  + `<div class="pk-b bd-pl"><div class="bd-box sm"><b>What PMOS took from your material</b>${took.map((t) => `<span>${esc(t)}</span>`).join('')}${names.length ? `<span class="bd-amut">From ${esc(names.join(' and '))}</span>` : ''}</div>`
306
- + (qs.length ? `<div class="bd-qhd"><b>${qs.length} ${qs.length === 1 ? 'question' : 'questions'} before the BRD</b><span class="bd-amut">Only what the material does not answer</span></div>${qs.map(card).join('')}` : '<p class="bd-amut">Nothing is left to ask: the BRD can start from what you gave.</p>')
307
+ + (qs.length ? `<div class="bd-qhd"><b>${qs.length} ${qs.length === 1 ? 'question' : 'questions'} to start discovery</b><span class="bd-amut">Your answers become its evidence and what would stop it</span></div>${qs.map(card).join('')}` : '<p class="bd-amut">Nothing is left to ask.</p>')
307
308
  + `<p class="bd-amsg" id="grM" role="status"></p><div class="bd-arow bd-pfoot">${qs.length ? `<button type="button" class="bd-btn solid" data-grill="next">${last ? 'Done' : 'Next question'}</button>` : ''}<button type="button" class="bd-btn ghost" data-grill="later">Later</button><span class="bd-amut bd-push">${open ? 'Later keeps them as the next step' : 'Every question is answered'}</span></div></div>`;
308
309
  }
309
310
  /** The questions in the Viewer's shell (premium-board.js actsPanel): the shell's Close (×, Escape) is the same as Later. */
@@ -335,7 +336,7 @@ document.addEventListener('click', async (e) => {
335
336
  if (b.dataset.grill === 'next' && Q.at < ((Q.data && Q.data.questions.length) || 0) - 1) { Q.at++; grillPanel(); const i = $('#czViewer .bd-qc.on input'); if (i) i.focus(); return; }
336
337
  if (b.dataset.grill === 'later' && open) await post('/api/board-grill/later', { ws: wsOf(Q.id), id: Q.id }).catch(() => null);
337
338
  Q = null; A.close();
338
- A.say(open ? 'Kept as the next step of ' + title + ': ' + open + ' open ' + (open === 1 ? 'question' : 'questions') + '.' : 'The answers are kept on ' + title + ' for its BRD.');
339
+ A.say(open ? 'Kept as the next step of ' + title + ': ' + open + ' open ' + (open === 1 ? 'question' : 'questions') + '.' : 'Kept on ' + title + '.');
339
340
  A.load();
340
341
  });
341
342
  /** The shell closed the questions while they showed: the answer typed is kept, and the open ones stay as the next step, as Later does. */
@@ -348,7 +349,7 @@ async function later() {
348
349
  if (cur && typed && typed !== (cur.answer || '')) { const r = await post('/api/board-grill/answer', { ws: wsOf(q.id), id: q.id, q: cur.key, answer: typed }).catch(() => null); if (r && r.ok) data = r; }
349
350
  const open = data ? data.questions.filter((x) => !x.answer).length : 0;
350
351
  if (open) await post('/api/board-grill/later', { ws: wsOf(q.id), id: q.id }).catch(() => null);
351
- A.say(open ? 'Kept as the next step of ' + q.title + ': ' + open + ' open ' + (open === 1 ? 'question' : 'questions') + '.' : 'The answers are kept on ' + q.title + ' for its BRD.');
352
+ A.say(open ? 'Kept as the next step of ' + q.title + ': ' + open + ' open ' + (open === 1 ? 'question' : 'questions') + '.' : 'Kept on ' + q.title + '.');
352
353
  A.load();
353
354
  }
354
355
  export const grillOpen = () => !!Q;