create-pmos 0.475.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 (90) hide show
  1. package/package.json +33 -33
  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 +32 -0
  9. package/workspace/guide/briefing-premium.md +2 -2
  10. package/workspace/guide/claude-proposes.md +8 -2
  11. package/workspace/guide/forecast.md +16 -3
  12. package/workspace/guide/home.md +2 -2
  13. package/workspace/guide/settings.md +9 -0
  14. package/workspace/guide/workflows.md +13 -2
  15. package/workspace/home-railcard-test.js +4 -4
  16. package/workspace/home-rows-test.js +15 -4
  17. package/workspace/ini-workflow-test.js +1 -1
  18. package/workspace/lib/board-pack.js +20 -1
  19. package/workspace/lib/board-trail.js +17 -1
  20. package/workspace/lib/boards-host.js +22 -2
  21. package/workspace/lib/briefing-premium-agent.js +2 -2
  22. package/workspace/lib/engine/boards.js +15 -3
  23. package/workspace/lib/engine/workflows.js +79 -10
  24. package/workspace/lib/forecast-offer.js +57 -0
  25. package/workspace/lib/grill-runs.js +1 -0
  26. package/workspace/lib/grill.js +1 -1
  27. package/workspace/lib/insight-moves.js +8 -6
  28. package/workspace/lib/news-for-you.js +6 -4
  29. package/workspace/lib/proposals.js +4 -3
  30. package/workspace/lib/report-chat.js +2 -0
  31. package/workspace/lib/route-modules.js +1 -0
  32. package/workspace/lib/routes-board-publish.js +7 -2
  33. package/workspace/lib/routes-boards.js +18 -5
  34. package/workspace/lib/routes-briefing-premium.js +16 -2
  35. package/workspace/lib/routes-forecast.js +8 -1
  36. package/workspace/lib/routes-grill.js +70 -0
  37. package/workspace/lib/routes-insight-moves.js +7 -5
  38. package/workspace/lib/routes-news.js +3 -1
  39. package/workspace/lib/routes-proposals.js +8 -6
  40. package/workspace/lib/routes-workflows.js +13 -0
  41. package/workspace/lib/wf-bridge.js +165 -0
  42. package/workspace/package-lock.json +2 -2
  43. package/workspace/package.json +1 -1
  44. package/workspace/panels-test.js +1 -2
  45. package/workspace/public/pm/bd-fc-card.js +45 -0
  46. package/workspace/public/pm/bd-next.js +1 -1
  47. package/workspace/public/pm/bd-publish.css +22 -18
  48. package/workspace/public/pm/bd-publish.js +57 -48
  49. package/workspace/public/pm/bd-shared.css +92 -30
  50. package/workspace/public/pm/bd-shared.js +143 -55
  51. package/workspace/public/pm/bd-span.js +27 -7
  52. package/workspace/public/pm/cozy-board.css +15 -0
  53. package/workspace/public/pm/cozy-ev.css +52 -0
  54. package/workspace/public/pm/cozy-home.css +4 -4
  55. package/workspace/public/pm/cozy-insights.css +23 -0
  56. package/workspace/public/pm/cozy-jl.js +158 -0
  57. package/workspace/public/pm/cozy-news.js +56 -2
  58. package/workspace/public/pm/cozy-panels.js +3 -2
  59. package/workspace/public/pm/cozy-settings.js +35 -7
  60. package/workspace/public/pm/cozy-today.css +6 -0
  61. package/workspace/public/pm/cozy-viewer.js +19 -3
  62. package/workspace/public/pm/goal-forecast.js +101 -0
  63. package/workspace/public/pm/grill-words.js +53 -0
  64. package/workspace/public/pm/hi-pop.css +16 -0
  65. package/workspace/public/pm/home-app.js +42 -5
  66. package/workspace/public/pm/home-day.js +5 -3
  67. package/workspace/public/pm/home-list.js +14 -4
  68. package/workspace/public/pm/home-mentions.js +5 -0
  69. package/workspace/public/pm/home-task.js +1 -1
  70. package/workspace/public/pm/home-today.js +14 -5
  71. package/workspace/public/pm/ini-props.js +41 -8
  72. package/workspace/public/pm/ini-view-model.js +27 -14
  73. package/workspace/public/pm/ini-view.css +62 -37
  74. package/workspace/public/pm/ini-view.js +1 -1
  75. package/workspace/public/pm/ini-wf-model.js +76 -19
  76. package/workspace/public/pm/ini-wf.js +69 -18
  77. package/workspace/public/pm/metric-drafts.css +9 -0
  78. package/workspace/public/pm/metric-drafts.js +2 -2
  79. package/workspace/public/pm/premium-board.js +13 -3
  80. package/workspace/public/pm/premium-insights.js +86 -11
  81. package/workspace/public/pm/premium-report-tab.js +13 -3
  82. package/workspace/public/pm/premium-vw-item.js +1 -1
  83. package/workspace/public/pm/readonly.js +1 -0
  84. package/workspace/public/pm/report-chat.js +2 -1
  85. package/workspace/public/pm/task-card.js +4 -3
  86. package/workspace/public/pm/wf-page.css +9 -0
  87. package/workspace/public/pm/wf-page.js +30 -1
  88. package/workspace/run-tests.js +10 -2
  89. package/workspace/server.js +5 -2
  90. package/workspace/test-lists/forecast-board.json +5 -0
@@ -1,26 +1,50 @@
1
1
  /* pm/bd-shared.js — the Shared tab of the Board (initiative board-publish, slice 4; planning/prd/board-publish-prd.md T1 to T6; D103).
2
- * Design: prototype/board-publish/shared-view-design.html (drawn inside the real Board; PM approved 2026-10-31). It is the Documents tab's own pattern:
3
- * a chips row, the button on the right, and the Board's .bd-dtw table with pills and avatars (a card per row on a phone).
2
+ * Design: batch 20 item 2, agreed A2 (main canvas, In development: SbList, SbStates, SbLink). One card per board in a column that fits the screen,
3
+ * with icon-only buttons (the words are in each button's tooltip and label):
4
4
  *
5
- * All · Yours · one chip per joined team Yours only when you have open links. A team's chip shows its count, or no count when it cannot be read.
6
- * a board a press opens that copy in a new browser tab, signed in (POST /api/board-publish/open: a one-time address)
7
- * Yours Republish (same link, same password) and Turn off (a second press confirms)
8
- * a team that cannot be read one line in its place (password changed, locked, host down): the other teams still draw, and no old rows
9
- * a team selected Refresh · Paste a new invite link · Leave team (a second press; forgets only the password on this computer)
10
- * nothing joined one sentence and one field for the invite link; "type the team name and password instead" is the second way
5
+ * chips All · Yours · one per joined team, then a plus that opens Join a team as a small popover under it
6
+ * a board a press on its name opens that copy in a new browser tab, signed in (POST /api/board-publish/open: a one-time address)
7
+ * not yours the open icon (the same as pressing the name)
8
+ * yours copy link · key (a new password from the host, shown once; the old one stops) | Republish (send up) · Turn off (power)
9
+ * Turn off asks once in the row: a red line, ✕ keeps it, the red power confirms
10
+ * a zero is not drawn (no "0 views"); ended boards fold into "N ended"
11
+ * a team not read one line in its place with a key (paste a new invite) or a refresh icon; the other teams still draw, and no old rows
12
+ * a team selected paste a new invite link · leave team (asks once; forgets only the password on this computer)
13
+ * first run the calm face, one sentence and the invite field; the key icon switches to team name and password
11
14
  *
12
15
  * Reads: GET /api/board-publish (local: your links and the team names, no host is asked) for the number on the tab at load;
13
16
  * GET /api/board-publish/shared (reads each joined team's host now) when the tab opens and on Refresh. Nothing is polled and nothing from a read is kept.
17
+ * A new password lives only in this tab's memory until Done or the next draw that closes it: it is never stored.
14
18
  * loadCount(cb) cb(n): the number of your own open links, from this computer only
15
19
  * show(el, { onCount }) draw the tab into el and read the teams. onCount(n) gets the total of open copies after a read
16
20
  * viewHtml(S) the tab's inside as HTML. Pure. */
17
21
  import { pmGet, pmPost } from './http.js';
22
+ import { adler } from './cozy-adler.js';
18
23
 
19
24
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
20
- const ICON = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 4h16v16H4zM4 9h16M9 9v11"></path></svg>';
21
- const KIND = { product: 'Product', program: 'Program', initiative: 'Initiative', multi: 'Several' };
25
+ const svg = (d, px = 20) => `<svg width="${px}" height="${px}" viewBox="0 0 24 24" aria-hidden="true">${d}</svg>`;
26
+ const I = {
27
+ board: '<path d="M4 4h16v16H4zM4 9h16M9 9v11"/>',
28
+ plus: '<path d="M12 5v14M5 12h14"/>',
29
+ open: '<path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/>',
30
+ link: '<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"/>',
31
+ key: '<circle cx="8" cy="15" r="4"/><path d="M11 12l9-9M16 7l3 3"/>',
32
+ up: '<path d="M12 15V4M7.5 8.5L12 4l4.5 4.5M5 14v5h14v-5"/>',
33
+ power: '<path d="M12 3v8M6.3 6.8a8 8 0 1 0 11.4 0"/>',
34
+ x: '<path d="M6 6l12 12M18 6L6 18"/>',
35
+ go: '<path d="M5 12h14M13 6l6 6-6 6"/>',
36
+ lock: '<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',
37
+ copy: '<rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V6a2 2 0 0 1 2-2h9"/>',
38
+ done: '<path d="M5 12l5 5 9-10"/>',
39
+ more: '<path d="M9 6l6 6-6 6"/>',
40
+ refresh: '<path d="M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7"/>',
41
+ leave: '<path d="M15 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4M10 16l-4-4 4-4M6 12h10"/>',
42
+ };
43
+ const KIND = { product: 'Product', program: 'Program', initiative: 'Initiative', multi: 'Several boards' };
22
44
  const SOON = 36 * 3600 * 1000;
23
45
  const day = (iso) => { try { return new Date(iso).toLocaleDateString(undefined, { day: 'numeric', month: 'short' }); } catch { return ''; } };
46
+ /** An icon-only button: the word is its tooltip and its label (design principle: icon-only CTAs). */
47
+ const ib = (icon, label, attrs, cls = '') => `<button type="button" class="bdsh-ib${cls ? ' ' + cls : ''}" aria-label="${esc(label)}" title="${esc(label)}" ${attrs}>${svg(I[icon], /\bs\b/.test(cls) ? 18 : 20)}</button>`;
24
48
 
25
49
  export function css() {
26
50
  const href = new URL('./bd-shared.css', import.meta.url).href;
@@ -40,52 +64,83 @@ function rowsOf(S, now = S.now || Date.now()) {
40
64
  }
41
65
  const endText = (r) => (r.ended ? 'Ended' : r.soon ? 'Tomorrow' : day(r.ends));
42
66
  const agoText = (S) => { const m = Math.max(0, Math.round(((S.now || Date.now()) - Date.parse(S.readAt)) / 60000)); return m < 1 ? 'just now' : m === 1 ? 'a minute ago' : m + ' minutes ago'; };
43
- const init = (n) => esc(String(n || '?').slice(0, 2));
44
- const who = (r) => `<span class="bd-pt"><span class="bd-av" aria-hidden="true">${init(r.by)}</span><span class="bd-ell">${esc(r.by)}</span></span>`;
45
67
  const openable = (S, r) => !r.ended && (r.team ? (S.teams || []).some((t) => t.team === r.team && t.ok) || (S.names || []).includes(r.team) : false);
68
+ const views = (n) => (n ? n + (n === 1 ? ' view' : ' views') : ''); // a zero is not drawn
46
69
 
47
- function row(S, r) {
48
- const act = r.mine ? `<button type="button" class="bd-btn sm" data-sh-re="${esc(r.id)}">Republish</button><button type="button" class="bd-btn sm${S.off === r.id ? ' on' : ''}" data-sh-off="${esc(r.id)}">${S.off === r.id ? 'Sure? Turn off' : 'Turn off'}</button>` : '';
70
+ function card(S, r) {
71
+ const sure = r.mine && S.off === r.id;
72
+ const can = openable(S, r);
49
73
  const why = !r.ended && !r.team ? ' title="Opens from a team. Publish with a team name to open it here."' : ''; // a copy with no team has no password this computer keeps
50
- const nm = r.ended || !openable(S, r) ? `<span class="bd-dlink bdsh-plain" role="rowheader"${why}>${esc(r.name)}</span>` : `<button type="button" class="bd-dlink" role="rowheader" data-sh-open="${esc(r.id)}" data-sh-team="${esc(r.team)}">${esc(r.name)}</button>`;
51
- const end = `<span role="cell" class="${r.soon ? 'cs s-risk' : r.ended ? 'bd-amut' : ''}">${r.soon ? '<i class="cz-dot risk m-warn"></i>' : ''}${esc(endText(r))}</span>`;
52
- const table = `<div class="bd-dt${r.ended ? ' bdsh-gone' : ''}" role="row"><span class="bd-dic" aria-hidden="true">${ICON}</span>${nm}<span role="cell"><span class="bd-pill">${esc(KIND[r.kind] || 'Board')}</span></span><span role="cell" class="bd-amut">${esc(r.team || '—')}</span>${who(r)}<span role="cell">${esc(day(r.made))}</span><span role="cell">${r.views || 0}</span>${end}<span role="cell" class="bd-dby">${act}</span></div>`;
53
- const card = `<div class="bdsh-card${r.ended ? ' bdsh-gone' : ''}"><div class="bdsh-l1">${nm.replace('bd-dlink', 'bdsh-nm bd-dlink')}<span class="${r.soon ? 'cs s-risk' : 'bd-amut'}">${r.soon ? '<i class="cz-dot risk m-warn"></i>' : ''}${esc(endText(r))}</span></div><span class="bd-amut">${esc(KIND[r.kind] || 'Board')}${r.team ? ' · ' + esc(r.team) : ''} · ${r.mine ? 'you' : esc(r.by)} · ${esc(day(r.made))} · ${r.views || 0} views</span>${act ? `<div class="bdsh-act">${act}</div>` : ''}</div>`;
54
- return { table, card };
74
+ const nm = can ? `<button type="button" class="bdsh-nm bd-dlink" data-sh-open="${esc(r.id)}" data-sh-team="${esc(r.team)}">${esc(r.name)}</button>` : `<span class="bdsh-nm bdsh-plain"${why}>${esc(r.name)}</span>`;
75
+ const meta = sure ? '<span class="bdsh-meta bdsh-warn">Turn off this link? The copy is deleted from the host.</span>'
76
+ : `<span class="bdsh-meta">${[KIND[r.kind] || 'Board', r.mine ? '' : r.by, r.team, day(r.made), views(r.views)].filter(Boolean).map(esc).join(' · ')}</span>`;
77
+ const end = `<span class="bdsh-end${r.soon ? ' soon' : ''}">${r.soon ? '<i class="cz-dot risk m-warn"></i>' : ''}${esc(endText(r))}</span>`;
78
+ let act = '';
79
+ if (sure) act = ib('x', 'Keep it on', `data-sh-keep="${esc(r.id)}"`, 'gh') + ib('power', 'Sure, turn off', `data-sh-off="${esc(r.id)}"`, 'danger');
80
+ else if (r.mine && !r.ended) {
81
+ act = ib('link', 'Copy link', `data-sh-copy="${esc(r.id)}"`, 's gh') + ib('key', 'New password', `data-sh-pw="${esc(r.id)}" aria-expanded="${!!(S.pw && S.pw.id === r.id)}"`, 's gh')
82
+ + '<span class="bdsh-vr" aria-hidden="true"></span>' + ib('up', 'Republish', `data-sh-re="${esc(r.id)}"`) + ib('power', 'Turn off', `data-sh-off="${esc(r.id)}"`, 'bad');
83
+ } else if (can) act = ib('open', 'Open in a new tab', `data-sh-open="${esc(r.id)}" data-sh-team="${esc(r.team)}"`, 'gh');
84
+ const pop = S.pw && S.pw.id === r.id ? pwPop(S.pw) : '';
85
+ return `<div class="bdsh-card${r.ended ? ' bdsh-gone' : ''}${sure ? ' sure' : ''}" data-sh-row="${esc(r.id)}"><span class="bdsh-tile" aria-hidden="true">${svg(I.board)}</span>`
86
+ + `<div class="bdsh-txt">${nm}${meta}</div>${end}${act ? `<span class="bdsh-act${!r.mine && can ? ' open' : ''}">${act}</span>` : ''}${pop}</div>`;
55
87
  }
56
88
 
57
- function joinHtml(S) {
58
- const J = S.join || {}; const first = !(S.teams || []).length && !(S.yours || []).length;
59
- const inp = (id, ph, v, type) => `<input id="${id}" type="${type || 'text'}" class="bdsh-in" placeholder="${esc(ph)}" value="${esc(v || '')}" spellcheck="false" autocomplete="off" aria-label="${esc(ph)}">`;
89
+ /** The new password, under the key icon (SbLink): shown once, the old one already stopped. */
90
+ function pwPop(P) {
91
+ if (P.busy) return '<div class="bdsh-pop bdsh-pwpop" role="status"><p class="bdsh-meta">Asking the host for a new password…</p></div>';
92
+ if (P.err) return `<div class="bdsh-pop bdsh-pwpop" role="alert"><p class="bdsh-err"><i class="cz-dot red"></i>${esc(P.err)}</p><div class="bdsh-pend">${ib('done', 'Done', 'data-sh="pwdone"', 's')}</div></div>`;
93
+ return `<div class="bdsh-pop bdsh-pwpop" role="dialog" aria-label="New password"><span class="bdsh-cap">New password</span>`
94
+ + `<div class="bdsh-fld ro">${svg(I.lock, 18)}<code class="bdsh-t" id="shNewPw">${esc(P.password)}</code>${ib('copy', P.copied ? 'Copied' : 'Copy password', 'data-sh="pwcopy"', 's gh')}</div>`
95
+ + '<p class="bdsh-meta">The old password stops working now. Send this one in another message. It is shown once.</p>'
96
+ + `<div class="bdsh-pend">${ib('done', 'Done', 'data-sh="pwdone"', 's pri')}</div></div>`;
97
+ }
98
+
99
+ const field = (id, ph, v, type, bad) => `<input id="${id}" type="${type || 'text'}" class="bdsh-in${bad ? ' bad' : ''}" placeholder="${esc(ph)}" value="${esc(v || '')}" spellcheck="false" autocomplete="off" aria-label="${esc(ph)}">`;
100
+ /** The join form: an invite link (the key icon switches to team name and password), or the three typed fields. Used in the popover and on first run. */
101
+ function joinForm(J) {
102
+ const go = ib('go', J.busy ? 'Joining…' : 'Join', `data-sh="join"${J.busy ? ' disabled' : ''}`, 's pri');
60
103
  const body = J.typed
61
- ? `<b>Join a team</b><p class="bd-amut">Type what the person who made the team gave you.</p>${inp('shHost', 'Board host address', J.host)}${inp('shTeam', 'Team name', J.team)}<div class="bdsh-fr">${inp('shPass', 'Team password', J.password, 'password')}<button type="button" class="bd-btn bdsh-go" data-sh="join"${J.busy ? ' disabled' : ''}>${J.busy ? 'Joining…' : 'Join'}</button></div>`
62
- : `<b>${first ? 'Join a team to see its boards' : 'Join another team'}</b><p class="bd-amut">Ask whoever made the team for its invite link, then paste it here.</p><div class="bdsh-fr">${inp('shInvite', 'Paste the invite link', J.invite)}<button type="button" class="bd-btn bdsh-go" data-sh="join"${J.busy ? ' disabled' : ''}>${J.busy ? 'Joining…' : 'Join'}</button></div>`;
63
- return `<div class="bdsh-join">${body}${J.err ? `<p class="cs s-risk" role="alert"><i class="cz-dot risk m-warn"></i>${esc(J.err)}</p>` : ''}<button type="button" class="bdsh-alt" data-sh="${J.typed ? 'paste' : 'typed'}">${J.typed ? 'Paste an invite link instead' : 'Type the team name and password instead'}</button><p class="bd-amut bdsh-fine">The team and its password are kept on this computer only.</p></div>`;
104
+ ? `<div class="bdsh-typed">${field('shHost', 'Board host address', J.host)}${field('shTeam', 'Team name', J.team)}<div class="bdsh-fld">${field('shPass', 'Team password', J.password, 'password')}${go}</div></div>`
105
+ : `<div class="bdsh-fld${J.err ? ' bad' : ''}">${field('shInvite', 'Paste an invite link', J.invite)}${ib('key', 'Use team name and password', 'data-sh="typed"', 's gh')}${go}</div>`;
106
+ return body + (J.err ? `<p class="bdsh-err" role="alert"><i class="cz-dot red"></i>${esc(J.err)}</p>` : '')
107
+ + (J.typed ? '<button type="button" class="bdsh-lk" data-sh="paste">Paste an invite link instead</button>' : '');
64
108
  }
65
109
 
66
- /** The tab's inside. S = { phase, yours, teams:[{team,host,ok,links|kind,error}], names, readAt, now, sel, join, off, status, leave } */
110
+ function firstRun(S) {
111
+ const J = S.join || {};
112
+ return `<div class="bdsh-first"><span class="bdsh-face" aria-hidden="true">${adler('handled', 72, { label: false })}</span><p class="bdsh-big">Boards your teams share show up here.</p>`
113
+ + `<div class="bdsh-form">${joinForm(J)}</div><p class="bdsh-meta bdsh-fine">${svg(I.lock, 14)} Kept on this computer only.</p></div>`;
114
+ }
115
+
116
+ /** The tab's inside. S = { phase, yours, teams:[{team,host,ok,links|kind,error}], names, readAt, now, sel, join, off, leave, pw, endedOpen } */
67
117
  export function viewHtml(S) {
68
- if (S.phase === 'loading') return '<p class="bd-amut bdsh-pad">Reading the teams…</p>';
118
+ if (S.phase === 'loading') return '<p class="bdsh-meta bdsh-pad">Reading the teams…</p>';
69
119
  const teams = S.teams || []; const rows = rowsOf(S);
70
- const showJoin = S.join && S.join.open;
71
- if (!teams.length && !(S.yours || []).length) return joinHtml(Object.assign({}, S, { join: Object.assign({ open: true }, S.join) }));
120
+ if (!teams.length && !(S.yours || []).length) return `<div class="bdsh-col">${firstRun(S)}</div>`;
72
121
  const count = (f) => rows.filter((r) => !r.ended && f(r)).length;
73
122
  const sel = S.sel === 'mine' && (S.yours || []).length ? 'mine' : teams.some((t) => t.team === S.sel) ? S.sel : 'all';
74
- const chip = (k, label, n) => `<button type="button" class="bd-chip${sel === k ? ' on' : ''}" data-sh-sel="${esc(k)}" aria-pressed="${sel === k}">${esc(label)}${n ? ' ' + n : ''}</button>`;
75
- const chipsHtml = chip('all', 'All', count(() => true)) + ((S.yours || []).length ? chip('mine', 'Yours', count((r) => r.mine)) : '') + teams.map((t) => chip(t.team, t.team, t.ok ? count((r) => r.team === t.team) : 0)).join('');
123
+ const chip = (k, label, n) => `<button type="button" class="bd-chip bdsh-chip${sel === k ? ' on' : ''}" data-sh-sel="${esc(k)}" aria-pressed="${sel === k}">${esc(label)}${n ? ' ' + n : ''}</button>`;
124
+ const J = S.join || {};
125
+ const plus = `<span class="bdsh-plusw">${ib('plus', 'Join a team', `data-sh="${J.open ? 'closejoin' : 'openjoin'}" aria-haspopup="dialog" aria-expanded="${!!J.open}"`, 's plus')}`
126
+ + (J.open ? `<div class="bdsh-pop bdsh-joinpop" role="dialog" aria-label="Join a team"><div class="bdsh-ph"><b>Join a team</b>${ib('x', 'Close', 'data-sh="closejoin"', 's gh')}</div>${joinForm(J)}<p class="bdsh-meta bdsh-fine">${svg(I.lock, 14)} Kept on this computer only.</p></div>` : '') + '</span>';
127
+ const chipsHtml = chip('all', 'All', count(() => true)) + ((S.yours || []).length ? chip('mine', 'Yours', count((r) => r.mine)) : '') + teams.map((t) => chip(t.team, t.team, t.ok ? count((r) => r.team === t.team) : 0)).join('') + plus;
76
128
  const failing = teams.filter((t) => !t.ok && (sel === 'all' || sel === t.team));
77
- const banners = failing.map((t) => `<div class="bdsh-ban" role="alert"><span class="cs s-risk"><i class="cz-dot risk m-warn"></i>${esc(t.team)}: ${esc(t.error)}</span><button type="button" class="bd-btn" data-sh="${t.kind === 'password' ? 'repaste' : 'refresh'}" data-sh-team="${esc(t.team)}">${t.kind === 'password' ? 'Paste a new invite link' : 'Refresh'}</button></div>`).join('');
78
- const shown = rows.filter((r) => (sel === 'all' ? true : sel === 'mine' ? r.mine : r.team === sel)).sort((a, b) => Number(a.ended) - Number(b.ended) || (b.mine ? 1 : 0) - (a.mine ? 1 : 0) || String(b.made).localeCompare(String(a.made)));
79
- const built = shown.map((r) => row(S, r));
129
+ const banners = failing.map((t) => `<div class="bdsh-ban" role="alert"><i class="cz-dot red"></i><span class="bdsh-bt"><b>${esc(t.team)}</b> cannot be read. ${esc(t.error)}</span>`
130
+ + (t.kind === 'password' ? ib('key', 'Paste a new invite link', `data-sh="repaste" data-sh-team="${esc(t.team)}"`, 's') : ib('refresh', 'Refresh', `data-sh="refresh" data-sh-team="${esc(t.team)}"`, 's')) + '</div>').join('');
131
+ const shown = rows.filter((r) => (sel === 'all' ? true : sel === 'mine' ? r.mine : r.team === sel)).sort((a, b) => (b.mine ? 1 : 0) - (a.mine ? 1 : 0) || String(b.made).localeCompare(String(a.made)));
132
+ const live = shown.filter((r) => !r.ended); const ended = shown.filter((r) => r.ended);
80
133
  const teamSel = teams.find((t) => t.team === sel);
81
- const teamLine = teamSel ? `<div class="bdsh-tl"><button type="button" class="bd-btn sm" data-sh="refresh">Refresh</button><button type="button" class="bd-btn sm" data-sh="repaste" data-sh-team="${esc(teamSel.team)}">Paste a new invite link</button><button type="button" class="bd-btn sm${S.leave === teamSel.team ? ' on' : ''}" data-sh-leave="${esc(teamSel.team)}">${S.leave === teamSel.team ? 'Sure? Leave ' + esc(teamSel.team) : 'Leave team'}</button></div><p class="bd-amut bdsh-fine">${S.leave === teamSel.team ? 'Leaving only forgets the team\'s password on this computer. Copies you published stay. Join again with the invite link.' : ''}</p>` : '';
82
- const empty = !built.length && !failing.length ? `<p class="bd-amut bdsh-pad">${sel === 'all' ? 'Nothing is shared yet.' : sel === 'mine' ? 'You have no open links.' : 'Nobody has shared a board with ' + esc(sel) + ' yet. Press the share button on the Board to publish one.'}</p>` : '';
83
- const head = '<div class="bd-dt h" role="row"><span></span><span role="columnheader">Board</span><span role="columnheader">Selection</span><span role="columnheader">Team</span><span role="columnheader">Shared by</span><span role="columnheader">Published</span><span role="columnheader">Views</span><span role="columnheader">Ends</span><span></span></div>';
134
+ const leaving = teamSel && S.leave === teamSel.team;
135
+ const teamLine = teamSel ? `<div class="bdsh-tl"><span class="bdsh-meta">${leaving ? 'Leave ' + esc(teamSel.team) + '? It only forgets the team\'s password on this computer. Copies you published stay.' : esc(teamSel.team)}</span>`
136
+ + (leaving ? ib('x', 'Stay in the team', 'data-sh="stay"', 's gh') + ib('leave', 'Sure, leave ' + teamSel.team, `data-sh-leave="${esc(teamSel.team)}"`, 's danger')
137
+ : ib('key', 'Paste a new invite link', `data-sh="repaste" data-sh-team="${esc(teamSel.team)}"`, 's gh') + ib('leave', 'Leave team', `data-sh-leave="${esc(teamSel.team)}"`, 's gh')) + '</div>' : '';
138
+ const empty = !live.length && !ended.length && !failing.length ? `<p class="bdsh-meta bdsh-pad">${sel === 'all' ? 'Nothing is shared yet.' : sel === 'mine' ? 'You have no open links.' : 'Nobody has shared a board with ' + esc(sel) + ' yet. Press the share button on the Board to publish one.'}</p>` : '';
139
+ const fold = ended.length ? `<button type="button" class="bdsh-fold" data-sh="ended" aria-expanded="${!!S.endedOpen}">${svg(I.more, 16)}<span>${ended.length} ended</span></button>` + (S.endedOpen ? ended.map((r) => card(S, r)).join('') : '') : '';
84
140
  const hosts = [...new Set(teams.filter((t) => t.ok).map((t) => t.host))];
85
- const readLine = S.readAt ? `<p class="bd-amut bdsh-fine">Read${hosts.length ? ' from ' + hosts.map(esc).join(', ') : ''} ${agoText(S)}. Press a board to open its copy in a new tab. <button type="button" class="bdsh-lk" data-sh="refresh">Refresh</button></p>` : '';
86
- return `<div class="bd-dchips" role="group" aria-label="Shared">${chipsHtml}<span class="bd-sp"></span><button type="button" class="bd-btn" data-sh="${showJoin ? 'closejoin' : 'openjoin'}">${showJoin ? 'Close' : 'Join another team'}</button></div>`
87
- + (showJoin ? joinHtml(S) : '') + (S.status ? `<p class="bd-amut bdsh-fine" role="status">${esc(S.status)}</p>` : '') + banners + teamLine
88
- + (built.length ? `<div class="bd-dtw bdsh-table" role="table" aria-label="Shared boards">${head}${built.map((b) => b.table).join('')}</div><div class="bdsh-cards">${built.map((b) => b.card).join('')}</div>` : '') + empty + readLine;
141
+ const readLine = S.readAt ? `<p class="bdsh-meta bdsh-read"><i class="cz-dot ok"></i><span>Read${hosts.length ? ' from ' + hosts.map(esc).join(', ') : ''} ${agoText(S)}. Press a board to open its copy in a new tab.</span>${ib('refresh', 'Refresh', 'data-sh="refresh"', 's gh')}</p>` : '';
142
+ return `<div class="bdsh-col"><div class="bdsh-top" role="group" aria-label="Shared">${chipsHtml}</div>` + banners + teamLine
143
+ + (live.length ? `<div class="bdsh-list" role="list" aria-label="Shared boards">${live.map((r) => card(S, r)).join('')}</div>` : '') + fold + empty + readLine + '</div>';
89
144
  }
90
145
 
91
146
  export async function loadCount(cb) {
@@ -93,9 +148,16 @@ export async function loadCount(cb) {
93
148
  if (r && r.ok) cb((r.links || []).length);
94
149
  }
95
150
 
151
+ let toastT = null;
152
+ /** The Board's toast (#bdToast, the dark pill); quiet when the page has none. */
153
+ function toast(msg) {
154
+ const t = document.getElementById('bdToast'); if (!t || !msg) return;
155
+ t.textContent = msg; t.hidden = false; clearTimeout(toastT); toastT = setTimeout(() => { t.hidden = true; }, 5000);
156
+ }
157
+
96
158
  export function show(el, opts = {}) {
97
159
  css();
98
- const S = el.__sh || (el.__sh = { phase: 'loading', yours: [], teams: [], names: [], readAt: '', now: Date.now(), sel: 'all', join: { open: false, typed: false }, off: null, leave: null, status: '' });
160
+ const S = el.__sh || (el.__sh = { phase: 'loading', yours: [], teams: [], names: [], readAt: '', now: Date.now(), sel: 'all', join: { open: false, typed: false }, off: null, leave: null, pw: null, endedOpen: false });
99
161
  const draw = (focus) => {
100
162
  const keep = { invite: el.querySelector('#shInvite'), host: el.querySelector('#shHost'), team: el.querySelector('#shTeam'), pass: el.querySelector('#shPass') };
101
163
  if (keep.invite) S.join.invite = keep.invite.value; if (keep.host) S.join.host = keep.host.value; if (keep.team) S.join.team = keep.team.value; if (keep.pass) S.join.password = keep.pass.value;
@@ -106,47 +168,73 @@ export function show(el, opts = {}) {
106
168
  if (!keepPhase) { S.phase = 'loading'; draw(); }
107
169
  const r = await pmGet('/api/board-publish/shared').catch(() => null);
108
170
  S.phase = 'ready'; S.now = Date.now();
109
- if (r && r.ok) { S.yours = r.yours || []; S.teams = r.teams || []; S.names = S.teams.map((t) => t.team); S.readAt = r.readAt; } else S.status = (r && r.error) || 'The workspace did not answer. Try again.';
171
+ if (r && r.ok) { S.yours = r.yours || []; S.teams = r.teams || []; S.names = S.teams.map((t) => t.team); S.readAt = r.readAt; } else toast((r && r.error) || 'The workspace did not answer. Try again.');
110
172
  if (opts.onCount) opts.onCount(totalOf(S)); draw();
111
173
  };
112
174
  if (!el.__shBound) {
113
175
  el.__shBound = true;
176
+ el.addEventListener('keydown', (e) => {
177
+ if (e.key !== 'Escape') return;
178
+ if (S.pw) { const id = S.pw.id; S.pw = null; e.stopPropagation(); return draw(`[data-sh-pw="${CSS.escape(id)}"]`); }
179
+ if (S.join.open && (S.teams.length || S.yours.length)) { S.join = { open: false, typed: false }; e.stopPropagation(); return draw('.bdsh-ib.plus'); }
180
+ if (S.off) { const id = S.off; S.off = null; e.stopPropagation(); return draw(`[data-sh-off="${CSS.escape(id)}"]`); }
181
+ });
114
182
  el.addEventListener('click', async (e) => {
115
183
  const b = e.target.closest('button'); if (!b) return;
116
- if (b.dataset.shSel) { S.sel = b.dataset.shSel; S.leave = null; S.off = null; return draw(`[data-sh-sel="${CSS.escape(S.sel)}"]`); }
184
+ if (b.dataset.shSel) { S.sel = b.dataset.shSel; S.leave = null; S.off = null; S.pw = null; return draw(`[data-sh-sel="${CSS.escape(S.sel)}"]`); }
117
185
  const a = b.dataset.sh;
118
- if (a === 'refresh') { S.status = ''; S.leave = null; return read(false); }
186
+ if (a === 'refresh') { S.leave = null; S.pw = null; return read(false); }
119
187
  if (a === 'openjoin') { S.join = { open: true, typed: false }; return draw('#shInvite'); }
120
- if (a === 'closejoin') { S.join = { open: false, typed: false }; return draw(); }
188
+ if (a === 'closejoin') { S.join = { open: false, typed: false }; return draw('.bdsh-ib.plus'); }
121
189
  if (a === 'repaste') { S.join = { open: true, typed: false, team: b.dataset.shTeam }; return draw('#shInvite'); }
122
190
  if (a === 'typed') { S.join.typed = true; S.join.err = ''; return draw('#shHost'); }
123
191
  if (a === 'paste') { S.join.typed = false; S.join.err = ''; return draw('#shInvite'); }
192
+ if (a === 'ended') { S.endedOpen = !S.endedOpen; return draw('[data-sh="ended"]'); }
193
+ if (a === 'stay') { S.leave = null; return draw('[data-sh-leave]'); }
194
+ if (a === 'pwdone') { const id = S.pw && S.pw.id; S.pw = null; return draw(id ? `[data-sh-pw="${CSS.escape(id)}"]` : null); }
195
+ if (a === 'pwcopy') {
196
+ try { await navigator.clipboard.writeText(S.pw.password); S.pw.copied = true; toast('Password copied'); } catch { toast('Select the password and copy it'); }
197
+ return draw('[data-sh="pwcopy"]');
198
+ }
124
199
  if (a === 'join') {
125
- const J = S.join; const body = J.typed ? { host: J.host || '', team: J.team || '', password: J.password || '' } : { invite: J.invite || '' };
200
+ const J = S.join;
126
201
  const fresh = { invite: (el.querySelector('#shInvite') || {}).value, host: (el.querySelector('#shHost') || {}).value, team: (el.querySelector('#shTeam') || {}).value, password: (el.querySelector('#shPass') || {}).value };
127
- if (J.typed) { body.host = fresh.host || ''; body.team = fresh.team || ''; body.password = fresh.password || ''; } else body.invite = fresh.invite || '';
202
+ const body = J.typed ? { host: fresh.host || '', team: fresh.team || '', password: fresh.password || '' } : { invite: fresh.invite || '' };
128
203
  J.busy = true; J.err = ''; draw();
129
204
  const r = await pmPost('/api/board-publish/join', body).catch(() => null); J.busy = false;
130
- if (r && r.ok) { S.join = { open: false, typed: false }; S.sel = r.team; S.status = 'Joined ' + r.team + '.'; return read(false); }
205
+ if (r && r.ok) { S.join = { open: false, typed: false }; S.sel = r.team; toast('Joined ' + r.team + '.'); return read(false); }
131
206
  J.err = (r && r.error) || 'The workspace did not answer. Try again.'; return draw(J.typed ? '#shHost' : '#shInvite');
132
207
  }
133
208
  if (b.dataset.shLeave) {
134
209
  if (S.leave !== b.dataset.shLeave) { S.leave = b.dataset.shLeave; return draw(`[data-sh-leave="${CSS.escape(S.leave)}"]`); }
135
210
  const r = await pmPost('/api/board-publish/leave', { team: S.leave }).catch(() => null); const was = S.leave; S.leave = null; S.sel = 'all';
136
- S.status = r && r.ok ? 'Left ' + was + '. Copies you published stay.' : (r && r.error) || 'Not saved.'; return read(true);
211
+ toast(r && r.ok ? 'Left ' + was + '. Copies you published stay.' : (r && r.error) || 'Not saved.'); return read(true);
212
+ }
213
+ if (b.dataset.shKeep) { S.off = null; return draw(`[data-sh-off="${CSS.escape(b.dataset.shKeep)}"]`); }
214
+ if (b.dataset.shCopy) {
215
+ const l = S.yours.find((x) => x.id === b.dataset.shCopy);
216
+ try { await navigator.clipboard.writeText(l.url); toast('Link copied'); } catch { toast('The link could not be copied: ' + (l ? l.url : '')); }
217
+ return;
218
+ }
219
+ if (b.dataset.shPw) {
220
+ const id = b.dataset.shPw; if (S.pw && S.pw.id === id && !S.pw.busy) { S.pw = null; return draw(`[data-sh-pw="${CSS.escape(id)}"]`); }
221
+ S.off = null; S.pw = { id, busy: true }; draw();
222
+ const r = await pmPost('/api/board-publish/password', { id }).catch(() => null);
223
+ S.pw = r && r.ok ? { id, password: r.password } : { id, err: (r && r.error) || 'The workspace did not answer. Try again.' };
224
+ return draw('.bdsh-pwpop button');
137
225
  }
138
- if (b.dataset.shRe) { S.status = ''; const r = await pmPost('/api/board-publish/republish', { id: b.dataset.shRe }).catch(() => null); S.status = r && r.ok ? 'Republished. The link and the password stay the same.' : (r && r.error) || 'The workspace did not answer. Try again.'; return read(true); }
226
+ if (b.dataset.shRe) { b.disabled = true; const r = await pmPost('/api/board-publish/republish', { id: b.dataset.shRe }).catch(() => null); toast(r && r.ok ? 'Republished. The link and the password stay the same.' : (r && r.error) || 'The workspace did not answer. Try again.'); return read(true); }
139
227
  if (b.dataset.shOff) {
140
- if (S.off !== b.dataset.shOff) { S.off = b.dataset.shOff; return draw(`[data-sh-off="${CSS.escape(S.off)}"]`); }
228
+ if (S.off !== b.dataset.shOff) { S.off = b.dataset.shOff; S.pw = null; return draw(`[data-sh-keep="${CSS.escape(S.off)}"]`); }
141
229
  const r = await pmPost('/api/board-publish/off', { id: S.off }).catch(() => null); S.off = null;
142
- S.status = r && r.ok ? 'Turned off. The copy is deleted from the host.' : (r && r.error) || 'The link could not be turned off.'; return read(true);
230
+ toast(r && r.ok ? 'Turned off. The copy is deleted from the host.' : (r && r.error) || 'The link could not be turned off.'); return read(true);
143
231
  }
144
232
  if (b.dataset.shOpen) {
145
233
  // the tab is opened by the press itself (a popup blocker allows that), then pointed at the one-time address
146
234
  const w = window.open('about:blank', '_blank'); if (w) { try { w.opener = null; } catch { /* none */ } }
235
+ const row = S.yours.concat(...S.teams.filter((t) => t.ok).map((t) => t.links)).find((x) => x.id === b.dataset.shOpen);
147
236
  const r = await pmPost('/api/board-publish/open', { team: b.dataset.shTeam, id: b.dataset.shOpen }).catch(() => null);
148
- if (r && r.ok && w) { w.location.href = r.url; S.status = 'Opened ' + (b.textContent || 'the board') + ' in a new tab.'; } else { if (w) w.close(); S.status = (r && r.error) || 'The workspace did not answer. Try again.'; }
149
- return draw(`[data-sh-open="${CSS.escape(b.dataset.shOpen)}"]`);
237
+ if (r && r.ok && w) { w.location.href = r.url; toast('Opened ' + ((row && row.name) || 'the board') + ' in a new tab.'); } else { if (w) w.close(); toast((r && r.error) || 'The workspace did not answer. Try again.'); }
150
238
  }
151
239
  });
152
240
  }
@@ -37,7 +37,12 @@
37
37
  * · A row's dot shows only off track (late, at risk, on hold). Names wrap to two lines. One tint (programs); quarter grid lines only.
38
38
  * Columns and bars (batch 19 item 5, Board Track; StsA8Board, StsA9BoardDark): a desktop shows columns beside the names (o.cols, pm/bd-cols.js),
39
39
  * Status carries the dot and Next milestone the end's words; the bars are 20 px, now blue to the end of this week while under way, and a late
40
- * row draws an orange line from its end to Today. */
40
+ * row draws an orange line from its end to Today.
41
+ * Forecast ranges (build brief Grill and Forecast, UI-B Board; FcBoard): r.forecast is lib/forecast.js deliveryForecast. At risk or will miss, a
42
+ * hatched range runs past the plan, from the promised ◇ to the late end of the range: orange at risk, red to miss. A held range is drawn
43
+ * dimmed and grey. On track, too early or no range draws nothing (zero is silence). A press on the hatch opens a small card (pm/bd-fc-card.js).
44
+ * With r.forecast on the row, the older dashed Jira forecast is not drawn (one method, say it once). A program with milestones at risk says
45
+ * "N of M milestones at risk" under its name (model.programForecasts, through o.progRisk). */
41
46
  import { esc } from './premium-shell.js';
42
47
  import { mergeClose } from './program-model.js';
43
48
  import { stagesOfRow } from './bd-wf.js';
@@ -101,6 +106,14 @@ const doneOf = (r) => { const p = r.track && r.track.prog; return p ? Math.max(0
101
106
  /** A milestone task past its due date and not done (feedback batch 11 item 3): its ◇ turns orange, and so does the row's dot. */
102
107
  const msLate = (m, now) => !m.done && day(m.date) && day(m.date) < new Date(now.getFullYear(), now.getMonth(), now.getDate());
103
108
  export const anyMsLate = (r, now) => !!(now && (r.milestones || []).some((m) => msLate(m, now)));
109
+ /** The forecast range a row draws (FcBoard): { tone: 'risk' | 'miss' | 'held', low, high } past its promised date, else null. */
110
+ export function fcRange(r) {
111
+ const F = r && r.forecast, e = r && day(r.end);
112
+ if (!F || !e) return null;
113
+ const tone = F.state === 'at-risk' ? 'risk' : F.state === 'will-miss' ? 'miss' : F.state === 'held' && (F.was === 'at-risk' || F.was === 'will-miss') ? 'held' : '';
114
+ const hi = day(F.high || F.low), lo = day(F.low);
115
+ return tone && hi && hi > e ? { tone, low: lo || hi, high: hi } : null;
116
+ }
104
117
  const toneOf = (r, now) => (r.late || anyMsLate(r, now) ? 'late' : r.status === 'at risk' ? 'risk' : r.track && r.track.you ? 'you' : r.status === 'on track' ? 'ok' : 'q');
105
118
  /** A row's dot (batch 13 item 4): only off track. 'late' | 'risk' | 'q' (on hold) | null. */
106
119
  export const offTone = (r, now) => { const t = toneOf(r, now); return t === 'late' || t === 'risk' ? t : r.status === 'on hold' ? 'q' : null; };
@@ -174,7 +187,7 @@ export const skipWords = (items) => items.map((x) => x.name + ' skipped' + (x.wh
174
187
 
175
188
  /** The first and last mark of a row: the plan, the forecast, a return date ahead, and today while it is over. */
176
189
  function extentOf(r, now) {
177
- const s = day(r.start), e = day(r.end), fc = r.track && day(r.track.forecast), ds = [s, e, fc].filter(Boolean);
190
+ const s = day(r.start), e = day(r.end), fc = r.track && day(r.track.forecast), fr = fcRange(r), ds = [s, e, fc, fr && fr.high].filter(Boolean);
178
191
  const ob = openBack(r, now); if (ob && s) ds.push(ob);
179
192
  if (r.over && e && now > e) ds.push(now);
180
193
  return ds.length ? { a: new Date(Math.min(...ds)), b: new Date(Math.max(...ds)) } : null;
@@ -198,7 +211,7 @@ const slipWords = (r, e) => { const p = r.plan, b = p && day(p.end), n = p && p.
198
211
  /** One initiative's marks: the plan cut by its gaps and holds, the forecast past the plan, the shown milestones, the end ◇ and one label after the
199
212
  * furthest mark. */
200
213
  function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
201
- const s = day(r.start), e = day(r.end), fc = r.track && day(r.track.forecast), tone = toneOf(r);
214
+ const s = day(r.start), e = day(r.end), fr = fcRange(r), fc = r.forecast ? null : r.track && day(r.track.forecast), tone = toneOf(r);
202
215
  const tm = taskMarks(r, X, now, phone, pxPct, ms), et = tm.end, note = markWords(r, now);
203
216
  const risk = r.status === 'at risk' ? 'risk' : r.status === 'on hold' ? 'q' : '';
204
217
  let out = tm.html + depHtml(r, X, phone), clash = null;
@@ -210,6 +223,11 @@ function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
210
223
  // a late initiative (batch 19 item 5): a thin orange line from the day after its end to Today, ending in a dot; the bar keeps its fill
211
224
  if (over) out += `<span class="tg-late" style="left:${P(X(e))};width:${P(Math.max(0, X(now) - X(e)))}" aria-hidden="true"></span>`;
212
225
  if (late) { out += `<span class="tg-fc" style="left:${P(X(e))};width:${P(X(fc) - X(e))}" title="Jira forecast ${esc(md(fc))}"></span>`; hover.push('Jira forecast ' + md(fc)); }
226
+ if (fr) {
227
+ const words = (fr.tone === 'held' ? 'Held: forecast ' : 'Forecast ') + (+fr.low !== +fr.high ? md(fr.low) + ' to ' + md(fr.high) : md(fr.high));
228
+ out += `<button type="button" class="tg-fh ${fr.tone}" data-fc-pick="${esc(r.key)}" style="left:${P(X(e))};width:${P(Math.max(0.3, X(fr.high) - X(e)))}" aria-haspopup="dialog" aria-label="${esc(words + '. Why')}" title="${esc(words)}"></button>`;
229
+ hover.push(words);
230
+ }
213
231
  if (clash) hover.push(clash);
214
232
  const sw = slipWords(r, e); if (sw) hover.push(sw);
215
233
  // the committed end is the ◇ (PgTimeline); a milestone task in the stage it stands for IS that ◇ (say it once, batch 11 item 3): its name and its done
@@ -219,7 +237,7 @@ function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
219
237
  const name = landsOf(r, et), eTitle = name + ' · ' + md(ed) + (et && et.stage ? ' · ◆ ' + et.stage : '') + (et && et.done ? ' · done' : isLate ? ' · late' : '');
220
238
  out += `<button type="button" class="tg-end${et && et.done ? ' dn' : ''}${isLate ? ' late' : ''}" data-ms-pick="${esc(r.key)}" data-ms-id="${esc(et ? et.id : '')}" style="left:${P(X(ed))}" aria-haspopup="dialog" aria-label="${esc(eTitle + '. Milestones of ' + r.title)}" title="${esc(eTitle + (clash ? '. ' + clash : ''))}"></button>`;
221
239
  // with the Next milestone column on, the column names it and the bar's end has no label (StsA8Board); the ◇ keeps the words as its hover
222
- if (!ms.noLabel) out += endLabel(Math.max(X(e), X(ed), over ? X(now) : 0, late ? X(fc) : 0), name, ed, isLate ? 'late' : risk, now, pxPct, hover, slipHtml(r));
240
+ if (!ms.noLabel) out += endLabel(Math.max(X(e), X(ed), over ? X(now) : 0, late ? X(fc) : 0, fr ? X(fr.high) : 0), name, ed, isLate ? 'late' : risk, now, pxPct, hover, slipHtml(r));
223
241
  } else if (fc) {
224
242
  out += `<span class="tg-fc solo" style="left:${P(X(fc))};width:12px;margin-left:-12px" title="Jira forecast ${esc(md(fc))}"></span>` + endLabel(X(fc), 'Jira forecast', fc, '', now, pxPct, [], '');
225
243
  } else if (r.draft && day(r.draft.start)) {
@@ -475,11 +493,11 @@ function edgeTabs(r, X, now, phone) {
475
493
  * (extra: { plan, draft }; batch 11 item 8), one hairline key for a gap or a hold while one is drawn and Skipped while a » is (extra: { gap, skip };
476
494
  * batch 13 item 4 folds the hold into the gap's hairline), the Jira forecast, Milestone, today. `prog` is kept for the callers: a program draws
477
495
  * no ◇ of its own while open. */
478
- export const legendHtml = (prog, hold, extra = {}) => `<span class="tg-lgd" role="group" aria-label="Legend"><span><i class="k dn"></i>Done in Jira</span><span><i class="k nw"></i>Now</span><span><i class="k pl"></i>To do</span>${extra.plan ? '<span><i class="k pln"></i>Plan</span>' : ''}${extra.draft ? '<span><i class="k drf"></i>Draft</span>' : ''}${hold || extra.gap ? `<span><i class="k ng"></i>${hold && extra.gap ? 'Gap or hold' : hold ? 'On hold' : 'No activity'}</span>` : ''}${extra.skip ? `<span><i class="k sk">${SV(SKIP)}</i>Skipped</span>` : ''}<span><i class="k fc"></i>Jira forecast</span><span><i class="k dlv"></i>Milestone</span><span><i class="k td"></i>Today</span></span>`;
496
+ export const legendHtml = (prog, hold, extra = {}) => `<span class="tg-lgd" role="group" aria-label="Legend"><span><i class="k dn"></i>Done in Jira</span><span><i class="k nw"></i>Now</span><span><i class="k pl"></i>To do</span>${extra.plan ? '<span><i class="k pln"></i>Plan</span>' : ''}${extra.draft ? '<span><i class="k drf"></i>Draft</span>' : ''}${hold || extra.gap ? `<span><i class="k ng"></i>${hold && extra.gap ? 'Gap or hold' : hold ? 'On hold' : 'No activity'}</span>` : ''}${extra.skip ? `<span><i class="k sk">${SV(SKIP)}</i>Skipped</span>` : ''}${extra.range ? '<span><i class="k fh"></i>Forecast range</span>' : ''}<span><i class="k fc"></i>Jira forecast</span><span><i class="k dlv"></i>Milestone</span><span><i class="k td"></i>Today</span></span>`;
479
497
 
480
498
  /** The dates on record a window must hold: every shown row's plan and forecast, the programs' spans and milestones, the release. */
481
499
  function datesOf(list, M, o) {
482
- const ds = list.flatMap((r) => [day(r.start), day(r.end), r.track && day(r.track.forecast), day(r.start) ? openBack(r, o.now) : null, r.plan && day(r.plan.start), r.plan && day(r.plan.end), r.draft && day(r.draft.start), r.draft && day(r.draft.end)]);
500
+ const ds = list.flatMap((r) => [day(r.start), day(r.end), r.track && day(r.track.forecast), day(r.start) ? openBack(r, o.now) : null, r.plan && day(r.plan.start), r.plan && day(r.plan.end), r.draft && day(r.draft.start), r.draft && day(r.draft.end), (fcRange(r) || {}).high]);
483
501
  for (const { g, st } of progGroups(o)) { const sp = progSpan(g); if (sp) ds.push(sp.lo, sp.hi); for (const m of st.milestones || []) ds.push(day(m.date)); }
484
502
  const rel = M.jira && M.jira.release; if (rel) ds.push(day(rel.iso));
485
503
  return ds.filter(Boolean);
@@ -620,8 +638,10 @@ function progMarks(g, st, X, W, days, fmt, phone, pxPct) {
620
638
  /** A program's name cell: the tile, the title, the off-track dots while folded, the fold; the title opens the program (bd:program). */
621
639
  function progName(g, st, o, dots = '') {
622
640
  const p = g.program, n = o.productsOf ? o.productsOf(p) : 0, meta = n > 1 ? n + ' products' : st.state;
641
+ // the milestones at risk (FcBoard), only when there are some: zero is silence
642
+ const f = o.progRisk ? o.progRisk(p.id) : null, risk = f && f.atRisk > 0 ? f.atRisk + ' of ' + f.total + ' milestones at risk' : '';
623
643
  // no "Running" under the name (batch 13 item 4: quiet rows): the state stays in its label for a reader
624
- return `<button type="button" class="tg-pgo" data-prog="${esc(p.id)}" aria-haspopup="dialog" aria-label="${esc(p.title)}, a program${meta ? ', ' + esc(meta) : ''}. Open the program">${o.progTile ? o.progTile() : ''}<span class="tt"><b>${esc(p.title)}</b></span></button>${dots}${o.foldBtn ? o.foldBtn(g) : ''}`;
644
+ return `<button type="button" class="tg-pgo" data-prog="${esc(p.id)}" aria-haspopup="dialog" aria-label="${esc(p.title)}, a program${meta ? ', ' + esc(meta) : ''}${risk ? ', ' + esc(risk) : ''}. Open the program">${o.progTile ? o.progTile() : ''}<span class="tt"><b>${esc(p.title)}</b>${risk ? `<small class="tg-pgr">${esc(risk)}</small>` : ''}</span></button>${dots}${o.foldBtn ? o.foldBtn(g) : ''}`;
625
645
  }
626
646
  /** The program groups among the page's groups (programs first, PgTimeline), with their state; [] in By product or with no program here. */
627
647
  const progGroups = (o) => (o.groups || []).filter((g) => g.kind === 'program').map((g) => ({ g, st: o.progState ? o.progState(g.program) : { milestones: [], state: '' } }));
@@ -1472,3 +1472,18 @@ span.tg-ng { cursor: default; }
1472
1472
  /* with a viewer open the Timeline keeps the initiative's name: no Stage, Status, Start or Next milestone */
1473
1473
  .ro-vw .tg { --nw: 300px !important; --cg: minmax(0, 1fr) !important; }
1474
1474
  .ro-vw .tg-h .tg-n > :nth-child(n+2), .ro-vw .tg-n.ini2 > :nth-child(n+2) { display: none !important; }
1475
+ /* ── forecast ranges on the timeline (build brief Grill and Forecast, UI-B Board; FcBoard): a hatched range past the plan from the promised ◇,
1476
+ * orange at risk, red to miss, grey and dimmed when held; a press opens the forecast card (pm/bd-fc-card.js). A program with milestones at
1477
+ * risk says so under its name. ── */
1478
+ .tg-fh { all: unset; position: absolute; top: 50%; height: 20px; margin-top: -10px; border-radius: 0 999px 999px 0; box-sizing: border-box; z-index: 1; cursor: pointer;
1479
+ --fh: var(--cz-dot-late); background: repeating-linear-gradient(45deg, var(--fh) 0 4px, color-mix(in srgb, var(--fh) 22%, transparent) 4px 8px); }
1480
+ .tg-fh.miss { --fh: var(--cz-red); }
1481
+ .tg-fh.held { --fh: var(--cz-ink3); opacity: .45; }
1482
+ .tg-fh:hover { filter: brightness(1.08); }
1483
+ .tg-fh:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
1484
+ .tg-fh::before { content: ''; position: absolute; inset: -12px 0; } /* a 44 px press target around the 20 px bar */
1485
+ .tg-lgd .k.fh { background: repeating-linear-gradient(45deg, var(--cz-dot-late) 0 3px, transparent 3px 6px); }
1486
+ .tg-pgo .tt small.tg-pgr { color: var(--cz-late); font-weight: 700; }
1487
+ .bd-fc-go { display: flex; justify-content: flex-end; padding-bottom: 6px; }
1488
+ .bd-fc-sp { all: unset; box-sizing: border-box; width: 44px; height: 44px; border-radius: 22px; background: var(--cz-blue); color: var(--cz-onsolid); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
1489
+ .bd-fc-sp:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
@@ -303,6 +303,16 @@
303
303
  .nv-idd { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--cz-card); color: var(--cz-blueink); font-size: var(--fs-1); font-weight: 800; vertical-align: 1px; }
304
304
  .nv-go { padding-top: 2px; }
305
305
  .nv-pri svg { flex: none; }
306
+ /* the bridge (batch 20 item 3, canvas WmB): each new stage with the old stages that go into it; ✕ and ✓ as icons, ✓ last */
307
+ .nv-bridge { border: 1px solid var(--cz-hair); border-radius: 14px; background: var(--cz-card); padding: 2px 14px; }
308
+ .nv-br { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 0; }
309
+ .nv-br + .nv-br { border-top: 1px solid var(--cz-hair); }
310
+ .nv-bo { padding: 5px 10px; border-radius: 10px; background: var(--cz-well); color: var(--cz-ink2); font-weight: 700; font-size: var(--fs-2); }
311
+ .nv-ba { display: inline-flex; color: var(--cz-ink3); }
312
+ .nv-bn { padding: 5px 10px; border-radius: 10px; background: var(--cz-bluebg); color: var(--cz-blueink); font-weight: 800; font-size: var(--fs-2); }
313
+ .nv-bc { margin-left: auto; font-style: normal; font-size: var(--fs-1); color: var(--cz-ink3); }
314
+ .nv-goi { display: flex; justify-content: flex-end; gap: 10px; }
315
+ .nv-ico { width: 44px; height: 44px; padding: 0; border-radius: 22px; justify-content: center; }
306
316
  .nv-parts { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; color: var(--cz-ink2); }
307
317
  .nv-sp { display: inline-flex; vertical-align: -2px; margin-right: 6px; color: var(--cz-blue); }
308
318
  .nv-when { display: flex; flex-wrap: wrap; gap: 8px; }
@@ -313,3 +323,45 @@
313
323
  .nv-row b { flex: none; font-weight: 800; }
314
324
  .nv-row span { flex: 1; min-width: 0; text-align: right; color: var(--cz-ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
315
325
  .nv-row svg { flex: none; color: var(--cz-ink3); }
326
+ /* Settings › Claude's checks (canvas GrillEntry): what this month used of the credit, as one quiet bar */
327
+ .cz .ev-gcap { flex-wrap: wrap; }
328
+ .cz .ev-gcap .ev-small { flex: 1 1 160px; }
329
+ .cz .ev-gbar { position: relative; flex: 1 1 200px; height: 8px; border-radius: 4px; background: var(--cz-well2, var(--cz-well)); overflow: hidden; }
330
+ .cz .ev-gbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--cz-blue); }
331
+ @media (max-width: 600px) { .cz .ev-trow:has(.ev-seg[aria-label="Grill by itself"]), .cz .ev-trow:has(.ev-seg[aria-label="Monthly credit for checks"]) { flex-wrap: wrap; } }
332
+ /* Settings › Jev and Laya (canvas JlA1Empty–JlA4Phone): the key and Laya rows, Claude's ✦ for Laya, the repositories in one well */
333
+ .ev-st .ev-jl-lead { margin: 0 0 8px; }
334
+ .ev-st .ev-jl-ctl { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
335
+ .ev-st input.ev-inp.ev-jl-key { flex: 0 1 190px; width: 190px; }
336
+ .ev-st .ev-ib.ev-jl-pri { background: var(--cz-bluebg); color: var(--cz-blueink); }
337
+ .ev-st .ev-jl-need { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
338
+ .ev-st .ev-jl-need p { flex: 1; margin: 0; font-size: var(--fs-3); }
339
+ .ev-st .ev-jl-ok, .ev-st .ev-jl-bad { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ok); }
340
+ .ev-st .ev-jl-bad { color: var(--cz-late); }
341
+ .ev-st p.ev-jl-ok, .ev-st p.ev-jl-bad { padding: 0 0 8px; }
342
+ .ev-st .ev-jl-lbl { padding: 14px 0 4px; }
343
+ .ev-st .ev-jl-rp { background: var(--cz-well); border-radius: 16px; padding: 4px 14px 6px; }
344
+ .ev-st .ev-jl-rp .ev-trow.ev-jl-r { padding: 10px 0; border-bottom: 0; }
345
+ .ev-st .ev-jl-ind { border-left: 2px solid var(--cz-hair); margin: 0 0 6px 8px; }
346
+ .ev-st .ev-jl-ind .ev-trow.ev-jl-r { padding-left: 16px; }
347
+ .ev-st .ev-jl-ind .ev-tx b { font-weight: 700; }
348
+ .ev-st .ev-jl-hr { height: 1px; background: var(--cz-hair); }
349
+ .ev-st .ev-sw:disabled { opacity: .5; cursor: default; }
350
+ @media (max-width: 760px) {
351
+ .ev-st .ev-jl-ctl { width: 100%; justify-content: flex-start; }
352
+ .ev-st input.ev-inp.ev-jl-key { flex: 1 1 auto; width: auto; }
353
+ }
354
+ /* Settings › Claude: the shared sign-in block (pm/cozy-claude-setup.js). Its Welcome styles (premium.css .wl-btn, .cs-*) are not on this
355
+ * page, so the block takes the Settings look here: pill buttons, the well select, quiet notes (batch 20 item 12). */
356
+ .ev-st [data-claude-setup] .cs-panel { display: grid; gap: 10px; justify-items: start; }
357
+ .ev-st [data-claude-setup] p { margin: 0; color: var(--cz-ink2); font-size: var(--fs-3); line-height: 1.45; }
358
+ .ev-st [data-claude-setup] p.note, .ev-st [data-claude-setup] .cs-status { color: var(--cz-ink3); font-size: var(--fs-2); }
359
+ .ev-st [data-claude-setup] .wl-btn { height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: var(--fs-3); font-weight: 700; border: 0; background: var(--cz-solid); color: var(--cz-onsolid); cursor: pointer; white-space: nowrap; }
360
+ .ev-st [data-claude-setup] .wl-btn.alt { background: var(--cz-card); color: var(--cz-ink); border: 1px solid var(--cz-hair); }
361
+ .ev-st [data-claude-setup] .wl-btn.quiet { background: none; color: var(--cz-ink2); }
362
+ .ev-st [data-claude-setup] .wl-btn:disabled { opacity: .5; cursor: default; }
363
+ .ev-st [data-claude-setup] .cs-label { display: flex; align-items: center; gap: 10px; font-size: var(--fs-3); font-weight: 700; color: var(--cz-ink); }
364
+ .ev-st [data-claude-setup] select { height: 36px; border-radius: 14px; background: var(--cz-well); padding: 0 12px; font: inherit; font-size: var(--fs-3); font-weight: 400; color: var(--cz-ink); border: 0; min-width: 200px; }
365
+ .ev-st [data-claude-setup] .cs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
366
+ .ev-st [data-claude-setup] .cs-term { width: 100%; min-height: 280px; border-radius: 14px; overflow: hidden; }
367
+ @media (max-width: 760px) { .ev-st [data-claude-setup] .wl-btn, .ev-st [data-claude-setup] select { min-height: 44px; } .ev-st [data-claude-setup] .cs-label { flex-wrap: wrap; } }
@@ -22,13 +22,13 @@ body.cz-home { min-height: 100vh; overflow: hidden; }
22
22
  body.cz-home .hm-desk { inset: 0; padding: 16px; gap: 16px; background: none; box-shadow: none; border-radius: 0; }
23
23
  body.cz-home .hm-chat { background: var(--cz-card); border-radius: 24px; padding: 16px 24px 20px; box-shadow: 0 10px 30px -24px var(--cz-c-9da3ac); }
24
24
  body.cz-home .hm-vw .cz-vw { flex-basis: min(500px, max(380px, calc(100vw - 852px))); width: min(500px, max(380px, calc(100vw - 852px))); }
25
- body.cz-home.hm-folded .hm-desk { padding-left: 56px; }
25
+ body.cz-home.hm-folded:not(.cz-vw-rail) .hm-desk { padding-left: 56px; }
26
26
  body.cz-home .hm-reopen { top: 12px; right: 12px; }
27
27
  }
28
- .hm-folded .hm-list { display: none; }
28
+ .hm-folded:not(.cz-vw-rail) .hm-list { display: none; } /* with a Viewer open, the folded list is the rail (batch 20 item 6) */
29
29
  .hm-unfold { display: none; }
30
- .hm-folded .hm-unfold { display: grid; place-items: center; position: absolute; left: 10px; top: 24px; z-index: 2; width: 36px; height: 36px; border-radius: 12px; border: 0; background: var(--cz-well); color: var(--cz-ink2); cursor: pointer; }
31
- .hm-folded .hm-desk { padding-left: 56px; }
30
+ .hm-folded:not(.cz-vw-rail) .hm-unfold { display: grid; place-items: center; position: absolute; left: 10px; top: 24px; z-index: 2; width: 36px; height: 36px; border-radius: 12px; border: 0; background: var(--cz-well); color: var(--cz-ink2); cursor: pointer; }
31
+ .hm-folded:not(.cz-vw-rail) .hm-desk { padding-left: 56px; }
32
32
  .hm-desk button { font-family: var(--cz-sans); }
33
33
  .hm-ib { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; border: 0; background: none; color: var(--cz-ink2); cursor: pointer; padding: 0; flex: none; }
34
34
  .hm-ib:hover { background: var(--cz-well2); }
@@ -876,3 +876,26 @@ textarea.ins-dri { height: auto; padding: 6px 8px; font-weight: 500; resize: ver
876
876
  .ins-nomv .ins-cols > .mv, .ins-nomv .ins-cols > .ins-mvh { display: none; }
877
877
  .ins-row.vwo, .ins-row.vwo:hover { background: var(--cz-bluebg); box-shadow: inset 3px 0 0 var(--cz-blue); }
878
878
  .ins-card.vwo { background: var(--cz-bluebg); box-shadow: inset 3px 0 0 var(--cz-blue); border-color: transparent; }
879
+ /* the budget's burn under its pace (canvas FcIntel) */
880
+ .ins-burn { margin-top: 4px; }
881
+
882
+ /* a goal's forecast in its Viewer (FcViewer, FcPhone; pm/goal-forecast.js): the state line, the range band, the legend, the baseline ✓ */
883
+ .fc-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 2px 10px; }
884
+ .fc-say { flex: 1; min-width: 12em; font-size: var(--fs-3); color: var(--cz-ink2); line-height: 1.45; }
885
+ .fc-tag { display: inline-flex; align-items: center; font-size: var(--fs-1); font-weight: 800; border-radius: 10px; padding: 3px 9px; background: var(--cz-well); color: var(--cz-ink2); white-space: nowrap; }
886
+ .fc-tag.ok { background: var(--cz-okbg); color: var(--cz-ok); }
887
+ .fc-tag.risk { background: var(--cz-riskbg); color: var(--cz-risk); }
888
+ .fc-tag.late { background: var(--cz-latebg); color: var(--cz-late); }
889
+ .ins-gch .fc-band { fill: var(--cz-blue); opacity: .22; stroke: none; }
890
+ .ins-gch .fc-band.held { opacity: .1; }
891
+ .ins-gch .fc-likely { stroke: var(--cz-blue); stroke-dasharray: 6 5; }
892
+ .ins-gch .fc-skip { fill: var(--cz-riskbg); stroke: none; }
893
+ .fc-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: var(--fs-1); color: var(--cz-ink3); }
894
+ .fc-legend span { display: inline-flex; align-items: center; gap: 6px; }
895
+ .fc-legend .fc-sp { flex: 1; }
896
+ .fc-k { display: inline-block; flex: none; }
897
+ .fc-k.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cz-blue); }
898
+ .fc-k.dash { width: 16px; border-top: 2px dashed var(--cz-blue); }
899
+ .fc-k.band { width: 14px; height: 10px; border-radius: 3px; background: var(--cz-blue); opacity: .22; }
900
+ .fc-base { display: flex; align-items: center; gap: 8px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--cz-hair); background: var(--cz-card); padding: 8px 10px 8px 16px; margin-top: 10px; }
901
+ .fc-base b { flex: 1; font-size: var(--fs-3); font-weight: 800; line-height: 1.4; }