create-pmos 0.691.0 → 0.693.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 (111) hide show
  1. package/package.json +20 -14
  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 +19 -0
  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/cli.md +3 -1
  17. package/workspace/guide/home.md +1 -1
  18. package/workspace/guide/layout.md +2 -2
  19. package/workspace/guide/settings-and-switches.md +0 -1
  20. package/workspace/impact-screens-test.js +2 -47
  21. package/workspace/ini-workflow-test.js +1 -1
  22. package/workspace/lib/board-premium.js +10 -2
  23. package/workspace/lib/initiative-cli.js +31 -4
  24. package/workspace/lib/initiative-origin.js +131 -0
  25. package/workspace/lib/initiative-writer.js +35 -2
  26. package/workspace/lib/routes-boards.js +4 -1
  27. package/workspace/live-pill-round-test.js +6 -18
  28. package/workspace/milestone-suggest-test.js +4 -28
  29. package/workspace/news-viewers-test.js +3 -29
  30. package/workspace/package-lock.json +2 -2
  31. package/workspace/package.json +1 -1
  32. package/workspace/premium-board-actions-test.js +2 -2
  33. package/workspace/premium-briefing-depth-test.js +4 -4
  34. package/workspace/premium-chat-attach-test.js +3 -2
  35. package/workspace/premium-chat-chart-tab-test.js +8 -7
  36. package/workspace/premium-chat-context-test.js +3 -1
  37. package/workspace/premium-chat-goal-view-test.js +3 -1
  38. package/workspace/premium-chat-line-test.js +8 -6
  39. package/workspace/premium-chat-report-tab-test.js +13 -5
  40. package/workspace/premium-chat-term-test.js +2 -2
  41. package/workspace/premium-chat-viewer-test.js +10 -16
  42. package/workspace/premium-core-doc-issue-test.js +7 -2
  43. package/workspace/premium-discuss-landing-test.js +9 -5
  44. package/workspace/premium-html-viewer-test.js +7 -3
  45. package/workspace/premium-link-suggest-test.js +6 -10
  46. package/workspace/premium-phone-card-test.js +2 -2
  47. package/workspace/premium-viewer-download-test.js +1 -1
  48. package/workspace/premium-viewer-flicker-test.js +1 -1
  49. package/workspace/premium-viewer-share-test.js +2 -2
  50. package/workspace/premium-viewer-test.js +1 -1
  51. package/workspace/premium-vw-cal-test.js +1 -1
  52. package/workspace/premium-vw-copy-test.js +3 -3
  53. package/workspace/premium-vw-doc-test.js +1 -1
  54. package/workspace/premium-vw-item-test.js +1 -1
  55. package/workspace/premium-work-depth-test.js +2 -2
  56. package/workspace/program-charter-test.js +1 -12
  57. package/workspace/program-leave-test.js +2 -2
  58. package/workspace/program-order-test.js +3 -65
  59. package/workspace/project-onboard-flow-test.js +5 -5
  60. package/workspace/public/pm/bd-work.js +24 -5
  61. package/workspace/public/pm/cozy-home.css +0 -6
  62. package/workspace/public/pm/cozy-panels.js +2 -6
  63. package/workspace/public/pm/cozy-popup.css +1 -0
  64. package/workspace/public/pm/cozy-popup.js +15 -2
  65. package/workspace/public/pm/cozy-today-page.css +1 -1
  66. package/workspace/public/pm/cozy-today.css +0 -14
  67. package/workspace/public/pm/cozy-viewer.js +14 -38
  68. package/workspace/public/pm/goal-chat.js +2 -2
  69. package/workspace/public/pm/home-app.js +8 -67
  70. package/workspace/public/pm/home-chat.js +1 -1
  71. package/workspace/public/pm/home-ses-name.js +3 -2
  72. package/workspace/public/pm/home-today.js +4 -18
  73. package/workspace/public/premium-intelligence.html +1 -1
  74. package/workspace/public/premium-viewer.html +1 -1
  75. package/workspace/public/premium-workflows.html +1 -1
  76. package/workspace/ready-dash-ui-test.js +1 -1
  77. package/workspace/rename-test.js +2 -2
  78. package/workspace/server.js +11 -12
  79. package/workspace/session-names-test.js +34 -56
  80. package/workspace/sort-order-test.js +2 -71
  81. package/workspace/split-merge-ui-test.js +1 -1
  82. package/workspace/stage-card-tasks-test.js +1 -1
  83. package/workspace/stage-card-test.js +1 -1
  84. package/workspace/task-card-test.js +1 -1
  85. package/workspace/task-press-test.js +1 -1
  86. package/workspace/task-views-test.js +1 -1
  87. package/workspace/test-lists/adler-seasons-art.json +3 -6
  88. package/workspace/test-lists/batch18-asks.json +1 -1
  89. package/workspace/test-lists/briefing-premium.json +1 -11
  90. package/workspace/test-lists/premium-agreed-viewer.json +1 -1
  91. package/workspace/test-lists/who-raised-each-idea.json +5 -0
  92. package/workspace/test-run.js +0 -2
  93. package/workspace/test-timings.json +0 -4
  94. package/workspace/tk-tasks-test.js +3 -17
  95. package/workspace/viewer-trail-test.js +2 -2
  96. package/workspace/workflows-setup-test.js +4 -2
  97. package/workspace/adler-seasons-art-test.js +0 -116
  98. package/workspace/briefing-premium-initiative-test.js +0 -289
  99. package/workspace/briefing-premium-products-test.js +0 -209
  100. package/workspace/briefing-premium-sources-test.js +0 -250
  101. package/workspace/briefing-premium-test.js +0 -282
  102. package/workspace/home-other-product-test.js +0 -197
  103. package/workspace/home-pill-test.js +0 -138
  104. package/workspace/home-railcard-test.js +0 -196
  105. package/workspace/home-rows-test.js +0 -389
  106. package/workspace/panels-test.js +0 -454
  107. package/workspace/public/premium.html +0 -48
  108. package/workspace/test-lists/batch18-panels.json +0 -9
  109. package/workspace/test-lists/home-railcard.json +0 -9
  110. package/workspace/test-lists/home-sessions-pill.json +0 -6
  111. package/workspace/test-lists/viewer-home-rows.json +0 -9
@@ -150,7 +150,8 @@ const look = () => {
150
150
  const s0 = await until(async () => { const v = await p.evaluate(look); return v.divider ? v : null; }) || await p.evaluate(look);
151
151
  ok('P5 a goal that is done: no line; "Goal done" sits over PMOS\'s result', !s0.line && /Goal done/.test(s0.divider || '') && /The draft is ready for Dita/.test(s0.dividerNext || ''), JSON.stringify(s0));
152
152
  await p.click('#hmLog .pl-dv [data-goal-open]');
153
- const s1 = await until(async () => { const v = await p.evaluate(look); return v.vw ? v : null; }) || await p.evaluate(look);
153
+ // on a desktop the chat is the popup's (home-page-retire), whose work side lists the sessions until the goal opens there
154
+ const s1 = await until(async () => { const v = await p.evaluate(look); return v.vw && /points met/.test(v.vw) ? v : null; }) || await p.evaluate(look);
154
155
  ok('P5 a tap opens the points, with the note that PMOS checked them itself', /4 of 4 done points met/.test(s1.vw || '') && /PMOS checked its own points/.test(s1.vw || ''), JSON.stringify(s1));
155
156
  st.goal = goal('stopped', { reason: 'deadline', at: ago(0.2) });
156
157
  const s2 = await until(async () => { const v = await p.evaluate(look); return /Goal stopped/.test(v.divider || '') ? v : null; }) || await p.evaluate(look);
@@ -171,14 +172,15 @@ const look = () => {
171
172
  { const st = { goal: goal('started'), conv: { turn: 'tool', messages: BASE } };
172
173
  const { p, ctx, errs } = await open(1360, st); // slice 1: the rail of places takes 80 px; at 1280 the Viewer floats over the chat line instead of sitting beside it
173
174
  const s0 = await until(async () => { const v = await p.evaluate(look); return v.line ? v : null; }) || await p.evaluate(look);
174
- ok('P9 a desktop: the same line over the chat column, opening nothing by itself', /1 of 4 done/.test(s0.line || '') && !s0.vw, JSON.stringify(s0));
175
+ const steps = (v) => /round 2 of 12/.test(v.vw || ''); // the popup's work side lists the sessions until the steps open there (home-page-retire)
176
+ ok('P9 a desktop: the same line over the popup\'s chat, opening nothing by itself', /1 of 4 done/.test(s0.line || '') && !steps(s0), JSON.stringify(s0));
175
177
  await p.click('#hmPl [data-pl="toggle"]');
176
- const s1 = await until(async () => { const v = await p.evaluate(look); return v.vw && /\bon\b/.test(v.cls) ? v : null; }) || await p.evaluate(look);
178
+ const s1 = await until(async () => { const v = await p.evaluate(look); return steps(v) && /\bon\b/.test(v.cls) ? v : null; }) || await p.evaluate(look);
177
179
  ok('P9 a tap opens the steps in the Viewer (the goal, the round, every point, Now) and the line stays tinted', /round 2 of 12/.test(s1.vw || '') && /Ready for Dita's review/.test(s1.vw || '') && /Now/.test(s1.vw || '') && !s1.open && /\bon\b/.test(s1.cls), JSON.stringify(s1));
178
180
  if (shots) await p.screenshot({ path: `${shots}/line-1280-viewer.png` });
179
181
  await p.click('#hmPl [data-pl="toggle"]');
180
- const s2 = await until(async () => { const v = await p.evaluate(look); return !v.vw ? v : null; }) || await p.evaluate(look);
181
- ok('P9 a second tap closes the Viewer and the tint goes', !s2.vw && !/\bon\b/.test(s2.cls), JSON.stringify(s2));
182
+ const s2 = await until(async () => { const v = await p.evaluate(look); return !steps(v) ? v : null; }) || await p.evaluate(look);
183
+ ok('P9 a second tap closes the steps and the tint goes', !steps(s2) && !/\bon\b/.test(s2.cls), JSON.stringify(s2));
182
184
  ok('F1 (1280) no page error and no sideways scroll', !errs.length && !s2.wide, errs.join(' | '));
183
185
  await ctx.close(); }
184
186
 
@@ -187,7 +189,7 @@ const look = () => {
187
189
  { id: 'ring-a', name: 'Weekly update draft', agent: 'claude', state: 'running', shown: 'working', created: ago(10), hx: { title: 'Weekly update draft' }, progress: { done: 3, n: 5 } },
188
190
  { id: 'ring-b', name: 'Checkout drop-off', agent: 'claude', state: 'running', shown: 'working', created: ago(9), hx: { title: 'Checkout drop-off' }, progress: null },
189
191
  ] };
190
- const { p, ctx, errs } = await open(390, st, `${F.BASE}/premium.html?ws=${encodeURIComponent(F.ws)}`);
192
+ const { p, ctx, errs } = await open(390, st, `${F.BASE}/today.html?ws=${encodeURIComponent(F.ws)}`);
191
193
  await until(() => p.evaluate(() => !!document.querySelector('#hmList [data-hm-pg="loose"]')));
192
194
  await p.evaluate(() => { const g = document.querySelector('#hmList [data-hm-pg="loose"]'); if (g && g.getAttribute('aria-expanded') !== 'true') g.click(); });
193
195
  const rows = await until(() => p.evaluate(() => { const a = [...document.querySelectorAll('#hmList .hm-r')].find((r) => /Weekly update draft/.test(r.textContent)), b = [...document.querySelectorAll('#hmList .hm-r')].find((r) => /Checkout drop-off/.test(r.textContent)); return a && b ? { a: a.innerHTML, at: a.textContent, b: b.innerHTML } : null; })) || {};
@@ -45,8 +45,10 @@ const ANSWER = { role: 'assistant', text: 'Signups from the lightbox rose to 1,2
45
45
  * card ([data-rt="askyes"]). */
46
46
  const look = () => {
47
47
  const vw = document.querySelector('#czViewer:not([hidden])'), pane = vw ? vw.querySelector('.vz[data-vw^="report:"]') : null;
48
- return { shut: !pane, title: vw ? ((vw.querySelector('.cz-vw-title') || {}).textContent || '') : '', reader: !!(vw && vw.querySelector('.vz-rp0')), review: vw && vw.querySelector('.rf-rv') ? vw.querySelector('.rf-rv').textContent : null,
49
- tpl: !!(vw && vw.querySelector('[data-cz-vw-p="template"]')) && !!(vw && vw.querySelector('[data-cz-vw-p="chat"]')), layer: false, chip: (document.querySelector('#hmLog [data-report-open]') || {}).textContent || null,
48
+ return { shut: !pane, inPop: !!(vw && vw.closest('.cz-pop')), // the popup's Viewer has no kind line (home-page-retire)
49
+ title: vw ? ((vw.querySelector('.cz-vw-title') || {}).textContent || '') : '', reader: !!(vw && vw.querySelector('.vz-rp0')), review: vw && vw.querySelector('.rf-rv') ? vw.querySelector('.rf-rv').textContent : null,
50
+ // in the popup (home-page-retire) the work side's quiet presses go into ⋯ (board 20): the template and chat presses are there
51
+ tpl: !!(vw && ((vw.querySelector('[data-cz-vw-p="template"]') && vw.querySelector('[data-cz-vw-p="chat"]')) || (vw.closest('.cz-pop') && vw.querySelector('[data-cz-vw="more"]')))), layer: false, chip: (document.querySelector('#hmLog [data-report-open]') || {}).textContent || null,
50
52
  json: /pmos-report|"kind"/.test((document.querySelector('#hmLog') || {}).textContent || ''), user: [...document.querySelectorAll('#hmLog .hm-u .hm-bub')].map((u) => u.textContent.trim()),
51
53
  tabs: pane ? [(vw.querySelector('.cz-vw-kind') || {}).textContent || ''] : [], pane: pane ? pane.textContent.replace(/\s+/g, ' ').trim() : null,
52
54
  secs: pane ? (pane.querySelector('.vz-dkt') ? pane.querySelectorAll('.vz-dkt button').length - 1 : pane.querySelectorAll('.vz-secs li').length) : 0,
@@ -56,6 +58,12 @@ const look = () => {
56
58
  wide: document.documentElement.scrollWidth > innerWidth + 1 };
57
59
  };
58
60
 
61
+ /** A header press of the Viewer: in the popup it is an item of ⋯ (board 20), elsewhere its own icon. */
62
+ const press = async (p, act, label) => {
63
+ if (await p.$(`#czViewer [data-cz-vw-p="${act}"]`)) return p.click(`#czViewer [data-cz-vw-p="${act}"]`);
64
+ await p.click('#czViewer [data-cz-vw="more"]');
65
+ await p.click(`[data-cz-vw-mi]:has-text("${label}")`);
66
+ };
59
67
  (async () => {
60
68
  const exe = findBrowser();
61
69
  if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
@@ -84,7 +92,7 @@ const look = () => {
84
92
  ok('R1 opening the chat opens no tab by itself', s0.tabs.length === 0, JSON.stringify(s0));
85
93
  await p.click('#hmLog [data-report-open]');
86
94
  const s1 = await until(async () => { const v = await p.evaluate(look); return v.pane ? v : null; }) || await p.evaluate(look);
87
- ok('R3 a new report asks its questions first (RfH4): Waits on your answers, PMOS\'s picks filled in (Slides, Growth leads, Once), the standard look, its sources, Nothing goes out and Draft it', /Report · Growth leads/.test(s1.tabs.join(' ')) && /Social login weekly/.test(s1.title)
95
+ ok('R3 a new report asks its questions first (RfH4): Waits on your answers, PMOS\'s picks filled in (Slides, Growth leads, Once), the standard look, its sources, Nothing goes out and Draft it', (/Report · Growth leads/.test(s1.tabs.join(' ')) || s1.inPop) && /Social login weekly/.test(s1.title)
88
96
  && /Waits on your answers/.test(s1.pane || '') && /my pick/.test(s1.pane || '') && /Standard PMOS look/.test(s1.pane || '') && /GA4/.test(s1.pane || '') && /Nothing goes out/.test(s1.pane || '')
89
97
  && await p.evaluate(() => document.querySelector('#czViewer [data-rt="fmt|google-slides"]').getAttribute('aria-checked') === 'true' && document.querySelector('#czViewer [data-rt="rep|0"]').getAttribute('aria-checked') === 'true' && document.querySelector('#czViewer input[data-rt="aud"]').value === 'Growth leads' && !!document.querySelector('#czViewer [data-rt="draftit"]:not([disabled])'))
90
98
  && !/Customer service|Follow a sample deck/.test(s1.pane || '') && !(await p.$('#czViewer .rt, #czViewer .obody, #dlg:not([hidden])')), JSON.stringify(s1));
@@ -101,10 +109,10 @@ const look = () => {
101
109
  ok('R4 the report\'s current state opens: its first draft in the reader, PMOS\'s review under it (RfH2), the template icon in the header', s3.reader && /I read it as your readers would/.test(s3.review || '') && s3.tpl, JSON.stringify(s3).slice(0, 600));
102
110
  if (shots) await p.screenshot({ path: `${shots}/draft-1280-light.png` });
103
111
  // the chat icon (Wawan, 2026-11-02): the report's own conversation opens in Home's chat, the report stays beside it
104
- await p.click('#czViewer [data-cz-vw-p="chat"]');
112
+ await press(p, 'chat', 'Talk to PMOS about this report');
105
113
  const ch = await until(() => p.evaluate(() => { const i = document.getElementById('hmIn'); return i && i.placeholder === 'Change the report' ? { ph: i.placeholder, log: (document.getElementById('hmLog') || {}).textContent || '', reader: !!document.querySelector('#czViewer .vz-slide, #czViewer .vz-rp0') } : null; }), 8000);
106
114
  ok('R4 the chat icon opens the report\'s own conversation beside it: PMOS asks what to change, the report stays open', !!ch && /Tell me what to change in/.test(ch.log) && ch.reader, JSON.stringify(ch));
107
- await p.click('#czViewer [data-cz-vw-p="template"]');
115
+ await press(p, 'template', 'Template: format, readers, look, sources');
108
116
  await until(() => p.evaluate(() => !!document.querySelector('#czViewer .vz[data-panel="template"] [data-rt="fmt|google-doc"]')));
109
117
  await p.click('#czViewer [data-rt="fmt|google-doc"]');
110
118
  const t1 = await until(() => p.evaluate(() => { const v = document.querySelector('#czViewer .vz[data-panel="template"]'); return v && /changed, not saved yet/.test(v.textContent) ? v.textContent.replace(/\s+/g, ' ') : null; }));
@@ -63,8 +63,8 @@ const pressTerm = async (p) => { await p.click('#hmAdd'); await p.click('#hmTerm
63
63
  r.fulfill({ json: { ok: true, id: 'sess-7', cols: 60, rows: 12, gen: 0, end: RAW.length, reset: true, data: RAW } }); });
64
64
  let pops = 0; ctx.on('page', () => { pops++; });
65
65
  await pressTerm(p);
66
- const v = await until(() => p.evaluate(() => { const w = document.querySelector('#czViewer:not([hidden])'); return w && /working/.test(w.textContent) && w.querySelector('.hv-xt[role="log"]') ? (w.querySelector('.cz-vw-kind') || {}).textContent : null; })); // the read-only view: sess-7 is routed, not running, so the live attach finds nothing
67
- ok('O1 pressing it shows that same session\'s terminal in the Viewer (read only when the socket has no live session to attach); no tab opens and nothing links to the console', v === 'Terminal · read only' && read === 'sess-7' && pops === 0
66
+ const v = await until(() => p.evaluate(() => { const w = document.querySelector('#czViewer:not([hidden])'); return w && /working/.test(w.textContent) && w.querySelector('.hv-xt[role="log"]') ? ((w.querySelector('.cz-vw-kind') || {}).textContent || (w.closest('.cz-pop') ? 'pop:' + ((w.querySelector('.cz-vw-hd') || {}).textContent || '').replace(/\s+/g, ' ').trim() : null)) : null; })); // the popup has no kind line (home-page-retire): its header names it // the read-only view: sess-7 is routed, not running, so the live attach finds nothing
67
+ ok('O1 pressing it shows that same session\'s terminal in the Viewer (read only when the socket has no live session to attach); no tab opens and nothing links to the console', (v === 'Terminal · read only' || /^pop:.*Read only/.test(v || '')) && read === 'sess-7' && pops === 0
68
68
  && !(await p.evaluate(() => [...document.querySelectorAll('a[href]')].some((a) => /console/.test(a.getAttribute('href'))))), JSON.stringify([v, read, pops]));
69
69
  const lines = () => p.evaluate(() => [...document.querySelectorAll('#czViewer .xterm-rows > div')].map((d) => d.textContent.replace(/\u00a0/g, ' ').trimEnd()).filter(Boolean));
70
70
  const l1 = await until(async () => { const l = await lines(); return l.includes('next') ? l : null; }, 9000) || await lines();
@@ -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'));