create-pmos 0.421.0 → 0.423.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 +25 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/anchor-resolve.js +93 -15
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-programs-test.js +87 -3
- package/workspace/briefing-premium-adddoc-test.js +1 -1
- package/workspace/briefing-premium-board-test.js +13 -11
- package/workspace/briefing-premium-initiative-test.js +30 -38
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/report-api/draft.json +2 -1
- package/workspace/guide/briefing-premium.md +2 -1
- package/workspace/guide/home.md +14 -4
- package/workspace/guide/programs.md +5 -3
- package/workspace/guide/workflows.md +5 -1
- package/workspace/home-other-product-test.js +55 -0
- package/workspace/ini-workflow-test.js +4 -4
- package/workspace/lib/board-premium.js +21 -6
- package/workspace/lib/custom-docs.js +65 -3
- package/workspace/lib/doc-live-root.js +37 -0
- package/workspace/lib/engine/anchor-resolve.js +93 -15
- package/workspace/lib/engine/boards.js +30 -2
- package/workspace/lib/engine/intake.js +1 -1
- package/workspace/lib/hold-spans.js +24 -10
- package/workspace/lib/initiative-writer.js +63 -1
- package/workspace/lib/kg.js +1 -1
- package/workspace/lib/plan-items.js +36 -5
- package/workspace/lib/programs.js +11 -3
- package/workspace/lib/report-draft.js +3 -0
- package/workspace/lib/route-modules.js +2 -0
- package/workspace/lib/routes-board-premium.js +28 -0
- package/workspace/lib/routes-boards.js +92 -13
- package/workspace/lib/routes-doc-sheet.js +29 -1
- package/workspace/lib/routes-initiatives.js +12 -0
- package/workspace/lib/routes-programs.js +44 -5
- package/workspace/lib/routes-task-links.js +329 -0
- package/workspace/lib/routes-task-plans.js +333 -0
- package/workspace/lib/split-merge-suggest.js +162 -0
- package/workspace/lib/split-merge.js +379 -0
- package/workspace/lib/task-cli.js +73 -13
- package/workspace/lib/task-items.js +15 -3
- package/workspace/lib/task-links.js +422 -0
- package/workspace/lib/task-plans.js +232 -0
- package/workspace/lib/vendor/scripts/anchor-resolve.js +93 -15
- package/workspace/lib/vendor/scripts/intake.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -2
- package/workspace/premium-core-doc-issue-test.js +2 -2
- package/workspace/premium-vw-backlog-test.js +3 -3
- package/workspace/premium-vw-doc-test.js +26 -3
- package/workspace/premium-vw-item-test.js +3 -3
- package/workspace/premium-vw-jira-test.js +6 -6
- package/workspace/product-lane-test.js +165 -0
- package/workspace/program-leave-test.js +203 -0
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-acts.js +5 -2
- package/workspace/public/pm/bd-ini-panel.js +32 -9
- package/workspace/public/pm/bd-prog-panel.js +22 -7
- package/workspace/public/pm/bd-prog.js +6 -1
- package/workspace/public/pm/bd-span.js +234 -30
- package/workspace/public/pm/bd-views.js +3 -2
- package/workspace/public/pm/cozy-board.css +90 -0
- package/workspace/public/pm/cozy-home.css +3 -0
- package/workspace/public/pm/doc-follow.js +36 -0
- package/workspace/public/pm/home-app.js +62 -14
- package/workspace/public/pm/home-ini-model.js +0 -34
- package/workspace/public/pm/home-ini.js +81 -204
- package/workspace/public/pm/home-list.js +2 -2
- package/workspace/public/pm/home-today.js +3 -1
- package/workspace/public/pm/ini-groups.js +228 -0
- package/workspace/public/pm/ini-links.js +561 -0
- package/workspace/public/pm/ini-tasks.js +131 -30
- package/workspace/public/pm/ini-versions.js +348 -0
- package/workspace/public/pm/ini-view-model.js +113 -43
- package/workspace/public/pm/ini-view.css +341 -18
- package/workspace/public/pm/ini-view.js +153 -38
- package/workspace/public/pm/premium-board.js +160 -21
- package/workspace/public/pm/premium-report-read.js +20 -1
- package/workspace/public/pm/premium-shell.js +29 -4
- package/workspace/public/pm/premium-vw-doc.js +46 -11
- package/workspace/public/pm/prog-move.js +69 -0
- package/workspace/public/pm/split-merge.css +77 -0
- package/workspace/public/pm/split-merge.js +265 -0
- package/workspace/public/pm/stage-line.js +414 -0
- package/workspace/public/pm/task-card.css +3 -0
- package/workspace/public/pm/task-card.js +15 -6
- package/workspace/public/pm/wf-page.css +2 -0
- package/workspace/public/pm/wf-page.js +2 -0
- package/workspace/public/pm/wf-stage.js +2 -1
- package/workspace/server.js +15 -1
- package/workspace/split-merge-ui-test.js +175 -0
- package/workspace/stage-card-test.js +12 -11
- package/workspace/task-card-test.js +3 -2
- package/workspace/task-delete-test.js +126 -0
- package/workspace/task-links-test.js +227 -0
- package/workspace/task-milestones-test.js +176 -0
- package/workspace/task-plans-test.js +181 -0
- package/workspace/task-views-test.js +3 -3
- package/workspace/test-lists/bd-ini-panel.json +8 -2
- package/workspace/test-lists/product-lane.json +6 -0
- package/workspace/test-lists/program-leave.json +6 -0
- package/workspace/test-lists/split-merge.json +15 -0
- package/workspace/test-lists/task-delete.json +5 -0
- package/workspace/test-lists/task-links.json +6 -0
- package/workspace/test-lists/task-milestones.json +6 -0
- package/workspace/test-lists/task-plans.json +6 -0
- package/workspace/test-lists/viewer-live-file.json +9 -0
- package/workspace/timeline-holds-test.js +61 -4
- package/workspace/tk-tasks-test.js +173 -57
- package/workspace/workflows-setup-test.js +4 -3
|
@@ -5,23 +5,35 @@
|
|
|
5
5
|
*
|
|
6
6
|
* viewHtml(v, o) the body, top to bottom: the summary card (what waits on you leads, with the one primary; else the status and why;
|
|
7
7
|
* the meta line: the status when something waits, the owner, the workflow, the program), the stage card (the stage's
|
|
8
|
-
* number and name, how much of its section is done, the day clock
|
|
9
|
-
*
|
|
8
|
+
* number and name, how much of its section is done, the day clock and the → to the next stage, then its one line:
|
|
9
|
+
* each stage on its own dates with the milestone tasks as ◇, pm/stage-line.js, batch 11 item 21), Tasks as the WBS
|
|
10
|
+
* (sections in workflow order), then Documents and Linked as folds.
|
|
10
11
|
* o: { add (the Tasks + icon), adding (the inline field is open), next (the next stage is a press: Home's move sheet), openTask, docs: { n, html? } | null,
|
|
11
12
|
* quick (each task's box carries the status caret and its date is a press: the host has h.status and h.dates),
|
|
12
13
|
* draft (the empty breakdown's Draft it), program (the chip opens the program), wf (the workflow on the meta line opens the Change picker) }
|
|
13
14
|
* wireView(body, h) the presses, once per body: h.check(uid, btn), h.openTask(uid), h.openTicket(key), h.add(btn) (the + icon: the host
|
|
14
15
|
* redraws with o.adding, an inline field), h.addTask(title, input), h.addCancel(), h.next(btn),
|
|
15
16
|
* h.primary(act, btn), h.program(id), h.docs(), h.doc(path) (a linked document), h.draft(btn), h.wf(btn), h.redraw() (after a fold opens or closes),
|
|
16
|
-
* h.
|
|
17
|
+
* h.sm(act, btn) a press on Claude's split or merge card (pm/split-merge.js press), h.openIni(id) the merged summary's link,
|
|
18
|
+
* h.status(uid, state) and h.dates(uid, { start?, due? }) (the quick changes, each saved at once with Undo in the host's toast);
|
|
19
|
+
* the stage card's line (batch 11 item 21, pm/stage-line.js): h.add(btn, { start, due }) a gap's + (a task on those dates),
|
|
20
|
+
* h.hold(i, btn) a hold's ⏸ or calendar (o.hold: the host has it), h.openIni(id) "after <initiative>";
|
|
21
|
+
* for planned versus actual (pm/ini-versions.js) h.where() → { ws, board }, h.reload() and h.toast(text, undo?)
|
|
17
22
|
*
|
|
18
23
|
* Tasks has three views (batch 9 item 5b; canvas In development, row "Tasks views"): the List (the WBS below), Timeline and Kanban
|
|
19
|
-
* (pm/ini-tasks.js). The icon segment in the Tasks header switches them, and the last one is remembered for the PM.
|
|
24
|
+
* (pm/ini-tasks.js). The icon segment in the Tasks header switches them, and the last one is remembered for the PM. The group icon before
|
|
25
|
+
* it (batch 11 item 20, pm/ini-groups.js) groups the same tasks by Stage, Epic, Your groups, Owner or Status in all three views; By epic
|
|
26
|
+
* carries the send icons and Send to Jira, which used to be the old All tasks panel's.
|
|
20
27
|
*
|
|
21
28
|
* Folds keep their state per initiative for the session (a section, the Later line, a WBS group, the done tasks). Icon-only presses carry
|
|
22
29
|
* their words in aria-label and title. Zero is silence: a part with nothing on record draws nothing. */
|
|
23
30
|
import { wfIcon } from './wf-model.js';
|
|
24
31
|
import * as TV from './ini-tasks.js'; // Tasks as List, Timeline or Kanban, and the quick status and dates (batch 9 item 5b)
|
|
32
|
+
import * as VS from './ini-versions.js'; // planned versus actual: the version chip, Make live, a draft's writes (batch 11 item 8)
|
|
33
|
+
import * as LK from './ini-links.js'; // links between tasks, Claude's proposals and quiet moves (batch 11 item 15)
|
|
34
|
+
import * as G from './ini-groups.js'; // Group by and Send to Jira, in place of the old All tasks panel (batch 11 item 20)
|
|
35
|
+
import { cardHtml as smCard, mergedHtml as smMerged } from './split-merge.js'; // split or merge: Claude's card, the merged summary (batch 11 item 14)
|
|
36
|
+
import { lineHtml, fitLine } from './stage-line.js'; // the stage card's one line (batch 11 item 21)
|
|
25
37
|
|
|
26
38
|
const CSS = new URL('./ini-view.css', import.meta.url).href;
|
|
27
39
|
if (typeof document !== 'undefined' && document.head && !document.querySelector(`link[href="${CSS}"]`)) {
|
|
@@ -32,7 +44,8 @@ const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" heigh
|
|
|
32
44
|
const P = {
|
|
33
45
|
go: 'M5 12h14M13 6l6 6-6 6', check: 'M5 12l5 5 9-10', right: 'M10 7l5 5-5 5', down: 'M7 10l5 5 5-5', plus: 'M12 5v14M5 12h14',
|
|
34
46
|
prog: 'M12 3l9 5-9 5-9-5zM3 13l9 5 9-5', doc: 'M7 3h7l5 5v13H7zM14 3v5h5', draft: 'M12 3v4M12 17v4M3 12h4M17 12h4M5.6 5.6l2.8 2.8M15.6 15.6l2.8 2.8M5.6 18.4l2.8-2.8M15.6 8.4l2.8-2.8',
|
|
35
|
-
skip: '
|
|
47
|
+
skip: 'M6 7l5 5-5 5M13 7l5 5-5 5', // » a skipped stage (batch 11 item 13: the same mark as the timelines)
|
|
48
|
+
pause: 'M9 6v12M15 6v12', cal: 'M4 5h16v15H4zM8 3v4M16 3v4M4 10h16',
|
|
36
49
|
};
|
|
37
50
|
const FOLD = new Map(); // `${id}|${key}` → true (open) | false (shut): the PM's own fold, for the session
|
|
38
51
|
const isOpen = (v, key, dflt) => { const k = (v.id || v.key) + '|' + key; return FOLD.has(k) ? FOLD.get(k) : !!dflt; };
|
|
@@ -54,43 +67,60 @@ function summaryHtml(s, o = {}) {
|
|
|
54
67
|
+ `<p class="iv-meta">${meta.join('<span class="iv-sep" aria-hidden="true">·</span>')}</p></section>`;
|
|
55
68
|
}
|
|
56
69
|
|
|
57
|
-
/* ── the stage card
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
70
|
+
/* ── the stage card: its header and one line (batch 11 item 21, agreed A; it replaced the ladder, the dates line and the next stage) ──
|
|
71
|
+
* The header: the stage's number and name, "N of M done" (a press shows the stage in Tasks), the clock, or the hold, done or draft chip that
|
|
72
|
+
* replaces it, the calendar when a date is missing, and the icon-only → that opens the move sheet (blue when every task of the stage is done
|
|
73
|
+
* and the next stage waits). The line is pm/stage-line.js. */
|
|
74
|
+
const CLOCK = 'M12 7.5V12l3 2M12 3.5a8.5 8.5 0 1 0 0 17a8.5 8.5 0 1 0 0-17';
|
|
75
|
+
const LINE = new Map(); // id → what is unfolded under the line ('' | 'list' | 'list+' | 'ms:<i>' | 'gap:<i>')
|
|
76
|
+
function stageHtml(st, o, id) {
|
|
77
|
+
const L = st.line;
|
|
78
|
+
const tile = st.n ? `<span class="iv-no${st.ms ? ' ms' : ''}" aria-hidden="true">${st.ms ? '' : st.n}</span>` : '';
|
|
79
|
+
const of = st.doneOf ? (st.key ? `<button type="button" class="iv-scd" data-iv-stage="${esc(st.key)}" title="Show ${esc(st.name)} in Tasks">${esc(st.doneOf)}</button>` : `<span class="iv-scd">${esc(st.doneOf)}</span>`) : '';
|
|
80
|
+
const chip = L && L.chip ? `<span class="iv-chp ${esc(L.chip.tone)}">${L.chip.pause ? SVG(P.pause, 11, 2.4) : ''}${esc(L.chip.text)}</span>` : '';
|
|
81
|
+
const clock = !chip && st.clock ? `<span class="iv-clk${st.dayOver ? ' w' : ''}">${SVG(CLOCK, 13, 2)}${esc(st.clock)}</span>` : '';
|
|
82
|
+
const cal = L && L.cal === 'dates' ? `<button type="button" class="iv-ib iv-scb" data-iv-tlcal aria-label="No dates yet. Set them in Tasks" title="Set the dates">${SVG(P.cal, 16)}</button>`
|
|
83
|
+
: L && L.cal === 'back' && o.hold ? `<button type="button" class="iv-ib iv-scb" data-iv-hold="${L.holdAt}" aria-label="On hold with no return date. Set it" title="Set the return date">${SVG(P.cal, 16)}</button>` : '';
|
|
65
84
|
const n = st.next;
|
|
66
|
-
const
|
|
67
|
-
|
|
85
|
+
const go = n ? `<${o.next ? 'button type="button" data-iv-next' : 'span'} class="iv-scgo${st.ready ? ' on' : ''}"${n.ms ? ' data-ms="1"' : ''} aria-label="${esc('Next: ' + (n.ms ? '◆ ' : '') + n.name + (o.next ? '. Move to ' + n.name : ''))}" title="${esc('Next: ' + n.name)}">${SVG(P.go, 16, 2.2)}</${o.next ? 'button' : 'span'}>` : '';
|
|
86
|
+
// a phone puts "N of M done" and the clock on a line of their own under the name (ScxA2Phone)
|
|
87
|
+
const meta = of || clock || chip ? `<span class="iv-scm">${of}${clock}${chip}</span>` : '';
|
|
88
|
+
const head = `<div class="iv-sch">${tile}<b>${esc(st.name)}</b><span class="iv-sp"></span>${meta}${cal}${go}</div>`;
|
|
89
|
+
return `<section class="iv-sc" aria-label="${esc(st.aria || 'Stage · ' + st.name)}">${head}${lineHtml(L, { open: LINE.get(id) || '', hold: !!o.hold })}</section>`;
|
|
68
90
|
}
|
|
69
91
|
|
|
70
92
|
/* ── the WBS ── */
|
|
71
93
|
function taskHtml(x, o, arch) {
|
|
72
94
|
// the box marks done in one press; its caret opens the status picker right under it (an archived task has only the caret)
|
|
73
|
-
const car = o.quick && x.uid ? `<button type="button" class="iv-car" data-iv-stat="${esc(x.uid)}" data-st="${esc(x.status)}" aria-haspopup="dialog" aria-label="${esc('Change the status: ' + x.title)}" title="Status">${SVG(P.down, 10, 2.6)}</button>` : '';
|
|
95
|
+
const car = o.quick && x.uid ? `<button type="button" class="iv-car" data-iv-stat="${esc(x.uid)}" data-st="${esc(x.status)}" data-ms="${x.ms ? 1 : 0}" aria-haspopup="dialog" aria-label="${esc('Change the status: ' + x.title)}" title="Status">${SVG(P.down, 10, 2.6)}</button>` : '';
|
|
74
96
|
const cls = ['iv-cb', x.done ? 'on' : '', x.prog ? 'pr' : '', x.wont ? 'wo' : ''].filter(Boolean).join(' ');
|
|
75
|
-
const chk = x.canCheck && !arch ? `<span class="iv-bxw"><button type="button" class="${cls}" data-iv-check="${esc(x.uid)}" aria-pressed="${x.done}" aria-label="${esc((x.done ? 'Reopen: ' : 'Mark done: ') + x.title)}" title="${x.done ? 'Reopen' : 'Mark done'}">${x.done ? SVG(P.check, 12, 3) : ''}</button>${car}</span>`
|
|
97
|
+
const chk = x.dr ? `<span class="iv-bxw"><span class="iv-cb dr" aria-hidden="true"></span>${car}</span>` : x.canCheck && !arch ? `<span class="iv-bxw"><button type="button" class="${cls}" data-iv-check="${esc(x.uid)}" aria-pressed="${x.done}" aria-label="${esc((x.done ? 'Reopen: ' : 'Mark done: ') + x.title)}" title="${x.done ? 'Reopen' : 'Mark done'}">${x.done ? SVG(P.check, 12, 3) : ''}</button>${car}</span>`
|
|
76
98
|
: `<span class="iv-bxw"><span class="iv-cb off${x.done ? ' on' : ''}" aria-hidden="true">${x.done ? SVG(P.check, 12, 3) : ''}</span>${arch ? car : ''}</span>`;
|
|
77
|
-
const t = o.openTask && x.uid ? `<button type="button" class="iv-tt" data-iv-task="${esc(x.uid)}">${esc(x.title)}</button>` : `<b class="iv-tt">${esc(x.title)}</b
|
|
99
|
+
const t = (o.openTask && x.uid && !x.dr ? `<button type="button" class="iv-tt" data-iv-task="${esc(x.uid)}">${esc(x.title)}</button>` : `<b class="iv-tt">${esc(x.title)}</b>`) + TV.msGlyph(x) + TV.addedMark(x);
|
|
78
100
|
// the meta: In progress, the dates (a press: the start and due picker opens under them), the late days, the owner
|
|
79
101
|
let meta = x.sub ? `<span class="${x.late ? 'w' : ''}">${esc(x.sub)}</span>` : '';
|
|
80
102
|
if (o.quick && x.uid) {
|
|
81
103
|
// no dates: the calendar icon sits last and shows on hover, so an undated row reads the same as before
|
|
82
|
-
const parts = [x.prog ? 'In progress' : '', x.days ? TV.dateBtn(x, o) + (x.lateText ? `<span class="iv-late">, ${esc(x.lateText)}</span>` : '') : '', x.owner && x.owner !== 'You' ? esc(x.owner) : ''];
|
|
104
|
+
const parts = [x.prog ? 'In progress' : '', x.days ? TV.dateBtn(x, o) + (x.lateText ? `<span class="iv-late">, ${esc(x.lateText)}</span>` : '') + TV.slipHtml(x) : '', LK.metaHtml(x, o.lk, o.quick), x.owner && x.owner !== 'You' ? esc(x.owner) : ''];
|
|
83
105
|
meta = `<span class="iv-rm">${parts.filter(Boolean).join('<span class="iv-sep" aria-hidden="true"> · </span>')}${x.days ? '' : TV.dateBtn(x, o)}</span>`;
|
|
106
|
+
} else if (TV.msNoDate(x)) {
|
|
107
|
+
meta = `<span class="iv-rm">${x.sub ? `<span>${esc(x.sub)}</span> ` : ''}<span class="iv-dc ms">Set the due date</span></span>`;
|
|
84
108
|
}
|
|
85
|
-
|
|
109
|
+
// Your groups (batch 11 item 20): a task drags to another of the PM's groups
|
|
110
|
+
const drag = o.gdrag && x.uid && !x.dr ? ` draggable="true" data-ig-drag="${esc(x.uid)}"` : '';
|
|
111
|
+
return `<div class="iv-tr${x.closed ? ' done' : ''}${x.wont ? ' wo' : ''}${arch ? ' ar' : ''}"${drag}>${chk}<span class="w">${t}${meta}</span></div>`;
|
|
86
112
|
}
|
|
87
113
|
const chev = (open) => `<span class="iv-cv" aria-hidden="true">${SVG(open ? P.down : P.right, 15, 2)}</span>`;
|
|
88
114
|
function bodyHtml(v, sec, o) {
|
|
89
|
-
|
|
115
|
+
// By epic (batch 11 item 20): an epic's tickets first, or what comes next while nothing is drafted
|
|
116
|
+
let h = G.tkRowsHtml(sec) + G.tkEmptyHtml(sec) + sec.top.map((x) => taskHtml(x, o)).join('');
|
|
90
117
|
if (sec.jira) {
|
|
91
118
|
const byEp = new Map(); for (const k of sec.jira.open) { const e = k.epic || ''; if (!byEp.has(e)) byEp.set(e, []); byEp.get(e).push(k); }
|
|
92
119
|
const all = isOpen(v, sec.key + ':tk', false), shown = all ? sec.jira.open : sec.jira.open.slice(0, 3);
|
|
93
|
-
|
|
120
|
+
// the title opens the ticket; with quick changes on, its dates are a press too: the start and due kept in PMOS (batch 11 item 23)
|
|
121
|
+
h += shown.map((k) => o.quick
|
|
122
|
+
? `<div class="iv-tr iv-tkr"><span class="iv-jq" aria-hidden="true"></span><span class="w"><button type="button" class="iv-tt" data-iv-ticket="${esc(k.key)}"><em>${esc(k.key)}</em> ${esc(k.title)}</button><span class="iv-rm"><span class="${k.warn ? 'w' : ''}">${esc(k.sub)}</span>${k.days ? '<span class="iv-sep" aria-hidden="true"> · </span>' : ''}${TV.dateBtn(TV.jiraRow(k), o)}</span></span></div>`
|
|
123
|
+
: `<button type="button" class="iv-tr iv-tk" data-iv-ticket="${esc(k.key)}"><span class="iv-jq" aria-hidden="true"></span><span class="w"><b class="iv-tt"><em>${esc(k.key)}</em> ${esc(k.title)}</b><span class="${k.warn ? 'w' : ''}">${esc(k.sub)}</span></span></button>`).join('');
|
|
94
124
|
if (sec.jira.open.length > shown.length) h += `<button type="button" class="iv-more" data-iv-fold="${esc(sec.key + ':tk')}" aria-expanded="false">${esc((sec.jira.open.length - shown.length) + ' more open' + (byEp.size > 1 ? ' · by epic' : ''))}${SVG(P.right, 14, 2)}</button>`;
|
|
95
125
|
h += `<p class="iv-q">${esc(sec.jira.done + ' of ' + sec.jira.total + ' done in Jira' + (sec.jira.at ? ' · ' + sec.jira.at : ''))}</p>`;
|
|
96
126
|
}
|
|
@@ -123,27 +153,38 @@ function markOf(sec) {
|
|
|
123
153
|
if (sec.kind === 'later' || sec.kind === 'none') return '<span class="iv-no dash" aria-hidden="true"></span>';
|
|
124
154
|
if (sec.status === 'skip') return `<span class="iv-no skip" aria-hidden="true">${SVG(P.skip, 12, 2)}</span>`;
|
|
125
155
|
if (sec.status === 'done') return `<span class="iv-no ok" aria-hidden="true">${SVG(P.check, 12, 3)}</span>`;
|
|
156
|
+
if (sec.kind === 'group' || sec.kind === 'epic') return ''; // a group of another grouping has no stage number (batch 11 item 20)
|
|
126
157
|
if (sec.ms) return '<span class="iv-no ms" aria-hidden="true"></span>';
|
|
127
158
|
return `<span class="iv-no${sec.status === 'now' ? ' now' : ''}" aria-hidden="true">${esc(sec.n)}</span>`;
|
|
128
159
|
}
|
|
129
160
|
function sectionHtml(v, sec, o, inner) {
|
|
130
161
|
const key = 'sec:' + (sec.key || 'none'), op = isOpen(v, key, sec.open);
|
|
131
|
-
const has = sec.top.length || sec.groups.length || sec.done.length || (sec.archived || []).length || sec.jira || (sec.stages && sec.stages.length);
|
|
162
|
+
const has = sec.top.length || sec.groups.length || sec.done.length || (sec.archived || []).length || sec.jira || (sec.stages && sec.stages.length) || (sec.tk && sec.tk.length) || sec.tkEmpty;
|
|
132
163
|
const name = sec.label || sec.name;
|
|
133
|
-
const row = `<button type="button" class="iv-ws${sec.kind
|
|
134
|
-
+ `<span class="w"><b>${esc(name)}</b>${sec.sub ? `<small class="${sec.subWarn ? 'w' : ''}">${esc(sec.sub)}</small>` : ''}</span>${sec.count ? `<span class="n${sec.warn ? ' w' : ''}">${esc(sec.count)}</span>` : ''}${has ? chev(op) : ''}</button>`;
|
|
135
|
-
|
|
164
|
+
const row = `<button type="button" class="iv-ws${sec.kind === 'past' || sec.kind === 'later' ? ' mut' : ''}${inner ? ' in' : ''}" ${has ? `data-iv-fold="${esc(key)}" aria-expanded="${op}"` : 'disabled'}>${markOf(sec)}`
|
|
165
|
+
+ `<span class="w"><b>${esc(name)}</b>${sec.sub ? `<small class="${sec.subWarn ? 'w' : ''}">${esc(sec.sub)}</small>` : ''}</span>${sec.epicKey ? `<span class="ig-key">${esc(sec.epicKey)}</span>` : ''}${sec.count ? `<span class="n${sec.warn ? ' w' : ''}">${esc(sec.count)}</span>` : ''}${has ? chev(op) : ''}</button>`;
|
|
166
|
+
// a group's own presses sit beside its fold: ⋯ on the PM's own group, the send icon on an epic (batch 11 item 20)
|
|
167
|
+
const tools = G.toolsHtml(sec), head = tools ? `<div class="iv-wsw">${row}${tools}</div>` : row;
|
|
168
|
+
// the PM's own groups and Not in a group take a dragged task
|
|
169
|
+
const drop = (h) => (sec.mine != null && o.gdrag ? `<div class="ig-dz" data-ig-drop="${esc(sec.mine || '')}">${h}</div>` : h);
|
|
170
|
+
if (!op || !has) return drop(head);
|
|
136
171
|
// the folded lines (past stages, Later) open into their own stages, each a section of its own
|
|
137
172
|
const body = sec.stages ? sec.stages.map((s) => sectionHtml(v, s, o, true)).join('') : bodyHtml(v, sec, o);
|
|
138
|
-
return
|
|
173
|
+
return drop(head + `<div class="iv-wl">${body}</div>`);
|
|
139
174
|
}
|
|
140
|
-
function tasksHtml(
|
|
141
|
-
|
|
175
|
+
function tasksHtml(v0, o) {
|
|
176
|
+
// the grouping the PM picked (batch 11 item 20): every view draws its groups as it draws the stages
|
|
177
|
+
const v = G.view(v0), T = v.tasks;
|
|
142
178
|
const add = o.add ? `<button type="button" class="iv-ib" data-iv-add aria-label="Add a task to ${esc(v.title)}" title="Add a task">${SVG(P.plus, 16, 2.2)}</button>` : '';
|
|
143
179
|
// the view switch shows once there is a task to see another way (zero is silence)
|
|
144
180
|
const mode = T.empty ? 'list' : TV.viewMode();
|
|
145
|
-
|
|
146
|
-
|
|
181
|
+
// planned versus actual (batch 11 item 8): the version chip and the end slip after the count; Make live (seal) while a draft is shown
|
|
182
|
+
const cnt = VS.countText(v.vs, T.count, T.open + T.done);
|
|
183
|
+
// links (batch 11 item 15): the blue ✦ (proposals), the grey ✦ (quiet moves), the late count, between the count and the version chip
|
|
184
|
+
const lk = T.empty ? null : LK.of(v);
|
|
185
|
+
o = { ...o, lk };
|
|
186
|
+
const head = `<div class="iv-th"><b>Tasks</b>${cnt ? `<span class="n">${esc(cnt)}</span>` : ''}${LK.headHtml(lk)}${VS.headHtml(v.vs)}<span class="iv-sp"></span>${T.empty ? '' : TV.headExtraHtml(v, mode) + G.headHtml(v) + TV.switchHtml(mode)}${VS.liveHtml(v.vs)}${add}</div>`
|
|
187
|
+
+ (o.adding ? `<form class="iv-addf" data-iv-addform><input id="ivAddTask" type="text" maxlength="160" autocomplete="off" placeholder="A task for ${esc(v.title)}${o.addHint ? esc(', ' + o.addHint) : ''}" aria-label="New task"><button type="submit" class="iv-go" aria-label="Add the task" title="Add (Enter). Esc cancels.">${SVG(P.check, 16, 2.2)}</button></form>` : '');
|
|
147
188
|
if (T.empty) {
|
|
148
189
|
const sk = T.empty.stages.map((s) => `<span class="iv-sk"><span class="iv-no dash${s.ms ? ' ms' : ''}" aria-hidden="true">${s.ms ? '' : s.n}</span>${esc(s.name)}${s.now ? ' <i>· now</i>' : ''}</span>`).join('');
|
|
149
190
|
return head + `<div class="iv-empty">${sk}<p class="iv-q">Claude drafts the breakdown, one section per stage. Nothing is saved until you keep it.</p>`
|
|
@@ -151,9 +192,11 @@ function tasksHtml(v, o) {
|
|
|
151
192
|
}
|
|
152
193
|
SHOWN.set(v.id || v.key || '', v);
|
|
153
194
|
const fold = (k, d) => isOpen(v, k, d), q = { ...o, mark: markOf };
|
|
154
|
-
|
|
155
|
-
if (mode === '
|
|
156
|
-
return
|
|
195
|
+
const top = head + G.sumHtml(v);
|
|
196
|
+
if (mode === 'timeline') return top + `<div class="iv-tk">${TV.timelineHtml(v, q, fold)}</div>`;
|
|
197
|
+
if (mode === 'kanban') return top + `<div class="iv-tk">${TV.kanbanHtml(v, q, fold)}</div>`;
|
|
198
|
+
const ol = T.by === 'mine' ? { ...o, gdrag: !!o.quick } : o;
|
|
199
|
+
return top + `<div class="iv-wbs">${T.sections.map((s) => sectionHtml(v, s, ol)).join('')}</div>`;
|
|
157
200
|
}
|
|
158
201
|
function foldsHtml(v, o) {
|
|
159
202
|
const rows = [];
|
|
@@ -170,27 +213,44 @@ function foldsHtml(v, o) {
|
|
|
170
213
|
return rows.length ? `<div class="iv-folds">${rows.join('')}</div>` : '';
|
|
171
214
|
}
|
|
172
215
|
export function viewHtml(v, o = {}) {
|
|
173
|
-
|
|
216
|
+
// a merged initiative leads with where its work went, and draws no stage or tasks (they moved; its folds stay); an open one shows Claude's split or merge card under the summary (batch 11 item 14)
|
|
217
|
+
const top = v.merged ? smMerged(v.merged) : summaryHtml(v.summary, o) + (o.sm !== false ? smCard(v.suggest, v.title) : '');
|
|
218
|
+
return `<div class="iv" data-iv="${esc(v.id || v.key || '')}">${top}${v.merged ? '' : stageHtml(v.stage, o, v.id || v.key || '') + tasksHtml(v, o)}${foldsHtml(v, o)}${o.tail || ''}</div>`;
|
|
174
219
|
}
|
|
175
220
|
|
|
176
221
|
/* ── the presses ── */
|
|
177
222
|
export function wireView(body, h) {
|
|
178
223
|
if (!body) return;
|
|
179
|
-
body.
|
|
224
|
+
const idOf = () => { const n = body.querySelector('[data-iv]'); return n ? n.dataset.iv : null; };
|
|
225
|
+
body.__iv = LK.wrap(VS.wrap(h, body, (id) => SHOWN.get(id)), idOf);
|
|
226
|
+
G.attach(body, body.__iv); // the layout and the drafted tickets of the initiative shown (batch 11 item 20)
|
|
180
227
|
if (body.__ivWired) return;
|
|
181
228
|
body.__ivWired = true;
|
|
229
|
+
// the stage line's labels are checked as drawn (pm/stage-line.js fitLine): after each draw and when the panel changes width
|
|
230
|
+
if (typeof MutationObserver === 'function') {
|
|
231
|
+
let q = 0; const fit = () => { if (q) return; q = requestAnimationFrame(() => { q = 0; fitLine(body); }); };
|
|
232
|
+
new MutationObserver(fit).observe(body, { childList: true, subtree: true });
|
|
233
|
+
if (typeof ResizeObserver === 'function') new ResizeObserver(fit).observe(body);
|
|
234
|
+
fit();
|
|
235
|
+
}
|
|
182
236
|
body.addEventListener('click', (e) => {
|
|
183
237
|
const H = body.__iv || {}, b = e.target.closest('button, a'); if (!b || !body.contains(b)) return;
|
|
184
238
|
const root = b.closest('[data-iv]'); if (!root) return;
|
|
185
239
|
const id = root.dataset.iv;
|
|
186
240
|
const d = b.dataset;
|
|
241
|
+
if (VS.press(b, d, root, H)) return;
|
|
242
|
+
if (G.press(b, d, root, H)) return;
|
|
243
|
+
if (LK.press(b, d, root, { ...H, __dates: (x) => TV.press(x, { ivtBar: x.dataset.ivtBar }, root, H, e) })) return;
|
|
187
244
|
if (TV.press(b, d, root, { ...H, __v: SHOWN.get(id) }, e)) return;
|
|
188
245
|
if (d.ivFold) { e.preventDefault(); const k = id + '|' + d.ivFold; FOLD.set(k, b.getAttribute('aria-expanded') !== 'true'); if (H.redraw) H.redraw(); return; }
|
|
189
246
|
if (d.ivCheck && H.check) { e.preventDefault(); H.check(d.ivCheck, b); return; }
|
|
190
247
|
if (d.ivTask && H.openTask) { e.preventDefault(); H.openTask(d.ivTask, b); return; }
|
|
191
248
|
if (d.ivTicket && H.openTicket) { e.preventDefault(); H.openTicket(d.ivTicket, b); return; }
|
|
192
249
|
if ('ivAdd' in d && H.add) { e.preventDefault(); H.add(b); return; }
|
|
250
|
+
if (lineMove(b, d, id, H, e)) return;
|
|
193
251
|
if ('ivNext' in d && H.next) { e.preventDefault(); H.next(b); return; }
|
|
252
|
+
if (d.sm && H.sm) { e.preventDefault(); H.sm(d.sm, b); return; }
|
|
253
|
+
if (d.smOpen && H.openIni) { e.preventDefault(); H.openIni(d.smOpen, b); return; }
|
|
194
254
|
if (d.ivPrimary && H.primary) { e.preventDefault(); H.primary(d.ivPrimary, b); return; }
|
|
195
255
|
if ('ivWf' in d && H.wf) { e.preventDefault(); H.wf(b); return; }
|
|
196
256
|
if (d.ivProgram && H.program) { e.preventDefault(); H.program(d.ivProgram, b); return; }
|
|
@@ -204,8 +264,63 @@ export function wireView(body, h) {
|
|
|
204
264
|
e.preventDefault(); const H = body.__iv || {}, inp = f.querySelector('input'), t = inp ? inp.value.trim() : '';
|
|
205
265
|
if (t && H.addTask) H.addTask(t, inp);
|
|
206
266
|
});
|
|
207
|
-
|
|
267
|
+
G.wireDrag(body);
|
|
268
|
+
TV.wireDrag(body, () => { LK.draw(body, true); const n = body.querySelector('[data-iv]'); if (n) LK.sweep(n.dataset.iv, body.__iv || {}); });
|
|
208
269
|
body.addEventListener('keydown', (e) => { if (e.key === 'Escape' && e.target.id === 'ivAddTask') { e.stopPropagation(); const H = body.__iv || {}; if (H.addCancel) H.addCancel(); } });
|
|
209
270
|
}
|
|
271
|
+
/* ── the stage card's presses (batch 11 item 21) ──
|
|
272
|
+
* A part of the line or "N of M done" shows that stage in Tasks: its section opens and scrolls into view (the Kanban turns to that stage).
|
|
273
|
+
* A ◇ shows its task there. On a phone a tap on the line lists the stages and milestones under it instead (ScxA2Phone). A counted ◇, a
|
|
274
|
+
* gap and the phone's list unfold under the line; a second press folds them. */
|
|
275
|
+
const phone = () => typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches;
|
|
276
|
+
function lineMove(b, d, id, H, e) {
|
|
277
|
+
const fold = (k) => { LINE.set(id, LINE.get(id) === k ? '' : k); if (H.redraw) H.redraw(); };
|
|
278
|
+
const inLine = !!b.closest('[data-iv-line]');
|
|
279
|
+
if (d.ivStage != null) { e.preventDefault(); if (inLine && phone()) fold('list'); else showIn(b, id, H, d.ivStage, null); return true; }
|
|
280
|
+
if (d.ivMs) { e.preventDefault(); if (inLine && phone()) { fold('list'); return true; } const v = SHOWN.get(id), f = v && findRow(v, d.ivMs); showIn(b, id, H, f ? f.sec : null, d.ivMs); return true; }
|
|
281
|
+
if (d.ivMsc != null) { e.preventDefault(); fold(phone() ? 'list' : 'ms:' + d.ivMsc); return true; }
|
|
282
|
+
if (d.ivGap != null) { e.preventDefault(); fold(phone() ? 'list' : 'gap:' + d.ivGap); return true; }
|
|
283
|
+
if ('ivTlall' in d) { e.preventDefault(); LINE.set(id, LINE.get(id) === 'list+' ? 'list' : 'list+'); if (H.redraw) H.redraw(); return true; }
|
|
284
|
+
if (d.ivGapadd && H.add) { e.preventDefault(); const [start, due] = d.ivGapadd.split(' '); LINE.set(id, ''); H.add(b, { start, due }); return true; }
|
|
285
|
+
if ('ivTlcal' in d) { e.preventDefault(); TV.setViewMode('timeline'); if (H.redraw) H.redraw(); later(b, (root) => root.querySelector('.iv-th')); return true; }
|
|
286
|
+
if (d.ivHold != null && H.hold) { e.preventDefault(); H.hold(+d.ivHold, b); return true; }
|
|
287
|
+
if (d.ivIni && H.openIni) { e.preventDefault(); H.openIni(d.ivIni, b); return true; }
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
/** A task row of the view by its id: { x, sec, fold } — fold: the fold inside its section that holds it (a WBS group or Done), or ''. */
|
|
291
|
+
function findRow(v, uid) {
|
|
292
|
+
for (const s of (v.tasks && v.tasks.sections) || []) {
|
|
293
|
+
const inner = s.stages ? s.stages : [s];
|
|
294
|
+
for (const c of inner) {
|
|
295
|
+
if ((c.top || []).some((x) => x.uid === uid)) return { x: c.top.find((x) => x.uid === uid), sec: c.key, fold: '' };
|
|
296
|
+
for (const g of c.groups || []) if (g.rows.some((x) => x.uid === uid)) return { x: g.rows.find((x) => x.uid === uid), sec: c.key, fold: c.key + ':g:' + g.key };
|
|
297
|
+
if ((c.done || []).some((x) => x.uid === uid)) return { x: c.done.find((x) => x.uid === uid), sec: c.key, fold: c.key + ':done' };
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
/** After the redraw: find the target in the view and bring it into sight, with a short highlight. */
|
|
303
|
+
function later(b, pick) {
|
|
304
|
+
const body = b.closest('[data-iv]') && b.closest('[data-iv]').parentElement;
|
|
305
|
+
const go = () => {
|
|
306
|
+
const root = body && body.querySelector('[data-iv]'); if (!root) return;
|
|
307
|
+
const el = pick(root); if (!el) return;
|
|
308
|
+
el.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
309
|
+
el.classList.add('iv-hit'); setTimeout(() => el.classList.remove('iv-hit'), 1600);
|
|
310
|
+
};
|
|
311
|
+
if (typeof requestAnimationFrame === 'function') requestAnimationFrame(go); else go();
|
|
312
|
+
}
|
|
313
|
+
/** Show a stage (and one task of it) in Tasks: its section opens in the List and the Timeline, the Kanban turns to it. */
|
|
314
|
+
function showIn(b, id, H, key, uid) {
|
|
315
|
+
if (key != null) { FOLD.set(id + '|sec:' + (key || 'none'), true); TV.setKanbanStage(id, key); }
|
|
316
|
+
if (uid) { const v = SHOWN.get(id), f = v && findRow(v, uid); if (f && f.fold) FOLD.set(id + '|' + f.fold, true); }
|
|
317
|
+
if (H.redraw) H.redraw();
|
|
318
|
+
const q = (v) => String(v).replace(/["\\]/g, '\\$&');
|
|
319
|
+
later(b, (root) => {
|
|
320
|
+
if (uid) { const t = root.querySelector(`.iv-tk [data-iv-task="${q(uid)}"], .iv-wbs [data-iv-task="${q(uid)}"], .iv-wbs [data-iv-check="${q(uid)}"], .iv-tk [data-ivt-bar="${q(uid)}"], .iv-tk [data-iv-check="${q(uid)}"]`); if (t) return t.closest('.iv-tr') || t; }
|
|
321
|
+
return root.querySelector(`[data-iv-fold="sec:${q(key || 'none')}"]`) || root.querySelector('.iv-th');
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
|
|
210
325
|
/** For the tests: forget every fold the PM opened or shut. */
|
|
211
|
-
export const resetFolds = () => { FOLD.clear(); TV.resetViews(); };
|
|
326
|
+
export const resetFolds = () => { LINE.clear(); FOLD.clear(); TV.resetViews(); VS.resetVersions(); LK.resetLinks(); G.resetGroups(); };
|