create-pmos 0.476.0 → 0.477.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 (82) 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-publish-ui-test.js +11 -16
  7. package/workspace/board-shared-ui-test.js +34 -33
  8. package/workspace/changelog.json +19 -0
  9. package/workspace/guide/briefing-premium.md +2 -2
  10. package/workspace/guide/claude-proposes.md +3 -1
  11. package/workspace/guide/forecast.md +16 -3
  12. package/workspace/guide/home.md +2 -2
  13. package/workspace/guide/workflows.md +13 -2
  14. package/workspace/home-railcard-test.js +4 -4
  15. package/workspace/home-rows-test.js +15 -4
  16. package/workspace/ini-workflow-test.js +1 -1
  17. package/workspace/lib/board-pack.js +20 -1
  18. package/workspace/lib/board-trail.js +17 -1
  19. package/workspace/lib/boards-host.js +22 -2
  20. package/workspace/lib/briefing-premium-agent.js +2 -2
  21. package/workspace/lib/engine/boards.js +15 -3
  22. package/workspace/lib/engine/workflows.js +79 -10
  23. package/workspace/lib/forecast-offer.js +57 -0
  24. package/workspace/lib/grill-runs.js +1 -0
  25. package/workspace/lib/grill.js +1 -1
  26. package/workspace/lib/insight-moves.js +8 -6
  27. package/workspace/lib/news-for-you.js +6 -4
  28. package/workspace/lib/report-chat.js +2 -0
  29. package/workspace/lib/routes-board-publish.js +7 -2
  30. package/workspace/lib/routes-boards.js +18 -5
  31. package/workspace/lib/routes-briefing-premium.js +16 -2
  32. package/workspace/lib/routes-forecast.js +8 -1
  33. package/workspace/lib/routes-insight-moves.js +7 -5
  34. package/workspace/lib/routes-news.js +3 -1
  35. package/workspace/lib/routes-workflows.js +13 -0
  36. package/workspace/lib/wf-bridge.js +165 -0
  37. package/workspace/package-lock.json +2 -2
  38. package/workspace/package.json +1 -1
  39. package/workspace/panels-test.js +1 -2
  40. package/workspace/public/pm/bd-fc-card.js +45 -0
  41. package/workspace/public/pm/bd-next.js +1 -1
  42. package/workspace/public/pm/bd-publish.css +22 -18
  43. package/workspace/public/pm/bd-publish.js +57 -48
  44. package/workspace/public/pm/bd-shared.css +92 -30
  45. package/workspace/public/pm/bd-shared.js +143 -55
  46. package/workspace/public/pm/bd-span.js +27 -7
  47. package/workspace/public/pm/cozy-board.css +15 -0
  48. package/workspace/public/pm/cozy-ev.css +46 -0
  49. package/workspace/public/pm/cozy-home.css +4 -4
  50. package/workspace/public/pm/cozy-insights.css +21 -0
  51. package/workspace/public/pm/cozy-jl.js +158 -0
  52. package/workspace/public/pm/cozy-news.js +56 -2
  53. package/workspace/public/pm/cozy-panels.js +3 -2
  54. package/workspace/public/pm/cozy-settings.js +11 -7
  55. package/workspace/public/pm/cozy-today.css +3 -0
  56. package/workspace/public/pm/cozy-viewer.js +19 -3
  57. package/workspace/public/pm/goal-forecast.js +101 -0
  58. package/workspace/public/pm/hi-pop.css +16 -0
  59. package/workspace/public/pm/home-app.js +11 -4
  60. package/workspace/public/pm/home-day.js +5 -3
  61. package/workspace/public/pm/home-list.js +14 -4
  62. package/workspace/public/pm/home-mentions.js +5 -0
  63. package/workspace/public/pm/home-task.js +1 -1
  64. package/workspace/public/pm/home-today.js +11 -4
  65. package/workspace/public/pm/ini-view-model.js +27 -14
  66. package/workspace/public/pm/ini-view.js +1 -1
  67. package/workspace/public/pm/ini-wf-model.js +76 -19
  68. package/workspace/public/pm/ini-wf.js +69 -18
  69. package/workspace/public/pm/metric-drafts.css +9 -0
  70. package/workspace/public/pm/metric-drafts.js +2 -2
  71. package/workspace/public/pm/premium-board.js +13 -3
  72. package/workspace/public/pm/premium-insights.js +43 -6
  73. package/workspace/public/pm/premium-report-tab.js +13 -3
  74. package/workspace/public/pm/premium-vw-item.js +1 -1
  75. package/workspace/public/pm/readonly.js +1 -0
  76. package/workspace/public/pm/report-chat.js +2 -1
  77. package/workspace/public/pm/task-card.js +4 -3
  78. package/workspace/public/pm/wf-page.css +9 -0
  79. package/workspace/public/pm/wf-page.js +30 -1
  80. package/workspace/run-tests.js +10 -2
  81. package/workspace/server.js +5 -2
  82. package/workspace/test-lists/forecast-board.json +5 -0
@@ -1,16 +1,15 @@
1
1
  /* pm/bd-publish.js — the Publish popover on the Board (initiative board-publish, slice 2, page side; planning/prd/board-publish-prd.md P1 to P5; D103).
2
- * Design: prototype/board-publish/publish-popover-design.html (PM approved 2026-10-31). It makes a read-only copy of part of the Board and puts it on
3
- * the team's host through POST /api/board-publish, which is a page press: only a press here publishes, never an agent session.
2
+ * Design: batch 20 item 2 (main canvas, SbPublish): the popover opens UNDER the share icon with a caret to it (a sheet at the bottom on a phone),
3
+ * icon-only buttons with their words in tooltips. It makes a read-only copy of part of the Board and puts it on the team's host through
4
+ * POST /api/board-publish, which is a page press: only a press here publishes, never an agent session.
4
5
  *
5
- * What to share chips: this board's product, the programs that hold one of its initiatives, and any initiatives (the picker)
6
- * Team optional, typed; the host says when there is no such team (slice 4 turns it into the list of joined teams)
7
- * Password on by default with a generated one (GET /api/board-publish), the PM can change it or turn it off
8
- * Ends 1, 7 or 30 days
9
- * Link ready the link and the password, one Copy, shown once (the workspace does not keep the password)
10
- * Open links only when there are any: Republish (same link, same password) and Turn off (a second press confirms)
11
- * No host before the host address is set: one sentence and the address field. The note on the form has a Change button to set it again.
6
+ * No host "Add the board host": one field and a save icon. Nothing is sent before that.
7
+ * Ready What to share (chips) · Team (optional) · Password (on by default, generated; a new one, or off) · Ends in 1, 7 or 30 days
8
+ * · the host with a pencil to change it · the send-up icon publishes
9
+ * Link ready the link and the password, one copy icon, shown once (the workspace does not keep the password)
10
+ * Open links not listed here any more: one row "N open links" opens the Shared tab, where they are managed. Zero is silence.
12
11
  *
13
- * open(btn, { ws, board }) the popover under the button (a sheet at the bottom on a phone)
12
+ * open(btn, { ws, board }) the popover under the button
14
13
  * publishHtml(S) the popover's inside as HTML. Pure. COUNT(links) · refreshCount(btn) */
15
14
  import { pmGet, pmPost } from './http.js';
16
15
 
@@ -20,48 +19,53 @@ const svg = (d) => `<svg class="i" viewBox="0 0 24 24" aria-hidden="true">${d}</
20
19
  const LOCK = svg('<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>');
21
20
  const LINK = svg('<path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/>');
22
21
  const PLUS = svg('<path d="M12 5v14M5 12h14"/>');
22
+ const HOST = svg('<rect x="4" y="4" width="16" height="6" rx="2"/><rect x="4" y="14" width="16" height="6" rx="2"/><path d="M8 7h.01M8 17h.01"/>');
23
+ const TEAM = svg('<path d="M16 19v-1a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v1M10 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6M20 19v-1a3 3 0 0 0-2.5-3M15.5 5.2a3 3 0 0 1 0 5.6"/>');
24
+ const DICE = svg('<rect x="4" y="4" width="16" height="16" rx="3"/><circle cx="9" cy="9" r="1"/><circle cx="15" cy="15" r="1"/><circle cx="15" cy="9" r="1"/><circle cx="9" cy="15" r="1"/>');
25
+ const PEN = svg('<path d="M4 20l1-4L16 5l3 3L8 19zM14 7l3 3"/>');
26
+ const OK = svg('<path d="M5 12l5 5 9-10"/>');
27
+ const UP = svg('<path d="M12 15V4M7.5 8.5L12 4l4.5 4.5M5 14v5h14v-5"/>');
28
+ const COPY = svg('<rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V6a2 2 0 0 1 2-2h9"/>');
29
+ const MORE = svg('<path d="M9 6l6 6-6 6"/>');
30
+ /** An icon-only button: the word is its tooltip and its label. */
31
+ const ib = (icon, label, attrs, cls = '') => `<button type="button" class="bpib${cls ? ' ' + cls : ''}" aria-label="${esc(label)}" title="${esc(label)}" ${attrs}>${icon}</button>`;
23
32
  const SOON_MS = 36 * 3600 * 1000;
24
33
 
25
34
  export const COUNT = (links) => (Array.isArray(links) ? links.length : 0);
26
35
  const keyOf = (k, id) => k + ':' + id;
27
36
  const chip = (S, kind, c, extra = '') => `<button type="button" class="bpchip" data-bp-sel="${esc(keyOf(kind, c.id))}" aria-pressed="${S.sel.has(keyOf(kind, c.id))}">${esc(c.label)} <small>${extra || kind}</small></button>`;
28
37
 
29
- /** The popover's inside. S = { phase, host, days, choices, sel:Set, team, pw, pass, err, busy, made, links, off, iniOpen, copied, now } */
38
+ /** The popover's inside. S = { phase, host, days, choices, sel:Set, team, pw, pass, err, busy, made, links, iniOpen, copied, now } */
30
39
  export function publishHtml(S) {
31
40
  if (S.phase === 'loading') return '<p class="bpnote">Reading your board…</p>';
32
41
  if (!S.host) {
33
- return `<div class="bpempty"><b>Publishing needs a board host</b><p>Ask whoever runs it for its address and add it here once. Nothing is sent before that.</p></div>`
34
- + `<div class="bpfield"><label for="bpHost">Board host address</label><div class="bpinp2"><input id="bpHost" type="url" inputmode="url" spellcheck="false" autocomplete="off" placeholder="Paste the host address" value="${esc(S.hostIn || '')}"><button type="button" class="bpbtn sm pri" data-bp="savehost">Save</button></div></div>`
42
+ return `<div class="bphead"><span class="bptile">${HOST}</span><span class="bpg"><b>Add the board host</b><em>Nothing is sent before you do.</em></span></div>`
43
+ + `<div class="bpfield"><div class="bpinp2"><input id="bpHost" type="url" inputmode="url" spellcheck="false" autocomplete="off" aria-label="Board host address" placeholder="The board host address" value="${esc(S.hostIn || '')}">${ib(OK, 'Save the host', 'data-bp="savehost"', 'pri sm')}</div></div>`
35
44
  + (S.err ? `<p class="bperr" role="alert">${esc(S.err)}</p>` : '');
36
45
  }
37
- const list = S.links && S.links.length
38
- ? `<div class="bpsep"></div><div class="bpeye">Open links · ${S.links.length}</div>` + S.links.map((l) => {
39
- const soon = S.now && l.ends && Date.parse(l.ends) - S.now < SOON_MS;
40
- return `<div class="bprow">${LOCK}<span class="bpg"><b>${esc(l.name || 'Board')}</b><em${soon ? ' class="soon"' : ''}>${l.team ? esc(l.team) + ' · ' : ''}ends ${esc(day(l.ends))}${l.views ? ' · ' + l.views + (l.views === 1 ? ' view' : ' views') : ''}</em></span>`
41
- + `<button type="button" class="bpbtn sm" data-bp-re="${esc(l.id)}"${S.busy ? ' disabled' : ''}>Republish</button>`
42
- + `<button type="button" class="bpbtn sm bad${S.off === l.id ? ' sure' : ''}" data-bp-off="${esc(l.id)}">${S.off === l.id ? 'Sure? Turn off' : 'Turn off'}</button></div>`;
43
- }).join('') : '';
46
+ // the open links are managed on the Shared tab: one row points there (zero is silence)
47
+ const n = COUNT(S.links);
48
+ const toShared = n ? `<button type="button" class="bpshared" data-bp="shared"><i class="cz-dot risk"></i><span class="bpg">${n} open ${n === 1 ? 'link' : 'links'}</span>${MORE}</button>` : '';
44
49
  if (S.made) {
45
50
  return `<div class="bpeye">Link ready</div><div class="bplnk"><div class="bpline">${LINK}<code>${esc(S.made.url)}</code></div>`
46
- + (S.made.pass ? `<div class="bpline">${LOCK}<code>${esc(S.made.pass)}</code></div>` : '')
47
- + `<div class="bpact"><button type="button" class="bpbtn pri" data-bp="copy">${S.made.pass ? 'Copy link and password' : 'Copy link'}</button><span class="bpok" role="status">${esc(S.copied || '')}</span></div></div>`
48
- + `<p class="bpnote">${esc(S.made.name)}${S.made.team ? ' · for the ' + esc(S.made.team) + ' team' : ''} · ends ${esc(day(S.made.ends))}.${S.made.pass ? ' Send the password in a different message. This is the only time it is shown.' : ''}</p>`
49
- + `<button type="button" class="bpbtn bpgo" data-bp="done">Done</button>` + list;
51
+ + (S.made.pass ? `<div class="bpline">${LOCK}<code>${esc(S.made.pass)}</code></div>` : '') + '</div>'
52
+ + `<div class="bpfoot"><span class="bpnote bpg">${esc(S.made.name)}${S.made.team ? ' · for the ' + esc(S.made.team) + ' team' : ''} · ends ${esc(day(S.made.ends))}.${S.made.pass ? ' Send the password in another message. It is shown once.' : ''}</span>`
53
+ + ib(COPY, S.copied || (S.made.pass ? 'Copy link and password' : 'Copy link'), 'data-bp="copy"', 'pri big') + '</div>'
54
+ + `<span class="vh" role="status">${esc(S.copied || '')}</span>` + toShared;
50
55
  }
51
56
  const c = S.choices || { products: [], programs: [], initiatives: [] };
52
57
  const picked = c.initiatives.filter((i) => S.sel.has(keyOf('initiative', i.id)));
53
58
  const chips = c.products.map((p) => chip(S, 'product', p)).join('') + c.programs.map((p) => chip(S, 'program', p)).join('') + picked.map((i) => chip(S, 'initiative', i)).join('')
54
- + (c.initiatives.length ? `<button type="button" class="bpchip add" data-bp="ini" aria-expanded="${!!S.iniOpen}">${PLUS}An initiative</button>` : '');
59
+ + (c.initiatives.length ? `<button type="button" class="bpchip add" data-bp="ini" aria-expanded="${!!S.iniOpen}">${PLUS}Initiative</button>` : '');
55
60
  const menu = S.iniOpen ? `<div class="bpmenu" role="menu">${c.initiatives.filter((i) => !S.sel.has(keyOf('initiative', i.id))).map((i) => `<button type="button" role="menuitem" data-bp-add="${esc(i.id)}">${esc(i.label)}</button>`).join('') || '<p class="bpnote">Every initiative is picked.</p>'}</div>` : '';
56
61
  return `<div class="bpeye">What to share</div><div class="bpchips">${chips}</div>${menu}`
57
- + `<div class="bpfield"><label for="bpTeam">Team</label><input id="bpTeam" class="bpinp" type="text" maxlength="40" autocomplete="off" placeholder="None" value="${esc(S.team)}"></div>`
58
- + `<div class="bpline2">${LOCK}<span class="bpg">Password</span><button type="button" class="bpsw" role="switch" aria-checked="${S.pw}" aria-label="Password" data-bp="pw"></button></div>`
59
- + (S.pw ? `<div class="bpfield"><div class="bpinp2"><input id="bpPass" type="text" spellcheck="false" autocomplete="off" aria-label="Password" value="${esc(S.pass)}"><button type="button" class="bpbtn sm" data-bp="newpw">New</button></div></div>` : '')
60
- + `<div class="bpline2"><span class="bpg">Ends</span><div class="bpseg" role="group" aria-label="Link ends after">${[1, 7, 30].map((d) => `<button type="button" data-bp-days="${d}" aria-pressed="${S.days === d}">${d === 1 ? '1 day' : d + ' days'}</button>`).join('')}</div></div>`
61
- + `<p class="bpnote">Sends a read-only copy of today's board to ${esc(S.host)}. It holds titles, stages, dates, owners and task names. <button type="button" class="bplink" data-bp="changehost">Change</button></p>`
62
+ + `<div class="bpfield"><div class="bpinp2">${TEAM}<input id="bpTeam" type="text" maxlength="40" autocomplete="off" aria-label="Team" placeholder="Team (optional)" value="${esc(S.team)}"></div></div>`
63
+ + `<div class="bpfield"><div class="bpinp2">${LOCK}${S.pw ? `<input id="bpPass" type="text" spellcheck="false" autocomplete="off" aria-label="Password" value="${esc(S.pass)}">${ib(DICE, 'New password', 'data-bp="newpw"', 'gh sm')}` : '<span class="bpg bpoff">No password</span>'}<button type="button" class="bpsw" role="switch" aria-checked="${S.pw}" aria-label="Password" title="Password" data-bp="pw"></button></div></div>`
64
+ + `<div class="bpline2"><span class="bpnote">Ends in</span><div class="bpseg" role="group" aria-label="Link ends after (days)">${[1, 7, 30].map((d) => `<button type="button" data-bp-days="${d}" aria-pressed="${S.days === d}" aria-label="${d === 1 ? '1 day' : d + ' days'}">${d}</button>`).join('')}</div><span class="bpnote">days</span></div>`
62
65
  + (S.err ? `<p class="bperr" role="alert">${esc(S.err)}</p>` : '')
63
- + `<button type="button" class="bpbtn pri bpgo" data-bp="make"${S.busy || !S.sel.size ? ' disabled' : ''}>${S.busy ? 'Publishing…' : 'Publish'}</button>`
64
- + (S.busy ? '<p class="bpnote" role="status">Checking for secrets, then sending…</p>' : '') + list;
66
+ + `<div class="bpfoot"><span class="bpnote bpg bphost" title="Sends a read-only copy of today's board to this host. It holds titles, stages, dates, owners and task names.">${HOST}<span class="bphn">${esc(S.host)}</span>${ib(PEN, 'Change the host', 'data-bp="changehost"', 'gh xs')}</span>`
67
+ + ib(UP, S.busy ? 'Publishing…' : 'Publish', `data-bp="make"${S.busy || !S.sel.size ? ' disabled' : ''}`, 'pri big') + '</div>'
68
+ + (S.busy ? '<p class="bpnote" role="status">Checking for secrets, then sending…</p>' : '') + toShared;
65
69
  }
66
70
 
67
71
  function css() {
@@ -82,18 +86,33 @@ export async function refreshCount(btn) {
82
86
 
83
87
  export function open(btn, ctx) {
84
88
  const old = document.querySelector('.bppop');
85
- if (old) { old.remove(); btn.setAttribute('aria-expanded', 'false'); return; }
89
+ if (old) { old.__close ? old.__close(false) : old.remove(); btn.setAttribute('aria-expanded', 'false'); return; }
86
90
  css();
87
- const S = { phase: 'loading', host: null, days: 7, choices: null, sel: new Set(), team: '', pw: true, pass: '', err: '', busy: false, made: null, links: [], off: null, iniOpen: false, copied: '', now: Date.now() };
91
+ const S = { phase: 'loading', host: null, days: 7, choices: null, sel: new Set(), team: '', pw: true, pass: '', err: '', busy: false, made: null, links: [], iniOpen: false, copied: '', now: Date.now() };
88
92
  const m = document.createElement('div');
89
93
  m.className = 'bppop'; m.setAttribute('role', 'dialog'); m.setAttribute('aria-label', 'Publish a read-only copy of the board'); m.dataset.escLayer = '1';
94
+ m.innerHTML = '<span class="bpcaret" aria-hidden="true"></span><div class="bpbody"></div>';
95
+ const body = m.querySelector('.bpbody');
96
+ // under the share icon, its right edge on the icon's and inside the window; the caret points at the icon. A phone takes the sheet in the CSS.
97
+ const place = () => {
98
+ if (!m.isConnected) return;
99
+ if (matchMedia('(max-width: 640px)').matches) { m.style.left = ''; m.style.top = ''; return; }
100
+ const r = btn.getBoundingClientRect(); const w = m.offsetWidth;
101
+ const left = Math.round(Math.max(16, Math.min(window.innerWidth - w - 16, r.right + 8 - w)));
102
+ const pos = left + ',' + Math.round(r.bottom) + ',' + w; if (pos === m.__pos) return; m.__pos = pos;
103
+ m.style.left = left + 'px'; m.style.top = Math.round(r.bottom + 10) + 'px';
104
+ m.style.setProperty('--bp-caret', Math.round(Math.max(12, Math.min(w - 26, r.left + r.width / 2 - left - 7))) + 'px');
105
+ };
106
+ // the toolbar can still move after the popover opens (icons arrive as the Board loads): follow the icon every frame while open
107
+ const follow = () => { if (!m.isConnected) return; place(); requestAnimationFrame(follow); };
90
108
  const close = (focus) => { document.removeEventListener('keydown', onKey, true); document.removeEventListener('pointerdown', onOut, true); m.remove(); btn.setAttribute('aria-expanded', 'false'); if (focus) btn.focus(); };
109
+ m.__close = close;
91
110
  const onKey = (e) => { if (e.key === 'Escape' && m.isConnected) { e.stopPropagation(); close(true); } };
92
111
  const onOut = (e) => { if (m.isConnected && !m.contains(e.target) && !btn.contains(e.target)) close(false); };
93
112
  const draw = (focus) => {
94
113
  const keep = { team: m.querySelector('#bpTeam'), pass: m.querySelector('#bpPass'), host: m.querySelector('#bpHost') };
95
114
  if (keep.team) S.team = keep.team.value; if (keep.pass) S.pass = keep.pass.value; if (keep.host) S.hostIn = keep.host.value;
96
- m.innerHTML = publishHtml(S);
115
+ body.innerHTML = publishHtml(S); place();
97
116
  const f = focus && m.querySelector(focus); if (f) f.focus();
98
117
  };
99
118
  const load = async () => {
@@ -111,6 +130,7 @@ export function open(btn, ctx) {
111
130
  if (b.dataset.bpDays) { S.days = Number(b.dataset.bpDays); return draw(`[data-bp-days="${S.days}"]`); }
112
131
  if (b.dataset.bpAdd) { S.sel.add(keyOf('initiative', b.dataset.bpAdd)); S.iniOpen = false; return draw('[data-bp="ini"]'); }
113
132
  const act = b.dataset.bp;
133
+ if (act === 'shared') { close(false); const t = document.getElementById('chShared'); const tab = t && t.offsetParent ? t : document.getElementById('tabShared'); if (tab) tab.click(); return; }
114
134
  if (act === 'changehost') { S.host = null; S.hostIn = ''; S.err = ''; return draw('#bpHost'); }
115
135
  if (act === 'savehost') {
116
136
  const v = ((m.querySelector('#bpHost') || {}).value || '').trim(); S.hostIn = v; S.err = '';
@@ -121,7 +141,6 @@ export function open(btn, ctx) {
121
141
  if (act === 'ini') { S.iniOpen = !S.iniOpen; return draw('[data-bp="ini"]'); }
122
142
  if (act === 'pw') { S.pw = !S.pw; return draw('[data-bp="pw"]'); }
123
143
  if (act === 'newpw') { const r = await pmGet('/api/board-publish').catch(() => null); if (r && r.ok) S.pass = r.password; return draw('#bpPass'); }
124
- if (act === 'done') { S.made = null; S.err = ''; S.copied = ''; S.pass = ''; return load(); }
125
144
  if (act === 'copy') {
126
145
  const text = S.made.pass ? S.made.url + '\nPassword: ' + S.made.pass : S.made.url;
127
146
  try { await navigator.clipboard.writeText(text); S.copied = 'Copied'; } catch { S.copied = 'Select the text and copy it'; }
@@ -135,18 +154,8 @@ export function open(btn, ctx) {
135
154
  if (r && r.ok) { const l = (await pmGet('/api/board-publish').catch(() => null)) || {}; S.links = l.links || S.links; S.made = { url: r.url, pass: S.pw ? S.pass : '', ends: r.ends, team: S.team.trim(), name: (S.links.find((x) => x.id === r.id) || {}).name || 'Board' }; S.pass = ''; S.err = ''; draw('[data-bp="copy"]'); return refreshCount(btn); }
136
155
  S.err = (r && r.error) || 'The workspace did not answer. Try again.'; return draw();
137
156
  }
138
- if (b.dataset.bpRe) {
139
- S.busy = true; S.err = ''; draw(); const r = await pmPost('/api/board-publish/republish', { id: b.dataset.bpRe, view: ctx.view }).catch(() => null); S.busy = false;
140
- S.err = r && r.ok ? '' : (r && r.error) || 'The workspace did not answer. Try again.'; const l = await pmGet('/api/board-publish').catch(() => null); if (l && l.ok) S.links = l.links; return draw();
141
- }
142
- if (b.dataset.bpOff) {
143
- if (S.off !== b.dataset.bpOff) { S.off = b.dataset.bpOff; return draw(`[data-bp-off="${CSS.escape(S.off)}"]`); }
144
- const r = await pmPost('/api/board-publish/off', { id: S.off }).catch(() => null);
145
- if (r && r.ok) S.links = S.links.filter((x) => x.id !== S.off); else S.err = (r && r.error) || 'The link could not be turned off.';
146
- S.off = null; draw(); return refreshCount(btn);
147
- }
148
157
  };
149
- btn.parentElement.appendChild(m); btn.setAttribute('aria-expanded', 'true');
158
+ document.body.appendChild(m); btn.setAttribute('aria-expanded', 'true');
150
159
  document.addEventListener('keydown', onKey, true); document.addEventListener('pointerdown', onOut, true);
151
- draw(); load();
160
+ draw(); load(); requestAnimationFrame(follow);
152
161
  }
@@ -1,32 +1,94 @@
1
- /* pm/bd-shared.css — the Shared tab of the Board (pm/bd-shared.js). The chips row, the table, the pills, the avatars and the buttons are the Board's own
2
- * (cozy-board.css: .bd-dchips, .bd-dtw, .bd-dt, .bd-pill, .bd-av, .bd-btn); this file only sets the columns of the table and the join form. */
3
- #cShared .bd-dt { grid-template-columns: 40px minmax(0, 1.5fr) 96px 96px minmax(0, 1fr) 84px 70px 130px 190px; }
4
- #cShared .bd-dby { display: flex; gap: 6px; justify-content: flex-end; overflow: visible; }
5
- #cShared .bdsh-gone { opacity: .5; }
6
- #cShared .bdsh-plain, #cShared .bdsh-plain:hover { cursor: default; color: var(--cz-ink); font-weight: 600; } /* a name that cannot be pressed does not look like a link */
7
- #cShared .bdsh-cards { display: none; }
8
- #cShared .bd-btn.on { border-color: var(--bad); color: var(--bad); }
9
- #cShared .bdsh-join { display: grid; gap: 12px; padding: 22px 8px 14px; justify-items: start; max-width: 560px; }
10
- #cShared .bdsh-join > b { font-size: var(--fs-4); font-weight: 800; }
11
- #cShared .bdsh-join p { margin: 0; }
12
- #cShared .bdsh-fr { display: flex; gap: 8px; width: 100%; max-width: 520px; }
13
- #cShared .bdsh-in { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--hair); border-radius: 12px; background: var(--card-solid); color: var(--ink); font: inherit; width: 100%; max-width: 520px; }
14
- #cShared .bdsh-fr .bdsh-in { width: auto; }
15
- #cShared .bdsh-go { min-height: 44px; background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
16
- #cShared .bdsh-go:disabled { opacity: .6; }
17
- #cShared .bdsh-alt, #cShared .bdsh-lk { border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; min-height: 36px; padding: 0 2px; }
18
- #cShared .bdsh-fine { font-size: var(--fs-1); margin: 8px 4px 0; }
19
- #cShared .bdsh-pad { padding: 24px 8px; margin: 0; max-width: 560px; }
20
- #cShared .bdsh-ban { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 16px; margin: 8px 0; border: 1px solid var(--hair); border-radius: 14px; background: var(--card-solid); }
21
- #cShared .bdsh-ban > span { flex: 1 1 240px; min-width: 0; }
22
- #cShared .bdsh-tl { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
23
- #cShared :focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
1
+ /* pm/bd-shared.css — the Shared tab of the Board (pm/bd-shared.js). Design: batch 20 item 2, agreed A2 (SbList, SbStates, SbLink): one card per
2
+ * board in a column that fits the screen, icon-only buttons, a popover under the plus to join a team. The chips are the Board's own .bd-chip. */
3
+ #cShared .bdsh-col { max-width: 880px; margin: 0 auto; padding: 8px 0 24px; }
4
+ #cShared .bdsh-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
5
+ #cShared .bdsh-chip { height: 36px; padding: 0 14px; }
6
+ #cShared .bdsh-chip.on { background: var(--cz-bluebg); border-color: var(--cz-blue); color: var(--cz-blueink); }
7
+ #cShared .bdsh-plusw { position: relative; display: inline-flex; }
8
+
9
+ /* icon-only buttons: 44 px, 36 px small; ghost, primary, bad (red icon) and danger (red fill, the confirm) */
10
+ #cShared .bdsh-ib { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; cursor: pointer; font: inherit; }
11
+ #cShared .bdsh-ib svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
12
+ #cShared .bdsh-ib:hover { background: var(--cz-well); }
13
+ #cShared .bdsh-ib.s { width: 36px; height: 36px; }
14
+ #cShared .bdsh-ib.gh { background: transparent; border-color: transparent; }
15
+ #cShared .bdsh-ib.gh:hover { background: var(--cz-well); }
16
+ #cShared .bdsh-ib.pri { background: var(--cz-solid); border-color: var(--cz-solid); color: var(--cz-onsolid); }
17
+ #cShared .bdsh-ib.plus { background: var(--cz-bluebg); border-color: var(--cz-blue); color: var(--cz-blueink); }
18
+ #cShared .bdsh-ib.bad { color: var(--cz-red); }
19
+ #cShared .bdsh-ib.danger { background: var(--cz-red); border-color: var(--cz-red); color: var(--cz-onsolid); }
20
+ #cShared .bdsh-ib:disabled { opacity: .55; cursor: default; }
21
+ #cShared .bdsh-vr { width: 1px; height: 22px; background: var(--cz-hair); margin: 0 4px; flex: none; }
22
+
23
+ /* a board: one card row */
24
+ #cShared .bdsh-list { display: grid; gap: 10px; }
25
+ #cShared .bdsh-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 18px; }
26
+ #cShared .bdsh-card.sure { border-color: var(--cz-red); }
27
+ #cShared .bdsh-gone { opacity: .5; margin-top: 10px; }
28
+ #cShared .bdsh-tile { width: 40px; height: 40px; border-radius: 12px; background: var(--cz-well); color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
29
+ #cShared .bdsh-tile svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
30
+ #cShared .bdsh-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
31
+ #cShared .bdsh-nm { font-size: var(--fs-4); font-weight: 800; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
32
+ #cShared .bdsh-plain { cursor: default; color: var(--cz-ink); }
33
+ #cShared .bdsh-meta { font-size: var(--fs-2); color: var(--cz-ink3); }
34
+ #cShared .bdsh-warn { color: var(--cz-red); font-weight: 700; }
35
+ #cShared .bdsh-end { font-size: var(--fs-2); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--cz-ink2); }
36
+ #cShared .bdsh-end.soon { color: var(--cz-risk); }
37
+ #cShared .bdsh-act { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
38
+ #cShared .bdsh-fold { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin: 6px 0 0; padding: 0 4px; border: 0; background: none; color: var(--cz-ink3); font: 700 var(--fs-2) var(--cz-sans); cursor: pointer; }
39
+ #cShared .bdsh-fold svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
40
+ #cShared .bdsh-fold[aria-expanded="true"] svg { transform: rotate(90deg); }
41
+ #cShared .bdsh-read { display: flex; align-items: center; gap: 6px; margin: 18px 4px 0; font-size: var(--fs-1); }
42
+ #cShared .bdsh-pad { padding: 24px 4px; margin: 0; }
43
+
44
+ /* a team that cannot be read, and the selected team's line */
45
+ #cShared .bdsh-ban, #cShared .bdsh-tl { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; margin: 0 0 10px; background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 18px; }
46
+ #cShared .bdsh-bt, #cShared .bdsh-tl > .bdsh-meta { flex: 1; min-width: 0; font-size: var(--fs-3); }
47
+ #cShared .bdsh-tl { background: transparent; border-color: transparent; padding: 0 0 0 4px; }
48
+
49
+ /* popovers: join under the plus, the new password under the key */
50
+ #cShared .bdsh-pop { position: absolute; z-index: 20; top: calc(100% + 10px); background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 20px; box-shadow: var(--cz-lift, 0 14px 40px rgb(20 24 40 / .14)); padding: 16px; display: grid; gap: 10px; text-align: left; }
51
+ #cShared .bdsh-pop::before { content: ''; position: absolute; top: -8px; width: 14px; height: 14px; background: var(--cz-card); border-left: 1px solid var(--cz-hair); border-top: 1px solid var(--cz-hair); transform: rotate(45deg); }
52
+ #cShared .bdsh-joinpop { left: -16px; width: min(380px, calc(100vw - 32px)); }
53
+ #cShared .bdsh-joinpop::before { left: 27px; }
54
+ #cShared .bdsh-pwpop { right: 96px; width: min(360px, calc(100vw - 32px)); }
55
+ #cShared .bdsh-pwpop::before { right: 50px; }
56
+ #cShared .bdsh-ph { display: flex; align-items: center; gap: 8px; }
57
+ #cShared .bdsh-ph b { flex: 1; font-size: var(--fs-4); font-weight: 800; }
58
+ #cShared .bdsh-cap { font: 800 12px var(--cz-sans); letter-spacing: .04em; text-transform: uppercase; color: var(--cz-ink3); }
59
+ #cShared .bdsh-pend { display: flex; justify-content: flex-end; }
60
+ #cShared .bdsh-pop p { margin: 0; }
61
+
62
+ /* fields: one rounded field with its buttons inside */
63
+ #cShared .bdsh-fld { display: flex; align-items: center; gap: 6px; min-height: 44px; border: 1px solid var(--cz-hair); border-radius: 22px; background: var(--cz-card); padding: 0 4px 0 14px; color: var(--cz-ink3); }
64
+ #cShared .bdsh-fld.bad { border-color: var(--cz-red); }
65
+ #cShared .bdsh-fld.ro { background: var(--cz-well); }
66
+ #cShared .bdsh-fld svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
67
+ #cShared .bdsh-fld .bdsh-in { border: 0; padding: 0; min-height: 40px; background: transparent; }
68
+ #cShared .bdsh-in { flex: 1; min-width: 0; width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--cz-hair); border-radius: 22px; background: var(--cz-card); color: var(--cz-ink); font: inherit; font-size: var(--fs-3); outline: 0; }
69
+ #cShared .bdsh-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cz-ink); font: 700 var(--fs-3) var(--cz-mono); }
70
+ #cShared .bdsh-typed { display: grid; gap: 8px; }
71
+ #cShared .bdsh-err { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--cz-red); font-weight: 700; font-size: var(--fs-1); }
72
+ #cShared .bdsh-lk { justify-self: start; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; min-height: 36px; padding: 0 2px; }
73
+ #cShared .bdsh-fine { display: flex; align-items: center; gap: 6px; font-size: var(--fs-1); margin: 0; }
74
+ #cShared .bdsh-fine svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
75
+
76
+ /* first run: the calm face, one sentence, the invite field */
77
+ #cShared .bdsh-first { max-width: 420px; margin: 24px auto; padding: 28px 24px; background: var(--cz-card); border: 1px solid var(--cz-hair); border-radius: 18px; display: grid; justify-items: center; gap: 14px; text-align: center; }
78
+ #cShared .bdsh-big { margin: 0; font-size: var(--fs-5); font-weight: 800; }
79
+ #cShared .bdsh-form { width: 100%; display: grid; gap: 8px; text-align: left; }
80
+ #cShared :focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
81
+
82
+ /* a phone: the name and the end date on one line, the meta under it, the icons on the right below */
24
83
  @media (max-width: 720px) {
25
- #cShared .bdsh-table { display: none; }
26
- #cShared .bdsh-cards { display: block; }
27
- #cShared .bdsh-card { padding: 10px 4px; border-bottom: 1px solid var(--hair); display: grid; gap: 2px; }
28
- #cShared .bdsh-l1 { display: flex; gap: 8px; align-items: baseline; }
29
- #cShared .bdsh-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
30
- #cShared .bdsh-act { display: flex; gap: 8px; padding-top: 6px; }
31
- #cShared .bdsh-fr { flex-wrap: wrap; }
84
+ #cShared .bdsh-card { flex-wrap: wrap; align-items: flex-start; gap: 4px 8px; padding: 12px; }
85
+ #cShared .bdsh-tile { display: none; }
86
+ #cShared .bdsh-nm { font-size: 16px; }
87
+ #cShared .bdsh-meta { font-size: var(--fs-1); }
88
+ #cShared .bdsh-end { font-size: var(--fs-1); padding-top: 2px; }
89
+ #cShared .bdsh-act { flex: 1 0 100%; justify-content: flex-end; margin: 2px 0 0; }
90
+ #cShared .bdsh-act.open { display: none; } /* on a phone the name opens a team's board (SbStates): no lone icon row */
91
+ #cShared .bdsh-pwpop { left: 0; right: 0; width: auto; top: auto; bottom: calc(100% + 6px); }
92
+ #cShared .bdsh-pwpop::before { display: none; }
93
+ #cShared .bdsh-first { margin: 8px auto; }
32
94
  }