create-pmos 0.325.0 → 0.326.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 +1 -1
- 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/guide/briefing-premium.md +9 -2
- package/workspace/lib/engine/boards.js +28 -1
- package/workspace/lib/routes-boards.js +2 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-vw-backlog-test.js +127 -0
- package/workspace/premium-vw-doc-test.js +3 -1
- package/workspace/premium-vw-rec-test.js +209 -0
- package/workspace/public/pm/premium-board.js +10 -0
- package/workspace/public/pm/premium-meeting.js +22 -1
- package/workspace/public/pm/premium-shell.js +8 -2
- package/workspace/public/pm/premium-vw-backlog.css +30 -0
- package/workspace/public/pm/premium-vw-backlog.js +91 -0
- package/workspace/public/pm/premium-vw-doc-model.js +3 -2
- package/workspace/public/pm/premium-vw-doc.css +1 -0
- package/workspace/public/pm/premium-vw-doc.js +7 -4
- package/workspace/public/pm/premium-vw-jira.js +3 -1
- package/workspace/public/pm/premium-vw-rec.css +75 -0
- package/workspace/public/pm/premium-vw-rec.js +257 -0
- package/workspace/test-files.json +2 -0
- package/workspace/test-lists/premium-viewer.json +4 -2
- package/workspace/test-lists/premium-vw-backlog.json +13 -0
|
@@ -388,6 +388,7 @@ export function mountMeeting(d) {
|
|
|
388
388
|
const ctx = { state: { wsId: d.ws() }, setState: bump, FIXTURE: ST.FIXTURE };
|
|
389
389
|
R = {
|
|
390
390
|
listen: (id) => V.listenNow(ctx, id), pause: () => V.pauseListening(ctx), listening: () => V.listeningId(), started: () => V.liveStarted(), banner: () => V.takeBanner(),
|
|
391
|
+
highlight: (id) => V.highlightNow(ctx, id), highlighting: () => V.highlightBusy(),
|
|
391
392
|
async stop(id) {
|
|
392
393
|
const one = await d.pmGet('/api/notes/one?id=' + encodeURIComponent(id)), note = one && one.ok ? one.note : null;
|
|
393
394
|
const { discardable } = await import('./note-dock.js');
|
|
@@ -406,6 +407,19 @@ export function mountMeeting(d) {
|
|
|
406
407
|
if (!made || made.ok !== true) return { ok: false, error: (made && made.error) || 'The note was not made.' };
|
|
407
408
|
return ctl.resume(made.note.id);
|
|
408
409
|
},
|
|
410
|
+
/** New in the Record control: an untitled note with no meeting, listened to at once (the console's recordNew). */
|
|
411
|
+
async fresh() {
|
|
412
|
+
if (HOLD || liveRows(NR).some((n) => n.state === 'recording')) return { ok: false, error: 'A meeting is recording. Pause or stop it first.' };
|
|
413
|
+
const made = await d.pmPost('/api/notes/new', { title: '' });
|
|
414
|
+
if (!made || made.ok !== true) return { ok: false, error: (made && made.error) || 'The note was not made.' };
|
|
415
|
+
const res = await ctl.resume(made.note.id); return res.ok ? { ok: true, id: made.note.id } : res;
|
|
416
|
+
},
|
|
417
|
+
/** Highlight: the last 30 seconds and the next ones, made into a highlight from the transcript when the window closes (the console's highlightNow). */
|
|
418
|
+
async highlight() {
|
|
419
|
+
if (!HOLD) return { ok: false, error: 'This page is not recording.' };
|
|
420
|
+
const rec = await recorder(); const ok = rec.highlight ? rec.highlight(HOLD.id) : false;
|
|
421
|
+
return ok === false ? { ok: false, error: 'The highlight was not started.' } : { ok: true };
|
|
422
|
+
},
|
|
409
423
|
async resume(id) {
|
|
410
424
|
const rec = await recorder(); const ok = await rec.listen(id);
|
|
411
425
|
await readNotes();
|
|
@@ -422,7 +436,14 @@ export function mountMeeting(d) {
|
|
|
422
436
|
return res && res.ok === true ? { ok: true } : { ok: false, error: (res && res.error) || 'The meeting was not stopped.' };
|
|
423
437
|
},
|
|
424
438
|
};
|
|
425
|
-
|
|
439
|
+
/** Today's meetings the Record menu lists: of today, not ended more than 10 minutes ago (recordable), from the week the card read. */
|
|
440
|
+
async function todayRows() {
|
|
441
|
+
if (!W || W.state !== 'ok') await readWeek();
|
|
442
|
+
return W && W.state === 'ok' ? W.days.flatMap((x) => x.rows).filter((r) => recordable(r)) : [];
|
|
443
|
+
}
|
|
444
|
+
window.__premiumRec = { pause: ctl.pause, resume: ctl.resume, stop: ctl.stop, record: ctl.record, fresh: ctl.fresh, highlight: ctl.highlight, today: todayRows,
|
|
445
|
+
highlighting: () => { const r = window.__premiumRecorder || R; return r && r.highlighting ? r.highlighting() : null; }, started: () => { const r = window.__premiumRecorder || R; return r ? r.started() : null; }, notes: () => NR,
|
|
446
|
+
note: (id) => NR.find((n) => n.id === id) || null, refresh: readNotes, open: (id) => openNote(id) };
|
|
426
447
|
/* Leaving the Briefing while it holds the recorder: the browser asks first, and if the PM leaves, the meeting is paused (it stays open for an hour) so the record never says "recording" for audio nobody is capturing. */
|
|
427
448
|
addEventListener('beforeunload', (e) => { if (HOLD) { e.preventDefault(); e.returnValue = ''; } });
|
|
428
449
|
addEventListener('pagehide', () => { if (HOLD) d.pmPost('/api/notes/pause', { id: HOLD.id }, { keepalive: true }); });
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { pmGet, pmPost } from './http.js';
|
|
3
3
|
import { recChipView, STOP_LINE } from './premium-meeting.js';
|
|
4
4
|
import { vwReset } from './premium-viewer.js';
|
|
5
|
+
import { chipActs, openLive, openFocus, mountRecord, HL_LINE } from './premium-vw-rec.js';
|
|
5
6
|
import { lineItems, behindOf, refreshTargets, whenRead } from './freshness-words.js';
|
|
6
7
|
export const $ = (s, r = document) => r.querySelector(s);
|
|
7
8
|
export const $$ = (s, r = document) => [...r.querySelectorAll(s)];
|
|
@@ -295,17 +296,21 @@ function mountRecChip(here) {
|
|
|
295
296
|
if (!v) { c.hidden = true; c.innerHTML = ''; ask = false; return; }
|
|
296
297
|
c.hidden = false; c.dataset.mode = v.mode;
|
|
297
298
|
if (ask) { c.innerHTML = `<span>Stop “${esc(v.title)}” for good? ${esc(STOP_LINE)}</span><button data-r="no">Cancel</button>${v.held ? '<button data-r="pause">Pause instead</button>' : ''}<button data-r="stopgo">Stop for good</button>`; return; }
|
|
298
|
-
|
|
299
|
+
const L = { hl: 'Highlight', pause: 'Pause', fv: 'Focus', open: 'Open', resume: 'Resume', stop: 'Stop' }; // the presses premium-vw-rec.js gives this page
|
|
300
|
+
c.innerHTML = `<i${v.mode === 'paused' ? ' class="paused"' : ''}></i><span>${esc(msg || v.text)}</span>${chipActs(v, here).map((a) => `<button data-r="${a}"${a === 'hl' ? ` title="${esc(HL_LINE)}"` : ''}>${L[a]}</button>`).join('')}`;
|
|
299
301
|
};
|
|
300
302
|
const read = async () => { const r = await pmGet('/api/notes'); if (r && r.ok === true && Array.isArray(r.notes)) rows = r.notes; draw(); };
|
|
301
303
|
c.addEventListener('click', async (e) => {
|
|
302
304
|
const b = e.target.closest('button'); if (!b) return;
|
|
303
305
|
const v = recChipView(rows, { holdingId: holding(), here }); if (!v) return;
|
|
304
306
|
const act = b.dataset.r; msg = '';
|
|
305
|
-
|
|
307
|
+
const d = { openDlg, toast, pmGet, pmPost };
|
|
308
|
+
if (act === 'open') { if (here === 'brief' && window.__premiumRec) openLive(v.id, d); else location.assign('/premium.html?meeting=' + encodeURIComponent(v.id)); return; }
|
|
309
|
+
if (act === 'fv') { openFocus(v.id, d); return; }
|
|
306
310
|
if (act === 'stop') { ask = true; draw(); const g = c.querySelector('[data-r="no"]'); if (g) g.focus(); return; }
|
|
307
311
|
if (act === 'no') { ask = false; draw(); return; }
|
|
308
312
|
b.disabled = true;
|
|
313
|
+
if (act === 'hl') { const r = window.__premiumRec ? await window.__premiumRec.highlight() : { ok: false }; msg = r.ok ? 'Highlighting the last 30 seconds and the next ones.' : (r.error || 'The highlight was not started.'); draw(); setTimeout(() => { msg = ''; draw(); }, 6000); return; }
|
|
309
314
|
if (act === 'pause') { ask = false; const r = window.__premiumRec ? await window.__premiumRec.pause() : { ok: false }; msg = r.ok ? '' : (r.error || 'It was not paused.'); }
|
|
310
315
|
else if (act === 'resume') { const r = window.__premiumRec ? await window.__premiumRec.resume(v.id) : { ok: false }; msg = r.ok ? '' : (r.error || 'It was not resumed.'); }
|
|
311
316
|
else if (act === 'stopgo') {
|
|
@@ -317,6 +322,7 @@ function mountRecChip(here) {
|
|
|
317
322
|
});
|
|
318
323
|
addEventListener('premium-rec', read);
|
|
319
324
|
read(); setInterval(read, 20000);
|
|
325
|
+
mountRecord(here, { openDlg, toast, pmGet, pmPost });
|
|
320
326
|
}
|
|
321
327
|
export function wireRail(here) {
|
|
322
328
|
mountRecChip(here);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
:root{--fs-1:11px;--fs-2:12px;--fs-3:14px;--fs-4:16px;--fs-5:20px;--fs-6:28px}
|
|
2
|
+
/* pm/premium-vw-backlog.css — the Jira backlog as a viewer tab (initiative premium-viewer, R10; premium-vw-backlog.js).
|
|
3
|
+
* Loaded once by vwStyle('backlog'). Sizes are only var(--fs-1..6), weights 400/500/600 (premium-console-type.test.js). */
|
|
4
|
+
.vbl .bl{display:grid;gap:14px}
|
|
5
|
+
.vbl .bl-src{margin:0;font-size:var(--fs-2);color:var(--ink-3)}
|
|
6
|
+
.vbl .bl-f{display:flex;gap:4px;flex-wrap:wrap;padding:4px;border-radius:8px;background:var(--well);width:max-content;max-width:100%}
|
|
7
|
+
.vbl .bl-f button{min-height:44px;padding:0 16px;border-radius:6px;font-size:var(--fs-2);font-weight:600;color:var(--ink-2)}
|
|
8
|
+
.vbl .bl-f button[aria-pressed="true"]{background:var(--solid);color:var(--on-solid)}
|
|
9
|
+
.vbl .bl-s{background:var(--card-solid);border:1px solid var(--hair);border-radius:8px;box-shadow:var(--card-shadow);overflow:hidden}
|
|
10
|
+
.vbl .bl-h{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 14px;border-bottom:1px solid var(--hair)}
|
|
11
|
+
.vbl .bl-h b{font-size:var(--fs-3);font-weight:600}
|
|
12
|
+
.vbl .bl-h small{font-size:var(--fs-2);color:var(--ink-3)}
|
|
13
|
+
.vbl .bl-gap{flex:1}
|
|
14
|
+
.vbl .bl-rws{list-style:none;margin:0;padding:0}
|
|
15
|
+
.vbl .bl-rw{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:4px 14px;border-top:1px solid var(--hair)}
|
|
16
|
+
.vbl .bl-rw:first-child{border-top:0}
|
|
17
|
+
.vbl .bl-rw.risk{box-shadow:inset 3px 0 0 var(--bad)}
|
|
18
|
+
.vbl .bl-t{flex:1 1 220px;min-width:0;min-height:44px;display:flex;align-items:center;gap:10px;text-align:left;font-size:var(--fs-3);color:var(--ink)}
|
|
19
|
+
.vbl .bl-t b{font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
20
|
+
@media (hover:hover){.vbl .bl-t:hover b{text-decoration:underline;text-underline-offset:3px}}
|
|
21
|
+
.vbl .bl-k{font:500 var(--fs-2) var(--mono);color:var(--ink-3);flex:none}
|
|
22
|
+
.vbl .bl-m{display:flex;align-items:center;gap:8px;flex:none}
|
|
23
|
+
.vbl .bl-st{font-size:var(--fs-1);font-weight:600;padding:2px 8px;border-radius:6px;background:var(--well);color:var(--ink-2)}
|
|
24
|
+
.vbl .bl-st.doing{color:var(--ember-ink)}
|
|
25
|
+
.vbl .bl-p{font:500 var(--fs-2) var(--mono);min-width:24px;text-align:center;padding:1px 6px;border-radius:6px;border:1px solid var(--hair);color:var(--ink-2)}
|
|
26
|
+
.vbl .bl-in{font-size:var(--fs-2);color:var(--ink-3);max-width:16ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
27
|
+
.vbl .bl-why{flex-basis:100%;margin:-6px 0 6px;font-size:var(--fs-2);color:var(--bad)}
|
|
28
|
+
.vbl .bl-none,.vbl .bl-empty{margin:0;padding:12px 14px;font-size:var(--fs-2);color:var(--ink-3)}
|
|
29
|
+
.vbl .bl-f button:focus-visible,.vbl .bl-t:focus-visible{outline:2px solid var(--ember);outline-offset:2px}
|
|
30
|
+
@media (max-width:560px){.vbl .bl-in{display:none}}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* pm/premium-vw-backlog.js — the Jira backlog of a board as a viewer tab (initiative premium-viewer, R10).
|
|
2
|
+
* The open sprints first (active, then the next ones), then the Backlog: the board's tickets in no sprint and not done. Each row shows
|
|
3
|
+
* its key, title, status, points and initiative; a blocked ticket says why. A row opens its ticket (the Jira ticket tab when that view
|
|
4
|
+
* is on the page, else its Jira page).
|
|
5
|
+
*
|
|
6
|
+
* WHERE EACH PART COMES FROM. GET /api/boards/sprints?ws&board answers { source, readAt, sprints, backlog } (lib/routes-boards.js;
|
|
7
|
+
* scripts/boards.js sprintsOf and backlogOf), read from the Jira status check's saved readings. Nothing is invented. What the records
|
|
8
|
+
* do not hold is not drawn, and the tab says so once:
|
|
9
|
+
* - only the tickets PMOS knows: the ones the board's initiatives pushed, or the children of their linked epics. The rest of the Jira
|
|
10
|
+
* backlog is not read.
|
|
11
|
+
* - no rank (the list goes by key), no assignee, no sprint capacity: the readings hold none of them.
|
|
12
|
+
* - read-only: moving a ticket between sprints or ranking it happens in Jira (Jira owns sprint and rank, D88). */
|
|
13
|
+
import { vwOpen, vwStyle } from './premium-viewer.js';
|
|
14
|
+
|
|
15
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
16
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
17
|
+
const dm = (d) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(d || '')); return m ? +m[3] + ' ' + MON[+m[2] - 1] : ''; };
|
|
18
|
+
const pts = (n) => (Math.round(n * 10) / 10) + (n === 1 ? ' point' : ' points');
|
|
19
|
+
const STATE = { active: 'Active', future: 'Next' };
|
|
20
|
+
|
|
21
|
+
/** The tab's model from the answer of /api/boards/sprints: { readAt, sections: [{ id, name, sub, items, points, rows }], links, empty } or null. */
|
|
22
|
+
export function backlogModel(r) {
|
|
23
|
+
if (!r || r.ok !== true) return null;
|
|
24
|
+
const bl = r.backlog || { issues: [], points: null, links: {}, readAt: null };
|
|
25
|
+
const row = (i) => ({ key: i.key, title: i.summary || i.key, status: i.status || '', cat: i.category || 'todo', points: typeof i.points === 'number' ? i.points : null,
|
|
26
|
+
type: i.type || null, initiative: i.initiative || null, blocked: i.flagged ? (i.reason || 'Blocked') : null, stale: !!i.stale, url: (bl.links || {})[i.key] || null });
|
|
27
|
+
const sum = (p, n) => (p ? pts(p.committed) + (p.unestimated ? ', ' + p.unestimated + ' not estimated' : '') : n ? 'Not estimated' : '');
|
|
28
|
+
const open = (Array.isArray(r.sprints) ? r.sprints : []).filter((s) => s.state === 'active' || s.state === 'future');
|
|
29
|
+
const sections = open.map((s) => ({
|
|
30
|
+
id: 'sp:' + s.name, name: s.name, state: s.state,
|
|
31
|
+
sub: [STATE[s.state], [dm(s.start), dm(s.end)].filter(Boolean).join(' – ')].filter(Boolean).join(' · '),
|
|
32
|
+
items: (s.issues || []).length, points: sum(s.points, (s.issues || []).length), rows: (s.issues || []).map(row),
|
|
33
|
+
}));
|
|
34
|
+
const rows = (bl.issues || []).map(row);
|
|
35
|
+
sections.push({ id: 'backlog', name: 'Backlog', state: 'backlog', sub: '', items: rows.length, points: sum(bl.points, rows.length), rows });
|
|
36
|
+
const readAt = [r.readAt, bl.readAt].filter(Boolean).sort()[0] || null; // the oldest read is the honest age
|
|
37
|
+
return { readAt, sections, empty: r.source !== 'jira' && !rows.length, bugs: sections.some((s) => s.rows.some((x) => /bug/i.test(x.type || ''))) };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Which rows a filter keeps: '' all, 'blocked', 'bug'. */
|
|
41
|
+
export const keep = (f) => (x) => (!f ? true : f === 'blocked' ? !!x.blocked : f === 'bug' ? /bug/i.test(x.type || '') : true);
|
|
42
|
+
|
|
43
|
+
const ago = (iso) => { const t = new Date(iso); if (!Number.isFinite(t.getTime())) return ''; return 'read ' + dm(t.toISOString()) + ' ' + String(t.getHours()).padStart(2, '0') + ':' + String(t.getMinutes()).padStart(2, '0'); };
|
|
44
|
+
const chip = (x) => `<span class="bl-st ${x.cat}">${esc(x.status || (x.cat === 'doing' ? 'In progress' : 'To do'))}</span>`;
|
|
45
|
+
function rowHtml(x) {
|
|
46
|
+
return `<li class="bl-rw${x.blocked ? ' risk' : ''}"><button type="button" class="bl-t" data-tk="${esc(x.key)}"${x.url ? ` data-url="${esc(x.url)}"` : ''}${x.initiative ? ` data-ini="${esc(x.initiative)}"` : ''}><span class="bl-k">${esc(x.key)}</span><b>${esc(x.title)}</b></button>`
|
|
47
|
+
+ `<span class="bl-m">${chip(x)}${x.points != null ? `<span class="bl-p" title="Story points">${esc(x.points)}</span>` : ''}${x.initiative ? `<span class="bl-in">${esc(x.initiative)}</span>` : ''}</span>`
|
|
48
|
+
+ (x.blocked ? `<span class="bl-why">${esc(x.blocked)}</span>` : '') + (x.stale ? '<span class="bl-why">Not in the last read</span>' : '') + '</li>';
|
|
49
|
+
}
|
|
50
|
+
export function backlogHtml(m, f = '') {
|
|
51
|
+
if (!m) return '<p class="bl-empty">The backlog could not be read. Try again in a moment.</p>';
|
|
52
|
+
if (m.empty) return '<p class="bl-empty">No Jira reading for this board yet. The backlog appears once the Jira status check has read the initiatives\' tickets.</p>';
|
|
53
|
+
const opts = [['', 'All'], ['blocked', 'Blocked']].concat(m.bugs ? [['bug', 'Bugs']] : []);
|
|
54
|
+
const secs = m.sections.map((s) => {
|
|
55
|
+
const rows = s.rows.filter(keep(f));
|
|
56
|
+
return `<section class="bl-s" data-sec="${esc(s.id)}"><div class="bl-h"><b>${esc(s.name)}</b>${s.sub ? `<small>${esc(s.sub)}</small>` : ''}<span class="bl-gap"></span><small>${s.items} ${s.items === 1 ? 'item' : 'items'}${s.points ? ' · ' + esc(s.points) : ''}</small></div>`
|
|
57
|
+
+ (rows.length ? `<ul class="bl-rws">${rows.map(rowHtml).join('')}</ul>` : `<p class="bl-none">${s.items ? 'None match this filter.' : s.state === 'backlog' ? 'No ticket of this board is outside a sprint.' : 'No ticket in this sprint.'}</p>`) + '</section>';
|
|
58
|
+
}).join('');
|
|
59
|
+
return `<div class="bl"><p class="bl-src">From Jira${m.readAt ? ' · ' + esc(ago(m.readAt)) : ''}. Only the tickets this board's initiatives pushed or hold under their epics, by key. Ranking and moving between sprints happen in Jira.</p>`
|
|
60
|
+
+ `<div class="bl-f" role="group" aria-label="Show">${opts.map((o) => `<button type="button" data-f="${o[0]}" aria-pressed="${f === o[0]}">${o[1]}</button>`).join('')}</div>${secs}</div>`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Opens one ticket: the Jira ticket tab when its view is on the page, else the ticket's Jira page. */
|
|
64
|
+
async function openTicket({ ws, board, initiative, key, url }) {
|
|
65
|
+
if (initiative) { try { const J = await import('./premium-vw-jira.js'); if (J && typeof J.openTicket === 'function') { J.openTicket({ ws, board, initiative, ref: key }); return; } } catch { /* no ticket view on this page */ } }
|
|
66
|
+
if (url) window.open(url, '_blank', 'noopener');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Opens the backlog of a board as a viewer tab. */
|
|
70
|
+
export function openBacklog({ ws, board, title } = {}) {
|
|
71
|
+
vwStyle('backlog');
|
|
72
|
+
let m = null; let f = '';
|
|
73
|
+
const draw = (el) => { el.innerHTML = `<div class="vbl">${m === undefined ? '<p class="bl-empty">Reading the backlog…</p>' : backlogHtml(m, f)}</div>`; };
|
|
74
|
+
return vwOpen({
|
|
75
|
+
id: 'backlog:' + (board || ''), title: title || 'Backlog', icon: 'list',
|
|
76
|
+
render: async (el) => {
|
|
77
|
+
m = undefined; draw(el);
|
|
78
|
+
const q = new URLSearchParams(); if (ws) q.set('ws', ws); if (board) q.set('board', board);
|
|
79
|
+
let r = null;
|
|
80
|
+
try { const res = await fetch('/api/boards/sprints?' + q, { credentials: 'same-origin' }); r = await res.json(); } catch { r = null; }
|
|
81
|
+
m = backlogModel(r); draw(el);
|
|
82
|
+
},
|
|
83
|
+
wire: (el) => {
|
|
84
|
+
el.onclick = (e) => { // delegated: the pane's content is drawn again on each filter
|
|
85
|
+
const b = e.target.closest('[data-f]'); if (b) { f = b.dataset.f; draw(el); return; }
|
|
86
|
+
const t = e.target.closest('[data-tk]'); if (t) openTicket({ ws, board, initiative: t.dataset.ini || null, key: t.dataset.tk, url: t.dataset.url || null });
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (typeof window !== 'undefined') window.__premiumVwBacklog = { openBacklog };
|
|
@@ -48,6 +48,7 @@ export function bodyHtml(src, o = {}) {
|
|
|
48
48
|
while (i < L.length) {
|
|
49
49
|
const l = L[i];
|
|
50
50
|
if (!l.trim()) { i++; continue; }
|
|
51
|
+
if (/^\s*<!--.*-->\s*$/.test(l)) { out.push(`<div class="vwcm" hidden contenteditable="false" data-cm="${esc(l)}"${i && L[i - 1].trim() ? ' data-tight="1"' : ''}></div>`); i++; continue; } // a whole-line HTML comment (pmos:note, pmos:slide): kept, never drawn
|
|
51
52
|
if (/^```/.test(l)) { const lang = l.slice(3).trim(), buf = []; i++; while (i < L.length && !/^```/.test(L[i])) buf.push(L[i++]); i++; out.push(codeBlock(lang, buf.join('\n'))); continue; }
|
|
52
53
|
const h = /^(#{1,6})\s+(.*)$/.exec(l);
|
|
53
54
|
if (h) { const lv = Math.min(4, Math.max(2, h[1].length)), id = 'vwh' + (start + heads.length); heads.push([lv, h[2].replace(/[*_`]/g, ''), id]); out.push(`<h${lv} id="${id}" data-md="${h[1].length}">${inl(h[2])}</h${lv}>`); i++; continue; }
|
|
@@ -82,7 +83,7 @@ export function bodyHtml(src, o = {}) {
|
|
|
82
83
|
const b = bodyHtml(buf.join('\n'), { start: start + heads.length }); heads.push(...b.heads);
|
|
83
84
|
out.push(`<details class="xp"><summary>${inl(sm ? sm[1] : 'Details')}</summary><div>${b.html}</div></details>`); continue;
|
|
84
85
|
}
|
|
85
|
-
const buf = []; while (i < L.length && L[i].trim() && !/^(#{1,6}\s|>|\s*\||```|<details|(-{3,}|\*{3,}|_{3,})\s*$)/.test(L[i]) && !isList(L[i])) buf.push(L[i++].trim());
|
|
86
|
+
const buf = []; while (i < L.length && L[i].trim() && !/^(#{1,6}\s|>|\s*\||```|<details|(-{3,}|\*{3,}|_{3,})\s*$|\s*<!--.*-->\s*$)/.test(L[i]) && !isList(L[i])) buf.push(L[i++].trim());
|
|
86
87
|
if (!buf.length) buf.push(L[i++]);
|
|
87
88
|
out.push(`<p>${inl(buf.join(' '))}</p>`);
|
|
88
89
|
}
|
|
@@ -173,7 +174,7 @@ export function mergeEdit(orig, base, now) {
|
|
|
173
174
|
const out = { fmRaw: O.fmRaw, pre: B.pre.trim() === N.pre.trim() ? O.pre : N.pre, sections: [] };
|
|
174
175
|
for (const s of N.sections) {
|
|
175
176
|
const b = bOf.get(s.name), o = oOf.get(s.name);
|
|
176
|
-
out.sections.push(same(s, b) && o ? o : { name: s.name, head: s.head, body: '\n' + s.body.trim() + '\n' });
|
|
177
|
+
out.sections.push(same(s, b) && o ? o : { name: s.name, head: s.head, body: (/^\S/.test(s.body) ? '' : '\n') + s.body.trim() + '\n' });
|
|
177
178
|
}
|
|
178
179
|
let t = joinDoc(out);
|
|
179
180
|
if (/\n$/.test(orig) && !/\n$/.test(t)) t += '\n';
|
|
@@ -169,3 +169,4 @@
|
|
|
169
169
|
.vwcp a{color:var(--vw-lnk);font-size:var(--fs-2)}
|
|
170
170
|
@media (max-width:640px){.vwchip,.vwli>button{min-height:44px}}
|
|
171
171
|
@media (hover:hover){.vwbtn:hover{background:var(--well)}.cf a:hover{text-decoration:underline}.vwtb:hover{background:var(--well);color:var(--ink)}.vwpop button:hover{background:var(--well)}.vwxmn a:hover{background:var(--well)}.vwli>button:hover{background:var(--well)}}
|
|
172
|
+
.cfb .vwcm{display:none}
|
|
@@ -38,12 +38,15 @@ function inlineMd(n) {
|
|
|
38
38
|
return s;
|
|
39
39
|
}).join('');
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
const TIGHT = '\u0000'; // marks a comment that sat on the line right after the block before it
|
|
42
|
+
export function domToMd(root) { return mdOf(root).replace(/\n\n\u0000/g, '\n').replace(/\u0000/g, ''); }
|
|
43
|
+
function mdOf(root) {
|
|
42
44
|
const B = [];
|
|
43
45
|
for (const c of root.children) {
|
|
44
46
|
const t = c.tagName, cl = c.classList;
|
|
45
|
-
if (cl.contains('vwchg')) { if (!c.dataset.hidden) { const inner = $('.vwcb', c); if (inner) B.push(
|
|
47
|
+
if (cl.contains('vwchg')) { if (!c.dataset.hidden) { const inner = $('.vwcb', c); if (inner) B.push(mdOf(inner)); } continue; }
|
|
46
48
|
if (cl.contains('vwbefore') || cl.contains('vwcl')) continue;
|
|
49
|
+
if (cl.contains('vwcm')) { B.push((c.dataset.tight ? TIGHT : '') + c.dataset.cm); continue; } // a whole-line HTML comment goes back as it was
|
|
47
50
|
if (cl.contains('pnl')) B.push(`> [!${String(c.dataset.k || 'note').toUpperCase()}]\n` + [...$('.pc', c).children].map((x) => '> ' + inlineMd(x).trim()).join('\n>\n'));
|
|
48
51
|
else if (cl.contains('tw') || t === 'TABLE') {
|
|
49
52
|
const rows = [...c.querySelectorAll('tr')].map((r) => '| ' + [...r.children].map((x) => inlineMd(x).trim().replace(/\|/g, '\\|')).join(' | ') + ' |');
|
|
@@ -54,8 +57,8 @@ export function domToMd(root) {
|
|
|
54
57
|
else if (t === 'UL' || t === 'OL') B.push([...c.children].map((li, k) => `${t === 'OL' ? k + 1 + '.' : '-'} ${inlineMd(li).trim()}`).join('\n'));
|
|
55
58
|
else if (t === 'BLOCKQUOTE') B.push('> ' + inlineMd(c).trim());
|
|
56
59
|
else if (t === 'HR') B.push('---');
|
|
57
|
-
else if (t === 'DETAILS') { const sm = $('summary', c); B.push(`<details><summary>${sm ? sm.textContent.trim() : 'Details'}</summary>\n\n${
|
|
58
|
-
else if (t === 'DIV') { const s =
|
|
60
|
+
else if (t === 'DETAILS') { const sm = $('summary', c); B.push(`<details><summary>${sm ? sm.textContent.trim() : 'Details'}</summary>\n\n${mdOf($('div', c) || c)}\n\n</details>`); }
|
|
61
|
+
else if (t === 'DIV') { const s = mdOf(c); if (s.trim()) B.push(s); }
|
|
59
62
|
else { const s = inlineMd(c).trim(); if (s) B.push(s); }
|
|
60
63
|
}
|
|
61
64
|
return B.join('\n\n');
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Reads GET /api/jira/tickets and GET /api/boards/sprints only; the model is pm/premium-vw-jira-model.js. Read-only: Jira owns status, sprint and
|
|
7
7
|
* assignee (D88), so nothing here moves a ticket. With no Jira data a view says what is missing. */
|
|
8
8
|
import { vwOpen, vwStyle } from './premium-viewer.js';
|
|
9
|
+
import { openBacklog } from './premium-vw-backlog.js';
|
|
9
10
|
import { mdRender } from './markdown.js';
|
|
10
11
|
import { esc, toast } from './premium-shell.js';
|
|
11
12
|
import { ticketModel, sprintModel, readLine } from './premium-vw-jira-model.js';
|
|
@@ -86,7 +87,7 @@ function sprintHtml(m) {
|
|
|
86
87
|
return `<div class="jv">${bar(m.name, m)}${pick}
|
|
87
88
|
<div class="jsh"><div><h3>${esc(m.name)}${m.dates ? ` · ${esc(m.dates)}` : ''}</h3><p>${[m.goal ? 'Goal: ' + m.goal : 'No sprint goal on record', m.left || m.state].filter(Boolean).map(esc).join(' · ')}</p></div><span class="gap"></span>${pts}</div>
|
|
88
89
|
<div class="jbrd">${m.cols.map((c) => `<section class="jcol" aria-label="${esc(c.label)}, ${c.cards.length}"><div class="jcolh"><span>${esc(c.label)}</span><span>${c.cards.length}</span></div>${c.cards.map(card).join('') || '<p class="jnone">None</p>'}</section>`).join('')}</div>
|
|
89
|
-
<p class="jnote">Read-only: Jira owns each ticket's status and sprint, so move a ticket in Jira.${m.other ? ` ${m.other} ${m.other === 1 ? 'ticket is' : 'tickets are'} in this sprint but on no initiative of this board, so ${m.other === 1 ? 'it has' : 'they have'} no ticket here.` : ''} Tickets with no sprint are
|
|
90
|
+
<p class="jnote">Read-only: Jira owns each ticket's status and sprint, so move a ticket in Jira.${m.other ? ` ${m.other} ${m.other === 1 ? 'ticket is' : 'tickets are'} in this sprint but on no initiative of this board, so ${m.other === 1 ? 'it has' : 'they have'} no ticket here.` : ''} Tickets with no sprint are in the backlog. <button type="button" class="jbtn" data-jbl>Open the backlog</button></p></div>`;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
/** The board's sprints as a board by status in one tab; name picks a sprint (default: the active one). */
|
|
@@ -101,6 +102,7 @@ export async function openSprint(o) {
|
|
|
101
102
|
el.innerHTML = sprintHtml(m); bars(el);
|
|
102
103
|
el.querySelectorAll('[data-sp]').forEach((b) => { b.onclick = () => { name = b.dataset.sp; draw(el); }; });
|
|
103
104
|
el.querySelectorAll('.jcrd[data-k]').forEach((b) => { b.onclick = () => openTicket({ ws, board, initiative: b.dataset.ini, ref: b.dataset.k }); });
|
|
105
|
+
const bl = el.querySelector('[data-jbl]'); if (bl) bl.onclick = () => openBacklog({ ws, board }); // the tickets in no sprint (premium-viewer R9)
|
|
104
106
|
const re = el.querySelector('[data-jre]'); if (re) re.onclick = async () => { await draw(el); toast('Read the cached Jira reading again. A Jira check reads Jira itself.'); };
|
|
105
107
|
};
|
|
106
108
|
return vwOpen({ id: 'sprint:' + (board || ''), title: 'Sprint', icon: 'list', render: (el) => { draw(el); } });
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
:root{--fs-1:11px;--fs-2:12px;--fs-3:14px;--fs-4:16px;--fs-5:20px;--fs-6:28px}
|
|
2
|
+
/* pm/premium-vw-rec.css — note recording in the premium viewer (premium-viewer S4): the Record control, the Live notes tab and the Focus tab. Loaded by vwStyle('rec'). */
|
|
3
|
+
.recctl{position:relative;display:inline-flex;align-items:stretch;border-radius:8px;background:var(--solid);color:var(--on-solid);flex:none}
|
|
4
|
+
.recctl[hidden]{display:none}
|
|
5
|
+
.recb{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:0 14px;font-size:var(--fs-2);font-weight:600;color:inherit;border-radius:6px}
|
|
6
|
+
.recb .i{width:16px;height:16px}
|
|
7
|
+
.recb.arr{padding:0 10px;border-left:1px solid var(--hair)}
|
|
8
|
+
.recb:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
|
|
9
|
+
.recm{position:absolute;right:0;top:calc(100% + 8px);z-index:40;width:min(320px,calc(100vw - 32px));padding:8px;border:1px solid var(--hair);border-radius:8px;background:var(--card-solid);box-shadow:var(--card-shadow);color:var(--ink)}
|
|
10
|
+
.recm[hidden]{display:none}
|
|
11
|
+
.recm .label{display:block;margin:4px 8px 6px}
|
|
12
|
+
.recm [role="menuitem"]{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:6px 10px;border-radius:6px;text-align:left;font-size:var(--fs-2);font-weight:500}
|
|
13
|
+
.recm [role="menuitem"] b{font-weight:600;flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
|
|
14
|
+
.recm [role="menuitem"] small{color:var(--ink-3);font-size:var(--fs-1);white-space:nowrap}
|
|
15
|
+
.recm [role="menuitem"]:focus-visible{background:var(--well)}
|
|
16
|
+
@media (hover:hover){.recm [role="menuitem"]:hover{background:var(--well)}}
|
|
17
|
+
.recm [role="menuitem"][disabled]{opacity:.55}
|
|
18
|
+
.recm [role="menuitem"] .i{width:16px;height:16px}
|
|
19
|
+
.recm .note{margin:4px 8px 8px}
|
|
20
|
+
.recask{padding:6px}
|
|
21
|
+
.recask p{margin:0 0 8px;font-size:var(--fs-2)}
|
|
22
|
+
.recask div,.rvask div{display:flex;flex-wrap:wrap;gap:8px}
|
|
23
|
+
|
|
24
|
+
.rvw .rvt{margin:0 0 10px;font-size:var(--fs-4);font-weight:600}
|
|
25
|
+
.rvh{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 12px;border:1px solid var(--hair);border-radius:8px;background:var(--card-solid);box-shadow:var(--card-shadow)}
|
|
26
|
+
.rvh b{font-size:var(--fs-3);font-weight:600}
|
|
27
|
+
.rvsp{flex:1 1 auto}
|
|
28
|
+
.rvclk{font-family:var(--mono);font-size:var(--fs-2);color:var(--ink-2)}
|
|
29
|
+
.rvdot{width:9px;height:9px;border-radius:50%;background:var(--bad);animation:br 1.6s ease-in-out infinite}
|
|
30
|
+
.rvdot.paused{background:var(--ember);animation:none}
|
|
31
|
+
.rvb{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 13px;border-radius:6px;background:var(--well);font-size:var(--fs-2);font-weight:600;color:var(--ink)}
|
|
32
|
+
.rvb .i{width:15px;height:15px}
|
|
33
|
+
.rvb.cta{background:var(--solid);color:var(--on-solid)}
|
|
34
|
+
.rvb[aria-pressed="true"]{background:var(--solid);color:var(--on-solid)}
|
|
35
|
+
.rvb:disabled{opacity:.55}
|
|
36
|
+
.rvb:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
|
|
37
|
+
.rvask{margin:10px 0 0;padding:12px 14px;border:1px solid var(--hair);border-radius:8px;background:var(--card-solid)}
|
|
38
|
+
.rvask p{margin:0 0 10px;font-size:var(--fs-2)}
|
|
39
|
+
.rvopts{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0 0}
|
|
40
|
+
.rvsec{margin:16px 0 0}
|
|
41
|
+
.rvsec>.label{display:block;margin:0 0 6px}
|
|
42
|
+
.rvta{width:100%;box-sizing:border-box;min-height:96px;padding:10px 12px;border:1px solid var(--hair);border-radius:6px;background:var(--card-solid);color:var(--ink);font:inherit;font-size:var(--fs-3);resize:vertical}
|
|
43
|
+
.rvta:focus-visible{outline:2px solid var(--ink);outline-offset:1px}
|
|
44
|
+
.rvhl{list-style:none;margin:0;padding:0;display:grid;gap:6px}
|
|
45
|
+
.rvhl li{display:flex;gap:10px;align-items:baseline;padding:8px 10px;border-radius:8px;background:var(--well);font-size:var(--fs-2)}
|
|
46
|
+
.rvhl time,.rvtr time{font-family:var(--mono);font-size:var(--fs-1);color:var(--ink-3);flex:none}
|
|
47
|
+
.rvhl em{margin-left:auto;font-style:normal;font-size:var(--fs-1);color:var(--ink-3)}
|
|
48
|
+
.rvtr{max-height:340px;overflow-y:auto;display:grid;gap:6px;padding:2px}
|
|
49
|
+
.rvtr p{display:flex;gap:8px;align-items:baseline;margin:0;font-size:var(--fs-2);color:var(--ink-2)}
|
|
50
|
+
.rvtr p b{font-weight:600;color:var(--ink);flex:none}
|
|
51
|
+
.rvtr p.cur{color:var(--ink)}
|
|
52
|
+
|
|
53
|
+
.fvh{display:flex;align-items:baseline;flex-wrap:wrap;gap:10px;margin:0 0 12px}
|
|
54
|
+
.fvh b{font-size:var(--fs-4);font-weight:600}
|
|
55
|
+
.fvbar{display:flex;gap:3px;height:28px;margin:0 0 12px}
|
|
56
|
+
.fvbar span{flex:var(--fc-flex,1);display:grid;place-items:center;min-width:18px;border-radius:6px;background:var(--well);font-size:var(--fs-1);font-weight:600;color:var(--ink-2)}
|
|
57
|
+
.fvbar span.on{background:var(--solid);color:var(--on-solid)}
|
|
58
|
+
.fvnow{padding:12px 14px;border:1px solid var(--hair);border-radius:8px;background:var(--card-solid);box-shadow:var(--card-shadow)}
|
|
59
|
+
.fvnow b{display:block;font-size:var(--fs-4);font-weight:600}
|
|
60
|
+
.fvnow p{margin:6px 0 0;font-size:var(--fs-3);color:var(--ink-2)}
|
|
61
|
+
.fvg{display:grid;grid-template-columns:1fr 1fr;gap:16px}
|
|
62
|
+
.fvtp{margin:0;padding-left:20px;display:grid;gap:4px;font-size:var(--fs-2)}
|
|
63
|
+
.fvtp li{color:var(--ink-2)}
|
|
64
|
+
.fvtp li.now{color:var(--ink);font-weight:600}
|
|
65
|
+
.fvtp small{margin-left:6px;color:var(--ink-3);font-size:var(--fs-1)}
|
|
66
|
+
.fvcap{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
|
|
67
|
+
.fvcap div{padding:8px 10px;border-radius:8px;background:var(--well)}
|
|
68
|
+
.fvcap b{display:block;font-size:var(--fs-4);font-weight:600}
|
|
69
|
+
.fvcap span{font-size:var(--fs-1);color:var(--ink-3)}
|
|
70
|
+
.fvst{list-style:none;margin:0;padding:0;display:grid;gap:8px}
|
|
71
|
+
.fvst li{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px 10px;border:1px solid var(--hair);border-radius:8px}
|
|
72
|
+
.fvst li>span{flex:1 1 12em;min-width:0}
|
|
73
|
+
.fvst b{display:block;font-weight:600;font-size:var(--fs-2);overflow-wrap:anywhere}
|
|
74
|
+
.fvst small{font-size:var(--fs-1);color:var(--ink-3)}
|
|
75
|
+
@media (max-width:700px){.fvg{grid-template-columns:1fr}.recb span{display:none}}
|