create-pmos 0.740.0 → 0.742.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 (35) hide show
  1. package/package.json +260 -54
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-insights-test.js +1 -1
  7. package/workspace/changelog.json +259 -27
  8. package/workspace/guide/breakdown.md +8 -0
  9. package/workspace/guide/cli.md +27 -0
  10. package/workspace/guide/layout.md +2 -4
  11. package/workspace/lib/pmos-verbs.js +6 -0
  12. package/workspace/lib/route-modules.js +1 -0
  13. package/workspace/lib/routes-try.js +39 -0
  14. package/workspace/lib/signal-cli.js +41 -0
  15. package/workspace/lib/try-it.js +194 -0
  16. package/workspace/package-lock.json +2 -2
  17. package/workspace/package.json +1 -1
  18. package/workspace/public/pm/bd-ini-panel.js +1 -1
  19. package/workspace/public/pm/bd-pop-ds.css +3 -5
  20. package/workspace/public/pm/bd-pop-ds.js +26 -4
  21. package/workspace/public/pm/cozy-ev.css +8 -0
  22. package/workspace/public/pm/cozy-pop-work.css +1 -0
  23. package/workspace/public/pm/cozy-pop-work.js +51 -14
  24. package/workspace/public/pm/cozy-settings.js +12 -2
  25. package/workspace/public/pm/cozy-viewer.js +6 -1
  26. package/workspace/public/pm/cozy-vw-shell.css +6 -0
  27. package/workspace/public/pm/home-app.js +6 -1
  28. package/workspace/public/pm/home-ini.js +1 -1
  29. package/workspace/public/pm/live-edit.js +10 -2
  30. package/workspace/public/pm/pop-work-model.js +2 -0
  31. package/workspace/public/pm/try-view.js +99 -0
  32. package/workspace/public/pm/work-tree.js +19 -1
  33. package/workspace/test-lists/artefacts-menu.json +9 -0
  34. package/workspace/test-lists/jira-row-edit.json +9 -0
  35. package/workspace/test-lists/try-what-shipped.json +9 -0
@@ -0,0 +1,194 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* try-it.js — try what shipped (initiative try-what-shipped). After an update, the user tries each change and says if it works.
4
+ * THE ONE WRITER and THE ONE FOLD of <state>/try/answers.jsonl, the list of changes to try, and the `pmos try` command.
5
+ *
6
+ * WHERE THE STEPS COME FROM. Each PR's changelog entry (workspace/changelog.json, written by scripts/kit-changelog.js) may carry
7
+ * try: { steps: [1 to 3], see?, open? }, copied from the PR's Story (Try:, Expect:, Open:). The Builder writes them (factory BUILDER.md).
8
+ * BETA ONLY (Wawan 2026-11-23: "That should only lands on Beta."). A computer on the GA line gets an empty list and no Home row.
9
+ * LOCAL ONLY. The answers stay in the state folder on this computer. Nothing here sends anything. The factory reads the file from the
10
+ * test-bed computer (factory/checker/try-feedback.js; Wawan's card 2026-11-23: "Factory reads it from your computer").
11
+ *
12
+ * THE LEDGER. One line per press, { at, key, v, n, verdict, note?, until? }:
13
+ * key '<version>#<PR number>' (the change) verdict works | broken | note | undo (undo takes the key's answer back)
14
+ * key '*' verdict later, until: 'YYYY-MM-DD' Later hides Today's row until that local day
15
+ *
16
+ * changesOf(appDir) → the installed changelog, raw installedOf(appDir) → the app version
17
+ * listOf({ changes, installed, answers, now, beta }) → { beta, items: [card], total, shown } PURE
18
+ * fold(lines) → { answers: Map key → line, later: 'YYYY-MM-DD' | '' } PURE
19
+ * answer(dir, { key, verdict, note }, list) → { ok, line } | { ok: false, error } refuses a key the list does not hold
20
+ * count(lines, changes, now) → { tried, answered, pct } PURE, the health number
21
+ * rowOf(list, { later, today }) → the Home row or null PURE (public/pm/try-view.js has the same rule for the page)
22
+ * CLI: pmos try [list|works|broken|note|undo|later|count] … (run), and node lib/try-it.js count (the health number on its last line) */
23
+ const fs = require('fs');
24
+ const path = require('path');
25
+
26
+ const TAG = '[try-it]';
27
+ const DAYS = 14;
28
+ const SHOW = 5;
29
+ const VERDICTS = new Set(['works', 'broken', 'note', 'undo']);
30
+ const APP_DIR = path.resolve(__dirname, '..');
31
+
32
+ const ledgerFile = (dir) => path.join(String(dir || ''), 'try', 'answers.jsonl');
33
+ const localDay = (t = Date.now()) => { const d = new Date(t); return new Date(d.getTime() - d.getTimezoneOffset() * 60000).toISOString().slice(0, 10); };
34
+ const vnum = (v) => String(v || '').split('-')[0].split('.').map((x) => Number(x) || 0);
35
+ const vcmp = (a, b) => { const A = vnum(a), B = vnum(b); for (let i = 0; i < 3; i++) if ((A[i] || 0) !== (B[i] || 0)) return (A[i] || 0) - (B[i] || 0); return 0; };
36
+ const str = (x, max) => (typeof x === 'string' ? x.replace(/\s+/g, ' ').trim().slice(0, max) : '');
37
+ const OPEN_RE = /^\/(?!\/)[A-Za-z0-9._~!$&'()*+,;=:@%/?#-]{0,300}$/;
38
+
39
+ function changesOf(appDir = APP_DIR) {
40
+ try { const j = JSON.parse(fs.readFileSync(path.join(appDir, 'changelog.json'), 'utf8')); return Array.isArray(j) ? j : []; } catch { return []; }
41
+ }
42
+ function installedOf(appDir = APP_DIR) {
43
+ try { return JSON.parse(fs.readFileSync(path.join(appDir, 'package.json'), 'utf8')).version || null; } catch { return null; }
44
+ }
45
+ function readLines(dir) {
46
+ try { return fs.readFileSync(ledgerFile(dir), 'utf8').split('\n').filter(Boolean).map((l) => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean); }
47
+ catch { return []; }
48
+ }
49
+
50
+ /** The answers by key (the last press wins; undo removes it) and the Later day. */
51
+ function fold(lines) {
52
+ const answers = new Map(); let later = '';
53
+ for (const l of lines || []) {
54
+ if (!l || typeof l.key !== 'string') continue;
55
+ if (l.key === '*') { if (l.verdict === 'later' && /^\d{4}-\d{2}-\d{2}$/.test(l.until || '')) later = l.until; continue; }
56
+ if (l.verdict === 'undo') answers.delete(l.key); else if (VERDICTS.has(l.verdict)) answers.set(l.key, l);
57
+ }
58
+ return { answers, later };
59
+ }
60
+
61
+ /** One card per change: from versions up to the installed one, in the last DAYS days, with try steps, not a chore, not answered. */
62
+ function cardsOf(changes, installed, now) {
63
+ const out = [];
64
+ for (const e of changes || []) {
65
+ if (!e || typeof e.v !== 'string' || !Array.isArray(e.prs)) continue;
66
+ if (installed && vcmp(e.v, installed) > 0) continue;
67
+ const at = Date.parse(e.at || '');
68
+ if (!Number.isFinite(at) || now - at > DAYS * 864e5) continue;
69
+ for (const p of e.prs) {
70
+ const y = p && p.try;
71
+ if (!y || !Array.isArray(y.steps) || !y.steps.length || p.k === 'x') continue;
72
+ const steps = y.steps.map((s) => str(s, 140)).filter(Boolean).slice(0, 3);
73
+ if (!steps.length) continue;
74
+ const open = typeof y.open === 'string' && OPEN_RE.test(y.open) ? y.open : null;
75
+ out.push({ key: `${e.v}#${p.n == null ? str(p.h || p.t, 40) : p.n}`, v: e.v, n: p.n == null ? null : p.n, at: e.at,
76
+ title: str(p.h || p.t || p.s, 120), kind: p.k || null, steps, see: str(y.see, 200) || null, open });
77
+ }
78
+ }
79
+ return out.sort((a, b) => vcmp(b.v, a.v) || (b.n || 0) - (a.n || 0));
80
+ }
81
+
82
+ function listOf({ changes, installed, answers = new Map(), now = Date.now(), beta = true } = {}) {
83
+ if (!beta) return { beta: false, items: [], total: 0, shown: 0 };
84
+ const open = cardsOf(changes, installed, now).filter((c) => !answers.has(c.key));
85
+ const items = open.slice(0, SHOW);
86
+ return { beta: true, items, total: open.length, shown: items.length };
87
+ }
88
+
89
+ /** Home's one row, or null (zero is silence; Later hides it until its day). */
90
+ function rowOf(list, { later = '', today = localDay() } = {}) {
91
+ if (!list || !list.beta || !list.total) return null;
92
+ if (later && later > today) return null;
93
+ return { key: 'try', go: 'try', title: list.total + (list.total === 1 ? ' new thing to try' : ' new things to try'), sub: 'From your recent updates. Each takes under a minute.' };
94
+ }
95
+
96
+ function append(dir, line) {
97
+ const f = ledgerFile(dir);
98
+ fs.mkdirSync(path.dirname(f), { recursive: true });
99
+ fs.appendFileSync(f, JSON.stringify(line) + '\n');
100
+ }
101
+
102
+ /** A press: works, broken, note (with text), or undo; the key must be a change the list knows (answered ones count for undo). */
103
+ function answer(dir, { key, verdict, note } = {}, { changes = [], installed = null, now = Date.now() } = {}) {
104
+ if (!VERDICTS.has(verdict)) return { ok: false, error: 'verdict is works, broken, note or undo' };
105
+ const known = cardsOf(changes, installed, now).find((c) => c.key === key);
106
+ if (!known) return { ok: false, error: 'no change to try has that key' };
107
+ const text = str(note, 1000);
108
+ if (verdict === 'note' && !text) return { ok: false, error: 'a note needs its text' };
109
+ const line = { at: new Date(now).toISOString(), key, v: known.v, n: known.n, title: known.title, verdict, ...(text ? { note: text } : {}) };
110
+ append(dir, line);
111
+ console.log(`${TAG} ${verdict} ${key}`);
112
+ return { ok: true, line };
113
+ }
114
+ function later(dir, { now = Date.now() } = {}) {
115
+ const until = localDay(now + 864e5);
116
+ const line = { at: new Date(now).toISOString(), key: '*', verdict: 'later', until };
117
+ append(dir, line);
118
+ return { ok: true, line };
119
+ }
120
+
121
+ /** The health number: of the changes with try steps in the last DAYS days, how many got an answer. */
122
+ function count(lines, changes, now = Date.now()) {
123
+ const cards = cardsOf(changes, null, now), { answers } = fold(lines);
124
+ const answered = cards.filter((c) => answers.has(c.key)).length;
125
+ return { tried: cards.length, answered, pct: cards.length ? Math.round((answered / cards.length) * 100) : 0 };
126
+ }
127
+
128
+ /* ── pmos try ─────────────────────────────────────────────────────────────────────────────────────────────── */
129
+ const USAGE = [
130
+ 'usage: pmos try [list|works|broken|note|undo|later|count] — try what shipped in your recent updates (beta only)',
131
+ ' pmos try the changes to try, newest first, each with its steps, what you should see and where to open',
132
+ ' pmos try works <n> it works (n is the number pmos try shows, or the change key 0.738.0#1639)',
133
+ ' pmos try broken <n> [--note "…"] it did not work; the factory takes it first',
134
+ ' pmos try note <n> --note "…" a note on the change',
135
+ ' pmos try undo <n> take your answer back',
136
+ ' pmos try later hide the Today row until tomorrow',
137
+ ' pmos try count answered percent of the last 14 days; the number is on the last line',
138
+ 'Answers stay on this computer. Nothing is sent.',
139
+ ];
140
+ /** The beta line: PMOS_CHANNEL beta/early, else the setting upd.channel=early (the rule lib/kit-update.js channel() states; read here
141
+ * without requiring kit-update, which no other library module may load). */
142
+ function betaOf(env, stateDir) {
143
+ const e = String((env && env.PMOS_CHANNEL) || '').trim().toLowerCase();
144
+ if (e === 'beta' || e === 'early') return true;
145
+ if (e === 'latest' || e === 'ga' || e === 'stable' || !stateDir) return false;
146
+ try { return require('./settings-store.js').get(stateDir, 'upd.channel') === 'early'; } catch { return false; }
147
+ }
148
+
149
+ function ctxOf(o) {
150
+ const stateDir = o.stateDir || require('./state-root.js').defaultRoot({ env: o.env || process.env });
151
+ const appDir = o.appDir || APP_DIR;
152
+ const beta = o.beta != null ? o.beta : betaOf(o.env || process.env, stateDir);
153
+ return { stateDir, changes: changesOf(appDir), installed: installedOf(appDir), beta, now: o.now || Date.now() };
154
+ }
155
+ function run(argv, o = {}) {
156
+ const say = o.say || console.log;
157
+ const args = argv[0] === 'try' ? argv.slice(1) : argv.slice();
158
+ const flag = (k) => { const i = args.indexOf('--' + k); if (i < 0) return null; const v = args[i + 1]; args.splice(i, 2); return v; };
159
+ const note = flag('note');
160
+ const [cmd = 'list', ref] = args;
161
+ if (cmd === 'help' || cmd === '--help') { USAGE.forEach((l) => say(l)); return 0; }
162
+ const C = ctxOf(o), lines = readLines(C.stateDir), F = fold(lines);
163
+ if (cmd === 'count') { const c = count(lines, C.changes, C.now); say(`${TAG} ${c.answered} of ${c.tried} changes answered`); say(String(c.pct)); return 0; }
164
+ if (!C.beta) { say('This computer follows the GA line, so PMOS does not ask you to try changes. Beta computers do.'); return cmd === 'list' ? 0 : 1; }
165
+ const L = listOf({ changes: C.changes, installed: C.installed, answers: F.answers, now: C.now, beta: true });
166
+ if (cmd === 'list') {
167
+ if (!L.total) { say('Nothing new to try.'); return 0; }
168
+ L.items.forEach((c, i) => {
169
+ say(`${i + 1}. ${c.title} (${c.v}) · ${c.key}`);
170
+ c.steps.forEach((s, j) => say(` ${j + 1}) ${s}`));
171
+ if (c.see) say(` You should see: ${c.see}`);
172
+ if (c.open) say(` Open: ${c.open}`);
173
+ });
174
+ if (L.total > L.shown) say(`${L.total - L.shown} more after these.`);
175
+ return 0;
176
+ }
177
+ if (cmd === 'later') { later(C.stateDir, { now: C.now }); say('Hidden from Today until tomorrow.'); return 0; }
178
+ if (!VERDICTS.has(cmd)) { say(`✗ ${cmd} is not a command of pmos try`); USAGE.forEach((l) => say(l)); return 2; }
179
+ if (!ref) { say(`✗ pmos try ${cmd} needs the change: its number in pmos try, or its key`); return 2; }
180
+ const all = cardsOf(C.changes, C.installed, C.now);
181
+ const key = /^\d+$/.test(ref) && Number(ref) <= L.items.length ? L.items[Number(ref) - 1].key : ref;
182
+ const r = answer(C.stateDir, { key: all.some((c) => c.key === key) ? key : ref, verdict: cmd, note }, C);
183
+ if (!r.ok) { say('✗ ' + r.error); return 1; }
184
+ say(cmd === 'works' ? 'Marked as working.' : cmd === 'broken' ? 'Marked as not working. The factory takes it first.' : cmd === 'undo' ? 'Your answer is taken back.' : 'Note kept.');
185
+ return 0;
186
+ }
187
+
188
+ if (require.main === module) {
189
+ const a = process.argv.slice(2);
190
+ if (a[0] === 'count') { const sd = require('./state-root.js').defaultRoot({ env: process.env }); const c = count(readLines(sd), changesOf()); console.log(`${TAG} ${c.answered} of ${c.tried} changes answered`); console.log(String(c.pct)); }
191
+ else process.exitCode = run(a);
192
+ }
193
+
194
+ module.exports = { TAG, DAYS, SHOW, ledgerFile, localDay, vcmp, changesOf, installedOf, readLines, fold, cardsOf, listOf, rowOf, answer, later, count, run, ctxOf, USAGE, COMMANDS: { try: ['list', 'works', 'broken', 'note', 'undo', 'later', 'count'] } };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.740.0",
3
+ "version": "0.742.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.740.0",
9
+ "version": "0.742.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.740.0",
3
+ "version": "0.742.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",
@@ -338,7 +338,7 @@ export function openIni(r, from, o = {}) {
338
338
  // on a desk it opens in the one popup with Ask PMOS about it beside it (slice 2 of the six-place navigation); a phone keeps its sheet
339
339
  const B = (O.M() || {}).board || {};
340
340
  VW.open({ kind: 'Initiative', title: r.title, icon: 'goal', wrap: true, id: vidOf(r), from: 'Work', kindChip: 'Initiative', sub: metaOf(r), pop: { id: r.id || '', kind: 'initiative', title: r.title, ws: r.ws || B.ws || undefined, ...roPop() },
341
- discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: () => { const x = O.rowOf(r.key) || r, b = VW.bodyOf(vidOf(x)); return (PW.on(b) ? PW.moreItems(null, popExtra(x)) : []).concat(iniMore(x)); }, rename: O.rename ? O.rename(r) : null,
341
+ discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: () => { const x = O.rowOf(r.key) || r, b = VW.bodyOf(vidOf(x)); return (PW.on(b) ? PW.moreItems(null, popExtra(x), b) : []).concat(iniMore(x)); }, rename: O.rename ? O.rename(r) : null,
342
342
  // the kind of work (batch 29 item 11, KdV1-3): its glyph stands before Discuss; a tap opens the three kinds. A published copy
343
343
  // (pm/readonly.js) cannot change it, so it has no press: the Board's icon still names the kind
344
344
  presses: (window.PMOS_READONLY ? [] : [WK.pressOf(r.kind)]).concat(dashFor(r) ? dashFor(r).presses() : []), onPress: (a, b) => {
@@ -2,14 +2,12 @@
2
2
  * boards WorkPopupDS, WorkGanttDS, WorkCaseEmptyDS). It only places the parts pm/bd-pop-ds.js draws (pm-block, pm-sug x, pm-tabs, pm-gt,
3
3
  * pm-dia, pm-now, pm-group, pm-li, pm-fold, pm-input); the look is the system's. */
4
4
 
5
- /* ── two columns: the work on the left, the case and its artefacts on the right ── */
6
- .pw.pwd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: var(--space-16); align-items: start; padding-bottom: var(--space-24); }
7
- .pwd-main, .pwd-side { display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; }
5
+ /* ── one column: the Overview, then the Stages and the breakdown at the full width; the artefacts are in ⋯ (artefacts-in-more-menu) ── */
6
+ .pw.pwd { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-16); align-items: start; padding-bottom: var(--space-24); }
7
+ .pwd-main { display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; }
8
8
  .pwd-blk { gap: var(--space-12); }
9
9
  .pwd-bh { justify-content: space-between; gap: var(--space-8); }
10
10
  .pwd-bh .pm-h-sm { margin: 0; }
11
- @container (max-width: 860px) { .pw.pwd { grid-template-columns: minmax(0, 1fr); } }
12
- @media (max-width: 1100px) { .pw.pwd { grid-template-columns: minmax(0, 1fr); } }
13
11
 
14
12
  /* ── Where it stands ── */
15
13
  .pwd-say { margin: 0; font-size: var(--fs-body); line-height: 24px; }
@@ -11,6 +11,7 @@
11
11
  * caseHtml(W, o) → The case: its lines (each editable), the facts; no line written: one Suggestion to draft them all
12
12
  * overviewHtml(W, r, o) → Overview: Where it stands, The case and its facts in one block that folds; folded, the one-line summary
13
13
  * artsHtml(arts) → Artefacts: a List with Add in the head
14
+ * artMenu(arts, o) → the ⋯ menu's Artefacts section (the desk popup has no side card)
14
15
  * stageKeyOf(text, st) → { key, name, title } the stage a captured line names ("… in Plan"), else the stage in progress
15
16
  *
16
17
  * The UI says PMOS, never Claude. Buttons are icons with aria-label. */
@@ -181,15 +182,18 @@ export function listHtml(rows, W, o = {}) {
181
182
  // a priority set in the row (inline-sprint-priority) says itself first; none, nothing
182
183
  const sub = x.jsub ? [x.who && x.who !== 'You' ? x.who : '', x.date].filter(Boolean).join(' · ') : [x.priority || '', x.date, x.who && x.who !== 'You' ? x.who : ''].filter(Boolean).join(' · ');
183
184
  // the tick (WorkStatesDS 3): marks it done, with Undo; a done task and a Jira ticket show their state only
184
- const box = x.done ? `<span class="pwd-ck dn" aria-label="Done" role="img">${SV(I.ok, 14)}</span>`
185
+ // a Jira ticket's box moves it in Jira, done or not (jira-row-edit): To do, In progress or Done, asked of Jira (pm/jira-move.js)
186
+ const E = WT.editOf(x, !!o.ro);
187
+ const box = E.status === 'jira' ? `<button type="button" class="pwd-ck${x.done ? ' dn' : ''}" data-pw-jstat="${esc(x.uid)}" aria-haspopup="menu" aria-label="${esc('Status in Jira: ' + (x.jst || x.status) + '. Move it in Jira')}" title="${esc('Jira · ' + (x.jmv ? 'moving to ' + x.status : x.jst || x.status))}">${SV(x.done ? I.ok : x.ms ? I.dia : I.box, 14)}</button>`
188
+ : x.done ? `<span class="pwd-ck dn" aria-label="Done" role="img">${SV(I.ok, 14)}</span>`
185
189
  : o.ro || x.jira ? `<span class="pwd-ck" aria-hidden="true">${SV(x.ms ? I.dia : I.box, 14)}</span>`
186
190
  : `<button type="button" class="pwd-ck" data-pw-tick="${esc(x.uid)}" aria-label="${esc('Mark ' + x.title + ' done')}" title="Mark it done">${SV(x.ms ? I.dia : I.box, 14)}</button>`;
187
- const title = x.jira || o.ro || x.done ? `<span class="t">${esc(x.title)}</span>` : `<button type="button" class="t pwd-tt" data-pw-name="${esc(x.uid)}" aria-label="${esc('Rename ' + x.title)}">${esc(x.title)}</button>`;
191
+ const title = !E.name || x.done ? `<span class="t">${esc(x.title)}</span>` : `<button type="button" class="t pwd-tt" data-pw-name="${esc(x.uid)}" aria-label="${esc('Rename ' + x.title)}">${esc(x.title)}</button>`;
188
192
  // on hover (WorkStatesDS 1): Who, Due date, Stage and More, each a small picker; a Jira ticket keeps Jira's owner and stage
189
193
  const ab = (attr, label, d) => `<button type="button" class="pm-btn" ${attr} aria-label="${esc(label)}" title="${esc(label)}">${SV(d)}</button>`;
190
194
  const acts = o.ro ? '' : '<span class="acts">'
191
195
  + (x.jira || x.done ? '' : ab(`data-pw-who="${esc(x.uid)}" aria-haspopup="menu"`, 'Who: ' + (x.who || 'no one'), I.who))
192
- + (x.done ? '' : ab(`data-pw-date="${esc(x.uid)}" aria-haspopup="dialog"`, x.date ? (x.ms ? 'Date: ' : 'Due: ') + x.date : 'Set a date', I.cal))
196
+ + (x.done || !E.dates ? '' : ab(`data-pw-date="${esc(x.uid)}" aria-haspopup="dialog"`, x.date ? (x.ms ? 'Date: ' : 'Due: ') + x.date : 'Set a date', I.cal))
193
197
  + (x.jira ? '' : ab(`data-pw-stage="${esc(x.uid)}" aria-haspopup="menu"`, 'Stage', I.stage))
194
198
  // Sprint and Priority (inline-sprint-priority): an open PMOS task only; Jira keeps its tickets' own
195
199
  + (x.jira || x.done ? '' : ab(`data-pw-sprint="${esc(x.uid)}" aria-haspopup="menu"`, 'Sprint', I.sprint) + ab(`data-pw-prio="${esc(x.uid)}" aria-haspopup="menu"`, 'Priority: ' + (x.priority || 'none'), I.flag))
@@ -197,7 +201,7 @@ export function listHtml(rows, W, o = {}) {
197
201
  // a parent (WorkSubtasksDS): the fold chevron, "n of m done" with its bar; children indent one step per level, up to three
198
202
  const chev = x.kids ? `<button type="button" class="pwd-chev" data-pw-sub="${esc(x.uid)}" aria-expanded="${!!x.open}" aria-label="${esc((x.open ? 'Fold ' : 'Open ') + x.title)}">${SV(x.open ? I.down : I.right, 14)}</button>` : (x.depth || (o.nested && !x.depth) ? '<span class="pwd-chev sp" aria-hidden="true"></span>' : '');
199
203
  const prog = x.kids ? `<span class="pwd-prog" aria-hidden="true"><i style="width:${x.nLeaf ? Math.round((x.nDone / x.nLeaf) * 100) : 0}%"></i></span><span class="pm-meta pwd-cnt">${esc(x.count)}</span>` : '';
200
- const jira = keyChip(x) + (x.jsub ? ' <span class="pm-meta">Jira sub-task</span>' : '');
204
+ const jira = keyChip({ ...x, jurl: WT.chipUrl(x, rows) }) + (x.jmv ? ' <span class="pm-meta">Moving in Jira</span>' : '') + (x.jsub ? ' <span class="pm-meta">Jira sub-task</span>' : '');
201
205
  const dot = epicDot(x, o.epics);
202
206
  // drag (work-subtasks-followups): onto a task nests it, left takes it out; a Jira sub-task stays under its ticket
203
207
  const drag = o.drag && !o.ro && !x.jsub ? ' draggable="true"' : '';
@@ -310,6 +314,24 @@ export function artsHtml(arts, o = {}) {
310
314
  return `<section class="pm-block pwd-blk pwd-arts" aria-label="Artefacts"><div class="pm-row pwd-bh"><h2 class="pm-h-sm">Artefacts</h2>${add}</div>${o.merge || ''}${rows || '<p class="pm-meta">Nothing yet.</p>'}</section>`;
311
315
  }
312
316
 
317
+ /** The ⋯ menu's Artefacts section (artefacts-in-more-menu, Wawan 2026-11-23: the side card took the width the Stages need). arts: the model's
318
+ * artefacts (each row's `art` is its index, as openArt reads it). o: { ro, merge: { say } (the ✦ line) }.
319
+ * → [{ head }, { label, icon, merge }?, { label, sub, icon, art } | { label, sub, icon, missing, disabled }, …, { label, icon, add }?, { sep }]
320
+ * Read only with nothing to open: []. */
321
+ export function artMenu(arts, o = {}) {
322
+ const R = (arts || []).map((a, i) => ({ a, i })).filter((x) => x.a && !(o.ro && x.a.missing));
323
+ if (o.ro && !R.length) return [];
324
+ const out = [{ head: 'Artefacts' }];
325
+ if (o.merge && o.merge.say && !o.ro) out.push({ label: o.merge.say, icon: I.star, merge: true });
326
+ for (const { a, i } of R) {
327
+ const sub = a.missing ? String(a.missing) : [a.kindName || a.kind, a.when, a.olds && a.olds.length ? a.olds.length + ' earlier' : ''].filter(Boolean).join(' · ');
328
+ out.push(a.missing ? { label: a.title || '', sub, icon: iconOf(a), missing: true, disabled: true } : { label: a.title || '', sub, icon: iconOf(a), art: i });
329
+ }
330
+ if (!o.ro) out.push({ label: 'Add an artefact', icon: I.plus, add: true });
331
+ out.push({ sep: true });
332
+ return out;
333
+ }
334
+
313
335
  /** Who can have a task (WorkStatesDS 1): You first, then the people who own tasks of this initiative, then PMOS. → [{ k, label, pmos? }] */
314
336
  export function whoOf(rows, cur = '') {
315
337
  const S = new Set();
@@ -542,6 +542,14 @@
542
542
  .ev-st.pm-ds svg.ev-gbar .bg { fill: var(--well); }
543
543
  .ev-st.pm-ds svg.ev-gbar .fg { fill: var(--leaf); }
544
544
 
545
+ /* try-what-shipped (pm/try-view.js): the changes to try, one card each, in Settings › Updates and in the Viewer from Home. Tokens only. */
546
+ .try-list { display: flex; flex-direction: column; gap: var(--space-12); }
547
+ .try-list .try-card { display: flex; flex-direction: column; gap: var(--space-8); }
548
+ .try-list .try-steps { margin: 0; padding-left: var(--space-24); }
549
+ .try-list .try-acts { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; }
550
+ .try-list .try-note { display: block; width: 100%; box-sizing: border-box; margin-top: var(--space-4); font: inherit; }
551
+ @media (max-width: 640px) { .try-list .try-acts .ev-btn { min-height: 44px; flex: 1 1 40%; } }
552
+
545
553
  /* ── the ? list of action keys (pm/action-keys.js, bet A477): a Komorebi sheet over the page; its parts are pm-h-sm, pm-row, pm-kbd, pm-meta, pm-btn.
546
554
  * It takes the width of its rows, never wider than the window less space-16 a side, and its head and list are reached through those parts. ── */
547
555
  .ev-keys.pm-ds { border: 0; border-radius: var(--radius-card); background: var(--card); color: var(--ink); box-shadow: var(--lift); padding: var(--space-24); width: fit-content; max-width: calc(100% - var(--space-32)); }
@@ -218,6 +218,7 @@ button.pw-osrc:hover { color: var(--cz-ink2); }
218
218
  .hi-pop .pw-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: var(--fs-meta); color: var(--cz-ink2); padding: 5px 10px; cursor: pointer; }
219
219
  .hi-pop .pw-seg button[aria-checked="true"] { background: var(--cz-card); color: var(--cz-ink); font-weight: var(--fw-strong); box-shadow: 0 0 0 1px var(--cz-hair); }
220
220
  .hi-pop .pw-jn { margin: 6px 0 0; color: var(--cz-ink3); }
221
+ .pw-st .pw-jmv { color: var(--cz-ink3); font-size: inherit; }
221
222
  .pw-addty { flex: none; display: inline-flex; align-items: center; gap: var(--space-4); border: 0; border-radius: var(--radius-pill); background: none; font: inherit; font-size: var(--fs-meta); color: var(--cz-ink3); padding: 2px var(--space-8); cursor: pointer; margin-right: 10px; }
222
223
  .pw-addty:hover, .pw-addty.on { background: var(--cz-well); color: var(--cz-ink); }
223
224
  /* a Details value that opens something reads in the link colour; a value read from the work stays plain (round 3 design check) */
@@ -24,6 +24,7 @@ import { pmGet, pmPost } from './http.js';
24
24
  import * as LE from './live-edit.js'; // an edit shows at once: this popup is drawn again the moment a task write is sent, and after each read
25
25
  import * as VW from './cozy-viewer.js';
26
26
  import * as ED from './ini-edit.js';
27
+ import * as JM from './jira-move.js'; // a Jira ticket's status, moved in Jira (jira-row-edit)
27
28
  import * as SW from './cozy-status-when.js'; // When did this happen? after a status pick (round 3 point 18)
28
29
  import * as DP from './cozy-day-pick.js'; // the app's own day form, "15 Oct 2026"
29
30
  import { mountRange, rangeHtml } from './range-pick.js'; // start and due on one calendar, like a flight's depart and return
@@ -259,11 +260,17 @@ function barHtml(x, W) {
259
260
  return CB.taskBar(x, X, W.today);
260
261
  }
261
262
  function rowHtml(x, W, C, sugRows) {
262
- const jc = W.jc ? (x.kind === 'task' ? `<span class="pw-jc">${PD.keyChip(x)}${PD.epicDot(x, W.epics || [])}</span>` : '<span class="pw-jc"></span>') : '';
263
- if (RO) { x = { ...x, jira: true }; sugRows = new Map(); } // a copy: a task's status, date and name are text, as a Jira task's are; no ✦
263
+ // a Jira row's key chip opens the ticket: its own link, else the same site's link with its key (jira-row-edit)
264
+ const chip = (q) => PD.keyChip({ ...q, jurl: WT.chipUrl(q, W.rows) }) + PD.epicDot(q, W.epics || []);
265
+ const jc = W.jc ? (x.kind === 'task' ? `<span class="pw-jc">${PD.keyChip({ ...x, jurl: WT.chipUrl(x, W.rows) })}${PD.epicDot(x, W.epics || [])}</span>` : '<span class="pw-jc"></span>') : '';
266
+ // what the row lets the PM change, the same for every Jira row (jira-row-edit): a published copy changes nothing and shows no ✦
267
+ const E = WT.editOf(x, RO);
268
+ if (RO) sugRows = new Map();
264
269
  const tl = C.tl ? `<div class="pw-tl">${(x.kind === 'stage' || x.kind === 'task') ? barHtml(x, W) : ''}${W.tx != null ? `<i class="pw-now" style="left:${W.tx.toFixed(2)}%"></i>` : ''}</div>` : '';
265
- const stc = C.status ? `<span class="pw-st">${x.kind === 'task' && !x.jira ? `<button type="button" class="pw-cell" data-pw-status="${esc(x.uid)}" aria-haspopup="menu" aria-label="${esc('Status: ' + x.status + '. Change it')}">${esc(x.status)}</button>` : esc(x.status || '')}</span>` : '';
266
- const dtc = C.date ? `<span class="pw-dt${x.late ? ' warn' : ''}">${x.kind === 'task' && !x.jira ? `<button type="button" class="pw-cell${x.date ? '' : ' empty'}" data-pw-date="${esc(x.uid)}" aria-label="${esc((x.date ? (x.ms ? 'Milestone ' : 'Due ') + x.date : 'No date') + '. Set the date, or make it a ' + (x.ms ? 'task' : 'milestone'))}">${esc(x.date || 'Set a date')}</button>` : esc(x.date || '')}</span>` : '';
270
+ // the status: a PMOS task's opens its list; a Jira ticket's moves it in Jira, and says "Moving in Jira" until Jira answers
271
+ const jst = E.status === 'jira' ? `<button type="button" class="pw-cell" data-pw-jstat="${esc(x.uid)}" aria-haspopup="menu" aria-label="${esc('Status in Jira: ' + (x.jst || x.status) + '. Move it in Jira')}" title="Status, moved in Jira">${esc(x.status)}${x.jmv ? ' <small class="pw-jmv">Moving in Jira</small>' : ''}</button>` : '';
272
+ const stc = C.status ? `<span class="pw-st">${jst || (E.status === 'pmos' ? `<button type="button" class="pw-cell" data-pw-status="${esc(x.uid)}" aria-haspopup="menu" aria-label="${esc('Status: ' + x.status + '. Change it')}">${esc(x.status)}</button>` : esc(x.status || ''))}</span>` : '';
273
+ const dtc = C.date ? `<span class="pw-dt${x.late ? ' warn' : ''}">${E.dates ? `<button type="button" class="pw-cell${x.date ? '' : ' empty'}" data-pw-date="${esc(x.uid)}" aria-label="${esc((x.date ? (x.ms ? 'Milestone ' : 'Due ') + x.date : 'No date') + '. Set the date, or make it a ' + (x.ms ? 'task' : 'milestone'))}">${esc(x.date || 'Set a date')}</button>` : esc(x.date || '')}</span>` : '';
267
274
  if (x.kind === 'stage') {
268
275
  const lead = `<button type="button" class="pw-stg" data-pw-fold="${esc(x.key)}" aria-expanded="${x.open}"${x.can ? '' : ' disabled'}><span class="pw-n">${esc(x.n)}</span><b>${esc(x.name)}</b>${x.can ? SVG(x.open ? P.down : P.right, 14) : ''}<small>${esc(x.count)}</small></button>`;
269
276
  const ls = x.loose ? sugRows.get('stage:') : null; // the one ✦ of the Not in a stage row (round 3 point 21)
@@ -273,10 +280,10 @@ function rowHtml(x, W, C, sugRows) {
273
280
  if (x.kind === 'far') return `<div class="pw-tr pw-sr" role="row"><span class="pw-it"><button type="button" class="pw-stg" data-pw-far aria-expanded="false"><span class="pw-n">${esc(x.n)}</span><b>${esc(x.name)}</b>${SVG(P.right, 14)}<small>${esc(x.count)}</small></button></span>${jc}${stc}${C.date ? '<span></span>' : ''}${tl}</div>`;
274
281
  if (x.kind === 'more') return `<div class="pw-tr pw-dr" role="row"><span class="pw-it"><button type="button" class="pw-dn" data-pw-more="${esc(x.key)}" aria-expanded="false">${esc(x.label)}${SVG(P.right, 14)}</button></span>${jc}${C.status ? '<span></span>' : ''}${C.date ? '<span></span>' : ''}${C.tl ? '<div class="pw-tl"></div>' : ''}</div>`;
275
282
  const s = sugRows.get(x.uid);
276
- const title = x.jira ? `<span class="pw-tt">${esc(x.title)}</span>` : `<button type="button" class="pw-tt" data-pw-name="${esc(x.uid)}" aria-label="${esc('Rename ' + x.title)}">${esc(x.title)}</button>`;
283
+ const title = !E.name ? `<span class="pw-tt">${esc(x.title)}</span>` : `<button type="button" class="pw-tt" data-pw-name="${esc(x.uid)}" aria-label="${esc('Rename ' + x.title)}">${esc(x.title)}</button>`;
277
284
  // subtasks (WorkSubtasksDS): indent one step per level, a parent's fold and count; a Jira row's key chip and the epic check's dot (WorkJiraDS)
278
285
  const chev = x.kids ? `<button type="button" class="pw-chev" data-pw-sub="${esc(x.uid)}" aria-expanded="${!!x.open}" aria-label="${esc((x.open ? 'Fold ' : 'Open ') + x.title)}">${SVG(x.open ? P.down : P.right, 13)}</button>` : '';
279
- const more2 = (x.kids ? `<small class="pw-cnt">${esc(x.count)}</small>` : '') + (W.jc ? '' : PD.keyChip(x) + PD.epicDot(x, W.epics || []));
286
+ const more2 = (x.kids ? `<small class="pw-cnt">${esc(x.count)}</small>` : '') + (W.jc ? '' : chip(x));
280
287
  return `<div class="pw-tr pw-kr${x.done ? ' done' : ''}${x.lit ? ' lit' : ''}${x.kids ? ' par' : ''}${RSEL.has(String(x.uid)) ? ' sel' : ''}" role="row" data-pw-row="${esc(x.uid)}" data-pw-sec="${esc(x.sec)}"${x.depth ? ` style="--pw-d:${x.depth}"` : ''}><span class="pw-it">${chev}<i class="pw-bul${x.ms ? ' ms' : ''}" aria-hidden="true"></i>${title}${more2}${RO ? '' : ib(`data-pw-open="${esc(x.uid)}"`, 'Open the task', P.open, 'xs hov') + ib(`data-pw-row-more="${esc(x.uid)}" aria-haspopup="menu"`, 'More for ' + x.title, P.more, 'xs hov')}</span>${jc}${stc}${dtc}${tl}</div>`
281
288
  + (s ? `<div class="pw-tr pw-sugrow" role="row"><span class="pw-it">${sugLine(s, true)}</span></div>` : '');
282
289
  }
@@ -393,12 +400,11 @@ function dsHtml(r, v, o, W, S, C, mode) {
393
400
  const wbs = view === 'gantt'
394
401
  ? breakdownHtml(W, C, mode, false, S).replace('<h3>Work breakdown</h3>', head('gantt') + (S.sel.size ? SEL.barHtml(S.sel.size, { epic: epicSel }) : '')).replace('class="pw-sec"', 'class="pw-sec pm-block pwd-blk pwd-wbs"')
395
402
  : `<section class="pm-block pwd-blk pwd-wbs" aria-label="Work breakdown">${S.sel.size ? '' : head('list')}${PD.listHtml(stF, W, { looseN: W.looseN, epics, fix, ask, sel: S.sel, nested: st.some((x) => x.kids), drag: canDrag(), group, epicSel })}</section>`;
396
- const mg = mergeOf(W.artefacts), merge = mg ? `<div class="pw-sugs pw-amg" role="list" aria-label="PMOS suggests">${sugLine({ id: mg.id, say: mg.say, merge: mg })}</div>` : '';
397
403
  // the done test's acceptance criteria on the initiative's Jira tickets (jira-criteria-write): its ✦ above the breakdown, unless the PM said no
398
404
  const crit = S.sel.size || dropped().has('crit:' + id) ? '' : critSugHtml(CRIT.get(id));
399
405
  // Overview (Wawan, 2026-11-23): Where it stands, The case and its facts in one block across the top; folded or open is the person's choice
400
- return `<div class="pw pwd">${PD.overviewHtml(W, r, { oid: id, dropped: dropped(), open: ovOpen() })}<div class="pwd-main">${PD.stagesHtml(st, W)}${crit}${wbs}</div>`
401
- + `<aside class="pwd-side">${PD.artsHtml(W.artefacts, { merge })}</aside></div>`;
406
+ // one column (artefacts-in-more-menu, Wawan 2026-11-23): the Stages and the breakdown take the full width; the artefacts are in ⋯ (moreItems)
407
+ return `<div class="pw pwd">${PD.overviewHtml(W, r, { oid: id, dropped: dropped(), open: ovOpen() })}<div class="pwd-main">${PD.stagesHtml(st, W)}${crit}${wbs}</div></div>`;
402
408
  }
403
409
 
404
410
  /** The grouping ✦ the PM said no to, for this initiative: 'group:<stage>'. */
@@ -720,6 +726,7 @@ export function wire(body, h0, x0) {
720
726
  if ('pwAddty' in d) { S.msAdd = !S.msAdd; const f = b.closest('.pw-add'), k = f && f.querySelector('[data-pw-add]') && f.querySelector('[data-pw-add]').dataset.pwAdd; redraw(); if (k != null) setTimeout(() => { const i = body.querySelector(`[data-pw-add="${window.CSS.escape(k)}"]`); if (i) i.focus(); }, 0); return; }
721
727
  if (d.pwFact) { fact(d.pwFact, b, c, h); return; }
722
728
  if (d.pwStatus) { statusMenu(b, d.pwStatus, h, c); return; }
729
+ if (d.pwJstat) { jiraStatusMenu(b, d.pwJstat, h, c); return; }
723
730
  if (d.pwDate) { dateMenu(b, d.pwDate, c, h); return; }
724
731
  if (d.pwName) { rename(b, d.pwName, h); return; }
725
732
  if ('pwPhall' in d) { if (PH_ALL.has(c.id)) PH_ALL.delete(c.id); else PH_ALL.add(c.id); redraw(); return; } // a phone: the other stages unfold (PhoneWorkDS)
@@ -908,6 +915,22 @@ function statusMenu(btn, uid, h, c) {
908
915
  w.querySelector('[data-sw]')?.focus();
909
916
  }, { label: 'Status', focus: '[aria-checked="true"]' });
910
917
  }
918
+ /* A Jira ticket's status (jira-row-edit, Wawan 2026-11-23 "why some Jira can edit but some cannot?"): To do, In progress or Done, asked of
919
+ * Jira through the jira-move agent with the PM's own connection (pm/jira-move.js). The row shows the pick at once (pm/live-edit.js), says
920
+ * "Moving in Jira" until Jira answers, and the toast says what Jira did: moved (with Undo), refused (Jira's reason), or not reached. */
921
+ function jiraStatusMenu(btn, uid, h, c) {
922
+ const row = (c && c.W.rows.find((x) => x.uid === uid)) || {}, key = WT.keyOf(row) || row.jkey || '';
923
+ if (!key) return;
924
+ const from = JM.TO.includes(row.status) ? row.status : /progress|review/i.test(row.status || '') ? 'In progress' : row.done ? 'Done' : 'To do';
925
+ openPop(btn, 'pw-status', JM.TO.map((s) => `<button type="button" class="hi-mi" role="menuitemradio" aria-checked="${s === from}" data-st="${esc(s)}">${esc(s)}</button>`).join('')
926
+ + `<p class="hi-small pw-jn">${esc('Moves ' + key + ' in Jira' + (row.jst ? '. Jira says ' + row.jst + ' now' : '') + '.')}</p>`, (b) => {
927
+ const to = b.dataset.st; if (!to) return;
928
+ closePop();
929
+ if (to === from) return;
930
+ const at = h.where ? h.where() : {};
931
+ JM.move({ ...h, where: () => at, __id: () => String((c && c.id) || '') }, { key, to, from, fromRaw: row.jst || '' });
932
+ }, { label: 'Status in Jira', focus: '[aria-checked="true"]' });
933
+ }
911
934
  /* Task or Milestone (round 3 point 2), in three places that do the same write (pm/ini-edit.js milestone, the host's Undo): the choice on top
912
935
  * of the date popup, the row's ⋯, and the add row. A task has Start and Due; a milestone one Date. A Jira task's change is PMOS-only. */
913
936
  const jiraNote = (row) => (row.jira ? '<p class="hi-small pw-jn">PMOS only. Jira is not changed.</p>' : '');
@@ -930,12 +953,13 @@ function rowMenu(btn, uid, c, h, body) {
930
953
  + `<button type="button" class="hi-mi" role="menuitem" data-k="open">${SVG(P.open, 14)} Open the task</button>`
931
954
  // subtasks (WorkSubtasksDS): make it a subtask of another task, or move it out of its parent
932
955
  + (row.jsub ? '' : `<button type="button" class="hi-mi" role="menuitem" data-k="under" aria-haspopup="menu">${SVG(P.right, 14)} Make subtask of…</button>`)
933
- + (row.up && !row.jsub ? `<button type="button" class="hi-mi" role="menuitem" data-k="out">${SVG(P.show, 14)} Move out of ${esc(((c.W.rows.find((q) => q.uid === row.up) || {}).title) || 'its parent')}</button>` : '') + jiraNote(row), (b) => {
956
+ + (row.up && !row.jsub ? `<button type="button" class="hi-mi" role="menuitem" data-k="out">${SVG(P.show, 14)} Move out of ${esc(((c.W.rows.find((q) => q.uid === row.up) || {}).title) || 'its parent')}</button>` : '')
957
+ + (row.jira ? '<p class="hi-small pw-jn">Status moves in Jira. Dates and kind are PMOS only.</p>' : ''), (b) => {
934
958
  const k = b.dataset.k;
935
959
  if (k === 'under') { parentMenu(btn, [uid], c, h, body.__pwx); return; }
936
960
  if (k === 'out') { closePop(); runBulk([uid], 'parent', '', c, h, body.__pwx); return; }
937
961
  // Status opens its own list (and its "when did this happen" line) in place of this menu
938
- if (k === 'status') { statusMenu(btn, uid, h, c); return; }
962
+ if (k === 'status') { if (row.jira) jiraStatusMenu(btn, uid, h, c); else statusMenu(btn, uid, h, c); return; }
939
963
  closePop();
940
964
  if (k === 'kind') setKind(row, !row.ms, h);
941
965
  else if (k === 'open') openSmall(uid, c, h, body.__pwx, body);
@@ -1356,14 +1380,27 @@ async function addArt(x, h) {
1356
1380
  onAdded: async () => { ITEMS.delete(o.id); if (h.reload) await h.reload(); VW.back(); } });
1357
1381
  }
1358
1382
 
1359
- /** The ⋯ entries the popup adds before the host's own: every part of the old page, as a drill-in, and every suggestion. */
1360
- export function moreItems(x, h) {
1361
- const out = [];
1383
+ /** The ⋯ entries the popup adds before the host's own: the initiative's Artefacts first (desk layout only; a phone lists them in the page),
1384
+ * every part of the old page, as a drill-in, and every suggestion. body: the popup body the host drew into (it carries the wired handlers). */
1385
+ export function moreItems(x, h, body) {
1386
+ const out = artItems(body);
1362
1387
  if (h.allParts) out.push({ label: 'Every part', on: () => h.allParts() });
1363
1388
  if (h.props) out.push({ label: 'Everything PMOS suggests', on: () => h.props() });
1364
1389
  return out.length ? out.concat({ sep: true }) : out;
1365
1390
  }
1366
1391
 
1392
+ /** The Artefacts section of ⋯ (artefacts-in-more-menu): read when ⋯ opens, so an artefact just added is there. The presses are the ones the
1393
+ * side card had: open full screen with Back, add, and the ✦ merge goes to the chat. */
1394
+ function artItems(body) {
1395
+ if (!body || !body.__pwx || !body.querySelector || !body.querySelector('.pw.pwd')) return [];
1396
+ const x = body.__pwx, h = body.__pwh || {}, r = x.r(), v = x.v();
1397
+ if (!r || !v) return [];
1398
+ const W = model(r, v, x.o()).W, mg = mergeOf(W.artefacts);
1399
+ return PD.artMenu(W.artefacts, { ro: RO, merge: mg }).map((it) => ({ ...it, top: true })).map((it) => (it.art != null ? { ...it, on: () => openArt(W.artefacts[it.art], h, x) }
1400
+ : it.add ? { ...it, on: () => addArt(x, h) }
1401
+ : it.merge ? { ...it, on: () => { if (!sendToChat(mg.ask) && h.toast) h.toast('Open Ask PMOS to send this.'); } } : it));
1402
+ }
1403
+
1367
1404
  /* ── one level up: a program or a product (boards 26, 27) ── */
1368
1405
  export function levelHtml(L, o = {}) {
1369
1406
  const W = M.levelOf(L, { today: o.today, mode: store.get(SPAN, 'full') }), C = cols(), mode = store.get(SPAN, 'full');
@@ -397,7 +397,7 @@ function updates() {
397
397
  const acts = T.phase === 'busy' ? '' : `<button type="button" class="ev-btn sm" data-ev-upd="check"${T.busy ? ' disabled' : ''}>Check now</button>${ready() ? `<button type="button" class="ev-btn sm dark" data-ev-upd="update">${appBehind() ? 'Restart to update' : 'Update'}</button>` : ''}`;
398
398
  const kits = (T.ws || []).filter((w) => !w.linked).map((w) => { const k = T.st[w.id], kit = k && k.kit; return trow(w.label || w.name || w.id, kit && kit.present ? 'kit ' + (kit.version || 'vendored by hand') : 'no kit in this workspace', k && k.kitBehind && L ? `<span class="pm-badge blue">${esc(L)} ready</span>` : kit && kit.present && (k.lastCheck || k.latest) ? '<span class="pm-badge">Up to date</span>' : ''); }).join('');
399
399
  const last = s.lastCheck ? 'Last checked ' + new Date(s.lastCheck.at).toLocaleString() + '. ' : '';
400
- return `<div class="ev-card ev-upd first">${mood ? adFace(mood) : ''}<div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="pm-meta">${esc(last)}${s.checkDaily ? 'PMOS checks when you open Updates and once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p>${weeks()}`;
400
+ return `<div class="ev-card ev-upd first">${mood ? adFace(mood) : ''}<div class="ev-tx ev-grow">${head}</div>${acts}</div>${kits}<p class="pm-meta">${esc(last)}${s.checkDaily ? 'PMOS checks when you open Updates and once a day while a page is open; Check now asks again.' : 'PMOS checks only when you press Check now.'}</p><div data-try-host></div>${weeks()}`;
401
401
  }
402
402
  /** Design E (UpE). A story line: a blue dot for New, an amber dot for Fixed, no dot for Improved; Claude's plain title, then the sentence. */
403
403
  const SPARK = 'M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z';
@@ -582,6 +582,7 @@ function draw() {
582
582
  cardRows(el.querySelector('.ev-st-main')); el.querySelectorAll('.ev-st-main .sc-w').forEach(cardRows);
583
583
  if (disposeClaudeSetup) { disposeClaudeSetup(); disposeClaudeSetup = null; }
584
584
  wfPanel(el);
585
+ tryPanel(el);
585
586
  const setup = el.querySelector('[data-claude-setup]');
586
587
  if (setup) disposeClaudeSetup = mountClaudeSetup(setup, { ws: wsParam() || (T.ws && T.ws[0] && T.ws[0].id) || '', onReady: () => {} });
587
588
  const cur = el.querySelector('.ev-st-nav [aria-current="page"]'); if (cur && cur.scrollIntoView) cur.scrollIntoView({ block: 'nearest', inline: 'nearest' }); // on a phone the section row scrolls: keep the open one in view
@@ -595,6 +596,15 @@ function cardRows(root) {
595
596
  [...root.children].forEach((k) => { if (k.classList.contains('ev-trow')) run.push(k); else flush(); });
596
597
  flush();
597
598
  }
599
+ /** Updates › To try (try-what-shipped): pm/try-view.js draws the changes to try into one node kept across redraws, so an answer in
600
+ * progress is not lost when the status line redraws. Beta only; nothing to try draws nothing. */
601
+ let TRY = null;
602
+ function tryPanel(el) {
603
+ const spot = el.querySelector('[data-try-host]');
604
+ if (!spot) return;
605
+ if (!TRY) { TRY = document.createElement('div'); TRY.className = 'try-host'; import('./try-view.js').then((TV) => TV.mountTry(TRY, { toast, head: true })).catch(() => {}); }
606
+ spot.replaceWith(TRY);
607
+ }
598
608
  /** Workspaces › Workflows (UI grill U1): pm/wf-page.js draws into its host, the same node across redraws; leaving it lets it go. */
599
609
  let WF = null, wfOpts = {};
600
610
  function wfPanel(el) {
@@ -841,7 +851,7 @@ async function load() {
841
851
  T.prods = pk ? pk.products : b && b.ok && b.model && b.model.products ? b.model.products.available || [] : [];
842
852
  if (!w || !Array.isArray(w.workspaces)) T.msg = 'The repositories could not be read.'; else if (!p || !p.ok) T.msg = 'The connectors could not be read.';
843
853
  draw();
844
- await Promise.all(T.ws.map(async (x) => { const r = await pmGet('/api/kit/status?ws=' + encodeURIComponent(x.id)); if (r && r.ok) T.st[x.id] = r; }));
854
+ await Promise.all((T.ws || []).map(async (x) => { const r = await pmGet('/api/kit/status?ws=' + encodeURIComponent(x.id)); if (r && r.ok) T.st[x.id] = r; }));
845
855
  draw();
846
856
  openCheck();
847
857
  }
@@ -419,6 +419,9 @@ function itemsOf(X, b) {
419
419
  const items = ((typeof X.cur.more === 'function' ? X.cur.more() : X.cur.more) || []).filter(Boolean).slice(); // a function is asked each time ⋯ opens, so its notes are current
420
420
  // on a phone the presses marked menu lead the menu (they left the header)
421
421
  if (X.ph || X.pop) { const mp = (X.cur.presses || []).filter((x) => x && x.act && x.label && (X.ph ? x.menu : !x.solid)); if (mp.length) items.unshift(...mp.map((x) => ({ label: x.label, icon: x.icon, on: () => { if (typeof X.cur.onPress === 'function') X.cur.onPress(x.act, b); } })), { sep: true }); }
422
+ // a section marked top (an initiative's Artefacts, artefacts-in-more-menu) leads the menu, before the presses that left the header
423
+ const top = items.filter((x) => x && x.top);
424
+ if (top.length) { const rest = items.filter((x) => !(x && x.top)); items.length = 0; items.push(...top, ...rest); }
422
425
  if (X.cur.url) { // the item's own address looks back, so it goes before the red stop-or-remove group, which stays last
423
426
  const at = items.findIndex((x) => x && x.danger), tab = { label: X.cur.full ? 'Open in full' : 'Open in a new tab', on: () => window.open(X.cur.url, '_blank', 'noopener') };
424
427
  if (at < 0) items.push({ sep: true }, tab); else items.splice(at > 0 && items[at - 1].sep ? at - 1 : at, 0, { sep: true }, tab);
@@ -448,7 +451,9 @@ function moreMenu(b) {
448
451
  const items = lead.concat(itemsOf(V, b), places.length ? [{ sep: true }, ...places] : []);
449
452
  const m = document.createElement('div');
450
453
  m.className = 'cz-vw-menu'; m.setAttribute('role', 'menu'); m.setAttribute('aria-label', 'More'); m.dataset.escLayer = '1';
451
- m.innerHTML = items.map((it, i) => (it.sep ? '<hr>' : `<button type="button" role="menuitem" data-cz-vw-mi="${i}"${it.danger ? ' class="bad"' : ''}${it.disabled ? ' disabled' : ''}>${it.icon ? svg(path(it.icon), 16) : ''}<span>${esc(it.label)}</span>${it.note || it.hint ? `<span class="k">${esc(it.note || it.hint)}</span>` : ''}</button>`)).join('');
454
+ // a head names a section (an initiative's Artefacts, artefacts-in-more-menu); a sub is an item's second line (its kind and day)
455
+ if (items.some((it) => it && it.sub)) m.classList.add('cz-vw-menu2');
456
+ m.innerHTML = items.map((it, i) => (it.sep ? '<hr>' : it.head ? `<p class="cz-vw-mh" role="presentation">${esc(it.head)}</p>` : `<button type="button" role="menuitem" data-cz-vw-mi="${i}"${it.danger ? ' class="bad"' : ''}${it.disabled ? ' disabled' : ''}${it.sub ? ` title="${esc(it.label)}"` : ''}>${it.icon ? svg(path(it.icon), 16) : ''}${it.sub ? `<span class="cz-vw-m2"><span>${esc(it.label)}</span><small>${esc(it.sub)}</small></span>` : `<span>${esc(it.label)}</span>`}${it.note || it.hint ? `<span class="k">${esc(it.note || it.hint)}</span>` : ''}</button>`)).join('');
452
457
  m.addEventListener('click', (e) => {
453
458
  const x = e.target.closest('[data-cz-vw-mi]'); if (!x) return;
454
459
  const it = items[+x.dataset.czVwMi]; m.remove(); b.setAttribute('aria-expanded', 'false');
@@ -55,6 +55,12 @@ body.cz-vw-drag, body.cz-vw-drag * { cursor: col-resize !important; user-select:
55
55
  .cz-vw-menu hr { border: 0; border-top: 1px solid var(--cz-hair); margin: var(--space-4) 6px; }
56
56
  .cz-vw-menu .k { margin-left: auto; color: var(--cz-ink3); font-size: var(--fs-meta); line-height: var(--lh-meta); }
57
57
  .cz-vw-menu .bad { color: var(--cz-red); }
58
+ .cz-vw-menu.cz-vw-menu2 { width: 300px; max-height: min(70vh, 560px); overflow-y: auto; }
59
+ .cz-vw-menu .cz-vw-mh { margin: 0; padding: var(--space-8) 10px var(--space-4); color: var(--cz-ink3); font: var(--fw-strong) var(--fs-meta)/var(--lh-meta) var(--cz-sans); }
60
+ .cz-vw-menu .cz-vw-m2 { display: flex; flex-direction: column; min-width: 0; padding: 6px 0; }
61
+ .cz-vw-menu .cz-vw-m2 > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
62
+ .cz-vw-menu .cz-vw-m2 > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cz-ink3); font-weight: var(--fw-regular); font-size: var(--fs-meta); line-height: var(--lh-meta); }
63
+ .cz-vw-menu button:disabled .cz-vw-m2 > small { color: var(--cz-red); }
58
64
  /* the trail list (batch 14 item 7, canvas NvADesk, NvAPhoneTrail): hover ← → on a desk, hold it on a phone; newest first, then the page */
59
65
  .cz-vw-hd [data-cz-vw="fwd"] { margin-left: -6px; }
60
66
  .cz-vw-trail { position: absolute; width: 280px; max-height: 60vh; overflow: auto; background: var(--cz-card); border-radius: var(--radius-card); box-shadow: var(--cz-sheet), 0 0 0 1px var(--cz-hair); padding: 6px; z-index: 7; display: flex; flex-direction: column; gap: 2px; }