create-pmos 0.444.0 → 0.446.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +25 -25
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/README.md +1 -1
- package/workspace/adler-moments-test.js +8 -0
- package/workspace/adler-seasons-art-test.js +3 -0
- package/workspace/board-columns-test.js +168 -0
- package/workspace/board-programs-test.js +1 -1
- package/workspace/briefing-premium-board-test.js +83 -6
- package/workspace/briefing-premium-insights-test.js +43 -0
- package/workspace/calm-timeline-test.js +3 -1
- package/workspace/changelog.json +24 -0
- package/workspace/guide/jira.md +13 -1
- package/workspace/guide/ready-made-dashboards.md +2 -2
- package/workspace/lib/board-fold.js +33 -5
- package/workspace/lib/console-state.js +5 -1
- package/workspace/lib/factory-join.js +46 -14
- package/workspace/lib/freshness.js +14 -1
- package/workspace/lib/initiative-rows.js +38 -4
- package/workspace/lib/issues.js +8 -1
- package/workspace/lib/jira-cli.js +18 -2
- package/workspace/lib/jira-moves.js +119 -0
- package/workspace/lib/jira-tickets.js +23 -4
- package/workspace/lib/notes.js +4 -2
- package/workspace/lib/offloop.js +75 -29
- package/workspace/lib/page-build.js +97 -0
- package/workspace/lib/plan-items.js +24 -3
- package/workspace/lib/plan-tree.js +62 -9
- package/workspace/lib/ready-reports.js +22 -8
- package/workspace/lib/refresh.js +14 -2
- package/workspace/lib/routes-board-premium.js +9 -1
- package/workspace/lib/routes-boards.js +74 -15
- package/workspace/lib/routes-brief-page.js +3 -1
- package/workspace/lib/routes-calendar-import.js +13 -1
- package/workspace/lib/routes-ready-reports.js +28 -5
- package/workspace/lib/task-links.js +12 -1
- package/workspace/lib/workflows-store.js +14 -3
- package/workspace/milestone-pins-test.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/panels-test.js +150 -6
- package/workspace/program-panel-test.js +6 -6
- package/workspace/public/pm/bd-cols.js +149 -0
- package/workspace/public/pm/bd-pane.js +41 -0
- package/workspace/public/pm/bd-span.js +29 -11
- package/workspace/public/pm/cozy-board.css +45 -0
- package/workspace/public/pm/cozy-insights.css +8 -0
- package/workspace/public/pm/cozy-live-pill.css +1 -0
- package/workspace/public/pm/cozy-live-pill.js +10 -1
- package/workspace/public/pm/cozy-panels.css +24 -3
- package/workspace/public/pm/cozy-panels.js +275 -108
- package/workspace/public/pm/cozy-viewer.js +3 -1
- package/workspace/public/pm/dash-view.js +5 -2
- package/workspace/public/pm/home-app.js +8 -8
- package/workspace/public/pm/ini-edit.js +5 -1
- package/workspace/public/pm/ini-tasks.js +134 -29
- package/workspace/public/pm/ini-view-model.js +4 -3
- package/workspace/public/pm/ini-view.css +74 -25
- package/workspace/public/pm/ini-view.js +4 -4
- package/workspace/public/pm/ini-wf-model.js +9 -0
- package/workspace/public/pm/ini-wf.js +14 -9
- package/workspace/public/pm/ins-pane.js +55 -0
- package/workspace/public/pm/jira-move.js +50 -0
- package/workspace/public/pm/live-model.js +3 -2
- package/workspace/public/pm/pn-narrow.js +76 -0
- package/workspace/public/pm/premium-board.js +77 -26
- package/workspace/public/pm/premium-insights.js +7 -1
- package/workspace/public/premium-board.html +2 -0
- package/workspace/ready-dash-ui-test.js +4 -4
- package/workspace/server.js +71 -20
- package/workspace/skills/jira-move.skill +35 -0
- package/workspace/stage-card-tasks-test.js +1 -0
- package/workspace/task-links-test.js +1 -0
- package/workspace/task-plans-test.js +1 -1
- package/workspace/task-views-test.js +161 -12
- package/workspace/test-lists/board-columns.json +5 -0
- package/workspace/test-lists/jira-moves.json +11 -0
- package/workspace/test-lists/page-speed-fold.json +5 -0
- package/workspace/test-lists/page-speed-reads.json +5 -0
- package/workspace/timeline-holds-test.js +1 -1
|
@@ -623,7 +623,9 @@ export function close(o = {}) {
|
|
|
623
623
|
const nx = mru(); // another Viewer is still open: it is the one in use now, and the list stays as it is
|
|
624
624
|
if (nx) V = nx; else setRail(false);
|
|
625
625
|
emit(x);
|
|
626
|
-
|
|
626
|
+
let b = x.back; x.back = null;
|
|
627
|
+
// the page drew its rows again meanwhile (a page panel back to its wide form): the same row, by its key, takes the focus
|
|
628
|
+
if (b && !b.isConnected && b.dataset && b.dataset.key) b = document.querySelector(`[data-key="${CSS.escape(b.dataset.key)}"]`);
|
|
627
629
|
if (b && b.isConnected && !nx) { try { b.focus(); } catch { /* gone */ } }
|
|
628
630
|
}
|
|
629
631
|
export const isOpen = () => !!(V.el && !V.el.hidden && V.cur);
|
|
@@ -156,6 +156,8 @@ function repRow(r) {
|
|
|
156
156
|
+ `<div class="db-acts">${ib('hold', 'Skip this one', I.x, { k: rid(r) + '|skip' })}${ib('hold', 'Send it now with a note', I.send, { k: rid(r) + '|send-note' })}${ib('hold', 'Wait until it reads again', I.clock, { solid: true, k: rid(r) + '|wait' })}</div></div>`;
|
|
157
157
|
const open = r.path ? ` data-db="report" data-k="${esc(rid(r))}"` : '';
|
|
158
158
|
const head = `<${r.path ? 'button type="button"' : 'div'} class="db-rep"${open}><span class="db-dic">${SV(iconOf(r), 16)}</span><span class="db-rt"><b>${esc(r.name)}</b>${r.sub ? `<small>${esc(r.sub)}</small>` : ''}</span>${r.path ? SV(I.next, 16) : ''}</${r.path ? 'button' : 'div'}>`;
|
|
159
|
+
// a calm week goes by itself 10 minutes after its time (batch 17 item 6): skip it, keep each week for your own press, or send it now
|
|
160
|
+
if (r.calm) return `<div class="db-late">${head}<div class="db-acts">${ib('hold', 'Skip this week', I.x, { k: rid(r) + '|skip' })}${ib('calm-off', 'Wait for me to send it, every week', I.clock, { k: rid(r) })}${ib('send', 'Send it now', I.send, { solid: true, k: rid(r) })}</div></div>`;
|
|
159
161
|
if (r.state === 'late') return `<div class="db-late">${head}<div class="db-acts">${ib('hold', 'Skip this week', I.x, { k: rid(r) + '|skip' })}${ib('send', 'Send it now', I.send, { solid: true, k: rid(r) })}</div></div>`;
|
|
160
162
|
return head;
|
|
161
163
|
}
|
|
@@ -175,7 +177,7 @@ function reportsHtml(d, o) {
|
|
|
175
177
|
const more = rest.length ? `<button type="button" class="db-fold" data-db="fold" data-k="reports" aria-expanded="${open}"><span class="db-rt"><b>${rest.length} more</b><small>${esc(rest.map((r) => [r.name, r.sub].filter(Boolean).join(' · ')).join(' · '))}</small></span>${SV(I.down, 16)}</button>${open ? rest.map(repRow).join('') : ''}` : '';
|
|
176
178
|
return hu + sec(d.level === 'product' ? 'This week' : 'Reports', `<div class="db-card db-reps">${lead.map(repRow).join('')}${more}</div>`);
|
|
177
179
|
}
|
|
178
|
-
/** Send by itself (PbG6):
|
|
180
|
+
/** Send by itself (PbG6): calm weeks go by themselves by default (Wawan 2026-10-28); the card shows only where the PM had turned it off. */
|
|
179
181
|
function trustHtml(d) {
|
|
180
182
|
const t = d.trust; if (!t) return '';
|
|
181
183
|
return `<div class="db-card db-trust"><div class="db-top"><span class="db-rt"><b>Send by itself</b><small>Only weeks where everything is on its line</small></span></div>`
|
|
@@ -219,7 +221,8 @@ export function wireDash(body, h) {
|
|
|
219
221
|
if (a === 'hold') { const [id, act] = k.split('|'), r = row(id) || {}; return done(await post('/api/ready-reports/hold', { ...base, kind: r.kind, act }), act === 'wait' ? 'It waits. It goes by itself once the source reads, if nothing changed.' : act === 'send-note' ? 'Sent, with the date of the last reading written on it.' : 'Skipped. The next issue covers both weeks.'); }
|
|
220
222
|
// ➤ is the report's Issue press (POST /api/report/issue): PMOS never sends outward; issuing freezes the bytes the PM sends from their mail
|
|
221
223
|
if (a === 'send') { const r = row(k) || {}; if (!r.cadence || !r.slot || !r.sha) { b.disabled = false; if (h.openReport && (r.path || r.desk)) h.openReport(r, d); return; } return done(await post('/api/report/issue', { ws: h.ws || undefined, cadence: r.cadence, slot: r.slot, sha: r.sha }), 'Issued. It is frozen as sent.'); }
|
|
222
|
-
if (a === '
|
|
224
|
+
if (a === 'calm-off') { const r = row(k) || {}; return done(await post('/api/ready-reports/trust', { ...base, kind: r.kind || 'weekly', on: false }), 'It waits for your press, this week and every week after.'); }
|
|
225
|
+
if (a === 'trust') { const r = (d.reports || []).find((x) => x.id === (d.trust && d.trust.reportId)) || (d.reports || [])[0] || {}; return done(await post('/api/ready-reports/trust', { ...base, kind: r.kind || 'weekly', on: k === 'on' }), k === 'on' ? 'Calm weeks go by themselves, 10 minutes after their time. A miss or a decision waits for you.' : 'Not now. Each week waits for your press.'); }
|
|
223
226
|
if (a === 'reread') return done(await post('/api/sources/refresh', { ws: h.ws || undefined, source: k || 'jira' }), 'Reading it again. The dashboard shows it when the read lands.');
|
|
224
227
|
// Connect again: Sources in the Viewer (pm/cozy-sources.js), where a source that is off or failing is connected; ← comes back
|
|
225
228
|
if (a === 'reconnect') { b.disabled = false; if (h.reconnect) { h.reconnect(k); return; } const V = await import('./cozy-viewer.js'); V.drill(); (await import('./cozy-sources.js')).openSources(); return; }
|
|
@@ -162,7 +162,8 @@ async function getRetry(path, tries = 20) {
|
|
|
162
162
|
for (let i = 0; i < tries; i++) {
|
|
163
163
|
const r = await pmGet(path);
|
|
164
164
|
if (!(r && (r.state === 'reading' || r.status === 202 || r.pending && !r.model))) return r;
|
|
165
|
-
|
|
165
|
+
// a first read after a restart usually lands within a second: ask again soon, then less often (page-speed)
|
|
166
|
+
await new Promise((ok) => setTimeout(ok, Math.min(2500, 300 * 2 ** i)));
|
|
166
167
|
}
|
|
167
168
|
return { ok: false, error: 'still reading' };
|
|
168
169
|
}
|
|
@@ -191,14 +192,13 @@ async function load() {
|
|
|
191
192
|
D.now = Date.now();
|
|
192
193
|
D.err = [brief, board].filter((x) => !x || !x.ok).map((x) => (x && x.error) || 'the server did not answer');
|
|
193
194
|
const rows = H.boardRows(D);
|
|
194
|
-
if (rows.length) {
|
|
195
|
-
const b = (D.board && D.board.board) || {};
|
|
196
|
-
const tr = await pmGet('/api/board-trail?ids=' + encodeURIComponent(rows.slice(0, 150).map((r) => r.id).join(',')) + (b.ws ? '&ws=' + encodeURIComponent(b.ws) : wsQ('&')) + (b.id ? '&board=' + encodeURIComponent(b.id) : boardQ('&')));
|
|
197
|
-
D.trail = tr && tr.ok ? tr : null;
|
|
198
|
-
}
|
|
199
|
-
// the PMOS tasks of the board, so each sits under its initiative
|
|
200
195
|
const b0 = (D.board && D.board.board) || {};
|
|
201
|
-
|
|
196
|
+
// the trail of the rows and the PMOS tasks of the board (so each sits under its initiative), read side by side (page-speed)
|
|
197
|
+
const [tr, items] = await Promise.all([
|
|
198
|
+
rows.length ? pmGet('/api/board-trail?ids=' + encodeURIComponent(rows.slice(0, 150).map((r) => r.id).join(',')) + (b0.ws ? '&ws=' + encodeURIComponent(b0.ws) : wsQ('&')) + (b0.id ? '&board=' + encodeURIComponent(b0.id) : boardQ('&'))) : null,
|
|
199
|
+
b0.id ? pmGet('/api/boards/items?ws=' + encodeURIComponent(b0.ws || WS || '') + '&board=' + encodeURIComponent(b0.id)) : null,
|
|
200
|
+
]);
|
|
201
|
+
if (rows.length) D.trail = tr && tr.ok ? tr : null;
|
|
202
202
|
D.items = items && items.ok ? items : null;
|
|
203
203
|
D.others = D.others || [];
|
|
204
204
|
S.ready = true;
|
|
@@ -15,13 +15,15 @@
|
|
|
15
15
|
* a press outside the open row closes it, and the drag (StA10Drag): a grip on hover on a desktop, a long press
|
|
16
16
|
* on the title on a phone; the target stage lights up and a blue line shows where the task lands
|
|
17
17
|
* writes(h) the host's handlers with the writes this file needs, where the host has none: h.rename(uid, title),
|
|
18
|
-
* h.move(uid, { to, from, ids, name }) (a stage, and the order inside it), each with Undo in the toast
|
|
18
|
+
* h.move(uid, { to, from, ids, name }) (a stage, and the order inside it), each with Undo in the toast,
|
|
19
|
+
* h.jiraMove({ key, to, from, fromRaw }) (a Jira ticket's status, moved in Jira: pm/jira-move.js)
|
|
19
20
|
*
|
|
20
21
|
* A move never changes a task's status or dates. Zero is silence: a row with no dates shows none. Icon-only presses carry their words in
|
|
21
22
|
* aria-label and title. */
|
|
22
23
|
import * as TV from './ini-tasks.js';
|
|
23
24
|
import { stateIcon, freshness } from './task-card.js';
|
|
24
25
|
import { pmPost } from './http.js';
|
|
26
|
+
import * as JM from './jira-move.js';
|
|
25
27
|
|
|
26
28
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
27
29
|
const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
@@ -113,6 +115,8 @@ const after = async (H) => { if (H.reload) await H.reload(); else if (H.redraw)
|
|
|
113
115
|
/** Add the writes the host does not have. The draft's own writes wrap these (pm/ini-versions.js). */
|
|
114
116
|
export function writes(h) {
|
|
115
117
|
const W = { ...h };
|
|
118
|
+
// a Jira ticket's status (a Kanban drag, its status press): asked of Jira through the jira-move agent, with Undo (pm/jira-move.js)
|
|
119
|
+
if (!W.jiraMove) W.jiraMove = (m) => JM.move(W, m);
|
|
116
120
|
if (!W.rename) W.rename = async (uid, title) => {
|
|
117
121
|
const res = await post(W, 'rename', { task: uid, title });
|
|
118
122
|
if (!res || res.ok === false) return failed(W, res, 'The name was not changed.');
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* picker and no drag. Archived tasks show in no view here (the List folds them after Done). */
|
|
26
26
|
import { STATES, stateIcon, stateKey, datePickerHtml, cardStyle } from './task-card.js';
|
|
27
27
|
import * as LK from './ini-links.js'; // the links' marks on bars and cards (batch 11 item 15)
|
|
28
|
+
import * as JM from './jira-move.js'; // a Jira ticket's status, moved in Jira (Wawan 2026-10-29)
|
|
28
29
|
|
|
29
30
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
30
31
|
const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
@@ -81,7 +82,7 @@ const zoomOf = () => { if (!ZOOM) { const z0 = store.get('pmos.tasks.zoom'), z =
|
|
|
81
82
|
/** The Timeline's zoom: 'week' | 'month' | 'all'. A stored zoom from before the three steps reads as All. */
|
|
82
83
|
export const zoomMode = () => zoomOf();
|
|
83
84
|
/** For the tests: forget the PM's picks. */
|
|
84
|
-
export const resetViews = () => { VIEW = null; ZOOM = null; STAGE.clear(); SCROLL.clear(); };
|
|
85
|
+
export const resetViews = () => { VIEW = null; ZOOM = null; TC = null; STAGE.clear(); SCROLL.clear(); };
|
|
85
86
|
/** The stage card's press on a stage (batch 11 item 21): the Kanban turns to that stage. */
|
|
86
87
|
export const setKanbanStage = (id, key) => { if (id && key != null) STAGE.set(id, key); };
|
|
87
88
|
|
|
@@ -150,6 +151,11 @@ export function sheetHtml(m, g, z = zoomOf()) {
|
|
|
150
151
|
if (m === 'timeline') {
|
|
151
152
|
h += '<p class="ivs-h">Zoom</p>' + seg('Zoom', ZOOMS.map(([k, l]) => ({ attr: `data-ivs-zoom="${k}"`, on: k === z, text: l, aria: k === 'all' ? 'All: the whole initiative fits the screen' : l })));
|
|
152
153
|
if (z === 'all') h += '<p class="ivs-note">All fits the whole initiative, however long. Tap a stage to see its tasks.</p>';
|
|
154
|
+
// Columns (StsA7Picker): Task always; a phone shows no columns, so it has no Columns row
|
|
155
|
+
else if (!PHONE()) {
|
|
156
|
+
const on = timelineCols(), ck = (k, l, p, fix) => `<button type="button" class="ivs-ck${p ? ' on' : ''}" role="checkbox" aria-checked="${p}"${fix ? ' aria-disabled="true"' : ` data-ivs-col="${k}"`} title="${esc(fix ? 'Always shown' : (p ? 'Hide ' : 'Show ') + l)}"><i aria-hidden="true">${p ? SVG(P.check, 12, 3) : ''}</i>${esc(l)}${fix ? '<small>always</small>' : ''}</button>`;
|
|
157
|
+
h += '<p class="ivs-h">Columns</p><div class="ivs-cols" role="group" aria-label="Columns">' + ck('task', 'Task', true, true) + TCOLS.map(([k, l]) => ck(k, l, on.includes(k), false)).join('') + '</div>';
|
|
158
|
+
}
|
|
153
159
|
}
|
|
154
160
|
return `<div class="tkc-pop ivs" role="dialog" aria-label="Tasks view"><span class="ivs-grab" aria-hidden="true"></span>${h}</div>`;
|
|
155
161
|
}
|
|
@@ -159,6 +165,7 @@ function openSheet(anchor, H) {
|
|
|
159
165
|
const el = openPop(anchor, sheetHtml(viewMode(), g()), (b) => {
|
|
160
166
|
const d = b.dataset;
|
|
161
167
|
if (d.ivsView) { setViewMode(d.ivsView); if (H.redraw) H.redraw(); draw(); return; }
|
|
168
|
+
if (d.ivsCol) { const on = timelineCols(); setTimelineCols(on.includes(d.ivsCol) ? on.filter((k) => k !== d.ivsCol) : on.concat(d.ivsCol)); if (H.redraw) H.redraw(); draw(); return; }
|
|
162
169
|
if (d.ivsZoom) { ZOOM = d.ivsZoom; store.set('pmos.tasks.zoom', ZOOM); if (H.redraw) H.redraw(); draw(); return; }
|
|
163
170
|
if (d.ivsBy && H.__g) { const r = H.__g.set(d.ivsBy); if (r && r.then) r.then(draw); else draw(); return; }
|
|
164
171
|
if ('ivsMore' in d && H.__g) { const a = POP && POP.anchor; closePop(); if (a && a.isConnected) H.__g.more(a); }
|
|
@@ -183,16 +190,23 @@ export function keyName(x) {
|
|
|
183
190
|
}
|
|
184
191
|
/** The Jira mark of a linked task, in place of its box: the status square the ticket rows draw (To do, In progress, Done). Jira owns the
|
|
185
192
|
* status, so it marks nothing here. */
|
|
186
|
-
export const jqMark = (x) => `<span class="iv-jq ig-sq ${x.closed ? 'done' : x.prog ? 'doing' : 'todo'}" role="img" aria-label="${esc('Jira ' + x.jkey + ': ' + (x.jst || x.status))}" title="${esc('Jira · ' + (x.jst || x.status))}"></span>`;
|
|
193
|
+
export const jqMark = (x) => `<span class="iv-jq ig-sq ${x.closed ? 'done' : x.prog ? 'doing' : 'todo'}${mvCls(x.jmove)}" role="img" aria-label="${esc('Jira ' + x.jkey + ': ' + (movingOf(x.jmove) ? 'moving to ' + x.status : x.jst || x.status))}" title="${esc('Jira · ' + (movingOf(x.jmove) ? 'moving to ' + x.status : x.jst || x.status))}"></span>`;
|
|
194
|
+
/** A Jira ticket's status press (Wawan 2026-10-29; canvas "Exploring · Move Jira tasks"): the caret beside its mark opens To do, In progress
|
|
195
|
+
* and Done; the pick is asked of Jira (pm/jira-move.js). st: its status here, raw: Jira's own name for it. */
|
|
196
|
+
const movingOf = (m) => !!(m && m.state === 'moving');
|
|
197
|
+
const mvCls = (m) => (movingOf(m) ? ' mv' : '');
|
|
198
|
+
export const jcar = (key, st, raw, nm, o) => (o && o.quick && key ? `<button type="button" class="iv-car" data-iv-jstat="${esc(key)}" data-st="${esc(colOf(st))}" data-raw="${esc(raw || '')}" aria-haspopup="dialog" aria-label="${esc('Change the status in Jira: ' + nm)}" title="Status, moved in Jira">${SVG(P.down, 10, 2.6)}</button>` : '');
|
|
199
|
+
/** "Moving in Jira" after a ticket's title while the agent moves it; nothing once Jira answered (zero is silence). */
|
|
200
|
+
export const movingHtml = (m) => (movingOf(m) ? '<span class="iv-jmv">Moving in Jira</span>' : '');
|
|
187
201
|
const box = (x, o) => {
|
|
188
|
-
if (x.jkey && !x.dr) return `<span class="iv-bxw">${jqMark(x)}</span>`;
|
|
202
|
+
if (x.jkey && !x.dr) return `<span class="iv-bxw">${jqMark(x)}${jcar(x.jkey, x.status, x.jst, x.title, o)}</span>`;
|
|
189
203
|
// a draft's task (batch 11 item 8) is an assumption: a dashed box that marks nothing; its caret still changes the status in the draft
|
|
190
204
|
if (x.dr) return `<span class="iv-bxw"><span class="iv-cb dr" aria-hidden="true"></span>` + (o.quick ? `<button type="button" class="iv-car" data-iv-stat="${esc(x.uid)}" data-st="${esc(x.status)}" aria-haspopup="dialog" aria-label="${esc('Change the status in the draft: ' + x.title)}" title="Status">${SVG(P.down, 10, 2.6)}</button>` : '') + '</span>';
|
|
191
205
|
const cls = ['iv-cb', x.done ? 'on' : '', x.prog ? 'pr' : '', x.wont ? 'wo' : ''].filter(Boolean).join(' ');
|
|
192
206
|
return `<span class="iv-bxw"><button type="button" class="${cls}" data-iv-check="${esc(x.uid)}" aria-pressed="${x.done}" aria-label="${esc((x.done ? 'Reopen: ' : 'Mark done: ') + x.title)}" title="${x.done ? 'Reopen' : 'Mark done'}">${x.done ? SVG(P.check, 12, 3) : ''}</button>`
|
|
193
207
|
+ (o.quick ? `<button type="button" class="iv-car" data-iv-stat="${esc(x.uid)}" data-st="${esc(x.status)}" data-ms="${x.ms ? 1 : 0}" aria-haspopup="dialog" aria-label="${esc('Change the status: ' + x.title)}" title="Status">${SVG(P.down, 10, 2.6)}</button>` : '') + '</span>';
|
|
194
208
|
};
|
|
195
|
-
const jmark = (k) => `<span class="iv-jm" role="img" aria-label="${esc('Jira ticket, ' + (k.
|
|
209
|
+
const jmark = (k, o) => `<span class="iv-bxw"><span class="iv-jm${mvCls(k.move)}" role="img" aria-label="${esc('Jira ticket, ' + (movingOf(k.move) ? 'moving to ' : '') + (k.status || 'To do'))}" title="${esc('Jira · ' + (movingOf(k.move) ? 'moving to ' : '') + (k.raw || k.status || 'To do'))}">${SVG(P.jira, 14, 2)}</span>${jcar(k.key, k.status, k.raw, k.key + ' ' + k.title, o)}</span>`;
|
|
196
210
|
// noMs: the row already leads with its ◇ (Timeline at All), so the title does not repeat it
|
|
197
211
|
const title = (x, o, noMs = false) => (o.openTask && x.uid && !x.dr ? `<button type="button" class="iv-tt" data-iv-task="${esc(x.uid)}">${keyName(x)}</button>` : `<b class="iv-tt">${keyName(x)}</b>`) + (noMs ? '' : msGlyph(x)) + addedMark(x);
|
|
198
212
|
/* ── planned versus actual (batch 11 item 8; canvas PvaAC1Live): ⊕ after a title added after the compared version, the slip after a date ── */
|
|
@@ -240,7 +254,37 @@ function fitPx(z, days) {
|
|
|
240
254
|
const nw = Math.min(320, Math.max(150, w * 0.36));
|
|
241
255
|
return Math.max(z[2], Math.floor(((w - nw - 24 - 36) / days) * 1000) / 1000);
|
|
242
256
|
}
|
|
243
|
-
|
|
257
|
+
/* The bar wears its task box (canvas StsA1Desk, StsA2Stage, StsA3Phone): To do hollow, In progress solid blue, Done grey, Won't do dashed.
|
|
258
|
+
* Late keeps the status: a thin --cz-late line runs from the day after the due day to Today and ends in a dot (lateLine). */
|
|
259
|
+
const tone = (x) => (x.wont ? 'wo' : x.closed ? 'dn' : x.prog ? 'pr' : 'to');
|
|
260
|
+
/** The days a task is past its due day, 0 when it is not late. */
|
|
261
|
+
const lateDays = (x, today) => { const b = dn(x.end); return x.late && !x.closed && b != null && b < today ? today - b : 0; };
|
|
262
|
+
/** A Jira ticket of the stage as a task row (StsA5Columns: one row shape for every source): its status read the way a linked task's is. */
|
|
263
|
+
const jiraBucket = (st) => (/^(done|closed|resolved|released)$/i.test(String(st || '')) ? 'Done' : /progress|review|test|\bqa\b|doing|started|block/i.test(String(st || '')) ? 'In progress' : 'To do');
|
|
264
|
+
function jiraTask(k, today) {
|
|
265
|
+
const status = jiraBucket(k.status), b = dn(k.due), closed = status === 'Done', late = !closed && b != null && b < today;
|
|
266
|
+
return { ...jiraRow(k), title: k.title, status, done: closed, closed, prog: status === 'In progress', late, lateText: late ? (today - b) + (today - b === 1 ? ' day' : ' days') + ' late' : '',
|
|
267
|
+
startText: k.start ? md(dn(k.start)) : '', dueText: b != null ? md(b) : '', av: k.av || '', jkey: k.key, jst: k.raw || k.status || 'To do', jonly: true, move: k.move || null };
|
|
268
|
+
}
|
|
269
|
+
/** The box of a task on the timelines. A Jira task wears the same box as any task (StsA5Columns); a press opens the Jira picker (To do,
|
|
270
|
+
* In progress, Done; "Moves KEY in Jira", D100), and while Jira has not answered the box is dashed. */
|
|
271
|
+
const glyph = (x) => `<span class="iv-cb${x.done ? ' on' : ''}${x.prog ? ' pr' : ''}${x.wont ? ' wo' : ''}${movingOf(x.move) ? ' mv' : ''}" aria-hidden="true">${x.done ? SVG(P.check, 12, 3) : ''}</span>`;
|
|
272
|
+
/** The press that opens the Jira picker: its data-iv-jstat is the one press() reads for Kanban, List and Timeline. */
|
|
273
|
+
const jstatAt = (x) => `data-iv-jstat="${esc(x.jkey)}" data-st="${esc(colOf(x.status))}" data-raw="${esc(x.jst || '')}" aria-haspopup="dialog"`;
|
|
274
|
+
const tbox = (x, o) => (x.jkey && !x.dr ? (o && o.quick
|
|
275
|
+
? `<button type="button" class="iv-bxw jr" ${jstatAt(x)} aria-label="${esc('Jira ' + x.jkey + ': ' + (x.jst || x.status) + '. Change the status in Jira')}" title="${esc('Jira · ' + (x.jst || x.status))}">${glyph(x)}</button>`
|
|
276
|
+
: `<span class="iv-bxw jr" role="img" aria-label="${esc('Jira ' + x.jkey + ': ' + (x.jst || x.status))}" title="${esc('Jira · ' + (x.jst || x.status))}">${glyph(x)}</span>`) : box(x, o));
|
|
277
|
+
|
|
278
|
+
/* ── the task timeline's columns (StsA5Columns, StsA7Picker): Task always, then the ones the PM keeps on, in this order; a phone has none ── */
|
|
279
|
+
export const TCOLS = [['key', 'Key', 84], ['status', 'Status', 124], ['start', 'Start', 68], ['due', 'Due', 104], ['owner', 'Owner', 64]];
|
|
280
|
+
const COLS0 = ['key', 'status', 'start', 'due'];
|
|
281
|
+
let TC = null;
|
|
282
|
+
/** The columns the PM shows on the Timeline, remembered in this browser (as pmos.tasks.view is). */
|
|
283
|
+
export function timelineCols() {
|
|
284
|
+
if (!TC) { let v = null; try { v = JSON.parse(store.get('pmos.tasks.cols.timeline') || 'null'); } catch { v = null; } TC = Array.isArray(v) ? TCOLS.map((c) => c[0]).filter((k) => v.includes(k)) : COLS0.slice(); }
|
|
285
|
+
return TC;
|
|
286
|
+
}
|
|
287
|
+
export function setTimelineCols(keys) { TC = TCOLS.map((c) => c[0]).filter((k) => keys.includes(k)); store.set('pmos.tasks.cols.timeline', JSON.stringify(TC)); }
|
|
244
288
|
export function timelineHtml(v, o, isOpen) {
|
|
245
289
|
if (zoomOf() === 'all') return allHtml(v, o, isOpen);
|
|
246
290
|
const today = dn(v.today) || Math.round(Date.now() / 864e5), z = ZOOMS.find((x) => x[0] === zoomOf());
|
|
@@ -277,7 +321,11 @@ export function timelineHtml(v, o, isOpen) {
|
|
|
277
321
|
return `<span class="ivt-pl" role="img" data-tlx="${X(a)}" data-tlw="${Math.max(4, X(Math.max(a, b) + 1) - X(a))}" aria-label="${esc('In ' + vs + ': ' + spanText(a, b))}" title="${esc(vs + ' · ' + spanText(a, b))}"></span>`;
|
|
278
322
|
};
|
|
279
323
|
const slipLab = (x) => { const n = slipOf(x), e = dn(x.end); return n && e != null ? `<span class="ivt-sl" data-tlx="${X(e + 1) + 8}">${esc(md(e))}${slipHtml(x)}</span>` : ''; };
|
|
280
|
-
|
|
324
|
+
// late keeps its status fill; the line from the day after the due day to Today says how late (StsA1Desk)
|
|
325
|
+
const lateLine = (x) => { const n = lateDays(x, today), b = dn(x.end); if (!n) return '';
|
|
326
|
+
const a = X(b + 1), t = X(today) + Math.round(px / 2);
|
|
327
|
+
return `<span class="ivt-late" role="img" data-tlx="${a}" data-tlw="${Math.max(4, t - a)}" aria-label="${esc(n + (n === 1 ? ' day' : ' days') + ' late')}" title="${esc('Due ' + md(b) + ' · ' + n + (n === 1 ? ' day' : ' days') + ' late')}"></span>`; };
|
|
328
|
+
const barOf = (x) => (x.wont && x.cmp ? planLine(x) : barOf0(x) + lateLine(x) + planLine(x) + slipLab(x));
|
|
281
329
|
const barOf0 = (x) => {
|
|
282
330
|
const a = dn(x.start), b = dn(x.end), cls = tone(x) + (x.dr ? ' dr' : ''), lbl = [x.days || 'No dates', x.owner && x.owner !== 'You' ? x.owner : '', x.closed ? x.status.toLowerCase() : x.late ? 'late' : x.prog ? 'in progress' : ''].filter(Boolean).join(', ');
|
|
283
331
|
const av = x.av ? `<span class="ivt-av" aria-hidden="true">${esc(x.av)}</span>` : '';
|
|
@@ -300,14 +348,41 @@ export function timelineHtml(v, o, isOpen) {
|
|
|
300
348
|
return `<span class="ivt-ms${x.done ? ' dn' : x.late ? ' lt' : ''}" data-tlx="${X(b + 1)}" role="img" aria-label="${esc('Milestone ' + x.title + ', ' + md(b) + (x.done ? ', done' : x.late ? ', late' : ''))}" title="${esc(x.title + ' · ' + md(b))}"><i></i><b>${esc(md(b))}</b></span>`; };
|
|
301
349
|
const guides = [...new Set(S.flatMap((s) => flat(s).concat(flatDone(s))).filter((x) => x.ms && !x.wont && x.status !== 'Archived' && dn(x.end) != null).map((x) => X(dn(x.end) + 1)))]
|
|
302
350
|
.map((gx) => `<i class="ms" data-tlx="${gx}"></i>`).join('');
|
|
303
|
-
// a Jira ticket's bar drags and its ends change the dates kept in PMOS, as a task's do (batch 11 item 23); read-only views draw the due dot
|
|
304
|
-
|
|
305
|
-
|
|
351
|
+
// a Jira ticket's bar drags and its ends change the dates kept in PMOS, as a task's do (batch 11 item 23); read-only views draw the due dot.
|
|
352
|
+
// It wears its status like any task's bar (StsA5Columns: one row shape for every source)
|
|
353
|
+
const jbar = (x) => { if (o.quick) return barOf(x);
|
|
354
|
+
const b = dn(x.end); return b == null ? '' : `<span class="ivt-d ${tone(x)}" role="img" data-ivt-jr="${esc(x.jkey)}" data-tlx="${X(b) + Math.round(px / 2)}" aria-label="${esc('Due ' + md(b) + ' in Jira')}" title="${esc('Jira · ' + md(b))}"></span>` + lateLine(x); };
|
|
306
355
|
// on a phone the title sits above its bar, from the bar's start (data-tln; it sticks to the left edge once the start scrolls away)
|
|
307
356
|
const nx = (a, b) => { const n = a != null ? a : b; return n == null ? null : Math.max(0, Math.min(X(n), W - 220)); };
|
|
308
357
|
const row = (n, c, cls = '', at = null) => `<div class="ivt-r${cls}"><div class="ivt-n"${at != null ? ` data-tln="${at}"` : ''}>${n}</div><div class="ivt-c">${c}</div></div>`;
|
|
309
|
-
|
|
310
|
-
const
|
|
358
|
+
// the dates after a title show while the Due column does not (wn-pN: they come back when a narrow panel hides it)
|
|
359
|
+
const dp = timelineCols().indexOf('due') + 1;
|
|
360
|
+
const when = (x) => (x.days ? `<span class="ivt-wn${dp ? ' wn-p' + dp : ''}">· ${esc(x.days)}${x.lateText ? `<b>, ${esc(x.lateText)}</b>` : ''}</span>` : '');
|
|
361
|
+
// the columns (StsA5Columns): Key, Status, Start, Due, Owner as the PM keeps them; p1… their place, so a narrow panel hides them from the
|
|
362
|
+
// right (the css container queries). The box shows once: in Status, or before the title while Status is hidden (bx-pN shows it again).
|
|
363
|
+
const CS = timelineCols(), cp = (k) => CS.indexOf(k) + 1, sp = cp('status');
|
|
364
|
+
const cell = (k, inner, at = '') => `<span class="ivt-col c-${k} p${cp(k)}"${at}>${inner}</span>`;
|
|
365
|
+
const keyCell = (x) => (x.jkey ? `<button type="button" class="ivt-key" data-iv-ticket="${esc(x.jkey)}" aria-label="${esc('Open ' + x.jkey + ' in Jira')}" title="${esc('Open ' + x.jkey)}">${esc(x.jkey)}</button>` : '');
|
|
366
|
+
const statCell = (x) => {
|
|
367
|
+
if (x.ms && !x.closed) return '';
|
|
368
|
+
const word = `${glyph(x)}<span>${esc(x.status)}</span>`;
|
|
369
|
+
// a Jira task: its picker (To do, In progress, Done; "Moves KEY in Jira", D100); "Moving in Jira" until Jira answers
|
|
370
|
+
if (x.jkey && !x.dr) {
|
|
371
|
+
const w = movingOf(x.move) ? `${glyph(x)}<span class="iv-jmv">Moving in Jira</span>` : word;
|
|
372
|
+
return o.quick ? `<button type="button" class="ivt-st jr" data-iv-jst="${esc(x.jkey)}" ${jstatAt(x)} aria-label="${esc('Jira ' + x.jkey + ': ' + (x.jst || x.status) + '. Change the status in Jira')}" title="${esc('Jira · ' + (x.jst || x.status))}">${w}</button>`
|
|
373
|
+
: `<span class="ivt-st jr" data-iv-jst="${esc(x.jkey)}" data-st="${esc(x.status)}" title="${esc('Jira · ' + (x.jst || x.status))}">${w}</span>`;
|
|
374
|
+
}
|
|
375
|
+
if (!o.quick || !x.uid) return `<span class="ivt-st">${word}</span>`;
|
|
376
|
+
return `<button type="button" class="ivt-st${x.dr ? ' dr' : ''}" data-iv-stat="${esc(x.uid)}" data-st="${esc(x.status)}" data-ms="${x.ms ? 1 : 0}" aria-haspopup="dialog" aria-label="${esc('Status: ' + x.status + '. Change: ' + x.title)}" title="Change the status">${word}</button>`;
|
|
377
|
+
};
|
|
378
|
+
const dueCell = (x) => { const n = lateDays(x, today); return x.dueText ? (n ? `<span class="lt">${esc(x.dueText)} +${n}d</span>` : esc(x.dueText)) : ''; };
|
|
379
|
+
const cols = (x) => CS.map((k) => cell(k, k === 'key' ? keyCell(x) : k === 'status' ? statCell(x) : k === 'start' ? (x.ms ? '' : esc(x.startText || '')) : k === 'due' ? dueCell(x)
|
|
380
|
+
: x.av ? `<span class="ivt-av" title="${esc(x.owner || '')}">${esc(x.av)}</span>` : '')).join('');
|
|
381
|
+
// the title: with the Key column on, a linked task's key is said there once; a Jira ticket opens its ticket
|
|
382
|
+
const tname = (x) => (x.jonly ? `<button type="button" class="iv-tt" data-iv-ticket="${esc(x.jkey)}">${CS.includes('key') ? '' : `<em>${esc(x.jkey)}</em> `}${esc(x.title)}</button>`
|
|
383
|
+
: title(CS.includes('key') && x.jkey ? { ...x, jkey: '' } : x, o, !!(x.ms && !x.closed)));
|
|
384
|
+
const lead = (x) => (x.ms && !x.closed ? `<span class="iva-mg" aria-hidden="true">${SVG(P.dia, 13, 2.4)}</span>` : `<span class="ivt-bx${sp ? ' bx-p' + sp : ''}">${tbox(x, o)}</span>`);
|
|
385
|
+
const trow = (x, cls = '') => row(`<span class="ivt-t">${lead(x)}${tname(x)}${when(x)}</span>${cols(x)}`, x.jonly ? jbar(x) : barOf(x), ' k' + cls, nx(dn(x.start), dn(x.end)));
|
|
311
386
|
const band = (rs) => { const ds = rs.flatMap((x) => [dn(x.start), dn(x.end)]).filter((n) => n != null); if (!ds.length) return ''; const a = Math.min(...ds), b = Math.max(...ds); return `<span class="ivt-band" data-tlx="${X(a)}" data-tlw="${Math.max(8, X(b + 1) - X(a))}"></span>`; };
|
|
312
387
|
// a skipped stage keeps its group row: a hairline from the band before it to the band after it, with » on it (batch 11 item 13, XgapA2Tasks);
|
|
313
388
|
// a skip before the first dated stage or after the last draws nothing
|
|
@@ -335,7 +410,7 @@ export function timelineHtml(v, o, isOpen) {
|
|
|
335
410
|
if (!op || !has) continue;
|
|
336
411
|
// a ticket in Jira whose task is linked to it (By epic) draws that task's bar: its dates are the task's, kept in PMOS
|
|
337
412
|
for (const t of tk) h += row(`${tkMark(t)}${tkTitle(t)}`, t.x ? barOf(t.x) : '', ' k', t.x ? nx(dn(t.x.start), dn(t.x.end)) : null);
|
|
338
|
-
for (const k of jr) h +=
|
|
413
|
+
for (const k of jr) h += trow(jiraTask(k, today));
|
|
339
414
|
for (const x of rs) h += trow(x);
|
|
340
415
|
// a stage with nothing open lists its done tasks straight away, as the List does: no "Done" fold inside the stage's own fold
|
|
341
416
|
// (PM, 2026-10-27: "Grouping 'Done' items is confusing")
|
|
@@ -347,16 +422,19 @@ export function timelineHtml(v, o, isOpen) {
|
|
|
347
422
|
}
|
|
348
423
|
}
|
|
349
424
|
const grid = ticks.map((t) => `<i data-tlx="${t.x}"></i>`).join('') + guides;
|
|
350
|
-
const axis = `<div class="ivt-r ax"><div class="ivt-n"
|
|
425
|
+
const axis = `<div class="ivt-r ax"><div class="ivt-n"><span class="ivt-t">Task</span>${CS.map((k) => cell(k, esc(TCOLS.find((c) => c[0] === k)[1]))).join('')}</div><div class="ivt-c">${ticks.map((t) => `<span class="${t.b ? 'b' : ''}" data-tlx="${t.x}">${esc(t.t)}</span>`).join('')}</div></div>`;
|
|
351
426
|
// Plan and Draft join the legend only when they are in view (batch 11 item 8)
|
|
352
427
|
const vk = v.vs ? (v.vs.lines && v.vs.cmp ? `<span><i class="pl"></i>${esc((v.vs.cmp.kind === 'plan' ? 'Plan · ' : 'Draft · ') + v.vs.cmp.name)}</span>` : '') + (v.vs.draft ? '<span><i class="dr"></i>Draft</span>' : '') : '';
|
|
353
|
-
|
|
428
|
+
// the bars wear their task's box, so the legend names only what is in view and is not a box (StsA5Columns: no Jira item, no status items)
|
|
429
|
+
const legend = `<div class="ivt-lg">${/class="ivt-d (?![^"]*\bms\b)[^"]*"/.test(h) ? '<span><i class="dd"></i>Due only</span>' : ''}${vk}`
|
|
354
430
|
+ (/class="ivt-ng"/.test(h) ? '<span><i class="ng"></i>No activity</span>' : '') + (/class="ivt-sk"/.test(h) ? `<span>${SVG(P.skip, 12, 2)}Skipped</span>` : '')
|
|
355
|
-
+ `${guides ? `<span>${SVG(P.dia, 11, 2.4)}Milestone</span>` : ''}
|
|
431
|
+
+ `${guides ? `<span>${SVG(P.dia, 11, 2.4)}Milestone</span>` : ''}${LK.legendHtml(o.lk)}${o.quick ? `<span class="h">${o.lk && o.lk.links.length ? 'Drag a bar to move it, an end to change dates, a dot to link it' : 'Drag a bar to move it; drag an end to change start or due'}</span>` : ''}</div>`;
|
|
356
432
|
// it opens on today, moved left as far as the earliest open task's start, so a late bar is in view
|
|
357
433
|
const firstOpen = S.flatMap(flat).flatMap((x) => [dn(x.start), dn(x.end)]).filter((n) => n != null);
|
|
358
434
|
const first = firstOpen.length ? X(Math.min(...firstOpen)) : X(today);
|
|
359
|
-
|
|
435
|
+
// the columns' widths, in their order: place() sets them as --tl-c1w, --tl-c2w, … (a narrow panel's css zeroes the ones it hides)
|
|
436
|
+
const cw = CS.map((k) => TCOLS.find((c) => c[0] === k)[2]).join(',');
|
|
437
|
+
return `<div class="ivt${CS.length ? ' cols' : ''}"${cw ? ` data-tlc="${cw}"` : ''}${LK.dataOf(o.lk)} data-ivt="${esc((v.id || v.key) + '|' + z[0])}" data-px="${px}" data-today="${X(today)}" data-first="${first}"><div class="ivt-sc"><div class="ivt-in" data-tlw="${W}">`
|
|
360
438
|
+ `<div class="ivt-grid" aria-hidden="true">${grid}</div>${axis}${h}<span class="ivt-today" data-tlx="${X(today) + Math.round(px / 2)}" aria-hidden="true"><i>Today</i></span></div></div>`
|
|
361
439
|
+ `<i class="ivt-fade" aria-hidden="true"></i>${noDatesHtml(ND, o, isOpen)}</div>${legend}`;
|
|
362
440
|
}
|
|
@@ -442,14 +520,17 @@ export function allHtml(v, o, isOpen) {
|
|
|
442
520
|
const at = o.quick && x.uid && !x.closed ? `data-ivt-bar="${esc(x.uid)}" data-s="${esc(x.start)}" data-e="${esc(x.end)}"` : '';
|
|
443
521
|
const tag = at ? 'button' : 'span', open0 = at ? 'button type="button"' : 'span';
|
|
444
522
|
if (x.ms && b != null) return `<${open0} class="iva-md${x.done ? ' dn' : x.late ? ' lt' : ''}" ${at}${at ? ` data-one="1" data-t="${esc(x.title)}"` : ''} data-tlx="${pc(b)}" aria-label="${lb}"></${tag}>`;
|
|
445
|
-
const s0 = a == null ? b : a, e0 = b == null ? a : Math.max(a, b);
|
|
446
|
-
|
|
523
|
+
const s0 = a == null ? b : a, e0 = b == null ? a : Math.max(a, b), n = lateDays(x, today);
|
|
524
|
+
// late keeps its status fill; a 3 px --cz-late line runs on to Today and ends in a dot (StsA2Stage)
|
|
525
|
+
const ln = n ? `<i class="iva-late" role="img" data-tlx="${pc(b + 1)}" data-tlw="${pw(b + 1, today)}" aria-label="${esc(n + (n === 1 ? ' day' : ' days') + ' late')}"></i>` : '';
|
|
526
|
+
return `<${open0} class="iva-tb ${cls}" ${at} data-tlx="${pc(s0)}" data-tlw="${pw(s0, e0)}" aria-label="${lb}"></${tag}>` + ln;
|
|
447
527
|
};
|
|
448
528
|
const p0 = (x) => { const n = dn(x.start) != null ? dn(x.start) : dn(x.end); return n == null ? 0 : fr(n).toFixed(4); };
|
|
449
529
|
for (const t of tk) h += trow(tkMark(t), tkTitle(t), t.x ? tbar(t.x) : '', t.x ? p0(t.x) : 0);
|
|
450
|
-
|
|
451
|
-
for (const
|
|
452
|
-
for (const x of
|
|
530
|
+
// a Jira ticket wears the same box and bar as a task (StsA5Columns: one row shape for every source)
|
|
531
|
+
for (const k of jr) { const x = jiraTask(k, today); h += trow(tbox(x, o), ttitle(k) + (k.days ? `<span class="ivt-wn">· ${esc(k.days)}</span>` : '') + (x.lateText ? `<span class="iva-nt lt">${esc(x.lateText)}</span>` : ''), tbar({ ...x, uid: o.quick ? x.uid : '' }), p0(x)); }
|
|
532
|
+
for (const x of rs) h += trow(x.ms ? dia : tbox(x, o), tline(x), tbar(x), p0(x));
|
|
533
|
+
for (const x of dn_) h += trow(x.ms ? dia : tbox(x, o), tline(x), tbar(x), p0(x), ' x' + (x.wont ? ' wo' : ''));
|
|
453
534
|
}
|
|
454
535
|
const tick = (t) => `<span class="${[t.b ? 'b' : '', t.mo ? 'mo' : '', t.q ? 'qm' : ''].filter(Boolean).join(' ')}" data-tlx="${pc(t.n)}"${t.q ? ` data-q="${esc(t.q)}"` : ''}>${esc(t.t)}</span>`;
|
|
455
536
|
const axis = `<div class="iva-ax"><span class="iva-n"></span><span class="iva-l"></span><span class="iva-c">${ticks.map(tick).join('')}</span></div>`;
|
|
@@ -463,7 +544,9 @@ export function allHtml(v, o, isOpen) {
|
|
|
463
544
|
* [data-tlx] / [data-tlw] under root. Called on each draw, before the paint. */
|
|
464
545
|
export function place(root) {
|
|
465
546
|
if (!root || !root.querySelectorAll) return;
|
|
466
|
-
|
|
547
|
+
const all = [...root.querySelectorAll('[data-tlx], [data-tlw], [data-tln], [data-tlp], [data-tlc]')];
|
|
548
|
+
if (root.dataset && root.dataset.tlc != null) all.push(root);
|
|
549
|
+
for (const e of all) {
|
|
467
550
|
if (e.__tl) continue; // placed once: a drag moves it from there
|
|
468
551
|
e.__tl = true;
|
|
469
552
|
// Timeline at All places in % of its track; Weeks and Months in px
|
|
@@ -472,6 +555,7 @@ export function place(root) {
|
|
|
472
555
|
if (e.dataset.tlw != null) e.style.setProperty('--tl-w', u(e.dataset.tlw));
|
|
473
556
|
if (e.dataset.tln != null) e.style.setProperty('--tl-n', u(e.dataset.tln));
|
|
474
557
|
if (e.dataset.tlp != null) e.style.setProperty('--tl-p', e.dataset.tlp); // a fraction of the track (All on a phone)
|
|
558
|
+
if (e.dataset.tlc != null) e.dataset.tlc.split(',').forEach((w, i) => e.style.setProperty('--tl-c' + (i + 1) + 'w', w + 'px')); // the columns' widths
|
|
475
559
|
}
|
|
476
560
|
}
|
|
477
561
|
|
|
@@ -489,11 +573,11 @@ export function kanbanHtml(v, o, isOpen) {
|
|
|
489
573
|
if (c.d) return `<div class="ivk-d jr">${tkMark(c.d)}<div class="w">${tkTitle(c.d)}${c.d.av ? `<div class="ivk-m"><span class="ivt-av" aria-hidden="true">${esc(c.d.av)}</span></div>` : ''}</div></div>`;
|
|
490
574
|
if (c.t) {
|
|
491
575
|
const t = c.t, d = dn(t.due);
|
|
492
|
-
return `<div class="ivk-d jr">${jmark(t)}<div class="w">${ttitle(t)}<div class="ivk-m">${d != null ? `<span>${esc(md(d))}</span>` : ''}${t.av ? `<span class="ivt-av" aria-hidden="true">${esc(t.av)}</span>` : ''}</div></div></div>`;
|
|
576
|
+
return `<div class="ivk-d jr${mvCls(t.move)}"${o.quick ? ` draggable="true" data-ivk-jira="${esc(t.key)}" data-st="${esc(t.status)}" data-raw="${esc(t.raw || '')}"` : ''}>${jmark(t, o)}<div class="w">${ttitle(t)}<div class="ivk-m">${movingHtml(t.move)}${d != null ? `<span>${esc(md(d))}</span>` : ''}${t.av ? `<span class="ivt-av" aria-hidden="true">${esc(t.av)}</span>` : ''}</div></div></div>`;
|
|
493
577
|
}
|
|
494
578
|
const x = c.x;
|
|
495
|
-
return `<div class="ivk-d${x.closed ? ' x' : ''}${x.wont ? ' wo' : ''}${x.dr ? ' dr' : ''}${x.jkey ? ' jr' : ''}"${o.quick && x.uid
|
|
496
|
-
+ `<div class="ivk-m">${dateBtn(x, o)}${LK.metaHtml(x, o.lk, o.quick)}${x.av ? `<span class="ivt-av" aria-hidden="true">${esc(x.av)}</span>` : ''}</div></div></div>`;
|
|
579
|
+
return `<div class="ivk-d${x.closed ? ' x' : ''}${x.wont ? ' wo' : ''}${x.dr ? ' dr' : ''}${x.jkey ? ' jr' + mvCls(x.jmove) : ''}"${o.quick && x.uid ? (x.jkey ? ` draggable="true" data-ivk-jira="${esc(x.jkey)}" data-st="${esc(x.status)}" data-raw="${esc(x.jst || '')}"` : ` draggable="true" data-ivk-card="${esc(x.uid)}" data-st="${esc(x.status)}"`) : ''}>${box(x, o)}<div class="w">${title(x, o, msInDate(x))}`
|
|
580
|
+
+ `<div class="ivk-m">${x.jkey ? movingHtml(x.jmove) : ''}${dateBtn(x, o)}${LK.metaHtml(x, o.lk, o.quick)}${x.av ? `<span class="ivt-av" aria-hidden="true">${esc(x.av)}</span>` : ''}</div></div></div>`;
|
|
497
581
|
};
|
|
498
582
|
const wop = isOpen('kb:wont', false), nW = by["Won't do"].length;
|
|
499
583
|
const col = ([st, lbl]) => `<section class="ivk-c" data-ivk-col="${esc(st)}" aria-label="${esc(lbl + ', ' + by[st].length)}"><h4>${esc(lbl)}${by[st].length ? `<span class="n">${by[st].length}</span>` : ''}</h4>${by[st].map(card).join('')}</section>`;
|
|
@@ -501,7 +585,7 @@ export function kanbanHtml(v, o, isOpen) {
|
|
|
501
585
|
: `<button type="button" class="ivk-w" data-iv-fold="kb:wont" data-ivk-col="Won't do" aria-expanded="false" aria-label="${esc("Show Won't do" + (nW ? ', ' + nW : ''))}"><span>Won't do${nW ? ' · ' + nW : ''}</span></button>`;
|
|
502
586
|
const tabs = `<div class="ivk-tabs" role="tablist">${COLS.map(([st, lbl], i) => `<button type="button" role="tab" data-ivk-tab="${i}" aria-selected="${i === 0}">${esc(lbl)}${by[st].length ? ` <span class="n">${by[st].length}</span>` : ''}</button>`).join('')}</div>`;
|
|
503
587
|
return `${tabs}<div class="ivk${wop ? ' w4' : ''}">${COLS.map(col).join('')}${wont}</div>`
|
|
504
|
-
+ (o.quick ? '<p class="iv-q ivk-h">Drag a card to change its status. A Jira card
|
|
588
|
+
+ (o.quick ? '<p class="iv-q ivk-h">Drag a card to change its status. A Jira card moves its ticket in Jira.</p>' : '');
|
|
505
589
|
}
|
|
506
590
|
|
|
507
591
|
/* ── the popovers: the task card's own status segment and date picker, opened right under the press ── */
|
|
@@ -567,6 +651,18 @@ export function statusPop(anchor, uid, status, H) {
|
|
|
567
651
|
const s = b.dataset.ivqState; if (!s) return; closePop(); if (s !== status && H.status) H.status(uid, s);
|
|
568
652
|
});
|
|
569
653
|
}
|
|
654
|
+
/** A Jira ticket's status picker: To do, In progress and Done, and under them the line that says the pick moves the ticket in Jira. */
|
|
655
|
+
export function jiraPopHtml(status, key) {
|
|
656
|
+
const b = (s) => { const k = stateKey(s), on = s === status;
|
|
657
|
+
return `<button type="button" class="i-${k}${on ? ' on' : ''}" role="radio" aria-checked="${on}" data-ivq-state="${esc(s)}"${on ? '' : ` aria-label="${esc(s)}"`} title="${esc(s)}">${stateIcon(s)}${on ? esc(s) : ''}</button>`; };
|
|
658
|
+
return `<div class="tkc-pop ivq-st jq" role="dialog" aria-label="${esc('Status in Jira: ' + key)}"><div class="seg" role="radiogroup" aria-label="Status">${JM.TO.map(b).join('')}</div><p class="ivq-jn">${esc('Moves ' + key + ' in Jira')}</p></div>`;
|
|
659
|
+
}
|
|
660
|
+
export function jiraPop(anchor, key, status, raw, H) {
|
|
661
|
+
openPop(anchor, jiraPopHtml(status, key), (b) => {
|
|
662
|
+
const s = b.dataset.ivqState; if (!s) return; closePop();
|
|
663
|
+
if (s !== status && H.jiraMove) H.jiraMove({ key, to: s, from: status, fromRaw: raw });
|
|
664
|
+
});
|
|
665
|
+
}
|
|
570
666
|
/** The date picker under a date press (a bottom sheet on a phone, batch 18 item 16 StA3Dates). The press says where it starts: data-f
|
|
571
667
|
* 'start' opens on the start (the open row's Start chip); data-one: a milestone's one day, "◇ Date" with no Start and Due tabs (StA4Milestone). */
|
|
572
668
|
export function datePop(anchor, uid, H) {
|
|
@@ -617,6 +713,7 @@ export function press(b, d, root, H, e) {
|
|
|
617
713
|
return true;
|
|
618
714
|
}
|
|
619
715
|
if (d.ivStat) { statusPop(b, d.ivStat, d.st || 'To do', H); return true; }
|
|
716
|
+
if (d.ivJstat) { jiraPop(b, d.ivJstat, d.st || 'To do', d.raw || '', H); return true; }
|
|
620
717
|
if (d.ivDate) { datePop(b, d.ivDate, H); return true; }
|
|
621
718
|
if (d.ivtBar) { if (DRAGGED) { DRAGGED = false; return true; } datePop(b, d.ivtBar, H); return true; }
|
|
622
719
|
if (d.ivkTab != null) { const c = root.querySelectorAll('.ivk > .ivk-c')[+d.ivkTab]; if (c) c.scrollIntoView({ block: 'nearest', inline: 'start', behavior: 'smooth' }); return true; }
|
|
@@ -632,15 +729,23 @@ export function wireDrag(body, after) {
|
|
|
632
729
|
body.__ivtDrag = true;
|
|
633
730
|
body.addEventListener('contextmenu', (e) => { if (e.target.closest && e.target.closest('[data-iv-check]') && coarse()) e.preventDefault(); });
|
|
634
731
|
// Kanban: drag a card to another column to change its status
|
|
635
|
-
|
|
636
|
-
body.addEventListener('
|
|
732
|
+
// a Jira card (data-ivk-jira) moves its ticket in Jira (pm/jira-move.js)
|
|
733
|
+
body.addEventListener('dragstart', (e) => { const c = e.target.closest && e.target.closest('[data-ivk-card], [data-ivk-jira]'); if (!c) return; e.dataTransfer.setData('text/plain', c.dataset.ivkCard || 'jira:' + c.dataset.ivkJira); e.dataTransfer.effectAllowed = 'move'; c.classList.add('drag'); body.__ivkFrom = c.dataset.st; body.__ivkRaw = c.dataset.raw || ''; });
|
|
734
|
+
body.addEventListener('dragend', (e) => { const c = e.target.closest && e.target.closest('[data-ivk-card], [data-ivk-jira]'); if (c) c.classList.remove('drag'); body.querySelectorAll('.ivk-over').forEach((n) => n.classList.remove('ivk-over')); });
|
|
637
735
|
body.addEventListener('dragover', (e) => { const z = e.target.closest && e.target.closest('[data-ivk-col]'); if (!z || !body.__ivkFrom) return; e.preventDefault(); body.querySelectorAll('.ivk-over').forEach((n) => { if (n !== z) n.classList.remove('ivk-over'); }); z.classList.add('ivk-over'); });
|
|
638
736
|
body.addEventListener('drop', (e) => {
|
|
639
737
|
const z = e.target.closest && e.target.closest('[data-ivk-col]'); if (!z) return;
|
|
640
738
|
e.preventDefault(); z.classList.remove('ivk-over');
|
|
641
739
|
const uid = e.dataTransfer.getData('text/plain'), to = z.dataset.ivkCol, from = body.__ivkFrom; body.__ivkFrom = null;
|
|
642
740
|
const H = body.__iv || {};
|
|
643
|
-
if (uid
|
|
741
|
+
if (!uid || !to || colOf(from) === to) return;
|
|
742
|
+
if (uid.startsWith('jira:')) {
|
|
743
|
+
const key = uid.slice(5);
|
|
744
|
+
if (!JM.TO.includes(to)) { if (H.toast) H.toast(`A Jira ticket moves to To do, In progress or Done. ${key} stays where it is.`); return; }
|
|
745
|
+
if (H.jiraMove) H.jiraMove({ key, to, from: colOf(from), fromRaw: body.__ivkRaw || '' });
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
if (H.status) H.status(uid, to);
|
|
644
749
|
});
|
|
645
750
|
// the Timeline keeps the PM's place over a redraw, and first opens on today
|
|
646
751
|
const settle = () => {
|
|
@@ -134,7 +134,7 @@ function rowOf(k0, today, J = null) {
|
|
|
134
134
|
// planned versus actual (batch 11 item 8, pm/ini-versions.js): the compared version's days where they differ, ⊕ added after it, a draft's task
|
|
135
135
|
cmp: k.cmp || null, added: !!k.added, dr: !!k.draft,
|
|
136
136
|
// jkey: the key of the Jira ticket the task is linked to, only when PMOS read that ticket; jst: its own Jira status (it owns the status)
|
|
137
|
-
jkey: J ? J.key : '', jst: J ? String(J.raw || J.status || '') : '', _k: k0, _t: today };
|
|
137
|
+
jkey: J ? J.key : '', jst: J ? String(J.raw || J.status || '') : '', jmove: J && J.move ? J.move : null, _k: k0, _t: today }; // jmove: a move asked in PMOS (lib/jira-moves.js)
|
|
138
138
|
}
|
|
139
139
|
/** The Jira keys a task's title holds ("MSD-4376 Navigation tabs" → ['MSD-4376']). A task whose title names a ticket PMOS read IS that ticket
|
|
140
140
|
* (linkOf): it shows the Jira mark and the key once, its status is Jira's, and the ticket's own row does not show again (batch 11 item 4,
|
|
@@ -252,8 +252,9 @@ export function iniView(r, ctx = {}) {
|
|
|
252
252
|
list.forEach((s, i) => {
|
|
253
253
|
const x = one(s, i);
|
|
254
254
|
if (i === cur && jira && tkOwn.length) {
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
// a ticket just moved to Done in PMOS stays in view until Jira's next read, so the card the PM dropped does not vanish
|
|
256
|
+
const opn = tkOwn.filter((k) => k.status !== 'Done' || (k.move && (k.move.state === 'moving' || k.move.state === 'moved'))).sort((a, b) => (b.blocked ? 1 : 0) - (a.blocked ? 1 : 0));
|
|
257
|
+
x.jira = { open: opn.map((k) => ({ key: k.key, title: k.title, epic: k.epic || '', status: k.status || 'To do', raw: k.raw || '', move: k.move || null, start: k.start || '', due: k.due || k.sprintEnd || '', here: !!k.datesHere, days: jDays(k, today), av: initials(k.assignee), sub: [k.blocked ? 'Blocked' + (k.reason ? ' by ' + String(k.reason).replace(/^Waiting on /i, '') : '') : k.status || 'To do', k.assignee || ''].filter(Boolean).join(' · '), warn: !!k.blocked })),
|
|
257
258
|
done: tkOwn.length - opn.length, total: tkOwn.length, at: ctx.jiraAt || '' };
|
|
258
259
|
x.count = countOf(opn.length + x.top.length + x.groups.reduce((n, g) => n + g.n, 0), x.top.filter((y) => y.late).length, 0);
|
|
259
260
|
x.sub = x.sub + (x.sub ? ' · ' : '') + 'Jira tickets, by epic';
|