create-pmos 0.289.0 → 0.290.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/briefing-premium-board-test.js +2 -2
- package/workspace/briefing-premium-metrics-test.js +2 -8
- package/workspace/guide/briefing-premium.md +1 -1
- package/workspace/lib/board-premium.js +37 -7
- package/workspace/lib/routes-board-premium.js +1 -3
- package/workspace/lib/routes-boards.js +7 -4
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/premium-board.js +13 -7
- package/workspace/public/pm/premium.css +13 -0
- package/workspace/public/premium-board.html +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.290.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-19T03:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T03:40:41Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-19T03:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T03:40:41Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-19T03:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T03:40:41Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -117,7 +117,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
117
117
|
{
|
|
118
118
|
const R = await open({ model: mk({ sprints: { source: 'jira', readAt: '2026-10-16', sprints: [{ name: 'Sprint 42', state: 'active', start: '2026-10-12', end: '2026-10-23', counts: { todo: 11, doing: 9, done: 14 }, goal: 'Self-serve onboarding reaches beta' }] }, nextRelease: { id: 'r1', type: 'minor', at: '2026-10-23T00:00:00Z' } }) });
|
|
119
119
|
const d = await R.page.evaluate(() => ({ sp: document.querySelector('#sprBody').textContent.replace(/\s+/g, ' '), cnt: [...document.querySelectorAll('#sprBody .cnt b')].map((b) => b.textContent).join(), rel: document.querySelector('#relBody').textContent.replace(/\s+/g, ' '), cap: document.querySelector('#relCap').textContent }));
|
|
120
|
-
ok('B9 B8 a sprint read and a release are drawn from their records',
|
|
120
|
+
ok('B9 B8 a sprint read and a release are drawn from their records', d.cnt === '14,9,11' && /Goal: Self-serve onboarding reaches beta/.test(d.sp) && /Sprint review in 6 days/.test(d.sp) && /r1Next23 Oct · 6 days away/.test(d.rel), JSON.stringify(d));
|
|
121
121
|
await R.ctx.close();
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -171,7 +171,7 @@ const MOCKUP = path.join(__dirname, '..', 'prototype', 'premium-ux-concept', 'br
|
|
|
171
171
|
const base = F.facts(), docs3 = Object.assign({}, base.docs, { docs: base.docs.docs.concat([F.doc('intake', 'Intake log'), F.doc('roadmap', 'Roadmap note')]) });
|
|
172
172
|
const D = await open({ model: BP.build(Object.assign({}, base, { docs: docs3 })) });
|
|
173
173
|
const q = D.page;
|
|
174
|
-
ok('B15 the third card is "
|
|
174
|
+
ok('B15 the third card is "Next release", as the mockup names it', await q.evaluate(() => document.querySelector('#hRel').textContent === 'Next release'));
|
|
175
175
|
ok('B15 the header is the crumb: the board\'s name, no switcher for one board, and the sparkle', await q.evaluate(() => document.querySelector('#crBoard').disabled && document.querySelector('#crBoard').textContent === 'pmos' && document.querySelector('#crSw').hidden && document.querySelector('#crAsk').getAttribute('aria-label') === 'Ask about this board' && !document.querySelector('#bsw')));
|
|
176
176
|
await q.click('#crAsk'); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
177
177
|
const bd = await q.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, grid: [...document.querySelectorAll('#oMain .kv2 span')].map((x) => x.textContent).join('|'), ask: document.querySelector('#askF').hidden }));
|
|
@@ -67,12 +67,6 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
|
|
|
67
67
|
if (!shown) return finish(1);
|
|
68
68
|
const place = await p.evaluate(() => ({ above: document.querySelector('#cMet').getBoundingClientRect().bottom <= document.querySelector('#cIni').getBoundingClientRect().top, cap: document.querySelector('#metCap').textContent, h: document.querySelector('#hMet').textContent }));
|
|
69
69
|
ok('C1 the card sits above the Initiatives card and says which repository it counts', place.above && place.cap === 'counted from idpf' && place.h === 'Metrics', JSON.stringify(place));
|
|
70
|
-
{
|
|
71
|
-
const R = await open({ answers: () => ({ status: 200, body: { ok: true, state: 'none', why: 'no card' } }) });
|
|
72
|
-
await sleep(800);
|
|
73
|
-
ok('C1 the home workspace\'s board draws no card', await R.page.evaluate(() => document.querySelector('#cMet').hidden), '');
|
|
74
|
-
await R.ctx.close();
|
|
75
|
-
}
|
|
76
70
|
|
|
77
71
|
/* C2 */
|
|
78
72
|
const tiles = await p.evaluate(() => [...document.querySelectorAll('#metBody .mt1')].map((t) => ({ l: t.querySelector('span').textContent, v: t.querySelector('.mval').textContent, c: t.querySelector('.mwk').textContent, chart: !!t.querySelector('svg'), cls: t.className, chg: (t.querySelector('.mchg') || {}).textContent || '' })));
|
|
@@ -141,14 +135,14 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
|
|
|
141
135
|
/* C7 the real route */
|
|
142
136
|
{
|
|
143
137
|
const home = await fetch(BASE + '/api/board-metrics-premium').then((r) => r.json());
|
|
144
|
-
ok('C7 the real route gives the home workspace
|
|
138
|
+
ok('C7 the real route gives the home workspace the card too', home.ok === true && home.state === 'ready', JSON.stringify(home));
|
|
145
139
|
const post = await fetch(BASE + '/api/board-metrics-premium', { method: 'POST', headers: await T.pressHeaders(BASE), body: '{}' }).then((r) => r.status);
|
|
146
140
|
ok('C7 the route is read-only', post === 405, String(post));
|
|
147
141
|
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
|
|
148
142
|
pg.on('pageerror', (e) => errs.push(String(e)));
|
|
149
143
|
await pg.goto(BASE + '/premium-board.html');
|
|
150
144
|
await until(() => pg.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 40000); await sleep(1500);
|
|
151
|
-
ok('C7 the real PMOS board draws
|
|
145
|
+
ok('C7 the real PMOS board draws the Metrics card and no script error', await pg.evaluate(() => !document.querySelector('#cMet').hidden) && errs.length === 0, errs.join(' | '));
|
|
152
146
|
await ctx.close();
|
|
153
147
|
}
|
|
154
148
|
|
|
@@ -225,7 +225,7 @@ Board is the third place on the rail, at `/premium-board.html`. It reads what th
|
|
|
225
225
|
- **New initiative** (beside the Initiatives heading, team boards only) asks for a title, a lane and an anchor (a KR or a health budget). It writes an ask and accepts it, as the console does. An unanchored initiative is refused on the page.
|
|
226
226
|
- **⋯ on a row** (and the bar under an initiative page's heading) moves it to the next or another stage, puts it on hold with a reason and a check-back day, cancels it with a reason, or archives it. Each press writes one line through the console's route, says what it recorded, and offers Undo for a few seconds. An on-hold row offers Resume; a cancelled one offers Reopen; an archived one offers Restore. Cancelled and archived initiatives leave the list and sit under a fold below it. On the PMOS board the workflow engine places each initiative, so the moves are not offered and New asks and New initiative are hidden.
|
|
227
227
|
|
|
228
|
-
Not drawn, because PMOS holds no record for them: the
|
|
228
|
+
Not drawn, because PMOS holds no record for them: the mockup's demo measures (Activation, Partner uptime, API p95), targets, and the mockup's demo boards.
|
|
229
229
|
|
|
230
230
|
|
|
231
231
|
## Initiative page
|
|
@@ -113,16 +113,46 @@ function build(f) {
|
|
|
113
113
|
|
|
114
114
|
const sp = f.sprints || {};
|
|
115
115
|
const sprints = Array.isArray(sp.sprints) ? sp.sprints : [];
|
|
116
|
-
|
|
116
|
+
// The current sprint: the active one, else the next to start, else the latest closed by its end date (the list sorts closed sprints by name, oldest first).
|
|
117
|
+
const latestClosed = sprints.filter((s) => s.state === 'closed').sort((a, b) => String(b.end || '').localeCompare(String(a.end || '')) || String(b.name).localeCompare(String(a.name), undefined, { numeric: true }))[0];
|
|
118
|
+
const active = sp.source === 'jira' ? (sprints.find((s) => s.state === 'active') || sprints.find((s) => s.state !== 'closed') || latestClosed || null) : null;
|
|
119
|
+
const goalText = active && active.goal ? (typeof active.goal === 'object' ? active.goal.text || '' : String(active.goal)) : '';
|
|
120
|
+
const wd = (a, b) => { const x = isoDay(a), y = isoDay(b); if (!x || !y) return null; let n = 0; for (const d = new Date(x); d <= y; d.setDate(d.getDate() + 1)) if (d.getDay() % 6) n++; return n; }; // weekdays, both ends counted
|
|
117
121
|
const sprint = active
|
|
118
|
-
?
|
|
122
|
+
? (() => {
|
|
123
|
+
const k = active.counts || {}, c = { done: k.done || 0, doing: k.doing || 0, todo: k.todo || 0 }, tot = c.done + c.doing + c.todo, st = active.start && String(active.start).slice(0, 10), en = active.end && String(active.end).slice(0, 10);
|
|
124
|
+
const open = active.state !== 'closed', len = st && en ? wd(st, en) : null, at = len && todayIso >= st ? Math.min(len, wd(st, todayIso)) : null, left = open && en ? days(todayIso, en) : null;
|
|
125
|
+
return { cap: open && len && at != null ? 'day ' + at + ' of ' + len : active.state || '', name: active.name, state: active.state, start: st ? shortDate(st) : '', end: en ? shortDate(en) : '', counts: c,
|
|
126
|
+
pct: tot ? { done: +(c.done / tot * 100).toFixed(1), doing: +(c.doing / tot * 100).toFixed(1) } : { done: 0, doing: 0 },
|
|
127
|
+
goal: goalText ? clip(goalText, 300) : '', tickets: (active.issues || []).slice(0, 40).map((i) => ({ key: i.key, title: clip(i.summary || i.key, 120), status: i.status || ({ done: 'Done', doing: 'Doing', todo: 'To do' })[i.category] || '' })), review: left == null ? '' : left < 0 ? 'Sprint ended ' + plural(-left, 'a day', -left + ' days') + ' ago.' : left === 0 ? 'Sprint review is today.' : 'Sprint review in ' + left + ' ' + plural(left, 'day', 'days') + '.' };
|
|
128
|
+
})()
|
|
119
129
|
: { cap: 'none', why: 'No sprint is on record for this board. A sprint appears when an agent session has read Jira for it.' };
|
|
120
130
|
|
|
131
|
+
// The sprint's dialog (initiative premium-board-actions): its tickets with status and, only where a closed sprint's note holds one, the last sprint review.
|
|
132
|
+
const lastC = sprints.filter((x) => x !== active && x.state === 'closed' && (x.closed || x.hit)).sort((x, y) => String(y.end || '').localeCompare(String(x.end || '')) || String(y.name).localeCompare(String(x.name), undefined, { numeric: true }))[0];
|
|
133
|
+
const goalOf = (x) => (x && x.goal ? (typeof x.goal === 'object' ? x.goal.text || '' : String(x.goal)) : '');
|
|
134
|
+
const HIT = { met: ' (met)', partly: ' (partly met)', missed: ' (missed)' };
|
|
135
|
+
const review = lastC ? [['Last sprint review', lastC.name], ['Goal', goalOf(lastC) ? clip(goalOf(lastC), 200) + (HIT[lastC.hit] || '') : ''], ['Done', lastC.closed && lastC.closed.total ? lastC.closed.done + ' of ' + lastC.closed.total + ' tickets' : ''],
|
|
136
|
+
['Carried over', lastC.closed && lastC.closed.carried ? lastC.closed.carried + ' ' + plural(lastC.closed.carried, 'ticket', 'tickets') + (lastC.closed.carriedTo ? ' moved to ' + lastC.closed.carriedTo : ' carried over') : ''], ['What got in the way', lastC.got || '']].filter((x) => x[1]) : [];
|
|
137
|
+
const sprintRow = sprint.name ? (() => {
|
|
138
|
+
const say = sprint.name + (sprint.cap ? ' · ' + sprint.cap : '') + '. ' + sprint.counts.done + ' done, ' + sprint.counts.doing + ' doing, ' + sprint.counts.todo + ' to do.';
|
|
139
|
+
const rs = [['Dates', [sprint.start, sprint.end].filter(Boolean).join(' to ')], ['State', sprint.state || ''], ['Goal', sprint.goal], ['Done', String(sprint.counts.done)], ['Doing', String(sprint.counts.doing)], ['To do', String(sprint.counts.todo)]].filter((x) => x[1])
|
|
140
|
+
.concat(sprint.tickets.map((t) => [t.key, t.title + (t.status ? ' · ' + t.status : '')]), review);
|
|
141
|
+
return { key: 'board:sprint', id: null, title: sprint.name, sub: 'Sprint', dialog: { eye: 'Sprint', logTitle: 'Read from Jira', log: ['Read the sprint and its tickets from the cached Jira reading', 'Counted them by status', 'Changed nothing'], say, head: 'Where it stands', facts: rs, hold: 'This dialog changes nothing. Sprints mirror Jira.', pane: { label: 'Sprint', file: '', note: 'The sprint as the cached Jira reading holds it. A review shows only where a closed sprint has a note.', rows: rs } } };
|
|
142
|
+
})() : null;
|
|
121
143
|
const nr = f.nextRelease;
|
|
122
|
-
const
|
|
144
|
+
const relOf = (r, tag) => {
|
|
145
|
+
const rd = days(todayIso, String(r.at).slice(0, 10));
|
|
146
|
+
return { name: r.name || r.id, tag, at: shortDate(String(r.at).slice(0, 10)), days: rd, away: rd != null ? (rd === 0 ? 'today' : rd + ' ' + plural(rd, 'day', 'days') + ' away') : '', type: r.type || '',
|
|
147
|
+
ini: (r.ini || []).map((id) => rows.find((x) => x.id === id)).filter(Boolean).map((x) => ({ id: x.id, key: x.key, title: x.title, status: x.statusLabel || '', tone: x.late ? 'bad' : x.bad ? 'warn' : '' })) };
|
|
148
|
+
};
|
|
123
149
|
const release = nr && nr.at
|
|
124
|
-
? {
|
|
125
|
-
: { cap: 'none', why: 'No release is planned for this board.' };
|
|
150
|
+
? { ...relOf(nr, 'Next'), cap: relOf(nr, 'Next').away, rel: [relOf(nr, 'Next')].concat(nr.later && nr.later.at ? [relOf(nr.later, 'Planned')] : []) }
|
|
151
|
+
: { cap: 'none', why: 'No release is planned for this board. A release appears here when one carries an initiative of this board.', rel: [] };
|
|
152
|
+
const relRow = release.rel.length ? (() => {
|
|
153
|
+
const rs = release.rel.flatMap((r) => [[r.name + ' · ' + r.tag, [r.at, r.away].filter(Boolean).join(' · ') + (r.type ? ' · ' + r.type : '')]].concat(r.ini.map((i) => ['Rides on it', i.title + (i.status ? ' · ' + i.status : '')])));
|
|
154
|
+
return { key: 'board:release', id: null, title: release.name, sub: 'Release', dialog: { eye: 'Release', logTitle: 'Read from the releases', log: ['Read the releases that carry an initiative of this board', 'Took the earliest date from today on', 'Changed nothing'], say: release.name + ' is next: ' + release.at + ', ' + release.away + '.', head: 'Where it stands', facts: rs, hold: 'This dialog changes nothing.', pane: { label: 'Release', file: '', note: 'The releases as the release records hold them.', rows: rs } } };
|
|
155
|
+
})() : null;
|
|
126
156
|
|
|
127
157
|
const dd = f.docs || null;
|
|
128
158
|
const custom = (f.custom || []).map((d) => Object.assign(Custom.rowOf(d), { added: shortDate(d.at) }));
|
|
@@ -152,8 +182,8 @@ function build(f) {
|
|
|
152
182
|
},
|
|
153
183
|
sprint, release, docs,
|
|
154
184
|
asks: f.asks == null ? { missing: true, rows: [] } : { rows: f.asks.filter((a) => a && a.state !== 'accepted' && a.state !== 'declined').slice(0, 50).map(askOf) },
|
|
155
|
-
dock: { needs: risk + late, label: 'need a look', next: (rows.find((r) => r.late) || rows.find((r) => r.bad) || {}).title || null },
|
|
156
|
-
rows: rows.concat(stageRows.filter((r) => !rows.some((x) => x.key === r.key)), gone.cancelled, gone.archived).concat([{ key: 'board:this-board', id: null, title: board.name || 'This board', sub: 'Board', dialog: { eye: 'Board', logTitle: 'Read from the board', log: ['Read the board and its initiatives', 'Counted them by status', 'Changed nothing'], say: (board.name || 'This board') + ' has ' + open + ' open ' + plural(open, 'initiative', 'initiatives') + ': ' + on + ' on track, ' + risk + ' at risk, ' + late + ' late' + (hold ? ', ' + hold + ' on hold' : '') + '.', head: 'Where it stands', facts: [['Open initiatives', String(open)], ['On track', String(on)], ['At risk', String(risk)], ['Late', String(late)], ['On hold', hold ? String(hold) : '']].filter((x) => x[1] !== ''), hold: 'Nothing here changes a board.', pane: { label: 'Board record', file: '', note: 'The board as its records hold it.', rows: [['Open initiatives', String(open)], ['On track', String(on)], ['At risk', String(risk)], ['Late', String(late)], ['On hold', hold ? String(hold) : '']].filter((x) => x[1] !== '') } } }]),
|
|
185
|
+
dock: { needs: risk + late, label: 'need a look', release: nr && nr.at ? { at: shortDate(String(nr.at).slice(0, 10)), name: nr.name || nr.id } : null, next: (rows.find((r) => r.late) || rows.find((r) => r.bad) || {}).title || null },
|
|
186
|
+
rows: rows.concat(stageRows.filter((r) => !rows.some((x) => x.key === r.key)), gone.cancelled, gone.archived, [sprintRow, relRow].filter(Boolean)).concat([{ key: 'board:this-board', id: null, title: board.name || 'This board', sub: 'Board', dialog: { eye: 'Board', logTitle: 'Read from the board', log: ['Read the board and its initiatives', 'Counted them by status', 'Changed nothing'], say: (board.name || 'This board') + ' has ' + open + ' open ' + plural(open, 'initiative', 'initiatives') + ': ' + on + ' on track, ' + risk + ' at risk, ' + late + ' late' + (hold ? ', ' + hold + ' on hold' : '') + '.', head: 'Where it stands', facts: [['Open initiatives', String(open)], ['On track', String(on)], ['At risk', String(risk)], ['Late', String(late)], ['On hold', hold ? String(hold) : '']].filter((x) => x[1] !== ''), hold: 'Nothing here changes a board.', pane: { label: 'Board record', file: '', note: 'The board as its records hold it.', rows: [['Open initiatives', String(open)], ['On track', String(on)], ['At risk', String(risk)], ['Late', String(late)], ['On hold', hold ? String(hold) : '']].filter((x) => x[1] !== '') } } }]),
|
|
157
187
|
};
|
|
158
188
|
last = model;
|
|
159
189
|
return model;
|
|
@@ -29,14 +29,12 @@ async function via(mod, pathAndQuery, req, ctx) {
|
|
|
29
29
|
const qs = (o) => '?' + Object.entries(o).filter(([, v]) => v != null && v !== '').map(([k, v]) => k + '=' + encodeURIComponent(v)).join('&');
|
|
30
30
|
|
|
31
31
|
/** GET /api/board-metrics-premium?ws=<id> — the Metrics card of a tenant's Board (initiative briefing-premium-metrics). Read-only, and apart from the Board's own
|
|
32
|
-
* route so the Board never waits for it.
|
|
32
|
+
* route so the Board never waits for it. Every board has the card, the PMOS board's counted from the PMOS repository. */
|
|
33
33
|
async function metrics(req, res, url, ctx) {
|
|
34
34
|
if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
|
|
35
35
|
try {
|
|
36
36
|
const w = ctx.getWs && ctx.getWs(url.searchParams.get('ws') || null);
|
|
37
37
|
if (!w || !w.root) { ctx.json(res, { ok: false, state: 'error', error: 'that workspace is not registered' }, 404); return true; }
|
|
38
|
-
const home = ctx.homeRoot || ctx.selfRoot || null;
|
|
39
|
-
if (home && path.resolve(w.root) === path.resolve(home)) { ctx.json(res, { ok: true, state: 'none', why: 'The board of this repository has no Metrics card.' }); return true; }
|
|
40
38
|
const engine = ENGINE_PATHS.find((p) => fs.existsSync(p)) || null;
|
|
41
39
|
const model = await Metrics.read({ root: w.root, engine, now: Date.now() });
|
|
42
40
|
// the read-only agent finds a tile's row in the Board's model
|
|
@@ -336,14 +336,17 @@ function readReleases(ctx) {
|
|
|
336
336
|
/** The next release that carries an initiative of the board: the earliest release (or deploy) date from today on. */
|
|
337
337
|
function nextReleaseOf(releases, ids) {
|
|
338
338
|
const day = today();
|
|
339
|
-
|
|
339
|
+
const hits = [];
|
|
340
340
|
for (const r of releases) {
|
|
341
|
-
|
|
341
|
+
const on = (r.initiative_ids || []).filter((x) => ids.has(x));
|
|
342
|
+
if (!on.length) continue;
|
|
342
343
|
const at = r.release_at || r.deploy_at;
|
|
343
344
|
if (!at || at.slice(0, 10) < day) continue;
|
|
344
|
-
|
|
345
|
+
hits.push({ id: r.id, type: r.type, at, name: r.fix_version || r.id, ini: on });
|
|
345
346
|
}
|
|
346
|
-
|
|
347
|
+
hits.sort((x, y) => String(x.at).localeCompare(String(y.at)));
|
|
348
|
+
// the next one, with the one after it (the mockup's Planned row)
|
|
349
|
+
return hits[0] ? { ...hits[0], later: hits[1] || null } : null;
|
|
347
350
|
}
|
|
348
351
|
const openAsks = (folded, boardId) => [...folded.asks.values()].filter((a) => a.board === boardId && a.state === 'open').length;
|
|
349
352
|
const pageAsk = (a) => ({ ...a, by: actorLib.pageName(a.by) });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.290.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.290.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -97,15 +97,22 @@ const rowOf = (key) => (M && M.rows || []).find((r) => r.key === key) || null;
|
|
|
97
97
|
|
|
98
98
|
/* ── sprint, release, documents ─────────────────────────────────────────────────────────────────────────── */
|
|
99
99
|
function drawSide() {
|
|
100
|
-
const S = M.sprint;
|
|
100
|
+
const S = M.sprint, R = M.release;
|
|
101
|
+
$('#hSpr').textContent = S.name || 'Sprint';
|
|
101
102
|
$('#sprCap').textContent = S.cap || '';
|
|
102
103
|
$('#sprBody').innerHTML = S.name
|
|
103
|
-
? `<
|
|
104
|
+
? `<button type="button" class="spr sprb" data-open="board:sprint" aria-haspopup="dialog" aria-label="${esc(S.name)}, ${esc(S.cap || '')}. Open the sprint"><span class="sbar" aria-hidden="true"><i class="d" style="width:${S.pct.done}%"></i><i class="g" style="width:${S.pct.doing}%"></i></span>`
|
|
105
|
+
+ `<span class="cnt"><span><b>${S.counts.done}</b> done</span><span><b>${S.counts.doing}</b> doing</span><span><b>${S.counts.todo}</b> to do</span></span>`
|
|
106
|
+
+ `${S.goal ? `<span class="goal2">Goal: ${esc(S.goal)}</span>` : ''}${S.review ? `<span class="sum3">${esc(S.review)}</span>` : ''}</button>`
|
|
104
107
|
: `<p class="mut">${esc(S.why)}</p>`;
|
|
105
|
-
|
|
106
|
-
$('#relCap').textContent = R.
|
|
107
|
-
$('#relBody').innerHTML = R.
|
|
108
|
+
$('#hRel').textContent = 'Next release';
|
|
109
|
+
$('#relCap').textContent = R.rel && R.rel.length ? '' : 'none';
|
|
110
|
+
$('#relBody').innerHTML = R.rel && R.rel.length
|
|
111
|
+
? `<div class="rels">${R.rel.map((r) => `<button type="button" class="rel" data-open="board:release" aria-haspopup="dialog"><span class="rh"><b>${esc(r.name)}</b><em class="rtag">${esc(r.tag)}</em><time>${esc(r.at)}${r.away ? ' · ' + esc(r.away) : ''}</time></span>${r.ini.map((i) => `<span class="ri"><i class="hd ${i.tone}"></i>${esc(i.title)}${i.status ? ' · ' + esc(i.status) : ''}</span>`).join('')}</button>`).join('')}</div>`
|
|
112
|
+
: `<p class="empty3 plain">${esc(R.why)}</p>`;
|
|
108
113
|
}
|
|
114
|
+
$('#cSpr').addEventListener('click', (e) => { const b = e.target.closest('[data-open]'); if (b) openRow(rowOf(b.dataset.open)); });
|
|
115
|
+
$('#cRel').addEventListener('click', (e) => { const b = e.target.closest('[data-open]'); if (b) openRow(rowOf(b.dataset.open)); });
|
|
109
116
|
function docRow(d) {
|
|
110
117
|
const act = !d.act ? '' : d.act.kind === 'draft' ? `<button class="dmcta alt" data-draft="${esc(d.key)}"${d.running ? ' disabled' : ''}>${d.running ? '<span class="spin"></span>' : ICO('<path d="M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"/>')}${esc(d.act.label)}</button>` : `<button class="dmcta alt" data-tab="${esc(d.act.tab)}">${esc(d.act.label)}</button>`;
|
|
111
118
|
return `<div class="dmr ${esc(d.st || '')}" role="listitem">${d.path ? `<button class="dmo" data-doc="${esc(d.key)}" aria-haspopup="dialog">` : '<span class="dmo">'}<span class="dmi c-Board">${ICO(DOCI)}</span><span class="dmn"><b>${esc(d.title)}</b><small>${esc(d.what)}</small><span class="dmm"><span class="s ${esc(d.st || 'live')}">${ICO(STATE_ICO[d.state] || STATE_ICO['Not started'])}${esc(d.state)}</span>${d.added ? `<span>${ICO('<rect x="3" y="5" width="18" height="16" rx="3"/><path d="M3 10h18M8 3v4M16 3v4"/>')}added ${esc(d.added)}</span>` : ''}${d.cadence ? `<span>${ICO('<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>')}${esc(d.cadence)}</span>` : ''}${d.by ? `<span>${ICO('<circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/>')}${esc(d.by)}</span>` : ''}</span></span>${d.path ? '</button>' : '</span>'}<span class="dmq">${act}</span></div>`;
|
|
@@ -166,7 +173,7 @@ $('#asksHost').addEventListener('click', (e) => { if (M) onAsks(e, ctxOf(), M.as
|
|
|
166
173
|
$('#newIni').onclick = () => { closeMenu(); openIniForm(ctxOf(), null); };
|
|
167
174
|
|
|
168
175
|
/* ── dock ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
169
|
-
function drawDock() { $('#dN').textContent = M.dock.needs; $('#dLab').textContent = M.dock.label; $('#dNext').innerHTML = M.dock.next ? `<i></i>First <b>${esc(M.dock.next)}</b>` : 'Nothing is late or at risk'; }
|
|
176
|
+
function drawDock() { $('#dN').textContent = M.dock.needs; $('#dLab').textContent = M.dock.label; $('#dNext').innerHTML = (M.dock.next ? `<i></i>First <b>${esc(M.dock.next)}</b>` : 'Nothing is late or at risk') + (M.dock.release ? ` <span class="sep"></span> Next release <b>${esc(M.dock.release.at)}</b> ${esc(M.dock.release.name)}` : ''); }
|
|
170
177
|
|
|
171
178
|
/* ── the dialog: the initiative's record, no press, the read-only agent beside it ──────────────────────────── */
|
|
172
179
|
function cardHtml(r) { return `<div class="acard" id="card"><p class="ct">What this page can do</p><p class="nodef" id="holdWhy">${esc(r.dialog.hold)}</p></div>`; }
|
|
@@ -290,7 +297,6 @@ async function startMetrics(ws) {
|
|
|
290
297
|
clearTimeout(metTimer);
|
|
291
298
|
let r = null;
|
|
292
299
|
try { const res = await fetch('/api/board-metrics-premium?ws=' + encodeURIComponent(ws || ''), { credentials: 'same-origin' }); r = await res.json(); } catch { r = null; }
|
|
293
|
-
if (r && r.ok && r.state === 'none') { MM = null; metDraw(); return; } // the home workspace's board has no card
|
|
294
300
|
if (!r || !r.ok || r.state !== 'ready') {
|
|
295
301
|
MM = null; metDraw(); $('#cMet').hidden = false; $('#metCap').textContent = 'not read'; $('#metHint').textContent = 'The metrics could not be read, so none is shown.' + (r && r.error ? ' The reason: ' + r.error : ''); $('#metBody').innerHTML = ''; $('#metNote').textContent = '';
|
|
296
302
|
return;
|
|
@@ -697,6 +697,19 @@ a.round{color:inherit;text-decoration:none}
|
|
|
697
697
|
.ini2.ibi{width:calc(100% + 24px);margin:0 -12px;padding:12px;border-radius:var(--r-in);text-align:left;transition:background .25s}
|
|
698
698
|
.ini2.ibi:hover{background:var(--well)}
|
|
699
699
|
#cSpr .spr{background:var(--well)}
|
|
700
|
+
/* Sprint and Next release cards as the mockup draws them */
|
|
701
|
+
.spr.sprb{display:grid;width:100%;text-align:left;background:none;padding:0;border-radius:var(--r-in);gap:12px;cursor:pointer}
|
|
702
|
+
.sbar{display:flex;gap:4px;height:6px}
|
|
703
|
+
.sbar i{display:block;border-radius:8px}
|
|
704
|
+
.sbar::after{content:"";flex:1;border-radius:8px;background:var(--b3)}
|
|
705
|
+
.sbar .d{background:var(--ok)}.sbar .g{background:var(--solid)}
|
|
706
|
+
.rels{display:grid;gap:14px}
|
|
707
|
+
.rel{display:grid;gap:6px;width:100%;text-align:left;cursor:pointer}
|
|
708
|
+
.rel .rh{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
|
|
709
|
+
.rel .rh b{font-size:15px}
|
|
710
|
+
.rel .rh time{margin-left:auto;font:500 12px var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--ink-2)}
|
|
711
|
+
.rtag{font-style:normal;font-size:12px;font-weight:650;padding:2px 10px;border-radius:12px;background:var(--well)}
|
|
712
|
+
.rel .ri{font-size:13.5px;color:var(--ink-2)}
|
|
700
713
|
.goal2,.sum3{margin:0;font-size:var(--t-body);line-height:1.5}
|
|
701
714
|
.sum3{color:var(--ink-2)}
|
|
702
715
|
@media (max-width:999px){
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
<div id="sprBody"></div>
|
|
65
65
|
</section>
|
|
66
66
|
<section class="card rise" style="--d:7" id="cRel" aria-labelledby="hRel">
|
|
67
|
-
<div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="16" rx="3"/><path d="M3 10h18M8 3v4M16 3v4"/></svg></span><h2 id="hRel">
|
|
67
|
+
<div class="ch"><span class="ic"><svg class="i" viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="16" rx="3"/><path d="M3 10h18M8 3v4M16 3v4"/></svg></span><h2 id="hRel">Next release</h2><small id="relCap"></small></div>
|
|
68
68
|
<div id="relBody"></div>
|
|
69
69
|
</section>
|
|
70
70
|
</div>
|