create-pmos 0.414.0 → 0.416.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 +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/bin/pmos.js +1 -1
- package/workspace/briefing-premium-adddoc-test.js +3 -3
- package/workspace/briefing-premium-board-test.js +72 -43
- package/workspace/briefing-premium-doc-edit-test.js +2 -2
- package/workspace/briefing-premium-initiative-test.js +19 -22
- package/workspace/briefing-premium-insights-test.js +28 -17
- package/workspace/changelog.json +24 -0
- package/workspace/core-docs-workflow-test.js +1 -1
- package/workspace/guide/workflows.md +6 -2
- package/workspace/ini-workflow-test.js +11 -11
- package/workspace/lib/board-premium.js +13 -0
- package/workspace/lib/board-trail.js +6 -1
- package/workspace/lib/engine/boards.js +12 -4
- package/workspace/lib/goal-chat.js +46 -15
- package/workspace/lib/initiative-chat.js +7 -5
- package/workspace/lib/initiative-premium.js +4 -2
- package/workspace/lib/insights-premium.js +9 -1
- package/workspace/lib/item-cli.js +2 -1
- package/workspace/lib/pmos-verbs.js +1 -1
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +149 -18
- package/workspace/lib/routes-briefing-premium.js +14 -1
- package/workspace/lib/routes-live.js +53 -0
- package/workspace/lib/task-cli.js +137 -25
- package/workspace/lib/task-items.js +88 -0
- package/workspace/lib/workflow-cli.js +1 -1
- package/workspace/milestone-suggest-test.js +2 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +3 -3
- package/workspace/premium-chat-report-tab-test.js +13 -5
- package/workspace/premium-core-doc-issue-test.js +1 -1
- package/workspace/premium-report-read-test.js +66 -51
- package/workspace/premium-vw-backlog-test.js +3 -3
- package/workspace/premium-vw-doc-test.js +3 -3
- package/workspace/premium-vw-item-test.js +4 -4
- package/workspace/premium-vw-jira-test.js +14 -13
- package/workspace/premium-vw-slides-test.js +7 -5
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-ini-panel.js +68 -210
- package/workspace/public/pm/cozy-insights.css +15 -0
- package/workspace/public/pm/cozy-live-pill.css +48 -0
- package/workspace/public/pm/cozy-live-pill.js +141 -0
- package/workspace/public/pm/cozy-viewer.js +4 -3
- package/workspace/public/pm/cozy-vw-rp.css +48 -0
- package/workspace/public/pm/home-app.js +45 -8
- package/workspace/public/pm/home-chat.js +5 -2
- package/workspace/public/pm/home-ini.js +57 -22
- package/workspace/public/pm/home-stage-card.js +3 -2
- package/workspace/public/pm/home-task.js +16 -5
- package/workspace/public/pm/ini-view-model.js +277 -0
- package/workspace/public/pm/ini-view.css +122 -0
- package/workspace/public/pm/ini-view.js +180 -0
- package/workspace/public/pm/live-model.js +104 -0
- package/workspace/public/pm/ov-view.css +44 -0
- package/workspace/public/pm/premium-board.js +23 -15
- package/workspace/public/pm/premium-initiative-head.js +12 -2
- package/workspace/public/pm/premium-insights.js +61 -35
- package/workspace/public/pm/premium-report-read.js +74 -50
- package/workspace/public/pm/premium-report-tab.js +36 -15
- package/workspace/public/pm/premium-shell.js +1 -1
- package/workspace/public/pm/premium-vw-item-model.js +6 -3
- package/workspace/public/pm/premium-vw-item.js +25 -6
- package/workspace/public/pm/premium-vw-jira.js +17 -15
- package/workspace/public/pm/rp-parts.js +75 -12
- package/workspace/public/pm/task-card.css +24 -49
- package/workspace/public/pm/task-card.js +90 -64
- package/workspace/public/pm/tk-view.css +21 -0
- package/workspace/public/pm/tk-view.js +216 -0
- package/workspace/public/pm/wf-page.js +2 -0
- package/workspace/server.js +24 -1
- package/workspace/stage-card-test.js +49 -41
- package/workspace/task-card-test.js +83 -38
- package/workspace/test-files.json +3 -1
- package/workspace/test-lists/bd-ini-panel.json +3 -3
- package/workspace/test-lists/one-task-list.json +5 -0
- package/workspace/tk-tasks-test.js +3 -3
- package/workspace/public/pm/bd-ini-model.js +0 -81
- package/workspace/public/pm/cozy-rec-pill.css +0 -12
- package/workspace/public/pm/cozy-rec-pill.js +0 -46
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
* icon a key of ICONS below or an SVG path "M…"
|
|
20
20
|
* url the item's own address: "Open in a new tab" goes under ⋯ (full: true names it "Open in full")
|
|
21
21
|
* more [{ label, on(moreButton), note?, danger?, icon?, disabled? } | { sep: true }], or a function that returns it: the ⋯ menu; on() gets the ⋯ button as an anchor, in the xvMore order (change it, look back, stop or remove last)
|
|
22
|
-
* discuss true, { href }, or fn(): the quiet "Discuss in chat" icon before ⋯.
|
|
22
|
+
* discuss true, { href }, or fn(): the quiet "Discuss in chat" icon before ⋯. Not drawn on Home, where the chat is already beside it,
|
|
23
|
+
* unless discussHome: an initiative's page (the one view) starts a new session about it there.
|
|
23
24
|
* rename { save(title, { jira }) → Promise<{ ok, title?, error? }>, max?, value?, jira?: { label, key } }: the title is the rename press
|
|
24
25
|
* (value: the name the field starts from when the title shows more, as a program's "title · goal")
|
|
25
26
|
* (canvas RnATask, RnAIni, RnAProg, RnAPhone). A tap turns it into one field with a check: Enter or the check saves, Esc
|
|
@@ -116,7 +117,7 @@ export function headHtml(it) {
|
|
|
116
117
|
const o = it || {};
|
|
117
118
|
const phone = !!o.phone;
|
|
118
119
|
const kind = o.kind && !sameAs(o.kind, o.title) ? `<p class="cz-vw-kind">${esc(o.kind)}</p>` : '';
|
|
119
|
-
const disc = o.discuss && !o.home ? ib('discuss', 'Discuss in chat', P.chat) : '';
|
|
120
|
+
const disc = o.discuss && (!o.home || o.discussHome) ? ib('discuss', 'Discuss in chat', P.chat) : '';
|
|
120
121
|
const more = typeof o.more === 'function' || (Array.isArray(o.more) && o.more.some((m) => m && !m.sep)) || o.url ? ib('more', 'More', P.more, ' aria-haspopup="menu" aria-expanded="false"') : '';
|
|
121
122
|
const add = o.add && o.add.label && !phone ? ib('add', o.add.label, P.add) : '';
|
|
122
123
|
const own = (o.presses || []).filter((x) => x && x.act && x.label).map((x) => x.solid
|
|
@@ -452,7 +453,7 @@ export function open(it) {
|
|
|
452
453
|
V.drill = false;
|
|
453
454
|
const sameKind = V.cur && kindKey(V.cur.kind) === kindKey(o.kind);
|
|
454
455
|
leave();
|
|
455
|
-
V.cur = { id: o.id == null ? null : String(o.id), kind: o.kind || '', title: o.title || '', icon: o.icon, url: o.url || '', full: !!o.full, onClose: o.onClose, more: o.more, discuss: o.discuss, add: o.add || null, sub: o.sub || '', check: o.check || null, presses: o.presses || null, onPress: o.onPress, guard: o.guard, rename: o.rename && typeof o.rename.save === 'function' ? o.rename : null, args: o };
|
|
456
|
+
V.cur = { id: o.id == null ? null : String(o.id), kind: o.kind || '', title: o.title || '', icon: o.icon, url: o.url || '', full: !!o.full, onClose: o.onClose, more: o.more, discuss: o.discuss, discussHome: !!o.discussHome, add: o.add || null, sub: o.sub || '', check: o.check || null, presses: o.presses || null, onPress: o.onPress, guard: o.guard, rename: o.rename && typeof o.rename.save === 'function' ? o.rename : null, args: o };
|
|
456
457
|
el.setAttribute('aria-label', 'Viewer: ' + (o.kind || o.title || 'item'));
|
|
457
458
|
redraw();
|
|
458
459
|
const m = el.querySelector('.cz-vw-menu'); if (m) m.remove();
|
|
@@ -165,3 +165,51 @@
|
|
|
165
165
|
.rp-sec { height: 40px; padding: 0 14px !important; border-radius: 999px; background: var(--cz-card) !important; font-size: 13.5px; font-weight: 700; color: var(--cz-ink2); }
|
|
166
166
|
.rp-back { display: flex; align-items: center; gap: 4px; margin-left: -8px; }
|
|
167
167
|
.rp-back b { font-size: 15px; font-weight: 800; }
|
|
168
|
+
|
|
169
|
+
/* ── the one report Viewer (canvas OvReport): the summary with its icon primary and meta chips, the bar, the deck, the folds.
|
|
170
|
+
* A cycle (premium-report-read.js) and a new report from the chat (premium-report-tab.js) draw the same parts (rp-parts.js rpSumHtml, rpBarHtml). ── */
|
|
171
|
+
.rp-sum .czs-line { min-height: 32px; }
|
|
172
|
+
.rp-sum .rp-ln { min-width: 0; }
|
|
173
|
+
.rp-sum .czs-r { font-weight: 500; font-size: 12.5px; }
|
|
174
|
+
.rp-pri { flex: none; width: 32px; height: 32px; margin: -2px -4px -2px 4px; border: 0; border-radius: 999px; display: grid; place-items: center; cursor: pointer; background: var(--cz-blue); color: var(--cz-onsolid); }
|
|
175
|
+
.rp-sum .czs-line:not(:has(.czs-r)) .rp-pri { margin-left: auto; }
|
|
176
|
+
.rp-pri:hover { filter: brightness(1.08); }
|
|
177
|
+
.rp-pri:disabled { opacity: .5; cursor: default; }
|
|
178
|
+
.rp-pri:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
179
|
+
.rp-sum .czs-p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--cz-ink); }
|
|
180
|
+
.rp-mcs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
|
|
181
|
+
.rp-mc { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px var(--cz-sans); color: var(--cz-ink2); background: none; border: 0; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; }
|
|
182
|
+
.rp-mc svg { color: var(--cz-ink3); }
|
|
183
|
+
button.rp-mc { cursor: pointer; }
|
|
184
|
+
button.rp-mc:hover, button.rp-mc[aria-expanded="true"] { background: var(--cz-well); color: var(--cz-ink); }
|
|
185
|
+
.rp-bar { display: flex; align-items: center; gap: 4px; }
|
|
186
|
+
.rp-seg { flex: 1; min-width: 0; display: flex; padding: 3px; border-radius: 999px; background: var(--cz-well); }
|
|
187
|
+
.rp-seg button { flex: 1; min-width: 0; height: 30px; text-align: center; border: 0; border-radius: 999px; background: none; font: 600 12.5px var(--cz-sans); color: var(--cz-ink2); cursor: pointer; white-space: nowrap; padding: 0 8px; }
|
|
188
|
+
.rp-seg button[aria-pressed="true"] { background: var(--cz-card); color: var(--cz-ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
|
|
189
|
+
.rp-tls { display: flex; flex: none; }
|
|
190
|
+
.rp-tl.rp-tl { width: 36px; height: 36px; border: 0; padding: 0; border-top: 0; border-radius: 10px; display: grid; place-items: center; background: none; color: var(--cz-ink2); cursor: pointer; }
|
|
191
|
+
.rp-tl:hover, .rp-tl[aria-expanded="true"] { background: var(--cz-well); color: var(--cz-ink); }
|
|
192
|
+
.rp-nav { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: -4px; }
|
|
193
|
+
.rp-nav > .vz-ib { width: 28px; height: 28px; border-radius: 999px; }
|
|
194
|
+
.rp-a .rp-nav .rp-count { font-size: 12.5px; color: var(--cz-ink2); min-width: 84px; }
|
|
195
|
+
.rp-a .rp-thumbs.rp-thumbs { overflow: visible; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: -4px; }
|
|
196
|
+
.rp-a .rp-th.rp-th { border-radius: 8px; }
|
|
197
|
+
.rp-a .czs-secs { margin: 0; }
|
|
198
|
+
.rp-cys { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
|
|
199
|
+
.rp-cy { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin: 0 -10px; border: 0; background: none; border-radius: 10px; text-align: left; font: inherit; color: var(--cz-ink); }
|
|
200
|
+
button.rp-cy { cursor: pointer; }
|
|
201
|
+
button.rp-cy:hover { background: var(--cz-well); }
|
|
202
|
+
.rp-cy > span { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
|
|
203
|
+
.rp-cy b { font-size: 13.5px; font-weight: 700; }
|
|
204
|
+
.rp-cy small { font-size: 12.5px; color: var(--cz-ink3); }
|
|
205
|
+
.rp-cy svg { color: var(--cz-ink3); }
|
|
206
|
+
.rp-ol { margin: 0 0 4px; padding-left: 20px; font-size: 13.5px; line-height: 1.6; }
|
|
207
|
+
@media (max-width: 760px) {
|
|
208
|
+
.rp-a .rp-thumbs.rp-thumbs, .vz-dk .vz-dkt { display: none; }
|
|
209
|
+
.rp-seg button { padding: 0 4px; }
|
|
210
|
+
.rp-tl.rp-tl { width: 34px; }
|
|
211
|
+
.rp-nav > .vz-ib { width: 44px; height: 44px; }
|
|
212
|
+
}
|
|
213
|
+
.vz-dk .czs-secs { margin: 0; }
|
|
214
|
+
.vz-dkp { border-radius: 16px; background: var(--cz-card); box-shadow: inset 0 0 0 1px var(--cz-hair); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
|
|
215
|
+
.vz-dkp h2 { margin: 0; font-size: 20px; font-weight: 800; }
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* The models are in home-data.js and home-list.js (pure). This file reads the routes, draws, and wires the presses. Every write is the PM's
|
|
16
16
|
* press (pmPost). Nothing here opens the old dialog or links to the console. */
|
|
17
17
|
import { mountNav } from './cozy-nav.js';
|
|
18
|
+
import { mountLivePill } from './cozy-live-pill.js';
|
|
18
19
|
import * as VW from './cozy-viewer.js';
|
|
19
20
|
import { pmGet, pmPost, pmHeaders } from './http.js';
|
|
20
21
|
import * as H from './home-data.js';
|
|
@@ -24,6 +25,8 @@ import { headModel, STEPS } from './premium-initiative-head.js';
|
|
|
24
25
|
import * as SC from './home-stage-card.js'; // the initiative's stage card D
|
|
25
26
|
import * as WFM from './ini-wf-model.js'; // D99: the workflow an initiative runs (kind line, usual days)
|
|
26
27
|
import { wfIcon, wfOf } from './wf-model.js';
|
|
28
|
+
import { iniView } from './ini-view-model.js'; // the one initiative view (batch 6 item 1): the same model the Board's panel draws
|
|
29
|
+
import { programOf } from './program-model.js';
|
|
27
30
|
import { startAgent } from './page-agent.js';
|
|
28
31
|
import { mdHtml } from './chat-md.js';
|
|
29
32
|
import { mountPhoneCard } from './home-phone-card.js';
|
|
@@ -288,6 +291,23 @@ function filterMenu(b) {
|
|
|
288
291
|
}
|
|
289
292
|
|
|
290
293
|
/* ── the initiative card ── */
|
|
294
|
+
/** The one view's model for an initiative (ini-view-model.js): Home's board row with its trail, the board's steps and day, its usual days,
|
|
295
|
+
* the Needs-you row that waits on the PM and its program. Null when the initiative is not on a board Home reads. */
|
|
296
|
+
function iniViewOf(id) {
|
|
297
|
+
const row = iniRowOf(id) || imRowOf(id); if (!row) return null;
|
|
298
|
+
const B = S.D.board || {}, t = S.D.trail && S.D.trail.items && S.D.trail.items[id];
|
|
299
|
+
const need = H.needsOf(S.D).find((r) => r.ini === id);
|
|
300
|
+
const p = programOf(S.D.programs || [], row.ws || (B.board || {}).ws || '', id);
|
|
301
|
+
return iniView({ ...row, trail: t || row.trail || null }, { steps: B.steps || STEPS, today: B.today, usual: WFM.usualOf(S.D.trail, row),
|
|
302
|
+
ask: need ? { title: need.name } : null, program: p ? { id: p.id, title: p.title } : null });
|
|
303
|
+
}
|
|
304
|
+
/** An initiative no board Home reads holds (its own read only, GET /api/initiative-premium): the row the one view needs, from that read. */
|
|
305
|
+
function imRowOf(id) {
|
|
306
|
+
const M = S.IM && S.IMid === id ? S.IM : null; if (!M) return null;
|
|
307
|
+
const stage = (M.head && M.head.stage) || '', k = STEPS.findIndex((x) => x.label === stage);
|
|
308
|
+
return { id, key: 'board:' + id, title: M.title || id, lane: M.lane || null, track: { k, key: k >= 0 ? STEPS[k].key : null, label: stage },
|
|
309
|
+
tasks: ((M.tasks && M.tasks.rows) || []).filter((x) => x.pmos && x.uid).map((x) => ({ uid: x.uid, title: x.title, status: x.state || 'To do', end: x.end || '', owner: x.owner || '' })) };
|
|
310
|
+
}
|
|
291
311
|
function iniRowOf(id) { return H.boardRows(S.D).find((r) => r.id === id) || (otherIni(id) || {}).row || null; }
|
|
292
312
|
/** An initiative of another product Home reads (D.others): its row, and the workspace and board it is read from. Null for the board's own. */
|
|
293
313
|
function otherIni(id) {
|
|
@@ -442,12 +462,18 @@ const SN = mountSesName({ esc, pmPost, toast, toastUndo: (m, u) => toastUndo(m,
|
|
|
442
462
|
changed: () => { drawTop(); chat.refresh(); drawList(); } });
|
|
443
463
|
|
|
444
464
|
/* ── the chat ── */
|
|
465
|
+
// a chat Home opened by itself on load (the first Needs-you row) is not the PM touching it: a touch counts after the PM's first press or
|
|
466
|
+
// key, or when the address named the session (the Live pill on another page, a link)
|
|
467
|
+
const ACTED = { on: !!(P.get('session') || P.get('open')) };
|
|
468
|
+
for (const ev of ['pointerdown', 'keydown']) addEventListener(ev, () => { ACTED.on = true; }, { capture: true, once: true });
|
|
445
469
|
const chat = mountChat($('#hmChat'), {
|
|
446
470
|
esc, toast, pmGet, pmPost, pressHeaders: () => { const h = pmHeaders(); delete h['Content-Type']; return h; },
|
|
447
471
|
roles: () => (S.D.desk && S.D.desk.roles) || [],
|
|
448
472
|
seen: (key) => (S.D.desk && S.D.desk.seen && S.D.desk.seen[key]) || null,
|
|
449
473
|
markSeen: (key) => { pmPost('/api/home-desk/seen', { key }).then((r) => { if (r && r.ok && S.D.desk) S.D.desk.seen = { ...S.D.desk.seen, [key]: r.seen }; }); },
|
|
450
474
|
session: (id) => S.D.sessions.find((s) => s.id === id) || null,
|
|
475
|
+
// the Live pill: the PM opened, typed in or answered this session now (its row moves to the top of the pill's list)
|
|
476
|
+
touch: (sid) => { if (sid && ACTED.on) pmPost('/api/session/touch', { id: sid }).then(() => document.dispatchEvent(new CustomEvent('cz:live'))).catch(() => {}); },
|
|
451
477
|
queued: (sid) => (sid && S.D.desk && S.D.desk.queued && S.D.desk.queued[sid]) || [],
|
|
452
478
|
queue: (sid, text) => pmPost('/api/home-desk/queue', { session: sid, text }).then((r) => { if (r && r.ok && S.D.desk) { const q = { ...(S.D.desk.queued || {}) }; q[sid] = (q[sid] || []).concat({ text, at: r.at }); S.D.desk.queued = q; chat.refresh(); } }),
|
|
453
479
|
unqueue: (sid, at) => { pmPost('/api/home-desk/queue-drop', { session: sid, at }); if (S.D.desk && S.D.desk.queued && S.D.desk.queued[sid]) S.D.desk.queued[sid] = S.D.desk.queued[sid].filter((x) => x.at !== at); },
|
|
@@ -703,13 +729,13 @@ function select(id, o = {}) {
|
|
|
703
729
|
drawList();
|
|
704
730
|
syncUrl();
|
|
705
731
|
}
|
|
706
|
-
/** A session opened
|
|
707
|
-
*
|
|
732
|
+
/** A session opened from the list takes the Viewer with it (Wawan, 2026-10-25, asked twice): whatever the Viewer shows (another
|
|
733
|
+
* initiative's page, a Documents or Tasks view, a task or a file drilled into, another row's item), it changes to the page of the session's
|
|
734
|
+
* own initiative, and a loose session closes it. Only the page of that same initiative stays as it is. A closed Viewer stays closed. */
|
|
708
735
|
function followViewer(s) {
|
|
709
|
-
if (isPhone()) return;
|
|
710
|
-
const c = VW.current()
|
|
711
|
-
|
|
712
|
-
if (c.id === 'ov:' + ini) return;
|
|
736
|
+
if (isPhone() || !VW.isOpen()) return;
|
|
737
|
+
const c = VW.current(), ini = H.iniOfSession(s);
|
|
738
|
+
if (ini && c && c.id === 'ov:' + ini && c.kind === kindOf(ini)) return;
|
|
713
739
|
if (!ini || !iniRowOf(ini)) { VW.close(); return; }
|
|
714
740
|
if (S.ini !== ini) { S.ini = ini; S.IM = null; S.IMid = null; S.doneOpen = false; S.stepsMore = false; }
|
|
715
741
|
iniPage();
|
|
@@ -1428,7 +1454,7 @@ function cta() {
|
|
|
1428
1454
|
/* ── start ── */
|
|
1429
1455
|
mountIni({ S, VW, pmGet, pmPost, toast, rowOf: (id) => iniRowOf(id), renameIni: (id, pre) => iniRenameOf(id, pre), renameTask: (t) => taskRenameOf(t), load: () => load(), loadIni: () => loadIni(), openFile: (f) => openFile(f), iniTitle: (id) => iniTitle(id), drawList: () => drawList(), wait: MORE.WAIT,
|
|
1430
1456
|
// the initiative's page (HbCDesk): its card, its header and its ⋯
|
|
1431
|
-
cardHtml: (id, o) => cardHtml(id, o), kindOf: (id) => kindOf(id), cta: () => cta(), overviewAsk: (id) => overviewAsk(id), newIn: (id) => newIn(id), addPerson: () => addPerson(), turnProgram: (id) => turnProgram(id), talk: () => talk(),
|
|
1457
|
+
cardHtml: (id, o) => cardHtml(id, o), kindOf: (id) => kindOf(id), cta: () => cta(), overviewAsk: (id) => overviewAsk(id), newIn: (id) => newIn(id), addPerson: () => addPerson(), turnProgram: (id) => turnProgram(id), talk: () => talk(), view: (id) => iniViewOf(id), head: (id) => (S.H = headOf(id)), goProgram: (id) => goProgram(id),
|
|
1432
1458
|
foldCard: () => { S.cardFold = !S.cardFold; store.set('pmos.home.cardfold', S.cardFold ? '1' : null); } });
|
|
1433
1459
|
/* The program panel in Home's Viewer (HbCProg): Home's board model and programs; an initiative of it opens here, with ← back to the program.
|
|
1434
1460
|
* Read on the first program press, never at start: the panel's modules load premium-shell.js, whose start reads ?session= for the old dialog. */
|
|
@@ -1438,6 +1464,17 @@ PO.mount({ programs: () => S.D.programs || [], stateOf: (p) => (((S.M && S.M.gro
|
|
|
1438
1464
|
saved: (p) => { const L2 = S.D.programs || [], i = L2.findIndex((x) => x.id === p.id); if (i >= 0) L2[i] = { ...L2[i], ...p }; drawList(); },
|
|
1439
1465
|
say: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)), openIni: (id) => goIni(id) });
|
|
1440
1466
|
mountNav('home', document, { more: () => moreMenu, settings: () => MORE.openSettings(), here: () => { if (VW.isOpen()) VW.close(); goHome(); } });
|
|
1467
|
+
// the Live pill (batch 6 item 2): on Home a row opens in place, the session's chat (with its Viewer page) or the meeting; the open one is tinted
|
|
1468
|
+
mountLivePill(document, {
|
|
1469
|
+
open: () => (S.cur && S.cur.ses) || null,
|
|
1470
|
+
go: (x) => {
|
|
1471
|
+
if (x.kind === 'rec') { const id = /[?&]meeting=([^&]+)/.exec(x.href || ''); if (!id) return false; openMeeting({ note: decodeURIComponent(id[1]) }); return true; }
|
|
1472
|
+
const s = x.sid && S.D.sessions.find((y) => y.id === x.sid); if (!s) return false;
|
|
1473
|
+
if (VW.isOpen() && isPhone()) VW.close();
|
|
1474
|
+
S.sel = 's:' + s.id; S.phoneChat = isPhone(); openTarget(sessionTarget(s)); followViewer(s); drawList(); syncUrl();
|
|
1475
|
+
return true;
|
|
1476
|
+
},
|
|
1477
|
+
});
|
|
1441
1478
|
PHC = mountPhoneCard({ pmGet, pmPost, toast, ws: () => WS || null, openMeeting: (m) => openMeeting(m) }); drawList();
|
|
1442
1479
|
drawList(); drawTop();
|
|
1443
1480
|
{ // a conversation the address names opens at once, before the lists are read, so nothing typed or attached lands in the Home chat
|
|
@@ -1473,7 +1510,7 @@ load().then(() => {
|
|
|
1473
1510
|
const r = allRows().find((x) => x.key === open || (/^pt:/.test(open) && x.id === open));
|
|
1474
1511
|
if (r) select(r.id); else if (KEY.test(open)) openTarget({ ...homeTarget(), key: open, title: open });
|
|
1475
1512
|
}
|
|
1476
|
-
else if (sid) { const s = S.D.sessions.find((x) => x.id === sid); if (s) { S.sel = 's:' + s.id; openTarget(sessionTarget(s)); drawList(); } else { openTarget(homeTarget()); toast('That session is not on this machine.'); } }
|
|
1513
|
+
else if (sid) { const s = S.D.sessions.find((x) => x.id === sid); if (s) { S.sel = 's:' + s.id; openTarget(sessionTarget(s)); followViewer(s); drawList(); } else { openTarget(homeTarget()); toast('That session is not on this machine.'); } }
|
|
1477
1514
|
else if (/^program:[A-Za-z0-9][A-Za-z0-9._-]{0,100}$/.test(ask)) openTarget(programTarget(ask.slice(8))); // Ask in Home from the program panel
|
|
1478
1515
|
else if (about && /^init:/.test(about) && iniRowOf(P.get('vid') || about.slice(5))) { const id = iniRowOf(P.get('vid')) ? P.get('vid') : about.slice(5); goIni(id).then(() => { if (P.get('vk') && S.ini === id && !isPhone()) iniOverview(); }); }
|
|
1479
1516
|
// the Board's program panel Discuss in chat names board:program:<id>: the program's own conversation, the one its tasks open (bug 2026-10-24)
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* target: { key?, sid?, title, scope: { text, icon, loose }, role: { name, initial }, intro?: { role, text, at, pills: [{ label, primary, go }] },
|
|
19
19
|
* ini?, rich, also?: { text, go } }
|
|
20
20
|
* host: { esc, toast, pmGet, pmPost, roles(), seen(key), markSeen(key), onScope(btn), onLink(btn), onTo(btn), workItem(text, target),
|
|
21
|
-
* viewerClosed(), reopenViewer(), head(target) } */
|
|
21
|
+
* viewerClosed(), reopenViewer(), head(target), touch(sid) (the PM opened, typed in or answered that session: the Live pill) } */
|
|
22
22
|
import { mdHtml, userHtml, toolLine, webKind } from './chat-md.js';
|
|
23
23
|
import { streamOf, roleOf, tintOf, hm } from './home-data.js';
|
|
24
24
|
import { splitGoal, shownUser, goalBlockHtml, goalViewHtml, goalNow, slashMatches, loadSlash } from './goal-chat.js';
|
|
@@ -84,6 +84,7 @@ export function mountChat(el, host) {
|
|
|
84
84
|
} else if (t.sid) conv = await host.pmGet('/api/sessions/conversation?id=' + encodeURIComponent(t.sid)).catch(() => null);
|
|
85
85
|
if (my !== C.seq || C.t !== t) return;
|
|
86
86
|
C.th = th && th.ok ? th : null; C.conv = conv && conv.ok ? conv : null;
|
|
87
|
+
if (host.touch && sid() && C.touched !== sid()) { C.touched = sid(); host.touch(C.touched); } // the Live pill: the PM opened it now
|
|
87
88
|
C.sess = host.session ? host.session(t.sid || (C.th && C.th.session)) : null;
|
|
88
89
|
draw();
|
|
89
90
|
clearTimeout(C.timer);
|
|
@@ -397,6 +398,7 @@ export function mountChat(el, host) {
|
|
|
397
398
|
C.sending = false;
|
|
398
399
|
if (!r || r.ok !== true) { host.toast((r && r.error) || 'The message was not sent.'); return false; }
|
|
399
400
|
const s = sid() || r.session;
|
|
401
|
+
if (host.touch) host.touch(s);
|
|
400
402
|
if (was && s && host.queue) host.queue(s, text);
|
|
401
403
|
C.files.forEach((f) => { if (f.url) URL.revokeObjectURL(f.url); }); C.files = []; C.jump = true;
|
|
402
404
|
if (t.onSent) t.onSent(r);
|
|
@@ -408,6 +410,7 @@ export function mountChat(el, host) {
|
|
|
408
410
|
const r = t.key && !t.sid ? await host.pmPost('/api/briefing-premium/press' + (t.ws ? '?ws=' + encodeURIComponent(t.ws) : ''), { key: t.key, press: k }).catch(() => null)
|
|
409
411
|
: await host.pmPost('/api/session/keys', { id: sid(), press: k }).catch(() => null);
|
|
410
412
|
if (!r || !r.ok) host.toast((r && r.error) || 'The key did not reach the session.');
|
|
413
|
+
else if (host.touch) host.touch(sid() || r.session);
|
|
411
414
|
setTimeout(read, 500);
|
|
412
415
|
}
|
|
413
416
|
async function upload(files) {
|
|
@@ -583,7 +586,7 @@ export function mountChat(el, host) {
|
|
|
583
586
|
if (notesM) notesM.then((M) => setTimeout(() => M.syncNotes(), 0)); // the Notes open in the Viewer belonged to the conversation before
|
|
584
587
|
const same = C.t && t && C.t.key === t.key && C.t.sid === t.sid;
|
|
585
588
|
C.t = t;
|
|
586
|
-
if (!same) { C.addOpen = false; C.th = null; C.conv = null; C.show = 12; C.open = new Set(); C.files = []; C.marked = null; C.picked = {}; C.plOpen = false; C.plAll = false; C.seenAt = t.key ? host.seen(t.key) : null; put(log, introHtml(t.intro)); put(pl, ''); pl.hidden = true; C.jump = true; peek(null); }
|
|
589
|
+
if (!same) { C.addOpen = false; C.th = null; C.conv = null; C.show = 12; C.open = new Set(); C.files = []; C.marked = null; C.touched = null; C.picked = {}; C.plOpen = false; C.plAll = false; C.seenAt = t.key ? host.seen(t.key) : null; put(log, introHtml(t.intro)); put(pl, ''); pl.hidden = true; C.jump = true; peek(null); }
|
|
587
590
|
draw(); read();
|
|
588
591
|
},
|
|
589
592
|
refresh() { if (C.t) draw(); },
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* mountIni(ctx) once, from home-app.js. ctx: { S, VW, pmGet, pmPost, toast, load, openFile, iniTitle, drawList, wait }
|
|
5
5
|
* iniList(sc) after each draw of the list column: reads the layout record and moves the stage by itself when it may. The list column
|
|
6
6
|
* never changes for an initiative (canvas HbC): the initiative is a page of the Viewer.
|
|
7
|
-
* iniPage() the initiative's page in the Viewer
|
|
8
|
-
*
|
|
7
|
+
* iniPage() the initiative's page in the Viewer: the ONE view the Board's panel draws too (ini-view.js; batch 6 items 1 and 3):
|
|
8
|
+
* summary, stage card with the dates line, Tasks as the WBS, Documents and Linked. The next stage opens the move sheet;
|
|
9
|
+
* Documents drills into the documents view, with ← back to the page. true when it opened.
|
|
9
10
|
* iniOverview(v, o) the initiative in the Viewer: Tasks (the default), Documents or Stage; o.back keeps the page behind it. true when it opened.
|
|
10
11
|
*
|
|
11
12
|
* The stage move (stage card D, canvas XscD and XscDDesk; it replaced InStage's switch, Move to <next> and Back on the card): the card's last
|
|
@@ -28,6 +29,7 @@ import * as MD from './home-ini-model.js';
|
|
|
28
29
|
import * as TKM from './tk-model.js';
|
|
29
30
|
import * as WF from './ini-wf.js';
|
|
30
31
|
import * as SC from './home-stage-card.js';
|
|
32
|
+
import { viewHtml, wireView } from './ini-view.js'; // the one initiative view, the Board's panel's own renderer
|
|
31
33
|
import { ensureCss as ensureStepsCss } from './cozy-steps.js'; // stage card D: the card's last node and the move sheet's words // D99: the initiative's own workflow (Change picker, switch, Won't do, Archive)
|
|
32
34
|
|
|
33
35
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
@@ -215,7 +217,7 @@ function nextSheetHtml(id, M, mv) {
|
|
|
215
217
|
}
|
|
216
218
|
function popNext(anchor, id, M) {
|
|
217
219
|
const mv = mvOf(id, M);
|
|
218
|
-
const reopen = () => { const a = document.querySelector('#czViewer [data-
|
|
220
|
+
const reopen = () => { const a = document.querySelector('#czViewer [data-iv-next]') || anchor; return a; };
|
|
219
221
|
openPop(anchor, 'next', nextSheetHtml(id, M, mv), async (b, el) => {
|
|
220
222
|
const d = b.dataset, mv2 = mvOf(id, curM() || M);
|
|
221
223
|
if ('hiAuto' in d) {
|
|
@@ -252,26 +254,57 @@ export function iniList(sc) {
|
|
|
252
254
|
if (X.view === 'page') redrawView(); // a new read of the initiative shows on its page
|
|
253
255
|
}
|
|
254
256
|
|
|
255
|
-
/* ── the initiative's page in the Viewer (canvas
|
|
257
|
+
/* ── the initiative's page in the Viewer: the ONE view (batch 6 items 1 and 3; canvas OvIniA, OvViewers) ──
|
|
258
|
+
* The Board's panel draws the same model (ini-view-model.js) with the same renderer (ini-view.js): the summary card, the stage card with
|
|
259
|
+
* the dates line, Tasks as the WBS, Documents and Linked as folds. Home keeps its own presses: the next stage opens the move sheet, a task
|
|
260
|
+
* drills into the task editor, Documents drills into the documents view. */
|
|
261
|
+
let ADDING = null; // the initiative whose inline Add a task is open
|
|
256
262
|
function pageHtml(id, M) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
const
|
|
261
|
-
+ (t.canCheck ? `<button type="button" class="hi-chk" data-hi-chk="${esc(t.key)}" aria-pressed="false" aria-label="Mark ${esc(t.title)} done"></button>` : '<span class="hi-chk off" aria-hidden="true"></span>')
|
|
262
|
-
+ `<button type="button" class="hm-rm" data-hi-task="${esc(t.key)}"><span class="hm-rt"><b>${esc(t.title)}</b><em class="${t.late ? 'late' : 'q'}">${esc([t.owner || (t.jira ? 'Jira' : ''), t.due].filter(Boolean).join(' · ') || t.state)}</em></span></button></div>`;
|
|
263
|
-
const more = T.all - T.top.length;
|
|
264
|
-
const tasks = `<section class="hi-pg" aria-label="Tasks"><div class="hi-pgh"><b>Tasks</b>${T.open ? `<span class="hi-n">${T.open}</span>` : ''}<button type="button" class="hm-gadd" data-hi-addtask aria-label="Add a task to ${esc(X.ctx.iniTitle(id))}" title="Add a task">${SVG(I.plus, 14, 2.2)}</button></div>`
|
|
265
|
-
+ (rows.length ? T.top.map(trow).join('') + (more > 0 ? `<button type="button" class="hi-pgm" data-hi-open="tasks">Show ${more} more${SVG(I.right, 14, 2)}</button>` : '')
|
|
266
|
-
: `<div class="hi-pge"><p>No tasks yet</p><button type="button" class="hi-btn sm" data-hi-addtask>${SVG(I.plus, 14)}Add a task</button></div>`)
|
|
267
|
-
+ '</section>';
|
|
268
|
-
const docs = MD.docRows(M), look = docs.filter((d) => d.look);
|
|
269
|
-
const drow = (d) => `<div class="hm-r hi-r"><button type="button" class="hm-rm" data-hi-doc="${esc(d.key)}"><i class="hm-dot hi-risk" aria-hidden="true"></i><span class="hm-tile">${SVG(I.doc, 14)}</span><span class="hm-rt"><b>${esc(d.title)}</b><em class="risk">${esc(MD.docPill(d)[0] + (d.when ? ' · ' + d.when : ''))}</em></span></button></div>`;
|
|
270
|
-
const dsec = docs.length ? `<section class="hi-pg" aria-label="Documents"><div class="hi-pgh"><b>Documents</b><span class="hi-n">${docs.length}</span></div>`
|
|
271
|
-
+ look.map(drow).join('') + `<button type="button" class="hi-pgm" data-hi-open="docs">Show all ${docs.length}${SVG(I.right, 14, 2)}</button></section>` : '';
|
|
263
|
+
X.ctx.head(id); // the stage head the move sheet and the primary read (S.H)
|
|
264
|
+
const v = X.ctx.view(id);
|
|
265
|
+
if (!v) return `<div class="hi-v hi-page" data-hi-v="page"><p class="hi-small" role="status">The initiative could not be read.</p></div>`;
|
|
266
|
+
const docs = MD.docRows(M);
|
|
272
267
|
// a phone: the page is a sheet over the list, and the chat is one press away (HbCPhone)
|
|
273
268
|
const talk = isPhone() ? `<button type="button" class="hi-talk" data-hi-talk>Message Claude about ${esc(X.ctx.iniTitle(id))}</button>` : '';
|
|
274
|
-
return `<div class="hi-v hi-page" data-hi-v="page">${WF.endedHtml(rowOf(id))}
|
|
269
|
+
return `<div class="hi-v hi-page" data-hi-v="page">${WF.endedHtml(rowOf(id))}`
|
|
270
|
+
+ viewHtml(v, { add: true, adding: ADDING === id, next: !!v.stage.next, openTask: true, docs: docs.length ? { n: docs.length } : null, wf: !(M.acts && M.acts.self) && !rowOf(id).ended })
|
|
271
|
+
+ `${talk}<p class="hi-small" role="status" id="ovMsg"></p></div>`;
|
|
272
|
+
}
|
|
273
|
+
/** The one view's presses on Home's page. */
|
|
274
|
+
function wirePage(b, id) {
|
|
275
|
+
const C = X.ctx, say = (m) => C.toast(m);
|
|
276
|
+
wireView(b, {
|
|
277
|
+
redraw: () => redrawView(),
|
|
278
|
+
check: async (uid, btn) => {
|
|
279
|
+
const M = curM(); if (!M) return;
|
|
280
|
+
const done = btn.getAttribute('aria-pressed') === 'true';
|
|
281
|
+
const r = await C.pmPost('/api/boards/tasks/state', { ...bw(M), task: uid, state: done ? 'To do' : 'Done' });
|
|
282
|
+
if (!r || r.ok === false) { say((r && r.error) || 'Nothing was changed.'); return; }
|
|
283
|
+
await C.load(); redrawView();
|
|
284
|
+
},
|
|
285
|
+
openTask: (uid) => {
|
|
286
|
+
const M = curM(); if (!M) return;
|
|
287
|
+
const row = (M.tasks.rows || []).find((x) => x.uid === uid || x.key === uid || x.key === 'task:' + uid);
|
|
288
|
+
if (row) { C.VW.drill(); openTask(id, M, row.key); } else iniOverview('tasks', { back: true });
|
|
289
|
+
},
|
|
290
|
+
add: () => { ADDING = id; redrawView(); const f = BODY && BODY.querySelector('#ivAddTask'); if (f) f.focus(); },
|
|
291
|
+
addCancel: () => { ADDING = null; redrawView(); },
|
|
292
|
+
addTask: async (title, inp) => {
|
|
293
|
+
const M = curM(); if (!M) return;
|
|
294
|
+
inp.disabled = true;
|
|
295
|
+
const r = await C.pmPost('/api/boards/tasks/add', { ...bw(M), initiative: id, title });
|
|
296
|
+
inp.disabled = false;
|
|
297
|
+
if (!r || r.ok === false) { say((r && r.error) || 'The task was not added.'); return; }
|
|
298
|
+
say('Task added.'); await C.load(); redrawView();
|
|
299
|
+
const n = BODY && BODY.querySelector('#ivAddTask'); if (n) { n.value = ''; n.focus(); }
|
|
300
|
+
},
|
|
301
|
+
next: (btn) => { const M = curM(); if (M) popNext(btn, id, M); },
|
|
302
|
+
primary: (act) => { if (act === 'ask' || act === 'commit' || act === 'page') C.cta(); else if (act && act.startsWith('doc:')) iniOverview('docs', { back: true }); else C.cta(); },
|
|
303
|
+
program: (pid) => { if (C.goProgram) C.goProgram(pid); },
|
|
304
|
+
doc: (path) => { C.VW.drill(); C.openFile({ path, name: path.split('/').pop() }); },
|
|
305
|
+
docs: () => iniOverview('docs', { back: true }),
|
|
306
|
+
wf: (btn) => WF.openPicker(btn, wfUi(), id),
|
|
307
|
+
});
|
|
275
308
|
}
|
|
276
309
|
/** ⋯ of the page (HbCMore): change it, look at it elsewhere, then stop it, red and last. */
|
|
277
310
|
function pageMore(id) {
|
|
@@ -279,6 +312,8 @@ function pageMore(id) {
|
|
|
279
312
|
const mv = mvOf(id, M), out = [], row = rowOf(id), self = !!(M.acts && M.acts.self);
|
|
280
313
|
// D99 (WfAWontDo): Change workflow and Rename first; the PMOS-self board keeps its derived ladder, so it has no workflow to change
|
|
281
314
|
if (!self && !row.ended) out.push({ label: 'Change workflow', note: (row.wf || {}).name || 'Product feature', on: (b) => WF.openPicker(b || moreBtn(), wfUi(), id) });
|
|
315
|
+
// the one view lists the tasks as the WBS; grouping them by epic, owner or your own groups, and sending them to Jira, is the Tasks view
|
|
316
|
+
out.push({ label: 'All tasks', note: 'Group, send to Jira', on: () => iniOverview('tasks', { back: true }) });
|
|
282
317
|
if (X.ctx.renameIni) out.push({ label: 'Rename', on: () => { const t = document.querySelector('#czViewer [data-cz-vw-rn]'); if (t) t.click(); } });
|
|
283
318
|
if (!mv.why) out.push({ label: 'Moves on by itself', note: mv.auto ? 'On' : 'Off', on: () => (ownWf(row) ? autoPress(id, M, !mv.auto) : press(id, M, { kind: 'auto', on: !mv.auto })) });
|
|
284
319
|
if (mv.canBack) out.push({ label: 'Move back a stage', note: mv.prev, on: (b) => popBack(b || document.querySelector('#czViewer [data-cz-vw="more"]'), id, M, mv) });
|
|
@@ -309,8 +344,8 @@ export function iniPage() {
|
|
|
309
344
|
let rename = X.ctx.renameIni ? X.ctx.renameIni(id, '') : null;
|
|
310
345
|
if (rename) rename = { ...rename, value: X.ctx.iniTitle(id) };
|
|
311
346
|
BODY = VW.open({ id: 'ov:' + id, kind: X.ctx.kindOf(id), title: X.ctx.iniTitle(id), icon: 'goal', more: () => pageMore(id), rename,
|
|
312
|
-
|
|
313
|
-
render: (b) => { X.view = 'page'; BODY = b; draw(b); wire(b, id); } });
|
|
347
|
+
discuss: () => X.ctx.newIn(id), discussHome: true, // the one view (OvViewers): Discuss starts a new session about it, where + New session was
|
|
348
|
+
render: (b) => { X.view = 'page'; BODY = b; ADDING = null; draw(b); wire(b, id); wirePage(b, id); } });
|
|
314
349
|
WF.pmosNotice(wfUi(), id); // WfTriage: "Set to Tender from the BRD · Undo", once
|
|
315
350
|
if (!curM()) { X.failed = null; X.ctx.loadIni().then(() => { if (S.ini !== id) return; if (!curM()) X.failed = id; redrawView(); }); }
|
|
316
351
|
return true;
|
|
@@ -33,7 +33,8 @@ export function stepRows(h, o = {}) {
|
|
|
33
33
|
for (const x of (h && h.rest) || []) {
|
|
34
34
|
if (x.kind === 'you') { you.push({ state: 'you', label: x.label, note: x.note, go: first ? { attr: 'data-hm-go', label: x.label + '. Open it' } : null, attr: first ? '' : 'data-hm-go', aria: x.label + '. Open it' }); first = false; }
|
|
35
35
|
else if (x.kind === 'agent' && o.run && !ran) { ran = true; run.push({ state: 'run', label: x.label, note: runNote(), owner: { kind: 'claude', live: true } }); }
|
|
36
|
-
else if (x.kind === 'agent') wait.push({ state: 'wait', label: x.label, note: x.note, owner: { kind: 'claude' }
|
|
36
|
+
else if (x.kind === 'agent') wait.push({ state: 'wait', label: x.label, note: x.note, owner: { kind: 'claude' },
|
|
37
|
+
...(x.task ? { act: { attr: `data-hi-chk="${esc(x.task)}"`, icon: 'check', label: 'Mark done: ' + x.label } } : {}) }); // a stage task closes here (home-ini.js hiChk)
|
|
37
38
|
else if (x.kind === 'risk') risk.push({ state: 'risk', label: x.label, note: x.note, noteWarn: true });
|
|
38
39
|
else if (x.kind === 'jira') wait.push({ state: 'wait', label: x.label, owner: { kind: 'jira' }, jira: x.jt ? { done: x.jd, total: x.jt } : null });
|
|
39
40
|
else wait.push({ state: 'wait', label: x.label, note: x.note });
|
|
@@ -87,7 +88,7 @@ export function stageCardHtml(h, o = {}) {
|
|
|
87
88
|
const fold = R.done.length ? { n: R.done.length, names: o.doneOpen ? '' : R.done.map((x) => x.label).join(', '), open: !!o.doneOpen, attr: 'data-hm-done' } : null;
|
|
88
89
|
const steps = (o.doneOpen ? R.done : []).concat(R.shown);
|
|
89
90
|
const list = stepsHtml(steps, { label: h.checkTitle, cls: 'hm-scl', fold, more: R.more > 0 ? { n: R.more, attr: 'data-hm-more' } : null, tail: o.tail || '' });
|
|
90
|
-
const none = !R.done.length && !R.open.length ? '<p class="hm-none">No
|
|
91
|
+
const none = !R.done.length && !R.open.length ? '<p class="hm-none">No task is on record for this stage.</p>' : '';
|
|
91
92
|
const turn = R.open.some((x) => x.state === 'you') ? 'you' : h.turn;
|
|
92
93
|
return `<section class="hm-card hm-pcard hm-sc" aria-label="${esc(o.title || '')}">`
|
|
93
94
|
+ `<div class="hm-box hm-scb ${esc(turn)}"><div class="hm-sch"><b>${esc(h.cur || 'No stage')}</b>${R.done.length + R.open.length ? `<span class="of">${esc(h.doneOf)}</span>` : ''}`
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* XetX1Rest … XetX1Phone).
|
|
3
3
|
*
|
|
4
4
|
* A PMOS task of an initiative (GET /api/boards/items, src "pmos") opens here from the list and edits in place: the check box in the header
|
|
5
|
-
* is the quick Done, the title is the rename press, and the
|
|
6
|
-
* the dates, the owner, the
|
|
5
|
+
* is the quick Done, the title is the rename press, and the view under it (task-card.js, the one task Viewer every page uses) changes the
|
|
6
|
+
* status, the dates, the owner and the notes, and its move icon the section, the group or the initiative. Every write is the board's own route and is the PM's press; each says so
|
|
7
7
|
* in a toast with Undo, and a refusal shows the route's reason and changes nothing. Talk it through in chat is under ⋯ (the chat is beside
|
|
8
8
|
* the Viewer on Home). The PM's own items (a note, a mention made into a task) open in My work's item view (home-work.js). */
|
|
9
|
-
import { taskOf, checkOf, mountCard, boardSaver, cardStyle } from './task-card.js';
|
|
9
|
+
import { taskOf, checkOf, mountCard, boardSaver, cardStyle, placeOf } from './task-card.js';
|
|
10
10
|
|
|
11
11
|
/** h: { VW, pmPost, toast, toastUndo?, now, ws, board, iniTitle(id), openIni(id), askInChat(task), onChange(), rename?(task),
|
|
12
12
|
* owners?() → [names], inis?() → [{ id, title }] } */
|
|
@@ -17,9 +17,9 @@ export function openTask(task, h) {
|
|
|
17
17
|
const t = taskOf(raw, { iniTitle: h.iniTitle(raw.ini), board });
|
|
18
18
|
const id = 'task:' + raw.uid;
|
|
19
19
|
const save = boardSaver({ ws, board, t, post: (p, b) => h.pmPost(p, b) });
|
|
20
|
-
let card = null, layout = null;
|
|
20
|
+
let card = null, layout = null, sections = null;
|
|
21
21
|
const changed = () => {
|
|
22
|
-
raw.status = t.status; raw.end = t.due; raw.start = t.start; raw.owner = t.owner; raw.notes = t.notes; raw.ini = t.ini; // the list reads the same row
|
|
22
|
+
raw.status = t.status; raw.end = t.due; raw.start = t.start; raw.owner = t.owner; raw.notes = t.notes; raw.ini = t.ini; raw.section = t.section; // the list reads the same row
|
|
23
23
|
if (h.VW.setCheck) h.VW.setCheck(id, checkOf(t));
|
|
24
24
|
clearTimeout(changed.t); changed.t = setTimeout(() => { if (h.onChange) h.onChange(); }, 400);
|
|
25
25
|
};
|
|
@@ -37,11 +37,22 @@ export function openTask(task, h) {
|
|
|
37
37
|
owners: () => (h.owners ? h.owners() : []),
|
|
38
38
|
inis: () => (h.inis ? h.inis() : []),
|
|
39
39
|
groups: () => (layout ? layout.names || [] : null),
|
|
40
|
+
sections: () => sections,
|
|
40
41
|
});
|
|
41
42
|
},
|
|
42
43
|
});
|
|
43
44
|
// the PM's groups of the initiative, and which one holds this task (initiative-layout); the group chip shows once they are read
|
|
44
45
|
if (t.ini) fetch('/api/initiative-layout?initiative=' + encodeURIComponent(t.ini) + (ws ? '&ws=' + encodeURIComponent(ws) : ''), { credentials: 'same-origin' })
|
|
45
46
|
.then((r) => r.json()).then((L) => { if (!L || !L.ok || !card || !body || !body.isConnected) return; layout = L; t.group = (L.of || {})[t.key] || ''; card.draw(); }).catch(() => {});
|
|
47
|
+
// where it sits: the initiative's stages (the sections the move icon offers), the task's section and its breakdown item
|
|
48
|
+
if (t.ini && board) fetch('/api/boards/items?board=' + encodeURIComponent(board) + (ws ? '&ws=' + encodeURIComponent(ws) : ''), { credentials: 'same-origin' })
|
|
49
|
+
.then((r) => r.json()).then(async (I) => {
|
|
50
|
+
if (!I || !I.ok || !card || !body || !body.isConnected) return;
|
|
51
|
+
const ini = (I.initiatives || []).find((x) => x.id === t.ini);
|
|
52
|
+
sections = ini && Array.isArray(ini.stages) && ini.stages.length ? ini.stages : null;
|
|
53
|
+
const row = (I.items || []).find((x) => x.uid === raw.uid) || raw;
|
|
54
|
+
const P = await placeOf(row, sections || [], (I.items || []).filter((x) => x.ini === t.ini && x.src !== 'jira'));
|
|
55
|
+
t.section = P.section; t.wbs = P.wbs; card.draw();
|
|
56
|
+
}).catch(() => {});
|
|
46
57
|
return body;
|
|
47
58
|
}
|