create-pmos 0.398.0 → 0.399.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 (126) hide show
  1. package/package.json +13 -13
  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/briefing-premium-adddoc-test.js +18 -14
  7. package/workspace/briefing-premium-board-test.js +80 -48
  8. package/workspace/briefing-premium-calendar-2-test.js +36 -36
  9. package/workspace/briefing-premium-calendar-3-test.js +39 -39
  10. package/workspace/briefing-premium-calendar-test.js +23 -24
  11. package/workspace/briefing-premium-doc-edit-test.js +6 -2
  12. package/workspace/briefing-premium-initiative-test.js +38 -16
  13. package/workspace/briefing-premium-insights-test.js +114 -37
  14. package/workspace/briefing-premium-metrics-test.js +6 -4
  15. package/workspace/briefing-premium-products-test.js +10 -7
  16. package/workspace/briefing-premium-sources-test.js +25 -22
  17. package/workspace/briefing-premium-test.js +46 -42
  18. package/workspace/briefing-premium-work-test.js +9 -9
  19. package/workspace/changelog.json +12 -0
  20. package/workspace/ev-everywhere-test.js +210 -0
  21. package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
  22. package/workspace/guide/home.md +39 -18
  23. package/workspace/guide/index.md +1 -1
  24. package/workspace/lib/board-grill.js +63 -0
  25. package/workspace/lib/board-premium.js +36 -5
  26. package/workspace/lib/initiative-layout.js +77 -0
  27. package/workspace/lib/insights-premium.js +3 -2
  28. package/workspace/lib/insights-records.js +21 -7
  29. package/workspace/lib/meeting-points.js +52 -0
  30. package/workspace/lib/news-for-you.js +88 -0
  31. package/workspace/lib/notes-series.js +29 -6
  32. package/workspace/lib/report-confirm.js +48 -0
  33. package/workspace/lib/route-modules.js +8 -0
  34. package/workspace/lib/routes-board-docs.js +46 -0
  35. package/workspace/lib/routes-board-grill.js +90 -0
  36. package/workspace/lib/routes-home-review.js +108 -0
  37. package/workspace/lib/routes-initiative-layout.js +57 -0
  38. package/workspace/lib/routes-insights-premium.js +4 -1
  39. package/workspace/lib/routes-insights-records.js +8 -4
  40. package/workspace/lib/routes-meeting-points.js +37 -0
  41. package/workspace/lib/routes-news.js +57 -0
  42. package/workspace/lib/routes-notes.js +2 -1
  43. package/workspace/lib/routes-report-confirm.js +31 -0
  44. package/workspace/lib/routes-search.js +38 -0
  45. package/workspace/lib/search-index.js +176 -0
  46. package/workspace/package-lock.json +2 -2
  47. package/workspace/package.json +1 -1
  48. package/workspace/premium-board-actions-test.js +86 -50
  49. package/workspace/premium-briefing-depth-test.js +55 -54
  50. package/workspace/premium-chat-chart-tab-test.js +4 -2
  51. package/workspace/premium-chat-report-tab-test.js +16 -2
  52. package/workspace/premium-core-doc-issue-test.js +15 -13
  53. package/workspace/premium-phone-card-test.js +5 -3
  54. package/workspace/premium-report-read-test.js +55 -18
  55. package/workspace/premium-vw-backlog-test.js +2 -2
  56. package/workspace/premium-vw-cal-test.js +50 -35
  57. package/workspace/premium-vw-doc-test.js +9 -3
  58. package/workspace/premium-vw-item-test.js +1 -1
  59. package/workspace/premium-vw-jira-test.js +2 -2
  60. package/workspace/premium-vw-meet-test.js +37 -40
  61. package/workspace/premium-vw-notes-test.js +21 -19
  62. package/workspace/premium-vw-rec-test.js +11 -12
  63. package/workspace/premium-welcome-test.js +3 -3
  64. package/workspace/premium-work-depth-test.js +3 -3
  65. package/workspace/public/pm/bd-acts.js +303 -225
  66. package/workspace/public/pm/bd-asks.js +261 -0
  67. package/workspace/public/pm/bd-pop.js +59 -0
  68. package/workspace/public/pm/bd-span.js +49 -13
  69. package/workspace/public/pm/bd-views.js +169 -0
  70. package/workspace/public/pm/cozy-board.css +301 -0
  71. package/workspace/public/pm/cozy-ev.css +228 -0
  72. package/workspace/public/pm/cozy-evmodel.js +106 -0
  73. package/workspace/public/pm/cozy-evui.js +47 -0
  74. package/workspace/public/pm/cozy-insights.css +148 -10
  75. package/workspace/public/pm/cozy-nav.js +103 -39
  76. package/workspace/public/pm/cozy-news.js +140 -0
  77. package/workspace/public/pm/cozy-search.js +203 -0
  78. package/workspace/public/pm/cozy-settings.js +198 -0
  79. package/workspace/public/pm/cozy-sources.js +89 -0
  80. package/workspace/public/pm/cozy-today.css +217 -0
  81. package/workspace/public/pm/cozy-viewer.js +1 -0
  82. package/workspace/public/pm/cozy-vw-mtg.css +350 -0
  83. package/workspace/public/pm/cozy-vw-rp.css +152 -0
  84. package/workspace/public/pm/home-adddoc.js +5 -5
  85. package/workspace/public/pm/home-app.js +329 -55
  86. package/workspace/public/pm/home-around.js +24 -126
  87. package/workspace/public/pm/home-chat.js +67 -14
  88. package/workspace/public/pm/home-data.js +6 -6
  89. package/workspace/public/pm/home-dictate.js +54 -0
  90. package/workspace/public/pm/home-draft.js +6 -6
  91. package/workspace/public/pm/home-ini-model.js +190 -0
  92. package/workspace/public/pm/home-ini.css +171 -0
  93. package/workspace/public/pm/home-ini.js +456 -0
  94. package/workspace/public/pm/home-list.js +276 -0
  95. package/workspace/public/pm/home-more.js +17 -134
  96. package/workspace/public/pm/home-phone-card.js +4 -4
  97. package/workspace/public/pm/home-review.js +104 -0
  98. package/workspace/public/pm/home-task.js +67 -0
  99. package/workspace/public/pm/home-today.js +144 -0
  100. package/workspace/public/pm/home-work.js +54 -26
  101. package/workspace/public/pm/premium-board.js +163 -39
  102. package/workspace/public/pm/premium-chart-tab.js +4 -5
  103. package/workspace/public/pm/premium-first.js +5 -7
  104. package/workspace/public/pm/premium-insights.js +499 -202
  105. package/workspace/public/pm/premium-mtg-present.js +138 -0
  106. package/workspace/public/pm/premium-mtg-replay.js +142 -0
  107. package/workspace/public/pm/premium-report-read.js +216 -52
  108. package/workspace/public/pm/premium-report-tab.js +44 -19
  109. package/workspace/public/pm/premium-shell.js +7 -7
  110. package/workspace/public/pm/premium-vw-cal.js +150 -60
  111. package/workspace/public/pm/premium-vw-mtg.js +488 -261
  112. package/workspace/public/pm/premium-vw-notes.js +61 -0
  113. package/workspace/public/pm/rp-parts.js +269 -0
  114. package/workspace/public/premium-board.html +4 -3
  115. package/workspace/public/premium-insights.html +10 -10
  116. package/workspace/public/premium.html +3 -1
  117. package/workspace/r/m1.png +0 -0
  118. package/workspace/r/m2.png +0 -0
  119. package/workspace/r/m3.png +0 -0
  120. package/workspace/r/nl.png +0 -0
  121. package/workspace/test-lists/initiative-layout.json +9 -0
  122. package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
  123. package/workspace/test-lists/premium-uncovered-reports.json +9 -0
  124. package/workspace/test-lists/uf-everywhere.json +15 -0
  125. package/workspace/test-lists/uf-home.json +9 -0
  126. package/workspace/test-lists/uncovered-board.json +9 -0
@@ -7,8 +7,9 @@
7
7
  * fixture (fixtures/briefing-premium-facts.js), so the page is checked against known data.
8
8
  * R1 Home is the default page; the console stays at /console.html and nothing on Home links to it; the place menu; Settings and Ctrl K
9
9
  * R2 the list head: Today, New with its four choices, and the fold
10
- * R4 Needs you: the top three rows and "N more · Show", 30 px tiles, title and hint; the first row opens its chat and its Viewer
11
- * R8 the phone's "N need you" equals the Needs-you rows
10
+ * R4 the one list (premium-uncovered-features, canvas HmMyWork): no Needs you group and no Your list; each next step is a row of its
11
+ * group with its tile, title and hint, the greeting counts them; the first row opens its chat and its Viewer
12
+ * R8 on a phone the list is the page (canvas HmPhone) and its greeting counts the same next steps
12
13
  * R9 a page that cannot read the repository says so
13
14
  * R10 a page where nothing was pressed to record sends only GETs
14
15
  * W1-W8 record a decision, put a row off, start an agent; the POST answers are mocked here, the refusals are the real server's
@@ -39,7 +40,7 @@ const finish = async (code) => {
39
40
  };
40
41
  process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
41
42
  const MODEL = B.build(F.facts());
42
- const NEEDS = '#hmList .hm-g[aria-label="Needs you"] .hm-r';
43
+ const NEEDS = '#hmList .hm-r[data-id^="n:"]'; // the next steps: rows of the one list, in their product or under Not in an initiative
43
44
  const vw = () => { const v = document.querySelector('#czViewer:not([hidden])'); return v ? { kind: (v.querySelector('.cz-vw-kind') || {}).textContent || '', title: (v.querySelector('#czVwTitle') || {}).textContent || '', text: v.textContent } : null; };
44
45
 
45
46
  (async () => {
@@ -80,38 +81,40 @@ const vw = () => { const v = document.querySelector('#czViewer:not([hidden])');
80
81
  const rail = await p.evaluate(() => ({ gone: !document.querySelector('nav.rail, .rail [data-go], #dlg'), places: [...document.querySelectorAll('#czMenu a')].map((a) => a.textContent.trim() + '>' + a.getAttribute('href')), cur: (document.querySelector('#czMenu [aria-current="page"]') || {}).textContent || '' }));
81
82
  ok('R1 no old rail and no old dialog; the place menu names Home, Board and Insights and Home is current', rail.gone && rail.places.join() === 'Home>/premium.html,Board>/premium-board.html,Insights>/premium-insights.html' && /Home/.test(rail.cur), JSON.stringify(rail));
82
83
  ok('R1 nothing on Home links to the console', await p.evaluate(() => !document.querySelector('a[href*="console"], a[href*="c3.html"], [data-href*="console"]')));
84
+ // premium-uncovered-features (EvSettings): Settings is its own dialog, opened from the place menu
83
85
  await p.click('#czFab'); await p.click('[data-cz-settings]');
84
- const st = await until(async () => { const v = await p.evaluate(vw); return v && /Settings/.test(v.kind + v.title) ? v : null; }) || await p.evaluate(vw);
85
- ok('R1 Settings opens in the Viewer', !!st && /Settings/.test(st.kind + st.title), JSON.stringify(st));
86
+ const st = await until(() => p.evaluate(() => { const d = document.querySelector('#evSettings:not([hidden])'); return d ? d.getAttribute('aria-label') + ' ' + ((d.querySelector('h2') || {}).textContent || '') : null; }));
87
+ ok('R1 Settings opens its dialog', !!st && /Settings/.test(st), String(st));
86
88
  await p.keyboard.press('Escape');
87
- ok('R11 Escape closes the Viewer', !!(await until(() => p.evaluate(() => !document.querySelector('#czViewer:not([hidden])')))));
89
+ ok('R11 Escape closes Settings', !!(await until(() => p.evaluate(() => !document.querySelector('#evSettings:not([hidden])')))));
88
90
  await p.route('**/api/sessions', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ sessions: [{ id: 's1', name: 'Fix the footer', state: 'idle', shown: 'quiet' }] }) }));
89
91
  await p.keyboard.press('Control+k');
90
- ok('SB2 Ctrl K opens Search in the Viewer with the box focused', !!(await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) #hxQ') && document.activeElement && document.activeElement.id === 'hxQ'))), await p.evaluate(() => JSON.stringify({ vw: !!document.querySelector('#czViewer:not([hidden])'), q: !!document.querySelector('#hxQ'), act: document.activeElement && (document.activeElement.id || document.activeElement.tagName) })));
92
+ // premium-uncovered-features (EvSearch): Search is the palette over the page
93
+ ok('SB2 Ctrl K opens Search with the box focused', !!(await until(() => p.evaluate(() => !!document.querySelector('#evSearch:not([hidden]) #evQ') && document.activeElement && document.activeElement.id === 'evQ'))), await p.evaluate(() => JSON.stringify({ sp: !!document.querySelector('#evSearch:not([hidden])'), act: document.activeElement && (document.activeElement.id || document.activeElement.tagName) })));
91
94
  await p.keyboard.type('fix');
92
- ok('SB4 typing finds the session by its name', !!(await until(() => p.evaluate(() => [...document.querySelectorAll('#hxRes .hx-hit b')].some((b) => b.textContent === 'Fix the footer')))));
93
- await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
95
+ ok('SB4 typing finds the session by its name', !!(await until(() => p.evaluate(() => [...document.querySelectorAll('#evRes .ev-mi')].some((b) => /Fix the footer/.test(b.textContent))))));
96
+ await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#evSearch:not([hidden])')));
94
97
  }
95
98
 
96
99
  /* R2 */
97
100
  { await p.click('[data-hm-new]');
98
101
  const nw = await until(() => p.evaluate(() => { const m = document.querySelector('#hmMenu:not([hidden])'); return m ? [...m.querySelectorAll('[role=menuitem], button')].map((b) => b.textContent.trim()).filter(Boolean) : null; }));
99
- ok('R2 the list head reads Today, and New offers four choices', await p.evaluate(() => document.querySelector('#hmList .hm-hd h1').textContent === 'Today') && !!nw && nw.length === 4, JSON.stringify(nw));
102
+ ok('R2 the list head reads Today, and New offers its five choices (Record a note now since premium-uncovered-features)', await p.evaluate(() => document.querySelector('#hmList .hm-hd h1').textContent === 'Today') && !!nw && nw.length === 5 && /^Record a note now/.test(nw[4]), JSON.stringify(nw));
100
103
  await p.keyboard.press('Escape');
101
- ok('R2 the fold button folds the list away and back', await p.evaluate(() => !!document.querySelector('[data-hm-fold]'))); }
104
+ ok('R2 the list head has no fold button (no header chrome, canvas HmMyWork)', await p.evaluate(() => !document.querySelector('[data-hm-fold]'))); }
102
105
 
103
106
  /* R4 */
104
107
  { const L = await p.evaluate((sel) => ({ rows: [...document.querySelectorAll(sel)].map((r) => ({ id: r.dataset.id, t: r.querySelector('.hm-rt b').textContent, h: r.querySelector('.hm-rt em').textContent, tile: Math.round((r.querySelector('.hm-tile, [class*="tile"]') || r).getBoundingClientRect().width) })), more: (document.querySelector('[data-hm-allneeds]') || {}).textContent || '', sel: (document.querySelector('.hm-r.sel') || {}).dataset ? document.querySelector('.hm-r.sel').dataset.id : null }), NEEDS);
105
- const all = MODEL.list.rows.length + 1; // the five rows of the model and nothing else from the fixture repository
106
- ok('R4 Needs you shows the top three rows and folds the rest into "N more · Show"', L.rows.length === 3 && /\d+ more · Show/.test(L.more), JSON.stringify(L));
107
- ok('R4 every row has a 30 px tile, its title and a hint', L.rows.every((r) => r.tile === 30 && r.t.length > 3), JSON.stringify(L.rows));
108
- ok('R4 on a desktop the first row is selected when Home opens', L.sel === L.rows[0].id, JSON.stringify(L));
109
- await p.click(`.hm-r[data-id="${L.rows[0].id}"] .hm-rm`); // Settings and Search took the Viewer above; selecting the row again opens its own
108
+ const G = await p.evaluate(() => ({ groups: [...document.querySelectorAll('#hmList [aria-label]')].map((g) => g.getAttribute('aria-label')), greet: (document.querySelector('#hmList .hm-tc .big') || {}).textContent || '' }));
109
+ ok('R4 Home has no Needs you group and no Your list; every next step of the model is a row of the one list', !G.groups.includes('Needs you') && !G.groups.includes('Your list') && MODEL.list.rows.every((m) => L.rows.some((r) => r.id === 'n:' + m.key)), JSON.stringify({ G, n: L.rows.length, want: MODEL.list.rows.length }));
110
+ ok('R4 every row has its tile, its title and a hint', L.rows.every((r) => r.tile >= 30 && r.t.length > 3), JSON.stringify(L.rows));
111
+ const gn = /(\d+) next steps? (?:is|are) yours/.exec(G.greet);
112
+ ok('R4 the greeting counts the next steps that are yours', !!gn && +gn[1] >= L.rows.length, G.greet);
113
+ ok('R4 on a desktop the first next step is selected when Home opens', !!L.sel && L.rows.some((r) => r.id === L.sel), JSON.stringify(L));
114
+ const r0 = L.rows.find((r) => r.id === 'n:waited:reviews') || L.rows[0];
115
+ await p.click(`.hm-r[data-id="${r0.id}"] .hm-rm`); // Settings and Search took the Viewer above; selecting the row again opens its own
110
116
  const v0 = await until(() => p.evaluate(vw));
111
- ok('R4 the selected row opens its Viewer beside its chat', !!v0 && v0.title === L.rows[0].t && await p.evaluate(() => !!document.querySelector('#hmLog')), JSON.stringify(v0));
112
- await p.click('[data-hm-allneeds]');
113
- const n2 = await p.evaluate((sel) => document.querySelectorAll(sel).length, NEEDS);
114
- ok('R4 Show lists every row that needs the PM', n2 >= MODEL.list.rows.length && n2 <= all + 1, String(n2));
117
+ ok('R4 the selected row opens its Viewer beside its chat', !!v0 && v0.title === r0.t && await p.evaluate(() => !!document.querySelector('#hmLog')), JSON.stringify(v0));
115
118
  const lift = await p.evaluate(() => getComputedStyle(document.querySelector('.hm-r.sel')).boxShadow);
116
119
  ok('R12 the selected row is a card with a lift shadow', lift && lift !== 'none', lift); }
117
120
 
@@ -121,28 +124,30 @@ const vw = () => { const v = document.querySelector('#czViewer:not([hidden])');
121
124
  /* W1-W7: record a decision */
122
125
  { const key = 'decision:KC5';
123
126
  await p.click(`.hm-r[data-id="n:${key}"] .hm-rm`);
124
- const v = await until(() => p.evaluate(() => { const x = document.querySelector('#czViewer:not([hidden])'); return x && x.querySelector('[data-hv-opt]') ? [...x.querySelectorAll('[data-hv-opt]')].map((b) => b.dataset.hvOpt) : null; }));
125
- ok('W1 the decision opens in the Viewer with its three choices', JSON.stringify(v) === JSON.stringify(['reshape', 'extend', 'retire']), JSON.stringify(v));
126
- const btn = () => p.evaluate(() => { const b = document.querySelector('[data-hv-rec]'); return { dis: b.disabled, h: b.getBoundingClientRect().height }; });
127
- ok('W1 before a choice the record button is off', (await btn()).dis);
128
- await p.click('[data-hv-opt="extend"]');
127
+ // premium-uncovered-features (canvas HmDecide): a decision is recorded on its card in the chat, under the agent's question
128
+ const v = await until(() => p.evaluate(() => { const x = document.querySelector('#hmLog .ut-dec'); return x && x.querySelector('[data-dc-opt]') ? [...x.querySelectorAll('[data-dc-opt]')].map((b) => b.dataset.dcOpt) : null; }));
129
+ ok('W1 the decision opens in the chat on its card with its three choices', JSON.stringify(v) === JSON.stringify(['reshape', 'extend', 'retire']), JSON.stringify(v));
130
+ const btn = () => p.evaluate(() => { const b = document.querySelector('#hmLog [data-dc-rec]'); return { dis: b.disabled, h: b.getBoundingClientRect().height }; });
131
+ const pick = (k) => p.click(`#hmLog [data-dc-opt="${k}"]`);
132
+ if (!(await p.evaluate(() => !!document.querySelector('#hmLog [data-dc-opt][aria-checked="true"]')))) ok('W1 before a choice the record button is off', (await btn()).dis);
133
+ await pick('extend');
129
134
  ok('W1 with a choice and no reason it is still off', (await btn()).dis);
130
- await p.fill('#hvWhy', 'ok');
135
+ await p.fill('#dcWhy', 'ok');
131
136
  ok('W1 a reason under three characters keeps it off', (await btn()).dis);
132
- await p.fill('#hvWhy', 'The partner needs two more weeks');
137
+ await p.fill('#dcWhy', 'The partner needs two more weeks');
133
138
  ok('W1 a choice and a reason turn it on', !(await btn()).dis);
134
- await p.click('[data-hv-rec]');
139
+ await p.click('#hmLog [data-dc-rec]');
135
140
  const post = await until(() => A.posts.find((x) => x.path === '/api/briefing-premium/decide'));
136
141
  ok('W6 the press posts the key, the choice and the reason, and no writer field', !!post && post.body.key === key && post.body.choice === 'extend' && post.body.why === 'The partner needs two more weeks' && !('by' in post.body), JSON.stringify(post && post.body));
137
- ok('W7 a recorded press closes the Viewer and says where it was recorded', !!(await until(() => p.evaluate(() => /pm-decisions\.md/.test(document.querySelector('#toast').textContent)))));
142
+ ok('W7 a recorded press says where it was recorded', !!(await until(() => p.evaluate(() => /pm-decisions\.md/.test(document.querySelector('#toast').textContent)))));
138
143
  /* W3 put off */
139
144
  const k2 = 'decision:premium-ux';
140
145
  await p.click(`.hm-r[data-id="n:${k2}"] .hm-rm`);
141
- await until(() => p.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hv-later]')));
142
- ok('W3 "Put off" is one quiet button, and its menu stays shut until pressed', await p.evaluate(() => document.querySelector('[data-hv-later] + .hv-lm').hidden));
143
- await p.click('[data-hv-later]');
144
- ok('W3 its menu has three live choices', await p.evaluate(() => [...document.querySelectorAll('[data-hv-until]')].map((b) => b.dataset.hvUntil).join() === 'later,tomorrow,nextweek'));
145
- await p.click('[data-hv-until="tomorrow"]');
146
+ await until(() => p.evaluate(() => !!document.querySelector('#hmLog [data-dc-later]')));
147
+ ok('W3 "Later" is one button on the decision card, and its menu stays shut until pressed', await p.evaluate(() => { const m = document.querySelector('#hmMenu'); return !m || m.hidden; }));
148
+ await p.click('#hmLog [data-dc-later]');
149
+ ok('W3 its menu has three live choices', await p.evaluate(() => [...document.querySelectorAll('#hmMenu:not([hidden]) [data-hm-mi] b')].map((b) => b.textContent).join() === 'Later today,Tomorrow,Next week'));
150
+ await p.locator('#hmMenu [data-hm-mi]').filter({ hasText: 'Tomorrow' }).first().click();
146
151
  ok('W3 "Tomorrow" posts the key and the time', !!(await until(() => A.posts.find((x) => x.path === '/api/briefing-premium/put-off' && x.body.key === k2 && x.body.until === 'tomorrow'))));
147
152
  /* the row's × puts it off until tomorrow */
148
153
  const k3 = 'blocked:onboarding-scan';
@@ -166,10 +171,10 @@ const vw = () => { const v = document.querySelector('#czViewer:not([hidden])');
166
171
  /* W6: a refused press keeps the Viewer and the typed reason */
167
172
  { const R = await open({ mock: false });
168
173
  await R.page.route('**/api/briefing-premium/decide*', (r) => r.fulfill({ status: 409, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'This decision is already on record.' }) }));
169
- await R.page.click('.hm-r[data-id="n:decision:KC5"] .hm-rm').catch(async () => { await R.page.click('[data-hm-allneeds]'); await R.page.click('.hm-r[data-id="n:decision:KC5"] .hm-rm'); });
170
- await until(() => R.page.evaluate(() => !!document.querySelector('[data-hv-opt]')));
171
- await R.page.click('[data-hv-opt="retire"]'); await R.page.fill('#hvWhy', 'No longer worth the date'); await R.page.click('[data-hv-rec]');
172
- ok('W6 a refused press shows the server reason, keeps the Viewer open and keeps the typed reason', !!(await until(() => R.page.evaluate(() => /already on record/.test((document.querySelector('#hvMsg') || {}).textContent || '') && document.querySelector('#hvWhy').value === 'No longer worth the date'))));
174
+ await R.page.click('.hm-r[data-id="n:decision:KC5"] .hm-rm');
175
+ await until(() => R.page.evaluate(() => !!document.querySelector('#hmLog [data-dc-opt]')));
176
+ await R.page.click('#hmLog [data-dc-opt="retire"]'); await R.page.fill('#dcWhy', 'No longer worth the date'); await R.page.click('#hmLog [data-dc-rec]');
177
+ ok('W6 a refused press shows the server reason, keeps the card and keeps the typed reason', !!(await until(() => R.page.evaluate(() => /already on record/.test((document.querySelector('#dcMsg') || {}).textContent || '') && document.querySelector('#dcWhy').value === 'No longer worth the date'))));
173
178
  await R.ctx.close(); }
174
179
 
175
180
  {
@@ -210,11 +215,10 @@ const vw = () => { const v = document.querySelector('#czViewer:not([hidden])');
210
215
  /* R8, R11, R12 on a phone, both themes */
211
216
  for (const theme of ['light', 'dark']) {
212
217
  const P = await open({ w: 390, h: 844, theme, touch: true });
213
- const top = await until(() => P.page.evaluate(() => { const n = document.querySelector('#hmNeedsN').textContent; return /need/.test(n) ? n : null; }));
214
- await P.page.click('#hmNeeds');
215
218
  const rows = await until(() => P.page.evaluate((sel) => { const l = document.querySelector('#hmList'); return l && getComputedStyle(l).display !== 'none' ? document.querySelectorAll(sel).length : 0; }, NEEDS));
216
- const needs = await P.page.evaluate(() => { const m = /(\d+) more/.exec((document.querySelector('[data-hm-allneeds]') || {}).textContent || ''); return m ? +m[1] : 0; });
217
- ok(`R8 (${theme}) the phone's "N need you" equals the Needs-you rows`, !!top && +top.match(/\d+/)[0] === rows + needs, JSON.stringify({ top, rows, needs }));
219
+ const top = await P.page.evaluate(() => (document.querySelector('#hmList .hm-tc .big') || {}).textContent || '');
220
+ const tn = /(\d+) next steps? (?:is|are) yours/.exec(top);
221
+ ok(`R8 (${theme}) on a phone the list is the page and its greeting counts the next steps it shows`, rows >= MODEL.list.rows.length && !!tn && +tn[1] >= rows && await P.page.evaluate(() => document.body.classList.contains('hm-plist')), JSON.stringify({ top, rows }));
218
222
  const small = await P.page.evaluate(() => [...document.querySelectorAll('#hmTop button, #hmList .hm-rm, #hmFoot button, #hmFoot label')].filter((b) => b.offsetParent !== null).map((b) => b.getBoundingClientRect()).filter((r) => r.height && r.height < 43.5).length);
219
223
  ok(`R11 (${theme}) every control on the phone's top bar, sheet and composer is 44 px`, small === 0, String(small));
220
224
  const ov = await P.page.evaluate(() => document.documentElement.scrollWidth - innerWidth);
@@ -2,8 +2,9 @@
2
2
  'use strict';
3
3
  /* briefing-premium-work-test.js — the premium My work page (initiative briefing-premium-work; planning/prd/briefing-premium-work-prd.md M1 to M12).
4
4
  * Re-pointed by premium-agreed-design: My work is no longer a page. /premium-work.html opens Home, and My work is a minimal view in the Viewer
5
- * (home-more.js openMyWork, from the place menu's More), marked "Waiting for design": four tabs (Your list, Waiting on others, Weekly review,
6
- * Untouched), Done on each of your rows, and one add box. The old page's hero, dialog fields (When, Waiting on, Keep, Drop), Undo and the
5
+ * (home-more.js openMyWork, from the place menu's More). Re-pointed again by premium-uncovered-features (canvas HmMyWork, HmReview): no
6
+ * "Waiting for design" marker; "My work" beside "Weekly review" at the top, the filters Open, Waiting, Untouched, Kept and Done, Done on each
7
+ * of your rows, and one add box. The old page's hero, dialog fields (When, Waiting on, Keep, Drop), Undo and the
7
8
  * per-item agent are not in the Agreed design and are not drawn; their routes stay and the last block still drives them for real.
8
9
  * Serves the real page from the real server. Most checks answer GET /api/my-work-premium with the model lib/my-work-premium.js builds from a
9
10
  * fixture (fixtures/my-work-premium-facts.js) and answer the presses themselves; the last block drives the real routes of a scratch state folder.
@@ -74,17 +75,16 @@ const view = () => { const v = document.querySelector('#czViewer:not([hidden])')
74
75
  ok('M1 the page is still served at /premium-work and /premium-work.html', (await fetch(BASE + '/premium-work', { redirect: 'manual' })).status === 302 && (await fetch(BASE + '/premium-work.html')).status === 200);
75
76
  /* M4 */
76
77
  const v0 = await p.evaluate(view);
77
- ok('M4 My work is a minimal view marked Waiting for design, with four tabs, on Your list', v0.kind === 'My work' && v0.wait && v0.tabs.join() === 'Your list,Waiting on others,Weekly review,Untouched' && v0.tab === 'Your list', JSON.stringify(v0));
78
+ ok('M4 My work has no Waiting for design marker; its filters are Open, Waiting, Untouched, Kept and Done, on Open', v0.kind === 'My work' && !v0.wait && v0.tabs.map((t) => t.replace(/ \d+$/, '')).join() === 'Open,Waiting,Untouched,Kept,Done' && v0.tab === 'Open', JSON.stringify(v0));
78
79
  const mine = M.queue.tabs.filter((t) => t.key !== 'kept' && t.key !== 'done').flatMap((t) => t.groups.flatMap((g) => g.rows || []));
79
80
  ok('M4 Your list holds every row of the queue but Kept and Done, each with Done', mine.every((r) => v0.text.includes(r.title)) && v0.done === mine.length, JSON.stringify({ want: mine.length, done: v0.done }));
80
81
  ok('M4 no suggestion, no estimate and no demo label is drawn', !/Accept all|~\d+ min|demo|fold the laundry|on the shelf|composts/i.test(v0.text));
81
82
  /* M6 */
82
83
  await p.click(`${MW} [data-tab="waiting"]`);
83
84
  const v1 = await p.evaluate(view);
84
- ok('M6 Waiting on others lists who owes the PM, longest first', v1.tab === 'Waiting on others' && v1.text.indexOf(M.waiting.rows[0].title) >= 0 && v1.text.indexOf(M.waiting.rows[0].title) < v1.text.indexOf(M.waiting.rows[1].title), JSON.stringify(v1));
85
+ ok('M6 Waiting on others lists who owes the PM, longest first', /^Waiting/.test(v1.tab) && v1.text.indexOf(M.waiting.rows[0].title) >= 0 && v1.text.indexOf(M.waiting.rows[0].title) < v1.text.indexOf(M.waiting.rows[1].title), JSON.stringify(v1));
85
86
  /* M7 */
86
- await p.click(`${MW} [data-tab="review"]`);
87
- ok('M7 Weekly review says what the review holds', (await p.evaluate(view)).text.includes(M.friday.cap));
87
+ ok('M7 "Weekly review" sits beside "My work" at the top of the card', await p.evaluate((V) => [...document.querySelectorAll(V + ' [data-ut-tab]')].map((b) => b.textContent).join() === 'My work,Weekly review', MW));
88
88
  await p.click(`${MW} [data-tab="stale"]`);
89
89
  const v2 = await p.evaluate(view);
90
90
  ok('M7 Untouched counts the items from the review list and lists the ones the list holds', v2.text.includes(M.review.n + ' items have sat untouched for ' + M.review.days + ' days') && v2.done >= 1 && v2.done <= M.review.ids.length, JSON.stringify(v2));
@@ -111,7 +111,7 @@ const view = () => { const v = document.querySelector('#czViewer:not([hidden])')
111
111
 
112
112
  /* M10 */
113
113
  { const E = await open({ fail: true });
114
- ok('M10 a failed read says why and shows nothing instead of a guess', !!(await until(() => E.page.evaluate(() => /Your list could not be read: the list could not be read/.test(document.querySelector('#czViewer').textContent) && !document.querySelector('#czViewer [data-done]')))));
114
+ ok('M10 a failed read says why and shows nothing instead of a guess', !!(await until(() => E.page.evaluate(() => /My work could not be read: the list could not be read/.test(document.querySelector('#czViewer').textContent) && !document.querySelector('#czViewer [data-done]')))));
115
115
  await E.ctx.close(); }
116
116
 
117
117
  /* M12 floors at 390, both themes */
@@ -126,14 +126,14 @@ const view = () => { const v = document.querySelector('#czViewer:not([hidden])')
126
126
  /* the real routes, over a scratch state folder: add, read back, mark done, read back */
127
127
  {
128
128
  const R = await open({ real: true }), pg = R.page;
129
- ok('E1 on an empty scratch state the real view says the list is empty', !!(await until(() => pg.evaluate(() => /Nothing on your list/.test(document.querySelector('#czViewer').textContent)), 20000)));
129
+ ok('E1 on an empty scratch state the real view says the list is empty', !!(await until(() => pg.evaluate(() => /Nothing is open/.test(document.querySelector('#czViewer').textContent)), 20000)));
130
130
  await pg.fill('#hxLine', 'Reply to Rina about SSO !p1'); await pg.click(`${MW} [data-x="add"]`);
131
131
  ok('E2 an added line comes back through the real routes on Your list', !!(await until(() => pg.evaluate(() => /Reply to Rina about SSO/.test(document.querySelector('#czViewer').textContent) && !!document.querySelector('#czViewer [data-done]')), 20000)), await pg.evaluate(() => document.querySelector('#czViewer').textContent.slice(0, 300)));
132
132
  const api0 = await fetch(BASE + '/api/my-work-premium').then((r) => r.json());
133
133
  const all0 = api0.model.queue.tabs.flatMap((t) => t.groups.flatMap((g) => g.rows || []));
134
134
  ok('E3 the real model holds it with its priority', all0.some((r) => /Reply to Rina about SSO/.test(r.title) && /P1/i.test(JSON.stringify(r))), JSON.stringify(all0).slice(0, 400));
135
135
  await pg.locator(`${MW} [data-done]`).first().click();
136
- ok('E4 Done marks it done, and the list is empty again', !!(await until(() => pg.evaluate(() => /Nothing on your list/.test(document.querySelector('#czViewer').textContent)), 15000)));
136
+ ok('E4 Done marks it done, and the list is empty again', !!(await until(() => pg.evaluate(() => /Nothing is open/.test(document.querySelector('#czViewer').textContent)), 15000)));
137
137
  const api = await fetch(BASE + '/api/my-work-premium').then((r) => r.json());
138
138
  ok('E5 the model route answers ready with the list the view reads', api.ok && api.state === 'ready' && api.model.dock.needs === 0);
139
139
  const hdr = await T.pressHeaders(BASE);
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "v": "0.399.0",
4
+ "at": "2026-10-23T08:35:27.575Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1019,
9
+ "t": "Build the uncovered features from the canvas review",
10
+ "s": "Build the uncovered features from the canvas review"
11
+ }
12
+ ]
13
+ },
2
14
  {
3
15
  "v": "0.398.0",
4
16
  "at": "2026-10-23T04:45:54.728Z",
@@ -0,0 +1,210 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* ev-everywhere-test.js — the Everywhere parts (initiative premium-uncovered-features, E1 to E4; canvas EvMenu, EvSearch, EvInbox, EvSources,
4
+ * EvSettings, EvStates, EvDark, EvPhone). The real server with one scratch product repository that has a worktree with a draft.
5
+ * U1 the place menu: Home, Board, Insights, then Search, New for you, Sources, Settings and Theme; More only on Home
6
+ * S1 Ctrl K opens Search over the page; typing finds a document on main and a draft on the worktree; the kind chips narrow; Escape closes
7
+ * S2 the worktree chip lists the worktree and leaving it out drops its draft; S3 a result opens in the Viewer
8
+ * N1 New for you opens in the Viewer, with the rows the old Around you held named under Where the rest went; nothing is posted on open
9
+ * R1 Sources lists each source with when it was read; R2 Settings opens on General with its sections, and Escape closes it
10
+ * B1 the Board's Settings and Sources open the same designed parts; B2 Ctrl K on Board opens the same Search
11
+ * D1 Theme Dark draws the page dark (data-theme), kept for the next page; P1 at 390 px Search fills the screen and nothing scrolls sideways
12
+ * Set EV_SHOTS=<dir> for screenshots at 1440x900 and 390x844, light and dark. Every wait polls the page; no fixed sleep stands in for a state. */
13
+ const fs = require('fs');
14
+ const os = require('os');
15
+ const path = require('path');
16
+ const { spawn, spawnSync } = require('child_process');
17
+ const { findBrowser } = require('./lib/find-browser');
18
+ const T = require('./test-run').configure({ name: 'ev-everywhere' });
19
+
20
+ const BASE = T.BASE;
21
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
22
+ const until = async (fn, ms = 15000, step = 120) => { const t0 = Date.now(); for (;;) { let v = null; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
23
+ const results = [];
24
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 400) : ''}`); };
25
+ let srv = null; let browser = null;
26
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'pmos-ev-'));
27
+ const finish = async (code) => {
28
+ if (browser) await browser.close().catch(() => {});
29
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
30
+ T.killTmux();
31
+ try { fs.rmSync(tmp, { recursive: true, force: true }); } catch { /* left for the OS */ }
32
+ const bad = results.filter((x) => !x.cond).length;
33
+ console.log(`\n${results.length - bad}/${results.length} ev-everywhere assertions passed`);
34
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
35
+ };
36
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
37
+ const sh = (cwd, args) => spawnSync('git', args, { cwd, encoding: 'utf8' });
38
+ const put = (root, rel, text) => { fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true }); fs.writeFileSync(path.join(root, rel), text); };
39
+
40
+ (async () => {
41
+ const exe = findBrowser();
42
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the ev-everywhere suite cannot run'); return finish(1); }
43
+ let chromium;
44
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the ev-everywhere suite cannot run'); return finish(1); }
45
+ const fakeBin = path.join(tmp, 'bin'); fs.mkdirSync(fakeBin);
46
+ fs.writeFileSync(path.join(fakeBin, 'claude'), '#!/bin/sh\nsleep 30\n', { mode: 0o755 });
47
+ /* the product: a PRD and a deck on main, and a worktree whose branch adds a draft of the billing spec */
48
+ const root = path.join(tmp, 'evprod');
49
+ fs.mkdirSync(root, { recursive: true });
50
+ put(root, 'AGENTS.md', '# a\n');
51
+ put(root, 'planning/prd/billing-prd.md', '---\ntype: PRD\ntitle: Usage billing PRD\n---\n# Usage billing PRD\n\nWe charge by usage from v2.5.\n');
52
+ put(root, 'planning/gtm/billing-deck.md', '# Billing launch deck\n\nThree slides on usage billing.\n');
53
+ sh(root, ['init', '-q', '-b', 'main']); sh(root, ['config', 'user.email', 't@t']); sh(root, ['config', 'user.name', 't']); sh(root, ['add', '-A']); sh(root, ['commit', '-q', '-m', 'initial']);
54
+ const wt = path.join(tmp, 'evprod-billing');
55
+ sh(root, ['worktree', 'add', '-q', '-b', 'billing-spec', wt]);
56
+ put(wt, 'planning/prd/billing-spec-draft.md', '# Billing spec draft\n\nUsage meters per seat.\n');
57
+ sh(wt, ['add', '-A']); sh(wt, ['commit', '-q', '-m', 'draft']);
58
+
59
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PATH: fakeBin + path.delimiter + process.env.PATH }) });
60
+ await T.waitForServer(BASE);
61
+ const json = async (m, p, b, h) => { const res = await fetch(BASE + p, { method: m, headers: { 'content-type': 'application/json', ...(h || {}) }, body: b ? JSON.stringify(b) : undefined }); let j = null; try { j = await res.json(); } catch { j = null; } return { status: res.status, body: j }; };
62
+ const added = await json('POST', '/api/workspaces', { root, name: 'EVPROD', focus: false }, await T.pressHeaders(BASE));
63
+ const ws = added.body && added.body.workspace && added.body.workspace.id;
64
+ ok('U0 the product is registered', !!ws, JSON.stringify(added.body));
65
+ const api = (await json('GET', '/api/find?q=billing&ws=' + encodeURIComponent(ws))).body || {};
66
+ ok('S0 GET /api/find finds the PRD and the deck on main and the draft on the worktree', api.ok && Array.isArray(api.results) && api.results.some((r) => r.path === 'planning/prd/billing-prd.md' && !r.draft) && api.results.some((r) => r.kind === 'slides') && api.results.some((r) => r.draft && /billing-spec-draft/.test(r.path)), JSON.stringify(api).slice(0, 400));
67
+
68
+ browser = await chromium.launch({ executablePath: exe, headless: true, args: ['--no-sandbox'] });
69
+ const shot = process.env.EV_SHOTS || '';
70
+ const snap = async (pg, name) => { if (!shot) return; fs.mkdirSync(shot, { recursive: true }); await sleep(400); await pg.screenshot({ path: path.join(shot, name + '.png') }); };
71
+ const open = async ({ w = 1440, h = 900, page = 'premium.html', theme = '' } = {}) => {
72
+ const ctx = await browser.newContext({ viewport: { width: w, height: h } });
73
+ const pg = await ctx.newPage(); const errors = [], posts = [];
74
+ pg.on('pageerror', (e) => errors.push(String(e)));
75
+ pg.on('request', (r) => { if (r.method() === 'POST') posts.push(new URL(r.url()).pathname); });
76
+ await pg.goto(`${BASE}/${page}?ws=${encodeURIComponent(ws)}${theme ? '&theme=' + theme : ''}`);
77
+ await pg.waitForSelector('#czFab', { timeout: 30000 });
78
+ return { ctx, pg, errors, posts };
79
+ };
80
+ const menu = async (pg) => { if (await pg.isHidden('#czMenu')) await pg.click('#czFab'); await pg.waitForSelector('#czMenu:not([hidden])'); };
81
+
82
+ { /* U: the place menu on Home */
83
+ const { ctx, pg, errors, posts } = await open();
84
+ await menu(pg);
85
+ const m = await pg.evaluate(() => ({ links: [...document.querySelectorAll('#czMenu a')].map((a) => a.textContent.trim()), items: [...document.querySelectorAll('#czMenu .ev-mi')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()), more: !!document.querySelector('#czMenu [data-cz-more]'), theme: [...document.querySelectorAll('#czMenu [data-ev-theme]')].map((b) => b.textContent) }));
86
+ ok('U1 the menu holds Home, Board, Insights, then Search, New for you, Sources and Settings, More (on Home) and Theme', m.links.join() === 'Home,Board,Insights' && /^Search/.test(m.items[0]) && /^New for you/.test(m.items[1]) && /^Sources/.test(m.items[2]) && /^Settings/.test(m.items[3]) && m.more && m.theme.join() === 'Light,Dark,Auto', JSON.stringify(m));
87
+ await snap(pg, 'menu-1440-light');
88
+ await pg.keyboard.press('Escape');
89
+ ok('U2 Escape closes the menu', await until(() => pg.isHidden('#czMenu')));
90
+
91
+ /* S: Search */
92
+ await pg.keyboard.press('Control+k');
93
+ ok('S1 Ctrl K opens Search with the box focused', await until(() => pg.evaluate(() => !!document.querySelector('#evSearch:not([hidden])') && document.activeElement && document.activeElement.id === 'evQ')));
94
+ await pg.keyboard.type('billing');
95
+ const res = await until(async () => { const r = await pg.evaluate(() => [...document.querySelectorAll('#evRes .ev-mi')].map((b) => b.textContent.replace(/\s+/g, ' ').trim())); return r.some((t) => /Usage billing PRD/.test(t)) && r.some((t) => /Billing spec draft/.test(t)) ? r : null; }, 20000);
96
+ ok('S1 typing finds the PRD on main and the draft on the worktree, and offers to ask Claude', !!res && res.some((t) => /Billing spec draft.*worktree billing-spec/.test(t)) && /Ask Claude about/.test(res[res.length - 1]), JSON.stringify(res));
97
+ await snap(pg, 'search-1440-light');
98
+ await pg.click('#evChips [data-ev-kind="slides"]');
99
+ const sl = await until(async () => { const r = await pg.evaluate(() => [...document.querySelectorAll('#evRes .ev-mi[data-ev-i]')].map((b) => b.textContent)); return r.length && !r.some((t) => /Usage billing PRD/.test(t)) ? r : null; });
100
+ ok('S1 the Slides chip keeps only the deck', !!sl && sl.some((t) => /Billing launch deck/.test(t)), JSON.stringify(sl));
101
+ await pg.click('#evChips [data-ev-kind="all"]');
102
+ await pg.click('[data-ev-wt]');
103
+ const wts = await until(() => pg.evaluate(() => [...document.querySelectorAll('.ev-wtm label')].map((l) => l.textContent)));
104
+ ok('S2 the worktree chip lists main and the billing-spec worktree', !!wts && wts.some((t) => /^main/.test(t)) && wts.some((t) => /billing-spec/.test(t)), JSON.stringify(wts));
105
+ await pg.click('.ev-wtm input[data-ev-wt-id]');
106
+ ok('S2 leaving the worktree out drops its draft', !!(await until(() => pg.evaluate(() => { const r = [...document.querySelectorAll('#evRes .ev-mi')].map((b) => b.textContent); return r.some((t) => /Usage billing PRD/.test(t)) && !r.some((t) => /Billing spec draft/.test(t)); }))));
107
+ await pg.click('.ev-wtm input[data-ev-wt-id]'); // back in, so the next run of this suite starts the same
108
+ await until(() => pg.evaluate(() => [...document.querySelectorAll('#evRes .ev-mi')].some((b) => /Billing spec draft/.test(b.textContent))));
109
+ await pg.click('#evRes .ev-mi:has-text("Billing spec draft")');
110
+ ok('S3 a draft opens in the Viewer, read from its worktree', !!(await until(() => pg.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden])'); return v && /Usage meters per seat/.test(v.textContent); }))), await pg.evaluate(() => (document.querySelector('#czViewer') || {}).textContent || ''));
111
+ ok('S3 Search closed behind it', await pg.evaluate(() => !document.querySelector('#evSearch:not([hidden])')));
112
+ await pg.keyboard.press('Escape');
113
+ await until(() => pg.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
114
+
115
+ /* N: New for you */
116
+ posts.length = 0;
117
+ await menu(pg); await pg.click('#czMenu [data-cz-news]');
118
+ const nw = await until(() => pg.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden]) .ev-news'); return v && !v.querySelector('.ev-skelrow') ? { t: v.textContent, rest: [...v.querySelectorAll('[data-ev-rest]')].map((b) => b.dataset.evRest), kind: document.querySelector('#czViewer .cz-vw-kind').textContent } : null; }), 20000);
119
+ ok('N1 New for you opens in the Viewer, says what is new or that nothing is, and names where the rest of Around you went', !!nw && /New since this morning/.test(nw.t) && /(Nothing new since you last looked|Mentions|Given to you|Finished while you were away)/.test(nw.t) && nw.rest.join() === 'pulse,rep,prop,scan', JSON.stringify(nw).slice(0, 400));
120
+ ok('N1 opening it posted nothing', posts.length === 0, JSON.stringify(posts));
121
+ await snap(pg, 'news-1440-light');
122
+ await pg.click('#czViewer [data-ev-rest="pulse"]');
123
+ ok('N2 a Where the rest went row opens its view, with Back to New for you', !!(await until(() => pg.evaluate(() => /Back to New for you/.test((document.querySelector('#czViewer [data-bda="back"]') || {}).textContent || '')))));
124
+ await pg.click('#czViewer [data-bda="back"]');
125
+ ok('N2 Back goes to New for you', !!(await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .ev-news [data-ev-rest]')))));
126
+ await pg.keyboard.press('Escape');
127
+
128
+ /* R: Sources and Settings */
129
+ await until(() => pg.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
130
+ await menu(pg); await pg.click('#czMenu [data-cz-sources]');
131
+ const src = await until(() => pg.evaluate(() => { const v = document.querySelector('#czViewer:not([hidden]) .ev-src'); const r = v ? [...v.querySelectorAll('.ev-trow[data-src]')] : []; return r.length ? { n: r.length, t: v.textContent } : null; }), 20000);
132
+ ok('R1 Sources lists each source with when it was last read and Read all again', !!src && src.n >= 3 && /Last read/.test(src.t) && /Read all again/.test(src.t) && /never posts to them/.test(src.t), JSON.stringify(src).slice(0, 300));
133
+ await snap(pg, 'sources-1440-light');
134
+ await pg.keyboard.press('Escape');
135
+ await until(() => pg.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
136
+ await menu(pg); await pg.click('#czMenu [data-cz-settings]');
137
+ const st = await until(() => pg.evaluate(() => { const d = document.querySelector('#evSettings:not([hidden])'); return d ? { nav: [...d.querySelectorAll('[data-ev-sec]')].map((a) => a.textContent.replace(/\d+$/, '').trim()), h: (d.querySelector('#evStTitle') || {}).textContent, t: d.textContent } : null; }));
138
+ ok('R2 Settings opens on General, with Connectors, Workspaces, Updates and What\'s new', !!st && st.h === 'General' && ['General', 'Connectors', 'Workspaces', 'Updates', 'What\'s new'].every((k) => st.nav.some((n) => n.startsWith(k))) && /Theme/.test(st.t), JSON.stringify(st && { nav: st.nav, h: st.h }));
139
+ await snap(pg, 'settings-1440-light');
140
+ await pg.click('#evSettings [data-ev-sec="workspaces"]');
141
+ ok('R2 Workspaces lists the product', !!(await until(() => pg.evaluate(() => /EVPROD/.test(document.querySelector('#evSettings').textContent)))));
142
+ await pg.keyboard.press('Escape');
143
+ ok('R2 Escape closes Settings', !!(await until(() => pg.evaluate(() => !document.querySelector('#evSettings:not([hidden])')))));
144
+
145
+ /* D: Theme */
146
+ await menu(pg); await pg.click('#czMenu [data-ev-theme="dark"]');
147
+ ok('D1 Theme Dark draws the page dark', !!(await until(() => pg.evaluate(() => document.documentElement.dataset.theme === 'dark' && getComputedStyle(document.body).backgroundColor !== 'rgb(255, 255, 255)'))));
148
+ await pg.goto(`${BASE}/premium-insights.html?ws=${encodeURIComponent(ws)}`); await pg.waitForSelector('#czFab');
149
+ ok('D1 the choice is kept for the next page', await pg.evaluate(() => document.documentElement.dataset.theme === 'dark'));
150
+ await menu(pg);
151
+ ok('U1 More is only on Home', await pg.evaluate(() => !document.querySelector('#czMenu [data-cz-more]')));
152
+ await snap(pg, 'menu-1440-dark');
153
+ await pg.keyboard.press('Escape');
154
+ await pg.keyboard.press('Control+k'); await pg.waitForSelector('#evSearch:not([hidden])'); await pg.keyboard.type('billing');
155
+ await until(() => pg.evaluate(() => document.querySelectorAll('#evRes .ev-mi[data-ev-i]').length > 1));
156
+ await snap(pg, 'search-1440-dark');
157
+ await pg.keyboard.press('Escape');
158
+ await pg.evaluate(() => { try { localStorage.removeItem('pmos.c3.theme'); } catch { /* none */ } });
159
+ ok('U no page error on Home and Insights', errors.length === 0, errors.join(' | '));
160
+ await ctx.close();
161
+ }
162
+
163
+ { /* B: the Board's top bar opens the same parts */
164
+ const { ctx, pg, errors } = await open({ page: 'premium-board.html' });
165
+ if (await pg.$('#moreBtn')) {
166
+ await pg.click('#moreBtn'); await pg.click('#settingsBtn');
167
+ ok('B1 the Board\'s Settings opens the designed Settings', !!(await until(() => pg.evaluate(() => !!document.querySelector('#evSettings:not([hidden])')))));
168
+ await pg.keyboard.press('Escape');
169
+ await until(() => pg.evaluate(() => !document.querySelector('#evSettings:not([hidden])')));
170
+ await pg.click('#moreBtn'); await pg.click('#srcItem');
171
+ ok('B1 the Board\'s Sources opens the designed Sources', !!(await until(() => pg.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .ev-src')), 20000)));
172
+ await pg.keyboard.press('Escape');
173
+ } else ok('B1 the Board has its top bar', false);
174
+ await until(() => pg.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
175
+ await pg.keyboard.press('Control+k');
176
+ ok('B2 Ctrl K on Board opens the same Search, once', !!(await until(() => pg.evaluate(() => !!document.querySelector('#evSearch:not([hidden])') && !document.querySelector('#pvOv:not([hidden])')))));
177
+ await pg.keyboard.press('Escape');
178
+ ok('B no page error on Board', errors.length === 0, errors.join(' | '));
179
+ await ctx.close();
180
+ }
181
+
182
+ for (const theme of ['light', 'dark']) { /* P: the phone */
183
+ const { ctx, pg, errors } = await open({ w: 390, h: 844, theme });
184
+ await menu(pg);
185
+ const fit = await pg.evaluate(() => { const r = document.querySelector('#czMenu').getBoundingClientRect(); return { l: Math.round(r.left), r: Math.round(r.right), side: document.documentElement.scrollWidth - innerWidth }; });
186
+ ok(`P1 ${theme} at 390 px the menu fits on screen`, fit.l >= 0 && fit.r <= 390 && fit.side <= 0, JSON.stringify(fit));
187
+ await snap(pg, 'menu-390-' + theme);
188
+ await pg.click('#czMenu [data-cz-search]');
189
+ await pg.waitForSelector('#evSearch:not([hidden])'); await pg.keyboard.type('billing');
190
+ await until(() => pg.evaluate(() => document.querySelectorAll('#evRes .ev-mi[data-ev-i]').length > 1), 20000);
191
+ const sp = await pg.evaluate(() => { const r = document.querySelector('#evSearch').getBoundingClientRect(); return { w: Math.round(r.width), h: Math.round(r.height), side: document.documentElement.scrollWidth - innerWidth }; });
192
+ ok(`P1 ${theme} at 390 px Search fills the screen and nothing scrolls sideways`, sp.w >= 388 && sp.h >= 800 && sp.side <= 0, JSON.stringify(sp));
193
+ await snap(pg, 'search-390-' + theme);
194
+ await pg.keyboard.press('Escape');
195
+ await menu(pg); await pg.click('#czMenu [data-cz-news]');
196
+ await until(() => pg.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .ev-news [data-ev-rest]')), 20000);
197
+ ok(`P2 ${theme} at 390 px New for you does not scroll sideways`, await pg.evaluate(() => { const b = document.querySelector('#czViewer .cz-vw-body'); return document.documentElement.scrollWidth - innerWidth <= 0 && b.scrollWidth - b.clientWidth <= 1; }));
198
+ await snap(pg, 'news-390-' + theme);
199
+ await pg.keyboard.press('Escape');
200
+ await until(() => pg.evaluate(() => !document.querySelector('#czViewer:not([hidden])')));
201
+ await menu(pg); await pg.click('#czMenu [data-cz-settings]');
202
+ await pg.waitForSelector('#evSettings:not([hidden])');
203
+ ok(`P3 ${theme} at 390 px Settings fits the screen`, await pg.evaluate(() => { const r = document.querySelector('#evSettings').getBoundingClientRect(); return r.left >= 0 && r.right <= 390 && document.documentElement.scrollWidth - innerWidth <= 0; }));
204
+ await snap(pg, 'settings-390-' + theme);
205
+ if (theme === 'dark') ok('D2 ?theme=dark draws the phone dark', await pg.evaluate(() => document.documentElement.dataset.theme === 'dark'));
206
+ ok(`P no page error (${theme})`, errors.length === 0, errors.join(' | '));
207
+ await ctx.close();
208
+ }
209
+ return finish();
210
+ })().catch((e) => { console.error(e); finish(1); });
@@ -67,7 +67,7 @@ function install(page, o = {}) {
67
67
  const body = (r) => { try { return JSON.parse(r.request().postData() || '{}'); } catch { return {}; } };
68
68
  const post = (r) => { const b = body(r); S.posts.push({ path: new URL(r.request().url()).pathname, body: b }); return b; };
69
69
  page.on('request', (r) => { if (r.method() === 'GET' && /\/api\//.test(r.url())) S.gets.push(new URL(r.url()).pathname + new URL(r.url()).search); });
70
- S.store = { n1: W.NOTE, n2: W.LIVE_NOTE, n0: { ...W.ROWS[1], body: '', transcript: [] }, n3: { ...W.ROWS[3], body: '', transcript: [] }, n4: { ...W.ROWS[4], body: '', transcript: [] } }; S.made = 0;
70
+ S.points = {}; S.store = { n1: W.NOTE, n2: W.LIVE_NOTE, n0: { ...W.ROWS[1], body: '', transcript: [] }, n3: { ...W.ROWS[3], body: '', transcript: [] }, n4: { ...W.ROWS[4], body: '', transcript: [] } }; S.made = 0;
71
71
  S.rows = (S.scene === 'prep' || o.noLive ? W.ROWS.filter((x) => x.id !== 'n2') : W.ROWS).map((x) => ({ ...x }));
72
72
  if (S.scene === 'prep' || o.noLive) delete S.store.n2;
73
73
  const notesRows = () => S.rows;
@@ -81,7 +81,11 @@ function install(page, o = {}) {
81
81
  return json(r, { ok: true, note: n, screen: { frames: id === 'n2' ? [{ t: 300000 }, { t: 400000 }, { t: 500000 }, { t: 600000 }] : [] }, place: null });
82
82
  }),
83
83
  page.route('**/api/notes/series?*', (r) => json(r, { ok: true, series: { key: 'viewer-sync', meetings: [{ id: 'n0', at: '2026-10-15T10:00:00Z', decided: 1, steps: 3 }, { id: 'n1', at: W.NOTE.meeting.start, decided: 2, steps: 3 }] } })),
84
- page.route('**/api/notes/search*', (r) => json(r, { ok: true, ids: ['n4'] })),
84
+ page.route('**/api/notes/search*', (r) => json(r, { ok: true, ids: ['n4'], hits: [{ id: 'n4', snip: '…which teams use saved views for teams every week…', open: true }] })),
85
+ page.route('**/api/meeting-points*', (r) => {
86
+ if (r.request().method() === 'POST') { const b = post(r); (b.ids || []).forEach((id) => { if (b.verdict) S.points[id] = b.verdict; else delete S.points[id]; }); return json(r, { ok: true, points: S.points }); }
87
+ return json(r, { ok: true, points: S.points });
88
+ }),
85
89
  page.route('**/api/notes/new', (r) => {
86
90
  const b = post(r), id = 'new' + (++S.made);
87
91
  const n = { id, title: b.title || '', state: 'idle', created_at: new Date().toISOString(), updated_at: new Date().toISOString(), meeting: b.meeting || (b.event ? { kind: 'event', event_id: b.event.id || b.event, start: b.event.at, title: b.event.title } : null), transcript: [] };
@@ -111,7 +115,7 @@ function install(page, o = {}) {
111
115
  const base = { ok: true, now_ms: Date.now(), event: live ? { id: 'ev-live', title: 'Design crit', at: W.LIVE_NOTE.meeting.start, end: W.LIVE_NOTE.meeting.end, attendees: ['Ana', 'Wawan'] } : ev === 'ev-rail' ? { id: 'ev-rail', title: 'Rail review', at: iso(W.RAIL), attendees: ['Sam', 'Wawan'] } : { id: 'ev-sync', title: 'Viewer sync', at: W.NOTE.meeting.start, end: W.NOTE.meeting.end, attendees: ['Ana', 'Dita', 'Wawan'] },
112
116
  note: live ? { id: 'n2', state: 'recording' } : ev === 'ev-rail' ? null : { id: 'n1', state: 'ended' },
113
117
  brief: { gist: ['Agree the rail before the Commit.'], purpose: 'Agree the rail before the Commit.', matters: [{ tag: 'Late', tone: 'bad', text: 'The SSO spike', meta: 'due 14 Oct' }, { tag: 'Changed', tone: '', text: 'The report panel design', meta: 'Oct 21' }], last: { id: 'n0', at: '2026-10-15T10:00:00Z', decisions: [{ text: 'a' }], actions: [{ text: 'b' }, { text: 'c' }] }, prep: 'Read the rail PRD.', initiative: { id: 'viewer', title: 'Viewer', ws: 'w1' } },
114
- material: [{ kind: 'pmos-doc', title: 'Rail PRD', ref: 'planning/prd/rail.md', from: 'you' }, { kind: 'link', title: 'Figma: report panel', url: 'https://x.example/f', topic: 'The report panel' }],
118
+ material: [{ kind: 'pmos-deck', title: 'Release deck', ref: 'decks/release.md', from: 'you' }, { kind: 'pmos-doc', title: 'Rail PRD', ref: 'planning/prd/rail.md', from: 'you' }, { kind: 'link', title: 'Figma: report panel', url: 'https://x.example/f', topic: 'The report panel' }],
115
119
  topics: live ? [{ id: 't1', text: 'One toolbar row', state: 'discussed', minutes: 6 }, { id: 't2', text: 'The Issue button', state: 'now', minutes: 8 }, { id: 't3', text: 'Phone layout', state: 'plan', minutes: 10 }] : [{ id: 't1', text: 'Viewer beside the chat', state: 'plan', minutes: 10 }, { id: 't2', text: 'Saved views and the migration', state: 'plan', minutes: 10 }, { id: 't3', text: 'Print preview', state: 'plan', minutes: 10 }],
116
120
  runs: live ? [{ topic: 't1', from_min: 0, to_min: 6 }, { topic: 't2', from_min: 6, to_min: null }] : [], captured: live ? { decisions: [{}], actions: [{}, {}], questions: [] } : {}, tail: [] };
117
121
  return json(r, base);
@@ -120,10 +124,11 @@ function install(page, o = {}) {
120
124
  page.route('**/api/meeting-replay*', (r) => (new URL(r.request().url()).searchParams.get('note') !== 'n1' ? json(r, { ok: false, error: 'no recording' }) : null) || json(r, { ok: true, length_ms: 31 * 60000 + 5000, note: { id: 'n1', title: 'Viewer sync' }, meeting: { title: 'Viewer sync', at: W.NOTE.meeting.start, attendees: ['Ana', 'Dita', 'Wawan'] },
121
125
  topics: [{ id: 't1', text: 'Viewer beside the chat' }, { id: 't2', text: 'Saved views and the migration' }, { id: 't3', text: 'Print preview' }],
122
126
  runs: [{ topic: 't1', from_ms: 0, to_ms: 600000 }, { topic: 't2', from_ms: 600000, to_ms: 1300000 }, { topic: 't3', from_ms: 1300000, to_ms: 1865000 }],
123
- keys: [{ k: 'decision', text: 'Diffs can be approved from the Viewer.', t: 895000 }, { k: 'action', text: 'Add a print view', t: 1500000 }, { k: 'decision', text: 'Migration V.3', t: 1700000 }],
127
+ keys: [{ k: 'decision', text: 'Diffs can be approved from the Viewer.', t: 895000, by: 'Dita' }, { k: 'action', text: 'Add a print view', t: 1500000, owner: 'Ana', due: 'Fri' }, { k: 'decision', text: 'Migration V.3', t: 1700000 }, { k: 'action', text: 'Ask legal about PDFs', t: 1750000 }, { k: 'question', text: 'Do old workspaces need a manual step?', t: 1800000, state: 'open' }],
124
128
  shots: [{ t: 190000, why: 'Viewer beside the chat' }, { t: 895000, why: 'Diff approve button' }, { t: 1470000, why: 'Print preview' }],
125
- lines: [{ t: 190000, who: 'Dita', text: 'The Viewer sits beside the chat now.' }, { t: 760000, who: 'You', text: 'Saved views move in their own work-item.' }] })),
126
- page.route('**/api/meeting-material*', (r) => (r.request().method() === 'POST' ? (post(r), json(r, { ok: true })) : json(r, { ok: true, key: 'k', items: [] }))),
129
+ lines: [{ t: 190000, who: 'Dita', text: 'The Viewer sits beside the chat now.' }, { t: 760000, who: 'You', text: 'Saved views move in their own work-item.' }, { t: 894000, who: 'Ana', text: 'Yes, approve the diff from the Viewer.' }, { t: 1499000, who: 'Ana', text: 'I will add the print view by Friday.' }] })),
130
+ page.route('**/api/meeting-material/suggest*', (r) => json(r, { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/runs/phone.md', title: 'Run log · phone test', meta: 'Run log' }, { kind: 'pmos-deck', ref: 'decks/release.md', title: 'Release deck', meta: 'Deck · 6 slides' }], found: [{ kind: 'pmos-doc', ref: 'planning/prd/rail.md', title: 'Rail PRD', meta: 'PRD' }] })),
131
+ page.route('**/api/meeting-material*', (r) => (r.request().method() === 'POST' ? (post(r), json(r, { ok: true })) : json(r, { ok: true, key: 'k', items: [], topics: [{ text: 'One toolbar row' }] }))),
127
132
  page.route('**/api/viewer-meeting?*', (r) => {
128
133
  const u = new URL(r.request().url()), topics = u.searchParams.getAll('topic');
129
134
  return json(r, { ok: true, agenda: { key: 's:viewer-sync', total: 30, topics: topics.map((t, i) => ({ n: i + 1, text: t, min: 10, set: i === 0 })) }, capture: { app: 'zoom', shots: 'on' }, steps: { links: S.links || {}, tasks: [] } });