create-pmos 0.621.0 → 0.623.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.621.0",
3
+ "version": "0.623.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,32 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.623.0",
38
+ "at": "2026-11-19T05:21:06.341Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1405,
43
+ "t": "Work's bars stop at the timeline's edge at every span",
44
+ "s": "Work's bars stop at the timeline's edge at every span",
45
+ "k": "fix"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "v": "0.622.0",
51
+ "at": "2026-11-19T05:05:08.698Z",
52
+ "f": 4,
53
+ "prs": [
54
+ {
55
+ "n": 1403,
56
+ "t": "Work breakdown back to stages with their tasks; no-stage tasks in the Backlog",
57
+ "s": "Work breakdown back to stages with their tasks; no-stage tasks in the Backlog",
58
+ "k": "fix"
59
+ }
60
+ ]
61
+ },
36
62
  {
37
63
  "v": "0.621.0",
38
64
  "at": "2026-11-19T04:46:30.709Z",
@@ -422,38 +448,6 @@
422
448
  "k": "fix"
423
449
  }
424
450
  ]
425
- },
426
- {
427
- "v": "0.603.0",
428
- "at": "2026-11-18T08:43:23.637Z",
429
- "f": 4,
430
- "prs": [
431
- {
432
- "n": 1345,
433
- "t": "Timeline bars and axis labels start on their day, under the Today line",
434
- "s": "Timeline bars and axis labels start on their day, under the Today line",
435
- "k": "fix"
436
- },
437
- {
438
- "n": 1346,
439
- "t": "A finished initiative's lateness counts to when it finished, not today",
440
- "s": "A finished initiative's lateness counts to when it finished, not today",
441
- "k": "fix"
442
- }
443
- ]
444
- },
445
- {
446
- "v": "0.602.0",
447
- "at": "2026-11-18T08:32:03.899Z",
448
- "f": 4,
449
- "prs": [
450
- {
451
- "n": 1344,
452
- "t": "Prototype like Figma: pages, screens, layers, an inspector, and Play with the flow beside it",
453
- "s": "Prototype like Figma: pages, screens, layers, an inspector, and Play with the flow beside it",
454
- "k": "new"
455
- }
456
- ]
457
451
  }
458
452
  ]
459
453
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@ccc5bd71
1
+ kernel-source: pmos@5d20acf4
2
2
  assembled: 2026-11-19
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-19T04:46:27Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-19T05:21:02Z"}
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-19T04:46:27Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-19T05:21:02Z"}
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-19T04:46:27Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-19T05:21:02Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.623.0",
4
+ "at": "2026-11-19T05:21:06.341Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1405,
9
+ "t": "Work's bars stop at the timeline's edge at every span",
10
+ "s": "Work's bars stop at the timeline's edge at every span",
11
+ "k": "fix"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.622.0",
17
+ "at": "2026-11-19T05:05:08.698Z",
18
+ "f": 4,
19
+ "prs": [
20
+ {
21
+ "n": 1403,
22
+ "t": "Work breakdown back to stages with their tasks; no-stage tasks in the Backlog",
23
+ "s": "Work breakdown back to stages with their tasks; no-stage tasks in the Backlog",
24
+ "k": "fix"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.621.0",
4
30
  "at": "2026-11-19T04:46:30.709Z",
@@ -95,14 +95,13 @@ A phone keeps its own layout. A shared read-only Board has no popup.
95
95
  The work side has three parts, top to bottom.
96
96
 
97
97
  - **Overview.** Three short lines from the initiative's own records: **Problem**, **Goal** (with the goal it serves, by name) and **Done when**. A line with no record says **Not written yet.** and offers a draft with ✓ and ✕. Press a line to change it; it saves when you leave the field, with **Undo**. Then one line on where it stands, **PMOS suggests** (at most three, each with ✓ and ✕), and **Details ›** for the facts: Stage, Status, Start, Target end, Next milestone, Goal, Product, Program, Workflow and Open. A fact with no value is not shown. Goal, Product, Program and Next milestone are in the link colour and open their thing; the others are plain text. An initiative that is closed or done but has open tasks shows one suggestion: **Close them** or **Reopen**.
98
- - **Work breakdown.** The stages are one row: the initiative's own steps, with its bar on the timeline. Press a stage to see its dates. The first line is its action: **Move to** another stage, or **Mark … done** on the stage now; after the press it asks when it happened. A done stage has a tick. Under the stages, **Tasks** is one list with the Backlog's own columns and groups (Jira ticket, Epic, Who, Due, State), this initiative's tasks only. A task has no stage. Press a task's name to open it on top. The four-corners icon shows each task with its date and bar on the timeline. **Open in Backlog** opens Work › Backlog on this initiative. When the task list cannot be read, the older view below shows instead.
99
- - **Work breakdown, the older view.** Each stage is a row that folds and says how much is done, for example "3 of 9 done". Only the stage in progress opens by itself. In a long stage you see the late tasks, the tasks in progress and the next five, then **N more tasks**. Done tasks fold to one line, and the stages after the next one fold to one row. **Not in a stage** is one folded row at the end; open it to see its tasks (PMOS remembers this for each initiative), or press ✓ on its suggestion to put them in the stage in progress, with **Undo**. The timeline is on the right, with **Today** on it. Drag the grip between the columns and the timeline to make the timeline wider or narrower; a double press puts it back. Choose its span (Quarter to Full) beside the tune icon, which shows or hides columns. The four-corners icon gives the breakdown the whole popup. Type in the last row of a stage to add a task; the **Task** choice beside it makes the next one a milestone.
98
+ - **Work breakdown.** Each stage is a row that folds and says how much is done, for example "3 of 9 done". Only the stage in progress opens by itself. In a long stage you see the late tasks, the tasks in progress and the next five, then **N more tasks**. Done tasks fold to one line, and the stages after the next one fold to one row. A task in no stage is not in the breakdown: it is in Work › Backlog, and one quiet line under the breakdown says how many, for example **2 tasks with no stage are in the Backlog ›**. A task with no date shows no date and is never late. The timeline is on the right, with **Today** on it. Drag the grip between the columns and the timeline to make the timeline wider or narrower; a double press puts it back. Choose its span (Quarter to Full) beside the tune icon, which shows or hides columns. The four-corners icon gives the breakdown the whole popup. Type in the last row of a stage to add a task; the **Task** choice beside it makes the next one a milestone.
100
99
  - **Status.** Press a task's status and pick the new one. **When did this happen?** shows under the list, with **Today** chosen: press the status again, or Enter, to keep today. Press **Yesterday**, or **Pick a date**, when the work moved earlier than you noted it. A day in the future, or a day before the task's previous move, cannot be picked. The toast says both days, for example "Done on 14 Nov, noted today.", with **Undo**.
101
- - **Open the task.** The ↗ on a row, or **Open the task** in its ⋯, opens a small popup on top: Task or Milestone, the name (press it to rename), status, dates, owner and notes. Its status asks **When did this happen?** too. ↑ and ↓ go to the task before or after it, and ⋯ has **Make it a milestone** and **Archive**, with **Undo**. Escape, × or a press outside closes only the small popup, and the task's row lights for a moment.
100
+ - **Open the task.** The ↗ on a row, or **Open the task** in its ⋯, opens a small popup on top: Task or Milestone, the name (press it to rename), status, dates, owner and notes. Its status asks **When did this happen?** too. ↑ and ↓ go to the task before or after it, and ⋯ has **Make it a milestone**, **Archive** and **Delete**, each with **Undo**. A change shows on the task's row at once. Escape, × or a press outside closes only the small popup, and the task's row lights for a moment.
102
101
  - **Dates.** Press a task's date. **Task | Milestone** on top turns it into a milestone (one Date) or back into a task (Start and Due). Write a day as "15 Oct 2026", or press the calendar icon. The row's ⋯ also has **Make it a milestone** and **Open the task**.
103
102
  - **Artefacts.** One row for each kind, such as PRD, Prototype brief or Minutes, with its newest file. **Version** shows when there are more, and opens the earlier ones. When one kind has several different files, one suggestion above the table offers to merge them into one artefact for each kind; nothing is deleted. A document opens as the document page, read from the initiative's own product. When it cannot be read, the page says why, with **Retry**. A link opens in a new tab. The last row adds a file, a link or a new document.
104
103
 
105
- **Moving a stage** asks **When did this happen?** in the same way, on the Board's Stage menu and on the initiative's stage buttons. A stage move cannot be dated before the initiative's previous move, and the stage's days count from the day you pick.
104
+ **Moving a stage** asks **When did this happen?** in the same way, on the Board's Stage menu and on **Stage** in the popup's **Details**. A stage move cannot be dated before the initiative's previous move, and the stage's days count from the day you pick.
106
105
 
107
106
  **Ask PMOS** is hidden until you want it, so the work takes the whole popup. It shows by itself when you had it open on the same item in the last 24 hours, or when a session about the item works or waits for you (a dot on the round **Ask PMOS** button). Press that button, or Ctrl or Cmd J, to show or hide it.
108
107
 
@@ -21,7 +21,7 @@ On a computer the Board place is **Work**: one list of initiatives with the time
21
21
 
22
22
  - **The columns.** Initiative, Product, Stage, Next milestone and Date, in this order. **Next milestone** is the name of the milestone. When an initiative has no milestone, the cell is empty and the date is the end of its plan. Only a late or at-risk date has colour, for example "4 Nov · 14 days late". The Product column does not show when you pick one product. A product shows by its display name, for example **IDPF**, in the Product column, the filter and the product chip at the top. A work copy or a worktree shows as its product.
23
23
  - **The groups.** The rows are under their goals. An initiative with no goal is under **No goal yet**.
24
- - **The timeline.** Each bar is the same bar as on the Board: dark grey is done, blue is now, light grey is still planned. Every milestone is a diamond at its date; press it to see its card. A thin line shows a gap in the plan, and an orange line goes from a missed date to today. Press a bar to see the stages of its workflow in a card, each with its date when it has one. Press outside the card or press Esc to close it. An initiative with no start and no end has an empty timeline cell. Closed and completed initiatives fold into one last line, for example **11 closed**; press it to show them. The span chooser at the top left of the timeline has **Quarter**, **Half**, **Year**, **2 yr**, **5 yr** and **Full**. **Full** shows every bar from the earliest start to the latest end. The button beside it hides the timeline. The key is under the list.
24
+ - **The timeline.** Each bar is the same bar as on the Board: dark grey is done, blue is now, light grey is still planned. Every milestone is a diamond at its date; press it to see its card. A thin line shows a gap in the plan, and an orange line goes from a missed date to today. Press a bar to see the stages of its workflow in a card, each with its date when it has one. Press outside the card or press Esc to close it. An initiative with no start and no end has an empty timeline cell. A bar that starts or ends outside the span stops at the timeline's edge, so the columns beside it always show. Closed and completed initiatives fold into one last line, for example **11 closed**; press it to show them. The span chooser at the top left of the timeline has **Quarter**, **Half**, **Year**, **2 yr**, **5 yr** and **Full**. **Full** shows every bar from the earliest start to the latest end. The button beside it hides the timeline. The key is under the list.
25
25
  - **The view menu.** Press the tune button. **Filter** comes first: Needs (late, at risk, waits on you, blocked), Stage, Status, Product, Program, Owner and Sprint. Each value shows how many initiatives it holds, and you can pick several at once. A line above the table says what shows, for example "Showing Build and Deliver of IDPF · 14 hidden · Show all", and the tune button shows how many filters are on. **Sort** takes up to three keys: press a column to add it, press it again to turn it round, and press its × to take it out. **PMOS order** puts what needs you first. **View** has **Group by** and the **Timeline** switch. **Columns** opens a switch for each column; drag a column to change the order (or use Alt+↑ and Alt+↓). PMOS remembers the view in this browser, and **Reset** shows when the view is not the usual one. If the sprint in the Jira reading has ended, the menu says so, for example "MAD Sprint 115 has ended, showing MAD Sprint 116". The ⋯ menu has **New asks**, **Sprints and releases**, **Shared with me** and **Read Jira again**.
26
26
  - **Sort.** Press a column title to sort by it. Press it again to go back to your usual order.
27
27
  - **Edit in place.** Press the Stage of a row to move the initiative to another stage. The toast has **Undo**.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.621.0",
3
+ "version": "0.623.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.621.0",
9
+ "version": "0.623.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.621.0",
3
+ "version": "0.623.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",
@@ -115,7 +115,7 @@ export const anyMsLate = (r, now) => !!(now && (r.milestones || []).some((m) =>
115
115
  /** The forecast range a row draws (FcBoard): { tone: 'risk' | 'miss' | 'held', low, high } past its promised date, else null. */
116
116
  export function fcRange(r) {
117
117
  const F = r && r.forecast, e = r && day(r.end);
118
- if (!F || !e) return null;
118
+ if (!F || !e || r.closed) return null; // a closed initiative has no forecast (batch 26 item 5: a closed initiative is not late)
119
119
  const tone = F.state === 'at-risk' ? 'risk' : F.state === 'will-miss' ? 'miss' : F.state === 'held' && (F.was === 'at-risk' || F.was === 'will-miss') ? 'held' : '';
120
120
  const hi = day(F.high || F.low), lo = day(F.low);
121
121
  return tone && hi && hi > e ? { tone, low: lo || hi, high: hi } : null;
@@ -230,7 +230,7 @@ function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
230
230
  if (s && e) {
231
231
  const g = gapsHtml(r, X, now, phone, fmt, pxPct || 0, s, e, tone, note, et ? { name: et.name, d: day(et.date) } : null);
232
232
  out += g.html; clash = g.clash;
233
- const over = r.over && now > e, late = fc && fc > e, hover = [];
233
+ const over = !r.closed && r.over && now > e, late = !r.closed && fc && fc > e, hover = [];
234
234
  if (over) hover.push(r.overDays + ' ' + (r.overDays === 1 ? 'day' : 'days') + ' over');
235
235
  // a late initiative (batch 19 item 5): a thin orange line from the day after its end to Today, ending in a dot; the bar keeps its fill
236
236
  if (over) out += `<span class="tg-late" style="left:${P(X(e))};width:${P(Math.max(0, X(now) - X(e)))}" aria-hidden="true"></span>`;
@@ -34,7 +34,7 @@ body.bd-page.wk-on .bd-hd .bd-tools { margin-left: auto; }
34
34
 
35
35
  /* the timeline column */
36
36
  .wk-x { align-self: stretch; position: relative; overflow: visible !important; box-shadow: inset 1px 0 0 var(--cz-hair); }
37
- .wk-bw { position: absolute; inset: 0 8px; }
37
+ .wk-bw { position: absolute; inset: 0 8px; overflow: clip; overflow-clip-margin: 8px; } /* a bar that starts or ends past the span stops at the timeline's edge (Quarter, 2026-11-19); the stage card sits outside it */
38
38
  .wk-gl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--cz-hair); }
39
39
  .wk-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--cz-ink); opacity: .7; z-index: 3; }
40
40
  .wk-xh { display: block; }
@@ -56,7 +56,7 @@ body.bd-page.wk-on .bd-hd .bd-tools { margin-left: auto; }
56
56
  .wk-i.hov { z-index: 5; }
57
57
 
58
58
  /* the stages card under a pointed row */
59
- .wk-card { position: absolute; left: auto; right: 0; width: max(100%, calc(var(--n, 8) * 80px + 24px)); box-sizing: border-box; top: 36px; z-index: 20; padding: 10px 12px 12px; border-radius: 14px; background: var(--cz-card); box-shadow: 0 12px 32px -8px rgba(30, 34, 42, .3), 0 0 0 1px var(--cz-hair); white-space: normal; cursor: default; }
59
+ .wk-card { position: absolute; left: auto; right: 8px; width: max(100%, calc(var(--n, 8) * 80px + 24px)); box-sizing: border-box; top: 36px; z-index: 20; padding: 10px 12px 12px; border-radius: 14px; background: var(--cz-card); box-shadow: 0 12px 32px -8px rgba(30, 34, 42, .3), 0 0 0 1px var(--cz-hair); white-space: normal; cursor: default; }
60
60
  .wk-card p { margin: 0 0 10px; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
61
61
  .wk-cg { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); position: relative; }
62
62
  .wk-cg::before { content: ''; position: absolute; left: calc(50% / var(--n)); right: calc(50% / var(--n)); top: 7px; height: 4px; border-radius: 2px; background: var(--wk-plan); }
@@ -365,7 +365,7 @@ export function listHtml(rows, o = {}) {
365
365
  + `<div class="wk-r wk-h" role="row">${sortHd('title', 'Initiative')}${keys.map((k) => sortHd(k, byK[k].n)).join('')}${tlHead}${showTl}</div>`;
366
366
  const row = (r) => `<div class="wk-r wk-i${o.sel === r.key ? ' sel' : ''}${CARD === r.key ? ' hov' : ''}${isClosed(r) ? ' cl' : ''}" role="row" tabindex="0" data-key="${esc(r.key)}" aria-label="${esc(r.title + (keys.length ? ', ' + words(r, keys, oo) : ''))}">`
367
367
  + `<span role="cell" class="n">${esc(r.title)}</span>${keys.map((k) => cellHtml(r, k, oo)).join('')}`
368
- + (tl ? `<span role="cell" class="wk-x" data-wkbar="${esc(r.key)}"><span class="wk-bw">${grid}${o.bar ? o.bar(r, W) : barHtml(r, W, { now })}${CARD === r.key ? cardHtml(r, W, now) : ''}</span></span>` : '') + '</div>';
368
+ + (tl ? `<span role="cell" class="wk-x" data-wkbar="${esc(r.key)}"><span class="wk-bw">${grid}${o.bar ? o.bar(r, W) : barHtml(r, W, { now })}</span>${CARD === r.key ? cardHtml(r, W, now) : ''}</span>` : '') + '</div>';
369
369
  if (!rows.length && every.length) h += `<p class="wk-empty">No initiative matches these filters. <button type="button" class="wk-sa" data-wkclear>Show all</button></p>`;
370
370
  const all = o.order ? o.order(rows) : rows, base = all.filter((r) => !isClosed(r)), shut = all.filter(isClosed), G = groupsOf(base, v.group, oo);
371
371
  const gline = (inner) => `<div class="wk-r wk-g" role="row">${inner}${tl ? `<span class="wk-x" aria-hidden="true"><span class="wk-bw">${grid}</span></span>` : ''}</div>`;
@@ -225,32 +225,7 @@ button.pw-fv .grey { color: var(--cz-ink3); }
225
225
  /* round 3 item 11b: the task a Today row opened, lit until another task is opened */
226
226
  .pw-kr.lit { background: var(--cz-bluebg); box-shadow: inset 3px 0 0 var(--cz-blue); }
227
227
  .pw-kr.lit .pw-tt { font-weight: var(--fw-strong); }
228
- /* Work breakdown as one row of stages and one list of tasks (round 3 point 22): the stages are chips on the initiative's own bar; the tasks are
229
- * the Backlog's own list (pm/bd-backlog.css), this initiative's only */
230
- .pw-one .pw-stgs { min-height: 44px; }
231
- .pw-one .pw-stgs .pw-it { overflow: visible; }
232
- .pw-scs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 0; }
233
- .pw-sc { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; background: var(--cz-well); padding: 3px 10px 3px 6px; font: inherit; font-size: var(--fs-meta); color: var(--cz-ink2); cursor: pointer; white-space: nowrap; }
234
- .pw-sc .pw-n { min-width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--cz-card); font-size: var(--fs-badge); color: var(--cz-ink3); }
235
- .pw-sc:hover { color: var(--cz-ink); }
236
- .pw-sc.dn { color: var(--cz-ink3); }
237
- .pw-sc.now { background: var(--cz-blue-soft, var(--cz-well)); color: var(--cz-ink); font-weight: var(--fw-strong); box-shadow: 0 0 0 1px var(--cz-blue) inset; }
238
- .pw-sc.late .pw-n { background: var(--cz-latebg); color: var(--cz-late); }
239
- .pw-sc:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
240
- .pw-one .pw-tl { position: relative; min-height: 32px; }
241
- .pw-tasks { margin-top: 14px; }
242
- .pw-lh { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
243
- .pw-lh h4 { margin: 0; flex: 1; font-size: var(--fs-row); font-weight: var(--fw-strong); color: var(--cz-ink); }
244
- .pw-lh .pw-lk { display: inline-flex; align-items: center; gap: 2px; }
245
- .pw-ltx { margin: 6px 2px; color: var(--cz-ink3); font-size: var(--fs-row); }
246
- .pw-bk .bk-emb { border-radius: 14px; background: var(--cz-card); box-shadow: 0 0 0 1px var(--cz-hair); }
247
- .hi-pop.pw-stc .hi-h3 { margin: 0 0 4px; }
248
- .hi-pop.pw-stc .hi-small { margin: 0 0 2px; }
249
- .hi-pop.pw-stc .warn { color: var(--cz-late); }
250
- .pw-bk .bk-r.lit { background: var(--cz-bluebg); box-shadow: inset 3px 0 0 var(--cz-blue); }
251
- .hi-pop .pw-stch { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
252
- .hi-pop .pw-stch .hi-h3 { margin: 0; }
253
- .hi-pop .pw-stch .pw-ib.solid { width: 32px; height: 32px; }
254
- .hi-pop .pw-stch .pw-ib.solid:disabled { opacity: .45; cursor: default; }
255
- .hi-pop.pw-stc .pw-when { margin: 4px 0 8px; }
256
- .pw-sc .pw-n svg { display: block; }
228
+ /* the tasks in no stage live in the Backlog (2026-11-19): one quiet line under the Work breakdown */
229
+ .pw-loose { margin: 8px 2px 0; }
230
+ .pw-loose .pw-lk { display: inline-flex; align-items: center; gap: 2px; color: var(--cz-ink3); }
231
+ .pw-loose .pw-lk:hover { color: var(--cz-blue); }
@@ -25,7 +25,6 @@ import * as ED from './ini-edit.js';
25
25
  import * as SW from './cozy-status-when.js'; // When did this happen? after a status pick (round 3 point 18)
26
26
  import * as DP from './cozy-day-pick.js'; // the app's own day field, "15 Oct 2026"
27
27
  const { localToday } = DP;
28
- import { rowBar } from './bd-span.js'; // the stages row: the Board's own bar (round 3 point 22)
29
28
  import * as AK from './artefact-kind.js'; // the Kind of a file and one row per kind (round 3 point 16), shared with the Library // the rename and its Undo, the same write as the old List (batch 18 item 16)
30
29
 
31
30
  const CSS = new URL('./cozy-pop-work.css', import.meta.url).href;
@@ -119,28 +118,6 @@ function productName(p, ws) {
119
118
  return n && !M.idShaped(n) ? n : '';
120
119
  }
121
120
 
122
- /* the initiative's tasks as one list (round 3 point 22): the Backlog's own list and grouping (pm/bd-backlog.js listHtml / bindList), read from
123
- * GET /api/backlog once per product. Until that module is on the page, or while the route answers nothing, the stages keep their tasks as before. */
124
- let BK = null, bkRedraw = null;
125
- import('./bd-backlog.js').then((m) => { BK = m && typeof m.listHtml === 'function' && typeof m.bindList === 'function' ? m : false; if (BK && bkRedraw) bkRedraw(); }).catch(() => { BK = false; });
126
- const BKT = new Map(); // ws|board → tasks | null while reading | false when the route is not there
127
- function bkTasks(ws, board) {
128
- if (!BK || !board) return false;
129
- const k = (ws || '') + '|' + board;
130
- if (!BKT.has(k)) {
131
- BKT.set(k, null);
132
- pmGet('/api/backlog?ws=' + encodeURIComponent(ws || '') + '&board=' + encodeURIComponent(board))
133
- .then((x) => {
134
- if (x && x.ok && Array.isArray(x.tasks)) { BKT.set(k, x.tasks); if (bkRedraw) bkRedraw(); }
135
- else if (x && x.pending) { BKT.delete(k); setTimeout(() => { if (bkRedraw) bkRedraw(); }, 1500); }
136
- else BKT.set(k, false);
137
- }).catch(() => BKT.set(k, false));
138
- }
139
- return BKT.get(k);
140
- }
141
- const bkReread = (ws, board) => { BKT.delete((ws || '') + '|' + (board || '')); };
142
- const BKFOLD = new Map(); // initiative id → { fold, more } as the PM left the list
143
-
144
121
  /* ── the parts ── */
145
122
  /* the Overview explains the initiative (round 3 point 10): Problem, Goal, Done when from its own records, one status line, PMOS suggests, then
146
123
  * Details › for the grid. A line with no source says so in grey with a ✦ offer; nothing is invented. */
@@ -243,44 +220,7 @@ function rowHtml(x, W, C, sugRows) {
243
220
  return `<div class="pw-tr pw-kr${x.done ? ' done' : ''}${x.lit ? ' lit' : ''}" role="row" data-pw-row="${esc(x.uid)}" data-pw-sec="${esc(x.sec)}"><span class="pw-it"><i class="pw-bul${x.ms ? ' ms' : ''}" aria-hidden="true"></i>${title}${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>${stc}${dtc}${tl}</div>`
244
221
  + (s ? `<div class="pw-tr pw-sugrow" role="row"><span class="pw-it">${sugLine(s, true)}</span></div>` : '');
245
222
  }
246
- /* Work breakdown, round 3 point 22 (Wawan: "Stage not apply to task, it only apply to initiative"): the stages are ONE row of the initiative's
247
- * own steps with the Board's own bar on the timeline; press a stage for its card (its dates, and the move, which asks when it happened). The
248
- * tasks are ONE list under it: the Backlog's columns and groups, this initiative's tasks only. A task's old stage stays in its record; it is
249
- * only not shown. "Open in Backlog" opens Work › Backlog. */
250
- const stagesOf = (W) => W.rows.filter((x) => x.kind === 'stage' && x.key !== '');
251
- function stagesRowHtml(W, C, r) {
252
- const st = stagesOf(W);
253
- const chips = st.map((x) => `<button type="button" class="pw-sc${x.tone === 'now' ? ' now' : ''}${x.tone === 'dn' ? ' dn' : ''}${x.late ? ' late' : ''}" data-pw-stage="${esc(x.key)}" aria-haspopup="dialog" aria-label="${esc(x.name + (x.tone === 'now' ? ', the stage now' : x.tone === 'dn' ? ', done' : '') + (x.late ? ', late' : '') + '. Open its card')}"><span class="pw-n">${x.tone === 'dn' ? SVG(P.check, 11, 2.4) : esc(x.n)}</span>${esc(x.name)}</button>`).join('');
254
- let bar = '';
255
- if (C.tl) {
256
- const a = Date.parse(W.span.a), b = Date.parse(W.span.b), X = (d) => ((+new Date(d) - a) / Math.max(864e5, b - a)) * 100;
257
- try { bar = rowBar(r, X, new Date(), { mode: 'all', label: false, pxPct: 4 }); } catch { bar = ''; }
258
- if (!bar) bar = st.map((x) => barHtml(x, W)).join('');
259
- bar = `<div class="pw-tl">${bar}${W.tx != null ? `<i class="pw-now" style="left:${W.tx.toFixed(2)}%"></i>` : ''}</div>`;
260
- }
261
- return `<div class="pw-tr pw-stgs" role="row"><span class="pw-it"><span class="pw-scs" role="group" aria-label="Stages">${chips}</span></span>${C.status ? '<span></span>' : ''}${C.date ? '<span></span>' : ''}${bar}</div>`;
262
- }
263
- function oneListHtml(W, C, mode, full, S, o, r) {
264
- const tasks = bkTasks(o.ws, o.board);
265
- const L = Array.isArray(tasks) ? BK.listHtml(tasks, { ini: o.id, cols: ['jira', 'epic', 'who', 'due', 'state'], ...(BKFOLD.get(o.id) || {}) }) : '';
266
- const spanB = C.tl ? `<button type="button" class="pw-span" data-pw-span aria-haspopup="menu" aria-label="${esc('Span of the timeline: ' + (M.MODES.find((m) => m[0] === mode) || M.MODES[5])[1])}">${esc((M.MODES.find((m) => m[0] === mode) || M.MODES[5])[1])}${SVG(P.down, 12)}</button>` : '';
267
- const tools = `<span class="pw-tools">${spanB}${ib(`data-pw-big aria-pressed="${!!full}"`, full ? 'Back to the initiative' : 'Give the work breakdown the whole popup', full ? P.in : P.full)}${ib('data-pw-tune="wbs" aria-haspopup="menu"', 'Show or hide columns', P.tune)}</span>`;
268
- const empty = tasks === null ? '<p class="pw-ltx">Reading the tasks…</p>' : '<p class="pw-ltx">No tasks yet.</p>';
269
- const head = `<div class="pw-lh"><h4>Tasks</h4><button type="button" class="pw-lk" data-pw-backlog>Open in Backlog${SVG(P.right, 14)}</button></div>`;
270
- if (full && C.tl && o.bars && o.bars.length) {
271
- // expanded: the same tasks with their dates and bars on the one timeline; the grouped list is the default view
272
- const rows = o.bars.map((x) => rowHtml({ ...x, sec: '' }, W, C, new Map())).join('');
273
- const T = `<div class="pw-card pw-wbs${C.status ? '' : ' nost'}${C.date ? '' : ' nodt'}" role="table" aria-label="Tasks"${tlStyle()}>${headCells(C, W, mode, 'Task')}${rows}</div>`;
274
- return `<section class="pw-sec" aria-label="Work breakdown"><div class="pw-sech">${tools}</div>`
275
- + `<div class="pw-card pw-wbs pw-one nost nodt" role="table" aria-label="Stages"${tlStyle()}>${gripHtml()}${headCells({ ...C, status: false, date: false }, W, mode, 'Stages')}${stagesRowHtml(W, { ...C, status: false, date: false }, r)}</div>`
276
- + `<div class="pw-tasks">${head}${T}</div></section>`;
277
- }
278
- return `<section class="pw-sec" aria-label="Work breakdown">${full ? `<div class="pw-sech">${tools}</div>` : `<div class="pw-sech"><h3>Work breakdown</h3>${tools}</div>`}`
279
- + `<div class="pw-card pw-wbs pw-one${C.tl ? '' : ' notl'} nost nodt" role="table" aria-label="Stages"${tlStyle()}>${C.tl ? gripHtml() : ''}${headCells({ ...C, status: false, date: false }, W, mode, 'Stages')}${stagesRowHtml(W, { ...C, status: false, date: false }, r)}</div>`
280
- + `<div class="pw-tasks">${head}<div class="pw-bk" data-pw-bk>${L || empty}</div></div></section>`;
281
- }
282
- function breakdownHtml(W, C, mode, full, S, o, r) {
283
- if (BK && o && o.board && bkTasks(o.ws, o.board) !== false) return oneListHtml(W, C, mode, full, S, o, r);
223
+ function breakdownHtml(W, C, mode, full, S) {
284
224
  const sugRows = W.rowSuggests, ms = !!(S && S.msAdd);
285
225
  // the add row (round 3 point 2): "◇" beside it makes the next one a milestone; typing "◇ " first does the same
286
226
  const add = (key, name) => `<div class="pw-tr pw-add" role="row"><span class="pw-it"><label class="pw-addf">${SVG(P.plus, 14)}<input data-pw-add="${esc(key)}" data-pw-add-name="${esc(name)}" placeholder="${ms ? 'Add a milestone' : 'Add a task'}" aria-label="${esc((ms ? 'Add a milestone to ' : 'Add a task to ') + name)}" maxlength="200" autocomplete="off"></label>`
@@ -296,9 +236,11 @@ function breakdownHtml(W, C, mode, full, S, o, r) {
296
236
  const spanB = C.tl ? `<button type="button" class="pw-span" data-pw-span aria-haspopup="menu" aria-label="${esc('Span of the timeline: ' + (M.MODES.find((m) => m[0] === mode) || M.MODES[5])[1])}">${esc((M.MODES.find((m) => m[0] === mode) || M.MODES[5])[1])}${SVG(P.down, 12)}</button>` : '';
297
237
  const tools = RO ? (spanB ? `<span class="pw-tools">${spanB}</span>` : '') : `<span class="pw-tools">${spanB}${ib(`data-pw-big aria-pressed="${!!full}"`, full ? 'Back to the initiative' : 'Give the work breakdown the whole popup', full ? P.in : P.full)}${ib('data-pw-tune="wbs" aria-haspopup="menu"', 'Show or hide columns', P.tune)}</span>`;
298
238
  const show = !C.tl && !RO ? ib('data-pw-tl', 'Show the timeline', P.show, 'xs') : '';
239
+ // the tasks in no stage are not in the breakdown (Wawan, 2026-11-19): they live in Work › Backlog; one quiet line says so and goes there
240
+ const loose = W.looseN && !RO ? `<p class="pw-loose"><button type="button" class="pw-lk" data-pw-backlog>${esc(W.looseN === 1 ? '1 task with no stage is in the Backlog' : W.looseN + ' tasks with no stage are in the Backlog')}${SVG(P.right, 13)}</button></p>` : '';
299
241
  return `<section class="pw-sec" aria-label="Work breakdown">${full ? `<div class="pw-sech">${tools}</div>` : `<div class="pw-sech"><h3>Work breakdown</h3>${show}${tools}</div>`}`
300
242
  + `<div class="pw-card pw-wbs${C.tl ? '' : ' notl'}${C.status ? '' : ' nost'}${C.date ? '' : ' nodt'}" role="table" aria-label="Work breakdown"${tlStyle()}>${C.tl ? gripHtml() : ''}${headCells(C, W, mode)}${out || '<div class="pw-tr pw-empty" role="row"><span>No task yet.</span></div>'}</div>`
301
- + (C.tl ? '<p class="pw-key"><span><i class="k-tb pr"></i>In progress</span><span><i class="k-tb"></i>To do</span><span><i class="k-tb dn"></i>Done</span><span><i class="k-md"></i>Milestone</span><span><i class="k-late"></i>Late</span><span><i class="k-gap"></i>No activity</span></p>' : '') + '</section>';
243
+ + (C.tl ? '<p class="pw-key"><span><i class="k-tb pr"></i>In progress</span><span><i class="k-tb"></i>To do</span><span><i class="k-tb dn"></i>Done</span><span><i class="k-md"></i>Milestone</span><span><i class="k-late"></i>Late</span><span><i class="k-gap"></i>No activity</span></p>' : '') + loose + '</section>';
302
244
  }
303
245
  /* the Artefacts (round 3 point 16): one row per Kind, in lifecycle order. Kind | Artefact (the current one) | Version | Updated. Versions and the
304
246
  * files of a series unfold under the row; several different files of one kind show a count, and one ✦ line above the table proposes to merge
@@ -336,21 +278,14 @@ const keyOf = (v, o) => String((o && o.id) || (v && (v.id || v.key)) || '');
336
278
  function model(r, v, o) {
337
279
  const id = keyOf(v, o), S = stOf(id), it = ITEMS.get(id);
338
280
  const g = o.goal || goalOf(o.ws, o.board, r.anchor || v.anchor);
339
- const W = M.workOf(r, v, { ...o, goal: M.idShaped(g) ? '' : g, product: productName(o.product, o.ws), art: artOf(id, o.ws), open: S.open, shut: S.shut, doneOpen: S.doneOpen, moreOpen: S.moreOpen, farOpen: S.farOpen || !!(BK && o.board), focus: S.focus, mode: store.get(SPAN, 'full'), items: it || [], dropped: dropped() });
281
+ const W = M.workOf(r, v, { ...o, goal: M.idShaped(g) ? '' : g, product: productName(o.product, o.ws), art: artOf(id, o.ws), open: S.open, shut: S.shut, doneOpen: S.doneOpen, moreOpen: S.moreOpen, farOpen: S.farOpen, focus: S.focus, mode: store.get(SPAN, 'full'), items: it || [], dropped: dropped() });
340
282
  const mk = M.marksOf(W.span, W.today); W.tx = mk.today;
341
283
  return { W, S, id };
342
284
  }
343
285
  export function html(r, v, o = {}) {
344
286
  const { W, S } = model(r, v, o), C = cols(), mode = store.get(SPAN, 'full');
345
- const bo = { ws: o.ws, board: o.board, id: keyOf(v, o) };
346
- // the expanded one list keeps each task's bar on the timeline (design check): every stage open, read for its task rows only
347
- if (S.big && BK && o.board) {
348
- const keys = new Set(W.rows.filter((x) => x.kind === 'stage').map((x) => x.key).concat(''));
349
- const W2 = M.workOf(r, v, { ...o, goal: '', product: productName(o.product, o.ws), art: [], open: keys, shut: new Set(), doneOpen: new Set(), moreOpen: keys, farOpen: true, mode, items: ITEMS.get(bo.id) || [], dropped: dropped() });
350
- bo.bars = W2.rows.filter((x) => x.kind === 'task' && !x.done).sort((a, b) => String(a.end || '9999').localeCompare(String(b.end || '9999')));
351
- }
352
- if (S.big) return `<div class="pw" data-pw-big-on>${breakdownHtml(W, C, mode, true, S, bo, r)}</div>`;
353
- return `<div class="pw">${overviewHtml(W, S, keyOf(v, o))}${breakdownHtml(W, C, mode, false, S, bo, r)}${artefactsHtml(W.artefacts, C, true, { scope: keyOf(v, o), recPath: v.prd && (v.prd.path || v.prd) })}</div>`;
287
+ if (S.big) return `<div class="pw" data-pw-big-on>${breakdownHtml(W, C, mode, true, S)}</div>`;
288
+ return `<div class="pw">${overviewHtml(W, S, keyOf(v, o))}${breakdownHtml(W, C, mode, false, S)}${artefactsHtml(W.artefacts, C, true, { scope: keyOf(v, o), recPath: v.prd && (v.prd.path || v.prd) })}</div>`;
354
289
  }
355
290
 
356
291
  /* ── the suggestion as its own page (board 22) ── */
@@ -443,29 +378,8 @@ export function wire(body, h0, x0) {
443
378
  body.__pw = true;
444
379
  function cur() { const x = body.__pwx, r = x && x.r(), v = x && x.v(); return r && v ? { r, v, ...model(r, v, x.o()) } : null; }
445
380
  function redraw() { if (body.__pwh && body.__pwh.redraw) body.__pwh.redraw(); }
446
- goalsRedraw = artRedraw = wsnRedraw = bkRedraw = () => { if (body.isConnected && body.querySelector('.pw')) redraw(); };
381
+ goalsRedraw = artRedraw = wsnRedraw = () => { if (body.isConnected && body.querySelector('.pw')) redraw(); };
447
382
  wireGrip(body);
448
- // the one list (round 3 point 22): each draw puts a new [data-pw-bk]; the Backlog's own presses are bound to it once
449
- const bindBk = () => body.querySelectorAll('[data-pw-bk]').forEach((el) => {
450
- if (el.__bk || !BK || !el.querySelector('.bk')) return;
451
- el.__bk = true;
452
- const c = cur(); if (!c) return;
453
- // the task a Today row opened (round 3 item 11b) is lit in the one list too
454
- if (c.S.focus) { const fr = el.querySelector(`[data-bkopen$="|${window.CSS.escape(c.S.focus)}"]`); if (fr) fr.closest('[role="row"]').classList.add('lit'); }
455
- const o = (body.__pwx && body.__pwx.o()) || {}, h = body.__pwh || {}, w = h.where ? h.where() : {}, ws = w.ws || o.ws, board = w.board || o.board;
456
- BK.bindList(el, {
457
- post: pmPost,
458
- say: (m, u) => (u ? undoToast(m, u) : h.toast ? h.toast(m) : undoToast(m)),
459
- openTask: (t) => { if (t.src === 'jira') { if (h.openTask) h.openTask(t.key || t.id); else if (t.url) window.open(t.url, '_blank', 'noopener'); return; } const cc = cur(); if (cc) openSmall(t.id, cc, body.__pwh, body.__pwx, body, t); },
460
- reload: async () => { bkReread(ws, board); if (body.__pwh && body.__pwh.reload) await body.__pwh.reload(); else redraw(); },
461
- }, () => BKT.get((ws || '') + '|' + (board || '')) || []);
462
- el.addEventListener('bk:redraw', (e) => {
463
- const p = BKFOLD.get(c.id) || { fold: {}, more: new Set() }, d = e.detail || {};
464
- BKFOLD.set(c.id, { fold: { ...p.fold, ...(d.fold || {}) }, more: new Set([...(p.more || []), ...(d.more || [])]) });
465
- redraw();
466
- });
467
- });
468
- bindBk(); new MutationObserver(bindBk).observe(body, { childList: true, subtree: true });
469
383
  const live = (e) => !!body.__pwx && !!e.target.closest('.pw') && !e.target.closest('.pw-sp, [data-pw-level]');
470
384
  body.addEventListener('scroll', () => { if (!body.querySelector(':scope > .pw, .pw:not(.pw-sp)')) return; const c = cur(); if (c) c.S.top = body.scrollTop; }, { passive: true });
471
385
  body.addEventListener('click', async (e) => {
@@ -503,7 +417,6 @@ export function wire(body, h0, x0) {
503
417
  if (d.pwDate) { dateMenu(b, d.pwDate, c, h); return; }
504
418
  if (d.pwName) { rename(b, d.pwName, h); return; }
505
419
  if (d.pwOpen) { openSmall(d.pwOpen, c, h, x, body); return; }
506
- if (d.pwStage) { stageCard(b, d.pwStage, c, h, x); return; }
507
420
  if ('pwBacklog' in d) { const o = x.o() || {}, w = h.where ? h.where() : {}, q = new URLSearchParams({ work: 'backlog' }); if (w.ws || o.ws) q.set('ws', w.ws || o.ws); if (o.id) q.set('ini', o.id); location.href = '/premium-board.html?' + q.toString(); return; }
508
421
  if (d.cbMs != null) { msPop(b, d.cbMs, W, h); return; }
509
422
  if (d.pwArt != null) { openArt(W.artefacts[+d.pwArt], h, x); return; }
@@ -694,47 +607,19 @@ async function openSmall(uid, c, h, x, body, bt) {
694
607
  if (row.jira) { if (h.openTask) h.openTask(uid); return; }
695
608
  const TP = await import('./cozy-task-pop.js');
696
609
  const w = h.where ? h.where() : {}, o = (x && x.o && x.o()) || {};
697
- const one = !!body.querySelector('[data-pw-bk] .bk');
698
- const list = () => { if (one) return [...body.querySelectorAll('[data-pw-bk] [data-bkopen]')].map((e) => e.dataset.bkopen.split('|').pop()).filter((v) => { const t = (BKT.get((o.ws || '') + '|' + (o.board || '')) || []).find((q) => q.id === v); return !t || t.src !== 'jira'; }); const cc = body.__pwx && body.__pwx.r() ? model(body.__pwx.r(), body.__pwx.v(), body.__pwx.o()) : null; return ((cc && cc.W.rows) || c.W.rows).filter((r) => r.kind === 'task' && !r.jira).map((r) => r.uid); };
610
+ const list = () => { const cc = body.__pwx && body.__pwx.r() ? model(body.__pwx.r(), body.__pwx.v(), body.__pwx.o()) : null; return ((cc && cc.W.rows) || c.W.rows).filter((r) => r.kind === 'task' && !r.jira).map((r) => r.uid); };
699
611
  TP.openTask(uid, {
700
612
  ws: w.ws || o.ws, board: w.board || o.board, ini: o.id, pmPost,
701
613
  toast: (m, undo) => (undo ? undoToast(m, undo) : h.toast ? h.toast(m) : undoToast(m)),
702
614
  list, iniTitle: () => ((x && x.v && x.v()) || {}).title || '',
703
615
  row: (u) => { const r = c.W.rows.find((q) => q.uid === u) || (bt && bt.id === u ? { uid: bt.id, title: bt.title, status: bt.status || bt.state || '', start: bt.start || '', end: bt.due || '', ms: !!bt.milestone } : null); return r ? { uid: r.uid, title: r.title, status: r.status, start: r.start || '', end: r.end || '', milestone: !!r.ms, since: r.since || '', ini: o.id, board: w.board || o.board } : null; },
704
616
  rename: h.rename ? (t, v) => h.rename(t.uid, v) : null,
617
+ // the row behind changes at once (Wawan, 2026-11-19: a new date or status did not show until the board was read again); the reload follows
618
+ patch: (u, p) => { const rr = x && x.r && x.r(), tk = rr && Array.isArray(rr.tasks) ? rr.tasks.find((q) => q && q.uid === u) : null; if (!tk) return; if (!p) { rr.tasks.splice(rr.tasks.indexOf(tk), 1); if (h.redraw) h.redraw(); return; } Object.assign(tk, { status: p.status || tk.status, end: p.end, start: p.start, milestone: p.milestone }); if (h.redraw) h.redraw(); },
705
619
  onChange: () => { if (h.reload) h.reload(); },
706
- onClose: (u) => { const r = body.querySelector(`[data-pw-row="${window.CSS.escape(u)}"]`) || body.querySelector(`[data-pw-bk] [data-bkopen$="|${window.CSS.escape(u)}"]`)?.closest('[role="row"]'); if (r) { r.classList.add('lit'); r.scrollIntoView({ block: 'nearest' }); setTimeout(() => r.classList.remove('lit'), 1600); } },
620
+ onClose: (u) => { const r = body.querySelector(`[data-pw-row="${window.CSS.escape(u)}"]`); if (r) { r.classList.add('lit'); r.scrollIntoView({ block: 'nearest' }); setTimeout(() => r.classList.remove('lit'), 1600); } },
707
621
  });
708
622
  }
709
- /* a stage's card (round 3 point 22): its dates and state; for another stage, the move to it, which asks when it happened (point 18) */
710
- function stageCard(btn, key, c, h, x) {
711
- const all = stagesOf(c.W), i = all.findIndex((r) => r.key === key), st = all[i]; if (!st) return;
712
- const now = all.find((r) => r.tone === 'now'), o = x.o() || {}, v = x.v() || {};
713
- const span = [st.start && M.dayText(st.start, c.W.today), st.end && M.dayText(st.end, c.W.today)].filter(Boolean).join(' – ');
714
- // the stage's own facts only: a task has no stage (round 3 point 22), so no task count here
715
- const facts = [st.status, span].filter(Boolean).map((t) => `<p class="hi-small">${esc(t)}</p>`).join('') + (st.late && st.date ? `<p class="hi-small warn">${esc(st.date)}</p>` : '');
716
- // the action is the first line (design check): another stage → "Move to Plan"; the stage now → "Mark Discover done" (moves to the next one).
717
- // The day question shows only after the press, and names the action.
718
- const nx = st.tone === 'now' ? all[i + 1] : null;
719
- const act = st.tone === 'now' ? (nx ? { to: nx.name, label: 'Mark ' + st.name + ' done', q: 'When was ' + st.name + ' done?', icon: P.check, said: st.name + ' done, moved to ' + nx.name } : null)
720
- : { to: st.name, label: 'Move to ' + st.name, q: 'When did it move to ' + st.name + '?', icon: P.right, said: 'Moved to ' + st.name };
721
- const head = `<div class="pw-stch"><p class="hi-h3">${esc(st.name)}</p>${act ? ib('data-mv', act.label, act.icon, 'solid') : ''}</div>`;
722
- const el = openPop(btn, 'pw-stc', head + (act ? '<div class="pw-when" hidden></div>' : '') + facts, (b) => {
723
- if (!('mv' in b.dataset) || !act) return;
724
- const w = el.querySelector('.pw-when'); b.disabled = true; b.classList.add('on'); w.hidden = false;
725
- SW.askWhen(w, { q: act.q, since: (x.r() || {}).acts?.movedOn || '', onPick: async (day) => {
726
- closePop();
727
- const wh = h.where ? h.where() : {}, base = { ws: wh.ws || o.ws, board: wh.board || o.board, id: o.id }, happened = day === localToday() ? null : day;
728
- const res = await pmPost('/api/boards/move', { ...base, to: act.to, ...(happened ? { happened } : {}) }).catch(() => null);
729
- if (!res || !res.ok) { if (h.toast) h.toast((res && res.error) || 'It did not move.'); return; }
730
- const from = now && now.name;
731
- const said = (v.title ? v.title + ' · ' : '') + SW.whenWords(act.said, happened);
732
- if (!from) { if (h.toast) h.toast(said); } else undoToast(said, async () => { const u = await pmPost('/api/boards/move', { ...base, to: from, why: 'Undo' }).catch(() => null); if (!u || !u.ok) { if (h.toast) h.toast((u && u.error) || 'The undo did not land.'); } if (h.reload) await h.reload(); });
733
- if (h.reload) await h.reload();
734
- } });
735
- w.querySelector('[data-sw]')?.focus();
736
- }, { label: st.name, focus: '[data-mv]' });
737
- }
738
623
  function spanMenu(btn, redraw) {
739
624
  const cur = store.get(SPAN, 'full');
740
625
  openPop(btn, 'pw-span', M.MODES.map(([k, l]) => `<button type="button" class="hi-mi" role="menuitemradio" aria-checked="${k === cur}" data-sp="${k}">${esc(l)}</button>`).join(''), (b) => {
@@ -32,3 +32,4 @@ button.ctp-t:hover { background: var(--cz-well); }
32
32
  .ctp { left: 0; right: 0; top: 0; bottom: 0; transform: none; width: auto; max-height: none; border-radius: 20px 20px 0 0; top: 24px; }
33
33
  }
34
34
  .ctp-when .sw { border-top: 0; margin-top: 0; padding-top: 0; }
35
+ .ctp-menu button.ctp-del { color: var(--cz-late); }
@@ -1,7 +1,7 @@
1
1
  /* pm/cozy-task-pop.js — one task in a small popup on top of the one popup (popup round 3 point 20, Wawan 2026-11-19: "When open task, can it also
2
2
  * open a smaller popup on top of current one?"). The initiative popup stays behind it, dimmed a little, not closed and not scrolled.
3
3
  *
4
- * openTask(uid, ctx) opens the task. ctx: { ws, board, ini, pmPost(path, body), toast(msg, undo?), onChange(), iniTitle?(id),
4
+ * openTask(uid, ctx) opens the task. ctx: { ws, board, ini, pmPost(path, body), toast(msg, undo?), onChange(), patch?(uid, { status, end, start, milestone, title }), iniTitle?(id),
5
5
  * row?(uid) → the row the host drew (GET /api/boards/items adds the owner and notes when it answers), list?() → [uid] (↑ ↓ step through it),
6
6
  * rename?(task, title) → Promise (the title,
7
7
  * pressed, becomes a field; Enter or leaving it saves), onClose?(uid) (the host
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * Inside: the kind (Task or Milestone, pressed to switch) and the title; the one task card (pm/task-card.js mountCard: status, due, owner, notes,
12
12
  * where it sits, what PMOS changed) whose status pick asks when it really happened (pm/cozy-status-when.js, point 18); ⋯ with Make it a
13
- * milestone and Archive (Undo). No chat inside: one level only, a second task replaces the content. On a phone it is a sheet from the bottom.
13
+ * milestone, Archive and Delete (Undo). No chat inside: one level only, a second task replaces the content. On a phone it is a sheet from the bottom.
14
14
  * Every write is the PM's press, on the board's own routes. The UI says PMOS, never Claude; icon-only buttons carry aria-label. */
15
15
  import { taskOf, mountCard, boardSaver, cardStyle, historyFor } from './task-card.js';
16
16
  import * as SWN from './cozy-status-when.js';
@@ -107,7 +107,8 @@ async function show(uid) {
107
107
  if (day && !t.jira) return ctx.pmPost('/api/boards/tasks/state', { ws: ctx.ws, board: raw.board || ctx.board, task: t.uid, state: patch.status, happened: day });
108
108
  return base(patch);
109
109
  };
110
- const changed = () => { raw.status = t.status; raw.end = t.due; raw.start = t.start; raw.owner = t.owner; raw.notes = t.notes; raw.milestone = t.milestone; clearTimeout(changed.t); changed.t = setTimeout(() => { if (ctx.onChange) ctx.onChange(); }, 400); };
110
+ // the host's row changes at once (ctx.patch: the list behind shows the new status and dates before the board is read again)
111
+ const changed = () => { raw.status = t.status; raw.end = t.due; raw.start = t.start; raw.owner = t.owner; raw.notes = t.notes; raw.milestone = t.milestone; if (ctx.patch) { try { ctx.patch(t.uid, { status: t.status, end: t.due || '', start: t.start || '', milestone: !!t.milestone, title: t.title }); } catch { /* the reload still draws it */ } } clearTimeout(changed.t); changed.t = setTimeout(() => { if (ctx.onChange) ctx.onChange(); }, 400); };
111
112
  const toast = (msg, undo) => (ctx.toast ? ctx.toast(msg, undo) : undefined);
112
113
  S.card = mountCard(S.el.querySelector('.ctp-b'), t, {
113
114
  save, toast, changed, now: () => Date.now(),
@@ -169,7 +170,8 @@ function moreMenu(btn) {
169
170
  if (m) { m.remove(); btn.setAttribute('aria-expanded', 'false'); return; }
170
171
  m = document.createElement('div'); m.className = 'ctp-menu'; m.setAttribute('role', 'menu'); m.setAttribute('aria-label', 'More for this task');
171
172
  m.innerHTML = `<button type="button" role="menuitem" data-k="kind">${SVG(s.t.milestone ? P.box : P.dia)}${s.t.milestone ? 'Make it a task' : 'Make it a milestone'}</button>`
172
- + (s.t.status !== 'Archived' ? '<button type="button" role="menuitem" data-k="arch">Archive</button>' : '');
173
+ + (s.t.status !== 'Archived' ? '<button type="button" role="menuitem" data-k="arch">Archive</button>' : '')
174
+ + '<button type="button" role="menuitem" data-k="del" class="ctp-del">Delete</button>';
173
175
  btn.setAttribute('aria-expanded', 'true');
174
176
  btn.closest('.ctp-h').appendChild(m);
175
177
  m.querySelector('button').focus();
@@ -178,9 +180,21 @@ function moreMenu(btn) {
178
180
  e.stopPropagation(); m.remove(); btn.setAttribute('aria-expanded', 'false');
179
181
  if (x.dataset.k === 'kind') kindOf(!s.t.milestone);
180
182
  else if (x.dataset.k === 'arch') s.card.setStatus('Archived');
183
+ else if (x.dataset.k === 'del') delTask(s);
181
184
  });
182
185
  m.addEventListener('keydown', (e) => { if (e.key === 'Escape') { e.stopPropagation(); m.remove(); btn.setAttribute('aria-expanded', 'false'); btn.focus(); } });
183
186
  }
187
+ /* Delete (Wawan, 2026-11-19: "where is delete task?"): a task added by mistake goes, the same write as the Board's trash
188
+ * (POST /api/boards/tasks/delete); Undo is POST /api/boards/tasks/restore. Archive stays for work that stopped. */
189
+ async function delTask(s) {
190
+ const { ctx, uid, t, raw } = s, body = { ws: ctx.ws, board: (raw && raw.board) || ctx.board, task: uid };
191
+ const res = await ctx.pmPost('/api/boards/tasks/delete', body).catch(() => null);
192
+ if (!res || res.ok === false) { if (ctx.toast) ctx.toast((res && res.error) || 'The task was not deleted.'); return; }
193
+ if (ctx.patch) { try { ctx.patch(uid, null); } catch { /* the reload still draws it */ } }
194
+ if (S === s) closeTask();
195
+ if (ctx.toast) ctx.toast('Deleted · ' + t.title + '.', async () => { const u = await ctx.pmPost('/api/boards/tasks/restore', body).catch(() => null); if ((!u || u.ok === false) && ctx.toast) ctx.toast((u && u.error) || 'The undo did not land.'); if (ctx.onChange) ctx.onChange(); });
196
+ if (ctx.onChange) ctx.onChange();
197
+ }
184
198
  /* the title becomes a field: Enter or leaving it saves (the host's rename, with its Undo); Escape keeps the old name */
185
199
  function renameField(btn) {
186
200
  const s = S; if (!s) return;
@@ -127,7 +127,7 @@ const jiraBucket = (st) => (/^(done|closed|resolved|released)$/i.test(String(st
127
127
  /** k: the task as stored; J: the Jira ticket its title names, when PMOS read that ticket (0.442.0 hotfix, Wawan 13:02 and 13:03). A linked task's
128
128
  * status is the ticket's; its start and due stay the PM's, kept in PMOS: Jira's start and due show only while the task has none of its own. */
129
129
  function rowOf(k0, today, J = null) {
130
- const k = J ? { ...k0, status: jiraBucket(J.status), start: k0.start || J.start || '', end: k0.end || J.due || J.sprintEnd || '' } : k0;
130
+ const k = J ? { ...k0, status: jiraBucket(J.status), start: k0.start || J.start || '', end: k0.end || J.due || '' } : k0; // never the sprint's end: a task with no date shows none, and is not late (Wawan, 2026-11-19)
131
131
  const closed = CLOSED.has(k.status), d = dayOf(k.end), late = !closed && !!d && d < today;
132
132
  // start and end both (batch 7 item 6): "Oct 15 – Oct 28", one day once, "from Oct 15" with no end
133
133
  const days = k.start && k.end ? span(k.start, k.end, today) : k.start ? 'from ' + dateY(k.start, today) : d ? dateY(k.end, today) : '';
@@ -370,14 +370,10 @@ export function breakdownOf(r, v, o = {}) {
370
370
  }
371
371
  stageRow(s, i);
372
372
  });
373
- const ts = looseTs.filter((x) => !x.closed);
374
- if (ts.length) {
375
- const isOpen = holds(ts, f) || (open.has('') && !shut.has(''));
376
- rows.push({ kind: 'stage', key: '', n: '', name: 'Not in a stage', status: '', count: plural(ts.length, 'open task', 'open tasks'), date: '', start: '', end: '', open: isOpen, can: true, loose: true });
377
- if (isOpen) for (const x of ts.slice().sort(urgent)) rows.push(lit({ ...taskRow(x, t), sec: '' }));
378
- if (cur >= 0) for (const x of ts) loose.push({ uid: x.uid, title: x.title, to: stages[cur].key, name: stages[cur].name });
379
- }
380
- return { rows, many, list, loose };
373
+ // the tasks in no stage leave the Work breakdown (Wawan, 2026-11-19: "put 'not in stage' tasks out of the initiative WBS and put on backlog
374
+ // instead"): they live in Work › Backlog; the breakdown says how many in one quiet line under it, with the way there
375
+ const looseN = looseTs.filter((x) => !x.closed).length;
376
+ return { rows, many, list, loose, looseN };
381
377
  }
382
378
 
383
379
  /* ── the artefacts ── */
@@ -476,7 +472,7 @@ export function workOf(r, v, o = {}) {
476
472
  const dates = [r.start, r.end].concat(bd.rows.flatMap((x) => [x.start, x.end])).filter(Boolean);
477
473
  const span = spanOf(dates, o.mode || 'full', t);
478
474
  return { title: v.title || r.title || '', summary: sum, overview: overviewOf(r, v, o), suggests: all.slice(0, MAX_SUGGEST), more: sug.more + Math.max(0, all.length - MAX_SUGGEST), rowSuggests: rowS, facts: factsOf(r, v, o),
479
- rows: bd.rows, many: bd.many, span, today: iso(t), artefacts: arts };
475
+ rows: bd.rows, many: bd.many, looseN: bd.looseN || 0, span, today: iso(t), artefacts: arts };
480
476
  }
481
477
 
482
478
  /* ── one level up: a program or a product (boards 26, 27) ── */