create-pmos 0.692.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 (103) hide show
  1. package/package.json +9 -3
  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 +8 -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 +1 -1
  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/live-pill-round-test.js +6 -18
  22. package/workspace/milestone-suggest-test.js +4 -28
  23. package/workspace/news-viewers-test.js +3 -29
  24. package/workspace/package-lock.json +2 -2
  25. package/workspace/package.json +1 -1
  26. package/workspace/premium-board-actions-test.js +2 -2
  27. package/workspace/premium-briefing-depth-test.js +4 -4
  28. package/workspace/premium-chat-attach-test.js +3 -2
  29. package/workspace/premium-chat-chart-tab-test.js +8 -7
  30. package/workspace/premium-chat-context-test.js +3 -1
  31. package/workspace/premium-chat-goal-view-test.js +3 -1
  32. package/workspace/premium-chat-line-test.js +8 -6
  33. package/workspace/premium-chat-report-tab-test.js +13 -5
  34. package/workspace/premium-chat-term-test.js +2 -2
  35. package/workspace/premium-chat-viewer-test.js +10 -16
  36. package/workspace/premium-core-doc-issue-test.js +7 -2
  37. package/workspace/premium-discuss-landing-test.js +9 -5
  38. package/workspace/premium-html-viewer-test.js +7 -3
  39. package/workspace/premium-link-suggest-test.js +6 -10
  40. package/workspace/premium-phone-card-test.js +2 -2
  41. package/workspace/premium-viewer-download-test.js +1 -1
  42. package/workspace/premium-viewer-flicker-test.js +1 -1
  43. package/workspace/premium-viewer-share-test.js +2 -2
  44. package/workspace/premium-viewer-test.js +1 -1
  45. package/workspace/premium-vw-cal-test.js +1 -1
  46. package/workspace/premium-vw-copy-test.js +3 -3
  47. package/workspace/premium-vw-doc-test.js +1 -1
  48. package/workspace/premium-vw-item-test.js +1 -1
  49. package/workspace/premium-work-depth-test.js +2 -2
  50. package/workspace/program-charter-test.js +1 -12
  51. package/workspace/program-leave-test.js +2 -2
  52. package/workspace/program-order-test.js +3 -65
  53. package/workspace/project-onboard-flow-test.js +5 -5
  54. package/workspace/public/pm/cozy-home.css +0 -6
  55. package/workspace/public/pm/cozy-panels.js +2 -6
  56. package/workspace/public/pm/cozy-popup.css +1 -0
  57. package/workspace/public/pm/cozy-popup.js +15 -2
  58. package/workspace/public/pm/cozy-today-page.css +1 -1
  59. package/workspace/public/pm/cozy-today.css +0 -14
  60. package/workspace/public/pm/cozy-viewer.js +14 -38
  61. package/workspace/public/pm/goal-chat.js +2 -2
  62. package/workspace/public/pm/home-app.js +8 -67
  63. package/workspace/public/pm/home-chat.js +1 -1
  64. package/workspace/public/pm/home-ses-name.js +3 -2
  65. package/workspace/public/pm/home-today.js +4 -18
  66. package/workspace/public/premium-intelligence.html +1 -1
  67. package/workspace/public/premium-viewer.html +1 -1
  68. package/workspace/public/premium-workflows.html +1 -1
  69. package/workspace/ready-dash-ui-test.js +1 -1
  70. package/workspace/rename-test.js +2 -2
  71. package/workspace/server.js +11 -12
  72. package/workspace/session-names-test.js +34 -56
  73. package/workspace/sort-order-test.js +2 -71
  74. package/workspace/split-merge-ui-test.js +1 -1
  75. package/workspace/stage-card-tasks-test.js +1 -1
  76. package/workspace/stage-card-test.js +1 -1
  77. package/workspace/task-card-test.js +1 -1
  78. package/workspace/task-press-test.js +1 -1
  79. package/workspace/task-views-test.js +1 -1
  80. package/workspace/test-lists/adler-seasons-art.json +3 -6
  81. package/workspace/test-lists/batch18-asks.json +1 -1
  82. package/workspace/test-lists/briefing-premium.json +1 -11
  83. package/workspace/test-lists/premium-agreed-viewer.json +1 -1
  84. package/workspace/test-run.js +0 -2
  85. package/workspace/test-timings.json +0 -4
  86. package/workspace/tk-tasks-test.js +3 -17
  87. package/workspace/viewer-trail-test.js +2 -2
  88. package/workspace/workflows-setup-test.js +4 -2
  89. package/workspace/adler-seasons-art-test.js +0 -116
  90. package/workspace/briefing-premium-initiative-test.js +0 -289
  91. package/workspace/briefing-premium-products-test.js +0 -209
  92. package/workspace/briefing-premium-sources-test.js +0 -250
  93. package/workspace/briefing-premium-test.js +0 -282
  94. package/workspace/home-other-product-test.js +0 -197
  95. package/workspace/home-pill-test.js +0 -138
  96. package/workspace/home-railcard-test.js +0 -196
  97. package/workspace/home-rows-test.js +0 -389
  98. package/workspace/panels-test.js +0 -454
  99. package/workspace/public/premium.html +0 -48
  100. package/workspace/test-lists/batch18-panels.json +0 -9
  101. package/workspace/test-lists/home-railcard.json +0 -9
  102. package/workspace/test-lists/home-sessions-pill.json +0 -6
  103. package/workspace/test-lists/viewer-home-rows.json +0 -9
@@ -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 });
@@ -23,13 +23,8 @@ body.cz-home { min-height: 100vh; overflow: hidden; }
23
23
  /* batch 26 item 2 (NpBw): the chat sits on the same soft gradient as on a phone */
24
24
  body.cz-home .hm-chat { background: var(--cz-ground); border-radius: var(--radius-panel, 24px); padding: 16px 24px 20px; box-shadow: 0 10px 30px -24px var(--cz-c-9da3ac); }
25
25
  body.cz-home .hm-vw .cz-vw { flex-basis: min(500px, max(380px, calc(100vw - 852px))); width: min(500px, max(380px, calc(100vw - 852px))); }
26
- body.cz-home.hm-folded:not(.cz-vw-rail) .hm-desk { padding-left: 56px; }
27
26
  body.cz-home .hm-reopen { top: 12px; right: 12px; }
28
27
  }
29
- .hm-folded:not(.cz-vw-rail) .hm-list { display: none; } /* with a Viewer open, the folded list is the rail (batch 20 item 6) */
30
- .hm-unfold { display: none; }
31
- .hm-folded:not(.cz-vw-rail) .hm-unfold { display: grid; place-items: center; position: absolute; left: 10px; top: 24px; z-index: 2; width: 36px; height: 36px; border-radius: var(--radius-md, 12px); border: 0; background: var(--cz-well); color: var(--cz-ink2); cursor: pointer; }
32
- .hm-folded:not(.cz-vw-rail) .hm-desk { padding-left: 56px; }
33
28
  .hm-desk button { font-family: var(--cz-sans); }
34
29
  .hm-ib { width: 36px; height: 36px; border-radius: var(--radius-md, 12px); display: grid; place-items: center; border: 0; background: none; color: var(--cz-ink2); cursor: pointer; padding: 0; flex: none; }
35
30
  .hm-ib:hover { background: var(--cz-well2); }
@@ -493,7 +488,6 @@ form.hm-box textarea { min-height: 48px; border: 0; background: none; resize: no
493
488
  * where the phone chat has no button */
494
489
  body.cz-home #hmFoot::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 72px; pointer-events: none; background: var(--cz-ground); background-size: 100% 1000px; -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%); mask-image: linear-gradient(to bottom, transparent, black 40%); } /* the ground is a gradient: its first colours meet the composer's top */
495
490
  .hm-x { opacity: 1; }
496
- .hm-unfold, .hm-folded .hm-unfold { display: none; }
497
491
  .hm-reopen { display: none; }
498
492
  .hm-bub, .hm-qb { max-width: 88%; }
499
493
  .hm-sheet .cz-fabw { z-index: 45; }
@@ -157,7 +157,7 @@ function layout() {
157
157
  sync();
158
158
  const B = document.body, phone = isPhone(), man = managed(), ids = [C, ...vs().map((p) => p.id)];
159
159
  const back = S.man && !man; // back to today's split: cozy-viewer.js decides the width and the rail again
160
- if (back) { S.keepList = false; P.rail(P.owned && P.owned() !== null ? P.owned() : false); }
160
+ if (back) { S.keepList = false; P.rail(false); }
161
161
  S.man = man;
162
162
  B.classList.toggle('cz-pn', !phone);
163
163
  B.classList.toggle('cz-pn-man', man);
@@ -184,11 +184,7 @@ function layout() {
184
184
  if (man && !phone && !S.page) {
185
185
  const room = S.desk.clientWidth - 64 - (S.row.length - 1) * 22; // the desk less its padding and the gaps
186
186
  const list = document.getElementById('hmList'), lw = list ? list.offsetWidth || 316 : 0;
187
- // Home owns its list's fold (batch 20 item 6). A full Viewer folds it only as a starting default: never once the PM has pressed the fold or
188
- // unfold (remembered), and not after the rail's "Show the list" in this layout (batch 25 item 12: the PM can always open or close it)
189
- const own = P.owned ? P.owned() : null;
190
- const startFold = !S.keepList && !(P.chosen && P.chosen()) && S.row.length === 1 && S.row[0] !== C;
191
- const fold = own !== null ? own || startFold : !S.keepList && (!S.row.includes(C) || room - lw < S.row.length * PANEL);
187
+ const fold = !S.keepList && (!S.row.includes(C) || room - lw < S.row.length * PANEL);
192
188
  if (fold !== P.railOn()) P.rail(fold);
193
189
  }
194
190
  if (back) P.rest(); else P.relayout();
@@ -38,6 +38,7 @@ body.cz-pop-drag, body.cz-pop-drag * { cursor: col-resize !important; user-selec
38
38
  .cz-pop-t span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
39
39
  .cz-pop-go:focus-visible, .cz-pop-t:focus-visible, .cz-pop-ib:focus-visible, .cz-pop-x:focus-visible, .cz-pop-sr:focus-visible, .cz-pop-f:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
40
40
  .cz-pop-tw { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 0; }
41
+ .cz-pop-tw .hm-ren { flex: 1 1 100%; } /* renaming: the field fills the title */
41
42
  /* the context line under the session (round 3 point 19a): one quiet line, cut with … */
42
43
  .cz-pop-cx { flex: 1 0 100%; min-width: 0; padding-left: 10px; font-size: var(--fs-meta); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
43
44
  .cz-pop-mm { left: auto; right: 12px; width: 260px; }
@@ -37,7 +37,7 @@ const I = {
37
37
  chat: 'M5 6.5A2.5 2.5 0 0 1 7.5 4h9A2.5 2.5 0 0 1 19 6.5v7a2.5 2.5 0 0 1-2.5 2.5H11l-4 3.5V16h.5A2.5 2.5 0 0 1 5 13.5z',
38
38
  hide: 'M4 5h16v14H4zM14.5 5v14M9 10l2 2-2 2', close: 'M6 6l12 12M18 6L6 18', down: 'M7 10l5 5 5-5', back: 'M15 6l-6 6 6 6',
39
39
  plus: 'M12 5v14M5 12h14', list: 'M5 7h14M5 12h14M5 17h14', find: 'M11 4.5a6.5 6.5 0 1 0 0 13a6.5 6.5 0 1 0 0-13M16 16l4 4', flag: 'M5 21V4h11l-2 4 2 4H5',
40
- side: 'M3.5 5h17v14h-17zM12 5v14', more: 'M5 12h.01M12 12h.01M19 12h.01',
40
+ side: 'M3.5 5h17v14h-17zM12 5v14', more: 'M5 12h.01M12 12h.01M19 12h.01', pen: 'M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4',
41
41
  };
42
42
  const CLAUDE = { key: 'claude', name: 'PMOS', initial: 'P' };
43
43
  const MIN_WORK = 480, MIN_CHAT = 320, DEF_CHAT = 460, DAY_MS = 864e5, POLL = 6000, UNDO = 6000, CHOOSER = 5;
@@ -56,6 +56,8 @@ const S = {
56
56
  };
57
57
 
58
58
  /* ── the page's hooks ── */
59
+ /** The page's chat changed a session (a rename): the title draws again now, and the sessions are read again. */
60
+ export function refresh() { if (!S.open) return; drawTitle(); read(); }
59
61
  export function useChat(p) { S.home = p && p.el && typeof p.open === 'function' ? p : null; }
60
62
  export function setTitles(fn) { S.titles = typeof fn === 'function' ? fn : null; }
61
63
  export function setOpener(fn) { S.opener = typeof fn === 'function' ? fn : null; }
@@ -312,10 +314,19 @@ function rowHtml(r, sel) {
312
314
  function drawTitle() {
313
315
  if (!S.title || !S.open) return;
314
316
  if (S.view === 'all') {
317
+ delete S.title.dataset.ren;
315
318
  S.title.innerHTML = `<button type="button" class="cz-pop-ib" data-pop="unall" aria-label="Back to the session you were in" title="Back to the session you were in">${svg(I.back)}</button><b class="t-row">All sessions</b>`;
316
319
  return;
317
320
  }
318
- const r = curRow(), name = r ? r.name : 'Ask PMOS', on = !!S.menu && S.menu.dataset.kind !== 'more';
321
+ // a chat with no session yet (an address's ?about, Discuss in chat) is named by what it is about, not "Ask PMOS"
322
+ const ct = !curRow() && S.chat && S.chat.current ? S.chat.current() : null;
323
+ const r = curRow(), name = r ? r.name : (ct && ct.title) || 'Ask PMOS', on = !!S.menu && S.menu.dataset.kind !== 'more';
324
+ // a rename in progress: the title is the name field (home-ses-name.js draws it; Enter saves, Esc cancels)
325
+ if (r && S.home && S.home.renaming && S.home.renaming(r.id)) {
326
+ // the sessions' poll draws the title again: the same field stays as it is, so the typing and the focus stay in it
327
+ const h = S.home.nameHtml(r.id, r.name); if (S.title.dataset.ren !== h) { S.title.innerHTML = h; S.title.dataset.ren = h; } return;
328
+ }
329
+ delete S.title.dataset.ren;
319
330
  // one quiet context line under the session (round 3 point 19a, the phone chat's line): what the chat is about, said once
320
331
  const a = S.about, cx = a && a.title ? (a.kind === 'initiative' ? 'Initiative' : a.kind === 'program' ? 'Program' : 'About') + ' · ' + a.title : '';
321
332
  S.title.innerHTML = `<button type="button" class="cz-pop-t" data-pop="pick" aria-haspopup="menu" aria-expanded="${on}" title="Change session" aria-label="${esc(name + '. Change session')}"><span>${esc(name)}</span>${svg(I.down, 16)}</button>`
@@ -352,6 +363,7 @@ function openMore() {
352
363
  m.innerHTML = `<button type="button" class="cz-pop-f" role="menuitem" data-pop="where">${svg(I.side, 16)}${beside() ? 'Open work in this popup' : 'Open work beside the page'}</button>`
353
364
  + `<button type="button" class="cz-pop-f" role="menuitem" data-pop="hide">${svg(I.hide, 16)}Hide the chat<span>Ctrl J</span></button>`
354
365
  + `<button type="button" class="cz-pop-f" role="menuitem" data-pop="pick">${svg(I.list, 16)}Sessions</button>`
366
+ + (r && S.home && S.home.nameHtml ? `<button type="button" class="cz-pop-f" role="menuitem" data-hm-rn="${esc(r.id)}">${svg(I.pen, 16)}Rename session</button>` : '')
355
367
  + (r && r.live ? `<hr><button type="button" class="cz-pop-f" role="menuitem" data-end="${esc(r.id)}">${svg(I.close, 16)}End session</button>` : '');
356
368
  S.right.appendChild(m); S.menu = m;
357
369
  const mb = S.card.querySelector('[data-pop="more"]'); if (mb) mb.setAttribute('aria-expanded', 'true');
@@ -441,6 +453,7 @@ async function newSession() {
441
453
  }
442
454
 
443
455
  function onClick(e) {
456
+ if (e.target.closest('[data-hm-rn]')) { closeMenu(); return; } // Rename session: home-ses-name.js takes the press from here
444
457
  const end1 = e.target.closest('[data-end]'); if (end1) { e.preventDefault(); end(end1.dataset.end); return; }
445
458
  const row = e.target.closest('[data-sid]'); if (row) { e.preventDefault(); pick(row.dataset.sid); return; }
446
459
  const b = e.target.closest('[data-pop]'); if (!b) return;
@@ -8,7 +8,7 @@
8
8
  * end of this file) in place of Home's list. */
9
9
 
10
10
  @media (min-width: 761px) {
11
- body.cz-today #hmDesk > .hm-list, body.cz-today #hmDesk > .hm-chat, body.cz-today #hmDesk > .cz-pn-div, body.cz-today #hmUnfold, body.cz-today .hm-top { display: none !important; }
11
+ body.cz-today #hmDesk > .hm-list, body.cz-today #hmDesk > .hm-chat, body.cz-today #hmDesk > .cz-pn-div, body.cz-today .hm-top { display: none !important; }
12
12
  /* the white page panel: the only big container, beside the rail (as the Board's) */
13
13
  body.cz-home.cz-today #hmDesk { display: block; overflow: auto; top: 16px; right: 16px; bottom: 16px; left: var(--cz-railx, 16px); padding: 28px 32px 32px; background: var(--cz-card); border-radius: 28px; box-shadow: var(--cz-lift); }
14
14
  /* the page starts at the left edge of the panel, like Work and Library; on a wide screen the log stops at about 1100 px */
@@ -530,20 +530,6 @@ body.cz-home .hm-hd.hv-bar > .hv-hi { flex: 1 0 auto; max-width: 100%; }
530
530
  /* the weekly review done for the week (batch 17 item 4-B, AdM1): Adler calm beside the words */
531
531
  .rv-done { display: flex; align-items: center; gap: 10px; }
532
532
 
533
- /* The folded rail's card (batch 18 item 14, FlA1–FlA5): beside the pressed tile, Home's popover look, Home's own rows inside. The pill's
534
- * sessions open in place under the row (.hv-rcs), not as a second popover. Its left and top are set from the tile (home-app.js). */
535
- .hv-rc { position: fixed; z-index: 60; width: 372px; max-width: calc(100vw - 96px); max-height: calc(100vh - 24px); overflow-y: auto; background: var(--cz-card); border-radius: 20px; padding: 6px; box-shadow: 0 24px 50px -20px rgba(42,46,53,.4), 0 0 0 1px var(--cz-hair); box-sizing: border-box; text-align: left; }
536
- .hv-rch { display: flex; align-items: center; gap: 6px; min-height: 44px; }
537
- .hv-rch .hv-pt { flex: 0 1 auto; gap: 8px; }
538
- .hv-rch .hv-pt .hv-tl { width: 26px; height: 26px; border-radius: 8px; }
539
- .hv-rch .hv-pt > svg { color: var(--cz-ink3); flex: none; }
540
- .hv-rch .hv-msd { margin-left: auto; }
541
- .hv-rch .hv-ib { margin-left: auto; flex: none; }
542
- .hv-rch .hv-msd + .hv-ib { margin-left: 2px; }
543
- .hv-rcb .hm-none { margin: 6px 10px 10px; }
544
- .hv-rcs { margin: 0 0 4px; padding: 4px; background: color-mix(in srgb, var(--cz-well) 55%, var(--cz-card)); border-radius: 14px; }
545
- .hv-rcs .hv-r::before { display: none; }
546
- .hv-rcs .hv-r.safe { background: var(--cz-bluebg); border-radius: 14px; }
547
533
  /* Home's one grill line (canvas FcPhone, Home): quiet, with ✦ at its end */
548
534
  .hv-gn { display: flex; align-items: center; gap: 8px; color: var(--cz-ink2); }
549
535
  .hv-gn span { flex: 1; min-width: 0; }
@@ -78,7 +78,7 @@
78
78
  * word press, only where a decision has two answers (Return it | Keep it as is).
79
79
  * czSections([{ id, title, count, open, render | html, tail? }], { key }) → the folding rows. A row folds and unfolds in place, and the fold
80
80
  * is remembered per key and id (localStorage, a private window forgets it). render(): a string of markup, called once when drawn.
81
- * widthOf(kind) · setWidth(px) · wide(on?) · railOn() for the page and the tests; railCard(fn) · railSync(key?) · keepWide() for a page
81
+ * widthOf(kind) · setWidth(px) · wide(on?) · railOn() for the page and the tests; railSync(key?) for a page
82
82
  * that draws a card for a rail tile (Home).
83
83
  * The look is in cozy-vw-shell.css (loaded here once) over cozy.css (.cz-vw…). The old #dlg path (premium-viewer.js) is separate. */
84
84
  import { czPlaceholder } from './cozy-placeholder.js';
@@ -128,13 +128,7 @@ const kindKey = (k) => String(k || 'item').trim().toLowerCase().replace(/^file
128
128
  * key or the last open() went to, so the exported API always speaks of the Viewer used last. G is what the page has once: its list's rail,
129
129
  * the listeners, the rail's card. Only the first instance (#czViewer) writes the browser history; another keeps its own ← → trail.
130
130
  * Without cozy-panels.js (Board, Intelligence) the limit stays 1 and there is one Viewer, as before. */
131
- const G = { chat: null, subs: [], card: null, railKey: null, rail: false, lw: 0, hold: 0, tick: 0, limit: 1, beside: null, place: null, managed: null, own: null, popH: null, popNext: null };
132
- /** The list's fold, when the page owns it (Home, batch 20 item 6): { folded() → bool, show() }. Then only the list's own icon folds or unfolds it:
133
- * a Viewer's width, its reset, open wide and its close never do. null: the Viewer folds the list to a rail as it needs (a page without one). */
134
- export function listFold(o) { G.own = o && typeof o.folded === 'function' ? o : null; }
135
- const owned = () => (G.own ? !!G.own.folded() : null);
136
- /** true: the PM has pressed the list's fold or unfold, so a full Viewer keeps the list as the PM left it (no starting fold). */
137
- const chosen = () => !!(G.own && typeof G.own.chosen === 'function' && G.own.chosen());
131
+ const G = { chat: null, subs: [], railKey: null, rail: false, lw: 0, tick: 0, limit: 1, beside: null, place: null, managed: null, popH: null, popNext: null };
138
132
  const mk = (i) => ({ i, el: null, cur: null, back: null, stack: [], fwd: [], wide: false, w: 0, drill: false, over: false, used: 0, ph: false, via: '', pop: false });
139
133
  let V = mk(0);
140
134
  const ALL = [V];
@@ -211,7 +205,9 @@ export function headHtml(it) {
211
205
  const from = o.pop && o.from ? `<button type="button" data-cz-vw-path="from">${esc(o.from)}</button><span aria-hidden="true">›</span>` : '';
212
206
  const pth = o.pop && ((o.path || []).length || from) ? `<nav class="cz-vw-path" aria-label="Path">${from}${(o.path || []).map((t, i, a) => `<button type="button" data-cz-vw-path="${i - a.length}">${esc(t || 'Back')}</button><span aria-hidden="true">›</span>`).join('')}</nav>` : '';
213
207
  // kindChip: the small kind chip after the title in the popup (Meeting notes, Report, Prototype)
214
- const kchip = o.pop && o.kindChip ? `<span class="cz-vw-kchip">${esc(o.kindChip)}</span>` : '';
208
+ // a read-only item (an ended session's terminal) says so in the popup too, where the kind line is not drawn (honest state)
209
+ const kc = o.kindChip || (o.pop && /\bread only\b/i.test(o.kind || '') ? 'Read only' : '');
210
+ const kchip = o.pop && kc ? `<span class="cz-vw-kchip">${esc(kc)}</span>` : '';
215
211
  const chip = o.chip && (o.chip.n > 0 || o.chip.looking) ? `<button type="button" class="cz-vw-chip${o.chip.looking ? ' live' : ''}" data-cz-vw="chip" aria-haspopup="dialog" aria-label="${esc(o.chip.label || 'PMOS proposes ' + o.chip.n + '. Open')}" title="${esc(o.chip.label || 'PMOS proposes')}">${svg(ICONS.spark, 13, 2)}${o.chip.n > 0 && !o.chip.quiet ? `<b>${esc(o.chip.n)}</b>` : ''}</button>` : '';
216
212
  const canBack = o.canBack || !!from;
217
213
  return (canBack || phone ? ib('back', o.canBack ? (o.backTo ? 'Back to ' + o.backTo : 'Back') : from ? 'Back to ' + o.from : 'Close the viewer', P.back) : '')
@@ -319,12 +315,9 @@ function setRail(on) {
319
315
  bar.innerHTML = `<button type="button" class="cz-vw-ib" data-cz-vw-rail="show" aria-label="Show the list" title="Show the list">${svg(P.list, 18)}</button><div class="cz-vw-railtiles"></div>`;
320
316
  bar.addEventListener('click', (e) => {
321
317
  const b = e.target.closest('[data-cz-vw-rail]'); if (!b) return;
322
- if (b.dataset.czVwRail === 'show' && G.own) { if (G.own.show) G.own.show(); if (G.rail) setRail(false); return; } // the page unfolds its own list; a layout that folded it never holds it folded
323
318
  if (b.dataset.czVwRail === 'show' && G.managed && ALL.some((x) => shown(x) && G.managed('v' + x.i))) { setRail(false); return; } // cozy-panels.js lays it out
324
319
  if (b.dataset.czVwRail === 'show') { V.wide = false; apply(Math.min(V.w, sideMax())); redraw(); return; }
325
- // a group's tile: the page's card of that group's rows, beside the tile (batch 18 item 14, FlA1); the rail and the Viewer stay
326
- if (G.card) { G.card(b.dataset.czVwRail, b, e.detail === 0); return; }
327
- // a page without a card: the list comes back, at that group
320
+ // a group's tile: the list comes back, at that group
328
321
  const src = list.querySelector('[data-cz-rail-tile="' + CSS.escape(b.dataset.czVwRail) + '"]');
329
322
  V.wide = false; apply(Math.min(V.w, sideMax())); redraw();
330
323
  if (src && src.scrollIntoView) src.scrollIntoView({ block: 'nearest' });
@@ -338,21 +331,18 @@ function setRail(on) {
338
331
  function railTiles(list, bar) {
339
332
  const tiles = [...list.querySelectorAll('[data-cz-rail-tile]')].slice(0, 8);
340
333
  const box = bar.querySelector('.cz-vw-railtiles');
341
- const sig = tiles.map((t) => t.outerHTML).join('') + '|' + !!G.card;
334
+ const sig = tiles.map((t) => t.outerHTML).join('');
342
335
  if (box.__sig !== sig) {
343
336
  box.__sig = sig; box.innerHTML = '';
344
337
  tiles.forEach((t) => { // a copy of the tile itself (its tint, initials and dot), in a press that names the group
345
338
  const nm = t.dataset.czRailName || t.textContent.trim(), here = t.hasAttribute('data-cz-rail-here');
346
339
  const btn = document.createElement('button'); btn.type = 'button'; btn.className = 'cz-vw-railtile' + (here ? ' here' : ''); btn.dataset.czVwRail = t.dataset.czRailTile;
347
- btn.setAttribute('aria-label', (G.card ? nm + (here ? ' (open)' : '') + '. Show its initiatives' : 'Show the list at ' + nm)); btn.title = nm;
348
- if (G.card) btn.setAttribute('aria-haspopup', 'dialog');
340
+ btn.setAttribute('aria-label', 'Show the list at ' + nm); btn.title = nm;
349
341
  const c = t.cloneNode(true); c.removeAttribute('data-cz-rail-tile'); c.removeAttribute('data-cz-rail-name'); c.removeAttribute('data-cz-rail-here'); btn.appendChild(c); box.appendChild(btn);
350
342
  });
351
343
  }
352
- box.querySelectorAll('.cz-vw-railtile').forEach((b) => { const on = b.dataset.czVwRail === G.railKey; b.classList.toggle('on', on); if (G.card) b.setAttribute('aria-expanded', String(on)); });
344
+ box.querySelectorAll('.cz-vw-railtile').forEach((b) => { const on = b.dataset.czVwRail === G.railKey; b.classList.toggle('on', on); });
353
345
  }
354
- /** A page that draws a card for a rail tile (Home): fn(key, tile, byKey) on a tile's press, in place of bringing the list back. */
355
- export function railCard(fn) { G.card = typeof fn === 'function' ? fn : null; railSync(); }
356
346
  /** The tile whose card is open (null: none): its ring and aria-expanded. The page calls it after a redraw of its list, so the rail's tiles
357
347
  * follow the list (a new "here" bar, a dot). */
358
348
  export function railSync(key) {
@@ -360,8 +350,6 @@ export function railSync(key) {
360
350
  const list = listEl(), bar = G.rail && list && list.querySelector(':scope > .cz-vw-railbar');
361
351
  if (bar) railTiles(list, bar);
362
352
  }
363
- /** The next open() keeps the Viewer as wide as it is and the rail folded (a pick from the rail's card, FlA4After). */
364
- export function keepWide() { G.hold = Date.now() + 2000; }
365
353
  const sideMax = () => { const r = room(); return r.float ? r.side : Math.max(MIN, r.side); };
366
354
  /** Set the width in px: past what the chat leaves, the list folds to a rail first; never under 420 or over about 70%. */
367
355
  function apply(px) {
@@ -372,17 +360,6 @@ function apply(px) {
372
360
  // cozy-panels.js lays the panels out itself (two Viewers, a Viewer full or sliding over): it sizes this one, the rail is its own call
373
361
  if (G.managed && G.managed('v' + V.i)) { el.style.width = ''; el.classList.toggle('cz-vw-w2', el.offsetWidth >= W2); return; } // its flex is the engine's; V.w keeps the width beside the chat
374
362
  let r = room();
375
- if (G.own) {
376
- // the page owns the fold: the rail is its choice, and the Viewer takes only the room beside it (batch 20 item 6)
377
- setRail(owned()); r = room();
378
- const over = !r.float && r.hasList && r.side < MIN && !!(el.parentNode && el.parentNode.hasAttribute('data-cz-vw-overlay'));
379
- if (over !== V.over) { V.over = over; document.body.classList.toggle('cz-vw-over', over); }
380
- const cap = r.float ? r.wideMax : over ? r.right : Math.max(MIN, G.rail ? r.wideMax : r.side);
381
- const w = Math.max(Math.min(MIN, cap), Math.min(Math.round(px || r.def), cap));
382
- V.w = w; el.style.width = w + 'px'; el.style.flexBasis = w + 'px'; el.classList.toggle('cz-vw-w2', w >= W2);
383
- const g = el.querySelector('.cz-vw-grip'); if (g) { g.setAttribute('aria-valuenow', String(w)); g.setAttribute('aria-valuemin', String(MIN)); g.setAttribute('aria-valuemax', String(cap)); }
384
- return;
385
- }
386
363
  // a host that keeps its list (Home, HbCNarrow): with no room beside the chat the Viewer lies over the chat, at most the room right of the list
387
364
  const over = !r.float && r.hasList && r.side < MIN && !V.wide && !!(el.parentNode && el.parentNode.hasAttribute('data-cz-vw-overlay'));
388
365
  if (over !== V.over) { V.over = over; document.body.classList.toggle('cz-vw-over', over); }
@@ -413,7 +390,7 @@ export function wide(on) {
413
390
  redraw();
414
391
  return V.wide;
415
392
  }
416
- function resetW() { if (!V.cur) return; store.set('cz-vw-w:' + kindKey(V.cur.kind), null); V.wide = false; if (!G.own) setRail(false); apply(room().def); redraw(); }
393
+ function resetW() { if (!V.cur) return; store.set('cz-vw-w:' + kindKey(V.cur.kind), null); V.wide = false; setRail(false); apply(room().def); redraw(); }
417
394
  function grip(el) {
418
395
  const g = document.createElement('div'), x = V;
419
396
  g.className = 'cz-vw-grip'; g.setAttribute('role', 'separator'); g.setAttribute('aria-orientation', 'vertical'); g.tabIndex = 0;
@@ -688,8 +665,7 @@ export function open(it) {
688
665
  body.className = 'cz-vw-body'; body.onclick = null; body.oninput = null; body.onchange = null; body.onkeydown = null; // what one item's render added to the body does not reach the next
689
666
  const wasHidden = el.hidden;
690
667
  el.hidden = false;
691
- const hold = G.hold > Date.now() && !wasHidden && (V.wide || G.rail); G.hold = 0;
692
- if (!hold && !(sameKind && !wasHidden && (V.wide || G.rail))) { const k = widthOf(o.kind); V.wide = false; apply(k || room().def); redraw(); }
668
+ if (!(sameKind && !wasHidden && (V.wide || G.rail))) { const k = widthOf(o.kind); V.wide = false; apply(k || room().def); redraw(); }
693
669
  if (typeof o.render === 'function') o.render(body); else if (o.html) body.innerHTML = o.html;
694
670
  emit();
695
671
  if (isPhone()) el.focus();
@@ -823,7 +799,7 @@ function holdable(el, x) {
823
799
  }
824
800
  /** A hold that opened the trail list is not also a press. */
825
801
  function held() { if (HOLD.fired && Date.now() - HOLD.fired < 800) { HOLD.fired = 0; return true; } return false; }
826
- const PAGES = { '/premium.html': 'Home', '/premium-board.html': 'Board', '/premium-intelligence.html': 'Intelligence', '/premium-insights.html': 'Intelligence' };
802
+ const PAGES = { '/': 'Today', '/today.html': 'Today', '/premium-board.html': 'Board', '/premium-intelligence.html': 'Intelligence', '/premium-insights.html': 'Intelligence' };
827
803
  function trailMenu(b, x) {
828
804
  if (!V.cur || !V.el) return;
829
805
  const old = V.el.querySelector('.cz-vw-trail'); if (old) old.remove();
@@ -881,7 +857,7 @@ export const panels = {
881
857
  relayout() { ALL.filter(shown).forEach((x) => on(x, () => { apply(V.wide ? room().wideMax : V.w || room().def); redraw(); })); },
882
858
  /** Back beside the chat after the engine laid it out: the width its kind keeps, else the default. */
883
859
  rest() { ALL.filter(shown).forEach((x) => on(x, () => { const k = widthOf(V.cur.kind); V.wide = false; apply(k || room().def); redraw(); })); },
884
- rail(v) { setRail(!!v); }, railOn: () => G.rail, owned, chosen,
860
+ rail(v) { setRail(!!v); }, railOn: () => G.rail,
885
861
  };
886
862
  /* ── the popup (slice 2, pm/cozy-popup.js) ── */
887
863
  /** cozy-popup.js registers { host() → the popup's left element, show(pop) → the popup is shown with the chat about pop }. */
@@ -895,4 +871,4 @@ const popShown = () => ALL.some((y) => y.pop && shown(y));
895
871
  export function popNext(pop) { G.popNext = pop ? { pop, t: Date.now() } : null; }
896
872
  /** Close the popup's Viewer (an item with unsaved changes asks first). */
897
873
  export function closePop() { const x = ALL.find((y) => y.pop && shown(y)); if (x) { use(x); guarded(close); } }
898
- if (typeof window !== 'undefined') window.czViewer = { open, close, closeOf, bodyOf, back, forward, trail, replaceUrl, drill, setPresses, setChip, setCheck, isOpen, current, body, onChange, placeholder, retitle, czSummary, czSections, widthOf, setWidth, wide, railOn, railCard, railSync, keepWide, ICONS };
874
+ if (typeof window !== 'undefined') window.czViewer = { open, close, closeOf, bodyOf, back, forward, trail, replaceUrl, drill, setPresses, setChip, setCheck, isOpen, current, body, onChange, placeholder, retitle, czSummary, czSections, widthOf, setWidth, wide, railOn, railSync, ICONS };
@@ -100,7 +100,7 @@ export function methodHtml(block, { live = false, open = false } = {}) {
100
100
  const why = block.why ? String(block.why) : m ? m.fits : '';
101
101
  const inner = `Method: <b>${esc(name)}</b>${live ? P(ICON.down, 14) : ''}${why ? `<em>${esc(why)}</em>` : ''}`;
102
102
  if (!live) return `<p class="gmeth">${inner}</p>`;
103
- const menu = `<span class="gmenu" role="menu" aria-label="Ask with another method"${open ? '' : ' hidden'}>${METHODS.filter((x) => !m || x.id !== m.id).map((x) => `<button type="button" role="menuitem" data-goal-method="${esc(x.id)}"><b>${esc(x.name)}</b><em>${esc(x.fits)}</em></button>`).join('')}</span>`;
103
+ const menu = `<span class="gmenu" role="menu" aria-label="Ask with another method"${open ? ' data-esc-layer' : ' hidden'}>${METHODS.filter((x) => !m || x.id !== m.id).map((x) => `<button type="button" role="menuitem" data-goal-method="${esc(x.id)}"><b>${esc(x.name)}</b><em>${esc(x.fits)}</em></button>`).join('')}</span>`;
104
104
  return `<span class="gmw"><button type="button" class="gmeth" data-goal-meth aria-haspopup="menu" aria-expanded="${open}" title="Change the method">${inner}</button>${menu}</span>`;
105
105
  }
106
106
 
@@ -183,7 +183,7 @@ export function editedDraft(base, fields) {
183
183
  /** The choice when /goal is typed while a goal works here: one goal runs in a chat at a time. here: the working goal's sentence.
184
184
  * newChat: false where this page cannot open a new chat (then only "Here" is offered). Esc or another message closes it (home-chat.js). */
185
185
  export function goalChoiceHtml(here, { newChat = true } = {}) {
186
- return `<div class="hm-a gchoice"><div class="hm-ab"><div class="askc" role="group" aria-label="Where should the new goal go?"><p class="k">One goal runs in a chat at a time</p><b>Where should the new goal go?</b><div class="gchips">`
186
+ return `<div class="hm-a gchoice" data-esc-layer><div class="hm-ab"><div class="askc" role="group" aria-label="Where should the new goal go?"><p class="k">One goal runs in a chat at a time</p><b>Where should the new goal go?</b><div class="gchips">`
187
187
  + (newChat ? `<button type="button" class="gchip rec" data-goal-where="new">In a new chat<small>recommended · this goal keeps going</small></button>` : '')
188
188
  + `<button type="button" class="gchip" data-goal-where="here">Here, instead of this goal<small class="warn">stops “${esc(here || 'the goal')}”</small></button>`
189
189
  + '</div></div></div></div>';