create-pmos 0.609.0 → 0.610.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 (62) hide show
  1. package/package.json +20 -14
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/board-programs-test.js +2 -2
  7. package/workspace/briefing-premium-adddoc-test.js +2 -1
  8. package/workspace/briefing-premium-board-test.js +9 -9
  9. package/workspace/briefing-premium-initiative-test.js +7 -6
  10. package/workspace/briefing-premium-insights-test.js +10 -10
  11. package/workspace/briefing-premium-products-test.js +4 -2
  12. package/workspace/briefing-premium-sources-test.js +1 -1
  13. package/workspace/briefing-premium-test.js +4 -4
  14. package/workspace/briefing-premium-work-test.js +1 -1
  15. package/workspace/changelog.json +19 -0
  16. package/workspace/ev-everywhere-test.js +9 -9
  17. package/workspace/guide/layout.md +32 -11
  18. package/workspace/home-other-product-test.js +2 -1
  19. package/workspace/home-railcard-test.js +2 -1
  20. package/workspace/lib/beside-page.js +15 -0
  21. package/workspace/live-pill-round-test.js +3 -4
  22. package/workspace/package-lock.json +2 -2
  23. package/workspace/package.json +1 -1
  24. package/workspace/panels-test.js +5 -4
  25. package/workspace/premium-chat-context-test.js +6 -6
  26. package/workspace/premium-chat-line-test.js +1 -1
  27. package/workspace/premium-chat-notes-test.js +1 -1
  28. package/workspace/premium-core-doc-issue-test.js +2 -1
  29. package/workspace/premium-vw-cal-test.js +1 -1
  30. package/workspace/premium-vw-doc-test.js +2 -1
  31. package/workspace/program-leave-test.js +2 -1
  32. package/workspace/program-panel-test.js +2 -2
  33. package/workspace/public/pm/bd-ini-panel.js +3 -1
  34. package/workspace/public/pm/bd-scroll.js +4 -2
  35. package/workspace/public/pm/cozy-board.css +3 -0
  36. package/workspace/public/pm/cozy-ev.css +51 -0
  37. package/workspace/public/pm/cozy-evmodel.js +1 -1
  38. package/workspace/public/pm/cozy-live-pill.js +2 -1
  39. package/workspace/public/pm/cozy-nav.js +70 -7
  40. package/workspace/public/pm/cozy-panels.js +1 -1
  41. package/workspace/public/pm/cozy-pick.css +3 -0
  42. package/workspace/public/pm/cozy-pick.js +6 -2
  43. package/workspace/public/pm/cozy-popup.css +113 -0
  44. package/workspace/public/pm/cozy-popup.js +408 -0
  45. package/workspace/public/pm/cozy-settings.js +10 -1
  46. package/workspace/public/pm/cozy-viewer.js +66 -18
  47. package/workspace/public/pm/home-app.js +11 -3
  48. package/workspace/public/pm/home-ini.js +4 -3
  49. package/workspace/public/pm/page-chat.js +16 -4
  50. package/workspace/public/pm/pop-sessions.js +65 -0
  51. package/workspace/public/pm/premium-board.js +7 -3
  52. package/workspace/public/pm/premium-insights.js +14 -2
  53. package/workspace/public/pm/premium-shell.js +1 -1
  54. package/workspace/stage-card-tasks-test.js +2 -2
  55. package/workspace/task-card-test.js +2 -1
  56. package/workspace/task-delete-test.js +2 -1
  57. package/workspace/task-links-test.js +3 -2
  58. package/workspace/task-views-test.js +7 -7
  59. package/workspace/test-lists/one-popup.json +9 -0
  60. package/workspace/tk-tasks-test.js +2 -1
  61. package/workspace/viewer-trail-test.js +1 -1
  62. package/workspace/workflows-setup-test.js +1 -1
@@ -67,13 +67,13 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
67
67
  /* L2 */
68
68
  live = RUNNING(); await kick();
69
69
  const l2 = await until(() => page.evaluate(() => {
70
- const l = document.getElementById('czLive'), f = document.getElementById('czFab'); if (!l || l.hidden) return null;
70
+ const l = document.getElementById('czLive'), f = document.querySelector('#czMenu.ev-rail [data-cz-chat]') || document.getElementById('czFab'); if (!l || l.hidden) return null; // a desktop: the rail's chat icon (slice 1)
71
71
  const a = l.getBoundingClientRect(), b = f.getBoundingClientRect();
72
72
  return { text: l.textContent.trim(), w: Math.round(a.width), h: Math.round(a.height), round: getComputedStyle(l).borderRadius, marks: l.querySelectorAll('.lv-m').length,
73
73
  above: a.bottom <= b.top, centred: Math.abs((a.left + a.width / 2) - (b.left + b.width / 2)) <= 1, label: l.getAttribute('aria-label'), asks: l.classList.contains('asks') };
74
74
  }));
75
75
  ok('L2 the pill shows the number of live items and no marks', l2 && l2.text === '2' && l2.marks === 0 && !l2.asks, JSON.stringify(l2));
76
- ok('L2 it is a 44 px round button, stacked above the menu button on its centre line', l2 && l2.w === 44 && l2.h === 44 && l2.round === '50%' && l2.above && l2.centred, JSON.stringify(l2));
76
+ ok('L2 it is a 44 px round button, stacked above the rail\'s chat icon on its centre line', l2 && l2.w === 44 && l2.h === 44 && l2.round === '50%' && l2.above && l2.centred, JSON.stringify(l2));
77
77
  ok('L2 its name still says what it holds and its key', l2 && /^What you work on now: 2 running\. Open \(Ctrl J\)$/.test(l2.label), l2 && l2.label);
78
78
  await shot(page, 'pill-running');
79
79
 
@@ -96,8 +96,7 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
96
96
  await page.evaluate(() => { delete window.czPanels; });
97
97
 
98
98
  /* L5 */
99
- await page.click('#czFab');
100
- ok('L5 the open menu takes the place above the menu button: the pill hides', await until(() => page.evaluate(() => getComputedStyle(document.getElementById('czLive')).visibility === 'hidden')));
99
+ ok('L5 a desktop has no menu to open (the rail is the menu, slice 1): the pill stays at the rail\'s foot', await page.evaluate(() => !document.getElementById('czLive').hidden && getComputedStyle(document.getElementById('czLive')).visibility === 'visible' && getComputedStyle(document.getElementById('czFab')).display === 'none'));
101
100
  await page.keyboard.press('Escape');
102
101
  await page.evaluate(() => { const m = document.getElementById('czMenu'); if (m && !m.hidden) document.getElementById('czFab').click(); });
103
102
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.609.0",
3
+ "version": "0.610.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.609.0",
9
+ "version": "0.610.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.609.0",
3
+ "version": "0.610.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -28,6 +28,7 @@ const fs = require('fs');
28
28
  const path = require('path');
29
29
  const { spawn } = require('child_process');
30
30
  const { findBrowser } = require('./lib/find-browser');
31
+ const { besidePage } = require('./lib/beside-page'); // these checks are about work beside the page, not the popup
31
32
  const T = require('./test-run').configure({ name: 'panels' });
32
33
  const B = require('./lib/briefing-premium.js');
33
34
  const F = require('./fixtures/briefing-premium-facts.js');
@@ -60,7 +61,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
60
61
  try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed — the panels suite cannot run'); return finish(1); }
61
62
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
62
63
  await T.waitForServer(BASE);
63
- browser = await chromium.launch({ executablePath: exe });
64
+ browser = besidePage(await chromium.launch({ executablePath: exe }));
64
65
 
65
66
  const open = async ({ w = 1440, h = 900, dark = false, ctx = null, q = '', at = '/premium.html', ready = () => { document.querySelectorAll('#hmList .hv-fold[aria-expanded="false"]').forEach((b) => b.click()); return !!window.czPanels && document.querySelectorAll('#hmList .hv-r.ini .hm-rm').length > 2; } } = {}) => {
66
67
  // Home shows only the rows with a call (home-nav-rows-with-a-call): the default ready opens every folded group, so the rows this suite drags are there
@@ -277,12 +278,12 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
277
278
  await Bd.page.click(nm(K[0]));
278
279
  const b1 = await until(() => pl(Bd.page).then((l) => (P(l, 'v0') && P(l, 'v0').box.shown && l.divs.length === 1 ? l : null)));
279
280
  ok('P1 a row opens a split: the page, one divider with the sprout, the Viewer; nothing floats over the page', !!b1 && !b1.float && P(b1, 'page').box.r <= b1.divs[0].l + 12 && b1.divs[0].r <= P(b1, 'v0').box.l + 12 && b1.divs[0].sprout, JSON.stringify(b1));
280
- ok('P1 the Viewer opens no wider than leaves the page its view whole (fit 880 at 1440: the Viewer 506 px, under 560); the page is not narrow', !!b1 && P(b1, 'page').box.w >= 878 && Math.abs(P(b1, 'v0').box.w - 506) <= 4 && !b1.narrow, JSON.stringify(b1 && [P(b1, 'page').box, P(b1, 'v0').box]));
281
+ ok('P1 the Viewer opens no wider than leaves the page its view whole (fit 880 at 1440 beside the 80 px rail of places, slice 1: the Viewer 426 px, under 560); the page is not narrow', !!b1 && P(b1, 'page').box.w >= 878 && Math.abs(P(b1, 'v0').box.w - 426) <= 4 && !b1.narrow, JSON.stringify(b1 && [P(b1, 'page').box, P(b1, 'v0').box]));
281
282
  const bh = await Bd.page.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-hd [data-cz-vw]')].map((b) => b.dataset.czVw));
282
283
  ok('P1 ⧉ before × on the Viewer\'s header, in place of ⤢', bh.slice(-2).join() === 'place,close' && !bh.includes('wide'), JSON.stringify(bh));
283
284
  await shot(Bd.page, 'p1-board-split-1440');
284
285
  // the divider near the middle snaps at ½: the page goes to its narrow form; only the share is kept
285
- { const d = await divAt(Bd.page); await drag(Bd.page, d, (16 + 1424) / 2 + 8, d.y); }
286
+ { const d = await divAt(Bd.page); await drag(Bd.page, d, (96 + 1424) / 2 + 8, d.y); } // slice 1: the page starts after the rail, at 96
286
287
  const b2 = await until(() => pl(Bd.page).then((l) => (Math.abs(P(l, 'page').box.w - P(l, 'v0').box.w) <= 4 ? l : null)), 3000);
287
288
  const keptB = await Bd.page.evaluate(() => { try { return JSON.parse(localStorage.getItem('cz-pn:board')); } catch { return null; } });
288
289
  ok('P2 a drag near the middle snaps the divider at ½; the page panel is narrower than fit() and gets cz-pn-narrow', !!b2 && b2.narrow, JSON.stringify(b2 && [P(b2, 'page').box, P(b2, 'v0').box, b2.narrow]));
@@ -373,7 +374,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
373
374
  await drag(Dd.page, '#czViewer .cz-vw-tile', 200, 400, { hold: async () => { z11 = await Dd.page.evaluate(() => { const z = document.querySelector('.cz-pn-drop:not([hidden])'); if (!z) return null; const r = z.getBoundingClientRect(); return { side: z.dataset.side, l: Math.round(r.left), w: Math.round(r.width) }; }); await shot(Dd.page, 'p11-dock-drag-1440'); } });
374
375
  const d11 = await until(() => pl(Dd.page).then((l) => (P(l, 'v0').box.r < P(l, 'page').box.l ? l : null)), 3000);
375
376
  const side11 = await Dd.page.evaluate(() => { try { return JSON.parse(localStorage.getItem('cz-pn-side')); } catch { return null; } });
376
- ok('P11 a drag of the Viewer\'s header over the left half turns that half blue', !!z11 && z11.side === 'left' && z11.l <= 20 && z11.w > 600, JSON.stringify(z11));
377
+ ok('P11 a drag of the Viewer\'s header over the left half turns that half blue', !!z11 && z11.side === 'left' && z11.l <= 100 && z11.w > 600, JSON.stringify(z11));
377
378
  ok('P11 the drop docks it on the left: the Viewer, the divider, then the page; the title is not renamed', !!d11 && d11.divs.length === 1 && P(d11, 'v0').box.r <= d11.divs[0].l + 12 && d11.divs[0].r <= P(d11, 'page').box.l + 12 && !(await Dd.page.$('#czViewer [data-cz-vw-ren]')), JSON.stringify(d11 || await pl(Dd.page)));
378
379
  ok('P11 the side is kept for its kind (cz-pn-side)', !!side11 && Object.values(side11).includes('left'), JSON.stringify(side11));
379
380
  await shot(Dd.page, 'p11-docked-left-1440');
@@ -11,7 +11,7 @@
11
11
  * (since premium-agreed-design /premium-chat.html opens Home with the chat ?about names; the Viewer is the cozy card #czViewer, and on a
12
12
  * phone the chat is the page and the Viewer covers it in place of the old Detail tab)
13
13
  * C6 every chip is at least 44 px; no sideways scroll; no page error
14
- * Set CHAT_CONTEXT_SHOTS=<dir> to save the page at 1280 and 390, light and dark. */
14
+ * Set CHAT_CONTEXT_SHOTS=<dir> to save the page at 1360 and 390, light and dark. */
15
15
  const { findBrowser } = require('./lib/find-browser');
16
16
  require('./test-run').configure({ name: 'premium-chat-context' });
17
17
  const Fx = require('./c3-scan-fixture.js');
@@ -74,7 +74,7 @@ const second = (k) => [
74
74
  };
75
75
  const answer = async (p, conv, k, working) => { conv.messages = [...first(), ...second(k)]; conv.turn = working ? 'agent' : 'user'; };
76
76
 
77
- { const { p, ctx, errs, conv } = await open(1280);
77
+ { const { p, ctx, errs, conv } = await open(1360);
78
78
  await sleep(2500); // a read after the first: an answer already there opens nothing
79
79
  const s0 = await p.evaluate(look);
80
80
  ok('C1 the answer that was there has its chips, the file PMOS wrote first and the file it read after', JSON.stringify(s0.chips) === JSON.stringify([['file:signup-drop.md*', 'file:signup-fix.md']]), JSON.stringify(s0.chips));
@@ -99,12 +99,12 @@ const second = (k) => [
99
99
  const sl = await until(() => p.evaluate(() => { const e = document.querySelector('#czViewer .obody.vw[data-vw^="slack:"]'); const a = e && e.querySelector('a'); return a ? a.href : null; }));
100
100
  ok('C4 a Slack chip opens a tab with Open in Slack', sl === 'slack://channel?id=C0123ABCD', String(sl));
101
101
  const s3 = await p.evaluate(look);
102
- ok('C6 at 1280 every chip is at least 44 px and nothing scrolls sideways', s3.minH >= 44 && !s3.wide, JSON.stringify(s3));
103
- if (shots) await p.screenshot({ path: `${shots}/chat-context-1280-light.png` });
104
- ok('C6 no page error at 1280', errs.length === 0, errs.join(' | '));
102
+ ok('C6 at 1360 every chip is at least 44 px and nothing scrolls sideways', s3.minH >= 44 && !s3.wide, JSON.stringify(s3));
103
+ if (shots) await p.screenshot({ path: `${shots}/chat-context-1360-light.png` });
104
+ ok('C6 no page error at 1360', errs.length === 0, errs.join(' | '));
105
105
  await ctx.close(); }
106
106
 
107
- { const { p, ctx, errs, conv } = await open(1280); // C7: what Claude only read folds into "+N read" (batch 17 item 5)
107
+ { const { p, ctx, errs, conv } = await open(1360); // C7: what Claude only read folds into "+N read" (batch 17 item 5)
108
108
  await sleep(1500);
109
109
  const reads = ['notes/a.md', 'notes/b.md', 'notes/c.md'];
110
110
  conv.messages = [...first(), { role: 'user', text: 'Sum up the notes', at: '2026-10-21T08:02:00Z' },
@@ -169,7 +169,7 @@ const look = () => {
169
169
 
170
170
  /* P9: a desktop */
171
171
  { const st = { goal: goal('started'), conv: { turn: 'tool', messages: BASE } };
172
- const { p, ctx, errs } = await open(1280, st);
172
+ const { p, ctx, errs } = await open(1360, st); // slice 1: the rail of places takes 80 px; at 1280 the Viewer floats over the chat line instead of sitting beside it
173
173
  const s0 = await until(async () => { const v = await p.evaluate(look); return v.line ? v : null; }) || await p.evaluate(look);
174
174
  ok('P9 a desktop: the same line over the chat column, opening nothing by itself', /1 of 4 done/.test(s0.line || '') && !s0.vw, JSON.stringify(s0));
175
175
  await p.click('#hmPl [data-pl="toggle"]');
@@ -43,7 +43,7 @@ const notes = (key = KEY) => lib.listNotes({ runtimeDir: T.STATE_DIR, key }).not
43
43
  await T.waitForServer(BASE);
44
44
  browser = await chromium.launch({ executablePath: exe });
45
45
 
46
- const open = async ({ w = 1280, h = 900, scheme = 'light' } = {}) => {
46
+ const open = async ({ w = 1360, h = 900, scheme = 'light' } = {}) => { // 1360: the rail of places takes 80 px, and at 1280 Home's narrow rule lays the Viewer over the chat
47
47
  const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: scheme, hasTouch: w < 1000 });
48
48
  const page = await ctx.newPage();
49
49
  const errors = [], asks = [], st = { session: null, messages: [] };
@@ -9,6 +9,7 @@ const fs = require('fs');
9
9
  const path = require('path');
10
10
  const { spawn } = require('child_process');
11
11
  const { findBrowser } = require('./lib/find-browser');
12
+ const { besidePage } = require('./lib/beside-page'); // these checks are about work beside the page, not the popup
12
13
  const T = require('./test-run').configure({ name: 'premium-core-doc-issue' });
13
14
  const { makeRepos, codeRepo, write, git } = require('./plan-test-repos');
14
15
  const CD = require('./lib/core-docs.js');
@@ -68,7 +69,7 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
68
69
  const ir = ini2.model.docs.rows.find((d) => d.key === ikey);
69
70
  ok('R2 the initiative model carries the draft\'s slot and path', ir.st === 'draft' && ir.slot === d2.slot && ir.path === d2.path, JSON.stringify(ir));
70
71
 
71
- browser = await chromium.launch({ executablePath: exe });
72
+ browser = besidePage(await chromium.launch({ executablePath: exe }));
72
73
  const open = async (url, { w = 1280, h = 900, theme = 'light' } = {}) => {
73
74
  const ctx = await browser.newContext({ viewport: { width: w, height: h } });
74
75
  await ctx.addInitScript(() => { try { localStorage.setItem('pmos.premium.openAs', 'popup'); } catch { /* none */ } });
@@ -146,7 +146,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
146
146
  await E.ctx.close();
147
147
 
148
148
  /* C9 on Home, the Viewer widens for the week */
149
- const G = await F.open(browser, BASE, '/premium.html', { w: 1440, h: 900 });
149
+ const G = await F.open(browser, BASE, '/premium.html', { w: 1520, h: 900 }); // the rail of places takes 80 px of Home's desk (six-place navigation): at 1520 the side beside the chat is as wide as it was at 1440
150
150
  await until(() => G.page.evaluate(() => !!(window.czViews && window.czViews.openCalendar)), 15000);
151
151
  await G.page.evaluate(() => window.czViews.openCalendar());
152
152
  await until(() => G.page.evaluate(() => !!document.querySelector('#czViewer .vzc-dy')), 15000);
@@ -9,6 +9,7 @@
9
9
  const path = require('path');
10
10
  const { spawn } = require('child_process');
11
11
  const { findBrowser } = require('./lib/find-browser');
12
+ const { besidePage } = require('./lib/beside-page'); // these checks are about work beside the page, not the popup
12
13
  const T = require('./test-run').configure({ name: 'premium-vw-doc' });
13
14
  const IP = require('./lib/initiative-premium.js');
14
15
  const F = require('./fixtures/initiative-premium-facts.js');
@@ -46,7 +47,7 @@ const prop = (o) => Object.assign({ id: 'prop-a', state: 'proposed', prompt: 'ad
46
47
  try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
47
48
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT), PMOS_SELF_ROOT: path.resolve(__dirname, '..') }) });
48
49
  await T.waitForServer(BASE);
49
- browser = await chromium.launch({ executablePath: exe });
50
+ browser = besidePage(await chromium.launch({ executablePath: exe }));
50
51
 
51
52
  const open = async ({ w = 1280, h = 900, theme = 'light', props = [], post = null, live = false } = {}) => {
52
53
  const ctx = await browser.newContext({ viewport: { width: w, height: h } });
@@ -14,6 +14,7 @@ const path = require('path');
14
14
  const { Readable } = require('stream');
15
15
  const { spawn } = require('child_process');
16
16
  const { findBrowser } = require('./lib/find-browser');
17
+ const { besidePage } = require('./lib/beside-page'); // these checks are about work beside the page, not the popup
17
18
  const T = require('./test-run').configure({ name: 'program-leave' });
18
19
  const BP = require('./lib/board-premium.js');
19
20
  const F = require('./fixtures/board-premium-facts.js');
@@ -77,7 +78,7 @@ const waitsOf = (id) => ((R.all(rctx).find((p) => p.id === 'project-ascent') ||
77
78
  try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
78
79
  srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
79
80
  await T.waitForServer(BASE);
80
- browser = await chromium.launch({ executablePath: exe });
81
+ browser = besidePage(await chromium.launch({ executablePath: exe }));
81
82
 
82
83
  const board = async (o = {}) => {
83
84
  seed();
@@ -76,7 +76,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
76
76
  ok('P ?program=<id> sends bd:program once: one path opens the program', await p.evaluate(() => window.__bdp) === 1, String(await p.evaluate(() => window.__bdp)));
77
77
  const hd = await p.evaluate(() => { const v = document.querySelector('#czViewer'); const r = v.getBoundingClientRect(); return { t: v.querySelector('.cz-vw-title').textContent, kind: (v.querySelector('.cz-vw-kind') || {}).textContent, tools: [...v.querySelectorAll('.cz-vw-head [data-cz-vw], [data-cz-vw]')].filter((b) => b.closest('#czViewer') && !b.classList.contains('cz-vw-grip')).map((b) => b.getAttribute('aria-label')), input: v.querySelectorAll('.cz-vw-body input, .cz-vw-body textarea').length, tabs: [...v.querySelectorAll('[data-pv="tab"]')].map((t) => t.dataset.k + (t.getAttribute('aria-selected') === 'true' ? '*' : '')), w: Math.round(r.width), right: Math.round(innerWidth - r.right), sel: !!document.querySelector('#ibBody [data-prow="project-ascent"].sel') }; });
78
78
  ok('P the shell\'s header names it once ("title · goal"), with Discuss in chat, ⋯, ⧉ Arrange and Close, and no Work | Dashboard toggle (batch 21 item 2: one page); no chat box; the tabs Tasks, Initiatives (open first), Reports, Documents', hd.t === 'Project Ascent · CIAM migration' && hd.kind === 'Program' && [...new Set(hd.tools)].join('|') === 'Discuss in chat|More|Arrange|Close the viewer' && hd.input === 0 && hd.tabs.join() === 'tasks,initiatives*,reports,documents', JSON.stringify(hd));
79
- ok('V the program opens beside the page, at the right edge, no wider than leaves the Board its 880 px (506 at 1440), and its band row on the Board is selected', hd.w === 506 && hd.right < 40 && hd.sel && await p.evaluate(() => !document.querySelector('#czViewer.cz-vw-float') && !!document.querySelector('.cz-pn-div')), JSON.stringify(hd));
79
+ ok('V the program opens beside the page, at the right edge, no wider than leaves the Board its 880 px (426 at 1440, beside the rail of places), and its band row on the Board is selected', hd.w === 426 && hd.right < 40 && hd.sel && await p.evaluate(() => !document.querySelector('#czViewer.cz-vw-float') && !!document.querySelector('.cz-pn-div')), JSON.stringify(hd));
80
80
  const sm = await p.evaluate(() => ({ line: (document.querySelector('#czViewer .pv-line') || {}).textContent || '', pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent || '' }));
81
81
  ok('P the ✦ line leads with the next milestone and says what waits on you once; no sort primary while every task has a level', /Next: Pilot live/.test(sm.line) && /One thing waits on you/.test(sm.line) && sm.pri === '', JSON.stringify(sm));
82
82
  const g = await p.evaluate(() => ({ per: document.querySelector('#czViewer .pp-per').textContent.trim(), krs: [...document.querySelectorAll('#czViewer .pp-goal .pp-kr:not(.ghost) b')].map((b) => b.textContent) }));
@@ -132,7 +132,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
132
132
  await p.focus('.cz-pn-div');
133
133
  await p.keyboard.press('ArrowLeft');
134
134
  const gw = await p.evaluate(() => { const r = document.querySelector('#czViewer').getBoundingClientRect(); let kept = null; try { kept = JSON.parse(localStorage.getItem('cz-pn:board')); } catch { /* none */ } return { w: Math.round(r.width), kept }; });
135
- ok('V the divider beside the page widens it 24 px, and the Board keeps the share (not a width per kind)', gw.w === 530 && !!gw.kept && gw.kept.v === 2, JSON.stringify(gw));
135
+ ok('V the divider beside the page widens it 24 px, and the Board keeps the share (not a width per kind)', gw.w === 450 && !!gw.kept && gw.kept.v === 2, JSON.stringify(gw));
136
136
  await p.keyboard.press('Escape');
137
137
  ok('P Escape closes the Viewer', await until(() => p.evaluate(() => document.querySelector('#czViewer').hidden)));
138
138
  ok('0 no page error on desktop', D.errors.length === 0, D.errors.join(' | '));
@@ -259,7 +259,9 @@ export function openIni(r, from, o = {}) {
259
259
  readPage(r, true); // the gate chips, Core documents and the stakeholders, as Home's page shows them
260
260
  { const h = dashFor(r); if (h) h.read(o.via || 'act'); } // a Board row is a press to act (PbH1Header); a link to read passes via 'read'
261
261
  // the same tile as Home's initiative page; no "Open in full": the header's expand already opens it wide (batch 14 item 5)
262
- VW.open({ kind: 'Initiative', title: r.title, icon: 'goal', wrap: true, id: vidOf(r),
262
+ // on a desk it opens in the one popup with Ask PMOS about it beside it (slice 2 of the six-place navigation); a phone keeps its sheet
263
+ const B = (O.M() || {}).board || {};
264
+ VW.open({ kind: 'Initiative', title: r.title, icon: 'goal', wrap: true, id: vidOf(r), pop: { id: r.id || '', kind: 'initiative', title: r.title, ws: r.ws || B.ws || undefined },
263
265
  discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: () => iniMore(O.rowOf(r.key) || r), rename: O.rename ? O.rename(r) : null,
264
266
  // the kind of work (batch 29 item 11, KdV1-3): its glyph stands before Discuss; a tap opens the three kinds. A published copy
265
267
  // (pm/readonly.js) cannot change it, so it has no press: the Board's icon still names the kind
@@ -38,7 +38,7 @@ function toToday(smooth) { const v = view(); scrollToX(xOf(+cur.el.dataset.now)
38
38
  /** The track's width for the screen it is on: one screen holds the span's columns. */
39
39
  function size() {
40
40
  const ratio = +cur.el.dataset.ratio || 1, w = Math.max(1, cur.sc.clientWidth - cur.nw);
41
- cur.tw = Math.round(w * ratio);
41
+ cur.tw = Math.round(w * ratio); cur.w = w;
42
42
  cur.sc.style.setProperty('--tw', cur.tw + 'px');
43
43
  cur.sc.style.setProperty('--vw', cur.sc.clientWidth + 'px');
44
44
  }
@@ -62,7 +62,9 @@ export function mount(host) {
62
62
  sc.addEventListener('keydown', onKey);
63
63
  sc.addEventListener('pointerdown', onDown);
64
64
  el.addEventListener('click', onClick, true);
65
- ro = new ResizeObserver(() => { if (!cur || cur.el !== el) return; const v = view(), mid = dateAt(v.l + v.w / 2); cur.nw = nameCell ? nameCell.getBoundingClientRect().width : 0; size(); scrollToX(xOf(mid) - view().w / 2); update(); });
65
+ ro = new ResizeObserver(() => { if (!cur || cur.el !== el) return; const w0 = cur.w || view().w, l0 = cur.sc.scrollLeft, tx0 = xOf(+el.dataset.now), at0 = tx0 >= l0 && tx0 <= l0 + w0 ? (tx0 - l0) / w0 : null, mid0 = dateAt(l0 + w0 / 2); cur.nw = nameCell ? nameCell.getBoundingClientRect().width : 0; size();
66
+ // a resize keeps today in place when it is in view (the rail or a panel can narrow the page after the first draw), else the middle date
67
+ if (at0 != null) scrollToX(xOf(+el.dataset.now) - view().w * at0); else scrollToX(xOf(mid0) - view().w / 2); update(); });
66
68
  ro.observe(sc);
67
69
  update();
68
70
  }
@@ -1568,3 +1568,6 @@ span.tg-ng { cursor: default; }
1568
1568
  .kd-seg > button:not(.bd-ib) { flex: 1 1 0%; justify-content: center; gap: 6px; height: 38px; }
1569
1569
  .kd-seg > button svg { flex: 0 0 auto; }
1570
1570
  .kd-g { display: inline-grid; vertical-align: -3px; margin-right: 6px; color: var(--cz-ink3); }
1571
+ /* slice 1: the rail of places leaves the toolbar 80 px less beside a Viewer; the "what needs a look" pill gives way first (it leaves the
1572
+ toolbar with slice 4), so ⋯ never runs past the panel's edge (its menu hangs from the wrapper, so only the chip clips) */
1573
+ @media (min-width: 761px) { .bd-hd #bdNeedw { min-width: 0; } .bd-hd #bdNeedw .bd-chip.bd-need { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; } .bd-hd .bd-chip.bd-need > span { flex: none; } }
@@ -459,3 +459,54 @@
459
459
  .ev-st input.ev-inp.ev-sw-at { flex: 0 0 auto; width: 120px; }
460
460
  .ev-st .ev-sw-more { margin: 0 0 8px 30px; }
461
461
  .ev-st .ev-sw-undo { border-bottom: 0; padding: 8px 0 0; }
462
+
463
+ /* ── The rail (slice 1 of the six places; boards StToday, StWorkList, StSettings): on a desktop the menu is one thin panel at the left
464
+ edge of every page, always shown. It is not a panel: the page leaves its width free. The floating button is a phone's only. ── */
465
+ @media (min-width: 761px) {
466
+ body.cz-railon { --cz-railw: 72px; --cz-railx: 96px; } /* the rail's width, and where the page starts: 12 + 72 + 12 (frame.js on the boards) */
467
+ body.cz-railon .cz-fabw { display: block !important; left: 0; bottom: 0; z-index: 60; } /* a dialog dims the rail (its scrim is above it); it never hides it */
468
+ body.cz-railon .cz-fab, body.cz-railon .ev-fd, body.cz-railon .ev-scrim { display: none !important; }
469
+ body.cz-railon .cz-fabw > .cz-fabm.ev-menu.ev-rail { position: fixed; left: 12px; top: 16px; bottom: 16px; width: var(--cz-railw); box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 4px;
470
+ padding: 10px 0 12px; border: 0; border-radius: 24px; background: var(--cz-well); box-shadow: none; overflow: hidden auto; scrollbar-width: none; }
471
+ .ev-menu.ev-rail a.ev-rp { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 60px; height: 56px; min-height: 0; padding: 0; margin: 0; border-radius: 16px;
472
+ color: var(--cz-ink2); font-size: var(--fs-label); font-weight: var(--fw-strong); line-height: var(--lh-label); text-decoration: none; background: none; }
473
+ .ev-menu.ev-rail a.ev-rp svg { width: 20px; height: 20px; color: currentColor; }
474
+ .ev-menu.ev-rail a.ev-rp:hover { background: var(--cz-well2); }
475
+ .ev-menu.ev-rail a.ev-rp[aria-current="page"] { background: var(--cz-card); color: var(--cz-blueink); box-shadow: 0 1px 2px rgba(30,40,60,.08), 0 4px 14px rgba(30,40,60,.06); }
476
+ .ev-menu.ev-rail a.ev-rp:focus-visible, .ev-menu.ev-rail .ev-rb:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
477
+ .ev-menu.ev-rail .ev-rsp { flex: 1; min-height: 12px; }
478
+ .ev-menu.ev-rail .ev-rtray { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
479
+ .ev-menu.ev-rail button.ev-rb { position: relative; width: 44px; height: 44px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 14px; background: none; color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
480
+ .ev-menu.ev-rail button.ev-rb:hover { background: var(--cz-well2); }
481
+ .ev-menu.ev-rail button.ev-rb svg { width: 20px; height: 20px; color: currentColor; }
482
+ /* a number: Today's calls, the sessions that wait for you. A dot: a place with something new (blue), a stale source (amber). */
483
+ .ev-menu.ev-rail .ev-rn { position: absolute; top: 3px; right: 5px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: var(--cz-blueink); color: var(--cz-onsolid);
484
+ font-style: normal; font-size: var(--fs-badge); font-weight: var(--fw-strong); line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--cz-well); transform: scale(.85); transform-origin: top right; }
485
+ .ev-menu.ev-rail .ev-rb .ev-rn { top: 1px; right: 0; }
486
+ .ev-menu.ev-rail a.ev-rp[aria-current="page"] .ev-rn { box-shadow: 0 0 0 2px var(--cz-card); }
487
+ .ev-menu.ev-rail .ev-rd { position: absolute; top: 8px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--cz-blue); box-shadow: 0 0 0 2px var(--cz-well); }
488
+ .ev-menu.ev-rail .ev-rb .ev-rd { top: 9px; right: 9px; }
489
+ .ev-menu.ev-rail .ev-rd.risk { background: var(--cz-dot-risk); }
490
+ /* the round Live button and its list, until the popup's chat holds the sessions: at the foot of the rail, above the chat icon */
491
+ body.cz-railon .cz-fabw .cz-live { position: fixed; left: 26px; bottom: 228px; visibility: visible !important; } /* the rail is never a menu that covers it */
492
+ body.cz-railon .cz-fabw .lv-tray:not(.lv-r) { position: fixed; left: calc(var(--cz-railx) - 8px); bottom: 16px; }
493
+ body.cz-railon.cz-chatpop .cz-fabw .cz-live { display: none; }
494
+ /* the pages start after the rail */
495
+ body.cz-railon .hm-desk { left: var(--cz-railx); }
496
+ body.cz.cz-railon main.cz-panel.stage { margin-left: var(--cz-railx); }
497
+ body.cz-railon.cz-pn-page { padding-left: var(--cz-railx); } /* the panels engine lays the page and its Viewer out in the body (cozy-panels.css) */
498
+ body.cz-railon.cz-pn-page .cz-vw.cz-pn-over.cz-pn-left { left: var(--cz-railx); }
499
+ /* the product choice is Work's and Goals' (one shared pick); Today reads the products of that pick */
500
+ body.cz-railon.cz-home #hmPick { display: none; }
501
+ }
502
+ @media (min-width: 761px) and (max-height: 640px) { .ev-menu.ev-rail a.ev-rp { height: 48px; gap: 3px; } }
503
+ /* Settings, one container (slice 1, board StSettings): each group of rows is one card with a thin border */
504
+ .ev-st .ev-tcard { border-radius: 16px; background: var(--cz-card); box-shadow: inset 0 0 0 1px var(--cz-hair); overflow: hidden; margin: 6px 0 4px; flex: none; }
505
+ .ev-st .ev-tcard > .ev-trow { padding-left: 18px; padding-right: 18px; margin: 0; border-radius: 0; }
506
+ .ev-st .ev-tcard > .ev-trow:last-child { border-bottom: 0; }
507
+ /* a published read-only copy (pm/readonly.js, html.ro) has no places to go to: no rail, and the page keeps its own left edge */
508
+ @media (min-width: 761px) {
509
+ html.ro body.cz-railon .cz-fabw { display: none !important; }
510
+ html.ro body.cz-railon.cz-pn-page { padding-left: 16px; }
511
+ html.ro body.cz.cz-railon main.cz-panel.stage { margin-left: 16px; }
512
+ }
@@ -18,7 +18,7 @@
18
18
  * wtChip(worktrees) → 'main + 3 worktrees'
19
19
  * initials(name) → 'Mei' · 'DL' (EvInbox's avatars: a short first name, else two initials) */
20
20
 
21
- const PLACE = { home: 'Home', board: 'Board', insights: 'Intelligence', settings: 'Settings' };
21
+ const PLACE = { home: 'Today', board: 'Work', insights: 'Goals', settings: 'Settings' }; // the places' names since slice 1 of the six places
22
22
  const SRC_NAME = { repository: 'Repository', initiatives: 'Initiatives', calendar: 'Calendar', jira: 'Jira', 'my-work': 'Your tasks', tracker: 'Tracker items', tools: 'Mail, Slack and meeting notes' };
23
23
  const SRC_SUB = { repository: 'This product\'s repository', initiatives: 'Read from the repository', calendar: 'Your calendar', jira: 'The Jira projects of your initiatives', 'my-work': 'The work assigned to you', tracker: 'The tracker items of your initiatives', tools: 'Mail, Slack, Confluence and Wispr Flow' };
24
24
  const PARTS = { jira: 'Board and the Jira-linked initiatives', calendar: 'Today and your meetings', 'my-work': 'Your tasks', tracker: 'The tracker items on Board', tools: 'New for you and the digests', initiatives: 'Home and Board', repository: 'Home and Board' };
@@ -113,7 +113,8 @@ export function mountLivePill(doc = document, opts = {}) {
113
113
  function draw() {
114
114
  if (!pill) return;
115
115
  const now = items();
116
- if (now.length !== L.n) { L.n = now.length; doc.dispatchEvent(new CustomEvent('cz:live-n', { detail: { n: now.length } })); } // the phone chat's ⋯ says "Live now · N" (batch 31 item 5)
116
+ const asks = now.filter((x) => x.mark === 'ask').length; // the sessions that wait for you: the number on the rail's chat icon (cozy-nav.js)
117
+ if (now.length !== L.n || asks !== L.asks) { L.n = now.length; L.asks = asks; doc.dispatchEvent(new CustomEvent('cz:live-n', { detail: { n: now.length, asks } })); } // the phone chat's ⋯ says "Live now · N" (batch 31 item 5)
117
118
  if (!now.length && !L.open) { pill.hidden = true; tray.hidden = true; scrim.hidden = true; return; }
118
119
  const list = L.open ? keepOrder(L.shown, now) : now;
119
120
  if (L.open && !list.length) { set(false); return; }
@@ -21,6 +21,13 @@
21
21
  * are Adler's ears over the phone button (AdP6): Your move is the one place that says what is yours.
22
22
  * THE CHAT (C5, board CsB): the tray's chat icon opens the one chat over the page you are on (pm/page-chat.js openCos), with a soft
23
23
  * "You are on …" chip. A page that has its own chat column (Home) passes opts.chat() and the icon focuses that chat instead.
24
+ * THE RAIL (slice 1 of the six places, boards StToday/StWorkList/StSettings, 2026-11-19): on a desktop (wider than 760 px) the menu is
25
+ * not a floating button: #czMenu is drawn as one thin panel at the left edge of every page, always shown, and it is not counted as a panel.
26
+ * Places on top (Today, Work, Goals; Events, Library and Routine show once their slice ships and gives them an href), then at the foot the
27
+ * chat icon with the number of sessions that wait for you, Search, Guide and Settings. One press changes place. The pages leave its width
28
+ * free (body.cz-railon in cozy-ev.css). Until the place of the same name ships, Today is Home, Work is the Board, Goals is Intelligence.
29
+ * The chat icon calls window.czOpenChat() when a page has it (the popup with the chat), else today's chat. While no popup is there,
30
+ * the round Live button keeps its list at the foot of the rail. A phone keeps the floating button and its menu as they were.
24
31
  * FROM THE TOP BAR (batch 31 item 5, board RcBmenu): openMenu({ anchor, rows }) opens the same menu under a page's own ⋯ (the phone
25
32
  * chat has no round button). rows go on top of the places, each { label, icon, dot, go }; the menu closes and focus goes back to the anchor.
26
33
  */
@@ -29,15 +36,32 @@ import { fabLabel, bannerOf } from './cozy-evmodel.js';
29
36
  import { mountToastFaces, loadPrefs } from './cozy-adler.js';
30
37
  import { pmPost } from './http.js'; // Adler (batch 16 item 2): every toast carries his S face; Settings > Adler is read once
31
38
 
32
- export const PLACES = [
33
- { key: 'home', label: 'Home', href: '/premium.html', d: ICON.home },
34
- { key: 'board', label: 'Board', href: '/premium-board.html', d: ICON.board },
35
- { key: 'insights', label: 'Intelligence', href: '/premium-intelligence.html', d: ICON.insights },
39
+ /* The six places (slice 1). A place shows once it has an href: Events, Library and Routine get theirs when their slice ships. Until then
40
+ * Today is Home, Work is the Board and Goals is Intelligence; the keys stay the pages' own (home, board, insights). */
41
+ const RAIL_ICON = {
42
+ today: 'M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M5.6 18.4L7 17M17 7l1.4-1.4',
43
+ work: 'M5.5 5h13a1.5 1.5 0 0 1 0 3h-13a1.5 1.5 0 0 1 0-3zM5.5 11h8a1.5 1.5 0 0 1 0 3h-8a1.5 1.5 0 0 1 0-3zM5.5 17h11a1.5 1.5 0 0 1 0 3h-11a1.5 1.5 0 0 1 0-3z',
44
+ goals: ICON.insights,
45
+ events: 'M7 5.5h10a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3zM4 10h16M8.5 3.5v4M15.5 3.5v4',
46
+ library: 'M5 5.5h4.5v13H5zM9.5 5.5H14v13H9.5zM14.6 7.2l3.9-1 2.6 11.6-3.9 1z',
47
+ routine: 'M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3M18 3v4h-4M6 21v-4h4',
48
+ };
49
+ const ALL_PLACES = [
50
+ { key: 'home', label: 'Today', href: '/premium.html', d: RAIL_ICON.today },
51
+ { key: 'board', label: 'Work', href: '/premium-board.html', d: RAIL_ICON.work },
52
+ { key: 'insights', label: 'Goals', href: '/premium-intelligence.html', d: RAIL_ICON.goals },
53
+ { key: 'events', label: 'Events', href: '', d: RAIL_ICON.events },
54
+ { key: 'library', label: 'Library', href: '', d: RAIL_ICON.library },
55
+ { key: 'routine', label: 'Routine', href: '', d: RAIL_ICON.routine },
36
56
  ];
57
+ export const PLACES = ALL_PLACES.filter((p) => p.href);
58
+ const DESK = '(min-width: 761px)';
59
+ /** The rail is drawn on a desktop; a phone keeps the floating button. */
60
+ export const railOn = () => typeof matchMedia === 'function' && matchMedia(DESK).matches;
37
61
  export { fabLabel };
38
62
  const THEME_KEY = 'pmos.c3.theme';
39
63
  const CSS = new URL('./cozy-ev.css', import.meta.url).href;
40
- const N = { news: 0, stale: null, here: 'home', calls: 0, fresh: new Set(), extra: [], from: null };
64
+ const N = { news: 0, stale: null, here: 'home', calls: 0, fresh: new Set(), extra: [], from: null, waiting: 0, rail: false };
41
65
  let OPEN = null; // mountNav's own open(o): openMenu reaches the one menu of the page
42
66
  /* A place that just opened (onboarding B3, ObA4Gradual; GET /api/moments places[p].dot): its menu row gets one soft blue dot until the PM
43
67
  * first opens it. Reports live in Intelligence, so their dot is on the Intelligence row. */
@@ -76,6 +100,24 @@ export function menuHtml(here, o = {}) {
76
100
  + '</div>';
77
101
  }
78
102
 
103
+ /** The rail's markup; pure, so a unit test can read it. here: home | board | insights. o: { calls, stale, fresh, waiting }
104
+ * calls: the calls that are yours (Today's number); waiting: the sessions that wait for you (the chat icon's number). Zero is silence. */
105
+ export function railHtml(here, o = {}) {
106
+ const n = (v) => (v > 0 ? `<i class="ev-rn" aria-hidden="true">${v > 99 ? '99+' : v}</i>` : '');
107
+ const places = PLACES.map((p) => {
108
+ const cur = p.key === here, calls = p.key === 'home' && o.calls > 0, opened = !cur && !!(o.fresh && o.fresh.has(p.key));
109
+ const lab = calls ? `${p.label}. ${callWords(o.calls)}` : opened ? `${p.label}. New: it has something to show now` : '';
110
+ return `<a class="ev-rp" href="${p.href}"${cur ? ' aria-current="page"' : ''}${lab ? ` aria-label="${esc(lab)}"` : ''}>${svg(p.d, 20)}<span>${esc(p.label)}</span>${calls ? n(o.calls) : opened ? '<i class="ev-rd" aria-hidden="true"></i>' : ''}</a>`;
111
+ }).join('');
112
+ const w = o.waiting > 0 ? `Ask PMOS. ${o.waiting === 1 ? 'One session waits' : o.waiting + ' sessions wait'} for you` : 'Ask PMOS';
113
+ return places + '<div class="ev-rsp"></div><div class="ev-rtray">'
114
+ + `<button type="button" class="ev-rb" data-cz-chat aria-label="${esc(w)}" title="${esc(w)}">${svg(ICON.chat, 20)}${n(o.waiting)}</button>`
115
+ + `<button type="button" class="ev-rb" data-cz-search aria-label="Search (⌘K)" title="Search ⌘K">${svg(ICON.search, 20)}</button>`
116
+ + `<button type="button" class="ev-rb" data-cz-guide aria-label="Guide" title="Guide">${svg(ICON.guide, 20)}</button>`
117
+ + `<button type="button" class="ev-rb" data-cz-settings aria-label="Settings${o.stale ? '. ' + esc(o.stale.text) : ''}" title="Settings">${svg(ICON.settings, 20)}${o.stale ? '<i class="ev-rd risk" aria-hidden="true"></i>' : ''}</button>`
118
+ + '</div>';
119
+ }
120
+
79
121
  function addCss(doc) {
80
122
  if (doc.querySelector(`link[href="${CSS}"]`)) return;
81
123
  const l = doc.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; doc.head.append(l);
@@ -106,6 +148,20 @@ export function mountNav(here, doc = document, opts = {}) {
106
148
  mountToastFaces(doc); loadPrefs();
107
149
  const fab = w.querySelector('#czFab'), menu = w.querySelector('#czMenu'), scrim = w.querySelector('#czScrim');
108
150
  const draw = () => {
151
+ N.rail = railOn();
152
+ doc.body.classList.toggle('cz-railon', N.rail);
153
+ doc.body.classList.toggle('cz-chatpop', N.rail && typeof window.czOpenChat === 'function'); // the popup's chat holds the sessions: no Live button
154
+ menu.classList.toggle('ev-rail', N.rail);
155
+ menu.setAttribute('aria-label', N.rail ? 'Places' : 'Menu');
156
+ if (N.rail) {
157
+ if (menu.hidden) { menu.hidden = false; scrim.hidden = true; }
158
+ const f = doc.activeElement && menu.contains(doc.activeElement) ? [...menu.querySelectorAll('a, button')].indexOf(doc.activeElement) : -1;
159
+ const h = railHtml(here, { calls: N.calls, stale: N.stale, fresh: N.fresh, waiting: N.waiting });
160
+ if (menu.__h !== h) { menu.__h = h; menu.innerHTML = h; if (f >= 0) { const e = menu.querySelectorAll('a, button')[f]; if (e) e.focus(); } }
161
+ w.querySelector('#czFdRisk').hidden = true; w.querySelector('#czFdYou').hidden = true;
162
+ return;
163
+ }
164
+ menu.__h = '';
109
165
  menu.innerHTML = menuHtml(here, { calls: N.calls, stale: N.stale, fresh: N.fresh, extra: N.extra });
110
166
  const opened = [...N.fresh].some((k) => k !== here);
111
167
  // one dot: amber while a source needs the PM, else blue while a call is theirs or a place has something new
@@ -114,6 +170,7 @@ export function mountNav(here, doc = document, opts = {}) {
114
170
  if (menu.hidden) fab.setAttribute('aria-label', fabLabel(here, false, N.stale) + (opened ? '. A place has something new to show' : '') + (N.calls > 0 ? '. ' + callWords(N.calls) : ''));
115
171
  };
116
172
  const set = (open) => {
173
+ if (N.rail) { if (N.from) { N.from.setAttribute('aria-expanded', 'false'); N.from = null; N.extra = []; } draw(); return; } // the rail is always shown
117
174
  if (!open && N.from) { N.from.setAttribute('aria-expanded', 'false'); N.from = null; N.extra = []; w.classList.remove('cz-top'); }
118
175
  menu.hidden = !open; scrim.hidden = !open; fab.setAttribute('aria-expanded', String(open));
119
176
  fab.setAttribute('aria-label', fabLabel(here, open, N.stale)); fab.innerHTML = svg(open ? ICON.close : ICON.menu, 22);
@@ -121,6 +178,7 @@ export function mountNav(here, doc = document, opts = {}) {
121
178
  if (open) { const f = menu.querySelector('a, button'); if (f) f.focus(); }
122
179
  };
123
180
  OPEN = (o) => {
181
+ if (N.rail) return; // a desktop has no menu to open: the rail is the menu (the ⋯ that calls this is the phone chat's)
124
182
  const back = N.from;
125
183
  if (!menu.hidden) { set(false); if (back === o.anchor) { if (back) back.focus(); return; } }
126
184
  N.from = o.anchor || null; N.extra = o.rows || [];
@@ -131,18 +189,20 @@ export function mountNav(here, doc = document, opts = {}) {
131
189
  draw();
132
190
  fab.addEventListener('click', () => set(menu.hidden));
133
191
  scrim.addEventListener('click', () => set(false));
134
- doc.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !menu.hidden) { e.stopPropagation(); const back = N.from || fab; set(false); back.focus(); } }, true);
192
+ doc.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !menu.hidden && !N.rail) { e.stopPropagation(); const back = N.from || fab; set(false); back.focus(); } }, true);
135
193
  // set() redraws the button's icon, so the pressed icon may be gone from the page by now: only a press still on the page closes the menu
136
194
  // (the ⋯ that opened it toggles it itself)
137
- doc.addEventListener('click', (e) => { if (!menu.hidden && e.target.isConnected && !w.contains(e.target) && !(N.from && N.from.contains(e.target))) set(false); });
195
+ doc.addEventListener('click', (e) => { if (!menu.hidden && !N.rail && e.target.isConnected && !w.contains(e.target) && !(N.from && N.from.contains(e.target))) set(false); });
138
196
  menu.addEventListener('click', (e) => {
139
197
  // the page you are on, pressed again: a page that passes opts.here goes back to its start without a reload (Home: the list, no page open)
140
198
  const a = e.target.closest('a[aria-current="page"]');
199
+ if (a && N.rail && !opts.here) { e.preventDefault(); return; } // the rail: pressing the place you are on reloads nothing
141
200
  if (a && opts.here && !e.metaKey && !e.ctrlKey && !e.shiftKey) { e.preventDefault(); set(false); opts.here(); return; }
142
201
  const b = e.target.closest('button'); if (!b) return;
143
202
  const x = 'czExtra' in b.dataset ? N.extra[+b.dataset.czExtra] : null;
144
203
  set(false);
145
204
  if (x) { if (x.go) x.go(); return; }
205
+ if ('czChat' in b.dataset && N.rail && typeof window.czOpenChat === 'function') { window.czOpenChat(); return; } // the popup with the chat (slice 2)
146
206
  if ('czChat' in b.dataset) { if (opts.chat) opts.chat(); else import('./page-chat.js').then((M) => M.openCos({ here: opts.where ? opts.where() : PLACES.find((p) => p.key === here) ? PLACES.find((p) => p.key === here).label : '' })); }
147
207
  else if ('czSearch' in b.dataset) import('./cozy-search.js').then((M) => M.openSearch({ ...(opts.search ? { go: opts.search() } : {}), ...(opts.scope ? { scope: opts.scope() } : {}) }));
148
208
  // a stale source opens Settings at Connectors, the stale one first (FmA3Settings: open where it matters)
@@ -178,6 +238,9 @@ export function mountNav(here, doc = document, opts = {}) {
178
238
  doc.addEventListener('cz:news', (e) => { if (e.detail && Number.isFinite(e.detail.count)) { N.news = e.detail.count; draw(); } else read(); });
179
239
  doc.addEventListener('cz:calls', (e) => { const n = e.detail && Number(e.detail.count); N.calls = Number.isFinite(n) && n > 0 ? n : 0; draw(); });
180
240
  doc.addEventListener('adler:prefs', () => draw());
241
+ // the chat icon's number: the sessions that wait for you (cozy-live-pill.js counts them)
242
+ doc.addEventListener('cz:live-n', (e) => { const a = e.detail && Number(e.detail.asks); const v = Number.isFinite(a) && a > 0 ? a : 0; if (v !== N.waiting) { N.waiting = v; draw(); } });
243
+ if (typeof matchMedia === 'function') { const mq = matchMedia(DESK); const f = () => { if (!N.rail) set(false); draw(); }; if (mq.addEventListener) mq.addEventListener('change', f); }
181
244
  window.addEventListener('pm:sources', (e) => { const d = e.detail; if (d && d.ok) { N.stale = bannerOf(d.sources); draw(); } });
182
245
  return w;
183
246
  }
@@ -466,7 +466,7 @@ function openBeside(x) {
466
466
 
467
467
  /* ── a new or closed Viewer ── */
468
468
  function onViewer(d) {
469
- if (!S.on || !d || !d.panel) return;
469
+ if (!S.on || !d || !d.panel || d.pop) return; // the popup (cozy-popup.js) is the one slide-over: it is never a panel of the row
470
470
  if (d.shut) { drop(d.panel); S.fr = []; layout(); return; }
471
471
  mark(d.panel);
472
472
  if (S.row.includes(d.panel) || S.over === d.panel || S.away.includes(d.panel)) {
@@ -39,3 +39,6 @@
39
39
  .ppk-menu.sheet .ppk-tk { width: 24px; height: 24px; border-radius: 8px; }
40
40
  @media (prefers-reduced-motion: no-preference) { .ppk-menu.sheet { animation: ppk-up .18s ease-out; } }
41
41
  @keyframes ppk-up { from { transform: translateY(24px); opacity: .6; } }
42
+ /* the chip with names (Work and Goals, slice 1): the full product name, then "+2" in grey */
43
+ .ppk-nmc { padding: 0 2px 0 9px; color: var(--cz-ink); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
44
+ .ppk-nmc em { font-style: normal; color: var(--cz-ink3); }
@@ -6,7 +6,8 @@
6
6
  * A saved pick fires pp:changed on the window (detail: the answer); each page follows it there
7
7
  * tonesOf(products) → { [ws]: 0 | 1 | 2 }: a product's tint, by its place with the default workspace first (Home's groups use the same)
8
8
  * codeOf(p) → the tile's letters: the workspace's own abbreviation, else two letters of its name
9
- * chipHtml(P, o) → the chip: the ticked products' tiles, overlapped, +N past 3; the word All when every one is ticked
9
+ * chipHtml(P, o) → the chip: the ticked products' tiles, overlapped, +N past 3; the word All when every one is ticked.
10
+ * o.names: the full name instead ("pmos-idpf", "pmos-idpf +2", "All products"), as Work and Goals show it
10
11
  * openPicker(chip, o) → the list under the chip (a sheet on a phone). o: { P, label, lines(ws), tones?, onApply(on), onAdd()?, note? };
11
12
  * Add a product opens Settings › Workspaces (the add flow) unless the page gives its own onAdd
12
13
  *
@@ -48,7 +49,10 @@ export function chipWords(P, label) {
48
49
  }
49
50
  export function chipHtml(P, o = {}) {
50
51
  const T = o.tones || tonesOf(P ? P.products : []), on = P ? P.products.filter((p) => p.on) : [];
51
- const inner = !P ? '' : isAll(P) ? '<span class="ppk-all">All</span>'
52
+ // o.names (Work and Goals, slice 1): the full name of the first ticked product, "+2" for the others, "All products" when every one is ticked
53
+ const first = on.slice().sort((a, b) => (b.primary ? 1 : 0) - (a.primary ? 1 : 0))[0];
54
+ const inner = !P ? '' : o.names ? `<span class="ppk-all ppk-nmc">${isAll(P) ? 'All products' : first ? esc(first.name) + (on.length > 1 ? ` <em>+${on.length - 1}</em>` : '') : 'No product'}</span>`
55
+ : isAll(P) ? '<span class="ppk-all">All</span>'
52
56
  : `<span class="ppk-stk">${on.slice(0, 3).map((p) => `<i class="ppk-t t${T[p.ws] || 0}">${esc(codeOf(p))}</i>`).join('')}${on.length > 3 ? `<i class="ppk-t ppk-n">+${on.length - 3}</i>` : ''}</span>`;
53
57
  const words = chipWords(P, o.label || 'Products'), id = o.id || 'ppChip', open = !!cur && cur.id === id; // a page that draws again keeps the open state
54
58
  return `<button type="button" class="ppk-chip${open ? ' open' : ''}" id="${esc(id)}"${o.attrs ? ' ' + o.attrs : ''} aria-haspopup="menu" aria-expanded="${open}" aria-label="${esc(words)}" title="${esc(words)}">${inner}${svg(open ? CHEV_U : CHEV_D, 14)}</button>`;