create-pmos 0.360.0 → 0.362.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 +35 -25
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/briefing-premium-sources-test.js +22 -0
- package/workspace/briefing-premium-test.js +12 -1
- package/workspace/changelog.json +34 -0
- package/workspace/guide/briefing-premium.md +6 -3
- package/workspace/lib/board-premium.js +8 -3
- package/workspace/lib/engine/boards.js +5 -3
- package/workspace/lib/first-input.js +44 -5
- package/workspace/lib/harness-health.js +95 -0
- package/workspace/lib/proactive.js +21 -3
- package/workspace/lib/refresh-run.js +20 -0
- package/workspace/lib/refresh.js +38 -4
- package/workspace/lib/routes-board-premium.js +1 -1
- package/workspace/lib/routes-boards.js +15 -1
- package/workspace/lib/routes-sources.js +4 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-vw-jira-test.js +22 -6
- package/workspace/public/pm/premium-board.js +3 -3
- package/workspace/public/pm/premium-shell.js +24 -6
- package/workspace/public/pm/premium-vw-jira-model.js +8 -5
- package/workspace/public/pm/premium-vw-jira.css +9 -0
- package/workspace/public/pm/premium-vw-jira.js +21 -9
- package/workspace/public/pm/premium.css +6 -0
- package/workspace/server.js +69 -16
- package/workspace/test-lists/harness-health.json +5 -0
|
@@ -29,6 +29,7 @@ function create(host) {
|
|
|
29
29
|
const expect = new Map(); // source id → { trigger, note, inputs } for the start the engine itself is making now
|
|
30
30
|
const jobWait = new Map(); // job id → ms it started waiting for an input
|
|
31
31
|
let lastPrune = 0;
|
|
32
|
+
let lastRetire = 0;
|
|
32
33
|
|
|
33
34
|
/* ── settings, with the one-time move of the seed schedules (R3) ── */
|
|
34
35
|
function settings() {
|
|
@@ -41,6 +42,12 @@ function create(host) {
|
|
|
41
42
|
s = R.withDefaults(m.settings);
|
|
42
43
|
} catch (e) { warn('refresh settings (moving the schedules)', e); }
|
|
43
44
|
}
|
|
45
|
+
// harness-health: a schedules.json entry of a managed skill that is still on (another workspace's morning brief) ends here.
|
|
46
|
+
if (s.migrated && now() - lastRetire >= 60000) {
|
|
47
|
+
lastRetire = now();
|
|
48
|
+
try { const r = R.retireLegacy(s, host.schedules.read()); if (r.retired.length) { host.schedules.write(r.schedules); warn('refresh settings', { message: 'ended the old schedules ' + r.retired.join(', ') + ': Settings › Data refresh runs them' }); } }
|
|
49
|
+
catch (e) { warn('refresh settings (ending old schedules)', e); }
|
|
50
|
+
}
|
|
44
51
|
// The day check's minutes have one home: the proactive settings.
|
|
45
52
|
const every = String(((host.proactive() || {}).dayCheck || {}).every || '60');
|
|
46
53
|
s.sources.daycheck.s = { kind: 'every', every: ['30', '60'].includes(every) ? every : '60', work: true };
|
|
@@ -173,6 +180,19 @@ function create(host) {
|
|
|
173
180
|
}
|
|
174
181
|
continue;
|
|
175
182
|
}
|
|
183
|
+
// harness-health: a scheduled run first refreshes its old inputs, then waits for them (the input wait above, at most 30 min).
|
|
184
|
+
if (['schedule', 'catch-up'].includes(d.trigger) && !(cur[src.id] || {}).waiting_since) {
|
|
185
|
+
const f = log();
|
|
186
|
+
const lastDone = (id) => { const runs = f.runs(id, 20) || []; const l = runs.find((r) => r.result === 'done'); return l ? Date.parse(l.end_at || l.start_at) || 0 : 0; };
|
|
187
|
+
const first = R.refreshFirst(src, { now: t, settings: set, inputState: inputStateFn(set, cur, t), lastDone });
|
|
188
|
+
const begun = first.filter((id) => { const x = R.BY_ID.get(id); return start(x, (set.sources[id] && set.sources[id].ws) || ws, { trigger: d.trigger, note: 'Refreshed first, before ' + src.label }).ok; });
|
|
189
|
+
if (begun.length) {
|
|
190
|
+
const nx = R.readState(dir);
|
|
191
|
+
nx[src.id] = { ...(nx[src.id] || {}), waiting_since: t, waiting_for: begun, waiting_why: null };
|
|
192
|
+
R.writeState(dir, nx);
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
176
196
|
start(src, ws, { trigger: d.trigger, slot: d.slot, note: d.note });
|
|
177
197
|
}
|
|
178
198
|
if (t - lastPrune > PRUNE_EVERY_MS) {
|
package/workspace/lib/refresh.js
CHANGED
|
@@ -31,13 +31,14 @@ const SKILL_KINDS = Object.freeze(['manual', 'every', 'daily', 'weekdays', 'week
|
|
|
31
31
|
const EVERY = Object.freeze(['15', '30', '60', '120', '240']);
|
|
32
32
|
const WAIT_MS = 30 * 60 * 1000; // a refresh waits at most this long for its inputs
|
|
33
33
|
const LATE_MS = 15 * 60 * 1000; // a slot older than this when first seen was missed (PMOS was closed)
|
|
34
|
+
const FIRST_MS = 2 * 3600 * 1000; // harness-health: a scheduled run first refreshes its skill inputs whose last good read is older than this
|
|
34
35
|
const MAX_TIMES = 4;
|
|
35
36
|
|
|
36
37
|
/* The sources. `fresh` names the lib/freshness.js row whose age and detail this source shares; `copy` names the files a done run keeps. */
|
|
37
38
|
const SOURCES = Object.freeze([
|
|
38
39
|
{ id: 'calendar', label: 'Calendar', group: 'tools', ic: 'cal', run: 'skill', skill: 'calendar-sync', how: 'tool', fresh: 'calendar',
|
|
39
40
|
what: 'Events from your calendars, for Calendar, the phone day, meeting focus and meeting notes.', uses: [],
|
|
40
|
-
impact: 'Calendar, the phone day, meeting focus
|
|
41
|
+
impact: 'Calendar, the phone day, meeting focus, meeting notes and the Briefing\'s Today card show the last import.',
|
|
41
42
|
def: { kind: 'daily', times: ['06:30', '12:30'] } },
|
|
42
43
|
{ id: 'jira', label: 'Jira tickets and sprints', group: 'tools', ic: 'org', run: 'skill', skill: 'jira-sync', how: 'tool', fresh: 'jira', copy: 'jira',
|
|
43
44
|
what: 'The status of every pushed ticket, the active sprints, and each sprint\'s goal and team summary.', uses: [],
|
|
@@ -52,7 +53,7 @@ const SOURCES = Object.freeze([
|
|
|
52
53
|
impact: 'The bi-weekly report says the tracker was not refreshed.',
|
|
53
54
|
def: { kind: 'weekly', day: 'Fri', times: ['15:30'] } },
|
|
54
55
|
{ id: 'brief', label: 'Morning briefing', group: 'pmos', ic: 'sun', run: 'skill', skill: 'morning-brief', how: 'bg',
|
|
55
|
-
what: 'Your Briefing for the day, ranked by what needs you first.', uses: ['mywork'],
|
|
56
|
+
what: 'Your Briefing for the day, ranked by what needs you first. When it is due, the sources it is built on that are older than 2 hours are refreshed first.', uses: ['calendar', 'jira', 'mywork'],
|
|
56
57
|
impact: 'No new Briefing for the day, and the day check has nothing to update.',
|
|
57
58
|
def: { kind: 'daily', times: ['06:45'] } },
|
|
58
59
|
{ id: 'daycheck', label: 'Day check', group: 'pmos', ic: 'clock', run: 'job', how: 'bg',
|
|
@@ -212,6 +213,39 @@ function migrate(settings, schedules, { homeWs } = {}) {
|
|
|
212
213
|
return { settings: next, schedules: list, adopted };
|
|
213
214
|
}
|
|
214
215
|
|
|
216
|
+
/**
|
|
217
|
+
* The schedules.json entries that still run a managed skill after the move (harness-health). migrate() adopted the entries of ONE
|
|
218
|
+
* workspace; an entry of the same skill in another workspace stayed on and kept starting its own run, so two morning briefs started
|
|
219
|
+
* at 06:45 every day, outside the refresh order. Once the settings are migrated, every such entry ends with the same reason.
|
|
220
|
+
* → { schedules, retired: [id] }. Pure: the caller writes the list.
|
|
221
|
+
*/
|
|
222
|
+
function retireLegacy(settings, schedules) {
|
|
223
|
+
const list = (schedules || []).map((x) => ({ ...x }));
|
|
224
|
+
const retired = [];
|
|
225
|
+
if (!settings || !settings.migrated) return { schedules: list, retired };
|
|
226
|
+
for (const x of list) {
|
|
227
|
+
if (x.enabled === false || x.endedReason || !SKILL_OF.has(x.skill)) continue;
|
|
228
|
+
x.enabled = false; x.endedReason = 'Moved to Settings › Data refresh'; x.nextRun = null;
|
|
229
|
+
retired.push(x.id);
|
|
230
|
+
}
|
|
231
|
+
return { schedules: list, retired };
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* The inputs a scheduled run of `src` refreshes before it starts (harness-health): its skill inputs that are on, not running or
|
|
236
|
+
* waiting, and whose last good read is older than FIRST_MS. The morning brief at 06:45 read calendar, Jira and work assigned to you
|
|
237
|
+
* as they were at 09:00 the day before, because those refresh on their own later times. → [id]
|
|
238
|
+
* ctx { now, settings, inputState(id), lastDone(id) → ms|0 }
|
|
239
|
+
*/
|
|
240
|
+
function refreshFirst(src, ctx) {
|
|
241
|
+
return (src.uses || []).filter((id) => {
|
|
242
|
+
const x = BY_ID.get(id); const set = ctx.settings.sources[id];
|
|
243
|
+
if (!x || x.run !== 'skill' || !set || !set.on) return false;
|
|
244
|
+
if (ctx.inputState(id) !== 'ok') return false;
|
|
245
|
+
return ctx.now - (ctx.lastDone(id) || 0) > FIRST_MS;
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
|
|
215
249
|
/* ── the decision ── */
|
|
216
250
|
/**
|
|
217
251
|
* What the tick should do for skill source `src` now. → { act: 'start'|'skip'|'wait'|'none', trigger?, slot?, why?, note? }
|
|
@@ -458,7 +492,7 @@ function toCsv(runs) {
|
|
|
458
492
|
}
|
|
459
493
|
|
|
460
494
|
module.exports = {
|
|
461
|
-
SOURCES, BY_ID, SKILL_OF, SKILL_KINDS, EVERY, WAIT_MS, LATE_MS, RULE_DEFAULTS, RULE_OPTS,
|
|
462
|
-
usedBy, normalize, normalizeRules, withDefaults, migrate, lastSlot, nextSlot, slotsOfDay, inWindow, inQuiet, decide, jobGate, sourceOfOrigin, rowsOf, textOf,
|
|
495
|
+
SOURCES, BY_ID, SKILL_OF, SKILL_KINDS, EVERY, WAIT_MS, LATE_MS, FIRST_MS, RULE_DEFAULTS, RULE_OPTS,
|
|
496
|
+
usedBy, normalize, normalizeRules, withDefaults, migrate, retireLegacy, refreshFirst, lastSlot, nextSlot, slotsOfDay, inWindow, inQuiet, decide, jobGate, sourceOfOrigin, rowsOf, textOf,
|
|
463
497
|
files, readSettings, writeSettings, readState, writeState, newRun, append, readLog, foldLog, keepCopy, prune, toCsv,
|
|
464
498
|
};
|
|
@@ -85,7 +85,7 @@ module.exports = {
|
|
|
85
85
|
try { const w = ctx.getWs ? ctx.getWs(pick.ws) : null; custom = w ? Custom.list(w.root, 'board:' + pick.id) : []; } catch { custom = []; missing.push('added documents'); }
|
|
86
86
|
const model = BoardPremium.build({
|
|
87
87
|
now: Date.now(), pending: false, missing: missing.filter((m) => m !== 'core documents'), boards: all.map((x) => ({ ws: x.ws, id: x.id, name: x.name })),
|
|
88
|
-
board: head.body.board, counts: head.body.counts, nextRelease: head.body.nextRelease || null,
|
|
88
|
+
board: head.body.board, counts: head.body.counts, nextRelease: head.body.nextRelease || null, pastReleases: head.body.pastReleases || [],
|
|
89
89
|
rows: listOf(rk, nw), columns: c ? c.columns : [], sprints: s || { source: 'none', sprints: [] }, docs: d, custom,
|
|
90
90
|
held: hd ? hd.rows : [], cancelled: cn ? cn.rows : [], archived: ar ? ar.rows : [], asks: ak ? ak.asks || [] : null,
|
|
91
91
|
});
|
|
@@ -348,6 +348,19 @@ function nextReleaseOf(releases, ids) {
|
|
|
348
348
|
// the next one, with the one after it (the mockup's Planned row)
|
|
349
349
|
return hits[0] ? { ...hits[0], later: hits[1] || null } : null;
|
|
350
350
|
}
|
|
351
|
+
/** The past releases that carry an initiative of the board, the latest first (at most `n`): the board's release history. */
|
|
352
|
+
function pastReleasesOf(releases, ids, n = 3) {
|
|
353
|
+
const day = today();
|
|
354
|
+
const hits = [];
|
|
355
|
+
for (const r of releases) {
|
|
356
|
+
const on = (r.initiative_ids || []).filter((x) => ids.has(x));
|
|
357
|
+
if (!on.length) continue;
|
|
358
|
+
const at = r.release_at || r.deploy_at;
|
|
359
|
+
if (!at || at.slice(0, 10) >= day) continue;
|
|
360
|
+
hits.push({ id: r.id, type: r.type, at, name: r.fix_version || r.id, ini: on, accepted: !!r.accepted_at });
|
|
361
|
+
}
|
|
362
|
+
return hits.sort((x, y) => String(y.at).localeCompare(String(x.at))).slice(0, n);
|
|
363
|
+
}
|
|
351
364
|
const openAsks = (folded, boardId) => [...folded.asks.values()].filter((a) => a.board === boardId && a.state === 'open').length;
|
|
352
365
|
const pageAsk = (a) => ({ ...a, by: actorLib.pageName(a.by) });
|
|
353
366
|
const pageMove = (m) => ({ ...m, by: actorLib.pageName(m.by) });
|
|
@@ -461,8 +474,9 @@ const READS = {
|
|
|
461
474
|
if (!r) return;
|
|
462
475
|
const c = B.counts(r.rows, r.board.workflow);
|
|
463
476
|
const recent = r.fr.folded.moves.filter((m) => m.board === r.board.id).slice(-10).reverse().map(pageMove);
|
|
477
|
+
const rels = readReleases(ctx), ids = new Set(r.rows.map((x) => x.id));
|
|
464
478
|
ctx.json(res, { ok: true, board: { ...r.board, health: B.health(r.rows) }, counts: { total: c.total, open: c.open, byStage: c.byStage, byStatus: c.byStatus, byCat: c.byCat },
|
|
465
|
-
asks: openAsks(r.fr.folded, r.board.id), nextRelease: nextReleaseOf(
|
|
479
|
+
asks: openAsks(r.fr.folded, r.board.id), nextRelease: nextReleaseOf(rels, ids), pastReleases: pastReleasesOf(rels, ids), recent });
|
|
466
480
|
},
|
|
467
481
|
'/api/boards/backlog': (ctx, res, url) => {
|
|
468
482
|
const r = boardRead(ctx, res, url);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/* routes-sources.js — how old each source of a workspace is, and Refresh now (workspace-data-freshness R6, R7).
|
|
3
3
|
*
|
|
4
|
-
* GET /api/sources?ws=<id> → { ok, ws, version, sources: [row] } lib/freshness.js sources()
|
|
4
|
+
* GET /api/sources?ws=<id> → { ok, ws, version, sources: [row], health } lib/freshness.js sources(); health is
|
|
5
|
+
* lib/harness-health.js of(): { level, line, issues } or null
|
|
5
6
|
* POST /api/sources/refresh { ws, source } → { ok, source, started: 'rebuild'|'session', session? }
|
|
6
7
|
* POST /api/sources/watch { ws, on } → { ok, watch } the change detector on or off for this repository
|
|
7
8
|
*
|
|
@@ -28,7 +29,8 @@ async function handle(req, res, url, ctx) {
|
|
|
28
29
|
const w = wsOf(ctx, url.searchParams.get('ws'));
|
|
29
30
|
if (!w) { ctx.json(res, { ok: false, error: 'no such workspace' }, 404); return true; }
|
|
30
31
|
const sources = F.sources({ id: w.id, root: w.root, repoStateDir: repoStateDir(ctx, w) });
|
|
31
|
-
|
|
32
|
+
let health = null; try { health = ctx.health ? ctx.health() : null; } catch { health = null; }
|
|
33
|
+
ctx.json(res, { ok: true, ws: w.id, version: F.versions()[w.id] || 0, sources, health });
|
|
32
34
|
return true;
|
|
33
35
|
}
|
|
34
36
|
if (p !== '/api/sources/refresh' && p !== '/api/sources/watch') return false;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.362.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.362.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -33,13 +33,16 @@ const SP = { name: 'Sprint 14', state: 'active', start: '2026-10-07', end: '2026
|
|
|
33
33
|
const SPRINTS = {
|
|
34
34
|
ok: true, ws: 'w1', board: 'w1', source: 'jira', readAt: new Date().toISOString(), velocity: [],
|
|
35
35
|
sprints: [
|
|
36
|
-
{ ...SP, goal: { from: 'tickets', text: 'Ship guided setup to new workspaces' }, points: { committed: 10, done: 3, unestimated: 0 }, pace: { daysLeft: 2 }, counts: { todo: 2, doing: 1, done: 1 },
|
|
36
|
+
{ ...SP, goal: { from: 'tickets', text: 'Ship guided setup to new workspaces', jira: 'Setup' }, summary: 'Three tickets on guided setup, one blocked.', points: { committed: 10, done: 3, unestimated: 0 }, pace: { daysLeft: 2 }, counts: { todo: 2, doing: 1, done: 1 },
|
|
37
37
|
issues: [
|
|
38
38
|
{ key: 'PMOS-142', summary: 'Migration check for older workspaces', status: 'To Do', category: 'todo', initiative: 'self-serve-v2', flagged: true, reason: 'Flagged in Jira', points: 5 },
|
|
39
39
|
{ key: 'PMOS-141', summary: 'Setup drops custom fields', status: 'Code review', category: 'doing', initiative: 'self-serve-v2', flagged: false, reason: null, points: 2 },
|
|
40
40
|
{ key: 'PMOS-138', summary: 'Guided setup copy', status: 'Done', category: 'done', initiative: 'self-serve-v2', flagged: false, reason: null, points: 3 },
|
|
41
|
-
{ key: 'OPS-9', summary: 'Rotate keys', status: 'To Do', category: 'todo', initiative: null, flagged: false, reason: null, points: null }] },
|
|
42
|
-
{ name: 'Sprint 15', state: 'future', start: '2026-10-22', end: '2026-11-04', goal: null, jiraGoal: null, points: null, counts: { todo: 0, doing: 0, done: 0 }, issues: [] }
|
|
41
|
+
{ key: 'OPS-9', summary: 'Rotate keys', status: 'To Do', category: 'todo', initiative: null, flagged: false, reason: null, points: null, url: 'https://acme.atlassian.net/browse/OPS-9' }] },
|
|
42
|
+
{ name: 'Sprint 15', state: 'future', start: '2026-10-22', end: '2026-11-04', goal: null, jiraGoal: null, points: null, counts: { todo: 0, doing: 0, done: 0 }, issues: [] },
|
|
43
|
+
{ name: 'Sprint 12', state: 'closed', start: '2026-09-09', end: '2026-09-23', goal: null, jiraGoal: null, points: null, counts: { todo: 0, doing: 0, done: 1 },
|
|
44
|
+
issues: [{ key: 'PMOS-120', summary: 'Old work', status: 'Done', category: 'done', initiative: null, flagged: false, reason: null, points: null }] },
|
|
45
|
+
{ name: 'Sprint 13', state: 'closed', start: '2026-09-23', end: '2026-10-07', goal: null, jiraGoal: null, points: null, counts: { todo: 0, doing: 0, done: 0 }, issues: [] }],
|
|
43
46
|
};
|
|
44
47
|
const TICKETS = {
|
|
45
48
|
ok: true, initiative: 'self-serve-v2', title: 'Self-serve onboarding v2', prd: 'planning/prd/self-serve-v2-prd.md', checkedAt: new Date().toISOString(),
|
|
@@ -85,14 +88,27 @@ const TICKETS = {
|
|
|
85
88
|
await p.click('#cSpr [data-open="board:sprint"]');
|
|
86
89
|
const board = await until(async () => { const t = await paneText(p, 'sprint:w1'); return t && /Migration check/.test(t) ? t : null; });
|
|
87
90
|
ok('B1 the Sprint card opens the dialog with the sprint as a second tab', !!board && (await tabIds(p)).join() === 'main,sprint:w1', JSON.stringify(await tabIds(p)));
|
|
88
|
-
ok('B2 the board names the sprint, its dates, goal, days left and points from the read', /Sprint 14 · 7 Oct – 21 Oct/.test(board) && /
|
|
91
|
+
ok('B2 the board names the sprint, its dates, goal, days left and points from the read', /Sprint 14 · 7 Oct – 21 Oct/.test(board) && /Sprint goal · from the tickets/i.test(board) && /Ship guided setup/.test(board) && /Three tickets on guided setup/.test(board) && /In Jira: “Setup”/.test(board) && /2 days left/.test(board) && /3 of 10 points done/.test(board), board);
|
|
89
92
|
const cols = await p.evaluate(() => [...document.querySelectorAll('.jcol')].map((c) => c.querySelector('.jcolh').textContent + ':' + c.querySelectorAll('.jcrd').length).join());
|
|
90
93
|
ok('B3 the cards sit in To do, In progress and Done by the reading\'s category', cols === 'To do2:2,In progress1:1,Done1:1', cols);
|
|
91
94
|
ok('B4 a card shows its own Jira status where it differs from the column, a flag, and points', await p.evaluate(() => { const c = [...document.querySelectorAll('.jcrd')]; const r = c.find((x) => /PMOS-141/.test(x.textContent)), f = c.find((x) => /PMOS-142/.test(x.textContent)); return /Code review/.test(r.textContent) && /2/.test(r.querySelector('.jpts').textContent) && f.classList.contains('risk') && /Flagged in Jira/.test(f.textContent); }));
|
|
92
|
-
ok('B5
|
|
95
|
+
ok('B5 every ticket is a button, the one on no initiative of the board too', await p.evaluate(() => [...document.querySelectorAll('.jcrd')].every((x) => x.tagName === 'BUTTON')));
|
|
96
|
+
ok('B8 the closed sprints fold behind Past sprints, shut by default, after the active and next ones', await p.evaluate(() => { const f = document.querySelector('#jpast'), b = document.querySelector('[data-jpast]');
|
|
97
|
+
return !!f && f.hidden && /Past sprints\s*2/.test(b.textContent) && b.getAttribute('aria-expanded') === 'false' && [...document.querySelectorAll('.jseg:not(.jpast) [data-sp]')].map((x) => x.dataset.sp).join() === 'Sprint 14,Sprint 15'; }));
|
|
98
|
+
await p.click('[data-jpast]');
|
|
99
|
+
ok('B9 Past sprints opens the closed ones; one press shows a closed sprint and keeps the fold open', await p.evaluate(() => !document.querySelector('#jpast').hidden));
|
|
100
|
+
await p.click('#jpast [data-sp="Sprint 12"]');
|
|
101
|
+
ok('B10 a closed sprint draws its board, and the fold stays open on it', !!(await until(async () => { const t = await paneText(p, 'sprint:w1'); return t && /Sprint 12 · 9 Sep – 23 Sep/.test(t) && /Old work/.test(t) && await p.evaluate(() => !document.querySelector('#jpast').hidden); })));
|
|
102
|
+
await p.click('[data-jpast]'); await p.click('.jseg [data-sp="Sprint 14"]');
|
|
103
|
+
await until(async () => { const t = await paneText(p, 'sprint:w1'); return t && /Sprint 14 ·/.test(t); });
|
|
104
|
+
ok('B11 shut again, the fold stays shut on the active sprint', await p.evaluate(() => document.querySelector('#jpast').hidden));
|
|
105
|
+
await p.click('.jcrd[data-k="OPS-9"]');
|
|
106
|
+
const o9 = await until(async () => { const t = await paneText(p, 'jira:OPS-9'); return t && /Rotate keys/.test(t) ? t : null; });
|
|
107
|
+
ok('B12 a ticket on no initiative opens its tab from the sprint read, with its Jira link', !!o9 && /on no initiative of this board/.test(o9) && await p.evaluate(() => [...document.querySelectorAll('#dOut .obody.vw:not([hidden]) a[href]')].some((a) => a.href === 'https://acme.atlassian.net/browse/OPS-9')), o9);
|
|
108
|
+
await p.click('#vTabs [data-vx="jira:OPS-9"]'); await p.click('#vTabs .vtab[data-vw="sprint:w1"]');
|
|
93
109
|
ok('B6 the view says it is read-only and moves nothing', /Read-only: Jira owns each ticket's status and sprint/.test(board) && !(await p.$('#dOut .obody.vw [draggable="true"]')));
|
|
94
110
|
await p.click('.jseg [data-sp="Sprint 15"]');
|
|
95
|
-
ok('B7 the other sprint is one press away, and an empty one draws empty columns', !!(await until(async () => { const t = await paneText(p, 'sprint:w1'); return t && /Sprint 15 · 22 Oct – 4 Nov/.test(t) && /No
|
|
111
|
+
ok('B7 the other sprint is one press away, and an empty one draws empty columns', !!(await until(async () => { const t = await paneText(p, 'sprint:w1'); return t && /Sprint 15 · 22 Oct – 4 Nov/.test(t) && /No goal yet\. The Jira status check writes one from the tickets/.test(t) && (t.match(/None/g) || []).length === 3; })));
|
|
96
112
|
await p.click('.jseg [data-sp="Sprint 14"]');
|
|
97
113
|
await until(() => p.$('.jcrd[data-k="PMOS-142"]'));
|
|
98
114
|
|
|
@@ -111,9 +111,9 @@ function drawSide() {
|
|
|
111
111
|
+ `${S.goal ? `<span class="goal2">Goal: ${esc(S.goal)}</span>` : ''}${S.review ? `<span class="sum3">${esc(S.review)}</span>` : ''}</button>`
|
|
112
112
|
: `<p class="mut">${esc(S.why)}</p>`;
|
|
113
113
|
$('#hRel').textContent = 'Next release';
|
|
114
|
-
$('#relCap').textContent = R.
|
|
114
|
+
$('#relCap').textContent = R.at ? '' : R.cap || 'none';
|
|
115
115
|
$('#relBody').innerHTML = R.rel && R.rel.length
|
|
116
|
-
? `<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>`
|
|
116
|
+
? `${R.at ? '' : `<p class="empty3 plain">${esc(R.why)}</p>`}<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>`
|
|
117
117
|
: `<p class="empty3 plain">${esc(R.why)}</p>`;
|
|
118
118
|
}
|
|
119
119
|
$('#cSpr').addEventListener('click', (e) => { const b = e.target.closest('[data-open]'); if (b) openRow(rowOf(b.dataset.open)); });
|
|
@@ -199,7 +199,7 @@ function paneHtml(r) {
|
|
|
199
199
|
function openRow(r) {
|
|
200
200
|
if (!r) return;
|
|
201
201
|
const d = r.dialog;
|
|
202
|
-
openDlg({ eye: d.eye + ' · real data', title: r.title, sub: r.sub + (r.statusLabel ? ' · ' + r.statusLabel : ''), say: d.say, stream: turnA(logHtml(d)) + turnA(ptx(d.say)) + cardHtml(r), noteKey: r.key, pane: paneHtml(r), label: d.pane.label });
|
|
202
|
+
openDlg({ eye: d.eye + ' · real data', title: r.title, sub: r.sub + (r.statusLabel ? ' · ' + r.statusLabel : ''), say: d.say, stream: turnA(logHtml(d)) + turnA(ptx(d.say)) + cardHtml(r), noteKey: r.key, pane: paneHtml(r), label: d.pane.label, compact: r.key === 'board:sprint' }); // compact: the short phone head of the meeting dialog, so the sprint board gets the height
|
|
203
203
|
const vb = $('#oMain [data-vwopen]'); if (vb) vb.onclick = () => openWorkItem({ kind: 'initiative', id: r.id, title: r.title, ws: M.board.ws, board: M.board.id }); // its record, checks, tasks and links as a viewer tab (premium-viewer S7)
|
|
204
204
|
loadThread(r.key);
|
|
205
205
|
if (r.key === 'board:sprint') openSprint({ ws: M.board.ws, board: M.board.id, name: r.title }); // the sprint as a board by status, beside its facts (premium-viewer S5)
|
|
@@ -102,8 +102,16 @@ function tbDot() {
|
|
|
102
102
|
const d = $('#srcDot'), c = $('#srcChip'); if (!d || !c) return;
|
|
103
103
|
const behind = TB.src && TB.src.ok ? behindOf(lineItems(TB.src.sources)) : [];
|
|
104
104
|
const n = behind.length + TB.gaps, known = TB.src && TB.src.ok;
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
// harness-health: the background line sets the dot first; red when background work stopped, orange when it is late
|
|
106
|
+
const h = known && TB.src.health ? TB.src.health : null;
|
|
107
|
+
d.className = 'sdot ' + (h && h.level === 'bad' ? 'bad' : n || (TB.src && !TB.src.ok) || (h && h.level === 'warn') ? 'warn' : known ? 'ok' : '');
|
|
108
|
+
c.title = [h && h.level !== 'ok' ? h.line : '', TB.src && !TB.src.ok ? 'The sources could not be read' : n ? [behind.length ? behind.map((b) => b.text).join(', ') : '', TB.gaps ? TB.gaps + (TB.gaps === 1 ? ' source this page could not read' : ' sources this page could not read') : ''].filter(Boolean).join(' · ') : known && !(h && h.level !== 'ok') ? 'Every source was read recently' : known ? '' : 'Reading the sources'].filter(Boolean).join(' · ');
|
|
109
|
+
}
|
|
110
|
+
/** The background line at the top of Sources (harness-health): a dot, the line, and any further issues under it. */
|
|
111
|
+
function healthHtml() {
|
|
112
|
+
const h = TB.src && TB.src.ok ? TB.src.health : null; if (!h) return '';
|
|
113
|
+
const more = (h.issues || []).slice(1, 4);
|
|
114
|
+
return `<div class="hline ${esc(h.level)}" role="status"><b><i class="sdot ${h.level === 'bad' ? 'bad' : h.level === 'warn' ? 'warn' : 'ok'}" aria-hidden="true"></i>${esc(h.line)}</b>${more.length ? `<ul>${more.map((i) => `<li>${esc(i.text)}</li>`).join('')}</ul>` : ''}</div>`;
|
|
107
115
|
}
|
|
108
116
|
/** n: how many sources the page itself could not read (its header's missing list). */
|
|
109
117
|
export function setPageGaps(n) { TB.gaps = n || 0; tbDot(); }
|
|
@@ -121,9 +129,10 @@ export async function openSources() {
|
|
|
121
129
|
// the frame is drawn once; a re-read redraws only the rows, the button and the message, so the page's own part (the Briefing's picker) is left alone
|
|
122
130
|
const rowsHtml = () => { const s = TB.src; return !s ? '<p class="note">Reading the sources.</p>' : !s.ok ? '<p class="note err" role="alert">The sources could not be read.</p>' : s.sources.map(srcRow).join(''); };
|
|
123
131
|
const draw = () => {
|
|
124
|
-
if ($('#srcRows')) { $('#srcRows').innerHTML = rowsHtml(); $('#srcAll').disabled = TB.busy; $('#srcM').textContent = TB.msg; return; }
|
|
132
|
+
if ($('#srcRows')) { $('#srcRows').innerHTML = rowsHtml(); $('#srcHealth').innerHTML = healthHtml(); $('#srcAll').disabled = TB.busy; $('#srcM').textContent = TB.msg; return; }
|
|
125
133
|
park();
|
|
126
134
|
$('#oMain').innerHTML = `<article class="paper doc"><div class="addf">
|
|
135
|
+
<div id="srcHealth">${healthHtml()}</div>
|
|
127
136
|
<div class="srctop"><p class="note" style="margin:0">Each source is read on its own schedule, not live. Each row says when it was last read.</p><button type="button" class="cta" id="srcAll"${TB.busy ? ' disabled' : ''}>Refresh all</button></div>
|
|
128
137
|
<div>${TB.extra ? '<span class="label">Sources</span>' : ''}<div id="srcRows">${rowsHtml()}</div></div>
|
|
129
138
|
${TB.extra ? TB.extra.html() : ''}
|
|
@@ -711,6 +720,8 @@ addEventListener('keydown', (e) => {
|
|
|
711
720
|
pvMount();
|
|
712
721
|
/* ── Settings: the two things that cannot be defaulted (initiative premium-settings) ────────────────────────────────────────────────────
|
|
713
722
|
* Workspaces: GET /api/workspaces · POST /api/workspaces, /api/workspaces/forget. Connectors: GET and POST /api/proactive/settings {briefSources}.
|
|
723
|
+
* The GET also lists every connector the Claude session has (server.js sessionConnectors); one that backs no brief source is a row
|
|
724
|
+
* of its own, off until pressed ({connectors}), and says that nothing in PMOS reads it on its own yet; sessions use it either way.
|
|
714
725
|
* Each press saves what the console's section saves, and nothing else. Every other setting runs on a default and stays in the console. */
|
|
715
726
|
const SRC = { calendar: 'Calendar', wispr: 'Wispr Flow', mail: 'Mail', slack: 'Slack', jira: 'Jira', confluence: 'Confluence', github: 'GitHub', drive: 'Google Drive', figma: 'Figma', website: 'Your websites' };
|
|
716
727
|
|
|
@@ -821,18 +832,19 @@ async function updWaitRestart(from, log, say) {
|
|
|
821
832
|
}
|
|
822
833
|
|
|
823
834
|
export async function openSettings() {
|
|
824
|
-
const M = { ws: null, src: null, err: '', busy: false };
|
|
835
|
+
const M = { ws: null, src: null, conn: [], con: {}, err: '', busy: false };
|
|
825
836
|
const U = { phase: null, say: '', checking: false, open: new Set(), shut: new Set(), full: new Set() };
|
|
826
837
|
const draw = () => {
|
|
827
838
|
const w = M.ws, s = M.src;
|
|
828
839
|
const wsRows = w === null ? '<p class="note">Reading the repositories.</p>' : w.length ? w.map((x) => `<div class="sr"><span class="sn"><b>${esc(x.label || x.name || x.id)}</b><em>${esc(x.root || '')}${x.home ? ' · home' : ''}</em></span>${x.home ? '' : `<button type="button" class="cta alt" data-rm="${esc(x.id)}">Remove</button>`}</div>`).join('') : '<p class="note">No repository is registered yet.</p>';
|
|
829
840
|
const srcRows = s === null ? '<p class="note">Reading the sources.</p>' : Object.keys(SRC).filter((k) => k in s).map((k) => `<div class="sr"><span class="sn"><b>${esc(SRC[k])}</b><em>${s[k] ? 'The Briefing reads it' : 'The Briefing does not read it'}</em></span><button type="button" class="fchip" role="switch" aria-checked="${s[k]}" aria-label="${esc(SRC[k])}: the Briefing reads it" data-src="${esc(k)}">${s[k] ? 'On' : 'Off'}</button></div>`).join('');
|
|
841
|
+
const connRows = s === null ? '' : M.conn.filter((c) => !c.source).map((c) => { const on = M.con[c.name] === true; return `<div class="sr"><span class="sn"><b>${esc(c.label)}</b><em>${on ? 'On for a reader to come. Your sessions can use it now' : 'Your sessions can use it. Nothing in PMOS reads it on its own yet'}</em></span><button type="button" class="fchip" role="switch" aria-checked="${on}" aria-label="${esc(c.label)}: on" data-conn="${esc(c.name)}">${on ? 'On' : 'Off'}</button></div>`; }).join('');
|
|
830
842
|
$('#oMain').innerHTML = `<article class="paper doc"><div class="addf">
|
|
831
843
|
<div data-upd-block><span class="label">Updates</span>${updBlock(U)}</div>
|
|
832
844
|
<div data-whats-new><span class="label">What's new</span>${updWhatsNew(U)}</div>
|
|
833
845
|
<div><span class="label">Workspaces</span><p class="note" style="margin:0 0 8px">A workspace is one repository PMOS works in. Removing one forgets the address only; the folder is not deleted.</p>${wsRows}
|
|
834
846
|
<div class="two" style="margin-top:10px"><label><input id="stP" maxlength="500" placeholder="Folder path of a repository" aria-label="Folder path of a repository"></label><button type="button" class="cta" id="stAdd">Add repository</button></div></div>
|
|
835
|
-
<div><span class="label">Connectors</span><p class="note" style="margin:0 0 8px">
|
|
847
|
+
<div><span class="label">Connectors</span><p class="note" style="margin:0 0 8px">Every connector your Claude session has. Your sessions can use all of them; a switch chooses only what PMOS reads on its own, such as the sources of the Briefing. PMOS keeps no passwords or keys.</p>${srcRows}${connRows}</div>
|
|
836
848
|
<p class="note" id="stM" role="status" style="margin:0;min-height:1.2em">${esc(M.err)}</p>
|
|
837
849
|
<p class="note" style="margin:0">Everything else runs on a default. <a href="/console.html?tab=settings">More settings in the console</a>.</p></div></article>`;
|
|
838
850
|
};
|
|
@@ -841,6 +853,7 @@ export async function openSettings() {
|
|
|
841
853
|
const load = async () => {
|
|
842
854
|
const [w, p] = await Promise.all([pmGet('/api/workspaces'), pmGet('/api/proactive/settings'), updRead()]);
|
|
843
855
|
M.ws = w && Array.isArray(w.workspaces) ? w.workspaces : []; M.src = p && p.ok && p.settings ? { ...p.settings.briefSources } : {};
|
|
856
|
+
M.con = p && p.ok && p.settings ? { ...p.settings.connectors } : {}; M.conn = p && p.connectors && Array.isArray(p.connectors.list) ? p.connectors.list : [];
|
|
844
857
|
if (!w || !Array.isArray(w.workspaces)) M.err = 'The repositories could not be read.'; else if (!p || !p.ok) M.err = 'The sources could not be read.';
|
|
845
858
|
draw();
|
|
846
859
|
};
|
|
@@ -872,7 +885,7 @@ export async function openSettings() {
|
|
|
872
885
|
}
|
|
873
886
|
return;
|
|
874
887
|
}
|
|
875
|
-
const rm = e.target.closest('[data-rm]'), sw = e.target.closest('[data-src]');
|
|
888
|
+
const rm = e.target.closest('[data-rm]'), sw = e.target.closest('[data-src]'), cn = e.target.closest('[data-conn]');
|
|
876
889
|
M.err = '';
|
|
877
890
|
if (rm) {
|
|
878
891
|
const x = M.ws.find((y) => y.id === rm.dataset.rm); if (!x) return;
|
|
@@ -884,6 +897,11 @@ export async function openSettings() {
|
|
|
884
897
|
M.busy = true; const r = await pmPost('/api/proactive/settings', { briefSources: { [k]: on } }); M.busy = false;
|
|
885
898
|
if (r && r.ok) { M.src[k] = on; toast((on ? 'The Briefing now reads ' : 'The Briefing no longer reads ') + SRC[k] + '.'); } else M.err = (r && r.error) || 'Not saved.';
|
|
886
899
|
draw();
|
|
900
|
+
} else if (cn) {
|
|
901
|
+
const k = cn.dataset.conn, on = M.con[k] !== true, c = M.conn.find((x) => x.name === k);
|
|
902
|
+
M.busy = true; const r = await pmPost('/api/proactive/settings', { connectors: { [k]: on } }); M.busy = false;
|
|
903
|
+
if (r && r.ok) { M.con[k] = on; toast((c ? c.label : k) + (on ? ' is on. Nothing in PMOS reads it on its own yet.' : ' is off.')); } else M.err = (r && r.error) || 'Not saved.';
|
|
904
|
+
draw();
|
|
887
905
|
} else if (e.target.closest('#stAdd')) {
|
|
888
906
|
const root = ($('#stP').value || '').trim(); if (!root) { M.err = 'Paste the folder path of a repository.'; draw(); return; }
|
|
889
907
|
M.busy = true; const r = await pmPost('/api/workspaces', { root, focus: false }); M.busy = false;
|
|
@@ -66,9 +66,9 @@ export function ticketModel(view, ref, sprints = null) {
|
|
|
66
66
|
sprint: sp && sp.name ? { name: sp.name, state: sp.state || '', dates: [day(sp.start), day(sp.end)].filter(Boolean).join(' – ') } : null,
|
|
67
67
|
flagged, reason: flagged ? (j && j.reason) || (hit && hit.issue.reason) || 'Flagged in Jira' : '',
|
|
68
68
|
stale: !!(j && j.stale), sections, subtasks: sub, links, epic, prd: view && view.prd ? String(view.prd) : '',
|
|
69
|
-
initiative: view && view.title ? view.title : '', url: safeUrl(j && j.url),
|
|
69
|
+
initiative: view && view.title ? view.title : '', url: safeUrl(j && j.url) || safeUrl(hit && hit.issue.url),
|
|
70
70
|
readAt: (view && view.checkedAt) || (sprints && sprints.readAt) || null,
|
|
71
|
-
draftOnly: !t, readingOnly: !!t && !!t.key && !j,
|
|
71
|
+
draftOnly: !t, noDraft: !view, readingOnly: !!t && !!t.key && !j,
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -88,7 +88,10 @@ export function sprintModel(sprints, name, { today } = {}) {
|
|
|
88
88
|
const all = Array.isArray(sprints.sprints) ? sprints.sprints : [];
|
|
89
89
|
const sp = (name && all.find((s) => s.name === name)) || all[0];
|
|
90
90
|
if (!sp) return { ok: false, why: 'Jira was read, but none of this board\'s tickets is in a sprint.' };
|
|
91
|
-
|
|
91
|
+
// The goal is always the one the Jira status check wrote from the sprint's tickets, as the console's Sprints tab draws it
|
|
92
|
+
// (c3-ib-sprints.js goalBlock): Jira's own sprint goal is often empty or too broad, so it is shown only as a reference.
|
|
93
|
+
const goal = sp.goal && typeof sp.goal === 'object' ? str(sp.goal.text) : '';
|
|
94
|
+
const jiraGoal = (sp.goal && typeof sp.goal === 'object' ? str(sp.goal.jira) : '') || str(sp.jiraGoal);
|
|
92
95
|
const pts = sp.points && Number.isFinite(sp.points.committed) ? { done: sp.points.done, committed: sp.points.committed, unestimated: sp.points.unestimated || 0 } : null;
|
|
93
96
|
const pace = sp.pace || null;
|
|
94
97
|
let left = '';
|
|
@@ -98,11 +101,11 @@ export function sprintModel(sprints, name, { today } = {}) {
|
|
|
98
101
|
if (Number.isFinite(a) && Number.isFinite(b)) { const d = Math.round((a - b) / 864e5); left = d < 0 ? 'ended ' + plural(-d, 'day', 'days') + ' ago' : d === 0 ? 'ends today' : plural(d, 'day', 'days') + ' left'; }
|
|
99
102
|
}
|
|
100
103
|
const cards = (sp.issues || []).map((i) => ({ key: i.key, title: i.summary || i.key, status: i.status || CAT[i.category] || '', cat: CAT[i.category] ? i.category : 'todo',
|
|
101
|
-
points: typeof i.points === 'number' ? i.points : null, initiative: i.initiative || null, flagged: !!i.flagged, reason: i.flagged ? i.reason || 'Flagged in Jira' : '' }));
|
|
104
|
+
points: typeof i.points === 'number' ? i.points : null, initiative: i.initiative || null, url: safeUrl(i.url), flagged: !!i.flagged, reason: i.flagged ? i.reason || 'Flagged in Jira' : '' }));
|
|
102
105
|
const cols = COLS.map(([cat, label]) => ({ cat, label, cards: cards.filter((c) => c.cat === cat) }));
|
|
103
106
|
const other = cards.filter((c) => !c.initiative).length;
|
|
104
107
|
return {
|
|
105
|
-
ok: true, name: sp.name, state: sp.state || '', dates: [day(sp.start), day(sp.end)].filter(Boolean).join(' – '), goal, left, points: pts,
|
|
108
|
+
ok: true, name: sp.name, state: sp.state || '', dates: [day(sp.start), day(sp.end)].filter(Boolean).join(' – '), goal, jiraGoal, summary: str(sp.summary), left, points: pts,
|
|
106
109
|
counts: { todo: cols[0].cards.length, doing: cols[1].cards.length, done: cols[2].cards.length }, total: cards.length, cols, other,
|
|
107
110
|
readAt: sprints.readAt || null, sprints: sprintList(sprints),
|
|
108
111
|
};
|
|
@@ -56,6 +56,15 @@
|
|
|
56
56
|
.jsh h3{margin:0;font-size:var(--fs-4);font-weight:600;color:var(--ink)}
|
|
57
57
|
.jsh p{margin:2px 0 0;font-size:var(--fs-2);color:var(--ink-3)}
|
|
58
58
|
.jsh>div{min-width:0}
|
|
59
|
+
.jpastb{border-style:dashed!important}
|
|
60
|
+
.jpastb[aria-expanded="true"]{border-style:solid!important;background:var(--well)!important}
|
|
61
|
+
.jpast[hidden]{display:none}
|
|
62
|
+
.jgoal{display:grid;gap:4px;background:var(--card-solid);border:1px solid var(--hair);border-radius:8px;padding:12px 16px;box-shadow:var(--card-shadow);min-width:0;overflow-wrap:anywhere}
|
|
63
|
+
.jgoal .jlab{margin:0;font:600 var(--fs-1) var(--mono);letter-spacing:.07em;text-transform:uppercase;color:var(--ink-3)}
|
|
64
|
+
.jgoal b{font-size:var(--fs-3);font-weight:600;line-height:1.45;color:var(--ink)}
|
|
65
|
+
.jgoal p{margin:0;font-size:var(--fs-2);line-height:1.5;color:var(--ink-2)}
|
|
66
|
+
.jgoal .jgref{color:var(--ink-3)}
|
|
67
|
+
.jsh .jgoal{flex-basis:100%;background:none;border:0;border-top:1px solid var(--hair);border-radius:0;box-shadow:none;padding:10px 0 0}
|
|
59
68
|
.jcap{display:flex;align-items:center;gap:8px;font-size:var(--fs-2);color:var(--ink-3)}
|
|
60
69
|
.jcap i{display:block;width:90px;height:6px;border-radius:6px;background:var(--well);overflow:hidden;position:relative}
|
|
61
70
|
.jcap i::after{content:"";position:absolute;inset:0;width:var(--bd-w,0);background:var(--ok);border-radius:6px}
|
|
@@ -43,7 +43,7 @@ function ticketHtml(m) {
|
|
|
43
43
|
? `<button type="button" data-jt="${esc(l.ref)}">${LINK}<span class="jk">${esc(l.key || l.ref)}</span><b>${esc(l.title)}</b></button>`
|
|
44
44
|
: `<span class="jlx">${LINK}<span class="jk">${esc(l.ref)}</span></span>`}</div>`).join('')}${m.prd ? `<div class="jln"><em>from</em><span class="jlx">${DOC}<b>${esc(m.prd)}</b></span></div>` : ''}</div>` : '';
|
|
45
45
|
const body = m.sections.length ? m.sections.map((s) => `<h3>${esc(s.name)}</h3><div class="jmd">${md(s.text)}</div>`).join('')
|
|
46
|
-
: `<p class="jnote">${m.draftOnly ? 'This ticket is not in the initiative\'s ticket draft, so PMOS holds no text for it. Its title, status and points come from the sprint read.' : 'The ticket draft holds no text for this ticket.'}</p>`;
|
|
46
|
+
: `<p class="jnote">${m.noDraft ? 'This ticket is on no initiative of this board, so PMOS holds no text for it. Its title, status and points come from the sprint read.' : m.draftOnly ? 'This ticket is not in the initiative\'s ticket draft, so PMOS holds no text for it. Its title, status and points come from the sprint read.' : 'The ticket draft holds no text for this ticket.'}</p>`;
|
|
47
47
|
return `<div class="jv">${bar('ticket', m)}<article class="jtk">
|
|
48
48
|
<div class="jbc">${m.epic ? `<span class="jk">${esc(m.epic.key)}</span>${m.epic.title ? ` ${esc(m.epic.title)}` : ''} <span aria-hidden="true">/</span> ` : m.initiative ? `${esc(m.initiative)} <span aria-hidden="true">/</span> ` : ''}<span class="jk">${esc(m.key || m.id)}</span></div>
|
|
49
49
|
<h1>${esc(m.title)}</h1>
|
|
@@ -74,34 +74,46 @@ export async function openTicket(o) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/* ── the sprint ─────────────────────────────────────────────────────────────────────────────────────────── */
|
|
77
|
-
function sprintHtml(m) {
|
|
77
|
+
function sprintHtml(m, past) {
|
|
78
78
|
if (!m.ok) return empty(m.why);
|
|
79
|
-
|
|
79
|
+
// The active and next sprints are one press away; the closed ones fold behind "Past sprints" (Wawan 2026-10-21, as the console keeps
|
|
80
|
+
// closed sprints out of its page) and open by themselves only when a closed sprint is the one shown.
|
|
81
|
+
const spBtn = (s) => `<button type="button" data-sp="${esc(s.name)}" aria-pressed="${s.name === m.name}">${esc(s.name)}${s.state ? `<small>${esc(s.state)}</small>` : ''}</button>`;
|
|
82
|
+
const now = m.sprints.filter((s) => s.state !== 'closed'), done = m.sprints.filter((s) => s.state === 'closed');
|
|
83
|
+
const open = past || done.some((s) => s.name === m.name);
|
|
84
|
+
const pick = m.sprints.length > 1 ? `<div class="jseg" role="group" aria-label="Sprint">${now.map(spBtn).join('')}${done.length ? `<button type="button" class="jpastb" data-jpast aria-expanded="${open}" aria-controls="jpast">Past sprints<small>${done.length}</small></button>` : ''}</div>`
|
|
85
|
+
+ (done.length ? `<div class="jseg jpast" id="jpast" role="group" aria-label="Past sprints"${open ? '' : ' hidden'}>${done.map(spBtn).join('')}</div>` : '') : '';
|
|
80
86
|
const pts = m.points ? `<span class="jcap"><i data-pct="${m.points.committed ? Math.round(m.points.done / m.points.committed * 100) : 0}"></i>${m.points.done} of ${m.points.committed} points done</span>`
|
|
81
87
|
: `<span class="jcap">${m.counts.done} of ${m.total} done · no points on record</span>`;
|
|
88
|
+
const jira = m.jiraGoal ? `<p class="jgref">In Jira: “${esc(m.jiraGoal)}”</p>` : '';
|
|
89
|
+
const goal = m.goal ? `<div class="jgoal" data-goal="tickets"><p class="jlab">Sprint goal · from the tickets</p><b>${esc(m.goal)}</b>${m.summary ? `<p>${esc(m.summary)}</p>` : ''}${jira}</div>`
|
|
90
|
+
: `<div class="jgoal" data-goal="missing"><p class="jlab">Sprint goal</p><p>No goal yet. The Jira status check writes one from the tickets at its next check.</p>${jira}</div>`;
|
|
82
91
|
const card = (c) => {
|
|
83
92
|
const inner = `<b>${esc(c.title)}</b>${c.flagged ? `<span class="jrk">${FLAG}${esc(c.reason)}</span>` : ''}<span class="jft"><span class="jk">${esc(c.key)}</span>${c.status && c.status !== m.cols.find((x) => x.cat === c.cat).label ? `<span class="jsx">${esc(c.status)}</span>` : ''}<span class="gap"></span>${c.points != null ? `<span class="jpts">${esc(c.points)}</span>` : ''}</span>`;
|
|
84
|
-
return
|
|
85
|
-
: `<div class="jcrd off${c.flagged ? ' risk' : ''}" title="Not a ticket of this board">${inner}</div>`;
|
|
93
|
+
return `<button type="button" class="jcrd${c.flagged ? ' risk' : ''}" data-k="${esc(c.key)}" data-ini="${esc(c.initiative || '')}" aria-label="${esc(c.key)}: ${esc(c.title)}. Open the ticket">${inner}</button>`;
|
|
86
94
|
};
|
|
87
95
|
return `<div class="jv">${bar(m.name, m)}${pick}
|
|
88
|
-
<div class="jsh"><div><h3>${esc(m.name)}${m.dates ? ` · ${esc(m.dates)}` : ''}</h3
|
|
96
|
+
<div class="jsh"><div><h3>${esc(m.name)}${m.dates ? ` · ${esc(m.dates)}` : ''}</h3>${m.left || m.state ? `<p>${esc(m.left || m.state)}</p>` : ''}</div><span class="gap"></span>${pts}${goal}</div>
|
|
89
97
|
<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>
|
|
90
|
-
<p class="jnote">Read-only: Jira owns each ticket's status and sprint, so move a ticket in Jira
|
|
98
|
+
<p class="jnote">Read-only: Jira owns each ticket's status and sprint, so move a ticket in Jira. Tickets with no sprint are in the backlog. <button type="button" class="jbtn" data-jbl>Open the backlog</button></p></div>`;
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
/** The board's sprints as a board by status in one tab; name picks a sprint (default: the active one). */
|
|
94
102
|
export async function openSprint(o) {
|
|
95
103
|
const { ws, board } = o || {};
|
|
96
104
|
let name = (o && o.name) || '';
|
|
105
|
+
let past = false; // the Past sprints fold, open or shut, kept across a redraw of the tab
|
|
97
106
|
vwStyle('jira');
|
|
98
107
|
const draw = async (el) => {
|
|
99
108
|
el.innerHTML = '<div class="jv"><p class="jnote">Reading the sprint</p></div>';
|
|
100
109
|
const sprints = await getJson('/api/boards/sprints', { ws, board });
|
|
101
110
|
const m = sprintModel(sprints, name, { today: new Date().toISOString() });
|
|
102
|
-
el.innerHTML = sprintHtml(m); bars(el);
|
|
111
|
+
el.innerHTML = sprintHtml(m, past); bars(el);
|
|
103
112
|
el.querySelectorAll('[data-sp]').forEach((b) => { b.onclick = () => { name = b.dataset.sp; draw(el); }; });
|
|
104
|
-
el.
|
|
113
|
+
const pb = el.querySelector('[data-jpast]'), pl = el.querySelector('#jpast');
|
|
114
|
+
if (pb && pl) pb.onclick = () => { pl.hidden = !pl.hidden; past = !pl.hidden; pb.setAttribute('aria-expanded', String(past)); };
|
|
115
|
+
// every ticket opens its tab: one on no initiative of the board shows what the sprint read holds (title, status, points, its Jira link)
|
|
116
|
+
el.querySelectorAll('.jcrd[data-k]').forEach((b) => { b.onclick = () => openTicket({ ws, board, initiative: b.dataset.ini || null, ref: b.dataset.k }); });
|
|
105
117
|
const bl = el.querySelector('[data-jbl]'); if (bl) bl.onclick = () => openBacklog({ ws, board }); // the tickets in no sprint (premium-viewer R9)
|
|
106
118
|
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.'); };
|
|
107
119
|
};
|
|
@@ -2124,6 +2124,12 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
|
|
|
2124
2124
|
.sdot{width:8px;height:8px;border-radius:50%;background:var(--ink-3);flex:none;display:inline-block}
|
|
2125
2125
|
.sdot.ok{background:var(--ok)}
|
|
2126
2126
|
.sdot.warn{background:var(--ember)}
|
|
2127
|
+
.sdot.bad{background:var(--bad)}
|
|
2128
|
+
.hline{display:flex;flex-direction:column;gap:4px;padding:10px 12px;border-radius:12px;background:var(--well);font-size:var(--fs-2);color:var(--ink)}
|
|
2129
|
+
.hline b{display:inline-flex;align-items:center;gap:8px;font-weight:600}
|
|
2130
|
+
.hline.ok b{font-weight:500;color:var(--ink-2)}
|
|
2131
|
+
.hline ul{margin:0;padding:0 0 0 16px;color:var(--ink-2)}
|
|
2132
|
+
.hline:empty,#srcHealth:empty{display:none}
|
|
2127
2133
|
.sr .sn b{display:inline-flex;align-items:center;gap:8px}
|
|
2128
2134
|
.srctop{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
|
|
2129
2135
|
.mwrap{position:relative;display:inline-flex}
|