create-pmos 0.471.0 → 0.473.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.471.0",
3
+ "version": "0.473.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -32,6 +32,32 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.473.0",
37
+ "at": "2026-11-01T01:14:19.818Z",
38
+ "f": 3,
39
+ "prs": [
40
+ {
41
+ "n": 1128,
42
+ "t": "Shared tab — a name that cannot open is plain text, with the reason",
43
+ "s": "Shared tab — a name that cannot open is plain text, with the reason",
44
+ "k": "fix"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "v": "0.472.0",
50
+ "at": "2026-11-01T00:41:46.421Z",
51
+ "f": 3,
52
+ "prs": [
53
+ {
54
+ "n": 1126,
55
+ "t": "Popover in view, published copy opens on the publisher's view, stage track opens initiatives",
56
+ "s": "Popover in view, published copy opens on the publisher's view, stage track opens initiatives",
57
+ "k": "fix"
58
+ }
59
+ ]
60
+ },
35
61
  {
36
62
  "v": "0.471.0",
37
63
  "at": "2026-10-31T13:21:46.914Z",
@@ -271,32 +297,6 @@
271
297
  "k": "fix"
272
298
  }
273
299
  ]
274
- },
275
- {
276
- "v": "0.453.0",
277
- "at": "2026-10-29T13:17:59.342Z",
278
- "f": 3,
279
- "prs": [
280
- {
281
- "n": 1099,
282
- "t": "The mission scene uses the blue Adler PNG set",
283
- "s": "The mission scene uses the blue Adler PNG set",
284
- "k": "new"
285
- }
286
- ]
287
- },
288
- {
289
- "v": "0.452.0",
290
- "at": "2026-10-29T12:12:01.657Z",
291
- "f": 3,
292
- "prs": [
293
- {
294
- "n": 1098,
295
- "t": "Settings > Claude: API key and Claude profile",
296
- "s": "Settings > Claude: API key and Claude profile",
297
- "k": "new"
298
- }
299
- ]
300
300
  }
301
301
  ]
302
302
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@d7c341c8
2
- assembled: 2026-10-31
1
+ kernel-source: pmos@f3b8d108
2
+ assembled: 2026-11-01
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-10-31T13:21:43Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-01T01:14:16Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-10-31T13:21:43Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-01T01:14:16Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-10-31T13:21:43Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-01T01:14:16Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  Newest first, ISO dates.
4
4
 
5
- ## 2026-10-31
5
+ ## 2026-11-01
6
6
 
7
7
  - Adopted OKF v0.2 (D73).
@@ -72,6 +72,15 @@ const ok = (name, cond, extra = '') => { n++; if (!cond) bad++; console.log(`${c
72
72
  await ctx.close();
73
73
  }
74
74
 
75
+ {
76
+ W.links = []; W.host = 'boards.test';
77
+ const s6 = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf');
78
+ await s6.p.locator('#bdPublish').click(); await s6.p.waitForSelector('.bppop', { timeout: 5000 }).catch(() => {}); await s6.p.waitForTimeout(300);
79
+ const g = await s6.p.evaluate(() => { const m = document.querySelector('.bppop').getBoundingClientRect(), b = document.querySelector('#bdPublish').getBoundingClientRect(); return { top: m.top, bottom: m.bottom, right: m.right, left: m.left, btnBottom: b.bottom, h: innerHeight, w: innerWidth }; });
80
+ ok('A6 the popover opens under the button and inside the viewport, not below the fold', g.top >= g.btnBottom && g.top < g.btnBottom + 40 && g.bottom <= g.h && g.left >= 0 && g.right <= g.w, JSON.stringify(g));
81
+ await s6.ctx.close();
82
+ }
83
+
75
84
  console.log('B no host');
76
85
  W.links = []; W.host = null; W.settings = []; W.settingsAnswer = null;
77
86
  s = await open(1440, 900, '/premium-board.html?ws=idpf&board=idpf'); await s.p.click('#bdPublish'); await s.p.waitForSelector('#bpHost');
@@ -97,6 +97,13 @@ const iso = (ms) => new Date(Date.now() + ms).toISOString();
97
97
  const names = await s.p.locator('#cShared .bdsh-table .bd-dlink').allTextContents();
98
98
  ok('C2 your own links come first, then the team\'s, and an ended copy last; your link in the team list is not drawn twice', JSON.stringify(names) === JSON.stringify(['IDPF', 'Project Ascent', 'Descope feature parity', 'Payments redesign', 'Legacy IdP sunset']), JSON.stringify(names));
99
99
  ok('C3 an ended copy is dimmed and is not a button; a copy that ends within a day and a half shows the Board\'s warning dot', (await s.p.locator('#cShared .bdsh-table .bdsh-gone').count()) === 1 && (await s.p.locator('#cShared .bdsh-table .bdsh-gone button.bd-dlink').count()) === 0 && (await s.p.locator('#cShared .bdsh-table .s-risk').count()) === 2);
100
+ ok('C3b a name that cannot open is plain text, not a link: an ended copy, and a link with no team (which says why)', await s.p.evaluate(async () => {
101
+ const { viewHtml } = await import('/pm/bd-shared.js'); const d = document.createElement('div');
102
+ const mk = (o) => Object.assign({ id: 'x' + Math.random().toString(36).slice(2, 10), url: 'https://boards.test/b/x', team: '', name: 'No team board', kind: 'program', by: 'Wawan', made: new Date().toISOString(), ends: new Date(Date.now() + 5 * 86400000).toISOString(), views: 0, mine: true }, o);
103
+ d.innerHTML = viewHtml({ phase: 'ready', yours: [mk({})], teams: [], names: [], readAt: new Date().toISOString(), now: Date.now(), sel: 'all', join: { open: false, typed: false }, off: null, leave: null, status: '' });
104
+ const n = d.querySelector('.bdsh-table .bdsh-plain');
105
+ return !!n && n.tagName === 'SPAN' && !d.querySelector('[data-sh-open]') && /Opens from a team/.test(n.title);
106
+ }));
100
107
  ok('C4 the line under the table says where and when it was read', /Read from boards\.test just now/.test(await s.p.locator('#cShared .bdsh-fine').last().textContent()), await s.p.locator('#cShared .bdsh-fine').last().textContent());
101
108
  const popup = s.p.waitForEvent('popup'); await s.p.locator('#cShared .bdsh-table [data-sh-open="team0000000000000001"]').click(); const pg = await popup; await pg.waitForURL(/ONETIME/, { timeout: 8000 }).catch(() => {});
102
109
  const o = W.posts.find((x) => x.p.endsWith('/open'));
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.473.0",
4
+ "at": "2026-11-01T01:14:19.818Z",
5
+ "f": 3,
6
+ "prs": [
7
+ {
8
+ "n": 1128,
9
+ "t": "Shared tab — a name that cannot open is plain text, with the reason",
10
+ "s": "Shared tab — a name that cannot open is plain text, with the reason",
11
+ "k": "fix"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.472.0",
17
+ "at": "2026-11-01T00:41:46.421Z",
18
+ "f": 3,
19
+ "prs": [
20
+ {
21
+ "n": 1126,
22
+ "t": "Popover in view, published copy opens on the publisher's view, stage track opens initiatives",
23
+ "s": "Popover in view, published copy opens on the publisher's view, stage track opens initiatives",
24
+ "k": "fix"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.471.0",
4
30
  "at": "2026-10-31T13:21:46.914Z",
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Published board: a read-only copy of a Board"
4
4
  description: "What a published board is, how to publish one from the Board, what a reader sees and cannot do, and how to preview one."
5
- timestamp: 2026-10-31
5
+ timestamp: 2026-11-01
6
6
  ---
7
7
 
8
8
  # Published board: a read-only copy of a Board
@@ -13,7 +13,7 @@ This version has the **Publish** button on the Board, the **Shared** tab, the re
13
13
 
14
14
  ## Publish a board
15
15
 
16
- Press the share icon on the Board's toolbar. A popover opens under it. The button shows a number when you have open links. It shows nothing when you have none.
16
+ Press the share icon on the Board's toolbar. A popover opens under it, inside the window. The button shows a number when you have open links. It shows nothing when you have none.
17
17
 
18
18
  The button is not on a narrow screen (720 px or less) and not on the All products page. Open one product to publish from it.
19
19
 
@@ -50,6 +50,7 @@ PMOS keeps the team and its password on this computer only. It does not show the
50
50
  The chips are **All**, **Yours** and one for each team. **Yours** shows only when you have open links. A chip shows how many open copies the team has.
51
51
 
52
52
  - **A board.** Press the name of a board to open its copy in a new browser tab. You do not type the password of the link. A copy that has ended is dimmed and does not open.
53
+ - **A name that is plain text.** A copy with no team cannot be opened from here, because PMOS does not keep the link's own password. Its name is not a button. Hold the pointer on it for the reason. Publish with a team name to open a copy from this tab.
53
54
  - **Yours.** Your own links have **Republish** and **Turn off**, the same as in the Publish popover. **Turn off** asks you to press a second time.
54
55
  - **A date in red.** The copy ends within a day and a half.
55
56
 
@@ -61,10 +62,11 @@ The tab is not in the read-only Board. A reader sees no Shared tab.
61
62
 
62
63
  ## What a reader sees
63
64
 
64
- - The Timeline, as you see it in the workspace. It opens on today.
65
+ - The view that you were in when you published: the stage track or the Timeline. A reader can switch between the two with the buttons on the toolbar. A copy made before this change opens on the stage track. Republish a link to give it your view. By stage and List are not offered.
66
+ - On the Timeline, the view opens on today.
65
67
  - The span picker, the Deliveries lane, and the folds of a program and a product.
66
68
  - One line above the Board. It names the selection, the date of the copy, who shared it and when the link ends.
67
- - A viewer for each initiative. Press the name of an initiative to open it. The viewer shows the stage card, About and Tasks. Tasks show as a List or as a Timeline, grouped by stage, owner or status.
69
+ - A viewer for each initiative. Press the name of an initiative to open it, on the stage track or on the Timeline. The viewer shows the stage card, About and Tasks. Tasks show as a List or as a Timeline, grouped by stage, owner or status.
68
70
  - The panel divider and the panel layout: full screen, split or slide over.
69
71
 
70
72
  While a viewer is open, the Timeline shows only the name of each initiative. The Stage, Status, Start and Next milestone columns are not shown.
@@ -73,7 +75,7 @@ While a viewer is open, the Timeline shows only the name of each initiative. The
73
75
 
74
76
  A reader can only look. Nothing that a reader presses or types changes anything.
75
77
 
76
- - The Board has no toolbar, no board picker, no filters and no **New initiative**.
78
+ - The Board has no board picker, no filters, no drag grips on the stage track and no **New initiative**.
77
79
  - A viewer has no rename, no **More**, no **Discuss in chat**, and no **+** to add a task or a person.
78
80
  - A task has no tick, no status and no date to change.
79
81
  - A viewer lists no documents and no links. It has no offer of Claude's help.
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- /* board-pack-route.js — GET /api/board-pack?ws=<id>&board=<id>&select=<kind>:<id>[,<kind>:<id>…][&by=&at=&ends=&hub=&viewer=]
2
+ /* board-pack-route.js — GET /api/board-pack?ws=<id>&board=<id>&select=<kind>:<id>[,<kind>:<id>…][&by=&at=&ends=&hub=&viewer=&view=]
3
3
  * (initiative board-publish, planning/prd/board-publish-prd.md R1; slice 1). Answered by routes-board-premium.js, which lists the prefix and hands the request here:
4
4
  * the pack is made from that route's own answer (the Board's model), so it is the Board's route that serves it.
5
5
  *
@@ -51,7 +51,7 @@ module.exports = {
51
51
  const t = await via(Trail, tk, req, ctx); if (t.body && t.body.ok) answers[tk] = t.body;
52
52
  for (const id of rows) { const lk = '/api/initiative-layout?initiative=' + encodeURIComponent(id) + '&ws=' + encodeURIComponent(ws); const l = await via(Layout, lk, req, ctx); if (l.body && l.body.ok) answers[lk] = l.body; }
53
53
  }
54
- const meta = { by: q.get('by') || '', at: q.get('at') || '', ends: q.get('ends') || '', viewer: q.get('viewer') || '', hub: q.get('hub') || '' };
54
+ const meta = { by: q.get('by') || '', at: q.get('at') || '', ends: q.get('ends') || '', viewer: q.get('viewer') || '', hub: q.get('hub') || '', view: q.get('view') || '' };
55
55
  ctx.json(res, { ok: true, pack: Pack.buildPack({ ws, board, selection, answers, meta }) });
56
56
  } catch (e) { return bad(String((e && e.message) || e).slice(0, 240), /not on this board|Pick at least|at most 2 MB|product, a program/.test(String(e && e.message)) ? 400 : 500); }
57
57
  return true;
@@ -19,6 +19,7 @@
19
19
  const SCHEMA = 'board-pack/1';
20
20
  const MAX_BYTES = 2 * 1024 * 1024;
21
21
  const KINDS = ['product', 'program', 'initiative'];
22
+ const VIEWS = ['track', 'stages', 'time', 'list']; // the Board's views a pack can open on
22
23
 
23
24
  // the parts of the Board's model that the Timeline and the viewer draw
24
25
  const MODEL_KEYS = ['pending', 'workflows', 'today', 'header', 'board', 'initiatives', 'steps', 'rows'];
@@ -135,9 +136,10 @@ function buildPack({ ws, board, selection, answers, meta }) {
135
136
  const m = meta || {};
136
137
  const pack = { schema: SCHEMA, viewer: m.viewer || '', scope, by: m.by || '', at: m.at || '', ends: m.ends || '' };
137
138
  if (m.hub) pack.hub = m.hub;
139
+ if (VIEWS.includes(m.view)) pack.view = m.view; // the publisher's view: the copy opens on it (board-publish R21)
138
140
  pack.responses = sorted;
139
141
  assertSize(pack);
140
142
  return pack;
141
143
  }
142
144
 
143
- module.exports = { SCHEMA, MAX_BYTES, KINDS, MODEL_KEYS, buildPack, assertSize };
145
+ module.exports = { VIEWS, SCHEMA, MAX_BYTES, KINDS, MODEL_KEYS, buildPack, assertSize };
@@ -130,7 +130,7 @@ module.exports = {
130
130
  if (!Host.DAYS.includes(days)) return send({ ok: false, error: 'Ends in 1, 7 or 30 days.' }, 400);
131
131
  sel = { ws: body.ws, board: body.board || body.ws, select: Array.isArray(body.select) ? body.select.map((s) => s.kind + ':' + s.id).join(',') : String(body.select || ''), by: String(body.shared_by || '').slice(0, 60) || sharedBy(), ends: new Date(now + days * 86400000).toISOString() };
132
132
  }
133
- const pk = await makePack(req, ctx, Object.assign({}, sel, { at: new Date(now).toISOString(), viewer: viewerVersion() }));
133
+ const pk = await makePack(req, ctx, Object.assign({}, sel, { at: new Date(now).toISOString(), viewer: viewerVersion(), view: body.view }));
134
134
  if (!pk.ok) return send({ ok: false, error: pk.error }, pk.status || 502);
135
135
  const hits = secretScan.scan(JSON.stringify(pk.pack));
136
136
  if (hits.length) return send({ ok: false, error: 'This board holds what looks like a secret (' + hits.join(', ') + '). Remove it, then publish again.', secrets: hits }, 422);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.471.0",
3
+ "version": "0.473.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.471.0",
9
+ "version": "0.473.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.471.0",
3
+ "version": "0.473.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -40,5 +40,6 @@
40
40
  .bppop .bprow em{font-style:normal;color:var(--ink-3);font-size:12px}.bppop .bprow em.soon{color:var(--bad)}
41
41
  .bppop .bpempty{display:grid;gap:10px;padding:12px 8px 10px;justify-items:start}.bppop .bpempty p{margin:0;color:var(--ink-2)}
42
42
  .bppop :focus-visible{outline:2px solid var(--ember);outline-offset:2px}
43
+ .bd-tools:has(.bppop){position:relative}
43
44
  #bdPublish{position:relative}#bdPublish .bpn{position:absolute;top:2px;right:0;min-width:16px;padding:0 5px;border-radius:99px;background:var(--solid);color:var(--on-solid);font:600 11px var(--mono);text-align:center;line-height:16px}
44
45
  @media (max-width:640px){.bppop{position:fixed;left:0;right:0;bottom:0;top:auto;width:auto;max-width:none;max-height:85vh;border-radius:16px 16px 0 0;border-width:1px 0 0;padding:12px 12px calc(18px + env(safe-area-inset-bottom,0px));box-shadow:0 -8px 30px rgb(0 0 0 / .18)}}
@@ -31,7 +31,7 @@ export function publishHtml(S) {
31
31
  if (S.phase === 'loading') return '<p class="bpnote">Reading your board…</p>';
32
32
  if (!S.host) {
33
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="https://boards.example.com" value="${esc(S.hostIn || '')}"><button type="button" class="bpbtn sm pri" data-bp="savehost">Save</button></div></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>`
35
35
  + (S.err ? `<p class="bperr" role="alert">${esc(S.err)}</p>` : '');
36
36
  }
37
37
  const list = S.links && S.links.length
@@ -65,7 +65,7 @@ export function publishHtml(S) {
65
65
  }
66
66
 
67
67
  function css() {
68
- for (const href of ['/pm/premium-vw-doc.css', '/pm/bd-publish.css']) {
68
+ for (const href of [new URL('./premium-vw-doc.css', import.meta.url).href, new URL('./bd-publish.css', import.meta.url).href]) {
69
69
  if (document.querySelector(`link[href="${href}"]`)) continue;
70
70
  const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = href; document.head.appendChild(l);
71
71
  }
@@ -130,13 +130,13 @@ export function open(btn, ctx) {
130
130
  if (act === 'make') {
131
131
  draw(); if (S.busy) return; S.busy = true; S.err = ''; draw();
132
132
  const select = [...S.sel].map((k) => { const i = k.indexOf(':'); return { kind: k.slice(0, i), id: k.slice(i + 1) }; });
133
- const r = await pmPost('/api/board-publish', { ws: ctx.ws, board: ctx.board || ctx.ws, select, team: S.team.trim(), password: S.pw ? S.pass : '', days: S.days }).catch(() => null);
133
+ const r = await pmPost('/api/board-publish', { ws: ctx.ws, board: ctx.board || ctx.ws, select, team: S.team.trim(), password: S.pw ? S.pass : '', days: S.days, view: ctx.view }).catch(() => null);
134
134
  S.busy = false;
135
135
  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
136
  S.err = (r && r.error) || 'The workspace did not answer. Try again.'; return draw();
137
137
  }
138
138
  if (b.dataset.bpRe) {
139
- S.busy = true; S.err = ''; draw(); const r = await pmPost('/api/board-publish/republish', { id: b.dataset.bpRe }).catch(() => null); S.busy = false;
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
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
141
  }
142
142
  if (b.dataset.bpOff) {
@@ -3,6 +3,7 @@
3
3
  #cShared .bd-dt { grid-template-columns: 40px minmax(0, 1.5fr) 96px 96px minmax(0, 1fr) 84px 70px 130px 190px; }
4
4
  #cShared .bd-dby { display: flex; gap: 6px; justify-content: flex-end; overflow: visible; }
5
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 */
6
7
  #cShared .bdsh-cards { display: none; }
7
8
  #cShared .bd-btn.on { border-color: var(--bad); color: var(--bad); }
8
9
  #cShared .bdsh-join { display: grid; gap: 12px; padding: 22px 8px 14px; justify-items: start; max-width: 560px; }
@@ -23,7 +23,7 @@ const SOON = 36 * 3600 * 1000;
23
23
  const day = (iso) => { try { return new Date(iso).toLocaleDateString(undefined, { day: 'numeric', month: 'short' }); } catch { return ''; } };
24
24
 
25
25
  export function css() {
26
- const href = '/pm/bd-shared.css';
26
+ const href = new URL('./bd-shared.css', import.meta.url).href;
27
27
  if (document.querySelector(`link[href="${href}"]`)) return;
28
28
  const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = href; document.head.appendChild(l);
29
29
  }
@@ -46,7 +46,8 @@ const openable = (S, r) => !r.ended && (r.team ? (S.teams || []).some((t) => t.t
46
46
 
47
47
  function row(S, r) {
48
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>` : '';
49
- const nm = r.ended || !openable(S, r) ? `<span class="bd-dlink" role="rowheader">${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>`;
49
+ 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>`;
50
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>`;
51
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>`;
52
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>`;
@@ -58,7 +59,7 @@ function joinHtml(S) {
58
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)}">`;
59
60
  const body = J.typed
60
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>`
61
- : `<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', 'https://boards.example.com/join#Team.password', J.invite)}<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>`;
62
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>`;
63
64
  }
64
65
 
@@ -58,8 +58,10 @@ import * as BP2 from './bd-pane.js'; // the Board as the first panel: fit(), t
58
58
  const VIEW_KEY = 'pmos.board.view', PVIEW_KEY = 'pmos.board.pview', SPAN_KEY = 'pmos.board.span', GROUPING_KEY = 'pmos.board.grouping';
59
59
  let M = null; // the model
60
60
  let TR = null; // the trail (GET /api/board-trail): { usual, themes, items: { [id]: item } }
61
- let view = ['track', 'stages', 'time', 'list'].includes(store.get(VIEW_KEY)) ? store.get(VIEW_KEY) : 'track';
62
- let pview = ['list', 'stages', 'track', 'time'].includes(store.get(PVIEW_KEY)) ? store.get(PVIEW_KEY) : 'list'; // a phone's view (BdPhone)
61
+ const PACK_VIEW = window.PMOS_READONLY && window.PMOS_READONLY.view; // a published copy opens on the view the publisher was in (board-publish R21)
62
+ const VIEWS = ['track', 'stages', 'time', 'list'];
63
+ let view = window.PMOS_READONLY ? (VIEWS.includes(PACK_VIEW) ? PACK_VIEW : 'track') : VIEWS.includes(store.get(VIEW_KEY)) ? store.get(VIEW_KEY) : 'track';
64
+ let pview = window.PMOS_READONLY ? (view === 'time' ? 'time' : 'track') : ['list', 'stages', 'track', 'time'].includes(store.get(PVIEW_KEY)) ? store.get(PVIEW_KEY) : 'list'; // a phone's view (BdPhone)
63
65
  let span = SPANS.some(([k]) => k === store.get(SPAN_KEY)) ? store.get(SPAN_KEY) : 'quarter';
64
66
  let tab = 'ini';
65
67
  let SH_N = 0; let SH_FULL = false; let SH_LOADED = false; // the Shared tab's number, whether it has read the teams, whether the first count was asked
@@ -850,7 +852,7 @@ $('#bdFilter').addEventListener('click', (e) => Acts.open.filter(e.currentTarget
850
852
  $('#newIni').addEventListener('click', (e) => { if (e.isTrusted) Asks.openNewMenu(e.currentTarget); else Acts.open.new(e.currentTarget); });
851
853
  $('#bdBell').addEventListener('click', (e) => { if (M) Acts.open.bell(e.currentTarget); });
852
854
  // Publish a read-only copy (initiative board-publish, slice 2): one board at a time, so it is not drawn on the All products page
853
- $('#bdPublish').addEventListener('click', (e) => { const btn = e.currentTarget; if (M && !ALL && M.board.ws) import('./bd-publish.js').then((P) => P.open(btn, { ws: M.board.ws, board: M.board.id || M.board.ws })); });
855
+ $('#bdPublish').addEventListener('click', (e) => { const btn = e.currentTarget; if (M && !ALL && M.board.ws) import('./bd-publish.js').then((P) => P.open(btn, { ws: M.board.ws, board: M.board.id || M.board.ws, view })); });
854
856
 
855
857
  /* ── tabs: Initiatives and Documents (Documents has no frame yet: a plain list) ──────────────────────────────────────────────────────── */
856
858
  function setTab(t) {
@@ -19,6 +19,8 @@ export const RO = !!PACK;
19
19
  export const VIEW_CONTROLS = [
20
20
  // the Timeline: the span, a column's sort, back to today, the Deliveries lane, the folds, an initiative's name (opens its viewer)
21
21
  '#bdSpans button', '.tg-chd', '.tg-tback', '.dl-fb', '.dl-dn', '.dl-e[aria-label*="press to open"]', '.bd-fold', '.bd-prdb', 'label.tg-n', 'button.tg-n.ini2',
22
+ // the stage track: the switch between it and the Timeline (the two views a publisher shares), an initiative's name, the Monitor and Evaluate fold
23
+ '#ibTabs [data-v="track"]', '#ibTabs [data-v="time"]', 'button.bt-nm', '#fold',
22
24
  // the viewer: the layout, the close, the folds, the Tasks view menu, a stage's fold and its done tasks
23
25
  '.cz-vw-ib[aria-label="Arrange"]', '.cz-vw-ib[aria-label="Close the viewer"]', '.cz-pn-menu', '[class*="cz-dv"]',
24
26
  '.iv-mctg', '.iv-gx-t', '.iv-ws', '.iv-grp', '.iv-ab-h', '.iv-fr', '.ivx-vb', '.tkc-pop [data-ivs-view]', '.tkc-pop [data-ivs-by]', '.tkc-pop [data-ivs-zoom]',
@@ -27,16 +29,17 @@ export const VIEW_CONTROLS = [
27
29
  ].join(',');
28
30
 
29
31
  /** The Board's static toolbar and chips: hidden, so the page's own script keeps the elements it holds. */
30
- const HIDE = ['.bd-hd', '.bd-tabs', '#crumbHost', '#ibTabs', '#bdFind', '#bdView', '#bdColsw', '#bdSort', '#bdFilter', '#bdBell', '#bdPublish', '#chShared', '#newIni', '.tools-top', '#bdGrpw', '#czFab'];
32
+ const HIDE = ['#ibTabs [data-v="stages"]', '#ibTabs [data-v="list"]', '#bdView', '#bdSpanPick', '.bd-title', '.bd-vr', '.bd-tabs', '#crumbHost', '#bdFind', '#bdColsw', '#bdSort', '#bdFilter', '#bdBell', '#bdPublish', '#chShared', '#newIni', '.tools-top', '#bdGrpw', '#czFab'];
31
33
  /** Controls the code draws that write, or lead to something a share does not hold: removed. */
32
34
  const REMOVE = [
35
+ '.po-grip', '.bd-nxa',
33
36
  '#bdChipset > :not(.tg-lgd)', '#askDates', '.tg-ft',
34
37
  '.cz-vw-ib[aria-label="Discuss in chat"]', '.cz-vw-ib[aria-label="More"]', '.iv-addp', '.iv-prog', '.iv-plus', '.iv-car', '.iv-scgn', '.iv-gx-a',
35
38
  '.ab-lk', '[data-ivs-view="kanban"]', '.ivs-cols', '.ivs-h:has(+ .ivs-cols)', '[data-ivs-more]', '.iv-tasks:has(.iv-q)', '.iv-th .iv-ib', '.iv-th .iv-plus',
36
39
  ];
37
40
  /** Controls whose words are the content (a title, a date, a name, a program's milestone in the Deliveries lane): set as plain text, same look. A program's
38
41
  * milestone opens the program's charter in the workspace; a share does not hold the charter. */
39
- const PLAIN = ['button.dl-e[aria-label*="Program milestone"]:not([aria-label*="press to open"])', 'button.cz-vw-rn', 'button.iv-tt', 'button.iv-dc', 'button.iv-stc', 'button.iv-dtc', 'button.iv-wf', 'button.iv-cb', 'button.tg-pgo', 'button.tg-end'];
42
+ const PLAIN = ['button.dl-e[aria-label*="Program milestone"]:not([aria-label*="press to open"])', 'button.cz-vw-rn', 'button.iv-tt', 'button.iv-dc', 'button.iv-stc', 'button.iv-dtc', 'button.iv-wf', 'button.iv-cb', 'button.tg-pgo', 'button.bt-pgo', 'button.tg-end'];
40
43
  /** A fold whose body goes with it: Documents and Linked are not listed. */
41
44
  const WITH_BODY = ['[data-iv-fold="docs"]', '[data-iv-docs]', '[data-iv-fold="linked"]'];
42
45