create-pmos 0.688.0 → 0.690.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/package.json +26 -14
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-insights-test.js +23 -1
  7. package/workspace/briefing-premium-test.js +3 -0
  8. package/workspace/changelog.json +25 -0
  9. package/workspace/guide/breakdown.md +24 -1
  10. package/workspace/guide/cli.md +2 -0
  11. package/workspace/guide/initiatives-and-next-steps.md +13 -1
  12. package/workspace/guide/intelligence-okr-goals.md +1 -1
  13. package/workspace/guide/settings-and-switches.md +1 -1
  14. package/workspace/lib/board-premium.js +13 -3
  15. package/workspace/lib/engine/boards.js +18 -3
  16. package/workspace/lib/initiative-premium.js +7 -4
  17. package/workspace/lib/jira-cli.js +21 -2
  18. package/workspace/lib/jira-epics.js +125 -0
  19. package/workspace/lib/jira-status.js +18 -3
  20. package/workspace/lib/kind-scope.js +73 -0
  21. package/workspace/lib/route-modules.js +1 -0
  22. package/workspace/lib/routes-boards.js +109 -6
  23. package/workspace/lib/routes-intake.js +7 -3
  24. package/workspace/lib/routes-jira-epics.js +65 -0
  25. package/workspace/lib/settings-store.js +3 -0
  26. package/workspace/lib/task-cli.js +25 -7
  27. package/workspace/lib/task-store.js +2 -2
  28. package/workspace/package-lock.json +2 -2
  29. package/workspace/package.json +1 -1
  30. package/workspace/public/pm/bd-asks.js +4 -3
  31. package/workspace/public/pm/bd-backlog.js +25 -4
  32. package/workspace/public/pm/bd-ini-panel.js +1 -1
  33. package/workspace/public/pm/bd-pop-ds.css +22 -0
  34. package/workspace/public/pm/bd-pop-ds.js +48 -11
  35. package/workspace/public/pm/bd-sprint-ds.js +5 -4
  36. package/workspace/public/pm/bd-sprint.js +10 -3
  37. package/workspace/public/pm/bd-work-ds.css +4 -0
  38. package/workspace/public/pm/cozy-pop-work.css +12 -0
  39. package/workspace/public/pm/cozy-pop-work.js +172 -9
  40. package/workspace/public/pm/cozy-settings.js +9 -0
  41. package/workspace/public/pm/home-app.js +1 -1
  42. package/workspace/public/pm/home-ini-model.js +1 -1
  43. package/workspace/public/pm/home-ini.js +6 -3
  44. package/workspace/public/pm/ini-view-model.js +12 -1
  45. package/workspace/public/pm/pop-work-model.js +40 -7
  46. package/workspace/public/pm/premium-initiative-head.js +17 -6
  47. package/workspace/public/pm/premium-insights.js +1 -1
  48. package/workspace/public/pm/work-select.js +73 -0
  49. package/workspace/public/pm/work-tree.js +111 -0
  50. package/workspace/skills/jira-epic.skill +35 -0
  51. package/workspace/test-lists/kind-scopes-lifecycle-stages.json +9 -0
  52. package/workspace/test-lists/work-subtasks.json +11 -0
@@ -39,12 +39,14 @@ const USAGE = [
39
39
  ' pmos task add <initiative> "<title>" [--stage <stage>] [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]',
40
40
  ' Add a task. Every new task goes here; pmos item add is the older breakdown record.',
41
41
  ' pmos task set <task> [<task> …] [--stage <stage>|none] [--due YYYY-MM-DD|none] [--start YYYY-MM-DD|none] [--owner <who>] [--notes <text>]',
42
- ' [--milestone|--no-milestone] [--pin|--no-pin|--pin-default]',
42
+ ' [--milestone|--no-milestone] [--pin|--no-pin|--pin-default] [--parent <task>|none]',
43
+ ' --parent puts the task under another task of the same initiative as a subtask; none takes it back to the top level. Set it only when the PM asks.',
43
44
  ' Group tasks under a stage of the initiative\'s workflow (key or name; none takes it out), or change dates, owner or notes.',
44
45
  ' --milestone makes a task a milestone: its due date shows as ◇ on the Board and the timeline. Set it only when the PM asks.',
45
46
  ' --pin shows a milestone on the Board timeline, --no-pin hides it, --pin-default goes back to the rule (the last milestone',
46
47
  ' shows). Set it only when the PM asks.',
47
- ' pmos task list <initiative> [--all] its open tasks, with the start and due day the Board shows; --all adds Done, Won\'t do and Archived',
48
+ ' pmos task list <initiative> [--all] its open tasks, with the start and due day the Board shows; --all adds Done, Won\'t do and Archived.',
49
+ ' A subtask prints under its parent, indented.',
48
50
  ' pmos task remove <task> [<task> …] [--why <text>]',
49
51
  ' Delete a task added by mistake (a placeholder, a duplicate) when the PM asks. It goes from every list; the page\'s Undo brings',
50
52
  ' it back. Work that stopped is Archived or Won\'t do instead. A breakdown item is not deleted: set it to Won\'t do.',
@@ -63,7 +65,7 @@ const USAGE = [
63
65
  ];
64
66
  const BOOL = new Set(['json', 'help', 'all', 'milestone', 'no-milestone', 'pin', 'no-pin', 'pin-default', 'propose']);
65
67
  const PIN_FLAGS = ['pin', 'no-pin', 'pin-default'];
66
- const VALUE = new Set(['to', 'why', 'root', 'due', 'start', 'owner', 'notes', 'stage', 'type', 'lag']);
68
+ const VALUE = new Set(['to', 'why', 'root', 'due', 'start', 'owner', 'notes', 'stage', 'type', 'lag', 'parent']);
67
69
  const ONLY = { add: ['due', 'start', 'owner', 'notes', 'stage'], list: ['all'], state: ['to', 'why'], remove: ['why'], set: ['due', 'start', 'owner', 'notes', 'stage'], link: ['type', 'lag', 'why'], unlink: [] };
68
70
  const OPEN = new Set(['To do', 'In progress']);
69
71
  /** The PM's words for a state: any case, with or without the apostrophe or the space. */
@@ -107,6 +109,16 @@ function boardsCtx(root, stateDir) {
107
109
  return { w, ctx: { getWs: () => w, workspaceList: () => [w], stateDirFor: () => stateDir, selfRoot: path.resolve(__dirname, '..', '..') } };
108
110
  }
109
111
  const line = (t) => `${t.id} · ${t.state} · ${t.title}${t.kind === 'Epic' ? ' (epic)' : ''}${t.milestone ? ' · ◇ milestone' : ''}${t.pinned === true ? ' · pinned' : t.pinned === false ? ' · not pinned' : ''}${t.stage ? ' · under ' + t.stage : ''}${t.start ? ' · starts ' + String(t.start).slice(0, 10) : ''}${t.due ? ' · due ' + String(t.due).slice(0, 10) : ''}`;
112
+ /** The tasks in tree order: each one, then the ones under it (a parent not in the list leaves its subtask at the top level). */
113
+ function nested(T) {
114
+ const ids = new Set(T.map((t) => t.id)), kids = new Map(), out = [];
115
+ for (const t of T) if (t.parent && ids.has(t.parent) && t.parent !== t.id) { if (!kids.has(t.parent)) kids.set(t.parent, []); kids.get(t.parent).push(t); }
116
+ const seen = new Set();
117
+ const walk = (t, d) => { if (seen.has(t.id)) return; seen.add(t.id); out.push({ t, depth: d }); for (const k of kids.get(t.id) || []) walk(k, d + 1); };
118
+ for (const t of T) if (!(t.parent && ids.has(t.parent) && t.parent !== t.id)) walk(t, 0);
119
+ for (const t of T) if (!seen.has(t.id)) walk(t, 0); // a loop: still listed
120
+ return out;
121
+ }
110
122
  /** The workflow row of an initiative, deriving the rows when they are still being read. */
111
123
  function rowOf(boards, ctx, w, id) {
112
124
  let r = boards.initiativeWorkflow(ctx, w, id);
@@ -144,7 +156,11 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
144
156
  const cli = { isTTY: isTTY === undefined ? !!(process.stdin.isTTY && process.stdout.isTTY) : isTTY, env: env === undefined ? process.env : env };
145
157
  const g = { ok: true, actor: actorLib.fromCli(cli), cli };
146
158
  /** Every task of an initiative: its Board tasks and its breakdown items (lib/stage-read.js, which `pmos board` reads too). */
147
- const tasksOf = (id) => require('./stage-read.js').tasksOf(ctx, w, id);
159
+ const tasksOf = (id) => {
160
+ // each with its parent (subtasks, initiative work-subtasks), from the same fold the Board reads
161
+ const PA = boards.foldOf(ctx, w).parents || new Map();
162
+ return require('./stage-read.js').tasksOf(ctx, w, id).map((t) => (PA.has(t.id) ? { ...t, parent: PA.get(t.id) } : t));
163
+ };
148
164
 
149
165
  if (verb === 'add') {
150
166
  const [id, title] = pos;
@@ -173,9 +189,10 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
173
189
  try { boards.seedInitiative(ctx, w, id); } catch { /* the To finish tasks are made on the next read */ }
174
190
  const all = tasksOf(id);
175
191
  const shown = flags.all ? all : all.filter((t) => OPEN.has(t.state));
176
- if (json) { say(JSON.stringify({ ok: true, tasks: shown.map((t) => ({ id: t.id, board: t.board, kind: t.kind, title: t.title, state: t.state, owner: t.owner, start: t.start || null, due: t.due, stage: t.stage || '', ...(t.milestone ? { milestone: true } : {}), ...(typeof t.pinned === 'boolean' ? { pinned: t.pinned } : {}), ...(t.from ? { from: t.from } : {}) })) })); return 0; }
192
+ if (json) { say(JSON.stringify({ ok: true, tasks: shown.map((t) => ({ id: t.id, board: t.board, kind: t.kind, title: t.title, state: t.state, owner: t.owner, start: t.start || null, due: t.due, stage: t.stage || '', ...(t.milestone ? { milestone: true } : {}), ...(typeof t.pinned === 'boolean' ? { pinned: t.pinned } : {}), ...(t.from ? { from: t.from } : {}), ...(t.parent ? { parent: t.parent } : {}) })) })); return 0; }
177
193
  if (!shown.length) { say(all.length ? `No open task on ${id}. --all lists the ${all.length} closed.` : `No task on ${id}.`); return 0; }
178
- for (const t of shown) say(line(t));
194
+ // subtasks (initiative work-subtasks): a task with a parent prints under it, indented one step per level, up to three
195
+ for (const x of nested(shown)) say(' '.repeat(Math.min(x.depth, 3)) + line(x.t));
179
196
  return 0;
180
197
  }
181
198
  /** A task by its id: a Board task, or a breakdown item with the board its initiative is on. */
@@ -191,7 +208,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
191
208
  };
192
209
 
193
210
  if (verb === 'set') {
194
- const keys = ['stage', 'due', 'start', 'owner', 'notes'].filter((k) => flags[k] !== undefined).concat(flags.milestone || flags['no-milestone'] ? ['milestone'] : []).concat(PIN_FLAGS.some((k) => flags[k]) ? ['pinned'] : []);
211
+ const keys = ['stage', 'due', 'start', 'owner', 'notes', 'parent'].filter((k) => flags[k] !== undefined).concat(flags.milestone || flags['no-milestone'] ? ['milestone'] : []).concat(PIN_FLAGS.some((k) => flags[k]) ? ['pinned'] : []);
195
212
  if (!pos.length || !keys.length) { say('usage: pmos task set <task> [<task> …] [--stage <stage>|none] [--due YYYY-MM-DD|none] [--start YYYY-MM-DD|none] [--owner <who>] [--notes <text>] [--milestone|--no-milestone] [--pin|--no-pin|--pin-default]'); return 2; }
196
213
  const folded = boards.foldOf(ctx, w);
197
214
  const done = [], refused = [];
@@ -208,6 +225,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
208
225
  }
209
226
  for (const k of ['due', 'start']) if (flags[k] !== undefined) body[k] = String(flags[k]).toLowerCase() === 'none' ? '' : flags[k];
210
227
  for (const k of ['owner', 'notes']) if (flags[k] !== undefined) body[k] = flags[k];
228
+ if (flags.parent !== undefined) body.parent = String(flags.parent).toLowerCase() === 'none' ? '' : String(flags.parent); // a subtask (initiative work-subtasks)
211
229
  if (flags.milestone || flags['no-milestone']) body.milestone = !!flags.milestone;
212
230
  if (PIN_FLAGS.some((k) => flags[k])) body.pinned = flags.pin ? true : flags['no-pin'] ? false : null;
213
231
  const e = boards.taskEdit(ctx, body, g);
@@ -28,7 +28,7 @@ const path = require('path');
28
28
  const ledgers = require('./plan-ledgers.js');
29
29
 
30
30
  const LEDGER = 'initiative-tasks.jsonl';
31
- const TASK_KINDS = Object.freeze(['task', 'task-update', 'task-remove', 'task-restore', 'task-section', 'task-milestone', 'task-pin', 'task-order']);
31
+ const TASK_KINDS = Object.freeze(['task', 'task-update', 'task-remove', 'task-restore', 'task-section', 'task-milestone', 'task-pin', 'task-order', 'task-parent']);
32
32
  const KINDS = new Set(TASK_KINDS);
33
33
  const isTaskKind = (k) => KINDS.has(k);
34
34
  const isTaskLine = (r) => !!r && typeof r === 'object' && !Array.isArray(r) && isTaskKind(r.kind);
@@ -118,7 +118,7 @@ function view(boardLines, storeLines) {
118
118
  /** The task part of a boards fold, as JSON text: equal text = the Board shows the same tasks, dates, places, milestones, pins and orders. */
119
119
  function snapshot(f) {
120
120
  const m = (x) => (x instanceof Map ? [...x.entries()].sort((a, b) => (String(a[0]) < String(b[0]) ? -1 : String(a[0]) > String(b[0]) ? 1 : 0)) : []);
121
- return JSON.stringify({ tasks: m(f.tasks), removed: m(f.removed), sections: m(f.sections), milestones: m(f.milestones), pins: m(f.pins), orders: m(f.orders),
121
+ return JSON.stringify({ tasks: m(f.tasks), removed: m(f.removed), sections: m(f.sections), parents: m(f.parents), milestones: m(f.milestones), pins: m(f.pins), orders: m(f.orders),
122
122
  // the last task-remove of a task is what its Undo reads (routes-boards tasks/restore)
123
123
  removes: (f.events || []).filter((e) => e.kind === 'task-remove').map((e) => [e.task, e.at || null, e.why || null]) });
124
124
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.688.0",
3
+ "version": "0.690.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.688.0",
9
+ "version": "0.690.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.688.0",
3
+ "version": "0.690.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",
@@ -162,7 +162,7 @@ export async function openNew(from, ask) {
162
162
  const d = ask ? ask.draft || {} : {};
163
163
  // kind: the one picked; kindBy: 'pmos' while PMOS's pre-pick from the name stands, 'you' once the PM taps one (then it never changes)
164
164
  const dk = d.kind && WK.KINDS.includes(d.kind) && d.kind_cue ? d.kind : null;
165
- N = { ask: ask || null, links: [], files: [], lean: d.lane || null, prior: ask ? ask.prior || [] : [], ack: false, close: null, kind: dk || 'product', kindBy: dk ? 'pmos' : null };
165
+ N = { ask: ask || null, links: [], files: [], lean: d.lane || null, prior: ask ? ask.prior || [] : [], ack: false, close: null, kind: dk || (WK.KINDS.includes(d.kind) ? d.kind : 'product'), kindBy: dk ? 'pmos' : null }; // no cue: the PM's role (work.role), no ✦ line
166
166
  const body = `<form class="bd-form bd-new" data-form="new2"${ask ? ` data-ask="${esc(ask.id)}"` : ''} novalidate>`
167
167
  + (ask ? `<p class="bd-quote">“${esc(ask.line)}”</p>` : '')
168
168
  + `<label class="bd-field">Name<input class="bd-inp" name="title" maxlength="120" value="${esc(d.title || '')}" placeholder="For example: Partner SSO audit trail" autocomplete="off"></label>`
@@ -190,8 +190,9 @@ function lean(text) {
190
190
  const r = text.trim().length > 3 ? await pmPost('/api/intake/draft', { line: text.trim() }).catch(() => null) : null;
191
191
  if (!N) return;
192
192
  if (r && r.ok && r.draft) { N.lean = r.draft.lane || N.lean; if (!N.ask) N.prior = r.draft.prior_rejections || []; }
193
- // PMOS's pre-pick follows the name until the PM taps a kind; a name that tells nothing goes back to Product with no ✦ line
194
- if (N.kindBy !== 'you') { const cue = r && r.ok && r.draft && r.draft.kind_cue && WK.KINDS.includes(r.draft.kind); N.kind = cue ? r.draft.kind : 'product'; N.kindBy = cue ? 'pmos' : null; }
193
+ // PMOS's pre-pick follows the name until the PM taps a kind; a name that tells nothing goes back to the PM's role (Settings › General ›
194
+ // Your role; the draft's kind then) with no ✦ line
195
+ if (N.kindBy !== 'you') { const dr = r && r.ok && r.draft, cue = dr && dr.kind_cue && WK.KINDS.includes(dr.kind); N.kind = cue ? dr.kind : dr && WK.KINDS.includes(dr.kind) ? dr.kind : 'product'; N.kindBy = cue ? 'pmos' : null; }
195
196
  const k = $('#nwKind'), h = $('#nwHints'); if (k) k.innerHTML = kindBox(); if (h) h.innerHTML = hintsHtml();
196
197
  }, 350);
197
198
  }
@@ -16,6 +16,7 @@
16
16
  import * as BM from './bk-model.js';
17
17
  import { productName } from './scope-chip.js'; // the product's display name ("IDPF"), never its folder id
18
18
  import * as SP from './bd-sprint.js';
19
+ import * as WS from './work-select.js'; // the bulk move with one Undo, shared with the initiative popup and This sprint (WorkBulkDS)
19
20
  import * as BD from './bd-backlog-ds.js'; // the Backlog from the system's parts (WorkBacklogDS) // the sprint overview while "This sprint" is on (initiative sprint-overview)
20
21
 
21
22
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
@@ -39,6 +40,7 @@ let CHIPS = new Set(), PICK = {}, SORT = 'due';
39
40
  let FOLD = {}; // group key → open (true) | folded (false), as the PM left it
40
41
  let MORE = new Set(); // the groups whose "N more" was pressed
41
42
  let SEL = new Set(); // ticked rows: ws|board|id
43
+ let ANCHOR = ''; // the last row picked in This sprint (Shift-click adds the range from it)
42
44
  let host = null, sw = null;
43
45
  let iniApplied = false; // ?ini= is read once
44
46
  let SAID = null; // the one line after a Yes: { text, undo }
@@ -143,7 +145,7 @@ function draw() {
143
145
  // This sprint (WorkSprintDS): the Summary card and the Tasks Table, both pm/bd-sprint.js; a past sprint keeps its frozen view and list
144
146
  if (tabOf() === 'sp') {
145
147
  const card = SP.bandHtml({ tasks: T.filter(BM.isOpen), all: T, inis: DATA.inis, readAt: DATA.readAt, notes: DATA.notes, hist: DATA.hist, now: DATA.now }, spDeps());
146
- const list = SP.pastOn() ? SP.pastListHtml() : SP.tasksNowHtml();
148
+ const list = SP.pastOn() ? SP.pastListHtml() : SP.tasksNowHtml(SEL);
147
149
  host.innerHTML = (DATA.err ? `<p class="bk-err">${esc(DATA.err)}</p>` : '') + (SAID ? `<p class="bk-said" role="status">${esc(SAID.text)}${SAID.undo ? ' <button type="button" class="bk-lnk" data-bksaid>Undo</button>' : ''}</p>` : '')
148
150
  + (card || list ? card + list : '<section class="pm-block"><p class="pm-meta">No sprint is active. When Jira has one, its work shows here, with the tasks outside Jira in its dates.</p></section>');
149
151
  drawBar();
@@ -323,7 +325,8 @@ function rowHtml(t, gk, cols = COLS) {
323
325
 
324
326
  /** What the sprint band (pm/bd-sprint.js) needs from the Backlog and its page. */
325
327
  const spDeps = () => ({ post, tasks: () => (DATA ? DATA.tasks.filter(BM.isOpen) : []), say: (m, u) => AP().say(m, u), draw, load, reload: () => AP().reload(), taskOf,
326
- openTask: (t, from) => AP().openTask(t, from),
328
+ openTask: (t, from) => AP().openTask(t, from), sel: SEL,
329
+ pick: (uid, order, e) => { const r = WS.pick(SEL, order, uid, { shift: e.shiftKey, meta: e.metaKey || e.ctrlKey, anchor: ANCHOR }); if (!r) return false; SEL.clear(); for (const u of r.sel) SEL.add(u); ANCHOR = r.anchor; draw(); return true; },
327
330
  pickIni: (at, p, done) => pickPop(at, 'Put them in', (DATA.inis || []).filter((x) => x.ws === p.ws && x.board === p.board).map((x) => [x.id, x.title]), (id) => done(id, ((DATA.inis || []).find((x) => x.id === id) || {}).title || id)),
328
331
  readJira: A && A.readJira ? () => A.readJira() : null, newInitiative: A && A.newInitiative ? (name, from) => A.newInitiative(name, from) : null });
329
332
 
@@ -335,7 +338,8 @@ function drawBar() {
335
338
  if (!n || !on()) { if (bar) { bar.remove(); bar = null; } return; }
336
339
  if (!bar) { bar = document.createElement('div'); bar.className = 'bk-bar'; bar.setAttribute('role', 'toolbar'); bar.setAttribute('aria-label', 'Ticked tasks'); document.body.appendChild(bar); bar.addEventListener('click', barPress); }
337
340
  bar.innerHTML = `<span class="c">${n} selected</span><button type="button" class="pm" data-bkb="give">${SPARK} Give to PMOS</button><button type="button" data-bkb="person">Give to a person</button>`
338
- + `<button type="button" data-bkb="ini">Move to initiative</button><button type="button" data-bkb="date">Set date</button><button type="button" data-bkb="archive">Archive</button>`
341
+ + `<button type="button" data-bkb="ini">Move to initiative</button><button type="button" data-bkb="parent">Under a parent</button><button type="button" data-bkb="date">Set date</button><button type="button" data-bkb="shift">Move dates</button>`
342
+ + `<button type="button" data-bkb="done">Done</button><button type="button" data-bkb="archive">Archive</button>`
339
343
  + `<button type="button" class="x" data-bkb="clear" aria-label="Clear the ticks" title="Clear">${SV(I.x)}</button>`;
340
344
  }
341
345
  const picked = () => DATA.tasks.filter((t) => SEL.has(uidOf(t)));
@@ -347,7 +351,24 @@ async function barPress(e) {
347
351
  if (k === 'person') { pickPop(b, 'Give to a person', people(), async (who) => { await editMany(T, { owner: who }, 'Given to ' + who); }, { free: 'A name' }); return; }
348
352
  if (k === 'ini') { pickPop(b, 'Move to initiative', inisFor(T).map((x) => [x.id, x.title]), async (id) => { await moveMany(T, id); }); return; }
349
353
  if (k === 'date') { datePop(b, async (d) => { await editMany(T, { due: d }, 'Due ' + d); }); return; }
350
- if (k === 'archive') { await stateMany(T, 'Archived'); }
354
+ if (k === 'archive') { await stateMany(T, 'Archived'); return; }
355
+ // the bulk move (initiative work-subtasks, WorkBulkDS): under a parent of the same initiative, by N days, or done, with one Undo
356
+ if (k === 'parent') {
357
+ const inis = new Set(T.map((t) => t.ini || '')), ini = [...inis][0];
358
+ if (inis.size !== 1 || !ini) { AP().say('Pick tasks of one initiative to put them under a parent.'); return; }
359
+ const L = DATA.tasks.filter((t) => t.ini === ini && t.src === 'pmos' && !SEL.has(uidOf(t))).map((t) => [uidOf(t), t.title]);
360
+ pickPop(b, 'Under a parent', [['', 'Top level (no parent)']].concat(L), async (v) => { const p = v ? DATA.tasks.find((t) => uidOf(t) === v) : null; await bulkMany(T, 'parent', p ? p.id : '', p ? p.title : 'the top level'); });
361
+ return;
362
+ }
363
+ if (k === 'shift') { pickPop(b, 'Move dates', [['-7', '1 week earlier'], ['-1', '1 day earlier'], ['1', '1 day later'], ['7', '1 week later']], async (v) => { const n = WS.shiftOf(v); if (n != null) await bulkMany(T, 'shift', n); }, { free: 'Days: +3, -2, 1w' }); return; }
364
+ if (k === 'done') { await bulkMany(T, 'done', null); }
365
+ }
366
+ /** One bulk write per board (POST /api/boards/tasks/bulk) and one Undo for all of it (pm/work-select.js). */
367
+ async function bulkMany(T, op, value, label) {
368
+ const by = new Map(T.map((t) => [uidOf(t), t]));
369
+ SEL.clear();
370
+ await WS.bulk((p, b) => post(p, b), (u) => { const t = by.get(u); return t ? { ws: t.ws, board: t.board, id: t.id } : null; }, [...by.keys()], op, value,
371
+ { say: (m, u) => AP().say(m, u || undefined), reload: async () => { load(); AP().reload(); } }, label);
351
372
  }
352
373
  const inisFor = (T) => { const ws = new Set(T.map((t) => t.ws + '|' + t.board)); return (DATA.inis || []).filter((x) => ws.has(x.ws + '|' + x.board)); };
353
374
 
@@ -70,7 +70,7 @@ async function readPage(r, force) {
70
70
  pmGet('/api/home-desk' + (w.ws ? '?ws=' + encodeURIComponent(w.ws) : '')).catch(() => null)]);
71
71
  const m = x && x.ok && x.model;
72
72
  const was = JSON.stringify(PAGE.get(r.id) || { gate: null, docs: [], people: [] });
73
- const now = { gate: m && !ownWf(r) ? gateOf(m.gateSteps || m.checks) : null, docs: m ? MD.docRows(m) : [], people: (d && d.ok && d.stakeholders && d.stakeholders[r.id]) || [] };
73
+ const now = { gate: m && !ownWf(r) ? gateOf(m.gateSteps || m.checks, m.scope) : null, docs: m ? MD.docRows(m).filter((d) => !d.hidden) : [], people: (d && d.ok && d.stakeholders && d.stakeholders[r.id]) || [] };
74
74
  PAGE.set(r.id, now);
75
75
  if (JSON.stringify(now) !== was) refresh(); // only when the read changed what shows, and never under the PM's hand (refresh skips a focused body)
76
76
  }
@@ -78,6 +78,28 @@ div.pwd-art { cursor: default; }
78
78
  .pwd-art.miss .t { color: var(--muted); }
79
79
  .pwd-art .w.warn { color: var(--alert); }
80
80
  .pwd-ai { flex: none; color: var(--muted); display: inline-flex; }
81
+
82
+ /* ── subtasks, the bulk bar and the Jira chip (initiative work-subtasks; WorkSubtasksDS, WorkBulkDS, WorkJiraDS) ── */
83
+ .pwd-li[style*="--pwd-d"] { padding-left: calc(var(--pwd-d) * 24px + var(--space-4)); }
84
+ .pwd-chev { width: 20px; height: 20px; flex: none; display: inline-grid; place-items: center; border: 0; background: none; color: var(--muted); padding: 0; cursor: pointer; border-radius: var(--radius-sm); }
85
+ .pwd-chev:hover { color: var(--ink); background: var(--well); }
86
+ .pwd-chev.sp { visibility: hidden; cursor: default; }
87
+ .pwd-tl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-8); }
88
+ .pwd-prog { flex: none; width: 56px; height: 4px; border-radius: 2px; background: var(--well); overflow: hidden; margin-left: auto; }
89
+ .pwd-prog i { display: block; height: 100%; background: var(--leaf); }
90
+ .pwd-cnt { flex: none; white-space: nowrap; }
91
+ .pwd-key { display: inline-flex; align-items: center; gap: var(--space-4); text-decoration: none; color: var(--muted); font-size: var(--fs-meta); }
92
+ .pwd-key:hover { color: var(--ink); }
93
+ .pwd-ep { margin-left: var(--space-8); }
94
+ .pwd-epic { flex: none; display: inline-flex; align-items: center; gap: var(--space-4); font-size: var(--fs-meta); color: var(--ink); background: var(--well); border-radius: var(--radius-sm); padding: 2px var(--space-8); white-space: nowrap; }
95
+ .pwd-epic i { width: 6px; height: 6px; border-radius: 50%; background: var(--alert); }
96
+ .pwd-li.sel { box-shadow: inset 3px 0 0 var(--blue); background: var(--blue-tint); }
97
+ .pwd-list.picking .pwd-li { cursor: default; }
98
+ .ws-bar { gap: var(--space-8); flex-wrap: wrap; padding: var(--space-8) 0; }
99
+ .ws-bar .ws-n { margin-right: var(--space-8); }
100
+ .ws-bar .ws-x { margin-left: auto; }
101
+ .pwd-ask { margin: var(--space-8) 0; }
102
+
81
103
  /* a stage head is a press that folds the stage (Wawan, 2026-11-22): the system's pm-group as a button, the chevron at the end */
82
104
  .pwd-list .pm-group.pwd-gh { width: 100%; border: 0; font: inherit; font-size: var(--fs-label); font-weight: var(--fw-strong); text-align: left; cursor: pointer; }
83
105
  .pwd-list .pm-group.pwd-gh svg { margin-left: auto; flex: none; }
@@ -19,9 +19,11 @@ export const I = {
19
19
  star: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z', pen: 'M4 20h4L19 9l-4-4L4 16z', ok: 'M5 12.5l4.5 4.5L19 7.5', x: 'M6 6l12 12M18 6L6 18',
20
20
  plus: 'M12 5v14M5 12h14', more: 'M5 12h.01M12 12h.01M19 12h.01', open: 'M14 5h5v5M19 5l-8 8M18 14v5H5V6h5', box: 'M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z',
21
21
  dia: 'M12 4l8 8-8 8-8-8z', doc: 'M7 3h7l4 4v14H7zM14 3v4h4M9.5 12h6M9.5 16h6', deck: 'M4 5h16v11H4zM12 16v4M8 20h8', link: 'M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1',
22
- proto: 'M4 5h16v12H4zM9 21h6M12 17v4', right: 'M10 7l5 5-5 5', down: 'M7 10l5 5 5-5',
22
+ proto: 'M4 5h16v12H4zM9 21h6M12 17v4', right: 'M10 7l5 5-5 5', down: 'M7 10l5 5 5-5', jira: 'M12 3l9 9-9 9-9-9zM12 8l4 4-4 4-4-4z',
23
23
  who: 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM5 20a7 7 0 0 1 14 0', cal: 'M5 6h14v14H5zM5 10h14M9 4v4M15 4v4', stage: 'M5 7h14M5 12h10M5 17h6',
24
24
  };
25
+ import * as WT from './work-tree.js'; // subtasks and the epic check (initiative work-subtasks)
26
+ import { barHtml as selBar } from './work-select.js'; // the bulk bar (WorkBulkDS)
25
27
  const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
26
28
  const DAY = 864e5;
27
29
  const day = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? Date.UTC(+m[1], +m[2] - 1, +m[3]) : null; };
@@ -116,9 +118,9 @@ export function stagesHtml(st, W) {
116
118
  }
117
119
 
118
120
  /* ── the Work breakdown ── */
119
- export function wbsHead(view) {
121
+ export function wbsHead(view, epic = '', epicUrl = '') {
120
122
  const t = (k, l) => `<button type="button" class="pm-tab" role="tab" aria-selected="${view === k}" data-pwv="${k}">${l}</button>`;
121
- return `<div class="pm-row pwd-bh"><h2 class="pm-h-sm">Work breakdown</h2><div class="pm-tabs" role="tablist" aria-label="View of the work breakdown">${t('list', 'List')}${t('gantt', 'Gantt')}</div></div>`;
123
+ return `<div class="pm-row pwd-bh"><h2 class="pm-h-sm">Work breakdown</h2>${epic ? `<span class="pm-meta pwd-ep">epic</span>${keyChip({ ckey: epic, jurl: epicUrl || '' })}` : ''}<div class="pm-tabs" role="tablist" aria-label="View of the work breakdown">${t('list', 'List')}${t('gantt', 'Gantt')}</div></div>`;
122
124
  }
123
125
  /** The stage a captured line names: "Write the runbook in Plan" → Plan; else the stage in progress, else the first stage. */
124
126
  export function stageKeyOf(text, st) {
@@ -131,8 +133,34 @@ export function stageKeyOf(text, st) {
131
133
  const cur = L.find((x) => x.now) || L.find((x) => !x.done) || L[0];
132
134
  return cur ? { key: cur.key, name: cur.name, title: s, guessed: true } : null;
133
135
  }
134
- /** rows: the breakdown with every stage open but a finished one, done tasks in their date order and no "more" fold (pop-work-model.js
135
- * breakdownOf with openAll). A stage head is a press that folds it (data-pw-fold, the Gantt's own). o: { ro, looseN, ms } */
136
+ /** A Jira row's key chip (WorkJiraDS): it opens the ticket in Jira; a PMOS-only row has none. */
137
+ export function keyChip(x) {
138
+ const k = WT.keyOf(x); if (!k) return '';
139
+ const inner = `${SV(I.jira, 12)}<span>${esc(k)}</span>`;
140
+ return x.jurl && /^https:\/\//.test(x.jurl) ? ` <a class="pm-chip code pwd-key" href="${esc(x.jurl)}" target="_blank" rel="noopener" aria-label="${esc('Open ' + k + ' in Jira')}" title="Open in Jira">${inner}</a>` : ` <span class="pm-chip code pwd-key">${inner}</span>`;
141
+ }
142
+ /** The red dot of the epic check (WorkJiraDS): "No epic" or "Other epic", its reason on hover. Nothing when the ticket fits. */
143
+ export function epicDot(x, epics) {
144
+ const f = WT.epicFlag(x, epics); if (!f) return '';
145
+ return `<span class="pwd-epic" title="${esc(WT.epicWhy(x, f, epics))}" aria-label="${esc(WT.epicWhy(x, f, epics))}"><i aria-hidden="true"></i>${f === 'none' ? 'No epic' : 'Other epic'}</span>`;
146
+ }
147
+ /** The ✦ fix of the epic check, above the list: put the flagged tickets under the initiative's epic. */
148
+ export function epicSugHtml(fx) {
149
+ if (!fx) return '';
150
+ return `<div class="pm-sug x" role="group" aria-label="PMOS suggests"><div class="ttl">${SV(I.star)}<b class="say">${esc(fx.say)}</b></div>`
151
+ + `<dl><dt>Why</dt><dd>${esc(fx.why)}</dd><dt>PMOS will</dt><dd><ul>${fx.will.map((w) => `<li>${esc(w)}</li>`).join('')}</ul></dd><dt>What changes</dt><dd>${esc('Every ticket in this work sits under ' + fx.epic + ', so the epic\'s progress in Jira matches this page.')}</dd></dl>`
152
+ + `<div class="ans"><button type="button" class="pm-btn primary" data-pw-epic-fix aria-label="Yes, do it" title="Yes, do it">${SV(I.ok)}</button>`
153
+ + `<button type="button" class="pm-btn outline" data-pw-epic-drop aria-label="No" title="No">${SV(I.x)}</button></div></div>`;
154
+ }
155
+ /** Ticking a parent asks once (WorkSubtasksDS): tick its open subtasks too? */
156
+ export function tickAskHtml(x, n) {
157
+ return `<div class="pm-sug pwd-ask" role="group" aria-label="Tick the subtasks too?"><div class="ttl">${SV(I.ok)}<span>You ticked <b>${esc(x.title)}</b>. Tick its ${esc(n === 1 ? 'open subtask' : n + ' open subtasks')} too?</span></div>`
158
+ + `<div class="ans"><button type="button" class="pm-btn primary" data-pw-tick-all="${esc(x.uid)}" aria-label="Yes, tick them all" title="Yes, tick them all">${SV(I.ok)}</button>`
159
+ + `<button type="button" class="pm-btn outline" data-pw-tick-no aria-label="No" title="No">${SV(I.x)}</button></div></div>`;
160
+ }
161
+ /** rows: the breakdown with every stage open, its done tasks shown and no fold (pop-work-model.js breakdownOf).
162
+ * Every stage is open but a finished one; done tasks keep their date order; a stage head is a press that folds it (data-pw-fold).
163
+ * o: { ro, looseN, ms, epics (the initiative's Jira epics), sel (Set of picked uids), fix (the epic ✦, WT.epicFix), ask (a parent ticked: { x, n }) } */
136
164
  export function listHtml(rows, W, o = {}) {
137
165
  const groups = [], empty = [];
138
166
  let g = null;
@@ -140,8 +168,9 @@ export function listHtml(rows, W, o = {}) {
140
168
  if (x.kind === 'stage') { g = x.key === '' ? null : { s: x, tasks: [] }; if (g) groups.push(g); continue; }
141
169
  if (g && x.kind === 'task') g.tasks.push(x);
142
170
  }
171
+ const sel = o.sel || new Set();
143
172
  const li = (x) => {
144
- const sub = [x.date, x.who && x.who !== 'You' ? x.who : ''].filter(Boolean).join(' · ');
173
+ const sub = x.jsub ? [x.who && x.who !== 'You' ? x.who : '', x.date].filter(Boolean).join(' · ') : [x.date, x.who && x.who !== 'You' ? x.who : ''].filter(Boolean).join(' · ');
145
174
  // the tick (WorkStatesDS 3): marks it done, with Undo; a done task and a Jira ticket show their state only
146
175
  const box = x.done ? `<span class="pwd-ck dn" aria-label="Done" role="img">${SV(I.ok, 14)}</span>`
147
176
  : o.ro || x.jira ? `<span class="pwd-ck" aria-hidden="true">${SV(x.ms ? I.dia : I.box, 14)}</span>`
@@ -154,21 +183,29 @@ export function listHtml(rows, W, o = {}) {
154
183
  + (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))
155
184
  + (x.jira ? '' : ab(`data-pw-stage="${esc(x.uid)}" aria-haspopup="menu"`, 'Stage', I.stage))
156
185
  + ab(`data-pw-row-more="${esc(x.uid)}" aria-haspopup="menu"`, 'More for ' + x.title, I.more) + '</span>';
157
- return `<div class="pm-li pwd-li${x.done ? ' dn' : ''}${x.lit ? ' now' : ''}" data-pwli="${esc(x.uid)}" data-pw-row="${esc(x.uid)}">${box}<span class="txt">${title}${sub ? `<span class="w${x.late ? ' late' : ''}">${esc(sub)}</span>` : ''}</span>${acts}</div>`;
186
+ // a parent (WorkSubtasksDS): the fold chevron, "n of m done" with its bar; children indent one step per level, up to three
187
+ 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>' : '');
188
+ 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>` : '';
189
+ const jira = keyChip(x) + (x.jsub ? ' <span class="pm-meta">Jira sub-task</span>' : '');
190
+ const dot = epicDot(x, o.epics);
191
+ return `<div class="pm-li pwd-li${x.done ? ' dn' : ''}${x.lit ? ' now' : ''}${sel.has(String(x.uid)) ? ' sel' : ''}${x.kids ? ' par' : ''}" data-pwli="${esc(x.uid)}" data-pw-row="${esc(x.uid)}"${x.depth ? ` style="--pwd-d:${x.depth}"` : ''}>${chev}${box}<span class="txt"><span class="pwd-tl">${title}${jira}</span>${sub ? `<span class="w${x.late ? ' late' : ''}">${esc(sub)}</span>` : ''}</span>${prog}${dot}${acts}</div>`;
158
192
  };
159
193
  const body = groups.map((G) => {
160
194
  // a stage row from breakdownOf says whether it has tasks (can) and is open; a row without them is open when tasks follow it
161
195
  const has = G.s.can != null ? !!G.s.can : G.tasks.length > 0, open = G.s.open != null ? !!G.s.open : true;
162
196
  if (!has) { empty.push(G.s.name); return ''; }
163
- const count = G.s.count || G.tasks.filter((x) => x.done).length + ' of ' + G.tasks.length + ' done';
164
- // the head folds the stage (Wawan, 2026-11-22: "completed stage can be collapsed"); its tasks keep their date order, done ones in place
197
+ // a top-level task counts its subtasks (initiative work-subtasks); every task keeps its date order, done ones in place (Part A)
198
+ const top = G.tasks.filter((x) => !x.depth), nAll = top.reduce((k, x) => k + (x.kids ? x.nLeaf : 1), 0), nDn = top.reduce((k, x) => k + (x.kids ? x.nDone : x.done ? 1 : 0), 0);
199
+ const count = G.s.count || nDn + ' of ' + nAll + ' done';
200
+ // the head folds the stage (Wawan, 2026-11-22: "completed stage can be collapsed")
165
201
  const head = `<button type="button" class="pm-group pwd-gh${G.s.now ? ' now' : ''}" data-pw-fold="${esc(G.s.key)}" aria-expanded="${open}"><b>${esc(G.s.name)}</b> <span class="pm-meta">${esc(count)}</span>${SV(open ? I.down : I.right, 14)}</button>`;
166
202
  return head + (open ? G.tasks.map(li).join('') : '');
167
203
  }).join('');
168
204
  const fold = empty.length ? `<div class="pm-fold pwd-fold">${esc(empty.length === 1 ? empty[0] + ' has no tasks yet' : empty.slice(0, -1).join(', ') + ' and ' + empty[empty.length - 1] + ' have no tasks yet')}</div>` : '';
169
- const cap = o.ro ? '' : `<input class="pm-input pwd-cap" data-pw-cap placeholder="Add a task; say its stage, or PMOS picks one" aria-label="Add a task. Say its stage, or PMOS picks one" maxlength="200" autocomplete="off">`;
205
+ const cap = o.ro ? '' : sel.size ? selBar(sel.size) : `<input class="pm-input pwd-cap" data-pw-cap placeholder="Add a task; say its stage, or type &quot;under Batch 2:&quot; to add a subtask" aria-label="Add a task. Say its stage, or type under, a parent's name and a colon to add a subtask" maxlength="200" autocomplete="off">`;
206
+ const top = o.ro ? '' : (o.ask ? tickAskHtml(o.ask.x, o.ask.n) : '') + (o.fix && !sel.size ? epicSugHtml(o.fix) : '');
170
207
  const loose = o.looseN && !o.ro ? `<p class="pwd-loose"><button type="button" class="pw-lk" data-pw-backlog>${esc(o.looseN === 1 ? '1 task with no stage is in the Backlog' : o.looseN + ' tasks with no stage are in the Backlog')}${SV(I.right, 13)}</button></p>` : '';
171
- return cap + `<div class="pwd-list" role="list" aria-label="Work breakdown">${body || (fold ? '' : '<p class="pm-meta pwd-none">No task yet.</p>')}${fold}</div>` + loose;
208
+ return cap + top + `<div class="pwd-list${sel.size ? ' picking' : ''}" role="list" aria-label="Work breakdown">${body || (fold ? '' : '<p class="pm-meta pwd-none">No task yet.</p>')}${fold}</div>` + loose;
172
209
  }
173
210
 
174
211
  /* ── the side column ── */
@@ -87,14 +87,15 @@ export function groupsOf(rows, o = {}) {
87
87
  }
88
88
 
89
89
  const badgeOf = (s) => `<span class="pm-badge${s === 'In progress' || s === 'In review' ? ' blue' : ''}">${esc(s)}</span>`;
90
- function rowHtml(r, nest) {
90
+ function rowHtml(r, nest, sel) {
91
+ const on = !!(sel && sel.has(r.uid));
91
92
  const t = r.open ? `<button type="button" class="wk-tt" data-spopen="${esc(r.uid)}">${esc(r.title)}</button>`
92
93
  : r.url ? `<a class="wk-tt" href="${esc(r.url)}" target="_blank" rel="noopener">${esc(r.title)}</a>` : esc(r.title);
93
94
  const src = r.key ? `<span class="pm-meta code">${esc(r.key)}</span>` : '<span class="pm-chip">Not in Jira</span>';
94
95
  const due = `<span class="pm-row wk-due">${r.due ? `<span class="pm-meta code">${dayText(r.due)}</span>` : ''}${r.late ? `<span class="pm-badge alert">${lateText(r.late)}</span>` : ''}${movedText(r.moved) ? `<span class="pm-badge">${movedText(r.moved).replace(/^m/, 'M')}</span>` : ''}</span>`;
95
- return `<tr class="wk-sr${r.state === 'Done' ? ' wk-dn' : ''}" data-sp="${esc(r.uid)}"><td class="${nest ? 'wk-nest' : ''}"><b>${t}</b></td><td>${esc(r.who) || '<span class="pm-meta">No one</span>'}</td><td>${badgeOf(r.state)}</td><td>${src}</td><td>${due}</td></tr>`;
96
+ return `<tr class="wk-sr${r.state === 'Done' ? ' wk-dn' : ''}${on ? ' sel' : ''}" data-sp="${esc(r.uid)}"${sel && sel.size ? ` aria-selected="${on}"` : ''}><td class="${nest ? 'wk-nest' : ''}"><b>${t}</b></td><td>${esc(r.who) || '<span class="pm-meta">No one</span>'}</td><td>${badgeOf(r.state)}</td><td>${src}</td><td>${due}</td></tr>`;
96
97
  }
97
- /** The Tasks block. o: { tab, group, menu (the Group menu is open), themes } */
98
+ /** The Tasks block. o: { tab, group, menu (the Group menu is open), themes, sel (the picked rows, Set of uid: Cmd, Ctrl or Shift-click picks) } */
98
99
  export function tasksHtml(N, o = {}) {
99
100
  const c = countsOf(N), tab = o.tab || 'all', group = o.group || 'ini';
100
101
  const tabs = `<div class="pm-tabs" role="tablist" aria-label="Show">${TABS.filter(([k]) => k === 'all' || c[k] || k === tab).map(([k, n]) => `<button type="button" class="pm-tab" role="tab" aria-selected="${k === tab}" data-sptab="${k}">${n} <span class="pm-meta">${c[k]}</span></button>`).join('')}</div>`;
@@ -107,7 +108,7 @@ export function tasksHtml(N, o = {}) {
107
108
  const body = GG.map((g) => {
108
109
  const whole = all.find((x) => x.k === g.k) || g;
109
110
  const head = g.name ? `<tr class="wk-g"><td colspan="5"><div class="pm-group"><b>${esc(g.name)}</b> <span class="pm-meta">${whole.rows.filter((r) => r.state === 'Done').length} of ${whole.rows.length} done</span></div></td></tr>` : '';
110
- return head + g.rows.map((r) => rowHtml(r, !!g.name)).join('');
111
+ return head + g.rows.map((r) => rowHtml(r, !!g.name, o.sel)).join('');
111
112
  }).join('');
112
113
  const table = R.length ? `<table class="pm-table wk-spx"><thead><tr><th>Task</th><th>Who</th><th>State</th><th>Source</th><th>Due</th></tr></thead><tbody>${body}</tbody></table>`
113
114
  : '<p class="pm-meta">Nothing here.</p>';
@@ -114,10 +114,10 @@ function nowOf(sp) {
114
114
  return { name: sp.name, label: sp.label, start: null, end: null, rows, jira, other: rows.length - jira, done: 0, total: rows.length };
115
115
  }
116
116
  /** The Tasks block of the sprint shown (WorkSprintDS); '' when a past sprint shows (its list is pastListHtml). */
117
- export function tasksNowHtml() {
117
+ export function tasksNowHtml(sel) {
118
118
  if (!CUR || !CUR.now || CURP) return '';
119
119
  const themes = (CUR.themes || []).filter((t) => !t.spare && (t.uids || []).length).map((t) => ({ id: t.id, name: t.name, uids: t.uids }));
120
- return DS.tasksHtml(CUR.now, { tab: VIEW.tab, group: VIEW.group === 'theme' && !themes.length ? 'ini' : VIEW.group, menu: GMENU, themes });
120
+ return DS.tasksHtml(CUR.now, { tab: VIEW.tab, group: VIEW.group === 'theme' && !themes.length ? 'ini' : VIEW.group, menu: GMENU, themes, sel });
121
121
  }
122
122
 
123
123
  /* ── past sprints (initiative sprint-snapshots) ───────────────────────────────────────────────────────────── */
@@ -245,7 +245,7 @@ export function themeOf() {
245
245
  }
246
246
  export function clearTheme() { THEME = ''; }
247
247
 
248
- /** A press in the Backlog. → true when it was the band's. deps: { post, say, draw, load, reload, readJira, newInitiative, taskOf(uid) } */
248
+ /** A press in the Backlog. → true when it was the band's. deps: { post, say, draw, load, reload, readJira, newInitiative, taskOf(uid), sel, pick(uid, order, e) } */
249
249
  export async function press(e, deps) {
250
250
  const t0 = e.target;
251
251
  const hit = (a) => t0.closest('[' + a + ']');
@@ -323,6 +323,13 @@ export async function press(e, deps) {
323
323
  if (hit('data-spgroup')) { GMENU = !GMENU; deps.draw(); const n = document.querySelector('[data-spgrp][aria-checked="true"]'); if (GMENU && n) n.focus(); return true; }
324
324
  if ((b = hit('data-spgrp'))) { VIEW.group = b.dataset.spgrp; GMENU = false; saveView(); deps.draw(); const n = document.querySelector('[data-spgroup]'); if (n) n.focus(); return true; }
325
325
  if (GMENU) { GMENU = false; deps.draw(); }
326
+ // the bulk move (initiative work-subtasks, WorkBulkDS): Cmd, Ctrl or Shift-click picks a row; with rows picked, a plain click does too.
327
+ // The Backlog's bar moves them, with one Undo.
328
+ const row = t0.closest('tr[data-sp]');
329
+ if (row && deps.pick && (e.metaKey || e.ctrlKey || e.shiftKey || (deps.sel && deps.sel.size)) && !t0.closest('a')) {
330
+ const order = [...document.querySelectorAll('tr[data-sp]')].map((n) => n.dataset.sp);
331
+ if (deps.pick(row.dataset.sp, order, e)) return true;
332
+ }
326
333
  if ((b = hit('data-spopen'))) { const t = deps.taskOf(b.dataset.spopen); if (t && deps.openTask) deps.openTask(t, b); return true; }
327
334
  if ((b = hit('data-spno'))) { const p = CUR.props.find((x) => x.id === b.dataset.spno); return p ? dismiss(p, at, deps) : true; }
328
335
  if ((b = hit('data-spok'))) { const p = CUR.props.find((x) => x.id === b.dataset.spok); return p ? accept(p, b, deps) : true; }
@@ -164,3 +164,7 @@ body.bd-page.bk-on [id="bkBody"] { display: flex; flex-direction: column; gap: v
164
164
  body.bd-page.wk-on .wk-path, body.bd-page.bk-on .wk-path { display: contents; }
165
165
  body.bd-page.wk-on .wk-path > span, body.bd-page.wk-on .wk-path > .pm-ic, body.bd-page.bk-on .wk-path > span, body.bd-page.bk-on .wk-path > .pm-ic { display: none; }
166
166
  }
167
+
168
+ /* This sprint: a picked row (the bulk move, initiative work-subtasks, WorkBulkDS) */
169
+ .wk-spx tr.wk-sr.sel td { background: var(--blue-tint); }
170
+ .wk-spx tr.wk-sr.sel td:first-child { box-shadow: inset 2px 0 0 var(--blue); }
@@ -289,3 +289,15 @@ button.pw-fv .grey { color: var(--cz-ink3); }
289
289
  /* the item's header on a phone: back and the title; the page's ⋯ (cozy-nav.js) holds the item's own ⋯ items */
290
290
  .cz-vw:has(.pw-ph) .cz-vw-hd .cz-vw-tile, .cz-vw:has(.pw-ph) .cz-vw-hd .cz-vw-kind, .cz-vw:has(.pw-ph) .cz-vw-hd [data-cz-vw="discuss"], .cz-vw:has(.pw-ph) .cz-vw-hd [data-cz-vw-p="kind"] { display: none; }
291
291
  }
292
+
293
+ /* subtasks in the Gantt (initiative work-subtasks, WorkSubtasksDS): indent per level, a parent's fold and count, its outlined bar */
294
+ .pw-kr[style*="--pw-d"] .pw-it { padding-left: calc(38px + var(--pw-d) * 18px) !important; }
295
+ .pw-kr.par .pw-it { padding-left: 18px !important; }
296
+ .pw-kr.par[style*="--pw-d"] .pw-it { padding-left: calc(18px + var(--pw-d) * 18px) !important; }
297
+ .pw-chev { width: 20px; height: 20px; flex: none; display: inline-grid; place-items: center; border: 0; background: none; padding: 0; color: var(--cz-ink3); cursor: pointer; border-radius: 4px; }
298
+ .pw-chev:hover { color: inherit; }
299
+ .pw-cnt { color: var(--cz-ink3); white-space: nowrap; }
300
+ .pw-kr.sel { box-shadow: inset 3px 0 0 var(--blue); }
301
+ .pw-pbar { position: absolute; top: 50%; height: 10px; margin-top: -5px; border: 1.5px solid currentColor; border-radius: 3px; box-sizing: border-box; color: var(--cz-ink2); overflow: hidden; }
302
+ .pw-pbar b { display: block; height: 100%; background: currentColor; }
303
+ .pw-pbar.dn { opacity: .6; }