create-pmos 0.630.0 → 0.632.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 +27 -33
- 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/state/discoveries.md +1 -1
- package/workspace/changelog.json +26 -0
- package/workspace/guide/cli.md +2 -0
- package/workspace/guide/jira.md +13 -0
- package/workspace/guide/notes.md +7 -3
- package/workspace/lib/engine/boards.js +16 -0
- package/workspace/lib/extension-cli.js +4 -1
- package/workspace/lib/extension-setup.js +93 -0
- package/workspace/lib/jira-cli.js +23 -2
- package/workspace/lib/jira-status.js +64 -20
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-backlog.js +34 -4
- package/workspace/lib/routes-boards.js +4 -1
- package/workspace/lib/routes-extension.js +23 -0
- package/workspace/lib/routes-sources.js +8 -1
- package/workspace/lib/sprint-history.js +294 -0
- package/workspace/lib/sprint-overview.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-backlog.css +38 -0
- package/workspace/public/pm/bd-backlog.js +7 -5
- package/workspace/public/pm/bd-sprint.js +174 -7
- package/workspace/public/pm/bk-sprint.js +42 -0
- package/workspace/public/pm/cozy-buddy.js +2 -0
- package/workspace/public/pm/cozy-ext.js +76 -0
- package/workspace/public/pm/cozy-settings.js +6 -2
- package/workspace/skills/jira-sync.skill +4 -3
- package/workspace/test-lists/meeting-buddy.json +1 -1
|
@@ -11,12 +11,19 @@
|
|
|
11
11
|
* writes over an edit and offers a newer draft with a yes and a no instead (POST /api/backlog/sprint-note).
|
|
12
12
|
* · ✦ proposals with ✓ and ✕: link sub-tasks to the initiative their parent is in, place a theme's tickets in an initiative of the same
|
|
13
13
|
* name, make a home for a theme. Nothing applies without the ✓; every ✓ and ✕ comes with Undo.
|
|
14
|
-
*
|
|
14
|
+
* · Past sprints (initiative sprint-snapshots; boards SpH1 to SpH3): the sprint's name is a picker. The current sprint first, then the
|
|
15
|
+
* past ones newest first, each with its dates and "N of M done", older ones folded; a sprint PMOS never kept says why. Under the list,
|
|
16
|
+
* one ✦ line on the carried-over work and its bars. A past sprint shows frozen (SpH2): the snapshot mark, done of total, carried to
|
|
17
|
+
* which sprint, points, the goal result, its themes, What happened (PMOS-written, editable) and Lessons (the PM's), and the list below is
|
|
18
|
+
* that sprint's tickets with their state at close. A sprint PMOS never saw (SpH3) says so once, with an icon to read it from Jira now.
|
|
19
|
+
* pm/bd-backlog.js calls bandHtml() while the chip is on, themeOf() for the list, pastOn()/pastListHtml() for a past sprint's list, and
|
|
20
|
+
* press() first on each press in the Backlog. */
|
|
15
21
|
import * as SK from './bk-sprint.js';
|
|
16
22
|
|
|
17
23
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
18
24
|
const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
19
|
-
const I = { ok: 'M5 12.5l4.5 4.5L19 7', x: 'M6 6l12 12M18 6L6 18', pen: 'M4 20h4L19 9l-4-4L4 16z', read: 'M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7'
|
|
25
|
+
const I = { ok: 'M5 12.5l4.5 4.5L19 7', x: 'M6 6l12 12M18 6L6 18', pen: 'M4 20h4L19 9l-4-4L4 16z', read: 'M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7',
|
|
26
|
+
down: 'M7 10l5 5 5-5', chev: 'M10 7l5 5-5 5', lock: 'M7 11V8a5 5 0 0 1 10 0v3M6 11h12v9H6z', jira: 'M12 3l9 9-9 9-9-9z M12 8l4 4-4 4-4-4z' };
|
|
20
27
|
const SPARK = '✦';
|
|
21
28
|
const OLD_MS = 36 * 3600000; // the Board's own line for an old Jira read (pm/premium-board.js jMood)
|
|
22
29
|
const MON3 = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
@@ -26,6 +33,14 @@ let PICK = ''; // the sprint shown (its id), when there are more than o
|
|
|
26
33
|
let THEME = ''; // the theme pressed (its id): the list below shows only its tickets
|
|
27
34
|
let EDIT = ''; // the block being edited
|
|
28
35
|
let CUR = null; // what the band drew last: { sp, themes, draft, props }
|
|
36
|
+
let PAST = ''; // the past sprint shown (its name), '' for the current one
|
|
37
|
+
let MENU = false; // the sprint picker is open
|
|
38
|
+
let OLDER = false; // the picker shows the older sprints too
|
|
39
|
+
let PMORE = false; // the past sprint's done rows are all shown
|
|
40
|
+
let CURP = null; // the past sprint drawn last: { H, x (its picker entry), d (its detail) }
|
|
41
|
+
const DET = new Map(); // 'ws|board|name' → { state: pending|ready|failed, d }
|
|
42
|
+
const FILLING = new Set(); // sprints being read from Jira now (SpH3)
|
|
43
|
+
const SHOWN = 8; // past sprints the picker shows before "N older sprints"
|
|
29
44
|
const DR = new Map(); // sprint id → { sig, state: pending|ready|failed, d, again }
|
|
30
45
|
|
|
31
46
|
const sigOf = (T) => T.map((t) => t.key + (SK.isMoving(t) ? 'm' : 't')).sort().join(',');
|
|
@@ -54,7 +69,13 @@ function ask(sp, deps) {
|
|
|
54
69
|
* no sprint is active. */
|
|
55
70
|
export function bandHtml(o, deps) {
|
|
56
71
|
const S = SK.sprintsOf(o.tasks);
|
|
57
|
-
|
|
72
|
+
const H = histOf(o, S);
|
|
73
|
+
const past = H ? H.list.filter((x) => x.state === 'closed') : [];
|
|
74
|
+
if (!S.length && !past.length) { CUR = null; CURP = null; return ''; }
|
|
75
|
+
if (PAST && !past.some((x) => x.name === PAST)) PAST = '';
|
|
76
|
+
if (!S.length && !PAST) PAST = (past.find((x) => x.kept !== 'none') || past[0]).name;
|
|
77
|
+
if (PAST) { CUR = null; return pastHtml(o, H, past.find((x) => x.name === PAST), deps); }
|
|
78
|
+
CURP = null;
|
|
58
79
|
const sp = S.find((x) => x.id === PICK) || S[0];
|
|
59
80
|
const T = sp.tasks, st = SK.statsOf(T);
|
|
60
81
|
const dr = ask(sp, deps);
|
|
@@ -71,7 +92,7 @@ export function bandHtml(o, deps) {
|
|
|
71
92
|
const read = `Jira says active${o.readAt ? ' · last read ' + dayOf(o.readAt) : ''}`;
|
|
72
93
|
const pick = S.length > 1 ? `<div class="sbo-pick" role="group" aria-label="Sprint">${S.map((x) => `<button type="button" class="bk-chip${x.id === sp.id ? ' on' : ''}" data-sppick="${esc(x.id)}" aria-pressed="${x.id === sp.id}">${esc(x.label)}<span class="k">${x.tasks.length}</span></button>`).join('')}</div>` : '';
|
|
73
94
|
const tail = [st.todo ? st.todo + ' to do' : '', st.homeless ? `${st.homeless} of ${st.all} ${st.homeless === 1 ? 'is' : 'are'} in no initiative` : ''].filter(Boolean).join(' · ');
|
|
74
|
-
const sum = `<div class="sbo-sum">${pick}<div class="sbo-h"
|
|
95
|
+
const sum = `<div class="sbo-sum">${pick}<div class="sbo-h">${H && past.length ? pickerHtml(H, sp.name, sp.label) : `<b title="${esc(sp.name)}">${esc(sp.label)}</b>`}<button type="button" class="bk-ib" data-spread aria-label="Read Jira again" title="Read Jira again">${SV(I.read)}</button></div>`
|
|
75
96
|
+ `<p class="sbo-meta">${old ? '<i class="bk-dot amber"></i>' : ''}${esc(read)}</p>`
|
|
76
97
|
+ `<p class="sbo-big"><b>${st.moving} of ${st.all}</b> <span>moving</span></p><div class="sbo-bar" aria-hidden="true"><s style="width:${pct(st.moving, st.all)}%"></s></div>`
|
|
77
98
|
+ (tail ? `<p class="sbo-meta">${esc(tail)}</p>` : '') + '</div>';
|
|
@@ -99,9 +120,126 @@ function blockHtml(k, draft, note, st) {
|
|
|
99
120
|
return `<div class="sbo-b">${head}${ul}${foot}</div>`;
|
|
100
121
|
}
|
|
101
122
|
|
|
123
|
+
/* ── past sprints (initiative sprint-snapshots) ───────────────────────────────────────────────────────────── */
|
|
124
|
+
/** The sprint list of the product the band is about: the current sprint's, else the first with a past sprint. */
|
|
125
|
+
function histOf(o, S) {
|
|
126
|
+
const L = (o.hist || []).filter((h) => h && Array.isArray(h.list) && h.list.length);
|
|
127
|
+
if (!L.length) return null;
|
|
128
|
+
const sp = S.find((x) => x.id === PICK) || S[0];
|
|
129
|
+
return (sp && L.find((h) => h.ws === sp.ws && h.board === sp.board)) || L[0];
|
|
130
|
+
}
|
|
131
|
+
/** The sprint's name as a picker (SpH1): the button, and the list while it is open. */
|
|
132
|
+
function pickerHtml(H, cur, label) {
|
|
133
|
+
const btn = `<button type="button" class="sbo-pk" data-spmenu aria-haspopup="listbox" aria-expanded="${MENU}" title="${esc(cur)}">${esc(label)}${SV(I.down)}</button>`;
|
|
134
|
+
if (!MENU) return `<span class="sbo-pw">${btn}</span>`;
|
|
135
|
+
const now = H.list.filter((x) => x.state !== 'closed'), past = H.list.filter((x) => x.state === 'closed');
|
|
136
|
+
const shown = OLDER ? past : past.slice(0, SHOWN), older = past.length - shown.length;
|
|
137
|
+
const row = (x) => {
|
|
138
|
+
const r = SK.pickRowOf(x), on = x.name === cur;
|
|
139
|
+
const mid = r.total ? `<span class="sbo-bar" aria-hidden="true"><s style="width:${r.pct}%"></s></span>` : `<span class="sbo-mq">${esc(r.right)}</span>`;
|
|
140
|
+
return `<button type="button" class="sbo-mi${on ? ' on' : ''}" role="option" aria-selected="${on}" data-spgo="${esc(x.name)}" title="${esc(x.name)}">`
|
|
141
|
+
+ `<b>${esc(r.label)}</b><span class="sbo-mw">${esc(r.when)}</span>${r.total ? mid + `<span class="sbo-mr">${esc(r.right)}</span>` : x.state === 'active' ? `<span class="sbo-mq">${esc(r.right)}</span>` : mid}</button>`;
|
|
142
|
+
};
|
|
143
|
+
const fold = older ? `<button type="button" class="sbo-mo" data-spolder>${SV(I.chev)}${older} older ${older === 1 ? 'sprint' : 'sprints'}, back to ${esc(SK.labelOf(past[past.length - 1].name))}</button>` : '';
|
|
144
|
+
const T = H.trend, max = T ? Math.max(1, ...T.bars.map((b) => b.carried)) : 1;
|
|
145
|
+
const tr = T ? `<div class="sbo-tr">${T.line ? `<p class="sbo-meta"><span class="sbo-s" aria-hidden="true">${SPARK}</span> ${esc(T.line.replace(/MAD |\(([^)]*)\)/g, (m, g) => (g ? '(' + SK.labelOf(g) + ')' : '')))}</p>` : ''}`
|
|
146
|
+
+ `<div class="sbo-bars" role="img" aria-label="${esc('Tickets carried to the next sprint: ' + T.bars.map((b) => SK.labelOf(b.name) + ' ' + b.carried).join(', '))}">`
|
|
147
|
+
+ T.bars.map((b) => `<span class="sbo-bc" title="${esc(SK.labelOf(b.name) + ': ' + b.carried + ' carried')}"><i style="height:${Math.max(b.carried ? 4 : 0, Math.round((b.carried / max) * 56))}px"></i><em>${esc((/(\d+)\s*$/.exec(b.name) || [, SK.labelOf(b.name)])[1])}</em></span>`).join('')
|
|
148
|
+
+ '</div></div>' : '';
|
|
149
|
+
return `<span class="sbo-pw">${btn}<div class="sbo-menu" role="listbox" aria-label="Sprints">${now.map(row).join('')}${shown.map(row).join('')}${fold}${tr}</div></span>`;
|
|
150
|
+
}
|
|
151
|
+
/** One past sprint, read once from the server and kept while the page is open. */
|
|
152
|
+
function detailOf(H, name, deps) {
|
|
153
|
+
const k = H.ws + '|' + H.board + '|' + name, have = DET.get(k);
|
|
154
|
+
if (have) return have;
|
|
155
|
+
const e = { state: 'pending', d: null };
|
|
156
|
+
DET.set(k, e);
|
|
157
|
+
(async () => {
|
|
158
|
+
let r = null;
|
|
159
|
+
try { const res = await fetch('/api/backlog/sprint?ws=' + encodeURIComponent(H.ws) + '&board=' + encodeURIComponent(H.board) + '&sprint=' + encodeURIComponent(name), { credentials: 'same-origin' }); r = await res.json(); } catch { r = null; }
|
|
160
|
+
if (r && r.ok && r.sprint) { e.state = 'ready'; e.d = r.sprint; } else e.state = 'failed';
|
|
161
|
+
if (DET.get(k) === e && PAST === name && !EDIT) deps.draw();
|
|
162
|
+
})();
|
|
163
|
+
return e;
|
|
164
|
+
}
|
|
165
|
+
const linesOf = (note) => (note && note.text ? note.text.split('\n').map((t) => t.trim()).filter(Boolean) : []);
|
|
166
|
+
const ulOf = (L, cls = '') => (L.length ? `<ul${cls ? ` class="${cls}"` : ''}>${L.map((t) => `<li><span>${esc(t)}</span></li>`).join('')}</ul>` : '');
|
|
167
|
+
/** A past sprint's band: frozen (SpH2), or never seen (SpH3). */
|
|
168
|
+
function pastHtml(o, H, x, deps) {
|
|
169
|
+
const note = ((o.notes || {})[H.ws + '|' + H.board] || {})[x.name] || {};
|
|
170
|
+
const head = `<div class="sbo-h">${pickerHtml(H, x.name, SK.labelOf(x.name))}</div>`;
|
|
171
|
+
if (x.kept === 'none') {
|
|
172
|
+
CURP = { H, x, d: null, note };
|
|
173
|
+
const filling = FILLING.has(H.ws + '|' + H.board + '|' + x.name);
|
|
174
|
+
const mine = ['goals', 'next'].filter((k) => note[k]);
|
|
175
|
+
const at = mine.map((k) => note[k].at).filter(Boolean).sort().pop();
|
|
176
|
+
const cols = mine.map((k) => `<div class="sbo-b"><h4>${k === 'goals' ? 'Your sprint goals' : 'Your planned next'}</h4>${ulOf(linesOf(note[k]))}</div>`).join('');
|
|
177
|
+
return `<section class="sbo-band sbo-past" aria-label="${esc(SK.labelOf(x.name))}, not kept">${head.replace('</div>', `<span class="sbo-meta">closed · no snapshot</span></div>`)}`
|
|
178
|
+
+ `<div class="sbo-warn" role="note"><p>${esc(filling ? 'PMOS is reading this sprint from Jira. Its snapshot shows here when the read lands.' : SK.neverLineOf(x.why))}</p>`
|
|
179
|
+
+ (filling ? '' : `<button type="button" class="bk-ib" data-spfill aria-label="Read this sprint from Jira now and keep it" title="Read it from Jira now and keep it">${SV(I.read)}</button>`) + '</div>'
|
|
180
|
+
+ (cols ? `<div class="sbo-pl sbo-two">${cols}</div>${at ? `<p class="sbo-meta">Edited by you on ${esc(SK.dayOf(at))}</p>` : ''}` : '') + '</section>';
|
|
181
|
+
}
|
|
182
|
+
const e = detailOf(H, x.name, deps), d = e.d;
|
|
183
|
+
CURP = { H, x, d, note };
|
|
184
|
+
const meta = [SK.datesOf(x.start, x.end), 'closed', x.keptAt ? 'kept ' + SK.dayOf(x.keptAt) : ''].filter(Boolean).join(' · ');
|
|
185
|
+
const to = x.carriedTo ? SK.labelOf(x.carriedTo) : 'the next sprint';
|
|
186
|
+
const tail = [x.carried ? `${x.carried} carried to ${to}` : '', x.carriedIn ? `${x.carriedIn} carried in` : '', x.points ? `${x.points.done} of ${x.points.total} points` : ''].filter(Boolean).join(' · ');
|
|
187
|
+
const hit = x.hit && SK.HIT[x.hit] ? `<p class="sbo-goal"><i class="bk-dot ${SK.HIT[x.hit][1]}"></i>${esc(SK.HIT[x.hit][0])}</p>` : '';
|
|
188
|
+
const pct = x.total ? Math.round((x.done / x.total) * 1000) / 10 : 0;
|
|
189
|
+
const sum = `<div class="sbo-sum">${head}<p class="sbo-meta"><span class="sbo-lk">${SV(I.lock)}Snapshot</span> ${esc(meta)}</p>`
|
|
190
|
+
+ `<p class="sbo-big"><b>${x.done} of ${x.total}</b> <span>done</span></p><div class="sbo-bar" aria-hidden="true"><s style="width:${pct}%"></s></div>`
|
|
191
|
+
+ (tail ? `<p class="sbo-meta">${esc(tail)}</p>` : '') + hit + '</div>';
|
|
192
|
+
const TH = d ? d.themes || [] : [];
|
|
193
|
+
if (THEME && !TH.some((t, i) => 'p' + i === THEME && t.keys.length)) THEME = '';
|
|
194
|
+
const th = !d ? `<div class="sbo-th"><p class="sbo-meta">${e.state === 'failed' ? 'The snapshot could not be read. Try again in a moment.' : 'Reading the snapshot…'}</p></div>`
|
|
195
|
+
: TH.length ? `<div class="sbo-th"><p class="sbo-meta"><span class="sbo-s">${SPARK}</span> Themes as they were at close.${TH.some((t) => t.keys.length) ? ' Press one to list its tickets below.' : ''}</p><div class="sbo-thl">`
|
|
196
|
+
+ TH.map((t, i) => { const tag = t.keys.length ? 'button' : 'div', id = 'p' + i, on = THEME === id;
|
|
197
|
+
return `<${tag}${tag === 'button' ? ` type="button" data-sptheme="${id}" aria-pressed="${on}"` : ''} class="sbo-t${on ? ' on' : ''}${tag === 'div' ? ' st' : ''}" title="${esc(t.title)}: ${t.done} of ${t.tickets} done">`
|
|
198
|
+
+ `<b>${esc(t.title)}</b><span class="sbo-bar" aria-hidden="true"><s style="width:${t.tickets ? Math.round((t.done / t.tickets) * 1000) / 10 : 0}%"></s></span><span class="c">${t.done} of ${t.tickets}</span></${tag}>`; }).join('') + '</div></div>'
|
|
199
|
+
: '<div class="sbo-th"></div>';
|
|
200
|
+
const happened = note.happened ? linesOf(note.happened) : d ? d.happened || [] : [];
|
|
201
|
+
const lessons = linesOf(note.lessons);
|
|
202
|
+
const pblock = (k, title, L, spark, empty) => {
|
|
203
|
+
const h = `<h4>${spark ? `<span class="sbo-s" aria-hidden="true">${SPARK}</span>` : ''}${title}<button type="button" class="bk-ib" data-sppedit="${k}" aria-label="Edit ${title}" title="Edit">${SV(I.pen)}</button></h4>`;
|
|
204
|
+
if (EDIT === k) return `<div class="sbo-b">${h}<textarea class="sbo-ta" data-spta="${k}" rows="${Math.max(3, L.length + 1)}" aria-label="${title}, one point a line">${esc(L.join('\n'))}</textarea>`
|
|
205
|
+
+ `<div class="sbo-ed"><button type="button" class="bk-ib ok" data-sppsave="${k}" aria-label="Save ${title}" title="Save">${SV(I.ok)}</button><button type="button" class="bk-ib" data-spcancel aria-label="Cancel" title="Cancel">${SV(I.x)}</button></div></div>`;
|
|
206
|
+
return `<div class="sbo-b">${h}${L.length ? ulOf(L) : `<ul class="q"><li><span>${esc(empty)}</span></li></ul>`}</div>`;
|
|
207
|
+
};
|
|
208
|
+
const carriedCol = x.carried ? `<div class="sbo-b"><h4>Carried to ${esc(to)}</h4><ul><li><span>${x.carried} open ${x.carried === 1 ? 'ticket' : 'tickets'}</span>`
|
|
209
|
+
+ (x.carriedTo && H.list.some((y) => y.name === x.carriedTo) ? `<button type="button" class="bk-lnk" data-spgo="${esc(x.carriedTo)}">open ${esc(to)}</button>` : '') + '</li></ul></div>' : '';
|
|
210
|
+
const pl = `<div class="sbo-pl">${pblock('happened', 'What happened', happened, !note.happened, 'PMOS writes this when the sprint closes.')}${carriedCol}${pblock('lessons', 'Lessons', lessons, false, 'Add what the team learned. Kept with the snapshot.')}</div>`;
|
|
211
|
+
return `<section class="sbo-band sbo-past" aria-label="${esc(SK.labelOf(x.name))}, snapshot"><div class="sbo-top">${sum}${th}</div>${pl}</section>`;
|
|
212
|
+
}
|
|
213
|
+
/** True while the band shows a past sprint that has a snapshot: the list below is its tickets (pastListHtml). */
|
|
214
|
+
export const pastOn = () => !!(CURP && CURP.x.kept !== 'none');
|
|
215
|
+
/** The past sprint's tickets with their state at close (SpH2), in the Backlog's own table. '' while the snapshot is read. */
|
|
216
|
+
export function pastListHtml() {
|
|
217
|
+
if (!pastOn()) return '';
|
|
218
|
+
const d = CURP.d;
|
|
219
|
+
if (!d) return '';
|
|
220
|
+
const th = THEME && /^p\d+$/.test(THEME) ? (d.themes || [])[+THEME.slice(1)] : null;
|
|
221
|
+
const G = SK.pastGroupsOf(d, th ? new Set(th.keys) : null);
|
|
222
|
+
const as = CURP.x.keptAt ? 'as read on ' + SK.dayOf(CURP.x.keptAt) : '';
|
|
223
|
+
const cols = 'style="--bk-cols: 40px minmax(240px, 1fr) 104px minmax(80px, 160px) minmax(140px, 220px) 72px"';
|
|
224
|
+
const head = '<div class="bk-r bk-h" role="row"><span class="c-ck"></span><span class="c-n">Task</span><span class="c-jira">Jira ticket</span><span class="c-epic">Epic</span><span class="c-state">State at close</span><span class="c-a"></span></div>';
|
|
225
|
+
const row = (r) => `<div class="bk-r bk-i" role="row"><span class="c-ck"></span><span class="c-n bk-n"><i class="bk-ic" title="Task">${SV('M5 5h14v14H5z')}</i>`
|
|
226
|
+
+ (r.url ? `<a class="bk-t" href="${esc(r.url)}" target="_blank" rel="noopener" title="${esc(r.title)}">${esc(r.title)}</a>` : `<span class="bk-t" title="${esc(r.title)}">${esc(r.title)}</span>`) + '</span>'
|
|
227
|
+
+ `<span class="c-jira"><span class="bk-jk" title="Jira ticket ${esc(r.key)}">${SV(I.jira)}${esc(r.key)}</span></span>`
|
|
228
|
+
+ `<span class="c-epic">${r.epicName || r.epic ? `<span title="${esc(r.epicName || r.epic)}">${esc(r.epicName || r.epic)}</span>` : '<span class="q">No epic</span>'}</span>`
|
|
229
|
+
+ `<span class="c-state bk-s"><i class="bk-dot ${r.category === 'done' ? 'green' : r.category === 'doing' ? 'blue' : ''}"></i>${esc(r.status || (r.category === 'done' ? 'Done' : 'Open'))}</span><span class="c-a"></span></div>`;
|
|
230
|
+
const body = G.map((g, i) => {
|
|
231
|
+
const cut = g.k === 'done' && !PMORE && !th && g.rows.length > 6;
|
|
232
|
+
const R = cut ? g.rows.slice(0, 6) : g.rows;
|
|
233
|
+
return `<div class="bk-r bk-g open" role="row"><span class="bk-gt"><b>${esc(g.n)}</b><span class="k">${g.rows.length} kept</span></span>${i === 0 && as ? `<span class="bk-gs">${esc(as)}</span>` : ''}${th ? `<button type="button" class="bk-lnk" data-spall>Show all</button>` : ''}</div>`
|
|
234
|
+
+ R.map(row).join('') + (cut ? `<button type="button" class="bk-r bk-more" data-sppmore>${SV(I.chev)}${g.rows.length - 6} more done ${g.rows.length - 6 === 1 ? 'ticket' : 'tickets'}</button>` : '');
|
|
235
|
+
}).join('') || '<p class="bk-none">PMOS kept no row of this sprint\'s tickets.</p>';
|
|
236
|
+
const miss = SK.missingLineOf(d.missing);
|
|
237
|
+
return `<div class="bk bk-past" role="table" aria-label="${esc(SK.labelOf(d.name))} at close" ${cols}>${head}${body}${miss && !th ? `<p class="sbo-miss" role="row">${esc(miss)}</p>` : ''}</div>`;
|
|
238
|
+
}
|
|
239
|
+
|
|
102
240
|
/** The theme pressed, for the list below: { name, uids: Set, total } | null. */
|
|
103
241
|
export function themeOf() {
|
|
104
|
-
if (!THEME || !CUR) return null;
|
|
242
|
+
if (!THEME || !CUR || CURP) return null;
|
|
105
243
|
const t = CUR.themes.find((x) => x.id === THEME);
|
|
106
244
|
return t ? { id: t.id, name: t.name, uids: new Set(t.uids), total: CUR.sp.tasks.length } : null;
|
|
107
245
|
}
|
|
@@ -112,7 +250,36 @@ export async function press(e, deps) {
|
|
|
112
250
|
const t0 = e.target;
|
|
113
251
|
const hit = (a) => t0.closest('[' + a + ']');
|
|
114
252
|
let b;
|
|
115
|
-
if ((b = hit('data-sppick'))) { PICK = b.dataset.sppick; THEME = ''; EDIT = ''; deps.draw(); return true; }
|
|
253
|
+
if ((b = hit('data-sppick'))) { PICK = b.dataset.sppick; PAST = ''; THEME = ''; EDIT = ''; deps.draw(); return true; }
|
|
254
|
+
if (hit('data-spmenu')) { MENU = !MENU; deps.draw(); const f = document.querySelector('.sbo-mi.on, .sbo-mi'); if (MENU && f) f.focus(); return true; }
|
|
255
|
+
if (hit('data-spolder')) { OLDER = true; deps.draw(); return true; }
|
|
256
|
+
if ((b = hit('data-spgo'))) {
|
|
257
|
+
const name = b.dataset.spgo, act = SK.sprintsOf(deps.tasks ? deps.tasks() : []).find((x) => x.name === name);
|
|
258
|
+
MENU = false; THEME = ''; EDIT = ''; PMORE = false;
|
|
259
|
+
if (act) { PICK = act.id; PAST = ''; } else PAST = name;
|
|
260
|
+
deps.draw(); const k = document.querySelector('[data-spmenu]'); if (k) k.focus(); return true;
|
|
261
|
+
}
|
|
262
|
+
if (hit('data-sppmore')) { PMORE = true; deps.draw(); return true; }
|
|
263
|
+
if (hit('data-spcancel')) { EDIT = ''; deps.draw(); return true; }
|
|
264
|
+
if (CURP && hit('data-spfill')) {
|
|
265
|
+
const { H, x } = CURP, k = H.ws + '|' + H.board + '|' + x.name;
|
|
266
|
+
const r = await deps.post('/api/sources/refresh', { ws: H.ws, source: 'jira', sprint: x.name });
|
|
267
|
+
if (!r || r.ok === false) { deps.say('PMOS could not start the read: ' + ((r && r.error) || 'the server did not answer') + '.'); return true; }
|
|
268
|
+
FILLING.add(k); deps.say('Reading ' + SK.labelOf(x.name) + ' from Jira. Its snapshot shows here when the read lands.'); deps.draw();
|
|
269
|
+
for (const ms of [60000, 150000, 300000]) setTimeout(() => { DET.delete(k); deps.load(); }, ms);
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
272
|
+
if (CURP && (b = hit('data-sppedit'))) { EDIT = EDIT === b.dataset.sppedit ? '' : b.dataset.sppedit; deps.draw(); const ta = document.querySelector('[data-spta]'); if (ta) ta.focus(); return true; }
|
|
273
|
+
if (CURP && (b = hit('data-sppsave'))) {
|
|
274
|
+
const k = b.dataset.sppsave, ta = document.querySelector(`[data-spta="${k}"]`), words = ta ? ta.value.trim() : '';
|
|
275
|
+
const at = { ws: CURP.H.ws, board: CURP.H.board, sprint: CURP.x.name }, was = CURP.note[k] || null;
|
|
276
|
+
const r = await deps.post('/api/backlog/sprint-note', words ? { ...at, ev: 'note', block: k, text: words, base: '' } : { ...at, ev: 'clear', block: k });
|
|
277
|
+
if (!r || r.ok === false) { deps.say((r && r.error) || 'The edit was not saved.'); return true; }
|
|
278
|
+
EDIT = '';
|
|
279
|
+
const title = k === 'lessons' ? 'Lessons' : 'What happened';
|
|
280
|
+
deps.say(words ? title + ' saved with the snapshot.' : title + ': cleared.', () => back(deps, at, k, was));
|
|
281
|
+
await deps.load(); return true;
|
|
282
|
+
}
|
|
116
283
|
if ((b = hit('data-sptheme'))) {
|
|
117
284
|
const id = b.dataset.sptheme; THEME = THEME === id ? '' : id; deps.draw();
|
|
118
285
|
const n = document.querySelector(`[data-sptheme="${CSS.escape(id)}"]`); if (n) n.focus();
|
|
@@ -124,10 +291,10 @@ export async function press(e, deps) {
|
|
|
124
291
|
if (deps.readJira) await deps.readJira(); else deps.load();
|
|
125
292
|
return true;
|
|
126
293
|
}
|
|
294
|
+
if (MENU && !hit('data-spmenu') && !t0.closest('.sbo-menu')) { MENU = false; deps.draw(); return true; }
|
|
127
295
|
if (!CUR) return false;
|
|
128
296
|
const sp = CUR.sp, at = { ws: sp.ws, board: sp.board, sprint: sp.name };
|
|
129
297
|
if ((b = hit('data-spedit'))) { EDIT = EDIT === b.dataset.spedit ? '' : b.dataset.spedit; deps.draw(); const ta = document.querySelector('[data-spta]'); if (ta) ta.focus(); return true; }
|
|
130
|
-
if (hit('data-spcancel')) { EDIT = ''; deps.draw(); return true; }
|
|
131
298
|
if ((b = hit('data-spsave'))) {
|
|
132
299
|
const k = b.dataset.spsave, ta = document.querySelector(`[data-spta="${k}"]`), words = ta ? ta.value.trim() : '';
|
|
133
300
|
const base = SK.hashOf(SK.textOf(CUR.draft[k]));
|
|
@@ -274,3 +274,45 @@ export function fromDraft(tasks, d) {
|
|
|
274
274
|
const goals = (d.goals || []).map((g) => ({ text: String(g) })).filter((g) => g.text);
|
|
275
275
|
return { themes: TH, draft: { goals, doing, next, nDoing: doing.reduce((s, x) => s + x.n, 0), nNext: next.reduce((s, x) => s + x.n, 0) } };
|
|
276
276
|
}
|
|
277
|
+
|
|
278
|
+
/* ── past sprints (initiative sprint-snapshots; boards SpH1 to SpH3) ──────────────────────────────────────────── */
|
|
279
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
280
|
+
const dayParts = (s) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(s || '')); return m ? { y: +m[1], m: +m[2] - 1, d: +m[3] } : null; };
|
|
281
|
+
/** "3–16 Sep", "20 Aug–2 Sep", "16 Sep" (end only); '' when Jira gave no date. Never a guessed date. */
|
|
282
|
+
export function datesOf(start, end) {
|
|
283
|
+
const a = dayParts(start), z = dayParts(end);
|
|
284
|
+
if (a && z) return a.m === z.m && a.y === z.y ? `${a.d}–${z.d} ${MON[z.m]}` : `${a.d} ${MON[a.m]}–${z.d} ${MON[z.m]}`;
|
|
285
|
+
const one = z || a;
|
|
286
|
+
return one ? `${one.d} ${MON[one.m]}` : '';
|
|
287
|
+
}
|
|
288
|
+
/** "14 Oct" from an ISO time or day; '' when there is none. */
|
|
289
|
+
export function dayOf(iso) { const p = dayParts(iso); return p ? `${p.d} ${MON[p.m]}` : ''; }
|
|
290
|
+
export const HIT = { met: ['Goal met', 'green'], partly: ['Goal partly met', 'amber'], missed: ['Goal not met', 'red'] };
|
|
291
|
+
/** One picker row (SpH1): { label, when, done?, total?, pct?, right, quiet } */
|
|
292
|
+
export function pickRowOf(x) {
|
|
293
|
+
const label = labelOf(x.name);
|
|
294
|
+
if (x.state === 'active') return { label, when: 'now', right: x.tickets ? `${x.tickets} ${x.tickets === 1 ? 'ticket' : 'tickets'}` : '', quiet: false };
|
|
295
|
+
if (x.kept === 'none' || !x.total) return { label, when: 'not kept', right: x.why || '', quiet: true };
|
|
296
|
+
return { label, when: datesOf(x.start, x.end), done: x.done, total: x.total, pct: Math.round((x.done / x.total) * 1000) / 10, right: `${x.done} of ${x.total} done`, quiet: false };
|
|
297
|
+
}
|
|
298
|
+
/** The past sprint's list (SpH2): done rows, then carried, each with their state at close; a theme's keys narrow it. → [{ k, n, sub, rows }] */
|
|
299
|
+
export function pastGroupsOf(d, keys) {
|
|
300
|
+
const R = (d.rows || []).filter((r) => !keys || keys.has(r.key));
|
|
301
|
+
const done = R.filter((r) => r.category === 'done'), open = R.filter((r) => r.category !== 'done');
|
|
302
|
+
const to = d.carriedTo ? labelOf(d.carriedTo) : 'the next sprint';
|
|
303
|
+
const G = [];
|
|
304
|
+
if (done.length) G.push({ k: 'done', n: 'Done in ' + labelOf(d.name), rows: done });
|
|
305
|
+
if (open.length) G.push({ k: 'carried', n: 'Carried to ' + to, rows: open });
|
|
306
|
+
return G;
|
|
307
|
+
}
|
|
308
|
+
/** The one quiet row for rows the snapshot does not hold (old data): '' when none are missing. */
|
|
309
|
+
export function missingLineOf(m) {
|
|
310
|
+
if (!m || (!m.done && !m.carried)) return '';
|
|
311
|
+
const parts = [m.done ? `${m.done} done ${m.done === 1 ? 'ticket' : 'tickets'}` : '', m.carried ? `the ${m.carried} carried ${m.carried === 1 ? 'one' : 'ones'}` : ''].filter(Boolean);
|
|
312
|
+
return `${parts.join(' and ')} moved on before the snapshot, so their rows are not kept. From now on PMOS keeps every ticket a sprint held.`.replace(/^./, (c) => c.toUpperCase());
|
|
313
|
+
}
|
|
314
|
+
/** What the not-kept view says (SpH3). */
|
|
315
|
+
export function neverLineOf(why) {
|
|
316
|
+
return (why === 'only your notes are kept' ? 'PMOS never read this sprint\'s tickets from Jira while it was open, so it has no snapshot.' : 'This sprint opened and closed between two Jira reads, so PMOS never saw its tickets.')
|
|
317
|
+
+ ' PMOS can read them from Jira now and keep them as its snapshot.';
|
|
318
|
+
}
|
|
@@ -54,6 +54,8 @@ async function read() {
|
|
|
54
54
|
|
|
55
55
|
/** Which meeting this call is. With none that fits, today's meetings to pick from. */
|
|
56
56
|
async function find() {
|
|
57
|
+
// inside the Meet panel (the extension passes ?meet): tell Settings › Connectors › Google Meet that the panel works
|
|
58
|
+
if (q.has('meet') && window.top !== window) pmGet('/api/extension/seen').catch(() => {});
|
|
57
59
|
if (q.get('event')) { S.ev = { id: q.get('event') }; S.date = q.get('date') || ''; return read(); }
|
|
58
60
|
const r = await pmGet('/api/meeting-focus/now?meet=' + encodeURIComponent(q.get('meet') || '') + '&title=' + encodeURIComponent(q.get('mtitle') || ''));
|
|
59
61
|
if (r && r.ok) { S.ev = r.event; S.date = r.date; return read(); }
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* cozy-ext.js — Settings › Connectors › Google Meet: set up the PMOS panel over a Meet call from the workspace (initiative meeting-buddy;
|
|
2
|
+
* Wawan 2026-11-19: "I can't find the file. Make it easy, make the setup can be done on the workspace").
|
|
3
|
+
*
|
|
4
|
+
* One row: the panel over Google Meet, what it does now, and icon buttons. Set up copies the extension to ~/PMOS Chrome extension, shows
|
|
5
|
+
* it in Finder and opens Chrome's extensions page; the steps left for the PM (Developer mode, Load unpacked, pick the folder) show under
|
|
6
|
+
* the row. Chrome keeps that last press for the person: no page can load an extension.
|
|
7
|
+
*
|
|
8
|
+
* extState() -> a fresh state object for one Settings dialog
|
|
9
|
+
* extLoad(X) GET /api/extension
|
|
10
|
+
* extHtml(X) -> the Google Meet block
|
|
11
|
+
* extClick(e, X, redraw, toast) -> true when the press was this block's; runs it
|
|
12
|
+
* Routes: lib/routes-extension.js. UI copy says PMOS. */
|
|
13
|
+
import { pmGet, pmPost } from './http.js';
|
|
14
|
+
import { esc, svg } from './cozy-evui.js';
|
|
15
|
+
|
|
16
|
+
const SETUP = 'M12 4v11M7 10l5 5 5-5M5 20h14';
|
|
17
|
+
const COPY = 'M9 9h11v11H9zM5 15V5a1 1 0 0 1 1-1h10';
|
|
18
|
+
const STEPS = 'M9 6h11M9 12h11M9 18h11M4 6h.01M4 12h.01M4 18h.01';
|
|
19
|
+
const hm = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0') : ''; };
|
|
20
|
+
|
|
21
|
+
export function extState() { return { st: null, open: false, busy: false }; }
|
|
22
|
+
|
|
23
|
+
export async function extLoad(X) {
|
|
24
|
+
const r = await pmGet('/api/extension').catch(() => null);
|
|
25
|
+
X.st = r && r.ok ? r : { ok: false };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const ib = (act, icon, label) => `<button type="button" class="ev-ib" data-ext="${act}" aria-label="${esc(label)}" title="${esc(label)}">${svg(icon, 18)}</button>`;
|
|
29
|
+
|
|
30
|
+
/** What the row says now. Pure. */
|
|
31
|
+
export function extLine(st) {
|
|
32
|
+
if (!st || !st.ok) return 'PMOS could not read the extension’s state.';
|
|
33
|
+
if (st.seen) return 'Working · seen in a call at ' + hm(st.seen);
|
|
34
|
+
if (st.refreshed) return 'Updated. Press the reload arrow on the PMOS card in Chrome’s extensions page.';
|
|
35
|
+
if (st.copied) return 'Copied to the folder “PMOS Chrome extension” in your home folder. Load it once in Chrome.';
|
|
36
|
+
return 'Not set up. One press puts it in a folder you can find and opens Chrome’s extensions page.';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function extHtml(X) {
|
|
40
|
+
const st = X.st;
|
|
41
|
+
if (st === null) return '';
|
|
42
|
+
const head = '<h4 id="evMeet">Google Meet</h4>';
|
|
43
|
+
const on = !!(st.ok && st.seen);
|
|
44
|
+
const acts = st.ok ? (st.copied
|
|
45
|
+
? ib('steps', STEPS, X.open ? 'Hide the steps' : 'Show the steps') + ib('setup', SETUP, 'Open the folder and Chrome’s extensions page again')
|
|
46
|
+
: ib('setup', SETUP, 'Set up the PMOS panel for Google Meet')) : '';
|
|
47
|
+
const panel = X.open && st.ok ? `<div class="ev-rl-steps ev-small" data-ext-panel><ol>`
|
|
48
|
+
+ '<li>In Chrome’s extensions page, turn on Developer mode (top right).</li>'
|
|
49
|
+
+ '<li>Press Load unpacked.</li>'
|
|
50
|
+
+ '<li>Pick the folder “PMOS Chrome extension” in your home folder. Finder shows it.</li>'
|
|
51
|
+
+ '<li>Open a Google Meet call. The PMOS panel shows at the bottom right.</li></ol>'
|
|
52
|
+
+ `<div class="ev-rl-kv"><b>Folder</b><code>${esc(st.folder || '')}</code>${ib('copy', COPY, 'Copy the folder’s path')}</div>`
|
|
53
|
+
+ '<p class="ev-small ev-mut">If Load unpacked is greyed out, your company’s Chrome blocks extensions that are not in the Web Store.</p></div>' : '';
|
|
54
|
+
return `<div data-ext>${head}<p class="ev-small ev-mut">The PMOS panel shows over a Google Meet call. Only you see it.</p>`
|
|
55
|
+
+ `<div class="ev-trow ev-fr" data-ext-row><span class="ev-gut">${on ? '<i class="ev-dot ok" aria-hidden="true"></i>' : ''}</span><div class="ev-tx ev-grow"><span>PMOS in Google Meet</span><p class="ev-small ev-mut">${esc(extLine(st))}</p></div><span class="ev-rl-acts">${acts}</span></div>${panel}</div>`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export async function extClick(e, X, redraw, toast) {
|
|
59
|
+
const b = e.target.closest('[data-ext]'); if (!b) return false;
|
|
60
|
+
if (X.busy) return true;
|
|
61
|
+
const act = b.dataset.ext;
|
|
62
|
+
const say = (t) => { if (toast) toast(t); };
|
|
63
|
+
if (act === 'copy') {
|
|
64
|
+
try { await navigator.clipboard.writeText((X.st && X.st.folder) || ''); say('Path copied.'); } catch { say('Select the path and copy it by hand.'); }
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
if (act === 'steps') { X.open = !X.open; redraw(); return true; }
|
|
68
|
+
X.busy = true;
|
|
69
|
+
const r = await pmPost('/api/extension/setup', {}).catch(() => null);
|
|
70
|
+
X.busy = false;
|
|
71
|
+
if (!r || r.ok === false) { say((r && r.error) || 'Not done. Nothing changed.'); return true; }
|
|
72
|
+
X.open = true;
|
|
73
|
+
say(r.opened ? 'Finder shows the folder, and Chrome’s extensions page is open. Three presses left, listed under the row.' : 'The folder is ready. Open chrome://extensions in Chrome and follow the steps under the row.');
|
|
74
|
+
await extLoad(X); redraw();
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* › Dress for the day (adler.dress.*, canvas AsSet1, batch 18 item 8): the master switch, where you are, one switch per group,
|
|
20
20
|
* "More festivals" with one switch per day, big sports and your colours, exam season, your days, Wear now (pm/cozy-seasons.js).
|
|
21
21
|
* openSettings('dress') opens it straight away (the › in Adler's tap popover, AsSet2Tap).
|
|
22
|
-
* Connectors Listening at the end (event-relay, D110, pm/cozy-relay.js): GitHub and Jira can ring PMOS's doorbell. design A (batch 28 item 1, canvas CnA): one list, trouble first (GET /api/sources, pm/cozy-evmodel.js connectorRows). Each
|
|
22
|
+
* Connectors Google Meet above Listening (meeting-buddy, pm/cozy-ext.js): set up the Chrome extension from here. Listening at the end (event-relay, D110, pm/cozy-relay.js): GitHub and Jira can ring PMOS's doorbell. design A (batch 28 item 1, canvas CnA): one list, trouble first (GET /api/sources, pm/cozy-evmodel.js connectorRows). Each
|
|
23
23
|
* source says its status once, on its own row: a trouble row has the amber dot, one reason and one icon action (↻ POST
|
|
24
24
|
* /api/sources/refresh, or the place to fix it); a quiet row has its name and time, and "Checked 10:42 · same since 09:15"
|
|
25
25
|
* where a measured read applies (SrSee R3). Claude's failed background work and the Git sync failure are rows too. ↻ in the
|
|
@@ -59,7 +59,9 @@ import * as AD from './cozy-adler.js';
|
|
|
59
59
|
import * as SE from './cozy-seasons.js';
|
|
60
60
|
import { weeksOf, lineOf, storiesOf } from './upd-weeks.js';
|
|
61
61
|
import { relayState, relayLoad, relayHtml, relayClick } from './cozy-relay.js'; // event-relay (D110): Connectors › Listening
|
|
62
|
+
import { extState, extLoad, extHtml, extClick } from './cozy-ext.js'; // meeting-buddy: Connectors › Google Meet, the Chrome extension set up from here
|
|
62
63
|
const RL = relayState();
|
|
64
|
+
const XT = extState();
|
|
63
65
|
|
|
64
66
|
/** PUT or DELETE with the page's launch nonce (pressFetch). Only the key row needs them. */
|
|
65
67
|
async function pmSend(method, path, body) {
|
|
@@ -276,7 +278,7 @@ function connectors() {
|
|
|
276
278
|
const chips = `<div class="ev-cn-chips" role="group" aria-label="Category">${CD.CATS.map(([k, l]) => `<button type="button" class="ev-chip${T.cat === k ? ' on' : ''}" data-ev-ccat="${k}" aria-pressed="${T.cat === k}">${esc(l)}</button>`).join('')}</div>`;
|
|
277
279
|
return info + readsHtml() + propCards() + `<div class="ev-cn">${search}${chips}<div id="evConList">${connList()}</div>`
|
|
278
280
|
+ `<p class="ev-small ev-mut ev-cn-foot">PMOS keeps no passwords or keys. A connector is added in your Claude account: + opens that page, and PMOS notices when it is there.</p></div>`
|
|
279
|
-
+ relayHtml(RL);
|
|
281
|
+
+ extHtml(XT) + relayHtml(RL);
|
|
280
282
|
}
|
|
281
283
|
/** The directory's read; after a +, again every 5 s with the probe until the connector shows or 2 minutes pass. */
|
|
282
284
|
async function readDir(probe) {
|
|
@@ -590,6 +592,7 @@ async function press(e) {
|
|
|
590
592
|
if (t.dataset.evSec) { e.preventDefault(); const m = MOVED[t.dataset.evSec]; T.sec = m ? m[0] : t.dataset.evSec; T.sub = m ? m[1] : ''; T.msg = ''; T.dress = false; draw(); const f = T.el.querySelector(`[data-ev-sec="${T.sec}"]`); if (f) f.focus(); openCheck(); return; }
|
|
591
593
|
if ('evClose' in t.dataset) { closeSettings(); return; }
|
|
592
594
|
if (await relayClick(e, RL, draw, toast)) return;
|
|
595
|
+
if (await extClick(e, XT, draw, toast)) return;
|
|
593
596
|
if (t.dataset.evWk) { const k = t.dataset.evWk; if (T.wkOpen.has(k)) T.wkOpen.delete(k); else T.wkOpen.add(k); draw(); return; }
|
|
594
597
|
if ('evArc' in t.dataset) { T.arc = !T.arc; draw(); return; }
|
|
595
598
|
if ('evInfo' in t.dataset) { T.info = !T.info; draw(); return; }
|
|
@@ -728,6 +731,7 @@ async function readAgain(id) {
|
|
|
728
731
|
async function load() {
|
|
729
732
|
readFresh();
|
|
730
733
|
RL.st = null; RL.open = null; RL.steps = null; relayLoad(RL).then(draw).catch(() => {});
|
|
734
|
+
XT.st = null; XT.open = false; extLoad(XT).then(draw).catch(() => {});
|
|
731
735
|
SW.swLoad(draw);
|
|
732
736
|
pmGet('/api/autonomy/kinds').then((k) => { T.ck = k && k.ok ? k : { ok: false, error: (k && k.error) || '' }; draw(); }).catch(() => { T.ck = { ok: false }; draw(); });
|
|
733
737
|
pmGet('/api/artefacts/lessons').then((l) => { T.ls = l && l.ok ? l : null; draw(); }).catch(() => { T.ls = null; });
|
|
@@ -23,6 +23,7 @@ Rules that always hold:
|
|
|
23
23
|
|
|
24
24
|
Procedure:
|
|
25
25
|
0. Ask first, when the task names no initiative. Run `pmos refresh since jira`. If it says "read in full", go to step 1. If it says "ask first", note the number of minutes it prints. Run `pmos jira query` and `pmos jira query --sprints`, and run each search they print with ` AND updated >= -<minutes>m` added (put the search in brackets first), asking only for the key field and one result. If no search returns an issue, run `pmos refresh same jira`, finish with "Checked: no change in Jira in the last <minutes> minutes", and stop. If any search returns an issue, or a search fails, go to step 1 and read in full.
|
|
26
|
+
0a. One sprint, when the task names it ("This check: sprint …"): the PM asked PMOS to read a closed sprint it never saw. Run `pmos jira query --sprint "<the sprint's name>"`, run that search with the fields of step 2, fetch every page, save the result in the scratch folder in the shape of step 3, run `pmos jira sync --sprint "<the sprint's name>" --from <the file>`, finish with "Checked: <the sprint's name>, <N> tickets kept", and stop. Do nothing else in that run.
|
|
26
27
|
1. If the task names one initiative ("This check: initiative …"), check that one only: run `pmos jira query <initiative>`. Otherwise run `pmos jira query`: each line is an initiative id, a tab and the Jira search (JQL) to run for it. An initiative PMOS pushed no ticket for, but which is linked to Jira epics, gets a search for those epics and the issues under them. If no initiative has a ticket or an epic in Jira, say so in one line and stop.
|
|
27
28
|
2. For each initiative, run its search with the Jira search tool and the fields in rule 3, at most 50 issues per page. The sprint is a custom field named "Sprint" whose id differs per site (often `customfield_10020`, on some sites `customfield_10004`). If the first page comes back with no Sprint field, ask once for every field of one issue (`*all`), find the field whose value is a list of sprints (each with a name and a state), and ask for that id from then on. Story points are also a custom field, named "Story Points" or "Story point estimate" (often `customfield_10016`); ask for it by name. Fetch every page.
|
|
28
29
|
3. Save the result as JSON in the scratch folder, for example `<scratch>/jira-<initiative>.json`, as a list with one object per issue:
|
|
@@ -30,7 +31,7 @@ Procedure:
|
|
|
30
31
|
- `type`: the issue type's name, for example `Epic`, `Story`, `Task` or `Bug`.
|
|
31
32
|
- `parent`: the parent issue's key (the epic of a story), or `null`.
|
|
32
33
|
- `category`: the status category, `new`, `indeterminate` or `done`.
|
|
33
|
-
- `sprint`: Jira's sprint, as `{"id": "42", "name": "Sprint 42", "state": "active", "start": "2026-10-01", "end": "2026-10-14"}`. Copy `state` as Jira gives it: `"active"`, `"future"` (a planned sprint) or `"closed"`. Use `null` when the issue is in no sprint: never write a made-up sprint such as `"Future"` or `"Backlog"` for it. Copy `id`, `start`, `end`, `completed` (a closed sprint's completion date) and `goal` (the sprint goal, as Jira writes it) from Jira's sprint field; leave out any that Jira does not give.
|
|
34
|
+
- `sprint`: Jira's sprint, as `{"id": "42", "name": "Sprint 42", "state": "active", "start": "2026-10-01", "end": "2026-10-14"}`. Copy `state` as Jira gives it: `"active"`, `"future"` (a planned sprint) or `"closed"`. Use `null` when the issue is in no sprint: never write a made-up sprint such as `"Future"` or `"Backlog"` for it. Copy `id`, `start`, `end`, `completed` (a closed sprint's completion date) and `goal` (the sprint goal, as Jira writes it) from Jira's sprint field; leave out any that Jira does not give. When Jira's sprint field lists more than one sprint (a ticket carried from one sprint to the next), write `sprint` as the list of all of them, oldest first, each in that shape: PMOS keeps the ticket in every sprint it was in.
|
|
34
35
|
- `points`: the story points as a number, or `null` when none are set.
|
|
35
36
|
- `resolved`: the resolution date as `YYYY-MM-DD`, or `null` when the issue is not resolved.
|
|
36
37
|
- `subtasks`: `{"done": 2, "total": 5}`.
|
|
@@ -43,8 +44,8 @@ Procedure:
|
|
|
43
44
|
4b. Write each sprint's goal and summary, after step 4a. Run `pmos jira summary`. Each line is a sprint that needs one: its name, its state, its number of issues and Jira's goal. A closed sprint that is already summarised is listed as kept: do not write it again. If it prints "no sprint needs a summary", skip this step. For each listed sprint, read its issues in the sprint search result of step 4a and write:
|
|
44
45
|
- `goal`: `{"text": "<the goal>", "jira": "<Jira's goal, or null>"}`. Always write the goal yourself from the sprint's tickets, in one sentence of at most 240 characters: what the sprint delivers when its tickets are done, naming the two or three largest outcomes. Do not copy Jira's sprint goal: it is often empty, too broad or incomplete. Put Jira's own goal in `"jira"` only as a reference, exactly as Jira writes it.
|
|
45
46
|
- `summary`: two to four plain sentences on what the team is working on: what is done, what is moving, what is blocked. For a closed sprint, say if the goal was met and what moved to the next sprint.
|
|
46
|
-
- `themes`: one entry per group of related tickets, at most 8, largest first: `{"title", "line", "tickets", "done", "blocked", "people", "initiative"}`. Group by initiative when the tickets belong to one (the initiative id from step 1); put tickets with no initiative in one theme such as "Fixes and upkeep" with `"initiative": null`. `line` is one sentence; `people` is the assignees' first names, comma-separated.
|
|
47
|
-
- For a closed sprint, also `closed`: `{"done", "total", "carried", "carriedTo", "points"}` (`points` as "31 of 38" when the tickets have points), `hit`: `"met"`, `"partly"` or `"missed"` (was the goal delivered), and `got`: one sentence on what got in the way, or leave it out when nothing did.
|
|
47
|
+
- `themes`: one entry per group of related tickets, at most 8, largest first: `{"title", "line", "tickets", "done", "blocked", "people", "initiative"}`. Group by initiative when the tickets belong to one (the initiative id from step 1); put tickets with no initiative in one theme such as "Fixes and upkeep" with `"initiative": null`. `line` is one sentence; `people` is the assignees' first names, comma-separated. For a closed sprint, also give `keys`: the ticket keys in the theme.
|
|
48
|
+
- For a closed sprint, also `closed`: `{"done", "total", "carried", "carriedTo", "points"}`. When `pmos jira summary` prints "at close (PMOS's count)" for it, use those numbers: PMOS kept every ticket the sprint held, the ones carried in included, and its count replaces yours (`points` as "31 of 38" when the tickets have points), `hit`: `"met"`, `"partly"` or `"missed"` (was the goal delivered), and `got`: one sentence on what got in the way, or leave it out when nothing did.
|
|
48
49
|
- For the active sprint, also `brief`, the sprint brief the PM reads first. Write it for a product manager: what matters, what is stuck, and what to do about it. PMOS counts the points, the flow, the velocity and the forecast itself, so do not repeat those as a list.
|
|
49
50
|
- `health`: `"ok"` (on track), `"warn"` (at risk) or `"bad"` (off track), from the share of points done against the share of the sprint gone, the blocked tickets and the velocity of the closed sprints.
|
|
50
51
|
- `verdict`: two or three sentences on where the sprint stands: on track or not, about how much will carry over at the team's usual pace, and which part of the work is exposed.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "The meeting buddy and the one-press start (initiative meeting-buddy, done test T1-T6): lib/meeting-focus.js callLinkOf and the caught bullet ids, pm/buddy-core.js, the Meet panel's address, Today's play icon. Pure, node.",
|
|
2
|
+
"_comment": "The meeting buddy and the one-press start (initiative meeting-buddy, done test T1-T6): lib/meeting-focus.js callLinkOf and the caught bullet ids, pm/buddy-core.js, the Meet panel's address, Today's play icon; T7 the extension set up from Settings › Connectors › Google Meet (lib/extension-setup.js, pm/cozy-ext.js). Pure, node.",
|
|
3
3
|
"modules": [
|
|
4
4
|
"meeting-buddy.test.js"
|
|
5
5
|
],
|