create-pmos 0.407.0 → 0.409.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/board-programs-test.js +1 -1
- package/workspace/board-wf-shot.js +45 -0
- package/workspace/board-workflows-test.js +186 -0
- package/workspace/briefing-premium-board-test.js +2 -2
- package/workspace/briefing-premium-initiative-test.js +1 -1
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/board-workflows-facts.js +49 -0
- package/workspace/fixtures/workflows-facts.js +53 -0
- package/workspace/guide/home.md +2 -2
- package/workspace/guide/index.md +1 -0
- package/workspace/guide/workflows.md +58 -0
- package/workspace/home-other-product-test.js +94 -0
- package/workspace/ini-workflow-test.js +177 -0
- package/workspace/lib/board-premium.js +30 -5
- package/workspace/lib/board-trail.js +24 -7
- package/workspace/lib/briefing-premium-agent.js +3 -0
- package/workspace/lib/engine/boards.js +30 -2
- package/workspace/lib/engine/workflows.js +204 -0
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/programs.js +22 -7
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +157 -7
- package/workspace/lib/routes-programs.js +5 -0
- package/workspace/lib/routes-workflows.js +105 -0
- package/workspace/lib/workflow-chat.js +26 -0
- package/workspace/lib/workflow-cli.js +141 -0
- package/workspace/lib/workflows-store.js +108 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/program-charter-test.js +243 -0
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-acts.js +10 -5
- package/workspace/public/pm/bd-asks.js +2 -2
- package/workspace/public/pm/bd-prog-panel.js +33 -14
- package/workspace/public/pm/bd-prog.js +11 -3
- package/workspace/public/pm/bd-views.js +128 -45
- package/workspace/public/pm/bd-wf.js +99 -0
- package/workspace/public/pm/cozy-board.css +67 -6
- package/workspace/public/pm/cozy-evmodel.js +1 -1
- package/workspace/public/pm/cozy-panel.css +12 -6
- package/workspace/public/pm/cozy-settings.js +4 -2
- package/workspace/public/pm/cozy-viewer.js +36 -9
- package/workspace/public/pm/cozy-vw-shell.css +8 -0
- package/workspace/public/pm/goal-chat.js +1 -1
- package/workspace/public/pm/home-app.js +50 -13
- package/workspace/public/pm/home-ini-model.js +2 -2
- package/workspace/public/pm/home-ini.css +30 -0
- package/workspace/public/pm/home-ini.js +52 -9
- package/workspace/public/pm/home-list.js +5 -3
- package/workspace/public/pm/home-today.js +4 -4
- package/workspace/public/pm/ini-wf-model.js +91 -0
- package/workspace/public/pm/ini-wf.js +160 -0
- package/workspace/public/pm/premium-board.js +98 -30
- package/workspace/public/pm/premium-initiative-head.js +18 -8
- package/workspace/public/pm/program-charter.css +135 -0
- package/workspace/public/pm/program-charter.js +333 -0
- package/workspace/public/pm/program-model.js +44 -4
- package/workspace/public/pm/wf-edit.js +119 -0
- package/workspace/public/pm/wf-model.js +48 -0
- package/workspace/public/pm/wf-page.css +162 -0
- package/workspace/public/pm/wf-page.js +398 -0
- package/workspace/public/pm/wf-stage.js +187 -0
- package/workspace/public/premium-workflows.html +31 -0
- package/workspace/public/premium.html +1 -0
- package/workspace/server.js +1 -1
- package/workspace/skills/workflow-setup.skill +57 -0
- package/workspace/test-lists/briefing-premium.json +3 -1
- package/workspace/test-lists/ini-workflow.json +6 -0
- package/workspace/test-lists/program-charter.json +9 -0
- package/workspace/test-lists/workflows-board.json +13 -0
- package/workspace/test-lists/workflows-setup.json +13 -0
- package/workspace/test-lists/workflows.json +5 -0
- package/workspace/workflows-setup-test.js +346 -0
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
* kind chips, health, when it changed and who changed it (GET /api/board-docs), and a row opens the document's panel.
|
|
10
10
|
* Nothing here invents a value: what no record holds is shown as "—" or not drawn. */
|
|
11
11
|
import { esc } from './premium-shell.js';
|
|
12
|
+
import * as WF from './bd-wf.js';
|
|
12
13
|
|
|
13
|
-
let A = null; // the page: { M(), statusOf(r), usual(t), trail(r), docMeta(path, ws), sel(), groups(L), folded(key), laneHead(g), subTile(name), memberIcon(id), programOf(r), programs()
|
|
14
|
+
let A = null; // the page: { M(), statusOf(r), usual(t), trail(r), docMeta(path, ws), sel(), groups(L), folded(key), laneHead(g), subTile(name), memberIcon(id), programOf(r), programs(),
|
|
15
|
+
// wf() → { list, cur, ended } the workflows on the board, the picked one (null for All) and the rows that ended (pm/bd-wf.js) }
|
|
14
16
|
export function init(api) { A = api; }
|
|
15
17
|
const M = () => A.M();
|
|
16
18
|
const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
@@ -22,8 +24,10 @@ export const initials = (name) => { const s = String(name || '').trim(); if (!s)
|
|
|
22
24
|
export const avatar = (name, cls = '') => (name ? `<span class="bd-av${cls ? ' ' + cls : ''}" title="${esc(name)}" aria-label="${esc(name)}">${esc(initials(name))}</span>` : '<span class="bd-amut">—</span>');
|
|
23
25
|
|
|
24
26
|
/* ── the step a row is in, and what a row needs ─────────────────────────────────────────────────────────────── */
|
|
25
|
-
const kOf = (r) => (r
|
|
26
|
-
const isME = (r) => r.track && r.track.k >= 6;
|
|
27
|
+
const kOf = (r) => WF.posOf(r); // stage order across workflows: category, then how far along its own list (Product feature: the eight steps)
|
|
28
|
+
const isME = (r) => r.track && r.track.k >= 6; // Monitor and Evaluate: only a Product feature row has a step index
|
|
29
|
+
const WFS = () => (A.wf ? A.wf() : { list: [], cur: null, ended: [] });
|
|
30
|
+
const many = () => WFS().list.length > 1; // the workflow icon is drawn only where more than one workflow is on the board (say it once)
|
|
27
31
|
/** The order of need: your turn, blocked, late, at risk, idle, then the rest. */
|
|
28
32
|
export const needOf = (r) => { const t = r.track || {}; return t.you ? 0 : t.blocked ? 1 : r.late ? 2 : r.status === 'at risk' ? 3 : t.idle != null ? 4 : 5; };
|
|
29
33
|
/** The status line of a row in the list, the cards and the phone: the page's status, with "N blocked in Jira" where a ticket is blocked. */
|
|
@@ -43,21 +47,26 @@ export function outOf(r) {
|
|
|
43
47
|
}
|
|
44
48
|
/** A progress bar; a count (tickets, parts) is striped so it never reads as points (BdPanel). */
|
|
45
49
|
export const barHtml = (o, cls = '') => (o ? `<span class="bd-bar${cls ? ' ' + cls : ''}" role="img" aria-label="${esc(o.label || o.pct + '%')}${o.count ? ' (by count)' : ''}"><i class="${o.count ? 'cnt' : ''}" style="width:${Math.max(0, Math.min(100, o.pct))}%"></i></span>` : '<span class="bd-bar" aria-hidden="true"><i style="width:0"></i></span>');
|
|
46
|
-
const stepText = (r, days) => { const t = r.track || {}; return (t.label || r.stage || 'No stage') + (days && t.days != null ? ' · ' + t.days + 'd' : ''); };
|
|
50
|
+
const stepText = (r, days) => { const t = r.track || {}, w = WF.stageOfRow(r); return ((w && w.name) || t.label || r.stage || 'No stage') + (days && t.days != null ? ' · ' + t.days + 'd' : ''); };
|
|
51
|
+
const CAT_TONE = { todo: '', doing: 'y', done: 'ok', wontdo: '', archived: '' };
|
|
52
|
+
/** The category pill of the List (WfAElse): To do, In progress, Done, Won't do, Archived. */
|
|
53
|
+
const catPill = (r) => { const c = WF.catOfRow(r); return c ? `<span class="bd-pill${CAT_TONE[c] ? ' ' + CAT_TONE[c] : ''}">${esc(WF.catLabel(c))}</span>` : '<span class="bd-amut">—</span>'; };
|
|
47
54
|
/** What the row waits on next: the trail's next part, else the first line under its Output bar. */
|
|
48
55
|
const nextOf = (r) => { const t = r.track || {}; if (typeof t.next === 'string' && t.next) return t.next; if (t.next && t.next.text) return t.next.text; const l = (t.line || [])[0]; return l ? l.text : ''; };
|
|
49
56
|
|
|
50
57
|
/* ── List (BdList) ───────────────────────────────────────────────────────────────────────────────────────────── */
|
|
51
58
|
let sortBy = null, meOpen = false; // null: by product with All products (PgList), else by need, until a column title is pressed
|
|
52
|
-
|
|
59
|
+
// the Kind column became Workflow, with Stage and Category after it (WfAElse)
|
|
60
|
+
const COLS = [['title', 'Initiative'], ['wf', 'Workflow'], ['stage', 'Stage'], ['cat', 'Category'], ['need', 'Status'], ['owner', 'Owner'], ['', 'Next'], ['finish', 'Finish'], ['', 'Output'], ['', '']];
|
|
53
61
|
// with a program on the board (PgList): Product and Program after the initiative, both sortable; a row with no program leaves the cell empty
|
|
54
62
|
const PCOLS = [COLS[0], ['product', 'Product'], ['program', 'Program'], ...COLS.slice(1)];
|
|
55
63
|
const progOf = (r) => (A.programOf ? A.programOf(r) : null);
|
|
56
64
|
const SORTS = {
|
|
57
65
|
need: (a, b) => needOf(a) - needOf(b) || kOf(a) - kOf(b),
|
|
58
66
|
title: (a, b) => String(a.title).localeCompare(String(b.title)),
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
wf: (a, b) => { const x = WF.wfOf(a), y = WF.wfOf(b); return (WF.isPF(y) - WF.isPF(x)) || String(x.name).localeCompare(String(y.name)) || kOf(a) - kOf(b) || needOf(a) - needOf(b); },
|
|
68
|
+
cat: (a, b) => kOf(a) - kOf(b) || needOf(a) - needOf(b),
|
|
69
|
+
stage: (a, b) => { const x = WF.stageOfRow(a), y = WF.stageOfRow(b); return (x ? x.n : 99) - (y ? y.n : 99) || kOf(a) - kOf(b) || needOf(a) - needOf(b); },
|
|
61
70
|
owner: (a, b) => String(a.owner || '~').localeCompare(String(b.owner || '~')),
|
|
62
71
|
finish: (a, b) => String(a.end || '9999').localeCompare(String(b.end || '9999')),
|
|
63
72
|
product: (a, b) => String(a.product || '').localeCompare(String(b.product || '')) || needOf(a) - needOf(b),
|
|
@@ -71,7 +80,7 @@ function listRow(r, pg) {
|
|
|
71
80
|
const pcells = pg ? `<span role="cell" class="bd-pt">${A.tileHtml(prod, 'bd-ti s')}<span class="bd-ell">${esc(prod)}</span></span><span role="cell" class="bd-pt">${p ? A.progTile('bd-pti s') + `<span class="bd-ell">${esc(p.title)}</span>` : ''}</span>` : '';
|
|
72
81
|
return `<div class="bd-lt${sel ? ' sel' : ''}${r.acts && r.acts.life === 'hold' ? ' held' : ''}" role="row" data-row="${esc(r.key)}">`
|
|
73
82
|
+ `<button type="button" class="bd-ltn ini2" data-key="${esc(r.key)}" role="rowheader" aria-haspopup="dialog"><b>${esc(r.title)}</b></button>${pcells}`
|
|
74
|
-
+ `<span role="cell" class="bd-
|
|
83
|
+
+ `<span role="cell" class="bd-wfn">${WF.wfIcon(WF.wfOf(r), 18)}<span class="bd-ell">${esc(WF.wfOf(r).name)}</span></span><span role="cell">${(r.track || {}).ms ? '<i class="cz-ms" aria-hidden="true"></i>' : ''}${esc(stepText(r, true))}</span><span role="cell">${catPill(r)}</span>`
|
|
75
84
|
+ `<span role="cell" class="cs s-${s.tone}"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i>${esc(s.text)}</span>`
|
|
76
85
|
+ `<span role="cell">${avatar(r.owner)}</span><span role="cell" class="bd-amut bd-ell">${esc(nextOf(r) || '—')}</span>`
|
|
77
86
|
+ `<span role="cell"${r.over ? ' class="bd-late"' : ''}>${esc(finish)}</span><span role="cell">${barHtml(outOf(r))}</span>`
|
|
@@ -93,9 +102,11 @@ export function listHtml(L, filtered) {
|
|
|
93
102
|
return `<div class="bd-ltw${pg ? ' pg' : ''}" role="table" aria-label="Initiatives">${head}${top.map((r) => listRow(r, pg)).join('')}${fold}</div><p class="bd-foot">${by === 'product' ? 'Sorted by product. Press Program to sort by program instead; a row with no program leaves the cell empty.' : 'Press a column title to sort. Press a row to open its panel, the same panel as the stage track.'}</p>`;
|
|
94
103
|
}
|
|
95
104
|
|
|
96
|
-
/* ── By stage (BdByStage, PgKanban): programs as swimlanes, then the product; any column folds to a strip
|
|
105
|
+
/* ── By stage (BdByStage, PgKanban; WfABoard, WfABoardOne, WfAPhone): programs as swimlanes, then the product; any column folds to a strip ──── */
|
|
97
106
|
/* A column folds to a strip with its count and stays folded (localStorage pmos.board.cols). Until the PM folds or opens it, a column starts
|
|
98
|
-
* folded when no card on screen is in it, and Monitor and Evaluate start folded while nothing in them needs you.
|
|
107
|
+
* folded when no card on screen is in it, and Monitor and Evaluate start folded while nothing in them needs you. Won't do and Archived start
|
|
108
|
+
* folded. The columns depend on the workflow chip (pm/bd-wf.js): one workflow picked (or the only one on the board) draws its own stages,
|
|
109
|
+
* with the category bar under them; All draws the three categories, In progress widest with its cards in stage order. */
|
|
99
110
|
const COL_KEY = 'pmos.board.cols';
|
|
100
111
|
let COLS_SET = null;
|
|
101
112
|
const colChoice = () => { if (!COLS_SET) { let v = null; try { v = JSON.parse(localStorage.getItem(COL_KEY) || 'null'); } catch { v = null; } COLS_SET = v && typeof v === 'object' && !Array.isArray(v) ? v : {}; } return COLS_SET; };
|
|
@@ -105,49 +116,108 @@ export function toggleCol(k) {
|
|
|
105
116
|
C[k] = shut ? 'open' : 'fold';
|
|
106
117
|
try { localStorage.setItem(COL_KEY, JSON.stringify(C)); } catch { /* no storage: the fold lasts until the reload */ }
|
|
107
118
|
}
|
|
108
|
-
|
|
109
|
-
|
|
119
|
+
/** How many are in a category: the board's own count of each Product feature step in it (rows not loaded count too, as the step columns
|
|
120
|
+
* count them), and the rows on screen of the other workflows. */
|
|
121
|
+
export const catCount = (L, k) => (M().steps || []).reduce((n, s, j) => n + ((WF.PF_STAGES[j] || {}).cat === k ? s.count || 0 : 0), 0)
|
|
122
|
+
+ L.filter((r) => !WF.isPF(WF.wfOf(r)) && WF.catOfRow(r) === k).length;
|
|
123
|
+
/** The columns By stage draws (see above), then Won't do and Archived, only when a row ended there (zero is silence). */
|
|
124
|
+
function columnsOf(L) {
|
|
125
|
+
const { cur, ended } = WFS(), S = M().steps || [];
|
|
126
|
+
let C;
|
|
127
|
+
if (cur && WF.isPF(cur)) {
|
|
128
|
+
C = S.map((s, j) => ({ key: s.key, label: s.label, ms: s.ms, count: s.count, cat: (WF.PF_STAGES[j] || {}).cat, step: j,
|
|
129
|
+
has: (r) => WF.isPF(WF.wfOf(r)) && !!r.track && r.track.k === j, fold0: (rs) => !rs.length || (j >= 6 && !rs.some((r) => r.track.you)) }));
|
|
130
|
+
} else if (cur) {
|
|
131
|
+
C = WF.stagesOfWf(cur, L).map((st) => {
|
|
132
|
+
const has = (r) => WF.wfOf(r).id === cur.id && (WF.stageOfRow(r) || {}).key === st.key;
|
|
133
|
+
return { key: cur.id + ':' + st.key, label: st.name, ms: st.milestone, count: L.filter(has).length, cat: st.cat, stage: st, has, fold0: (rs) => !rs.length };
|
|
134
|
+
});
|
|
135
|
+
} else {
|
|
136
|
+
C = WF.CATS.map(([k, n]) => ({ key: 'cat:' + k, label: n, count: catCount(L, k), cat: k, wide: k === 'doing', has: (r) => WF.catOfRow(r) === k, fold0: (rs) => !rs.length }));
|
|
137
|
+
}
|
|
138
|
+
const E = ended.filter((r) => !cur || WF.wfOf(r).id === cur.id);
|
|
139
|
+
for (const [k, n] of WF.ENDS) {
|
|
140
|
+
const rs = E.filter((r) => r.ended.as === k);
|
|
141
|
+
if (rs.length) C.push({ key: 'end:' + k, label: n, count: rs.length, rows: rs, end: true, has: (r) => !!r.ended && r.ended.as === k, fold0: () => true });
|
|
142
|
+
}
|
|
143
|
+
return C;
|
|
144
|
+
}
|
|
145
|
+
/** A card (BdByStage, PgKanban). With All (mixed), it names its own stage under the title with its workflow's icon (WfABoard). */
|
|
146
|
+
function card(r, drag, mixed) {
|
|
110
147
|
const t = r.track || {}, s = statusLine(r), u = A.usual(t);
|
|
111
148
|
// the foot leads with the next step (PgKanban, the nextfirst rule): your next part in blue when it waits on you, else the output and its
|
|
112
149
|
// count ("BRD 1 of 4"); the owner is in the List, the panel and the card's name for a reader
|
|
113
150
|
const out = t.count && t.count !== 'Not counted yet' ? String(t.output || '').replace(/ complete$/, '').split(/[ ,+]/)[0] + ' ' + String(t.count).replace(/ parts?$/, '') : '';
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
|
|
151
|
+
const you = t.you && nextOf(r) ? `<b class="nx">${esc(cap(nextOf(r).replace(/^Next: /, '')))}</b>` : '';
|
|
152
|
+
const left = you || (mixed ? '' : `<span>${esc(out)}</span>`);
|
|
153
|
+
const right = t.key === 'deliver' && r.release ? r.release.name + ' · ' + r.release.at : (t.key === 'build' || t.key === 'deliver') && t.prog && t.prog.unit !== '%' ? (mixed ? '' : t.count) : t.days != null ? t.days + 'd' + (u ? ' · usually ' + u.days : '') : '';
|
|
154
|
+
const w = WF.stageOfRow(r);
|
|
155
|
+
const counted = /^\d/.test(String(t.count || '')) ? out.trim() : ''; // "PRD 4 of 9", not "PRD — of 9" or "No tickets yet"
|
|
156
|
+
const meta = mixed ? `<span class="cm">${WF.wfIcon(WF.wfOf(r), 16)}<span>${w && w.milestone ? '◆ ' : ''}${esc((w && w.name) || r.stage || 'No stage')}${counted ? ' · ' + esc(counted) : ''}</span></span>` : '';
|
|
157
|
+
const foot = left || right ? `<span class="f">${left || '<span></span>'}<span>${esc(right)}</span></span>` : '';
|
|
158
|
+
return `<button type="button" class="bd-bc ini2${t.ms ? ' ms' : ''}${t.you ? ' you' : ''}${A.sel && A.sel() === r.key ? ' sel' : ''}" data-key="${esc(r.key)}"${drag ? ' draggable="true"' : ''} aria-haspopup="dialog"${r.owner ? ` title="${esc(r.title + ' · owner ' + r.owner)}"` : ''}><b class="t">${r.inProgram && A.memberIcon ? A.memberIcon(r.inProgram) : ''}${esc(r.title)}</b>${meta}<span class="s cs s-${s.tone}"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i>${esc(s.text)}</span>${foot}</button>`;
|
|
117
159
|
}
|
|
118
|
-
/** The
|
|
160
|
+
/** The place a column drops a card into: one of Product feature's eight steps (data-step), or a stage of the picked workflow (data-wfstage). */
|
|
161
|
+
const dropAt = (c, cur) => (c.end ? '' : c.step != null ? ` data-step="${c.step}"` : c.stage ? ` data-wfstage="${esc(c.stage.key)}" data-wf="${esc(cur.id)}"` : '');
|
|
162
|
+
const msI = (ms) => (ms ? '<i class="cz-ms" aria-hidden="true"></i>' : '');
|
|
163
|
+
/** The phone keeps one stacked section per stage (BdPhone): it has no room for lanes side by side. Inside a stage the cards keep the swimlane
|
|
119
164
|
* order (PgKanban): programs first, then each product, each under a small label, only when a program or more than one product is drawn.
|
|
120
|
-
* The empty
|
|
121
|
-
function phoneStages(L,
|
|
165
|
+
* The empty stages fold into one line at the foot, as the desktop folds empty columns (zero is silence). */
|
|
166
|
+
function phoneStages(L, C) {
|
|
167
|
+
const { cur } = WFS();
|
|
122
168
|
const G = A.groups ? A.groups(L) : null;
|
|
123
169
|
const lanes = G ? G.map((g) => ({ g, label: g.kind === 'program' ? `<p class="bd-sl pg">${A.progTile('bd-pti s')}${esc(g.program.title)}</p>` : `<p class="bd-sl">${A.subTile(g.name)}${esc(g.name)}</p>`, rows: g.rows })) : [{ g: null, label: '', rows: L }];
|
|
124
170
|
const empty = [];
|
|
125
|
-
const secs =
|
|
126
|
-
const at = (rows) => rows.filter(
|
|
171
|
+
const secs = C.filter((c) => !c.end).map((c) => {
|
|
172
|
+
const at = (rows) => rows.filter(c.has).sort((a, b) => needOf(a) - needOf(b));
|
|
127
173
|
const n = at(L).length;
|
|
128
|
-
if (!n) { empty.push(
|
|
174
|
+
if (!n) { empty.push(c.label); return ''; }
|
|
129
175
|
const body = lanes.map((ln) => { const rs = at(ln.rows); return rs.length ? (G ? ln.label : '') + rs.map((r) => card(r, false)).join('') : ''; }).join('');
|
|
130
|
-
return `<section class="bd-scol" aria-label="${esc(
|
|
176
|
+
return `<section class="bd-scol" aria-label="${esc(c.label)}"${dropAt(c, cur)}><h3>${msI(c.ms)}${esc(c.label)}<span>${c.count}</span></h3>${body}</section>`;
|
|
131
177
|
}).join('');
|
|
132
178
|
const tail = empty.length ? `<p class="bd-sempty">Nothing on screen in ${esc(empty.length > 1 ? empty.slice(0, -1).join(', ') + ' or ' + empty[empty.length - 1] : empty[0])}.</p>` : '';
|
|
133
|
-
return `<div class="bd-scols ph">${secs}${tail}</div
|
|
179
|
+
return `<div class="bd-scols ph">${secs}${tail}</div>${phoneEnded(C)}`;
|
|
180
|
+
}
|
|
181
|
+
/* the phone's sections (WfAPhone): each folds, remembered (pmos.board.pcats); In progress starts open. A section lists five rows, then "N more". */
|
|
182
|
+
const PCAT_KEY = 'pmos.board.pcats';
|
|
183
|
+
let PCATS = null, pmore = new Set();
|
|
184
|
+
const pcats = () => { if (!PCATS) { let v = null; try { v = JSON.parse(localStorage.getItem(PCAT_KEY) || 'null'); } catch { v = null; } PCATS = v && typeof v === 'object' && !Array.isArray(v) ? v : {}; } return PCATS; };
|
|
185
|
+
const pcatOpen = (k) => (pcats()[k] != null ? pcats()[k] === 'open' : k === 'doing');
|
|
186
|
+
export function togglePcat(k) { pcats()[k] = pcatOpen(k) ? 'fold' : 'open'; try { localStorage.setItem(PCAT_KEY, JSON.stringify(PCATS)); } catch { /* no storage */ } }
|
|
187
|
+
export function morePcat(k) { pmore.add(k); }
|
|
188
|
+
const CHEV_R = 'M10 7l5 5-5 5', CHEV_D = 'M7 10l5 5 5-5';
|
|
189
|
+
function phoneSec(k, label, count, rs, o = {}) {
|
|
190
|
+
const open = pcatOpen(k), all = pmore.has(k) || rs.length <= 6, shown = all ? rs : rs.slice(0, 5);
|
|
191
|
+
const head = `<button type="button" class="bd-ghd bd-pcat${o.end ? ' end' : ''}" data-pcat="${esc(k)}" aria-expanded="${open}">${SV(open ? CHEV_D : CHEV_R)}${esc(label)}<span class="n">${count}</span></button>`;
|
|
192
|
+
if (!open) return head;
|
|
193
|
+
return head + shown.map((r) => phoneRow(r)).join('') + (all ? '' : `<button type="button" class="dlink bd-pmore" data-pmore="${esc(k)}">${rs.length - 5} more</button>`);
|
|
194
|
+
}
|
|
195
|
+
/** All on a phone (WfAPhone): one section per category, then Won't do and Archived as one. */
|
|
196
|
+
function phoneCats(L, C) {
|
|
197
|
+
if (!L.length && !C.some((c) => c.end)) return '<p class="bt-empty">No initiative matches the chips or the filter.</p>';
|
|
198
|
+
const secs = C.filter((c) => !c.end).map((c) => phoneSec(c.cat, c.label, c.count, L.filter(c.has).sort((a, b) => kOf(a) - kOf(b) || needOf(a) - needOf(b)))).join('');
|
|
199
|
+
return `<div class="bd-plist bd-pcats">${secs}</div>${phoneEnded(C)}`;
|
|
200
|
+
}
|
|
201
|
+
/** Won't do and Archived on a phone: one folded section at the foot (WfAPhone). */
|
|
202
|
+
function phoneEnded(C) {
|
|
203
|
+
const E = C.filter((c) => c.end); if (!E.length) return '';
|
|
204
|
+
return `<div class="bd-plist bd-pcats">${phoneSec('end', E.map((c) => c.label).join(' · '), E.reduce((n, c) => n + c.count, 0), [].concat(...E.map((c) => c.rows)), { end: true })}</div>`;
|
|
134
205
|
}
|
|
135
206
|
export function stagesHtml(L, o = {}) {
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
207
|
+
const { cur } = WFS(), mixed = !cur;
|
|
208
|
+
const C = columnsOf(L);
|
|
209
|
+
if (o.phone) return mixed ? phoneCats(L, C) : phoneStages(L, C);
|
|
210
|
+
const drag = !M().board.self && !mixed; // All: a category is not a stage, so a card moves only where its workflow's stages are drawn
|
|
211
|
+
const CC = colChoice();
|
|
139
212
|
colDefault = {};
|
|
140
|
-
const shut =
|
|
141
|
-
const rs = L.filter((r) => r.track && r.track.k === j);
|
|
142
|
-
colDefault[s.key] = !rs.length || (j >= 6 && !rs.some((r) => r.track.you));
|
|
143
|
-
return C[s.key] ? C[s.key] === 'fold' : colDefault[s.key];
|
|
144
|
-
});
|
|
213
|
+
const shut = C.map((c) => { const rs = c.end ? c.rows : L.filter(c.has); colDefault[c.key] = c.fold0(rs); return CC[c.key] ? CC[c.key] === 'fold' : colDefault[c.key]; });
|
|
145
214
|
const G = A.groups ? A.groups(L) : null;
|
|
146
215
|
// the lanes: each a head row (a program or a product) and its rows of cells; with no program here, one lane and no head (zero is silence)
|
|
147
216
|
const lanes = G ? G.map((g) => ({ g, subs: g.kind === 'program' ? g.products.map((x) => ({ name: x.name, rows: x.rows, sub: g.products.length > 1 })) : [{ rows: g.rows }] }))
|
|
148
217
|
: [{ g: null, subs: [{ rows: L }] }];
|
|
149
218
|
let row = 2;
|
|
150
|
-
const
|
|
219
|
+
const order = (rs) => rs.sort((a, b) => (mixed ? kOf(a) - kOf(b) : 0) || needOf(a) - needOf(b));
|
|
220
|
+
const cell = (j, rs, end) => { const c = C[j]; return `<div class="bd-kc${end ? ' end' : ''}${c.wide ? ' wide' : ''}"${dropAt(c, cur)} style="grid-row:${row};grid-column:${j + 1}" aria-label="${esc(c.label)}">${order(rs.filter(c.has)).map((r) => card(r, drag, mixed)).join('')}</div>`; };
|
|
151
221
|
let body = '';
|
|
152
222
|
lanes.forEach((ln, li) => {
|
|
153
223
|
const g = ln.g, open = !g || !A.folded(g.key);
|
|
@@ -156,28 +226,41 @@ export function stagesHtml(L, o = {}) {
|
|
|
156
226
|
ln.subs.forEach((sub, si) => {
|
|
157
227
|
if (sub.sub) { body += `<div class="bd-ls" style="grid-row:${row}">${A.subTile(sub.name)}${esc(sub.name)}</div>`; row++; }
|
|
158
228
|
const last = li === lanes.length - 1 && si === ln.subs.length - 1;
|
|
159
|
-
body +=
|
|
229
|
+
body += C.map((c, j) => (shut[j] || c.end ? '' : cell(j, sub.rows, last))).join('');
|
|
160
230
|
row++;
|
|
161
231
|
});
|
|
162
232
|
});
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
233
|
+
// an open Won't do or Archived column: its cards, beside the first row (under the lanes when programs are drawn)
|
|
234
|
+
if (C.some((c, j) => c.end && !shut[j])) {
|
|
235
|
+
const at = G ? row++ : 2;
|
|
236
|
+
body += C.map((c, j) => (c.end && !shut[j] ? `<div class="bd-kc end" style="grid-row:${at};grid-column:${j + 1}" aria-label="${esc(c.label)}">${c.rows.map((r) => card(r, false)).join('')}</div>` : '')).join('');
|
|
237
|
+
}
|
|
238
|
+
const bodyEnd = row; // the strips run down to here; the category bar sits under them
|
|
239
|
+
// one workflow: the category bar under its stages (WfABoardOne)
|
|
240
|
+
if (!mixed) {
|
|
241
|
+
const runs = []; C.forEach((c, j) => { if (c.end) return; const l = runs[runs.length - 1]; if (l && l.cat === c.cat) l.b = j; else runs.push({ cat: c.cat, a: j, b: j }); });
|
|
242
|
+
body += runs.map((x) => `<div class="bd-kcat" style="grid-row:${row};grid-column:${x.a + 1} / ${x.b + 2}"><span>${esc(WF.catLabel(x.cat))}</span></div>`).join('');
|
|
243
|
+
row++;
|
|
244
|
+
}
|
|
245
|
+
const span = Math.max(2, bodyEnd);
|
|
246
|
+
const heads = C.map((c, j) => (shut[j]
|
|
247
|
+
? `<button type="button" class="bd-kstrip${c.end ? ' end' : ''}" data-colfold="${esc(c.key)}" style="grid-column:${j + 1};grid-row:1 / span ${span - 1}" aria-expanded="false" aria-label="Show ${esc(c.label)}, ${c.count}"><b>${c.count}</b><span>${msI(c.ms)}${esc(c.label)}</span></button>`
|
|
248
|
+
: `<button type="button" class="bd-kh" data-colfold="${esc(c.key)}" style="grid-column:${j + 1}" aria-expanded="true" aria-label="${esc(c.label)}, ${c.count}. Fold the column"><span class="l">${msI(c.ms)}${esc(c.label)}</span><span class="n">${c.count}</span>${SV('M7 10l5 5 5-5')}</button>`)).join('');
|
|
249
|
+
const cols = C.map((c, j) => (shut[j] ? '40px' : c.wide ? 'minmax(0,3.2fr)' : 'minmax(0,1fr)')).join(' ');
|
|
168
250
|
const foot = `<div class="bd-foot bd-sfoot"><span>Any column folds to a strip and stays folded. Empty ones start folded.</span>${drag ? '<span>Drag a card to move its stage</span>' : ''}</div>`;
|
|
169
|
-
return `<div class="bd-kb${G ? ' lanes' : ''}" style="grid-template-columns:${cols}">${heads}${body}</div>${foot}`;
|
|
251
|
+
return `<div class="bd-kb${G ? ' lanes' : ''}${mixed ? ' cats' : ''}" style="grid-template-columns:${cols}">${heads}${body}</div>${foot}`;
|
|
170
252
|
}
|
|
171
253
|
|
|
172
254
|
/* ── the phone list (BdPhone) ─────────────────────────────────────────────────────────────────────────────────── */
|
|
255
|
+
/** A phone row: the status dot, the title, the stage and what it waits on; the workflow's icon at the end when the board has more than one. */
|
|
256
|
+
function phoneRow(r) {
|
|
257
|
+
const s = statusLine(r), t = r.track || {}, w = WF.stageOfRow(r);
|
|
258
|
+
const sub = [(w && w.name) || t.label || r.stage, t.you ? t.you.replace(/^Your /, 'your ') : s.tone !== 'ok' && s.tone !== 'q' ? s.text.toLowerCase() : '', r.owner].filter(Boolean).join(' · ');
|
|
259
|
+
return `<button type="button" class="bd-lrow ini2${A.sel && A.sel() === r.key ? ' sel' : ''}" data-key="${esc(r.key)}" aria-haspopup="dialog"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i><span class="tx"><span class="t">${esc(r.title)}</span><span class="s${t.you ? '' : ' q'}">${esc(sub)}</span></span>${t.you && t.days != null ? `<span class="r">${t.days}d</span>` : ''}${many() ? WF.wfIcon(WF.wfOf(r), 18) : ''}</button>`;
|
|
260
|
+
}
|
|
173
261
|
export function phoneListHtml(L) {
|
|
174
262
|
const you = L.filter((r) => r.track && r.track.you), bad = L.filter((r) => !you.includes(r) && needOf(r) <= 3), rest = L.filter((r) => !you.includes(r) && !bad.includes(r));
|
|
175
|
-
const
|
|
176
|
-
const s = statusLine(r), t = r.track || {};
|
|
177
|
-
const sub = [t.label || r.stage, t.you ? t.you.replace(/^Your /, 'your ') : s.tone !== 'ok' && s.tone !== 'q' ? s.text.toLowerCase() : '', r.owner].filter(Boolean).join(' · ');
|
|
178
|
-
return `<button type="button" class="bd-lrow ini2${A.sel && A.sel() === r.key ? ' sel' : ''}" data-key="${esc(r.key)}" aria-haspopup="dialog"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i><span class="tx"><span class="t">${esc(r.title)}</span><span class="s${t.you ? '' : ' q'}">${esc(sub)}</span></span>${t.you && t.days != null ? `<span class="r">${t.days}d</span>` : ''}</button>`;
|
|
179
|
-
};
|
|
180
|
-
const grp = (name, rs) => (rs.length ? `<div class="bd-ghd">${esc(name)}<span class="n">${rs.length}</span></div>${rs.map(row).join('')}` : '');
|
|
263
|
+
const grp = (name, rs) => (rs.length ? `<div class="bd-ghd">${esc(name)}<span class="n">${rs.length}</span></div>${rs.map(phoneRow).join('')}` : '');
|
|
181
264
|
if (!L.length) return '<p class="bt-empty">No initiative matches the chips or the filter.</p>';
|
|
182
265
|
return `<div class="bd-plist">${grp('Your turn', you)}${grp('At risk or late', bad)}${grp('On track', rest)}</div>`;
|
|
183
266
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* pm/bd-wf.js — the Board's workflows (D99, initiative workflows-per-initiative, workstream B: WfABoard, WfABoardOne, WfATrack, WfAElse, WfAPhone).
|
|
2
|
+
* Every initiative is on one workflow: a numbered list of stages, each in a category (To do, In progress, Done); Won't do and Archived are in
|
|
3
|
+
* every workflow. The rows carry `wf`, `wfStage`, `wfStages` and `ended` (common.md, "Row fields"); a row without them is on Product feature,
|
|
4
|
+
* whose stages are the eight lifecycle steps (Triage is To do, Evaluate is Done, the rest are In progress).
|
|
5
|
+
* · the chip row: All, then one chip per workflow on the board with its count. A picked workflow is remembered (pmos.board.wf). With one
|
|
6
|
+
* workflow on the board there is nothing to pick, so no chip row is drawn and the Board shows that workflow's stages (zero is silence).
|
|
7
|
+
* · picked(): the workflow whose own stages the Board draws, or null for All (the Board then draws the three categories).
|
|
8
|
+
* · the stage lists come from GET /api/workflows (the definitions), else from a row's own `wfStages`, else Product feature's.
|
|
9
|
+
* Pure markup and state; the page (premium-board.js) and the views (bd-views.js) draw with it. */
|
|
10
|
+
import { esc, store } from './premium-shell.js';
|
|
11
|
+
import { CATS, ENDS, wfIcon, catLabel, PRODUCT_FEATURE_ID } from './wf-model.js';
|
|
12
|
+
|
|
13
|
+
export { CATS, ENDS, wfIcon, catLabel };
|
|
14
|
+
export const PF = { id: PRODUCT_FEATURE_ID, name: 'Product feature', icon: 'feature' };
|
|
15
|
+
/** Product feature's stages, in the order and categories of the eight lifecycle steps (lib/board-premium.js STEPS). */
|
|
16
|
+
export const PF_STAGES = [['triage', 'Triage', 'todo'], ['discover', 'Discover', 'doing'], ['plan', 'Plan', 'doing'], ['prioritize', 'Prioritize', 'doing'],
|
|
17
|
+
['build', 'Build', 'doing'], ['deliver', 'Deliver', 'doing', true], ['monitor', 'Monitor', 'doing'], ['evaluate', 'Evaluate', 'done', true]]
|
|
18
|
+
.map(([key, name, cat, ms]) => ({ key, name, cat, milestone: !!ms }));
|
|
19
|
+
export const CAT_ORDER = { todo: 0, doing: 1, done: 2, wontdo: 3, archived: 4 };
|
|
20
|
+
const PICK_KEY = 'pmos.board.wf';
|
|
21
|
+
/** Where a workflow is edited: the Workflows page (workstream C, WfAModel), opened at that workflow. */
|
|
22
|
+
export const editHref = (wf) => '/premium-workflows.html?wf=' + encodeURIComponent(wf.id);
|
|
23
|
+
|
|
24
|
+
export const isPF = (wf) => !wf || !wf.id || wf.id === PRODUCT_FEATURE_ID;
|
|
25
|
+
/** The workflow a row is on: its own, else Product feature. */
|
|
26
|
+
export const wfOf = (r) => (r && r.wf && r.wf.id ? r.wf : PF);
|
|
27
|
+
/** The stage a row stands in: { key, name, cat, milestone, n, of }, or null when no record places it. */
|
|
28
|
+
export function stageOfRow(r) {
|
|
29
|
+
if (!r) return null;
|
|
30
|
+
if (r.wfStage && r.wfStage.key) return r.wfStage;
|
|
31
|
+
const k = r.track && r.track.k;
|
|
32
|
+
if (!isPF(wfOf(r)) || !(k >= 0) || !PF_STAGES[k]) return null;
|
|
33
|
+
return { ...PF_STAGES[k], n: k + 1, of: PF_STAGES.length };
|
|
34
|
+
}
|
|
35
|
+
/** The row's own stage list (for its track): the record's, else Product feature's with the steps the row skipped. */
|
|
36
|
+
export function stagesOfRow(r) {
|
|
37
|
+
if (r && Array.isArray(r.wfStages) && r.wfStages.length) return r.wfStages;
|
|
38
|
+
const t = (r && r.track) || {}, sk = new Set(t.skipped || []);
|
|
39
|
+
return PF_STAGES.map((s, j) => (sk.has(j) ? { ...s, skipped: { why: ((t.skipWhy || []).find((x) => x.stage === s.key) || {}).why || '' } } : s));
|
|
40
|
+
}
|
|
41
|
+
/** The category a row is in: its end (Won't do, Archived) when it ended, else its stage's. */
|
|
42
|
+
export function catOfRow(r) { if (r && r.ended && r.ended.as) return r.ended.as; const s = stageOfRow(r); return s ? s.cat : null; }
|
|
43
|
+
/** A row's place in "stage order" across workflows: its category, then how far along its own list it is. Rows with no stage sort last. */
|
|
44
|
+
export function posOf(r) {
|
|
45
|
+
const c = catOfRow(r), s = stageOfRow(r);
|
|
46
|
+
if (c == null || !s) return 99;
|
|
47
|
+
return CAT_ORDER[c] * 10 + (s.of ? (s.n - 1) / s.of : 0);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* ── the workflows on this board ─────────────────────────────────────────────────────────────────────────────── */
|
|
51
|
+
let DEFS = {}; // GET /api/workflows: { [id]: workflow }
|
|
52
|
+
export function setDefs(list) { DEFS = {}; for (const w of list || []) if (w && w.id) DEFS[w.id] = w; }
|
|
53
|
+
/** The workflows with rows on this board, Product feature first, then by count: the model's, else counted from the rows. */
|
|
54
|
+
export function workflowsOf(M) {
|
|
55
|
+
if (M && Array.isArray(M.workflows) && M.workflows.length) return M.workflows;
|
|
56
|
+
const rows = (M && M.initiatives && M.initiatives.list && M.initiatives.list.rows) || [];
|
|
57
|
+
const by = new Map();
|
|
58
|
+
for (const r of rows) { const w = wfOf(r); const x = by.get(w.id) || { id: w.id, name: w.name || w.id, icon: w.icon || 'feature', count: 0 }; x.count++; by.set(w.id, x); }
|
|
59
|
+
return [...by.values()].sort((a, b) => (isPF(b) - isPF(a)) || b.count - a.count || a.name.localeCompare(b.name));
|
|
60
|
+
}
|
|
61
|
+
/** A workflow's stages: its definition, else the stage list of a row on it, else (Product feature) the eight steps. */
|
|
62
|
+
export function stagesOfWf(wf, rows) {
|
|
63
|
+
const d = wf && DEFS[wf.id];
|
|
64
|
+
if (d && Array.isArray(d.stages) && d.stages.length) return d.stages.map((s) => ({ key: s.key, name: s.name, cat: s.cat, milestone: !!s.milestone }));
|
|
65
|
+
const r = (rows || []).find((x) => wfOf(x).id === (wf && wf.id) && Array.isArray(x.wfStages) && x.wfStages.length);
|
|
66
|
+
if (r) return r.wfStages.map((s) => ({ key: s.key, name: s.name, cat: s.cat, milestone: !!s.milestone }));
|
|
67
|
+
return PF_STAGES.slice();
|
|
68
|
+
}
|
|
69
|
+
/** The picked workflow: the one the PM pressed, or the only one on the board; null is All (more than one, none picked). */
|
|
70
|
+
export function picked(list) {
|
|
71
|
+
const v = store.get(PICK_KEY);
|
|
72
|
+
const w = v && v !== 'all' ? list.find((x) => x.id === v) : null;
|
|
73
|
+
return w || (list.length === 1 ? list[0] : null);
|
|
74
|
+
}
|
|
75
|
+
/** The PM pressed a chip (or the Filter's Workflow group): an id, or '' for All. */
|
|
76
|
+
export function setPick(id) { store.set(PICK_KEY, id || 'all'); }
|
|
77
|
+
/** Did the PM narrow the rows to one workflow? (The only workflow on a board narrows nothing.) */
|
|
78
|
+
export const narrowed = (list) => list.length > 1 && !!picked(list);
|
|
79
|
+
|
|
80
|
+
const PEN = 'M4 20h4L19 9l-4-4L4 16zM14 6l4 4';
|
|
81
|
+
/** The chip row (WfABoard, WfABoardOne, WfATrack, WfAPhone): All, then each workflow as its icon and count; the picked one also names
|
|
82
|
+
* itself, and an edit icon opens it on the Workflows page. Nothing is drawn with one workflow on the board. */
|
|
83
|
+
export function chipsHtml(list, cur, o = {}) {
|
|
84
|
+
if (list.length < 2) return '';
|
|
85
|
+
const chip = (w) => { const on = !!cur && cur.id === w.id;
|
|
86
|
+
return `<button type="button" class="bd-chip bd-wfc${on ? ' on' : ''}" data-wfpick="${esc(w.id)}" aria-pressed="${on}" aria-label="${esc(w.name)} only, ${w.count}">${wfIcon(w, 16)}${on ? esc(w.name) + ' · ' : ''}${w.count}</button>`; };
|
|
87
|
+
const edit = cur && !o.phone ? `<a class="bd-ib sm bd-wfedit" href="${esc(editHref(cur))}" aria-label="Edit the ${esc(cur.name)} workflow" title="Edit the ${esc(cur.name)} workflow"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="${PEN}"/></svg></a>` : '';
|
|
88
|
+
return `<div class="bd-wfchips" role="group" aria-label="Workflow"><button type="button" class="bd-chip${cur ? '' : ' on'}" data-wfpick="" aria-pressed="${!cur}">All</button>${list.map(chip).join('')}${edit}</div>`;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** The rows that ended (Won't do, Archived): a row whose record says so, and the board's cancelled (Won't do) and archived rows. */
|
|
92
|
+
export function endedRows(M) {
|
|
93
|
+
const G = (M && M.initiatives && M.initiatives.gone) || {}, out = [], seen = new Set();
|
|
94
|
+
const add = (r, as) => { if (!r || seen.has(r.key)) return; seen.add(r.key); out.push(r.ended && r.ended.as ? r : { ...r, ended: { as, reason: '', note: '', at: null } }); };
|
|
95
|
+
for (const r of (M && M.rows) || []) if (r.id && r.ended && r.ended.as) add(r, r.ended.as);
|
|
96
|
+
for (const r of G.cancelled || []) add(r, 'wontdo');
|
|
97
|
+
for (const r of G.archived || []) add(r, 'archived');
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
@@ -808,7 +808,7 @@ button.pk-jt:focus-visible { outline: 2px solid var(--cz-blue); outline-offset:
|
|
|
808
808
|
.bd-qc b { font-size: 14px; font-weight: 800; }
|
|
809
809
|
/* List (BdList) */
|
|
810
810
|
.bd-ltw { border: 1px solid var(--cz-hair); border-radius: 18px; overflow: hidden; background: var(--cz-card); }
|
|
811
|
-
.bd-lt { display: grid; grid-template-columns: minmax(
|
|
811
|
+
.bd-lt { display: grid; grid-template-columns: minmax(170px, 1.5fr) 140px minmax(100px, .8fr) 100px minmax(130px, 1fr) 54px minmax(110px, 1.1fr) 70px 90px 36px; gap: 0 12px; align-items: center; min-height: 52px; padding: 0 10px 0 16px; border-top: 1px solid var(--cz-hair); font-size: 13px; }
|
|
812
812
|
.bd-lt.h { border-top: 0; min-height: 40px; background: var(--cz-well); font-size: 12px; font-weight: 800; color: var(--cz-ink3); }
|
|
813
813
|
.bd-lt:hover:not(.h):not(.foot) { background: var(--bd-row); }
|
|
814
814
|
.bd-lt.sel { background: var(--cz-bluebg); }
|
|
@@ -912,8 +912,8 @@ button.sp-n:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: -
|
|
|
912
912
|
.bd-lrow .s.q { color: var(--cz-ink3); }
|
|
913
913
|
.bd-lrow .r { font-size: 12px; font-weight: 700; color: var(--cz-blueink); white-space: nowrap; }
|
|
914
914
|
@media (max-width: 1200px) and (min-width: 721px) {
|
|
915
|
-
.bd-lt { grid-template-columns: minmax(160px, 1.6fr) minmax(100px, .9fr) minmax(120px, 1fr) 44px 70px 80px 36px; }
|
|
916
|
-
.bd-lt > :nth-child(
|
|
915
|
+
.bd-lt { grid-template-columns: minmax(160px, 1.6fr) 120px minmax(100px, .9fr) minmax(120px, 1fr) 44px 70px 80px 36px; }
|
|
916
|
+
.bd-lt > :nth-child(4), .bd-lt > :nth-child(7) { display: none; }
|
|
917
917
|
.bd-dt { grid-template-columns: 30px minmax(0, 1.5fr) minmax(0, 1fr) 150px 90px; }
|
|
918
918
|
.bd-dt > :nth-child(6) { display: none; }
|
|
919
919
|
}
|
|
@@ -1052,13 +1052,13 @@ html[data-theme="dark"] body.bd-page { --bd-prog: rgb(180,170,240); --bd-progbg:
|
|
|
1052
1052
|
.bd-sfoot { padding-left: 50px; }
|
|
1053
1053
|
|
|
1054
1054
|
/* List (PgList): Product and Program after the initiative */
|
|
1055
|
-
.bd-ltw.pg .bd-lt { grid-template-columns: minmax(150px,
|
|
1055
|
+
.bd-ltw.pg .bd-lt { grid-template-columns: minmax(150px, 1.8fr) 128px 150px 132px minmax(90px, .8fr) 100px minmax(120px, 1.3fr) 54px minmax(100px, 1.1fr) 70px 90px 36px; }
|
|
1056
1056
|
.bd-ltw.pg .bd-lt.foot { grid-template-columns: 1fr auto; }
|
|
1057
1057
|
.bd-pt { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-weight: 700; font-size: 12.5px; color: var(--cz-ink2); white-space: nowrap; overflow: hidden; }
|
|
1058
1058
|
@media (max-width: 1200px) and (min-width: 721px) {
|
|
1059
1059
|
.bd-ltw.pg .bd-lt { grid-template-columns: minmax(150px, 1.6fr) 110px 130px minmax(100px, .9fr) minmax(120px, 1fr) 44px 70px 80px 36px; }
|
|
1060
|
-
.bd-ltw.pg .bd-lt > :nth-child(4), .bd-ltw.pg .bd-lt > :nth-child(
|
|
1061
|
-
.bd-ltw.pg .bd-lt > :nth-child(2), .bd-ltw.pg .bd-lt > :nth-child(
|
|
1060
|
+
.bd-ltw.pg .bd-lt > :nth-child(4), .bd-ltw.pg .bd-lt > :nth-child(6), .bd-ltw.pg .bd-lt > :nth-child(9) { display: none; }
|
|
1061
|
+
.bd-ltw.pg .bd-lt > :nth-child(2), .bd-ltw.pg .bd-lt > :nth-child(7) { display: inline-flex; }
|
|
1062
1062
|
}
|
|
1063
1063
|
|
|
1064
1064
|
/* the timeline (PgTimeline): one line per initiative; the program row brackets its initiatives and draws its milestones as violet diamonds */
|
|
@@ -1133,3 +1133,64 @@ html[data-theme="dark"] body.bd-page { --bd-prog: rgb(180,170,240); --bd-progbg:
|
|
|
1133
1133
|
.bt-gmore { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; padding: 9px 14px 9px 50px; background: var(--bd-row); border-top: 1px solid var(--cz-hair); font: 800 12px var(--cz-sans); color: var(--cz-ink3); }
|
|
1134
1134
|
.bt-gmore:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: -2px; }
|
|
1135
1135
|
.bt-gmore svg { width: 14px; height: 14px; }
|
|
1136
|
+
|
|
1137
|
+
/* ── workflows (D99, workflows-per-initiative, workstream B: WfABoard, WfABoardOne, WfATrack, WfAElse, WfAPhone) ── */
|
|
1138
|
+
.wfi { display: inline-flex; flex: none; align-items: center; justify-content: center; color: var(--cz-ink2); }
|
|
1139
|
+
.wfi svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
|
1140
|
+
.bd-wfchips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
|
|
1141
|
+
.bd-wfchips .bd-chip { display: inline-flex; align-items: center; gap: 5px; }
|
|
1142
|
+
.bd-wfedit { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink2); }
|
|
1143
|
+
.bd-wfedit svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
1144
|
+
.bd-fg .bd-chip .wfi { margin-right: 4px; }
|
|
1145
|
+
/* By stage: a card names its own stage with its workflow's icon (All), In progress holds its cards three across, the category bar (one workflow) */
|
|
1146
|
+
.bd-bc .cm { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--cz-ink2); min-width: 0; }
|
|
1147
|
+
.bd-bc .cm > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1148
|
+
.bd-kc.wide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; }
|
|
1149
|
+
.bd-kcat { margin-top: 6px; padding-top: 4px; border-top: 2px solid var(--cz-hair); text-align: center; font-size: 11.5px; font-weight: 800; color: var(--cz-ink3); min-width: 0; }
|
|
1150
|
+
.bd-kcat span { white-space: nowrap; }
|
|
1151
|
+
.bd-kstrip.end { color: var(--cz-ink3); background: transparent; border: 1px dashed var(--cz-hair); }
|
|
1152
|
+
.bd-kstrip.end b { color: var(--cz-ink3); }
|
|
1153
|
+
/* the List: Workflow (icon and name), Stage and Category (WfAElse); the columns are set with the List's own rules above */
|
|
1154
|
+
.bd-wfn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-weight: 700; font-size: 12.5px; color: var(--cz-ink2); white-space: nowrap; overflow: hidden; }
|
|
1155
|
+
/* the track: another workflow's stages share the cells' width; with All, three category bands of bars (WfATrack) */
|
|
1156
|
+
.bt-cells.wfn { grid-template-columns: repeat(var(--n), calc(576px / var(--n))); }
|
|
1157
|
+
.bt-cells.bands { grid-template-columns: 64px minmax(0, 1fr) 72px; width: 576px; column-gap: 12px; padding: 0 8px; box-sizing: border-box; }
|
|
1158
|
+
.bt-l .bt-cells.bands > .bnd { justify-content: flex-start; }
|
|
1159
|
+
.bnd { display: flex; gap: 4px; align-items: center; min-height: 34px; min-width: 0; }
|
|
1160
|
+
.bnd span { flex: 1; position: relative; height: 8px; border-radius: 4px; background: var(--bd-rail); min-width: 6px; }
|
|
1161
|
+
.bnd span.dn { background: var(--bd-pass); }
|
|
1162
|
+
.bnd span.nw { background: var(--cz-ink); }
|
|
1163
|
+
.bnd span.k { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bd-pass); }
|
|
1164
|
+
.bnd span.m { flex: 0 0 10px; min-width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; }
|
|
1165
|
+
.bnd span em { position: absolute; top: 12px; left: 0; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--cz-ink2); white-space: nowrap; }
|
|
1166
|
+
.bnd span.m em { transform: rotate(-45deg); transform-origin: 0 0; top: 10px; left: 10px; }
|
|
1167
|
+
.bt-nm b .wfi { margin-right: 6px; vertical-align: -3px; }
|
|
1168
|
+
@media (max-width: 1200px) {
|
|
1169
|
+
.bt-cells.wfn { grid-template-columns: repeat(var(--n), calc(480px / var(--n))); }
|
|
1170
|
+
.bt-cells.bands { width: 480px; }
|
|
1171
|
+
}
|
|
1172
|
+
@media (max-width: 980px) and (min-width: 721px) {
|
|
1173
|
+
.bt-cells.wfn { grid-template-columns: repeat(var(--n), calc(400px / var(--n))); }
|
|
1174
|
+
.bt-cells.bands { width: 400px; }
|
|
1175
|
+
}
|
|
1176
|
+
@media (max-width: 720px) {
|
|
1177
|
+
.bt-cells.bands { width: auto; padding: 0; gap: 8px; }
|
|
1178
|
+
.bt-cells.bands::before { display: none; }
|
|
1179
|
+
.bt-l .bt-cells.bands > .bnd { width: auto; height: 12px; min-height: 0; flex: 0 0 auto; gap: 3px; }
|
|
1180
|
+
.bt-l .bt-cells.bands > .bnd:nth-child(2) { flex: 1 1 auto; }
|
|
1181
|
+
.bnd span { height: 6px; }
|
|
1182
|
+
.bnd span.m { flex-basis: 7px; min-width: 7px; height: 7px; }
|
|
1183
|
+
.bnd span em { display: none; }
|
|
1184
|
+
.bd-wfchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 4px; padding: 0 16px; }
|
|
1185
|
+
.bd-wfchips::-webkit-scrollbar { display: none; }
|
|
1186
|
+
}
|
|
1187
|
+
/* the phone's category sections (WfAPhone) */
|
|
1188
|
+
.bd-pcats { gap: 4px; }
|
|
1189
|
+
.bd-pcat { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 8px 10px 4px 8px; font-size: 13px; font-weight: 800; color: var(--cz-ink2); }
|
|
1190
|
+
.bd-pcat.end { color: var(--cz-ink3); }
|
|
1191
|
+
.bd-pcat svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
1192
|
+
.bd-pcat:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; border-radius: 8px; }
|
|
1193
|
+
.bd-pcats .bd-lrow { background: var(--cz-card); }
|
|
1194
|
+
.bd-lrow .wfi { margin-left: 2px; }
|
|
1195
|
+
.bd-pmore { all: unset; box-sizing: border-box; cursor: pointer; align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); }
|
|
1196
|
+
.bd-pmore:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; border-radius: 8px; }
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* wtChip(worktrees) → 'main + 3 worktrees'
|
|
13
13
|
* initials(name) → 'Mei' · 'DL' (EvInbox's avatars: a short first name, else two initials) */
|
|
14
14
|
|
|
15
|
-
const PLACE = { home: 'Home', board: 'Board', insights: 'Insights' };
|
|
15
|
+
const PLACE = { home: 'Home', board: 'Board', insights: 'Insights', settings: 'Settings' };
|
|
16
16
|
const SRC_NAME = { repository: 'Repository', initiatives: 'Initiatives', calendar: 'Calendar', jira: 'Jira', 'my-work': 'Your tasks', tracker: 'Tracker items', tools: 'Mail, Slack and meeting notes' };
|
|
17
17
|
const SRC_SUB = { repository: 'This product\'s repository', initiatives: 'Read from the repository', calendar: 'Your calendar', jira: 'The Jira projects of your initiatives', 'my-work': 'The work assigned to you', tracker: 'The tracker items of your initiatives', tools: 'Mail, Slack, Confluence and Wispr Flow' };
|
|
18
18
|
const PARTS = { jira: 'Board and the Jira-linked initiatives', calendar: 'Today and your meetings', 'my-work': 'Your tasks', tracker: 'The tracker items on Board', tools: 'New for you and the digests', initiatives: 'Home and Board', repository: 'Home and Board' };
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Every class here starts with pp-; the Viewer's body carries .pp-vw while it shows a program. */
|
|
5
5
|
|
|
6
6
|
/* the program's purple (PgProgram --prog / --progbg), light and dark */
|
|
7
|
-
body.bd-page { --pp-prog: var(--cz-c-6b4fa3); --pp-progbg: var(--cz-c-f1ecf8); --pp-diam: rgba(107,79,163,.32); --pp-amber: var(--cz-c-d4a13a); }
|
|
8
|
-
html[data-theme="dark"] body.bd-page { --pp-prog: var(--cz-c-b07cc6); --pp-progbg: rgba(176,124,198,.16); --pp-diam: rgba(176,124,198,.4); }
|
|
9
|
-
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body.bd-page { --pp-prog: var(--cz-c-b07cc6); --pp-progbg: rgba(176,124,198,.16); --pp-diam: rgba(176,124,198,.4); } }
|
|
7
|
+
body.bd-page, body.cz-home { --pp-prog: var(--cz-c-6b4fa3); --pp-progbg: var(--cz-c-f1ecf8); --pp-diam: rgba(107,79,163,.32); --pp-amber: var(--cz-c-d4a13a); }
|
|
8
|
+
html[data-theme="dark"] body.bd-page, html[data-theme="dark"] body.cz-home { --pp-prog: var(--cz-c-b07cc6); --pp-progbg: rgba(176,124,198,.16); --pp-diam: rgba(176,124,198,.4); }
|
|
9
|
+
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body.bd-page, html:not([data-theme="light"]) body.cz-home { --pp-prog: var(--cz-c-b07cc6); --pp-progbg: rgba(176,124,198,.16); --pp-diam: rgba(176,124,198,.4); } }
|
|
10
10
|
/* the products' tiles: blue, warm, grey; dark mode takes their tints */
|
|
11
|
-
body.bd-page { --pp-t0: var(--cz-c-e8f1fb); --pp-t0i: var(--cz-blueink); --pp-t1: var(--cz-c-f4eee6); --pp-t1i: var(--cz-c-7a5a2e); }
|
|
12
|
-
html[data-theme="dark"] body.bd-page { --pp-t0: rgba(106,170,240,.16); --pp-t1: rgba(232,160,122,.16); --pp-t1i: var(--cz-c-e8a07a); }
|
|
13
|
-
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body.bd-page { --pp-t0: rgba(106,170,240,.16); --pp-t1: rgba(232,160,122,.16); --pp-t1i: var(--cz-c-e8a07a); } }
|
|
11
|
+
body.bd-page, body.cz-home { --pp-t0: var(--cz-c-e8f1fb); --pp-t0i: var(--cz-blueink); --pp-t1: var(--cz-c-f4eee6); --pp-t1i: var(--cz-c-7a5a2e); }
|
|
12
|
+
html[data-theme="dark"] body.bd-page, html[data-theme="dark"] body.cz-home { --pp-t0: rgba(106,170,240,.16); --pp-t1: rgba(232,160,122,.16); --pp-t1i: var(--cz-c-e8a07a); }
|
|
13
|
+
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body.bd-page, html:not([data-theme="light"]) body.cz-home { --pp-t0: rgba(106,170,240,.16); --pp-t1: rgba(232,160,122,.16); --pp-t1i: var(--cz-c-e8a07a); } }
|
|
14
14
|
|
|
15
15
|
/* the shell's icon tile takes the program's purple; the parts sit in the Viewer's body, its rows' bodies lose their own frame */
|
|
16
16
|
#czViewer:has(> .cz-vw-body.pp-vw) .cz-vw-tile { background: var(--pp-progbg); color: var(--pp-prog); }
|
|
@@ -153,3 +153,9 @@ a.pp-nd.pp-tk:focus-visible, .pp-nd.pp-more:focus-visible { outline: 2px solid v
|
|
|
153
153
|
.pp-m b { font-size: 11.5px; }
|
|
154
154
|
.pp-nr, .pp-nd, .pp-doc { min-height: 44px; }
|
|
155
155
|
}
|
|
156
|
+
|
|
157
|
+
/* no milestone yet: one dashed way into the charter, at Milestones (canvas MsEmpty) */
|
|
158
|
+
.pp-first { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--pp-prog) 45%, transparent); color: var(--pp-prog); font-size: 13px; font-weight: 700; }
|
|
159
|
+
.pp-first .gd { width: 11px; height: 11px; transform: rotate(45deg); border-radius: 3px; border: 1.5px dashed currentColor; flex: none; }
|
|
160
|
+
.pp-first:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
161
|
+
@media (hover: hover) { .pp-first:hover { background: var(--pp-progbg); } }
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Your day (when the end-of-day card shows: time.workEnd, POST /api/settings), Agents write to Jira (fixed: only after Commit)
|
|
4
4
|
* Connectors what PMOS reads on its own, and the connectors your sessions have (GET and POST /api/proactive/settings)
|
|
5
5
|
* Workspaces the repositories PMOS works in (GET and POST /api/workspaces, POST /api/workspaces/forget; the folder is never touched)
|
|
6
|
+
* Workflows a link to its own page, /premium-workflows.html (pm/wf-page.js, D99): the stages each kind of initiative goes through
|
|
6
7
|
* Updates the versions and Check now, Update, Restart to update (GET /api/kit/status, POST /api/kit/check | update | upgrade-app)
|
|
7
8
|
* What's new what each published kit changed, newest first (the kit status's changelog lines)
|
|
8
9
|
* The card at the bottom of General says when an update is ready. Every write is the PM's press (pmPost carries the launch nonce).
|
|
@@ -10,7 +11,8 @@
|
|
|
10
11
|
import { pmGet, pmPost } from './http.js';
|
|
11
12
|
import { esc, svg, ICON, toast } from './cozy-evui.js';
|
|
12
13
|
|
|
13
|
-
const SECTIONS = [['general', 'General'], ['connectors', 'Connectors'], ['workspaces', 'Workspaces'], ['updates', 'Updates'], ['whatsnew', "What's new"]];
|
|
14
|
+
const SECTIONS = [['general', 'General'], ['connectors', 'Connectors'], ['workspaces', 'Workspaces'], ['workflows', 'Workflows'], ['updates', 'Updates'], ['whatsnew', "What's new"]];
|
|
15
|
+
const PAGE_LINKS = { workflows: '/premium-workflows.html' }; // a section that is a page of its own: the row goes there
|
|
14
16
|
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' };
|
|
15
17
|
const VIEWER_KEY = 'pmos.cz.viewer';
|
|
16
18
|
const T = { el: null, sec: 'general', ws: null, st: {}, src: null, con: {}, conn: [], set: null, prods: null, msg: '', busy: false, phase: '', say: '', back: null };
|
|
@@ -87,7 +89,7 @@ function draw() {
|
|
|
87
89
|
// a redraw replaces the nodes: keep focus on the same control (by its data-ev-* key), else on the open section, never on the body
|
|
88
90
|
const ae = document.activeElement, had = ae && el.contains(ae), key = had ? [...ae.attributes].find((a) => a.name.startsWith('data-ev-')) : null;
|
|
89
91
|
const n = { connectors: T.src === null ? '' : Object.keys(SRC).filter((k) => T.src[k]).length + T.conn.filter((c) => !c.source && T.con[c.name]).length, workspaces: T.ws ? T.ws.length : '', updates: ready() ? '<span class="ev-pill y">1</span>' : '' };
|
|
90
|
-
el.querySelector('.ev-st-nav').innerHTML = '<h2 class="ev-h2">Settings</h2>' + SECTIONS.map(([k, l]) => `<a href="#${k}" class="ev-mi" data-ev-sec="${k}"${T.sec === k ? ' aria-current="page"' : ''}>${esc(l)}${n[k] !== undefined && n[k] !== '' ? `<span class="ev-k">${typeof n[k] === 'number' ? n[k] : n[k]}</span>` : ''}</a>`).join('');
|
|
92
|
+
el.querySelector('.ev-st-nav').innerHTML = '<h2 class="ev-h2">Settings</h2>' + SECTIONS.map(([k, l]) => PAGE_LINKS[k] ? `<a href="${PAGE_LINKS[k]}" class="ev-mi">${esc(l)}</a>` : `<a href="#${k}" class="ev-mi" data-ev-sec="${k}"${T.sec === k ? ' aria-current="page"' : ''}>${esc(l)}${n[k] !== undefined && n[k] !== '' ? `<span class="ev-k">${typeof n[k] === 'number' ? n[k] : n[k]}</span>` : ''}</a>`).join('');
|
|
91
93
|
const label = (SECTIONS.find((x) => x[0] === T.sec) || SECTIONS[0])[1];
|
|
92
94
|
el.querySelector('.ev-st-main').innerHTML = `<div class="ev-top"><h3 class="ev-h2" id="evStTitle">${esc(label)}</h3><button type="button" class="ev-ib" data-ev-close aria-label="Close settings" title="Close settings">${svg(ICON.close, 18)}</button></div>`
|
|
93
95
|
+ BODY[T.sec]() + `<p role="status">${esc(T.msg)}</p>`;
|