create-pmos 0.740.0 → 0.741.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.740.0",
3
+ "version": "0.741.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": {
@@ -33,6 +33,25 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.741.0",
38
+ "at": "2026-11-23T09:00:39.651Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1657,
43
+ "t": "Initiative artefacts move into ⋯; Stages and Work breakdown take the full width",
44
+ "s": "Initiative artefacts move into ⋯; Stages and Work breakdown take the full width",
45
+ "k": "new"
46
+ },
47
+ {
48
+ "n": 1658,
49
+ "t": "Every Jira task in a work breakdown can be changed the same way",
50
+ "s": "Every Jira task in a work breakdown can be changed the same way",
51
+ "k": "fix"
52
+ }
53
+ ]
54
+ },
36
55
  {
37
56
  "v": "0.740.0",
38
57
  "at": "2026-11-23T08:20:40.488Z",
@@ -417,19 +436,6 @@
417
436
  "k": "new"
418
437
  }
419
438
  ]
420
- },
421
- {
422
- "v": "0.716.0",
423
- "at": "2026-11-22T20:55:20.302Z",
424
- "f": 4,
425
- "prs": [
426
- {
427
- "n": 1586,
428
- "t": "One-minute ease check per page from the local use log (job #1585)",
429
- "s": "One-minute ease check per page from the local use log (job #1585)",
430
- "k": "new"
431
- }
432
- ]
433
439
  }
434
440
  ]
435
441
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@96c77699
1
+ kernel-source: pmos@8efbf548
2
2
  assembled: 2026-11-23
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-11-23T08:20:36Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T09:00:36Z"}
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-11-23T08:20:36Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T09:00:36Z"}
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-11-23T08:20:36Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T09:00:36Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,23 @@
1
1
  [
2
+ {
3
+ "v": "0.741.0",
4
+ "at": "2026-11-23T09:00:39.651Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1657,
9
+ "t": "Initiative artefacts move into ⋯; Stages and Work breakdown take the full width",
10
+ "s": "Initiative artefacts move into ⋯; Stages and Work breakdown take the full width",
11
+ "k": "new"
12
+ },
13
+ {
14
+ "n": 1658,
15
+ "t": "Every Jira task in a work breakdown can be changed the same way",
16
+ "s": "Every Jira task in a work breakdown can be changed the same way",
17
+ "k": "fix"
18
+ }
19
+ ]
20
+ },
2
21
  {
3
22
  "v": "0.740.0",
4
23
  "at": "2026-11-23T08:20:40.488Z",
@@ -59,6 +59,14 @@ PMOS does not change the stage, owner or status of a Jira ticket. It skips these
59
59
 
60
60
  A task that is linked to a Jira ticket shows the ticket key. Select the key to open the ticket in Jira. A task that is only in PMOS shows no key. The Jira sub-tasks of a ticket show under the ticket.
61
61
 
62
+ Every Jira ticket in the breakdown has the same controls:
63
+
64
+ - **Status** moves the ticket in Jira. Select the status, then select **To do**, **In progress** or **Done**. The new status shows at once, with **Moving in Jira** until Jira answers. The message then says that Jira moved the ticket, with **Undo**. If Jira refuses, the ticket goes back and the message gives Jira's reason.
65
+ - **Dates** and the **name** change in PMOS only. Jira does not change.
66
+ - A Jira sub-task shows under its ticket. Only its status can change.
67
+
68
+ A ticket that PMOS has not read from Jira yet still opens in Jira when you select its key.
69
+
62
70
  A red dot on a ticket shows that it has no epic, or that its epic is not one of the initiative's epics. Hold the pointer on the dot to see why. Above the list, PMOS suggests a fix: put the tickets under the initiative's epic. When you select ✓:
63
71
 
64
72
  - PMOS sets the epic directly only on the tickets that are assigned to you. It uses your own Atlassian connection.
@@ -176,16 +176,14 @@ On a computer the popup is built from the parts of the PMOS design system. The t
176
176
  - **The case.** **Problem**, **Goal** and **Done when** from the initiative's records. Press a line to change it. A line not written offers a PMOS draft (✦) or ✕. When no line is written yet, one suggestion offers to draft them all from what is linked: ✓ sends the request to the chat, ✕ says not this, and the pencil lets you write it yourself. When the chat saves a line, the case shows it as soon as the chat's turn ends, with no reload and no commit. It also reads its lines again when you come back to the page.
177
177
  - **Details.** The facts: dates, the next milestone, product, program, workflow and what is open.
178
178
 
179
- Under it, the left column has two blocks:
179
+ Under it, two blocks use the full width of the popup:
180
180
 
181
181
  - **Stages.** Each stage of the workflow, with its dates under its name or "no dates yet", on a month scale with a red line for today. A stage's bar runs from the earliest start to the latest end of its tasks; a task with no start counts from its due date. Only a stage with no dated task uses the days the workflow moved through it. To change a stage's dates, change its tasks' dates. A stage has a bar only when it has real dates. A milestone is a diamond on its stage's row.
182
182
  - **Work breakdown.** **List** or **Gantt**; PMOS keeps your choice on this computer. **List** has one box on top: type a task and press Enter. Say its stage ("… in Plan"), or it goes to the stage in progress; start with ◇ to add a milestone. Each stage with tasks is one group that says how much is done, for example "1 of 3 done". Press the group to fold it, and press it again to open it. A stage whose tasks are all done is folded until you open it. In a stage, the tasks are in date order, a late task first. A done task stays in its place, in grey with a check. Stages with no tasks fold into one line at the end. Press the box before a task to mark it done, with **Undo**. Press its name to rename it: Enter saves and Escape cancels. When you point at the row, four icons show: **Who** (You, the people on this initiative, or **PMOS does it**, which gives the task to PMOS), **Due date**, **Stage** (moves the task to another stage) and ⋯ (**Status**, **Make it a milestone** and **Open the task**). Each change has **Undo**. A Jira ticket keeps its owner and stage from Jira. **Gantt** is the table described below, with its bars.
183
183
 
184
184
  Press the rest of a row, or a milestone, to open it as a full popup in place of the work side. Its top line has ←, the path (**Work › product › initiative**), the chat button, ⋯ and ×. ← or the initiative's name goes back to the initiative, where you left it. The chat button shows **Ask PMOS** beside it. × closes the popup. A task shows its status, dates, owner, notes and what changed. A milestone also shows its date and how many days are left, the done test, **Kill if**, and the suggestion from PMOS about it when there is one.
185
185
 
186
- The right column has one block:
187
-
188
- - **Artefacts.** The brief, the prototype and the documents, each with its kind and date. A document the gate needs that nobody wrote is grey and says which gate. + adds a file, a link or a new document. After a merge, the merged file stands and says how many earlier files it holds, for example "7 earlier". An old file folds under it when its frontmatter has `superseded_by:` with the merged file's path, or when it opens with the merge's "superseded by" note. The merge suggestion then goes away by itself.
186
+ **Artefacts** are at the top of the initiative's ⋯ menu: the brief, the prototype and the documents, each with its kind and date. Press one to open it full screen, with ← back to the initiative. A document the gate needs that nobody wrote is grey and says which gate. **Add an artefact** adds a file, a link or a new document; it is in the menu the next time you open ⋯. When PMOS suggests a merge, the suggestion is the first row of the section. After a merge, the merged file stands and says how many earlier files it holds, for example "7 earlier". An old file folds under it when its frontmatter has `superseded_by:` with the merged file's path, or when it opens with the merge's "superseded by" note. The merge suggestion then goes away by itself.
189
187
 
190
188
  On a phone, in a shared read-only copy and in a breakdown given the whole popup, the work side keeps the three parts below. They use the full width of the popup: in a wide popup the timeline gets the extra width. A done task shows in grey text, never struck through.
191
189
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.740.0",
3
+ "version": "0.741.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.741.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.741.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();
@@ -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');
@@ -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; }
@@ -498,7 +498,7 @@ export function iniPage(o = {}) {
498
498
  let rename = X.ctx.renameIni ? X.ctx.renameIni(id, '') : null;
499
499
  if (rename) rename = { ...rename, value: X.ctx.iniTitle(id) };
500
500
  const dh = dashFor(id);
501
- BODY = VW.open({ id: 'ov:' + id, kind: X.ctx.kindOf(id), title: X.ctx.iniTitle(id), icon: 'goal', wrap: true, more: () => (PW.on(BODY) ? PW.moreItems(null, popExtra(id)) : []).concat(pageMore(id), PW.on(BODY) && !PW.inPop(BODY) ? moreOf(id, 'page').filter((x) => x.sep || /full record|Sprint/.test(x.label)) : []), rename, // a phone's page (Ph2_init) keeps the record and the sprint pop: o.pop || undefined,
501
+ BODY = VW.open({ id: 'ov:' + id, kind: X.ctx.kindOf(id), title: X.ctx.iniTitle(id), icon: 'goal', wrap: true, more: () => (PW.on(BODY) ? PW.moreItems(null, popExtra(id), BODY) : []).concat(pageMore(id), PW.on(BODY) && !PW.inPop(BODY) ? moreOf(id, 'page').filter((x) => x.sep || /full record|Sprint/.test(x.label)) : []), rename, // a phone's page (Ph2_init) keeps the record and the sprint pop: o.pop || undefined,
502
502
  discuss: () => X.ctx.newIn(id), discussHome: true, // the one view (OvViewers): Discuss starts a new session about it, where + New session was
503
503
  // the kind of work (batch 29 item 11, KdV1-3): its glyph stands before Discuss; a tap opens the three kinds
504
504
  presses: [WK.pressOf(kindNow(id))].concat(dh ? dh.presses() : []), onPress: (a, btn) => {
@@ -35,6 +35,10 @@ export const FIELDS = {
35
35
  parent: ['parent'],
36
36
  };
37
37
  const TASK_WRITE = /^\/api\/boards\/tasks\/(state|edit|rename|add|delete|bulk)(?:\?|$)/;
38
+ // a Jira ticket's status asked from PMOS (pm/jira-move.js): the ticket shows its new status at once; a refused ask puts it back. Jira's own
39
+ // answer comes later, by the read and the move's toast (jira-row-edit)
40
+ const JIRA_MOVE = /^\/api\/jira\/move(?:\?|$)/;
41
+ const JIRA_TO = ['To do', 'In progress', 'Done'];
38
42
  const JIRA_KEY = /^[A-Z][A-Z0-9]+-\d+$/i;
39
43
  const isJira = (id) => JIRA_KEY.test(id) && !/^task-/i.test(id); // a PMOS task id is task-<hex>, which can be all digits
40
44
  const DAY = /^\d{4}-\d{2}-\d{2}$/;
@@ -58,6 +62,10 @@ function pick(body, rename) {
58
62
  * { kind: 'remove', id } tasks/delete
59
63
  * { kind: 'add', ini, row } tasks/add: a row drawn under its initiative until the read brings the real one */
60
64
  export function opsOf(path, body) {
65
+ if (JIRA_MOVE.test(String(path || ''))) {
66
+ const key = body && typeof body.key === 'string' ? body.key.trim().toUpperCase() : '';
67
+ return JIRA_KEY.test(key) && JIRA_TO.includes(body.to) && body.to !== body.from ? [{ kind: 'patch', id: key, fields: { state: body.to } }] : null;
68
+ }
61
69
  const m = TASK_WRITE.exec(String(path || ''));
62
70
  if (!m || !body || typeof body !== 'object') return null;
63
71
  const w = m[1];
@@ -252,7 +260,7 @@ export function install(g = globalThis) {
252
260
  const method = String((init && init.method) || (input && typeof input === 'object' && input.method) || 'GET').toUpperCase();
253
261
  if (method === 'POST' && url && init && typeof init.body === 'string') {
254
262
  const p = new URL(url, 'http://x').pathname;
255
- if (TASK_WRITE.test(p)) le = begin(p, JSON.parse(init.body));
263
+ if (TASK_WRITE.test(p) || JIRA_MOVE.test(p)) le = begin(p, JSON.parse(init.body));
256
264
  }
257
265
  } catch { le = null; }
258
266
  if (!le) return real.call(this, input, init);
@@ -305,6 +305,8 @@ function taskRow(x, t) {
305
305
  const dl = x.end ? dateLate(x.end, t, !x.closed) : { text: x.start ? 'from ' + dayText(x.start, t) : '', late: false };
306
306
  const st = taskStatus(x);
307
307
  return { kind: 'task', uid: x.uid, title: x.title, who: x.owner || '', status: st, date: dl.text, late: dl.late, start: x.start || '', end: x.end || '', since: x.since || '', done: !!x.closed, ms: !!x.ms, jira: !!x.jkey, canCheck: !!x.canCheck,
308
+ // a Jira ticket's own status name and a move PMOS asked that Jira has not answered (jira-row-edit): the status press moves it in Jira
309
+ ...(x.jkey ? { jkey: x.jkey, jst: x.jst || '', ...(x.jmove && x.jmove.state === 'moving' ? { jmv: true } : {}) } : {}),
308
310
  prog: /progress|review/i.test(st), wont: !!x.wont || st === "Won't do",
309
311
  // subtasks and Jira (initiative work-subtasks): the parent, the chip's key and link, the epic as read, the assignee, a Jira sub-task
310
312
  parent: x.parent || '', ckey: x.ckey || x.jkey || '', jurl: x.jurl || '', ...(x.jepic !== undefined ? { jepic: x.jepic, jepicName: x.jepicName || '' } : {}), jassignee: x.jassignee || '', jtype: x.jtype || '',
@@ -62,11 +62,29 @@ const doneCat = (s) => s && (s.category === 'done' || /^(done|closed|resolved|re
62
62
  export function subRows(row) {
63
63
  return ((row && row.jsubs) || []).filter((s) => s && s.key).map((s) => ({ kind: 'task', uid: s.key, title: s.summary || s.key, parent: row.uid, jira: true, jkey: s.key, ckey: s.key, jsub: true,
64
64
  jurl: row.jurl ? String(row.jurl).replace(/\/browse\/[^/?#]+/, '/browse/' + s.key) : '', closed: !!doneCat(s), done: !!doneCat(s), status: doneCat(s) ? 'Done' : /progress|review|doing/i.test(String(s.status || '')) ? 'In progress' : 'To do',
65
- start: '', end: '', owner: '' }));
65
+ start: '', end: '', owner: '', jst: String(s.status || '') }));
66
66
  }
67
67
 
68
68
  /** The Jira key a row's chip shows: the linked ticket's, else the one the task names that PMOS read. */
69
69
  export const keyOf = (row) => (row && (row.ckey || row.jkey)) || '';
70
+ /** The link a row's key chip opens (jira-row-edit): its own, else the same site's link of any other row with the key swapped in. A ticket
71
+ * PMOS pushed, or read before its link was, then still opens in Jira, so no chip is grey for want of a link. '' when no row has one. */
72
+ export function chipUrl(row, rows) {
73
+ const k = keyOf(row);
74
+ if (!k) return '';
75
+ if (row.jurl && /^https:\/\//.test(row.jurl)) return row.jurl;
76
+ const r = (rows || []).find((x) => x && x.jurl && /^https:\/\/[^/]+\/browse\//.test(x.jurl));
77
+ return r ? r.jurl.replace(/\/browse\/[^/?#]+/, '/browse/' + k) : '';
78
+ }
79
+ /** What a breakdown row lets the PM change (jira-row-edit, Wawan 2026-11-23 "why some Jira can edit but some cannot?"). The same for every
80
+ * Jira row: status moves the ticket in Jira (pm/jira-move.js); start, due and name are PMOS's own (the date popup says "PMOS only").
81
+ * A Jira sub-task PMOS only read has no PMOS task under it: its status moves in Jira, its dates and name stay Jira's.
82
+ * → { status: 'jira' | 'pmos', dates, name } ro: a published read-only copy, where nothing changes. */
83
+ export function editOf(row, ro = false) {
84
+ if (ro || !row || row.kind !== 'task') return { status: '', dates: false, name: false };
85
+ if (row.jsub) return { status: 'jira', dates: false, name: false };
86
+ return { status: row.jira ? 'jira' : 'pmos', dates: true, name: true };
87
+ }
70
88
  export function epicFlag(row, epics) {
71
89
  if (!row || !keyOf(row) || row.jsub || row.jsubOf || isSubType(row.jtype)) return '';
72
90
  if (row.jepic == null) return ''; // not read: PMOS says nothing it has not read
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "artefacts-in-more-menu (done test AM1-AM5): the initiative popup's artefacts move into its ⋯ menu so the Stages and Work breakdown use the full width. Pure menu items plus a read of the page code. No browser.",
3
+ "modules": [
4
+ "artefacts-menu.test.js"
5
+ ],
6
+ "seconds": {
7
+ "artefacts-menu.test.js": 1
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "jira-row-edit: every Jira task in a work breakdown offers the same changes (pure, node): pm/work-tree.js editOf and chipUrl, pm/live-edit.js Jira moves, pm/pop-work-model.js Jira fields, and a read of pm/cozy-pop-work.js and pm/bd-pop-ds.js.",
3
+ "modules": [
4
+ "jira-row-edit.test.js"
5
+ ],
6
+ "seconds": {
7
+ "jira-row-edit.test.js": 1
8
+ }
9
+ }