create-pmos 0.829.0 → 0.830.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 +120 -36
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/briefing-premium-insights-test.js +1 -1
- package/workspace/changelog.json +119 -22
- package/workspace/guide/agent-capabilities.md +1 -1
- package/workspace/guide/backlog.md +12 -1
- package/workspace/guide/cli.md +12 -0
- package/workspace/guide/home.md +1 -1
- package/workspace/guide/layout.md +1 -0
- package/workspace/lib/code-map.js +8 -2
- package/workspace/lib/factory-floor.js +16 -8
- package/workspace/lib/features.json +14 -13
- package/workspace/lib/people-cli.js +9 -1
- package/workspace/lib/people-prep.js +140 -0
- package/workspace/lib/pmos-verbs.js +2 -0
- package/workspace/lib/print-cli.js +49 -0
- package/workspace/lib/print-pdf.js +96 -0
- package/workspace/lib/review-reasons.js +121 -9
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-report-design.js +3 -1
- package/workspace/lib/routes-skill-map.js +39 -0
- package/workspace/lib/routes-strategy-card.js +13 -6
- package/workspace/lib/skill-map.js +199 -0
- package/workspace/lib/team-cli.js +20 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/action-keys.js +1 -0
- package/workspace/public/pm/ask-here-ctx.js +25 -1
- package/workspace/public/pm/ask-here.css +7 -0
- package/workspace/public/pm/ask-here.js +15 -2
- package/workspace/public/pm/bd-backlog.css +61 -0
- package/workspace/public/pm/bd-backlog.js +62 -8
- package/workspace/public/pm/bd-work.js +12 -1
- package/workspace/public/pm/code-map.js +15 -4
- package/workspace/public/pm/cozy-board.css +5 -1
- package/workspace/public/pm/cozy-pop-work.js +2 -0
- package/workspace/public/pm/cozy-search.js +2 -2
- package/workspace/public/pm/factory.js +199 -0
- package/workspace/public/pm/pop-cap.js +5 -3
- package/workspace/public/pm/premium-board.js +4 -0
- package/workspace/public/pm/premium-report-read.js +11 -2
- package/workspace/public/pm/print-pdf.js +191 -0
- package/workspace/public/pm/review-reasons.js +19 -5
- package/workspace/public/pm/skill-map.js +57 -0
- package/workspace/public/premium-board.html +2 -0
- package/workspace/test-lists/factory-page-ui.json +9 -0
- package/workspace/test-lists/people-prep.json +9 -0
- package/workspace/test-lists/print-pdf.json +9 -0
- package/workspace/test-lists/skill-map.json +9 -0
- package/workspace/test-lists/surface-ask-card.json +9 -0
- package/workspace/test-lists/voice-files.json +9 -0
|
@@ -193,7 +193,8 @@ export function target(c) {
|
|
|
193
193
|
const subject = l === 'field' ? [c.field || c.at, c.value].filter(Boolean).join(': ') : '';
|
|
194
194
|
return {
|
|
195
195
|
id: c.record.id, kind: c.record.kind.replace(/\s+/g, '-'), title: c.record.title || c.record.id, subject,
|
|
196
|
-
say: 'The PM pressed ' + (l === 'field' ? (c.field || c.at || 'part') + ' of ' : '') + 'the ' + c.record.kind + ' "' + (c.record.title || c.record.id) + '" on ' + (c.page || 'this page') + '. Read that record with pmos before you answer.'
|
|
196
|
+
say: 'The PM pressed ' + (l === 'field' ? (c.field || c.at || 'part') + ' of ' : '') + 'the ' + c.record.kind + ' "' + (c.record.title || c.record.id) + '" on ' + (c.page || 'this page') + '. Read that record with pmos before you answer.'
|
|
197
|
+
+ (c.record.kind === 'person' ? ' For a 1:1, run `pmos people prep "' + (c.record.title || c.record.id) + '"` and answer from its lines, with their sources.' : ''),
|
|
197
198
|
facts: facts.filter((f) => clean(f[1])),
|
|
198
199
|
};
|
|
199
200
|
}
|
|
@@ -216,6 +217,8 @@ const Q = {
|
|
|
216
217
|
'ticket': { '': ['Is it in step with PMOS?', 'Where does it stand?', 'Who is on it?'] },
|
|
217
218
|
'meeting': { '': ['What should I settle in it?', 'What is owed to me?', 'Draft the agenda'] },
|
|
218
219
|
'event': { '': ['What should I settle in it?', 'What is owed to me?', 'Draft the agenda'] },
|
|
220
|
+
// a person (people-prep, A85): the 1:1 brief first, so it shows with nothing typed (LINE.md Rule 12); target() names its command
|
|
221
|
+
'person': { '': ['Prepare my 1:1 with them', 'What are they carrying?', 'Where are they stuck?'] },
|
|
219
222
|
};
|
|
220
223
|
const SECTION_Q = ['What needs me here?', 'What changed here this week?', 'Explain this part'];
|
|
221
224
|
/** The field kind a column or label is: due, owner, status, stage, milestone, or '' */
|
|
@@ -238,6 +241,27 @@ export function questionsOf(c) {
|
|
|
238
241
|
const fk = l === 'field' ? (c.at ? 'place' : fieldKind(c.field)) : '';
|
|
239
242
|
return (k[fk] || k['']).slice(0, 3);
|
|
240
243
|
}
|
|
244
|
+
/* ── what PMOS can do for the pressed record (initiative surface-ask-card, board SfA): the user features whose row in lib/features.json
|
|
245
|
+
* names the record's kind in `ask`. A press asks the feature's command about this record in the card's chat; nothing runs before it. ── */
|
|
246
|
+
export const MAX_ACTIONS = 4;
|
|
247
|
+
/** The card's "What PMOS can do" line: [{ id, name, prompt }], at most MAX_ACTIONS, registry order; [] at section or page level, or when no
|
|
248
|
+
* feature names the kind (zero is silence). features: GET /api/features' rows. A command with a hint takes the record's id after it. */
|
|
249
|
+
export function actionsOf(c, features) {
|
|
250
|
+
const l = level(c);
|
|
251
|
+
if (!c || l === 'page' || l === 'section' || !c.record || !c.record.kind) return [];
|
|
252
|
+
const kind = c.record.kind === 'subtask' ? 'task' : c.record.kind;
|
|
253
|
+
return (Array.isArray(features) ? features : [])
|
|
254
|
+
.filter((f) => f && f.audience === 'user' && f.cmd && Array.isArray(f.ask) && f.ask.includes(kind))
|
|
255
|
+
.slice(0, MAX_ACTIONS)
|
|
256
|
+
.map((f) => ({ id: f.id, name: f.name, prompt: f.hint ? f.cmd + ' ' + c.record.id : f.cmd }));
|
|
257
|
+
}
|
|
258
|
+
const escH = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (ch) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[ch]);
|
|
259
|
+
const BOLT = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 3L5 14h6l-1 7 8-11h-6z"/></svg>';
|
|
260
|
+
/** The line's markup: one button per action, its name beside a bolt; '' when there is none. Pure, so the test reads it. */
|
|
261
|
+
export function actionsHtml(actions) {
|
|
262
|
+
if (!Array.isArray(actions) || !actions.length) return '';
|
|
263
|
+
return `<div class="ah-do" role="group" aria-label="What PMOS can do">${actions.map((a) => `<button type="button" data-ah-do="${escH(a.prompt)}" data-ah-feature="${escH(a.id)}" title="${escH(a.prompt)}">${BOLT}${escH(a.name)}</button>`).join('')}</div>`;
|
|
264
|
+
}
|
|
241
265
|
const DOW = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
242
266
|
const iso = (d) => d.toISOString().slice(0, 10);
|
|
243
267
|
const label = (d) => `${DOW[d.getUTCDay()]} ${d.getUTCDate()} ${MON[d.getUTCMonth()]}`;
|
|
@@ -34,3 +34,10 @@
|
|
|
34
34
|
.ah-card.sheet .ah-grab { display: block; }
|
|
35
35
|
@media (prefers-reduced-motion: no-preference) { .ah-card { animation: ah-in 160ms cubic-bezier(.2,.7,.2,1); } }
|
|
36
36
|
@keyframes ah-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
|
|
37
|
+
/* what PMOS can do for the pressed record (surface-ask-card): the same rows as the ✦ questions, a bolt for an action */
|
|
38
|
+
.ah-do { display: flex; flex-direction: column; gap: 2px; }
|
|
39
|
+
.ah-do button { all: unset; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--cz-ink); font-size: var(--fs-body); }
|
|
40
|
+
.ah-do button:focus-visible { outline: 2px solid var(--cz-blue); }
|
|
41
|
+
.ah-do svg { color: var(--cz-blue); flex: none; }
|
|
42
|
+
@media (hover: hover) { .ah-do button:hover { background: var(--cz-well); } }
|
|
43
|
+
.ah-card.sheet .ah-do button { min-height: 44px; }
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* (field → record → section → page), ⤢ moves the talk into the one full chat (page-chat.js openAbout), × or Esc closes.
|
|
8
8
|
* the record its card catalog row, live (chat-cards.js, GET /api/card-rows) with the catalog's own buttons; a pressed due date of a task
|
|
9
9
|
* or a milestone brings the catalog's "Move the date" picker. Every press is one pmos command with Undo (action-run.js).
|
|
10
|
+
* can do what PMOS can do for that kind of record (initiative surface-ask-card): the features whose lib/features.json row names the kind
|
|
11
|
+
* in `ask` (GET /api/features, read once); one press asks the feature's command about this record in the chat. None: no line.
|
|
10
12
|
* ✦ lines three questions for that kind of thing and field; one press asks it.
|
|
11
13
|
* the chat the one chat of the page (page-chat.js box(): the same element and conversation the popup shows), opened on the record's own
|
|
12
14
|
* conversation (itemTarget: pop:<kind>:<id>, its first message carries what was pressed); answers come back with live cards.
|
|
@@ -23,6 +25,7 @@ import { noteUse } from './use-log.js';
|
|
|
23
25
|
const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
24
26
|
const P = (d) => `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
25
27
|
const I = { up: 'M12 19V5M6 11l6-6 6 6', expand: 'M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7', x: 'M6 6l12 12M18 6L6 18', star: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z' };
|
|
28
|
+
let FEATS = null; // GET /api/features' rows, read once per page (the Ask card's "What PMOS can do" line)
|
|
26
29
|
const S = { card: null, ctx: null, el: null, ring: null, ws: '', chat: null, chatEl: null, home: null, CU: null, row: undefined, today: '', key: 0, off: null };
|
|
27
30
|
const toast = (m) => { const t = document.getElementById('toast'); if (!t) return; t.textContent = m; t.classList.add('on'); setTimeout(() => t.classList.remove('on'), 4200); };
|
|
28
31
|
|
|
@@ -100,13 +103,21 @@ function draw() {
|
|
|
100
103
|
+ `<button type="button" class="ah-icb" data-ah="up" aria-label="Ask about the bigger part instead" title="Ask about the bigger part instead"${top ? ' disabled' : ''}>${P(I.up)}</button>`
|
|
101
104
|
+ `<button type="button" class="ah-icb" data-ah="full" aria-label="Open in the full chat" title="Open in the full chat">${P(I.expand)}</button>`
|
|
102
105
|
+ `<button type="button" class="ah-icb" data-ah="x" aria-label="Close" title="Close">${P(I.x)}</button></div>`
|
|
103
|
-
+ '<div class="ah-bd"><div class="ah-rec" id="ahRec"></div>'
|
|
106
|
+
+ '<div class="ah-bd"><div class="ah-rec" id="ahRec"></div><div id="ahDo"></div>'
|
|
104
107
|
+ `<div class="ah-sug" id="ahSug">${C.questionsOf(ctx).map((q) => `<button type="button" data-ah-q="${esc(q)}">${P(I.star)}${esc(q)}</button>`).join('')}</div></div>`
|
|
105
108
|
+ '<div class="ah-chat quiet" id="ahChat"></div>';
|
|
106
109
|
ring();
|
|
107
110
|
drawRecord();
|
|
111
|
+
drawActions();
|
|
108
112
|
mountChat();
|
|
109
113
|
}
|
|
114
|
+
/** What PMOS can do for the pressed record; the features are read once, and the line fills in when they arrive. */
|
|
115
|
+
function drawActions() {
|
|
116
|
+
const box = S.card && S.card.querySelector('#ahDo'); if (!box) return;
|
|
117
|
+
if (FEATS) { box.innerHTML = C.actionsHtml(C.actionsOf(S.ctx, FEATS)); return; }
|
|
118
|
+
const k = S.key;
|
|
119
|
+
pmGet('/api/features').then((r) => { FEATS = r && r.ok && Array.isArray(r.features) ? r.features : []; if (k === S.key) drawActions(); }).catch(() => { FEATS = []; });
|
|
120
|
+
}
|
|
110
121
|
function ring() {
|
|
111
122
|
if (S.ring) S.ring.classList.remove('ah-ring');
|
|
112
123
|
S.ring = null;
|
|
@@ -152,6 +163,7 @@ function ask(q) {
|
|
|
152
163
|
const holder = S.card && S.card.querySelector('#ahChat'); if (!holder) return;
|
|
153
164
|
holder.classList.remove('quiet');
|
|
154
165
|
const sug = S.card.querySelector('#ahSug'); if (sug) sug.hidden = true;
|
|
166
|
+
const can = S.card.querySelector('#ahDo'); if (can) can.hidden = true;
|
|
155
167
|
const ta = holder.querySelector('textarea'), form = holder.querySelector('form.hm-box');
|
|
156
168
|
if (!ta || !form) return;
|
|
157
169
|
ta.value = q; ta.dispatchEvent(new Event('input', { bubbles: true }));
|
|
@@ -184,7 +196,8 @@ function wireCard() {
|
|
|
184
196
|
if (a === 'x') { close(); return; }
|
|
185
197
|
if (a === 'full') { full(); return; }
|
|
186
198
|
if (a === 'up') { const w = C.widen(S.ctx); if (w) { S.ctx = w; S.row = undefined; S.key += 1; noteUse('ask-here-widen'); putChatBack(); draw(); } return; }
|
|
187
|
-
const q = b.getAttribute('data-ah-q'); if (q) { noteUse('ask-here-question'); ask(q); }
|
|
199
|
+
const q = b.getAttribute('data-ah-q'); if (q) { noteUse('ask-here-question'); ask(q); return; }
|
|
200
|
+
const d = b.getAttribute('data-ah-do'); if (d) { noteUse('ask-here-do'); ask(d); }
|
|
188
201
|
});
|
|
189
202
|
card.addEventListener('input', (e) => { if (e.target && e.target.matches('textarea')) card.querySelector('#ahChat').classList.remove('quiet'); });
|
|
190
203
|
const esc = (e) => { if (e.key === 'Escape' && S.card) { e.stopPropagation(); close(); } };
|
|
@@ -278,3 +278,64 @@ textarea.bk-rvl-ed, .bk-rvl textarea.bd { resize: vertical; min-height: 180px; }
|
|
|
278
278
|
.pm-ds .ln-c-fin { color: var(--ink); line-height: 1.4; }
|
|
279
279
|
.pm-ds .ln-t .pm-badge.ln-ok { background: var(--leaf-tint); color: var(--leaf); }
|
|
280
280
|
.pm-ds .ln-t .pm-badge.ln-late { background: none; box-shadow: inset 0 0 0 1px var(--alert); color: var(--alert); }
|
|
281
|
+
|
|
282
|
+
/* ── Work › Factory (factory-page-ui; boards FxFloor and FxStation on the main canvas) ── pm/factory.js draws it. Komorebi tokens only.
|
|
283
|
+
* Every class starts with ff- (the page) or fx- (the station popup). Zero is silence: a quiet station is grey and has no numbers. */
|
|
284
|
+
.pm-ds .ff { display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-16) 0; }
|
|
285
|
+
.pm-ds .ff-andon { display: flex; gap: var(--space-12); align-items: flex-start; margin: 0; padding: var(--space-12) var(--space-16); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); color: var(--ink); font-size: var(--fs-row); line-height: 1.45; }
|
|
286
|
+
.pm-ds .ff-andon small { display: block; color: var(--muted); font-size: var(--fs-meta); }
|
|
287
|
+
.pm-ds .ff-andon .bd-lamp { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--leaf); }
|
|
288
|
+
.pm-ds .ff-andon.alert { background: var(--alert-tint); border-color: var(--alert); }
|
|
289
|
+
.pm-ds .ff-andon.alert .bd-lamp { background: var(--alert); }
|
|
290
|
+
.pm-ds .ff-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr) 14px) minmax(0, 1fr); align-items: stretch; }
|
|
291
|
+
.pm-ds .ff-arr { align-self: center; text-align: center; color: var(--muted); font-size: var(--fs-row); }
|
|
292
|
+
.pm-ds :is(.ff-st, .ff-side) { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: var(--space-12); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); }
|
|
293
|
+
.pm-ds :is(.ff-st, .ff-side).con { box-shadow: inset 3px 0 0 var(--alert); }
|
|
294
|
+
.pm-ds :is(.ff-st, .ff-side).quiet { background: var(--well); color: var(--muted); }
|
|
295
|
+
.pm-ds :is(.ff-st, .ff-side) header { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: var(--fs-row); }
|
|
296
|
+
.pm-ds :is(.ff-st, .ff-side).quiet header { color: var(--muted); }
|
|
297
|
+
.pm-ds :is(.ff-st, .ff-side) header b { flex: 1; min-width: 0; font-weight: var(--fw-strong); }
|
|
298
|
+
.pm-ds .ff-ic svg, .pm-ds .ff-open svg, .pm-ds .ff-undo svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
|
|
299
|
+
.pm-ds .ff-open, .pm-ds .ff-undo { all: unset; box-sizing: border-box; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-md); color: var(--muted); cursor: pointer; }
|
|
300
|
+
.pm-ds .ff-open:hover, .pm-ds .ff-undo:hover { background: var(--well); color: var(--ink); }
|
|
301
|
+
.pm-ds .ff-open:focus-visible, .pm-ds .ff-undo:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
|
|
302
|
+
.pm-ds .ff-you.con .ff-go { background: var(--blue); color: var(--on-blue); }
|
|
303
|
+
.pm-ds .ff-does { margin: 0; color: var(--muted); font-size: var(--fs-meta); line-height: 1.4; }
|
|
304
|
+
.pm-ds .ff-kv { display: flex; justify-content: space-between; gap: var(--space-8); font-size: var(--fs-meta); color: var(--muted); }
|
|
305
|
+
.pm-ds .ff-kv b { color: var(--ink); font-weight: var(--fw-strong); font-variant-numeric: tabular-nums; }
|
|
306
|
+
.pm-ds .ff-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
|
|
307
|
+
.pm-ds .ff-line { margin: 0; color: var(--ink); font-size: var(--fs-row); line-height: 1.45; }
|
|
308
|
+
.pm-ds .ff-side.quiet .ff-line { color: var(--muted); }
|
|
309
|
+
.pm-ds .ff-goals { padding: var(--space-12) var(--space-16); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); }
|
|
310
|
+
.pm-ds .ff-goals h3 { margin: 0 0 var(--space-8); font-size: var(--fs-row); font-weight: var(--fw-strong); color: var(--ink); }
|
|
311
|
+
.pm-ds .ff-goals h3 small { margin-left: 6px; font-weight: var(--fw-regular); color: var(--muted); font-size: var(--fs-meta); }
|
|
312
|
+
.pm-ds .ff-goals ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-8); }
|
|
313
|
+
.pm-ds .ff-goal { display: grid; grid-template-columns: minmax(0, 2fr) auto minmax(0, 3fr); gap: var(--space-12); align-items: center; font-size: var(--fs-row); color: var(--ink); }
|
|
314
|
+
.pm-ds .ff-gn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
315
|
+
.pm-ds .ff-gc { color: var(--muted); font-size: var(--fs-meta); white-space: nowrap; }
|
|
316
|
+
.pm-ds .ff-seg { display: flex; height: 10px; gap: 2px; border-radius: var(--radius-pill); overflow: hidden; }
|
|
317
|
+
.pm-ds .ff-seg i { display: block; flex: 1 1 0; min-width: 2px; }
|
|
318
|
+
.pm-ds .ff-legend i { display: block; }
|
|
319
|
+
.pm-ds .ff-legend { display: flex; flex-wrap: wrap; gap: var(--space-12); margin: var(--space-12) 0 0; color: var(--muted); font-size: var(--fs-meta); }
|
|
320
|
+
.pm-ds .ff-legend span { display: inline-flex; align-items: center; gap: 4px; }
|
|
321
|
+
.pm-ds .ff-legend i { width: 10px; height: 10px; border-radius: 2px; }
|
|
322
|
+
.pm-ds .ff-note { margin: var(--space-8) 0 0; color: var(--muted); font-size: var(--fs-meta); }
|
|
323
|
+
/* the stage colours: the system's own hues, in workflow order */
|
|
324
|
+
.pm-ds .ff .c0 { background: var(--muted); } .pm-ds .ff .c1 { background: var(--blue); } .pm-ds .ff .c2 { background: color-mix(in oklab, var(--blue) 55%, var(--leaf)); }
|
|
325
|
+
.pm-ds .ff .c3 { background: var(--leaf); } .pm-ds .ff .c4 { background: color-mix(in oklab, var(--leaf) 50%, var(--alert)); } .pm-ds .ff .c5 { background: var(--alert); }
|
|
326
|
+
@media (max-width: 1100px) { .pm-ds .ff-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-12); } .pm-ds .ff-arr { display: none; } }
|
|
327
|
+
@media (max-width: 760px) { .pm-ds .ff-flow, .pm-ds .ff-sides { grid-template-columns: minmax(0, 1fr); } .pm-ds .ff-goal { grid-template-columns: minmax(0, 1fr) auto; } .pm-ds .ff-seg { grid-column: 1 / -1; } }
|
|
328
|
+
/* the station popup (one panel, the system's sheet) */
|
|
329
|
+
.fx-sheet { display: flex; flex-direction: column; gap: 16px; }
|
|
330
|
+
.fx-sheet .fx-sec h4 { display: flex; gap: 6px; margin: 0 0 6px; font-size: var(--fs-row); font-weight: var(--fw-strong); }
|
|
331
|
+
.fx-sheet .fx-sec h4 span { color: var(--muted); font-weight: var(--fw-regular); }
|
|
332
|
+
.fx-sheet ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
|
|
333
|
+
.fx-sheet li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-row); }
|
|
334
|
+
.fx-sheet li b { font-weight: var(--fw-strong); overflow-wrap: anywhere; }
|
|
335
|
+
.fx-sheet li span { grid-column: 1; color: var(--muted); font-size: var(--fs-meta); }
|
|
336
|
+
.fx-sheet li .ff-undo { grid-column: 2; grid-row: 1 / span 2; }
|
|
337
|
+
.fx-sheet .ff-undo svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
|
|
338
|
+
.fx-sheet .fx-more, .fx-sheet p { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-meta); }
|
|
339
|
+
.fx-sheet .fx-fold summary { cursor: pointer; padding: 6px 0; font-size: var(--fs-meta); color: var(--muted); }
|
|
340
|
+
.fx-sheet .ff-undo { all: unset; box-sizing: border-box; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-md); cursor: pointer; }
|
|
341
|
+
.fx-sheet .ff-undo:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
|
|
@@ -21,9 +21,10 @@ import * as WS from './work-select.js'; // the bulk move with one Undo, shared
|
|
|
21
21
|
import * as IF from './inline-fields.js'; // a task's sprint and priority, set in the row (initiative inline-sprint-priority)
|
|
22
22
|
import * as LE from './live-edit.js'; // a task's status or days show at once in the list, before it is read again; a failed save is put back
|
|
23
23
|
import { noteUse } from './use-log.js'; // the sprint draft's presses, counted on this computer only (sprint-draft-capacity)
|
|
24
|
-
import { pmGet } from './http.js';
|
|
24
|
+
import { pmGet } from './http.js'; // Work › Factory and Work › Dependencies read through the page's own GET helper
|
|
25
25
|
import * as TWV from './team-waits.js'; // team-waits (A364): Work › Dependencies, the waits on other teams (GET /api/team-waits)
|
|
26
|
-
import * as LV from './line-view.js';
|
|
26
|
+
import * as LV from './line-view.js'; // quiet-rows slice B: the Line tab, every initiative by station (GET /api/line)
|
|
27
|
+
import * as FV from './factory.js'; // Work › Factory (factory-page-ui): the stations and the work they make, from GET /api/factory
|
|
27
28
|
import * as LB from './list-balance.js'; // the balance meter under the Backlog header (bet A448, board BalanceDS) // quiet-rows slice B: the Line tab, every initiative by station (GET /api/line)
|
|
28
29
|
import * as BD from './bd-backlog-ds.js'; // the Backlog from the system's parts (WorkBacklogDS) // the sprint overview while "This sprint" is on (initiative sprint-overview)
|
|
29
30
|
|
|
@@ -70,15 +71,18 @@ export function tabOf() {
|
|
|
70
71
|
if (q === 'backlog') return 'bk';
|
|
71
72
|
if (q === 'sprint') return 'sp';
|
|
72
73
|
if (q === 'line') return 'ln';
|
|
74
|
+
if (q === 'factory') return 'fx';
|
|
73
75
|
if (q === 'deps') return 'dp';
|
|
74
76
|
if (q === 'initiatives') return 'ini';
|
|
75
77
|
const v = (get(KEY, {}) || {})[scopeKey()];
|
|
76
|
-
return v === 'bk' || v === 'sp' || v === 'ln' || v === 'dp' ? v : 'ini';
|
|
78
|
+
return v === 'bk' || v === 'sp' || v === 'ln' || v === 'fx' || v === 'dp' ? v : 'ini';
|
|
77
79
|
}
|
|
78
80
|
/** Is a task tab (Backlog or This sprint) the view now? */
|
|
79
81
|
export const on = () => tabOf() === 'bk' || tabOf() === 'sp';
|
|
80
82
|
/** Is the Line tab the view now? (quiet-rows slice B) */
|
|
81
83
|
export const lineOn = () => tabOf() === 'ln';
|
|
84
|
+
/** Is the Factory tab the view now? (factory-page-ui) */
|
|
85
|
+
export const factoryOn = () => tabOf() === 'fx';
|
|
82
86
|
/** Is the Dependencies tab the view now? (team-waits) */
|
|
83
87
|
export const depsOn = () => tabOf() === 'dp';
|
|
84
88
|
function setOn(v) {
|
|
@@ -130,8 +134,9 @@ export async function load() {
|
|
|
130
134
|
/** Work's three tab names: a desk says "This sprint" and no count; a phone says "Backlog 14" and "Sprint" (PhoneWorkDS, job 1540).
|
|
131
135
|
* Zero is silence: no count when the Backlog is empty or not read yet. */
|
|
132
136
|
// the Line (quiet-rows-line) is a five-column table for a desk; a phone keeps its three tabs (Today's dashed line is desk-only too)
|
|
137
|
+
// the Factory (factory-page-ui) sits beside Line, a desk's too: its tiles are a row of five
|
|
133
138
|
// Dependencies (team-waits) is a desk tab as well: a phone keeps its three
|
|
134
|
-
export const tabNames = (phone, n) => [['ini', 'Initiatives'], ...(phone ? [] : [['ln', 'Line']]), ['bk', 'Backlog' + (phone && n > 0 ? ` <span class="bk-swn">${Number(n)}</span>` : '')], ['sp', phone ? 'Sprint' : 'This sprint'], ...(phone ? [] : [['dp', 'Dependencies']])];
|
|
139
|
+
export const tabNames = (phone, n) => [['ini', 'Initiatives'], ...(phone ? [] : [['ln', 'Line'], ['fx', 'Factory']]), ['bk', 'Backlog' + (phone && n > 0 ? ` <span class="bk-swn">${Number(n)}</span>` : '')], ['sp', phone ? 'Sprint' : 'This sprint'], ...(phone ? [] : [['dp', 'Dependencies']])];
|
|
135
140
|
const phoneNow = () => typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches;
|
|
136
141
|
function drawSwitch() {
|
|
137
142
|
if (!sw) return;
|
|
@@ -142,13 +147,14 @@ function drawSwitch() {
|
|
|
142
147
|
sw.innerHTML = tabNames(ph, ph && DATA ? backlogOf().length : 0).map(([k, n]) => tb(k, n)).join('');
|
|
143
148
|
}
|
|
144
149
|
function apply() {
|
|
145
|
-
const bk = on(), ln = lineOn(), dp = depsOn();
|
|
150
|
+
const bk = on(), ln = lineOn(), fx = factoryOn(), dp = depsOn();
|
|
146
151
|
if (tabOf() === 'sp') CHIPS.add('sprint');
|
|
147
152
|
document.body.classList.toggle('sp-on', tabOf() === 'sp');
|
|
148
|
-
document.body.classList.toggle('bk-on', bk || ln || dp);
|
|
149
|
-
if (host) host.hidden = !(bk || ln || dp);
|
|
153
|
+
document.body.classList.toggle('bk-on', bk || ln || fx || dp);
|
|
154
|
+
if (host) host.hidden = !(bk || ln || fx || dp);
|
|
150
155
|
drawSwitch();
|
|
151
156
|
if (ln) { closeAll(); drawLine(); return; }
|
|
157
|
+
if (fx) { closeAll(); drawFactory(); return; }
|
|
152
158
|
if (dp) { closeAll(); drawDeps(); return; }
|
|
153
159
|
if (bk) { if (!DATA || scopeKey() !== lastScope) { lastScope = scopeKey(); host.innerHTML = '<p class="bk-wait">Reading the tasks…</p>'; load(); } else draw(); }
|
|
154
160
|
else closeAll();
|
|
@@ -186,6 +192,54 @@ function linePress(e) {
|
|
|
186
192
|
return false;
|
|
187
193
|
}
|
|
188
194
|
|
|
195
|
+
/* ── the Factory tab (factory-page-ui, boards FxFloor and FxStation) ── the saved snapshot per product, from GET /api/factory ── */
|
|
196
|
+
const FX = { got: null, key: '', used: false, undone: new Set(), sheet: null, at: 0 };
|
|
197
|
+
async function readFactory() {
|
|
198
|
+
const ws = [...new Set(A.scope().map((s) => s.ws || ''))];
|
|
199
|
+
const got = await Promise.all(ws.map((w) => Promise.resolve(pmGet('/api/factory' + (w ? '?ws=' + encodeURIComponent(w) : ''))).catch(() => null)));
|
|
200
|
+
return got.filter((r) => r && r.ok).flatMap((r) => r.products || []);
|
|
201
|
+
}
|
|
202
|
+
const fxModel = () => FV.floorModel(FX.got || []);
|
|
203
|
+
function drawFactory() {
|
|
204
|
+
if (!host) return;
|
|
205
|
+
const k = scopeKey();
|
|
206
|
+
if (!FX.used) { FX.used = true; noteUse('factoryOpen'); console.info('[factory-page] factory tab opened'); }
|
|
207
|
+
// the snapshot changes only after a Driver run: a read a minute old is still the newest
|
|
208
|
+
if (!FX.got || FX.key !== k || Date.now() - FX.at > 60000) {
|
|
209
|
+
const first = !FX.got || FX.key !== k;
|
|
210
|
+
FX.key = k; FX.at = Date.now();
|
|
211
|
+
if (first) host.innerHTML = '<p class="bk-wait">Reading the factory…</p>';
|
|
212
|
+
readFactory().then((g) => { FX.got = g; if (factoryOn()) drawFactory(); });
|
|
213
|
+
if (first) return;
|
|
214
|
+
}
|
|
215
|
+
const goals = A && A.work ? FV.goalsModel(A.work()) : null;
|
|
216
|
+
host.innerHTML = FV.floorHtml(fxModel(), { goals });
|
|
217
|
+
}
|
|
218
|
+
function openStation(key) {
|
|
219
|
+
const st = key === 'check' ? fxModel().check : fxModel().stations.find((s) => s.key === key);
|
|
220
|
+
if (!st) return;
|
|
221
|
+
const body = document.createElement('div');
|
|
222
|
+
const fill = () => { body.innerHTML = FV.stationHtml(st, { undone: FX.undone }); };
|
|
223
|
+
fill();
|
|
224
|
+
body.addEventListener('click', async (e) => {
|
|
225
|
+
const b = e.target.closest('[data-fx-undo]'); if (!b || b.disabled) return;
|
|
226
|
+
b.disabled = true;
|
|
227
|
+
const r = await AP().post('/api/autonomy/undo', { ws: b.dataset.fxWs || undefined, ref: b.dataset.fxUndo }).catch(() => null);
|
|
228
|
+
if (r && r.ok) { FX.undone.add((b.dataset.fxWs || '') + '|' + b.dataset.fxUndo); fill(); if (AP().say) AP().say('Undone.'); }
|
|
229
|
+
else { b.disabled = false; if (AP().say) AP().say((r && r.error) || 'The change could not be undone. Try again in a moment.'); }
|
|
230
|
+
});
|
|
231
|
+
import('./primitives.js').then((P) => {
|
|
232
|
+
if (FX.sheet && FX.sheet.open) FX.sheet.close(); // one item, one panel (panel rule)
|
|
233
|
+
FX.sheet = P.sheet({ title: FV.NAMES[key], sub: FV.DOES[key], body: [body], attrs: { 'data-fx-sheet': key } });
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
/** A press in the Factory tab: a station's open button. true when it was one. */
|
|
237
|
+
function factoryPress(e) {
|
|
238
|
+
if (!factoryOn()) return false;
|
|
239
|
+
const b = e.target.closest('[data-fx-st]');
|
|
240
|
+
if (b) { openStation(b.dataset.fxSt); return true; }
|
|
241
|
+
return !!e.target.closest('.ff');
|
|
242
|
+
}
|
|
189
243
|
/* ── the Dependencies tab (team-waits, board BatchCodeDS panel 14) ── the pick's waits on other teams, from GET /api/team-waits ── */
|
|
190
244
|
const DP = { got: null, key: '', used: false, rows: [] };
|
|
191
245
|
async function readDeps() {
|
|
@@ -831,7 +885,7 @@ export function sync(api) {
|
|
|
831
885
|
sw.addEventListener('click', (e) => { const b = e.target.closest('[data-bksw]'); if (b) setOn(b.dataset.bksw); });
|
|
832
886
|
host = document.createElement('div'); host.id = 'bkBody'; host.className = 'bk-host'; host.hidden = true;
|
|
833
887
|
ib.insertAdjacentElement('afterend', host);
|
|
834
|
-
host.addEventListener('click', (e) => { if (linePress(e) || depsPress(e)) return; press(e); });
|
|
888
|
+
host.addEventListener('click', (e) => { if (linePress(e) || factoryPress(e) || depsPress(e)) return; press(e); });
|
|
835
889
|
host.addEventListener('change', (e) => { if (e.target.closest('[data-bkck]')) press(e); });
|
|
836
890
|
host.addEventListener('keydown', (e) => { const c = e.target.closest('[data-bkcap]'); if (c && e.key === 'Enter') { e.preventDefault(); capture(c); } });
|
|
837
891
|
dragWire();
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { stageOfRow, stagesOfRow, wfOf, catOfRow, posOf } from './bd-wf.js';
|
|
19
19
|
import { stageName as oneStageName } from './stage-chip.js';
|
|
20
20
|
import { stateGlyph } from './state-glyph.js';
|
|
21
|
+
import * as PR from './print-pdf.js'; // Print or PDF (job #1911, A379)
|
|
21
22
|
|
|
22
23
|
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
23
24
|
const SV = (d, n) => `<svg viewBox="0 0 24 24"${n ? ` width="${n}" height="${n}"` : ''} aria-hidden="true"><path d="${d}"/></svg>`;
|
|
@@ -339,7 +340,7 @@ export function ticksOf(W) {
|
|
|
339
340
|
}
|
|
340
341
|
|
|
341
342
|
/* ── markup ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
342
|
-
const I = { hide: 'M13 6l6 6-6 6M6 6l6 6-6 6', show: 'M11 6l-6 6 6 6M18 6l-6 6 6 6', chev: 'M7 10l5 5 5-5', sort: 'M12 5v14M6 13l6 6 6-6', x: 'M6 6l12 12M18 6L6 18',
|
|
343
|
+
const I = { print: 'M7 9V4h10v5M7 17H5a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-2M7 14h10v6H7z', hide: 'M13 6l6 6-6 6M6 6l6 6-6 6', show: 'M11 6l-6 6 6 6M18 6l-6 6 6 6', chev: 'M7 10l5 5 5-5', sort: 'M12 5v14M6 13l6 6 6-6', x: 'M6 6l12 12M18 6L6 18',
|
|
343
344
|
back: 'M15 6l-6 6 6 6', on: 'M10 8l4 4-4 4', today: 'M12 3v18M7 8l-4 4 4 4M17 8l4 4-4 4', tune: 'M4 7h10M18 7h2M4 17h4M12 17h8M14 5v4M8 15v4' };
|
|
344
345
|
|
|
345
346
|
function cellHtml(r, k, o) {
|
|
@@ -415,6 +416,7 @@ export function listHtml(rows, o = {}) {
|
|
|
415
416
|
const nav = (k, label, d) => `<button type="button" class="pm-btn" data-wknav="${k}" aria-label="${label}" title="${label}">${SV(d, 16)}</button>`;
|
|
416
417
|
const head = `<div class="head"><h2 class="pm-h">Initiatives</h2><span class="sp"></span>`
|
|
417
418
|
+ (tl ? `<div class="pm-tabs" role="tablist" aria-label="Scale of the timeline">${scale}</div>${nav('back', 'Earlier', I.back)}${nav('today', 'Go to today', I.today)}${nav('on', 'Later', I.on)}` : '')
|
|
419
|
+
+ `<button type="button" class="pm-btn" data-wkprint aria-label="Print or PDF" title="Print or PDF">${SV(I.print, 16)}</button>` // job #1911 (A379): the roadmap list in the one print layout
|
|
418
420
|
+ `<button type="button" class="pm-btn" data-wkmenu aria-haspopup="dialog" aria-label="Choose columns, sort and filter" title="Choose columns, sort and filter">${SV(I.tune, 16)}${filterCount() ? `<i class="wk-fc" aria-hidden="true">${filterCount()}</i>` : ''}</button></div>`;
|
|
419
421
|
const ncol = 1 + keys.length + (tl ? 1 : 0);
|
|
420
422
|
let h = `<section class="pm-block wk-blk" aria-label="Initiatives">${head}${o.above || ''}${showingHtml(every.length - rows.length)}`
|
|
@@ -499,6 +501,13 @@ export function menuHtml(o = {}) {
|
|
|
499
501
|
+ `<div class="wk-ft"><span>PMOS remembers this</span>${differs ? '<button type="button" class="wk-rs" data-wkreset>Reset</button>' : ''}</div></div>`;
|
|
500
502
|
}
|
|
501
503
|
|
|
504
|
+
/** Print or PDF on Work's list (job #1911, A379): the list as shown, in the one print layout (pm/print-pdf.js). */
|
|
505
|
+
function printList(btn) {
|
|
506
|
+
const sec = btn && btn.closest ? btn.closest('.wk-blk') : null;
|
|
507
|
+
let ws = ''; try { ws = new URLSearchParams(location.search).get('ws') || ''; } catch { ws = ''; }
|
|
508
|
+
if (sec) PR.printPage(sec, { title: 'Roadmap', ws });
|
|
509
|
+
}
|
|
510
|
+
|
|
502
511
|
/** What a press in the list or the menu means, or null when it is not Work's own. → { kind, ... } */
|
|
503
512
|
export function pressOf(t) {
|
|
504
513
|
const q = (s) => t.closest && t.closest(s);
|
|
@@ -513,6 +522,7 @@ export function pressOf(t) {
|
|
|
513
522
|
if ((b = q('[data-wkspick]'))) return { kind: 'span', span: b.dataset.wkspick };
|
|
514
523
|
if (q('[data-wkspan]')) return { kind: 'spanmenu' };
|
|
515
524
|
if ((b = q('[data-wknav]'))) return { kind: 'nav', dir: b.dataset.wknav };
|
|
525
|
+
if (q('[data-wkprint]')) return { kind: 'print', el: q('[data-wkprint]') };
|
|
516
526
|
if (q('[data-wkmenu]')) return { kind: 'menu', el: q('[data-wkmenu]') };
|
|
517
527
|
if ((b = q('[data-wktl]'))) return { kind: 'timeline', on: b.dataset.wktl === 'on' };
|
|
518
528
|
if ((b = q('[data-wkstage]'))) return { kind: 'stage', key: b.dataset.wkstage, el: b };
|
|
@@ -543,6 +553,7 @@ export function apply(p) {
|
|
|
543
553
|
else if (p.kind === 'closed') SHUT = !SHUT;
|
|
544
554
|
else if (p.kind === 'card') CARD = CARD === p.key ? null : p.key;
|
|
545
555
|
else if (p.kind === 'nav') { if (p.dir === 'today') toToday(); else step(p.dir === 'back' ? -1 : 1, LAST ? LAST.rows : []); }
|
|
556
|
+
else if (p.kind === 'print') { printList(p.el); return false; }
|
|
546
557
|
else if (p.kind === 'menu') return false;
|
|
547
558
|
else if (p.kind === 'inside') return false;
|
|
548
559
|
else return false;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* mount(host, { ws, single }) → draws the map into `host`; a Work page that shows several products at once shows none
|
|
5
5
|
* mapHtml(map) → the markup (pure, so the test reads it); '' when there is nothing to show
|
|
6
6
|
*
|
|
7
|
+
* Closed by default: one line ("Code · 6 parts · 1 tinted") until the PM opens it.
|
|
7
8
|
* Built from the board's parts: a pm-block with its head, the part boxes of panel 13 (card ground, small radius, a 1px line; cozy-board.css .bd-cm-) in a grid,
|
|
8
9
|
* and a pm-meta foot. Each box: the part's name, what it is (the PM's own words from `pmos code describe` when given), how it is tested and
|
|
9
10
|
* who changed it last. A risky part (no tests, or many recent fixes) is tinted with the alert colour and says why; the rest are plain.
|
|
@@ -34,12 +35,21 @@ export function boxHtml(p) {
|
|
|
34
35
|
return `<div class="bd-cm-part" role="listitem"${risk} title="${esc(p.dir || p.name)}"><b>${esc(p.name)}</b>${lines}</div>`;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
/** The one line the closed card shows: how many parts, and how many are tinted. */
|
|
39
|
+
export function sumOf(map) {
|
|
40
|
+
const n = map.parts.length + (map.more || 0);
|
|
41
|
+
const r = map.parts.filter((p) => p.risky).length;
|
|
42
|
+
return `${n} part${n === 1 ? '' : 's'}${r ? ` · ${r} tinted` : ''}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Closed by default (the PM, 2026-11-25: "should be hidden by default"): a <details> whose summary is the head and one line. */
|
|
46
|
+
export function mapHtml(map, { open = false } = {}) {
|
|
38
47
|
if (!map || !Array.isArray(map.parts) || !map.parts.length) return '';
|
|
39
48
|
const more = map.more ? `<span class="pm-meta">and ${map.more} smaller part${map.more === 1 ? '' : 's'}</span>` : '';
|
|
40
|
-
return `<
|
|
49
|
+
return `<details class="pm-block bd-cm" aria-label="Code"${open ? ' open' : ''}><summary class="head">${SV(CODE)}<h3 class="pm-h-sm">Code</h3><span class="pm-meta bd-cm-sum">${esc(sumOf(map))}</span></summary>`
|
|
50
|
+
+ '<p class="pm-meta bd-cm-say">The main parts of this product\'s code, read from its repository: what each is, how it is tested, who changed it last. Tinted: no tests, or mostly fixes lately.</p>'
|
|
41
51
|
+ `<div role="list" class="bd-cm-grid">${map.parts.map(boxHtml).join('')}</div>`
|
|
42
|
-
+ `<div class="pm-row bd-cm-foot">${more}<span class="pm-meta">Read from the repo on ${esc(dayOf(map.at))}</span></div></
|
|
52
|
+
+ `<div class="pm-row bd-cm-foot">${more}<span class="pm-meta">Read from the repo on ${esc(dayOf(map.at))}</span></div></details>`;
|
|
43
53
|
}
|
|
44
54
|
|
|
45
55
|
/** Draw the map into `host`. While PMOS draws it for the first time, read again now and then (at most ~2 minutes). */
|
|
@@ -51,7 +61,8 @@ export async function mount(host, opts = {}) {
|
|
|
51
61
|
let r = null;
|
|
52
62
|
try { r = await (await fetch('/api/code-map' + (ws ? '?ws=' + encodeURIComponent(ws) : ''), { credentials: 'same-origin' })).json(); } catch { r = null; }
|
|
53
63
|
if (!r || !r.ok) { host.hidden = true; return; } // an extra: a failed read leaves Work as it was
|
|
54
|
-
const
|
|
64
|
+
const was = host.querySelector && host.querySelector('details.bd-cm');
|
|
65
|
+
const html = mapHtml(r.map, { open: !!(was && was.open) }); // a redraw keeps the card as the PM left it
|
|
55
66
|
host.hidden = !html;
|
|
56
67
|
if (host.innerHTML !== html) host.innerHTML = html;
|
|
57
68
|
const tries = Number(host.dataset.polls || 0);
|
|
@@ -1628,10 +1628,14 @@ html.ro body.wk-on .bd-hd { display: none; } /* find and tune moved to the top
|
|
|
1628
1628
|
.bd-bc .s.ln { color: var(--cz-ink2); }
|
|
1629
1629
|
.bd-lrow .s.ln { color: var(--cz-ink2); white-space: normal; }
|
|
1630
1630
|
/* the product's code map (pm/code-map.js, idea A176, board BatchCodeDS panel 13): one box per main part; a risky part takes the alert tint */
|
|
1631
|
-
.bd-cm .head h3 { flex: 1; }
|
|
1632
1631
|
.bd-cm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-8); }
|
|
1633
1632
|
.bd-cm-part { min-width: 0; background: var(--card); border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line); padding: 6px 8px; font: var(--fw-regular) var(--fs-meta)/var(--lh-meta) var(--cz-sans); }
|
|
1634
1633
|
.bd-cm-part[data-risky] { background: color-mix(in srgb, var(--alert) 12%, var(--card)); }
|
|
1635
1634
|
.bd-cm-part b { display: block; font-weight: var(--fw-strong); }
|
|
1636
1635
|
.bd-cm-l { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1637
1636
|
.bd-cm-foot { gap: var(--space-8); margin-top: var(--space-8); }
|
|
1637
|
+
.bd-cm-say { margin: var(--space-8) 0; }
|
|
1638
|
+
.bd-cm > summary { cursor: pointer; list-style: none; }
|
|
1639
|
+
.bd-cm > summary::-webkit-details-marker { display: none; }
|
|
1640
|
+
.bd-cm > summary h3 { flex: 0 1 auto; }
|
|
1641
|
+
.bd-cm > summary .bd-cm-sum { flex: 1; }
|
|
@@ -37,6 +37,7 @@ import * as IF from './inline-fields.js'; // a task's sprint and priority, set
|
|
|
37
37
|
import * as SD from './star-draft.js'; // a ✦ draft runs as a PMOS background job and lands on its line (star-buttons-act-directly A7)
|
|
38
38
|
import * as CAP from './pop-cap.js'; // five actions at most: Ask PMOS and the toolbar's four, the rest under ⋯ (popup-cap, idea A498)
|
|
39
39
|
import { noteUse } from './use-log.js';
|
|
40
|
+
import * as PR from './print-pdf.js'; // Print or PDF under ⋯ (job #1911, A379)
|
|
40
41
|
import * as SMAP from './stakeholder-map.js'; // the People block: who decides, must agree, needs to know (stakeholder-map, A371)
|
|
41
42
|
import * as PD from './bd-pop-ds.js'; // the popup on a computer, built from the design system's blocks (initiative work-ds-popup) // the Kind of a file and one row per kind (round 3 point 16), shared with the Library // the rename and its Undo, the same write as the old List (batch 18 item 16)
|
|
42
43
|
|
|
@@ -1381,6 +1382,7 @@ function capItems(body, hh) {
|
|
|
1381
1382
|
if (act === 'big') return big(c, x, h);
|
|
1382
1383
|
if (act === 'src') return srcMenu(a, c, x, h);
|
|
1383
1384
|
if (act === 'parts') { if (hh && hh.allParts) hh.allParts(); }
|
|
1385
|
+
if (act === 'print') return PR.printPage(body.querySelector('.pw'), { title: (c.v && c.v.title) || (c.r && (c.r.title || c.r.name)) || '', ws: atOf(h, x).ws }); // job #1911: Print or PDF
|
|
1384
1386
|
};
|
|
1385
1387
|
const out = [];
|
|
1386
1388
|
for (const g of G) { out.push({ head: g.group }); for (const it of g.items) out.push({ label: it.label, icon: it.icon, on: (a) => { run(it.act, a); } }); }
|
|
@@ -40,7 +40,7 @@ function mount() {
|
|
|
40
40
|
const d = document.createElement('div');
|
|
41
41
|
d.innerHTML = '<div class="ev-sp-scrim" id="evSpScrim" hidden></div>'
|
|
42
42
|
+ '<div class="ev-sp" id="evSearch" role="dialog" aria-modal="true" aria-label="Search" hidden>'
|
|
43
|
-
+ `<div class="ev-sp-in">${svg(ICON.search, 20)}<label for="evQ" class="ev-vh">Search PMOS</label><input id="evQ" type="text" autocomplete="off" spellcheck="false" placeholder="Search initiatives, documents,
|
|
43
|
+
+ `<div class="ev-sp-in">${svg(ICON.search, 20)}<label for="evQ" class="ev-vh">Search or ask PMOS</label><input id="evQ" type="text" autocomplete="off" spellcheck="false" placeholder="Search or ask: initiatives, documents, reports, meetings…" role="combobox" aria-expanded="true" aria-controls="evRes" aria-autocomplete="list"><span class="ev-kbd">Esc</span><button type="button" class="ev-ib x" data-ev="close" aria-label="Close search">${svg(ICON.close, 18)}</button></div>`
|
|
44
44
|
+ '<div class="ev-sp-chips" id="evChips" role="group" aria-label="Kind"></div>'
|
|
45
45
|
+ '<div class="ev-sp-list" id="evRes" role="listbox" aria-label="Results"></div>'
|
|
46
46
|
+ `<div class="ev-sp-ft"><span><span class="ev-kbd" role="img" aria-label="Arrow up">${svg(ARROW.up, 12)}</span> <span class="ev-kbd" role="img" aria-label="Arrow down">${svg(ARROW.down, 12)}</span> move</span><span><span class="ev-kbd" role="img" aria-label="Enter">${svg(ARROW.enter, 12)}</span> open</span><span class="ev-r">Searches your work. Opens in the Viewer when it can.</span></div>`
|
|
@@ -74,7 +74,7 @@ export function openSearch(o = {}) {
|
|
|
74
74
|
if (o.q != null) S.q = String(o.q);
|
|
75
75
|
el.hidden = false; document.getElementById('evSpScrim').hidden = false; el.setAttribute('data-esc-layer', '');
|
|
76
76
|
const q = el.querySelector('#evQ'); q.value = S.q; q.focus(); q.select();
|
|
77
|
-
q.placeholder = S.scope ? 'Search ' + S.scope.name + ', then everywhere' : 'Search initiatives, documents,
|
|
77
|
+
q.placeholder = S.scope ? 'Search or ask: ' + S.scope.name + ', then everywhere' : 'Search or ask: initiatives, documents, reports, meetings…';
|
|
78
78
|
if (!S.boards) getj('/api/boards/backlog?limit=200' + wsQ('&')).then((b) => { S.boards = b && b.ok && Array.isArray(b.rows) ? b : { rows: [] }; draw(); });
|
|
79
79
|
if (!S.sessions) getj('/api/sessions').then((s) => { S.sessions = s && Array.isArray(s.sessions) ? s.sessions.filter((x) => !x.automatic && x.shown !== 'exited') : []; draw(); });
|
|
80
80
|
run();
|