create-pmos 0.415.0 → 0.417.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/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 +4 -3
- package/workspace/ini-workflow-test.js +11 -11
- package/workspace/lib/board-premium.js +7 -2
- package/workspace/lib/board-trail.js +6 -1
- package/workspace/lib/engine/boards.js +8 -2
- package/workspace/lib/initiative-chat.js +4 -3
- package/workspace/lib/initiative-premium.js +5 -3
- package/workspace/lib/insights-premium.js +9 -1
- package/workspace/lib/pmos-verbs.js +1 -1
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +73 -6
- package/workspace/lib/routes-live.js +53 -0
- package/workspace/lib/task-cli.js +88 -24
- package/workspace/lib/task-items.js +3 -1
- package/workspace/lib/workflow-cli.js +10 -4
- 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 +12 -8
- 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 -230
- 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-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 +15 -16
- 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/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
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* pm/live-model.js — what the Live pill shows (batch 6 item 2, canvas XrrAGrill "Live pill · every scenario"). Pure: no DOM, no fetch.
|
|
2
|
+
*
|
|
3
|
+
* liveItems(sessions, o) → [Item] the 5 or fewer live things the PM touched last, newest first; a recording is always first
|
|
4
|
+
* pillLabel(items) → string the pill's spoken name: "What you work on now: 2 asks you, 1 running. Open (Ctrl J)"
|
|
5
|
+
* keepOrder(prev, items) → [Item] the list while it is open: the rows keep their places, only the marks change (scenario 11)
|
|
6
|
+
* ago(ms) → 'now' | '4m' | '1h' | '2d' the time since the PM last touched it
|
|
7
|
+
* clock(ms) · elapsed(rec, now) the meeting clock (m:ss, then h:mm:ss) and the time heard so far (was pm/cozy-rec-pill.js)
|
|
8
|
+
*
|
|
9
|
+
* sessions: GET /api/live .sessions (the /api/sessions fields the pill needs, plus touched_at: when the PM last opened, typed in or answered it)
|
|
10
|
+
* o: { rec (pm/rec-state.js State), titles ({ initiative id: title }), now, open (the session id open on this page), max (5) }
|
|
11
|
+
*
|
|
12
|
+
* Item = { id, kind: 'ses'|'rec', mark, name, sub, time, at, href, sid, open, paused }
|
|
13
|
+
* mark ask (blue dot: waits on you) · run (ring: running) · stop (amber: it stopped before it finished, yours to restart)
|
|
14
|
+
* · done (check: finished, not opened since) · rec (red clock: a meeting records; grey while paused)
|
|
15
|
+
* What never shows: a session PMOS started and finished by itself, a plain shell, a session ended to make room for a newer chat, a
|
|
16
|
+
* finished one the PM opened after it finished, anything that ended more than a week ago. Nothing live: [] and no pill (zero is silence). */
|
|
17
|
+
|
|
18
|
+
export const MAX = 5;
|
|
19
|
+
const WEEK = 7 * 864e5;
|
|
20
|
+
const SETTLE = 5000; // an exit within 5 s of the PM's own key press (/exit, Ctrl D) is the PM closing it, not news
|
|
21
|
+
const ms = (v) => (v == null || v === '' ? 0 : typeof v === 'number' ? v : Date.parse(v) || 0);
|
|
22
|
+
|
|
23
|
+
/** The meeting clock: m:ss under an hour, then h:mm:ss. */
|
|
24
|
+
export function clock(t) {
|
|
25
|
+
const s = Math.max(0, Math.floor((Number(t) || 0) / 1000)), h = Math.floor(s / 3600), m = Math.floor((s % 3600) / 60), r = String(s % 60).padStart(2, '0');
|
|
26
|
+
return h ? h + ':' + String(m).padStart(2, '0') + ':' + r : m + ':' + r;
|
|
27
|
+
}
|
|
28
|
+
/** The time heard so far for a recording State, now. */
|
|
29
|
+
export const elapsed = (st, now = Date.now()) => (st && st.on ? (Number(st.elapsedMs) || 0) + (st.paused ? 0 : Math.max(0, now - (Number(st.readAt) || now))) : 0);
|
|
30
|
+
|
|
31
|
+
/** The time since: under a minute is "now". */
|
|
32
|
+
export function ago(d) {
|
|
33
|
+
const m = Math.floor(Math.max(0, Number(d) || 0) / 60000);
|
|
34
|
+
return m < 1 ? 'now' : m < 60 ? m + 'm' : m < 1440 ? Math.floor(m / 60) + 'h' : Math.floor(m / 1440) + 'd';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** A session's mark, or null when it is not live for the PM. */
|
|
38
|
+
export function markOf(s, now = Date.now()) {
|
|
39
|
+
if (!s || s.agent === 'shell' || s.auto_ended) return null;
|
|
40
|
+
const turn = s.hx && s.hx.turn;
|
|
41
|
+
if (s.shown === 'exited') {
|
|
42
|
+
if (s.automatic) return null; // PMOS started it and it ended: never the PM's news (Home hides it too)
|
|
43
|
+
const end = ms(s.exited_at) || ms(s.lastOutputAt), touched = ms(s.touched_at);
|
|
44
|
+
if (!touched || (end && now - end > WEEK)) return null; // one the PM never touched (or from before PMOS kept the time) is not theirs to read
|
|
45
|
+
if ((s.outcome && s.outcome.ok === false) || turn === 'agent' || turn === 'tool') return 'stop';
|
|
46
|
+
return end - touched > SETTLE ? 'done' : null;
|
|
47
|
+
}
|
|
48
|
+
if (s.shown === 'needs') return s.automatic ? null : 'ask'; // a run PMOS started that ended its prompt asks nothing (home-data homeSessions)
|
|
49
|
+
if (s.shown === 'blocked') return 'ask';
|
|
50
|
+
if (s.shown === 'working' || (s.shown === 'quiet' && (turn === 'agent' || turn === 'tool'))) return 'run';
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The session's name as Home shows it (home-data nameOf): the PM's own name wins, then Claude's, then the CLI's title. */
|
|
55
|
+
function nameOf(s) {
|
|
56
|
+
const plain = String(s.name || '').replace(/^chat:\s*/, '');
|
|
57
|
+
if (s.name_by === 'pm') return plain || s.auto_name || (s.hx && s.hx.title) || 'Session';
|
|
58
|
+
return s.auto_name || (s.hx && s.hx.title) || plain || 'Session';
|
|
59
|
+
}
|
|
60
|
+
const iniOf = (s) => s.initiative || ((/^chat:(?:init|board):([^:]+)/.exec(String(s.origin || '')) || [])[1]) || null;
|
|
61
|
+
|
|
62
|
+
export function liveItems(sessions, o = {}) {
|
|
63
|
+
const now = o.now || Date.now(), max = o.max || MAX, titles = o.titles || {};
|
|
64
|
+
const out = [];
|
|
65
|
+
const rec = o.rec;
|
|
66
|
+
if (rec && rec.on && !rec.here) {
|
|
67
|
+
out.push({ id: 'rec:' + rec.id, kind: 'rec', mark: 'rec', name: rec.title || 'Meeting', sub: 'Meeting', time: clock(elapsed(rec, now)), at: now, href: rec.href || '/premium.html', paused: !!rec.paused, open: false });
|
|
68
|
+
}
|
|
69
|
+
const rows = [];
|
|
70
|
+
for (const s of Array.isArray(sessions) ? sessions : []) {
|
|
71
|
+
const mark = markOf(s, now); if (!mark) continue;
|
|
72
|
+
const at = ms(s.touched_at) || ms(s.created);
|
|
73
|
+
const ini = iniOf(s);
|
|
74
|
+
rows.push({ id: 's:' + s.id, kind: 'ses', sid: s.id, mark, name: nameOf(s), sub: mark === 'stop' ? 'Stopped · restart it' : ini ? titles[ini] || ini : 'Not in an initiative',
|
|
75
|
+
at, time: ago(now - at), href: '/premium.html?session=' + encodeURIComponent(s.id), open: !!o.open && o.open === s.id });
|
|
76
|
+
}
|
|
77
|
+
rows.sort((a, b) => b.at - a.at || (a.id < b.id ? -1 : 1));
|
|
78
|
+
return out.concat(rows).slice(0, max);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The list while it is open: each row keeps its place and takes its new mark and time; a row that left stays out; nothing new joins. */
|
|
82
|
+
export function keepOrder(prev, items) {
|
|
83
|
+
if (!Array.isArray(prev) || !prev.length) return items;
|
|
84
|
+
const by = new Map(items.map((x) => [x.id, x]));
|
|
85
|
+
return prev.map((p) => by.get(p.id)).filter(Boolean);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const WORD = { ask: 'asks you', run: 'running', stop: 'stopped, open it to restart', done: 'finished, not read yet' };
|
|
89
|
+
/** The pill's name for a screen reader and its tooltip: what is live, by kind, then the key. */
|
|
90
|
+
export function pillLabel(items, { mac = false } = {}) {
|
|
91
|
+
const parts = [];
|
|
92
|
+
const r = items.find((x) => x.kind === 'rec');
|
|
93
|
+
if (r) parts.push((r.paused ? 'recording paused at ' : 'recording ') + r.time);
|
|
94
|
+
for (const k of ['ask', 'run', 'stop', 'done']) {
|
|
95
|
+
const n = items.filter((x) => x.mark === k).length;
|
|
96
|
+
if (n) parts.push(n + ' ' + WORD[k]);
|
|
97
|
+
}
|
|
98
|
+
return 'What you work on now: ' + parts.join(', ') + '. Open (' + (mac ? '⌘J' : 'Ctrl J') + ')';
|
|
99
|
+
}
|
|
100
|
+
/** One row's spoken name: its name, its state, when the PM last touched it, and "open now" for the one on screen. */
|
|
101
|
+
export function rowLabel(x) {
|
|
102
|
+
const st = x.kind === 'rec' ? (x.paused ? 'recording, paused' : 'recording') : WORD[x.mark];
|
|
103
|
+
return x.name + ', ' + st + (x.kind === 'rec' ? ', ' + x.time : ', last touched ' + x.time) + (x.open ? ', open now' : '');
|
|
104
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* pm/ov-view.css — the parts every object Viewer shares (feedback batch 6 item 1b; canvas OvViewers, OvReport): the facts card, a quiet
|
|
2
|
+
* label over a block of words, the clamped description with its open icon, and the one "where it sits" row. Over cozy.css's tokens, so the
|
|
3
|
+
* dark theme follows. task-card.js, tk-view.js and the goal Viewer (premium-insights.js) load it. */
|
|
4
|
+
.ovf { border-radius: 18px; box-shadow: inset 0 0 0 1px var(--cz-hair); background: var(--cz-card); padding: 14px 16px; display: grid; grid-template-columns: max-content 1fr; column-gap: 18px; row-gap: 6px; align-items: center; font-size: 14px; }
|
|
5
|
+
.ovf > .k { color: var(--cz-ink3); font-size: 13px; font-weight: 600; min-height: 30px; display: flex; align-items: center; }
|
|
6
|
+
.ovf > .v { min-width: 0; min-height: 30px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; color: var(--cz-ink); }
|
|
7
|
+
.ovf > .v .late { color: var(--cz-risk); font-weight: 700; }
|
|
8
|
+
.ovf > .foot { grid-column: 1 / -1; margin: 10px 0 0; font-size: 12.5px; color: var(--cz-ink3); font-weight: 600; }
|
|
9
|
+
.ovf .av { width: 22px; height: 22px; border-radius: 7px; background: var(--cz-well); color: var(--cz-ink2); font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
|
|
10
|
+
.ovf .av.j { border-radius: 50%; background: var(--cz-okbg); color: var(--cz-ok); }
|
|
11
|
+
.ovf .av.no { background: transparent; border: 1.5px dashed var(--cz-ink3); box-sizing: border-box; }
|
|
12
|
+
|
|
13
|
+
/* a quiet label over a block (Notes, Your notes, Description · from Jira) */
|
|
14
|
+
.ovb { display: flex; flex-direction: column; gap: 4px; }
|
|
15
|
+
.ovl { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); }
|
|
16
|
+
.ovl small { font-weight: 600; font-size: 12.5px; }
|
|
17
|
+
.ovt { margin: 0; font-size: 14px; line-height: 1.55; color: var(--cz-ink); }
|
|
18
|
+
/* the description: shown open, cut at five lines, an icon opens the rest */
|
|
19
|
+
.ovd { position: relative; }
|
|
20
|
+
.ovd .ovdx { font-size: 14px; line-height: 1.55; color: var(--cz-ink); overflow-wrap: anywhere; }
|
|
21
|
+
.ovd .ovdx p, .ovd .ovdx ul, .ovd .ovdx ol { margin: 0 0 6px; }
|
|
22
|
+
.ovd .ovdx h4 { margin: 8px 0 2px; font-size: 13px; }
|
|
23
|
+
.ovd.cut .ovdx { max-height: calc(1.55em * 5); overflow: hidden; -webkit-mask-image: linear-gradient(180deg, var(--cz-ink) 55%, transparent); mask-image: linear-gradient(180deg, var(--cz-ink) 55%, transparent); }
|
|
24
|
+
.ovd .ovdm { display: flex; justify-content: center; margin-top: 2px; }
|
|
25
|
+
.ovib { width: 30px; height: 30px; border-radius: 999px; border: 0; padding: 0; background: var(--cz-well); color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
|
|
26
|
+
.ovib:hover { background: var(--cz-well2); color: var(--cz-ink); }
|
|
27
|
+
|
|
28
|
+
/* where it sits: initiative › section › breakdown item, with the move icon */
|
|
29
|
+
.ovw { display: flex; align-items: center; gap: 4px; border-radius: 16px; background: var(--cz-well); padding: 4px 6px 4px 4px; }
|
|
30
|
+
.ovw .go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 8px; border-radius: 12px; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
|
|
31
|
+
.ovw .go:hover { background: var(--cz-well2); }
|
|
32
|
+
.ovw .tl { width: 28px; height: 28px; border-radius: 9px; background: var(--cz-bluebg); color: var(--cz-blueink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
|
|
33
|
+
.ovw .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
|
|
34
|
+
.ovw .tx b { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
35
|
+
.ovw .tx small { font-size: 12.5px; color: var(--cz-ink3); font-weight: 600; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
|
|
36
|
+
.ovw .tx small .sep { opacity: .7; }
|
|
37
|
+
.ovw .cv { color: var(--cz-ink3); display: inline-flex; flex: none; }
|
|
38
|
+
.ovw .ovmv { width: 38px; height: 38px; border-radius: 999px; border: 0; background: transparent; color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
|
|
39
|
+
.ovw .ovmv:hover, .ovw .ovmv.open { background: var(--cz-well2); }
|
|
40
|
+
|
|
41
|
+
/* the foot link (Open in Jira) */
|
|
42
|
+
.ovft { display: flex; justify-content: center; padding: 6px 0 4px; }
|
|
43
|
+
.ovft a { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--cz-ink2); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
|
|
44
|
+
.ovft a:hover { background: var(--cz-well); color: var(--cz-ink); }
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { pmPost } from './http.js';
|
|
20
20
|
import { $, $$, esc, store, crumbHtml, wireCrumb, chatAbout, setPageGaps } from './premium-shell.js';
|
|
21
21
|
import { mountNav } from './cozy-nav.js';
|
|
22
|
-
import {
|
|
22
|
+
import { mountLivePill } from './cozy-live-pill.js';
|
|
23
23
|
import { stepsHelpHtml, rulesHelpHtml } from './bd-stages.js';
|
|
24
24
|
import { timelineHtml, legendHtml, SPANS, GROUPS, md } from './bd-span.js';
|
|
25
25
|
import * as Acts from './bd-acts.js';
|
|
@@ -33,6 +33,7 @@ import * as VW from './cozy-viewer.js';
|
|
|
33
33
|
import * as PP from './bd-prog-panel.js';
|
|
34
34
|
import * as PO from './prog-order.js'; // the order of a program's initiatives: the grip and Claude's order from the dates (canvas RoADrag, RoASuggest)
|
|
35
35
|
import * as BI from './bd-ini-panel.js';
|
|
36
|
+
import { statusOf as ivStatus } from './ini-view-model.js';
|
|
36
37
|
import { initiativeRename } from './rename-press.js';
|
|
37
38
|
import { setSay } from './cozy-xv.js';
|
|
38
39
|
|
|
@@ -56,7 +57,7 @@ let byProduct = store.get(GROUPING_KEY) === 'product'; // the grouping: progra
|
|
|
56
57
|
let DM = {}; // the documents' history (GET /api/board-docs): { [path]: { changed, by, log } }
|
|
57
58
|
let peek = null; // what the Viewer shows for the Board: { kind: 'ini', key } an initiative or its ticket, { kind: 'acts' } an acts panel
|
|
58
59
|
mountNav('board');
|
|
59
|
-
|
|
60
|
+
mountLivePill();
|
|
60
61
|
// a product head's goal dots (PgBoard .gd) count that product's open initiatives, the way Home's product header does
|
|
61
62
|
PG.goalsFrom((name) => (M ? M.initiatives.list.rows.filter((r) => !M.board.all || r.product === name) : null));
|
|
62
63
|
const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
@@ -268,19 +269,10 @@ function showingHtml(n) {
|
|
|
268
269
|
return `<div class="bd-showing" role="status"><span class="bd-mlbl">Showing</span>${chips}<button type="button" class="dlink" id="fClear">Clear all</button><span class="bd-sp"></span><span class="bd-amut">${n} of ${M.initiatives.list.rows.length} initiatives</span></div>`;
|
|
269
270
|
}
|
|
270
271
|
/** The status line of a row: on hold, waiting on you, late, at risk, idle, shipping, on track. A blocked ticket stays on its ticket. */
|
|
272
|
+
/** The status a row and the initiative view both say (pm/ini-view-model.js statusOf), with its motion: the info pulse for you, the warn for late. */
|
|
271
273
|
function statusOf(r) {
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
if (t.you) return { tone: 'you', mo: 'm-info', text: t.you };
|
|
275
|
-
const g = r.id && GR[r.id]; if (g && g.open && !g.later) return { tone: 'you', mo: 'm-info', text: g.open + ' ' + plural(g.open, 'question', 'questions') + ' before the BRD' };
|
|
276
|
-
if (r.late) return { tone: 'late', mo: 'm-warn', text: r.overDays > 0 ? r.overDays + ' ' + plural(r.overDays, 'day', 'days') + ' over' : 'Late' };
|
|
277
|
-
if (r.status === 'at risk') return { tone: 'risk', mo: 'm-warn', text: 'At risk' + (r.owner ? '' : ' · no owner') };
|
|
278
|
-
if (t.idle != null) return { tone: 'q', mo: '', text: 'Idle ' + t.idle + ' days' };
|
|
279
|
-
if (r.status === 'on track' && r.release && r.release.days != null && r.release.days >= 0 && t.key === 'deliver') {
|
|
280
|
-
const d = r.release.days; return { tone: 'ok', mo: '', text: d === 0 ? 'Ships today' : d === 1 ? 'Ships tomorrow' : 'Ships ' + fmt(r.release.iso) };
|
|
281
|
-
}
|
|
282
|
-
if (r.status === 'on track') return { tone: 'ok', mo: '', text: 'On track' };
|
|
283
|
-
return { tone: 'q', mo: '', text: r.statusLabel || r.sub };
|
|
274
|
+
const x = ivStatus(r, r.id && GR[r.id], fmt);
|
|
275
|
+
return { ...x, mo: x.tone === 'you' ? 'm-info' : x.tone === 'late' || x.tone === 'risk' ? 'm-warn' : '', text: x.text || r.sub };
|
|
284
276
|
}
|
|
285
277
|
/** The Output bar: one segment per ticket (a ticket opens its panel) or per part; a progress the record holds fills it as one bar. */
|
|
286
278
|
function segHtml(r, big) {
|
|
@@ -494,7 +486,7 @@ $('#ibBody').addEventListener('drop', async (e) => {
|
|
|
494
486
|
to = st.name; if (cur) from = cur.name;
|
|
495
487
|
} else {
|
|
496
488
|
const j = +col.dataset.step; if (r.track.k === j) return;
|
|
497
|
-
const step = M.steps[j]; to = (r.acts.stages || []).find((n) => stepOfName(n) === step.key);
|
|
489
|
+
const step = M.steps[j]; to = (r.acts.stages || []).find((n) => stepOfName(n) === step.key) || (WF.isPF(WF.wfOf(r)) ? step.label : null); // batch 7 item 4
|
|
498
490
|
if (!to) { say(step.label + ' is not one of this board\'s stages, so it did not move.'); return; }
|
|
499
491
|
}
|
|
500
492
|
const body = { ws: r.ws || M.board.ws, board: r.boardId || M.board.id, id: r.id };
|
|
@@ -793,6 +785,13 @@ async function setTask(r, uid, state) {
|
|
|
793
785
|
say(state + ': ' + (k ? k.title : uid) + '.', k && state === 'Done' ? async () => { const u = await pmPost('/api/boards/tasks/state', { ...body, state: k.status }).catch(() => null); say(u && u.ok ? 'Back to ' + k.status + '.' : (u && u.error) || 'The undo did not land.'); load(); } : undefined);
|
|
794
786
|
load();
|
|
795
787
|
}
|
|
788
|
+
/** A new task from the initiative view's + (the same box Home's page draws): POST /api/boards/tasks/add. → true when it was added. */
|
|
789
|
+
async function addTask(r, title) {
|
|
790
|
+
const res = await pmPost('/api/boards/tasks/add', { ws: r.ws || M.board.ws, board: r.boardId || M.board.id, initiative: r.id, title }).catch(() => null);
|
|
791
|
+
if (!res || res.ok === false) { say((res && res.error) || 'The task was not added.'); return false; }
|
|
792
|
+
say('Task added.'); load();
|
|
793
|
+
return true;
|
|
794
|
+
}
|
|
796
795
|
const viewDoc = (path) => { const a = document.createElement('button'); a.dataset.doc = path; a.hidden = true; document.body.appendChild(a); a.click(); a.remove(); };
|
|
797
796
|
const anchors = async (ws, board) => { try { const r = await (await fetch('/api/boards/anchors?ws=' + encodeURIComponent(ws || M.board.ws || '') + '&board=' + encodeURIComponent(board || M.board.id || ''), { credentials: 'same-origin' })).json(); return r && r.ok ? r.anchors || [] : []; } catch { return []; } };
|
|
798
797
|
const openIniAny = (r) => openIni(r, $('#bdBell'), 'track');
|
|
@@ -806,7 +805,7 @@ Acts.init({ M: () => M, wf: wfState, load, say, panel: actsPanel, close: closePa
|
|
|
806
805
|
BI.mount({ M: () => M, statusOf, dayTitle, usual: usualOf, fmt, md, ago, segHtml, barHtml: V.barHtml, grill: (id) => GR[id], rowOf, pageHref, askHref, refreshJira: () => refreshJira(), viewDoc,
|
|
807
806
|
send: (r) => import('./tk-send.js').then((S) => S.openSend({ ws: r.ws || M.board.ws || null, board: r.boardId || M.board.id, initiative: r.id, toast: say })),
|
|
808
807
|
acts: (r, b) => Acts.open.row(r, b), grillOpen: (r, b) => Asks.openGrill(r.id, r.title, (r.track && r.track.label) || 'Triage', false, b), onShow: iniShown, onHide: iniHidden,
|
|
809
|
-
programOf: (r) => programOf(PGS, r.ws || M.board.ws || '', r.id), rename: renameIni, setTask, turnProgram });
|
|
808
|
+
programOf: (r) => programOf(PGS, r.ws || M.board.ws || '', r.id), openProgram: (id, b) => PG.openProgram(id, b), rename: renameIni, setTask, addTask, turnProgram });
|
|
810
809
|
/** Tap the title to rename (canvas RnAIni): the list, the Timeline and the panel show the new name at once; Undo is the same press.
|
|
811
810
|
* The Jira box opens Home's chat about it with the request typed, for the PM to send (PMOS holds no Jira credential, D53). */
|
|
812
811
|
// a name the PM just saved holds over a read that predates it (the board derives off the request path) until a read says it too
|
|
@@ -25,7 +25,7 @@ import { $, $$, esc, toast, wireRail, setPageGaps } from './premium-shell.js';
|
|
|
25
25
|
import { pmPost } from './http.js';
|
|
26
26
|
import { openReport } from './premium-report-read.js';
|
|
27
27
|
import { mountNav } from './cozy-nav.js';
|
|
28
|
-
import {
|
|
28
|
+
import { mountLivePill } from './cozy-live-pill.js';
|
|
29
29
|
|
|
30
30
|
let M = null; // the model
|
|
31
31
|
let BM = null, bmErr = ''; // the Board measures (Delivery trends)
|
|
@@ -39,7 +39,7 @@ let loadedAt = 0;
|
|
|
39
39
|
let selecting = false; let picked = []; // New dashboard: the goals picked in the table, in order
|
|
40
40
|
wireRail('rep');
|
|
41
41
|
mountNav('insights');
|
|
42
|
-
|
|
42
|
+
mountLivePill();
|
|
43
43
|
|
|
44
44
|
const SV = (d, sw) => `<svg viewBox="0 0 24 24" aria-hidden="true"${sw ? ` stroke-width="${sw}"` : ''}><path d="${d}"/></svg>`;
|
|
45
45
|
const I = {
|
|
@@ -480,43 +480,59 @@ const srcOf = (g) => (g.source ? SRC_NAME[g.source] || g.source : 'Recorded');
|
|
|
480
480
|
const unitV = (g, v) => { const u = String(g.unit || '').trim(); return String(v) + (u ? (/^[A-Za-z]/.test(u) ? ' ' + u : u) : ''); };
|
|
481
481
|
/** The ship dates of the work that moves a goal: a mark with the initiative's name where it falls inside the readings. */
|
|
482
482
|
const shipsOf = (g) => (g.moves || []).filter((r) => r.endAt && (r.idx >= 5 || r.status === 'done')).map((r) => ({ t: day(r.endAt), label: r.title + ' shipped' })).filter((x) => x.t !== null);
|
|
483
|
-
/** The
|
|
483
|
+
/** The milestones of the work that moves a goal, as the chart's diamonds: an open initiative's next milestone at its planned finish. */
|
|
484
|
+
const marksOf = (g) => (g.moves || []).filter((r) => r.milestone && r.endAt && r.status !== 'done' && r.status !== 'cancelled').map((r) => ({ t: day(r.endAt), label: String(r.milestone.name).split(/\s+/)[0] + ', ' + md(day(r.endAt)) })).filter((x) => x.t !== null);
|
|
485
|
+
/** The goal's readings at their dates (canvas OvViewers "Goal"): the target dashed with its value at the right end, the pace dashed to its
|
|
486
|
+
* date, each reading on the line and the latest a dot, and a diamond with a dotted rule at each milestone that moves it. */
|
|
484
487
|
function detailSvg(g, c, W = 490, H = 150) {
|
|
485
488
|
const pts = c.pts, t0 = day(pts[0].at), tl = day(pts[pts.length - 1].at), by = day(g.byAt);
|
|
486
|
-
const proj = g.proj && by !== null && by > tl ? { t: by, v: g.proj.atDue } : null
|
|
489
|
+
const proj = g.proj && by !== null && by > tl ? { t: by, v: g.proj.atDue } : null;
|
|
490
|
+
const marks = marksOf(g).filter((m) => m.t > t0 && m.t <= Math.max(by || 0, tl)), t1 = Math.max(proj ? proj.t : tl, ...marks.map((m) => m.t));
|
|
487
491
|
const ys = pts.map((p) => p.v).concat(g.target !== null ? [g.target] : [], proj ? [proj.v] : []), lo = Math.min(...ys), hi = Math.max(...ys), rg = hi - lo || 1;
|
|
488
|
-
const x = (t) =>
|
|
489
|
-
let out =
|
|
490
|
-
if (g.target !== null) { const ty = y(g.target); out += `<path class="tg" d="M0 ${f(ty)}H${W}"/><text class="tgl" x="
|
|
492
|
+
const x = (t) => 12 + (t1 > t0 ? (t - t0) / (t1 - t0) : 1) * (W - 24), y = (v) => 26 + (1 - (v - lo) / rg) * (H - 56), f = (n) => n.toFixed(1);
|
|
493
|
+
let out = '';
|
|
494
|
+
if (g.target !== null) { const ty = y(g.target); out += `<path class="tg" d="M0 ${f(ty)}H${W}"/><text class="tgl" x="${W - 2}" y="${f(ty < 18 ? ty + 14 : ty - 6)}" text-anchor="end">Target ${esc(g.targetTxt)}</text>`; }
|
|
491
495
|
for (const s of shipsOf(g)) { if (s.t < t0 || s.t > t1) continue; const sx = x(s.t), end = sx > W - 160; out += `<path class="ship" d="M${f(sx)} 20V${H - 10}"/><text class="shipl" x="${f(end ? sx - 4 : sx + 4)}" y="${H - 14}"${end ? ' text-anchor="end"' : ''}>${esc(s.label)}</text>`; }
|
|
496
|
+
for (const m of marks) { const mx = x(m.t), end = mx > W - 120; out += `<path class="msr" d="M${f(mx)} 14V${H - 16}"/><path class="msd" d="M${f(mx)} ${H - 14}l5 5-5 5-5-5z"/><text class="msl" x="${f(end ? mx - 9 : mx + 9)}" y="${H - 5}"${end ? ' text-anchor="end"' : ''}>${esc(m.label)}</text>`; }
|
|
492
497
|
const L = pts.map((p) => f(x(day(p.at))) + ' ' + f(y(p.v))), last = L[L.length - 1];
|
|
493
498
|
out += `<path class="ln" d="M${L.join('L')}"/>` + (proj ? `<path class="pj" d="M${last}L${f(x(proj.t))} ${f(y(proj.v))}"/>` : '');
|
|
494
|
-
out +=
|
|
499
|
+
out += `<circle class="pt now" cx="${f(x(day(pts[pts.length - 1].at)))}" cy="${f(y(pts[pts.length - 1].v))}" r="3.5"/>`;
|
|
495
500
|
const a = pts[0], z = pts[pts.length - 1];
|
|
496
|
-
return `<svg class="ins-gch" viewBox="0 0 ${W} ${H}" role="img" aria-label="${esc(g.title + ': readings from ' + a.txt + ' on ' + md(day(a.at)) + ' to ' + z.txt + ' on ' + md(day(z.at)) + (g.targetTxt ? ', target ' + g.targetTxt : ''))}">${out}</svg>`;
|
|
501
|
+
return `<svg class="ins-gch" viewBox="0 0 ${W} ${H}" role="img" aria-label="${esc(g.title + ': readings from ' + a.txt + ' on ' + md(day(a.at)) + ' to ' + z.txt + ' on ' + md(day(z.at)) + (g.targetTxt ? ', target ' + g.targetTxt : '') + (marks.length ? ', milestones ' + marks.map((m) => m.label).join(' and ') : ''))}">${out}</svg>`;
|
|
497
502
|
}
|
|
498
503
|
const emptyTrend = (g, add) => `<div class="ins-box ins-etr"><span>${g.readings ? 'A trend needs 2 readings.' : 'No reading yet. A trend needs 2 readings.'} ${esc(nextReading(g))}</span>${add ? '<button type="button" class="ins-btn sm" data-gx="add">Add a reading</button>' : ''}</div>`;
|
|
499
504
|
const dashSwitches = (g) => savedDash().map((D) => { const on = D.charts.includes(g.id); return `<div class="ins-trow"><span>${esc(D.name)}</span><button type="button" class="ins-tog${on ? ' on' : ''}" role="switch" aria-checked="${on}" aria-label="On ${esc(D.name)}" data-gx="dash" data-d="${esc(D.id)}"></button></div>`; }).join('')
|
|
500
505
|
|| '<p class="note">No dashboard is saved yet. New dashboard makes one.</p>';
|
|
501
|
-
/* ── a goal in the Viewer
|
|
502
|
-
* reading
|
|
503
|
-
* it
|
|
506
|
+
/* ── a goal in the Viewer (canvas OvViewers "Goal", batch 6 item 1b; the same chip everywhere opens it): the summary (on course or not, where
|
|
507
|
+
* the reading comes from and how fresh it is, the words), the big number with its target over the chart (the target line and the milestones
|
|
508
|
+
* that move it), Moved by (each initiative with its milestone and plan date), then the folds Readings and On dashboards. ⋯ holds Add a
|
|
509
|
+
* reading and Edit chart, then Copy link and Copy as text. Discuss in chat takes the goal to Home. ── */
|
|
504
510
|
const vwOpen = (o) => { const V = window.czViewer; return V && typeof V.open === 'function' && typeof V.czSummary === 'function' ? V.open(o) : null; };
|
|
505
|
-
|
|
511
|
+
const MONTH = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
512
|
+
/** The change over the readings: "Up 0.7 points since July." in the goal's unit (points for a percentage); '' with fewer than 2 readings. */
|
|
506
513
|
function sinceOf(g) {
|
|
507
514
|
const S = g.series || []; if (S.length < 2) return '';
|
|
508
|
-
const a = S[
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
515
|
+
const a = S[0], b = S[S.length - 1], d = Math.round((b.v - a.v) * 100) / 100, ta = day(a.at), far = day(b.at) - ta > 60 * DAY;
|
|
516
|
+
const amt = /^%$/.test(String(g.unit || '').trim()) ? Math.abs(d) + (Math.abs(d) === 1 ? ' point' : ' points') : unitV(g, Math.abs(d));
|
|
517
|
+
return (d === 0 ? 'No change' : (d > 0 ? 'Up ' : 'Down ') + amt) + ' since ' + (far ? MONTH[new Date(ta).getUTCMonth()] : md(ta)) + '.';
|
|
518
|
+
}
|
|
519
|
+
/** "read today", "read yesterday", "read 3 days ago": how fresh the latest reading is. */
|
|
520
|
+
const freshOf = (g) => { const S = g.series || []; if (!S.length) return ''; const n = Math.round((today() - day(S[S.length - 1].at)) / DAY); return n <= 0 ? 'read today' : n === 1 ? 'read yesterday' : 'read ' + n + ' days ago'; };
|
|
521
|
+
/** The state line: Reached, On course or Off course from the pace; a limit or a done-or-not goal says its own head. */
|
|
522
|
+
function stateOf(g) {
|
|
523
|
+
const P = g.pace || {};
|
|
524
|
+
if (g.type === 'Stay within' || g.type === 'Done or not' || P.head === 'Reached') return { line: P.head && P.head !== '—' ? P.head : 'No reading yet', tone: P.tone === 'late' ? 'warn' : P.tone === 'ok' ? 'ok' : '' };
|
|
525
|
+
if (P.tone === 'ok') return { line: 'On course', tone: 'ok' };
|
|
526
|
+
if (P.tone === 'late') return { line: 'Off course', tone: 'warn' };
|
|
527
|
+
return { line: g.readings ? 'No pace yet' : 'No reading yet', tone: '' };
|
|
528
|
+
}
|
|
529
|
+
function goalSummary(g) {
|
|
530
|
+
const st = stateOf(g), fr = freshOf(g);
|
|
531
|
+
const now = g.nowTxt ? g.nowTxt + ' now' : '', tgt = g.targetTxt ? g.targetTxt + (g.byAt ? ' by ' + md(day(g.byAt)) : '') : '';
|
|
532
|
+
const first = [now, tgt].filter(Boolean).join(', ');
|
|
533
|
+
const pace = g.pace && g.pace.tone === 'late' && g.pace.head !== '—' ? g.pace.head + (g.pace.sub ? ', ' + g.pace.sub : '') + '.' : '';
|
|
534
|
+
const text = [first ? first + '.' : '', sinceOf(g), pace].filter(Boolean).join(' ') || nextReading(g);
|
|
535
|
+
return { line: st.line, tone: st.tone, right: [PF ? g.prod : '', srcOf(g) === 'Recorded' ? 'Insights' : srcOf(g), fr].filter(Boolean).join(' · '), text }; // a portfolio names the goal's product
|
|
520
536
|
}
|
|
521
537
|
function readingsHtml(g, o) {
|
|
522
538
|
const steps = g.type === 'Done or not' && g.steps && g.steps.length, R = g.series.slice().reverse(), shown = o.more ? R : R.slice(0, 3);
|
|
@@ -524,32 +540,42 @@ function readingsHtml(g, o) {
|
|
|
524
540
|
+ (R.length > shown.length ? `<div><button type="button" class="ins-btn sm ghost" data-gx="all">All ${R.length} readings</button></div>` : '') : `<p class="note">${esc(nextReading(g))}</p>`)
|
|
525
541
|
+ (steps ? `<form class="ins-mf" data-stf><p class="ins-lbl">Steps</p>${g.steps.map((x, i) => `<label class="ins-ck2"><input type="checkbox" name="s${i}"${x.done ? ' checked' : ''}> ${esc(x.text)}</label>`).join('')}<div class="ins-mact"><button type="submit" class="ins-btn sm dark">Save steps</button><span class="note" data-msg role="status"></span></div></form>` : '');
|
|
526
542
|
}
|
|
527
|
-
const
|
|
543
|
+
const FLAG = '<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 21V4M6 4h11l-2 4 2 4H6"/></svg>';
|
|
544
|
+
const CHEV = '<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M10 7l5 5-5 5"/></svg>';
|
|
545
|
+
/** One initiative that moves the goal: its name, and the milestone it works toward with its plan date (or where it stands). */
|
|
546
|
+
const moveRow = (r) => { const sub = r.milestone ? '<i class="ins-dia" aria-hidden="true"></i>' + esc(r.milestone.name + (r.end ? ', plan ' + md(day(r.endAt)) : '')) : esc([r.stageLabel, r.end ? 'plan ' + md(day(r.endAt)) : ''].filter(Boolean).join(', '));
|
|
547
|
+
return `<a class="ovw ins-mvr" href="${iniHref(r.id)}"><span class="go"><span class="tl" aria-hidden="true">${FLAG}</span><span class="tx"><b>${esc(r.title)}</b>${sub ? `<small>${sub}</small>` : ''}</span><span class="cv">${CHEV}</span></span></a>`; };
|
|
548
|
+
const movedHtml = (g) => (g.moves.length ? `<div class="ins-mvl">${g.moves.map(moveRow).join('')}</div>` : `<p class="note">${M.initiativesRead ? 'No initiative anchors to it yet. An initiative moves it once its anchor names it.' : 'The initiatives are not read yet.'}</p>`);
|
|
528
549
|
function goalBodyHtml(g, o) {
|
|
529
550
|
const V = window.czViewer, c = g.key ? byKey(g.key) : null, phone = isPhone(), steps = g.type === 'Done or not' && g.steps && g.steps.length;
|
|
530
|
-
const chart = steps ? stepsHtml(g) : c ? detailSvg(g, c, phone ?
|
|
551
|
+
const chart = steps ? stepsHtml(g) : c ? detailSvg(g, c, phone ? 330 : 470, phone ? 140 : 160) : emptyTrend(g, o.own);
|
|
552
|
+
const big = `<div class="ins-gbig">${g.nowTxt ? `<p class="ins-gnum"><b>${esc(g.nowTxt)}</b>${g.targetTxt ? `<span>target ${esc(g.targetTxt)}${g.byAt ? ' by ' + esc(md(day(g.byAt))) : ''}</span>` : ''}</p>` : ''}${chart}</div>`;
|
|
531
553
|
const form = !steps && o.adding ? `<form class="ins-mf ins-box" data-rdf><div class="ins-2"><label class="ins-fl">Date<input class="ins-inp" type="date" name="at" value="${esc(M.today || '')}"></label><label class="ins-fl">Value${g.unit ? ' (' + esc(g.unit) + ')' : ''}<input class="ins-inp" name="v" inputmode="decimal" maxlength="16"></label></div><div class="ins-mact"><button type="submit" class="ins-btn sm dark">Add reading</button><button type="button" class="ins-btn sm ghost" data-gx="cancel">Cancel</button><span class="note" data-msg role="status"></span></div></form>` : '';
|
|
532
554
|
const onDash = savedDash().filter((D) => D.charts.includes(g.id)).length;
|
|
555
|
+
const moved = `<div class="ins-mvb"><p class="ins-mvh">Moved by${g.moves.length ? ` <span>${g.moves.length}</span>` : ''}</p>${movedHtml(g)}</div>`;
|
|
533
556
|
const rows = [
|
|
534
557
|
{ id: 'read', title: 'Readings', count: g.series.length, open: o.open === 'read', render: () => readingsHtml(g, o) },
|
|
535
|
-
{ id: '
|
|
536
|
-
o.own ? { id: 'dash', title: 'On your dashboards', count: onDash, render: () => dashSwitches(g) } : null,
|
|
558
|
+
o.own && savedDash().length ? { id: 'dash', title: 'On dashboards', count: onDash, render: () => dashSwitches(g) } : null,
|
|
537
559
|
];
|
|
538
|
-
return V.czSummary(goalSummary(g
|
|
560
|
+
return V.czSummary(goalSummary(g)) + form + big + moved + V.czSections(rows, { key: 'goal' }) + '<p class="note ins-gmsg" data-gmsg role="status"></p>';
|
|
539
561
|
}
|
|
540
562
|
/** The goal as plain text, for Copy as text. */
|
|
541
563
|
function goalText(g) {
|
|
542
|
-
const s = goalSummary(g
|
|
543
|
-
return [(kr ? kr + ' · ' : '') + g.title, s.line
|
|
564
|
+
const s = goalSummary(g), kr = krId(g);
|
|
565
|
+
return [(kr ? kr + ' · ' : '') + g.title, s.line + (s.right ? ' · ' + s.right : ''), s.text].filter(Boolean).join('\n') + (g.moves.length ? '\nMoved by: ' + g.moves.map((m) => m.title).join(', ') : '');
|
|
544
566
|
}
|
|
545
567
|
const goalLink = (g) => new URL(setQ({ goal: g.id, tab: null }), location.href).href;
|
|
546
568
|
function copyText(text, said) { try { navigator.clipboard.writeText(text).then(() => toast(said), () => toast('This browser did not allow the copy.')); } catch { toast('This browser did not allow the copy.'); } }
|
|
569
|
+
let ovCss = false;
|
|
547
570
|
function openGoalDetail(id, open0) {
|
|
548
571
|
let g = goalById(id); if (!g) return;
|
|
572
|
+
if (!ovCss) { ovCss = true; const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = '/pm/ov-view.css'; document.head.append(l); } // the where row Moved by shares
|
|
549
573
|
const own = goalWs(g) === M.board.ws, st = { open: open0 || '', more: false, adding: false, own };
|
|
550
574
|
const kr = krId(g);
|
|
551
|
-
const more = [];
|
|
552
|
-
if (own &&
|
|
575
|
+
const more = [], stepsGoal = g.type === 'Done or not' && g.steps && g.steps.length;
|
|
576
|
+
if (own && !stepsGoal) more.push({ label: 'Add a reading', on: () => { const el = window.czViewer && window.czViewer.body(); st.adding = true; if (el) { el.innerHTML = goalBodyHtml(g, st); const f = el.querySelector('[data-rdf] [name="v"]'); if (f) f.focus(); } } });
|
|
577
|
+
if (own && M.goals.some((x) => x.id === g.id)) more.push({ label: 'Edit chart', on: () => openChartEdit(g.id) });
|
|
578
|
+
if (more.length) more.push({ sep: true });
|
|
553
579
|
more.push({ label: 'Copy link', on: () => copyText(goalLink(g), 'Link copied.') }, { label: 'Copy as text', on: () => copyText(goalText(g), 'Copied as text.') });
|
|
554
580
|
const body = vwOpen({ kind: 'Goal', title: (kr ? kr + ' · ' : '') + g.title, icon: 'goal', id: 'goal:' + id, more,
|
|
555
581
|
discuss: true,
|
|
@@ -595,7 +621,7 @@ function openGoalDetail(id, open0) {
|
|
|
595
621
|
/** The fallback with no Viewer: the goal's summary and rows in the page's side panel. */
|
|
596
622
|
function openGoalSide(g, st) {
|
|
597
623
|
openSide({ kind: 'view', eye: 'Goal', title: g.title, body: '', note: '', go: null });
|
|
598
|
-
const sum = goalSummary(g
|
|
624
|
+
const sum = goalSummary(g);
|
|
599
625
|
$('#sideBody').innerHTML = `<div class="ins-gd"><div class="ins-gh"><p class="ins-gsub">${esc(sum.line)}</p>${sum.text ? `<p class="note">${esc(sum.text)}</p>` : ''}</div>${readingsHtml(g, st)}${movedHtml(g)}</div>`;
|
|
600
626
|
}
|
|
601
627
|
/* a health budget in the same shell: its reading is its share of the board's open initiatives against its cap; what moves it is the work anchored to it */
|