create-pmos 0.412.0 → 0.414.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/AGENTS.md +2 -2
- package/payload/KIT-VERSION +1 -1
- package/payload/mods/pmos-cockpit/README.md +1 -1
- package/payload/mods/pmos-cockpit/hooks/lib/guard.mjs +11 -5
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/pmos-log.sh +18 -4
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-programs-test.js +2 -2
- package/workspace/briefing-premium-board-test.js +45 -9
- package/workspace/briefing-premium-test.js +3 -2
- package/workspace/changelog.json +24 -0
- package/workspace/core-docs-workflow-test.js +144 -0
- package/workspace/guide/programs.md +13 -0
- package/workspace/guide/workflows.md +15 -1
- package/workspace/home-other-product-test.js +18 -0
- package/workspace/lib/board-premium.js +8 -2
- package/workspace/lib/briefing-premium-agent.js +16 -4
- package/workspace/lib/core-docs.js +79 -14
- package/workspace/lib/engine/boards.js +20 -12
- package/workspace/lib/headless.js +10 -1
- package/workspace/lib/initiative-chat.js +50 -0
- package/workspace/lib/initiative-premium.js +17 -7
- package/workspace/lib/item-cli.js +7 -2
- package/workspace/lib/milestone-review.js +120 -0
- package/workspace/lib/milestone-suggest.js +176 -0
- package/workspace/lib/plan-items.js +1 -1
- package/workspace/lib/pmos-verbs.js +7 -1
- package/workspace/lib/program-chat.js +1 -1
- package/workspace/lib/program-cli.js +56 -0
- package/workspace/lib/programs.js +25 -6
- package/workspace/lib/routes-boards.js +77 -13
- package/workspace/lib/routes-briefing-premium.js +17 -1
- package/workspace/lib/routes-core-docs.js +3 -1
- package/workspace/lib/routes-programs.js +84 -7
- package/workspace/lib/task-cli.js +120 -0
- package/workspace/lib/workflow-chat.js +1 -0
- package/workspace/lib/workflow-cli.js +91 -6
- package/workspace/milestone-suggest-test.js +175 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-chat-line-test.js +12 -1
- package/workspace/premium-vw-item-test.js +3 -3
- package/workspace/premium-vw-jira-test.js +2 -1
- package/workspace/program-order-test.js +180 -0
- package/workspace/public/pm/bd-ini-model.js +81 -0
- package/workspace/public/pm/bd-ini-panel.js +123 -58
- package/workspace/public/pm/bd-prog-panel.js +54 -14
- package/workspace/public/pm/bd-prog.js +3 -3
- package/workspace/public/pm/cozy-home.css +5 -0
- package/workspace/public/pm/cozy-panel.css +2 -0
- package/workspace/public/pm/cozy-viewer.js +10 -3
- package/workspace/public/pm/cozy-xv.css +51 -16
- package/workspace/public/pm/cozy-xv.js +6 -5
- package/workspace/public/pm/goal-chat.js +1 -1
- package/workspace/public/pm/home-app.js +35 -19
- package/workspace/public/pm/home-ask.js +9 -3
- package/workspace/public/pm/home-chat.js +16 -2
- package/workspace/public/pm/home-ini-model.js +42 -29
- package/workspace/public/pm/home-ini.css +1 -0
- package/workspace/public/pm/home-ini.js +26 -34
- package/workspace/public/pm/home-list.js +14 -8
- package/workspace/public/pm/home-stage-card.js +3 -1
- package/workspace/public/pm/home-task.js +41 -65
- package/workspace/public/pm/home-today.js +11 -12
- package/workspace/public/pm/ms-suggest.css +50 -0
- package/workspace/public/pm/ms-suggest.js +98 -0
- package/workspace/public/pm/premium-board.js +13 -7
- package/workspace/public/pm/premium-initiative-head.js +32 -13
- package/workspace/public/pm/premium-viewer.js +1 -0
- package/workspace/public/pm/premium-vw-item-model.js +13 -7
- package/workspace/public/pm/premium-vw-item.js +49 -5
- package/workspace/public/pm/prog-order.css +47 -0
- package/workspace/public/pm/prog-order.js +188 -0
- package/workspace/public/pm/program-charter.js +47 -7
- package/workspace/public/pm/program-model.js +79 -1
- package/workspace/public/pm/task-card.css +108 -0
- package/workspace/public/pm/task-card.js +271 -0
- package/workspace/public/pm/wf-page.js +3 -0
- package/workspace/server.js +23 -1
- package/workspace/skills/milestone-review.skill +53 -0
- package/workspace/skills/workflow-setup.skill +14 -5
- package/workspace/stage-card-test.js +11 -0
- package/workspace/task-card-test.js +248 -0
- package/workspace/test-lists/bd-ini-panel.json +5 -0
- package/workspace/test-lists/core-documents-backend.json +15 -3
- package/workspace/test-lists/milestone-suggest.json +6 -0
- package/workspace/test-lists/program-order.json +6 -0
- package/workspace/test-lists/task-card.json +6 -0
- package/workspace/test-lists/workflow-stage.json +5 -0
|
@@ -2,13 +2,58 @@
|
|
|
2
2
|
* XvOptAJira, XvAInsight), drawn by pm/cozy-xv.js and the panels that use it. Token vars from cozy.css only; cozy-vw-shell.css draws the
|
|
3
3
|
* header, the summary card and the folding rows. No motion. */
|
|
4
4
|
|
|
5
|
-
/* the stage
|
|
6
|
-
|
|
7
|
-
.xv-stg
|
|
8
|
-
.xv-stg i
|
|
9
|
-
.xv-stg i.
|
|
5
|
+
/* the stage ladder in the stage card (XipB .lad): one bar a stage of the initiative's own workflow; passed grey, the current one blue,
|
|
6
|
+
* a skipped one hatched, a milestone a diamond */
|
|
7
|
+
.xv-stg { display: flex; gap: 3px; align-items: center; flex: none; min-height: 10px; }
|
|
8
|
+
.xv-stg i { flex: 1; height: 6px; border-radius: 3px; background: var(--cz-well2); display: block; }
|
|
9
|
+
.xv-stg i.on { background: color-mix(in srgb, var(--cz-ink3) 55%, var(--cz-card)); }
|
|
10
|
+
.xv-stg i.now { background: var(--cz-blue); height: 8px; }
|
|
10
11
|
.xv-stg i.sk { background: repeating-linear-gradient(135deg, var(--cz-well2) 0 3px, transparent 3px 6px); }
|
|
11
|
-
.xv-
|
|
12
|
+
.xv-stg i.ms { flex: 0 0 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); }
|
|
13
|
+
.xv-skip { margin: 0 !important; }
|
|
14
|
+
|
|
15
|
+
/* the stage card and the Plan card (XipB .card2): a quiet outlined card, its head the name and where it stands */
|
|
16
|
+
.xv-card { border: 1px solid var(--cz-hair); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
|
|
17
|
+
.xv-ch { display: flex; align-items: center; gap: 8px; color: var(--cz-ink); }
|
|
18
|
+
.xv-ch b { font-size: 15px; font-weight: 800; }
|
|
19
|
+
.xv-ch .r { margin-left: auto; font-size: 12.5px; color: var(--cz-ink3); font-weight: 700; white-space: nowrap; }
|
|
20
|
+
.xv-sc .xv-lr { padding-left: 0; padding-right: 0; }
|
|
21
|
+
.xv-sl { margin: 0; }
|
|
22
|
+
.xv-sl .cz-nd.tl { width: 14px; height: 14px; margin: 4px; border-radius: 3px; transform: rotate(45deg); border-style: solid; }
|
|
23
|
+
.xv-none .tx small { color: var(--cz-ink3); }
|
|
24
|
+
.xv-none .cz-nd { border-style: dashed; }
|
|
25
|
+
.xv-sl .tail .nm { color: var(--cz-ink3); font-weight: 600; }
|
|
26
|
+
.cz-sli.has-act { display: flex; align-items: flex-start; gap: 8px; }
|
|
27
|
+
.cz-sli.has-act > .xv-none { flex: 1; }
|
|
28
|
+
.xv-add { width: 32px; height: 32px; border-radius: 50%; background: var(--cz-blueink); color: var(--cz-card); display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 6px; }
|
|
29
|
+
.xv-add:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
30
|
+
|
|
31
|
+
/* the summary's meta: the owner's avatar and name, the workflow's icon and name */
|
|
32
|
+
.xv-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
|
|
33
|
+
.xv-av { width: 22px; height: 22px; border-radius: 50%; background: var(--cz-bluebg); color: var(--cz-blueink); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
|
|
34
|
+
.xv-who .wfi { color: var(--cz-ink3); }
|
|
35
|
+
|
|
36
|
+
/* the plan line (XipB .pl): your plan grey, past the plan amber dashed, Jira's pace blue dashed, a tick for today */
|
|
37
|
+
.xv-pl { position: relative; height: 56px; margin: 2px 4px 0; }
|
|
38
|
+
.xv-pl .bar { position: absolute; top: 18px; height: 10px; border-radius: 5px; background: var(--cz-well2); }
|
|
39
|
+
.xv-pl .over, .xv-pl .exp { position: absolute; top: 21px; height: 4px; border-radius: 2px; }
|
|
40
|
+
.xv-pl .over { background: repeating-linear-gradient(90deg, var(--cz-dot-risk) 0 6px, transparent 6px 10px); }
|
|
41
|
+
.xv-pl .exp { background: repeating-linear-gradient(90deg, var(--cz-blueink) 0 6px, transparent 6px 10px); }
|
|
42
|
+
.xv-pl .tk { position: absolute; top: 12px; width: 2px; height: 22px; margin-left: -1px; border-radius: 1px; background: var(--cz-ink); }
|
|
43
|
+
.xv-pl .tk.am { background: var(--cz-dot-risk); }
|
|
44
|
+
.xv-pl .tk.e { background: var(--cz-blueink); }
|
|
45
|
+
.xv-pl .lb { position: absolute; top: 38px; font-size: 11.5px; font-weight: 700; color: var(--cz-ink3); white-space: nowrap; }
|
|
46
|
+
.xv-pl .lb.tp { top: -2px; }
|
|
47
|
+
.xv-pl .lb b { color: var(--cz-ink); font-weight: 800; }
|
|
48
|
+
.xv-pl .lb.w, .xv-pl .lb.w b { color: var(--cz-risk); }
|
|
49
|
+
.xv-pl .lb.e, .xv-pl .lb.e b { color: var(--cz-blueink); }
|
|
50
|
+
.xv-lg { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--cz-ink3); font-weight: 600; }
|
|
51
|
+
.xv-lg span { display: inline-flex; align-items: center; gap: 5px; }
|
|
52
|
+
.xv-lg i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; background: var(--cz-well2); }
|
|
53
|
+
.xv-lg i.over { background: repeating-linear-gradient(90deg, var(--cz-dot-risk) 0 4px, transparent 4px 6px); }
|
|
54
|
+
.xv-lg i.exp { background: repeating-linear-gradient(90deg, var(--cz-blueink) 0 4px, transparent 4px 6px); }
|
|
55
|
+
.xv-lg i.today { width: 2px; height: 12px; background: var(--cz-ink); }
|
|
56
|
+
.xv-lg i.today.am { background: var(--cz-dot-risk); }
|
|
12
57
|
|
|
13
58
|
/* one row in a section (XvABoard .lr): a mark, a title, one quiet line; a ticket row is a press */
|
|
14
59
|
.xv-lr { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px; border-radius: 12px; font: inherit; font-size: 13.5px; color: var(--cz-ink); background: none; border: 0; width: 100%; box-sizing: border-box; text-align: left; }
|
|
@@ -35,17 +80,7 @@ button.xv-chip { cursor: pointer; }
|
|
|
35
80
|
button.xv-chip:focus-visible, .xv-mini:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
36
81
|
.xv-mini { height: 30px; padding: 0 12px; border-radius: 999px; background: var(--cz-bluebg); color: var(--cz-blueink); font: 700 12.5px var(--cz-sans); border: 0; cursor: pointer; }
|
|
37
82
|
|
|
38
|
-
/* dates and trend: three boxes, then the progress bar */
|
|
39
|
-
.xv-dg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
|
|
40
|
-
.xv-box { background: color-mix(in srgb, var(--cz-well) 50%, var(--cz-card)); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
|
|
41
|
-
.xv-box > span { font-size: 12px; color: var(--cz-ink3); }
|
|
42
|
-
.xv-box > b { font-size: 14px; font-weight: 800; }
|
|
43
|
-
.xv-box.late > b { color: var(--cz-risk); }
|
|
44
|
-
.xv-bh { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
|
|
45
|
-
.xv-bh span { color: var(--cz-ink3); }
|
|
46
|
-
.xv-seg { padding: 2px 0 4px; }
|
|
47
83
|
|
|
48
84
|
@media (max-width: 760px) {
|
|
49
|
-
.xv-dg { grid-template-columns: 1fr 1fr; }
|
|
50
85
|
.xv-lr { min-height: 48px; }
|
|
51
86
|
}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* lr({ title, sub, right, mk, tk, attrs }) one row in a section: a mark (mk 'warn' | 'done' | 'you' | 'task' | 'late'), the title (markup),
|
|
7
7
|
* one quiet line, an end value; tk makes it a press that opens that Jira ticket
|
|
8
|
-
* stageBar(steps, k, skipped, nowTitle)
|
|
9
|
-
* nowTitle is the current one's tooltip (its days in the step, and
|
|
8
|
+
* stageBar(steps, k, skipped, nowTitle, aria) one segment per step: the passed ones grey, the current one blue, the skipped ones hatched,
|
|
9
|
+
* a milestone (s.ms) a diamond; nowTitle is the current one's tooltip (its days in the step, and
|
|
10
|
+
* the usual days); every other bar names its stage on hover; aria replaces the default label
|
|
10
11
|
* chips(list) a wrap of quiet chips (markup strings)
|
|
11
12
|
* copyText(text, said) copies the text and says so in the page's toast (setSay) */
|
|
12
13
|
import { esc, toast } from './premium-shell.js';
|
|
@@ -20,10 +21,10 @@ export const lr = (o) => {
|
|
|
20
21
|
return `<${tag} class="xv-lr${o.tk ? ' go' : ''}"${o.tk ? ` data-tk="${esc(o.tk)}"` : ''}${o.attrs || ''}><span class="xv-mk${o.mk ? ' ' + o.mk : ''}" aria-hidden="true"></span>`
|
|
21
22
|
+ `<span class="w"><b>${o.title}</b>${o.sub ? `<span>${esc(o.sub)}</span>` : ''}</span>${o.right ? `<span class="r">${o.right}</span>` : ''}</${end}>`;
|
|
22
23
|
};
|
|
23
|
-
export function stageBar(steps, k, skipped, nowTitle) {
|
|
24
|
+
export function stageBar(steps, k, skipped, nowTitle, aria) {
|
|
24
25
|
const S = steps || [], sk = new Set(skipped || []);
|
|
25
|
-
const label = k >= 0 && S[k] ? 'Stage ' + (k + 1) + ' of ' + S.length + ', ' + S[k].label : 'No stage on record';
|
|
26
|
-
return `<div class="xv-stg" role="img" aria-label="${esc(label)}">${S.map((s, j) => `<i class="${[j < k && !sk.has(j) ? 'on' : '', j === k ? 'now' : '', sk.has(j) ? 'sk' : ''].filter(Boolean).join(' ')}" title="${esc(j === k && nowTitle ? nowTitle : s.label)}"></i>`).join('')}</div>`;
|
|
26
|
+
const label = aria || (k >= 0 && S[k] ? 'Stage ' + (k + 1) + ' of ' + S.length + ', ' + S[k].label : 'No stage on record');
|
|
27
|
+
return `<div class="xv-stg" role="img" aria-label="${esc(label)}">${S.map((s, j) => `<i class="${[j < k && !sk.has(j) ? 'on' : '', j === k ? 'now' : '', sk.has(j) ? 'sk' : '', s.ms ? 'ms' : ''].filter(Boolean).join(' ')}" title="${esc(j === k && nowTitle ? nowTitle : s.label + (sk.has(j) ? ' · skipped' : j < k ? ' · done' : ''))}"></i>`).join('')}</div>`;
|
|
27
28
|
}
|
|
28
29
|
export const chips = (list) => (list && list.length ? `<div class="xv-chips">${list.join('')}</div>` : '');
|
|
29
30
|
let say = toast;
|
|
@@ -59,7 +59,7 @@ export function shownUser(text) {
|
|
|
59
59
|
if (t.includes(MARK.cancel)) return 'Cancel the goal';
|
|
60
60
|
const g = t.indexOf(MARK.grill + ' The PM set a goal: ');
|
|
61
61
|
if (g >= 0) return '/goal ' + t.slice(g + (MARK.grill + ' The PM set a goal: ').length).split('\n')[0];
|
|
62
|
-
if (t.startsWith(OPENING) || t.startsWith('[PMOS report]') || t.startsWith('[PMOS program]') || t.startsWith('[PMOS workflow]')) { const s = pmSays(t); if (s != null) return s; } // premium-reports-from-chat: lib/report-chat.js wrap; lib/program-chat.js wrap; lib/workflow-chat.js wrap
|
|
62
|
+
if (t.startsWith(OPENING) || t.startsWith('[PMOS report]') || t.startsWith('[PMOS program]') || t.startsWith('[PMOS workflow]') || t.startsWith('[PMOS initiative]')) { const s = pmSays(t); if (s != null) return s; } // premium-reports-from-chat: lib/report-chat.js wrap; lib/program-chat.js wrap; lib/workflow-chat.js wrap
|
|
63
63
|
return t;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -36,6 +36,7 @@ import { mountIni, iniList, iniOverview, iniPage } from './home-ini.js'; // th
|
|
|
36
36
|
import * as MEN from './home-mentions.js'; // @Mentions, the permanent row at the top of Home and its Viewer (Viewer kit, XvANew)
|
|
37
37
|
import { mountRecRow, clockOf as recClock } from './home-rec-row.js';
|
|
38
38
|
import { mountSesName } from './home-ses-name.js'; // session names A: tap the session's name to rename it (canvas XmsNames)
|
|
39
|
+
import * as PO from './prog-order.js'; // a program's order on Home: the grip, hold-then-drag on a phone, ✦ Claude's order from the dates (canvas RoAPhone)
|
|
39
40
|
import { initiativeRename, taskRename } from './rename-press.js'; // tap the title to rename (canvas RnATask, RnASaved) // the pinned recording row above it (XvARecHome)
|
|
40
41
|
|
|
41
42
|
const $ = (s, r = document) => r.querySelector(s);
|
|
@@ -86,14 +87,14 @@ const S = {
|
|
|
86
87
|
doneOpen: false, stepsMore: false, sheet: false, rec: {}, pin: new Set(JSON.parse(store.get('pmos.home.pin') || '[]')),
|
|
87
88
|
cardFold: store.get('pmos.home.cardfold') === '1', // the card's checklist folded to one line (AgInitSpec), kept in this browser
|
|
88
89
|
// the one list (premium-uncovered-features): the filter, the picked product, which groups and initiatives are open, kept in this browser
|
|
89
|
-
filter: 'today', product: store.get('pmos.home.product') || null, kidsOff: new Set(), rest: new Set(),
|
|
90
|
+
filter: 'today', product: store.get('pmos.home.product') || null, kidsOff: new Set(), rest: new Set(), cap: false, day: false,
|
|
90
91
|
pg: (() => { try { return JSON.parse(store.get('pmos.home.pg') || '{}') || {}; } catch { return {}; } })(),
|
|
91
92
|
eodHidden: store.get('pmos.home.eod') === L.dayOf(), phoneChat: false,
|
|
92
93
|
};
|
|
93
94
|
// every fold of the list is kept in this browser (HvAC: "every group can be hidden or shown, and the choice is remembered"): the groups in
|
|
94
95
|
// pmos.home.pg, an initiative's rows and its "N more" in pmos.home.kids
|
|
95
|
-
(() => { try { const k = JSON.parse(store.get('pmos.home.kids') || '{}') || {}; for (const [n, v] of [['on', S.kids], ['off', S.kidsOff], ['rest', S.rest]
|
|
96
|
-
const keepKids = () => store.set('pmos.home.kids', JSON.stringify({ on: [...S.kids], off: [...S.kidsOff], rest: [...S.rest]
|
|
96
|
+
(() => { try { const k = JSON.parse(store.get('pmos.home.kids') || '{}') || {}; for (const [n, v] of [['on', S.kids], ['off', S.kidsOff], ['rest', S.rest]]) for (const x of k[n] || []) v.add(x); } catch { /* none kept */ } })();
|
|
97
|
+
const keepKids = () => store.set('pmos.home.kids', JSON.stringify({ on: [...S.kids], off: [...S.kidsOff], rest: [...S.rest] }));
|
|
97
98
|
const toast = (t) => { const el = $('#toast'); el.classList.remove('act'); el.textContent = t; el.classList.add('on'); clearTimeout(toast.t); toast.t = setTimeout(() => el.classList.remove('on'), 4200); };
|
|
98
99
|
/** The toast with Undo (RnASaved: "Renamed · Undo"), the shape home-work.js draws: undo() runs the write's opposite once. */
|
|
99
100
|
function toastUndo(msg, undo) {
|
|
@@ -254,7 +255,7 @@ function homeListHtml() {
|
|
|
254
255
|
// a group is open until the PM folds it; another product starts folded; "Not in an initiative" starts folded on a phone (HvAC, HvACDesk)
|
|
255
256
|
const pOpen = (g) => (g.key in S.pg ? !!S.pg[g.key] : g.kind === 'loose' ? !isPhone() : g.kind === 'program' || g.primary || M.products.length === 1 || (!!S.product && !!g.product && S.product === g.product.key));
|
|
256
257
|
return TD.listHtml(M, todayModel(), {
|
|
257
|
-
sel: S.sel || (S.ini && S.ini !== 'product' ? 'i:' + S.ini : null), selHead: S.head, isOpen: open, pOpen, restOpen: (k) => S.rest.has(k), cap: S.cap,
|
|
258
|
+
sel: S.sel || (S.ini && S.ini !== 'product' ? 'i:' + S.ini : null), selHead: S.head, isOpen: open, pOpen, restOpen: (k) => S.rest.has(k), cap: S.cap, pin: S.pin, avHtml, ready: S.ready, err: S.D.err.length ? S.D.err[0] : '',
|
|
258
259
|
product: S.product, review: R, mic: canDictate(), phone: isPhone(), day: S.day, top: S.ready ? RECROW.html() + MEN.rowHtml(S.D, { sel: S.sel }) : '',
|
|
259
260
|
});
|
|
260
261
|
}
|
|
@@ -412,9 +413,9 @@ function draw() { drawList(); drawTop(); chat.refresh(); }
|
|
|
412
413
|
function allRows() {
|
|
413
414
|
const out = [];
|
|
414
415
|
const M = S.M || L.homeList(S.D, { now: NOW() });
|
|
415
|
-
const add = (r) => { if (!r) return; out.push(r); (r.kids || []).forEach(add); };
|
|
416
|
+
const add = (r) => { if (!r) return; out.push(r); (r.kids || []).forEach(add); (r.tasks || []).forEach(add); };
|
|
416
417
|
H.needsOf(S.D).forEach(add);
|
|
417
|
-
for (const g of M.groups) { (g.flat || []).forEach(add); (g.inis || []).forEach(add); (g.rest || []).forEach(add); (g.rows || []).forEach(add); (g.tasks || []).forEach(add); }
|
|
418
|
+
for (const g of M.groups) { (g.flat || []).forEach(add); (g.inis || []).forEach(add); (g.rest || []).forEach(add); (g.rows || []).forEach(add); (g.tasks || []).forEach(add); add(g.msRow); }
|
|
418
419
|
if (M.list) M.list.rows.forEach(add);
|
|
419
420
|
if (S.filter !== 'today') { const T = L.homeList(S.D, { now: NOW() }); T.groups.forEach((g) => { (g.rows || []).forEach(add); (g.inis || []).concat(g.rest || []).forEach(add); }); }
|
|
420
421
|
for (const s of S.D.sessions) { const r = { id: 's:' + s.id, kind: 'session', sid: s.id, key: H.keyOfSession(s), ini: H.iniOfSession(s), name: H.nameOf(s), role: H.roleOf(s, S.D.desk && S.D.desk.roles), state: s.shown }; out.push(r); }
|
|
@@ -684,12 +685,13 @@ function select(id, o = {}) {
|
|
|
684
685
|
if (!r) { S.phoneChat = false; if (S.ini) openTarget(iniTarget(S.ini)); else openTarget(homeTarget()); drawList(); return; }
|
|
685
686
|
if (r.kind === 'ini') { goIni(r.ini); return; }
|
|
686
687
|
if (r.kind === 'product') { goIni('product'); return; }
|
|
688
|
+
if (r.kind === 'msreview') { goProgram(r.program); return; } // Claude's milestone changes: the program panel, where they lead Waits on you
|
|
687
689
|
S.head = null;
|
|
688
690
|
// a row with a conversation opens it; on a phone it opens over the list, with a back bar (HmPhone2)
|
|
689
691
|
if (isPhone() && (r.kind === 'update' || (r.kind === 'need' && r.row) || r.kind === 'session' || r.needSession)) S.phoneChat = true;
|
|
690
692
|
if (r.kind === 'update') { openTarget(updateTarget()); if (!o.keepViewer) openUpdateViewer(); }
|
|
691
693
|
else if (r.kind === 'need' && r.row) { openTarget(needTarget(r)); if (!o.keepViewer) openNeedViewer(r); }
|
|
692
|
-
else if (r.kind === 'session' || r.needSession) { const s = S.D.sessions.find((x) => x.id === r.sid); if (s) { openTarget(sessionTarget(s)); if (isMetricsSession(s) && !o.keepViewer && !isPhone()) openMetricsViewer(); } }
|
|
694
|
+
else if (r.kind === 'session' || r.needSession) { const s = S.D.sessions.find((x) => x.id === r.sid); if (s) { openTarget(sessionTarget(s)); followViewer(s); if (isMetricsSession(s) && !o.keepViewer && !isPhone()) openMetricsViewer(); } }
|
|
693
695
|
else if (r.kind === 'ptask') { S.phoneChat = isPhone(); openTarget(programTarget(r.program, r)); }
|
|
694
696
|
else if (r.kind === 'task') { openBoardTask(r.task); }
|
|
695
697
|
else if (r.kind === 'item') { import('./home-work.js').then((M) => M.openWorkItem(r.key)); }
|
|
@@ -701,6 +703,17 @@ function select(id, o = {}) {
|
|
|
701
703
|
drawList();
|
|
702
704
|
syncUrl();
|
|
703
705
|
}
|
|
706
|
+
/** A session opened beside an initiative's page in the Viewer: the page follows the session's own initiative, and a loose session closes
|
|
707
|
+
* it, so the Viewer never shows the initiative of the session before (Wawan, 2026-10-25). Other Viewer items stay as they are. */
|
|
708
|
+
function followViewer(s) {
|
|
709
|
+
if (isPhone()) return;
|
|
710
|
+
const c = VW.current(); if (!c || !/^ov:/.test(String(c.id))) return;
|
|
711
|
+
const ini = H.iniOfSession(s);
|
|
712
|
+
if (c.id === 'ov:' + ini) return;
|
|
713
|
+
if (!ini || !iniRowOf(ini)) { VW.close(); return; }
|
|
714
|
+
if (S.ini !== ini) { S.ini = ini; S.IM = null; S.IMid = null; S.doneOpen = false; S.stepsMore = false; }
|
|
715
|
+
iniPage();
|
|
716
|
+
}
|
|
704
717
|
/** An initiative's name in the list (or 'product'): it is selected, the chat is its own and its page opens in the Viewer (HbCDesk). The list
|
|
705
718
|
* stays as it is. o.page false: the chat alone, the Viewer as it is. */
|
|
706
719
|
async function goIni(id, o = {}) {
|
|
@@ -733,7 +746,10 @@ function goOtherProduct(g) {
|
|
|
733
746
|
render: (b) => {
|
|
734
747
|
const goals = C.items.map((x) => itemHtml({ kind: x.kind === 'ok' ? 'done' : 'risk', label: x.label })).join('') || '<p class="hm-none">No KR or budget is anchored on this board.</p>';
|
|
735
748
|
b.innerHTML = `<div class="hi-v hi-page"><section class="hi-pg" aria-label="Goals"><div class="hi-pgh"><b>Goals</b><span class="hi-n">${esc(C.of)}</span></div>${goals}</section>`
|
|
736
|
-
+ `<section class="hi-pg" aria-label="This week"><div class="hi-pgh"><b>This week</b></div><div class="hm-r hi-r"><a class="hm-rm" href="${esc(own)}" target="_blank" rel="noopener"><span class="hm-tile">${SVG(I.doc, 14)}</span><span class="hm-rt"><b>Weekly update and metrics review</b><em class="q">In ${esc(name)}'s own Home, in a new tab</em></span></a></div></section
|
|
749
|
+
+ `<section class="hi-pg" aria-label="This week"><div class="hi-pgh"><b>This week</b></div><div class="hm-r hi-r"><a class="hm-rm" href="${esc(own)}" target="_blank" rel="noopener"><span class="hm-tile">${SVG(I.doc, 14)}</span><span class="hm-rt"><b>Weekly update and metrics review</b><em class="q">In ${esc(name)}'s own Home, in a new tab</em></span></a></div></section>`
|
|
750
|
+
+ (isPhone() ? `<button type="button" class="hi-talk" data-hp="talk">Message Claude about ${esc(name)}</button>` : '') + '</div>';
|
|
751
|
+
// a phone has no chat beside the page: its own chat is one press away, as on the board's own product (Wawan, 2026-10-25)
|
|
752
|
+
b.onclick = (e) => { const t = e.target.closest('[data-hp="talk"]'); if (t) talk(); };
|
|
737
753
|
} });
|
|
738
754
|
}
|
|
739
755
|
/** A program heading's name: the program panel in the Viewer, the program's own chat (HbCProg). */
|
|
@@ -771,16 +787,16 @@ const HTTPS = /^https:\/\//;
|
|
|
771
787
|
function openBoardTask(t) {
|
|
772
788
|
if (!t) return;
|
|
773
789
|
import('./home-task.js').then((M) => M.openTask(t, {
|
|
774
|
-
VW, pmPost, toast, now: NOW, ws: t.ws || boardWs(), board: t.board || boardId(), iniTitle,
|
|
775
|
-
|
|
776
|
-
|
|
790
|
+
VW, pmPost, toast, toastUndo, now: NOW, ws: t.ws || boardWs(), board: t.board || boardId(), iniTitle,
|
|
791
|
+
owners: () => [...new Set(((S.D.items && S.D.items.items) || []).map((x) => x && x.src === 'pmos' && x.owner).filter(Boolean))], // the task card's owner list
|
|
792
|
+
inis: () => H.boardRows(S.D).filter((r) => r && !r.archived).map((r) => ({ id: r.id, title: r.title })),
|
|
793
|
+
openIni: (id) => goIni(id),
|
|
777
794
|
askInChat: (task) => {
|
|
778
795
|
S.phoneChat = isPhone();
|
|
779
796
|
openTarget({ ...iniTarget(task.ini), placeholder: 'Ask about ' + task.title });
|
|
780
797
|
setTimeout(() => { const ta = $('#hmIn'); if (ta) { ta.value = 'About the task "' + task.title + '": '; ta.dispatchEvent(new Event('input', { bubbles: true })); ta.focus(); } }, 0);
|
|
781
798
|
drawList();
|
|
782
799
|
},
|
|
783
|
-
openRecord: (task) => import('./premium-vw-item.js').then((V) => V.openWorkItem({ kind: 'task', ini: task.ini, key: 'task:' + task.uid, title: task.title, ws: boardWs(), board: boardId() })).catch(() => toast('The record could not open.')),
|
|
784
800
|
onChange: () => load(),
|
|
785
801
|
rename: taskRenameOf,
|
|
786
802
|
}));
|
|
@@ -999,7 +1015,7 @@ function openOverview() {
|
|
|
999
1015
|
const life = M.acts && M.acts.life ? `<button type="button" class="hx-b" data-ov-life="active">Resume</button>`
|
|
1000
1016
|
: ask ? `<label class="hv-why"><span>${ask === 'on-hold' ? 'Put on hold' : 'Cancel'}: why? It goes on the record.</span><input id="ovWhy" autocomplete="off"></label><button type="button" class="hx-b pri" data-ov-life-go>Record</button><button type="button" class="hx-b" data-ov-life-no>Not now</button>`
|
|
1001
1017
|
: `<button type="button" class="hx-b" data-ov-life="on-hold">Put on hold</button><button type="button" class="hx-b" data-ov-life="cancelled">Cancel</button>`;
|
|
1002
|
-
const tasks = (M.tasks.rows || []).slice(0, 40).map((t) => `<div class="hx-row" data-ov-tkrow="${esc(t.key)}"><span class="hx-t"><b>${esc(t.title)}</b><em>${esc([t.src, t.state, t.owner].filter(Boolean).join(' · '))}</em></span><button type="button" class="hx-b" data-ov-tk="${esc(t.key)}" aria-label="Open ${esc(t.title)}">Open</button>${t.pmos && t.uid ? `<select data-ov-task="${esc(t.uid)}" aria-label="Status of ${esc(t.title)}">${['To do', 'In progress', '
|
|
1018
|
+
const tasks = (M.tasks.rows || []).slice(0, 40).map((t) => `<div class="hx-row" data-ov-tkrow="${esc(t.key)}"><span class="hx-t"><b>${esc(t.title)}</b><em>${esc([t.src, t.state, t.owner].filter(Boolean).join(' · '))}</em></span><button type="button" class="hx-b" data-ov-tk="${esc(t.key)}" aria-label="Open ${esc(t.title)}">Open</button>${t.pmos && t.uid ? `<select data-ov-task="${esc(t.uid)}" aria-label="Status of ${esc(t.title)}">${['To do', 'In progress', 'Done', "Won't do", 'Archived'].map((s) => `<option${t.state === s ? ' selected' : ''}>${s}</option>`).join('')}</select>` : ''}</div>`).join('') || `<p class="hx-n">${esc(M.tasks.note || 'No task.')}</p>`;
|
|
1003
1019
|
const docs = (M.docs.rows || []).filter((d) => !d.tech).map((d) => `<div class="hx-row" data-ov-doc="${esc(d.key)}"><span class="hx-t"><b>${esc(d.title)}</b><em>${esc([d.state, d.by, d.when || (d.added ? 'added ' + d.added : '')].filter(Boolean).join(' · '))}</em>${d.link ? `<small>${esc(d.link.kind + ': ' + d.link.url)}</small>` : ''}</span>${d.path && d.st === 'draft' && d.slot ? `<button type="button" class="hx-b" data-ov-dread="${esc(d.key)}">Read</button>` : d.path ? `<button type="button" class="hx-b" data-ov-open="${esc(d.path)}" data-ov-name="${esc(d.title)}">Open</button>` : ''}${d.act && d.act.kind === 'draft' && !d.running ? `<button type="button" class="hx-b pri" data-ov-draft="${esc(d.key)}">Draft it</button>` : d.running ? '<em class="hx-n">Drafting</em>' : ''}</div>`).join('');
|
|
1004
1020
|
b.innerHTML = MORE.WAIT + `<div class="hv-acts"><button type="button" class="hx-b" data-ov-record>Open the full record</button>${M.board && M.board.id ? '<button type="button" class="hx-b" data-ov-sprint>Sprint</button>' : ''}</div><section class="hx-sec"><h4>Stage</h4>${move}<div class="hv-acts">${life}</div></section>`
|
|
1005
1021
|
+ `<section class="hx-sec"><h4>Tasks</h4>${tasks}<div class="hx-add"><input id="ovTask" placeholder="Add a task" aria-label="Add a task"><button type="button" class="hx-b pri" data-ov-add>Add</button></div></section>`
|
|
@@ -1024,7 +1040,6 @@ function openOverview() {
|
|
|
1024
1040
|
if ('ovSprint' in t.dataset) { (await import('./premium-vw-jira.js')).openSprint(o); return; }
|
|
1025
1041
|
if ('ovRecord' in t.dataset) { (await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: M.title, ...o }); return; }
|
|
1026
1042
|
const row = (M.tasks.rows || []).find((x) => x.key === t.dataset.ovTk); if (!row) return;
|
|
1027
|
-
if (!row.pmos && row.ref) { (await import('./premium-vw-jira.js')).openTicket({ ...o, initiative: id, ref: row.ref }); return; }
|
|
1028
1043
|
(await import('./premium-vw-item.js')).openWorkItem({ kind: 'task', ini: id, key: row.key, title: row.title, ...o });
|
|
1029
1044
|
return;
|
|
1030
1045
|
}
|
|
@@ -1294,7 +1309,7 @@ function moreMenu(anchor) {
|
|
|
1294
1309
|
function searchGo(d) {
|
|
1295
1310
|
if (d.ini) goIni(d.ini);
|
|
1296
1311
|
else if (d.doc) openFile({ path: d.doc, name: d.doc.split('/').pop() });
|
|
1297
|
-
else if (d.ses) { const s = S.D.sessions.find((x) => x.id === d.ses); if (s) { S.sel = 's:' + s.id; openTarget(sessionTarget(s)); drawList(); } }
|
|
1312
|
+
else if (d.ses) { const s = S.D.sessions.find((x) => x.id === d.ses); if (s) { S.sel = 's:' + s.id; openTarget(sessionTarget(s)); followViewer(s); drawList(); } }
|
|
1298
1313
|
else if (d.link) location.href = d.link;
|
|
1299
1314
|
}
|
|
1300
1315
|
|
|
@@ -1332,7 +1347,6 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
|
|
|
1332
1347
|
}
|
|
1333
1348
|
if (d.hmPg) { const open = b.getAttribute('aria-expanded') === 'true'; S.pg[d.hmPg] = !open; store.set('pmos.home.pg', JSON.stringify(S.pg)); drawList(); const f = $(`#hmList [data-hm-pg="${CSS.escape(d.hmPg)}"]`); if (f) f.focus(); return; }
|
|
1334
1349
|
if ('hmProd' in d) { goIni('product'); return; }
|
|
1335
|
-
if (d.hmTasks) { if (S.tasks.has(d.hmTasks)) S.tasks.delete(d.hmTasks); else S.tasks.add(d.hmTasks); keepKids(); drawList(); return; }
|
|
1336
1350
|
if (d.hmRest) { if (S.rest.has(d.hmRest)) S.rest.delete(d.hmRest); else S.rest.add(d.hmRest); keepKids(); drawList(); return; }
|
|
1337
1351
|
if (d.hmFilter) { S.filter = S.filter === d.hmFilter ? 'today' : d.hmFilter; drawList(); const f = $(`#hmList [data-hm-filter="${d.hmFilter}"]`); if (f) f.focus(); return; }
|
|
1338
1352
|
if (d.hmCheck) { checkRow(d.hmCheck); return; }
|
|
@@ -1419,7 +1433,10 @@ mountIni({ S, VW, pmGet, pmPost, toast, rowOf: (id) => iniRowOf(id), renameIni:
|
|
|
1419
1433
|
/* The program panel in Home's Viewer (HbCProg): Home's board model and programs; an initiative of it opens here, with ← back to the program.
|
|
1420
1434
|
* Read on the first program press, never at start: the panel's modules load premium-shell.js, whose start reads ?session= for the old dialog. */
|
|
1421
1435
|
let progPanel = null;
|
|
1422
|
-
const programPanel = () => progPanel || (progPanel = import('./bd-prog-panel.js').then((PP) => { PP.mount({ M: () => S.D.board, programs: () => S.D.programs || [], openIni: (id) => goIni(id), close: () => {}, reload: () => load(), say: (m) => toast(m), drill: true }); return PP; }));
|
|
1436
|
+
const programPanel = () => progPanel || (progPanel = import('./bd-prog-panel.js').then((PP) => { PP.mount({ M: () => S.D.board, programs: () => S.D.programs || [], openIni: (id) => goIni(id), close: () => {}, reload: () => load(), say: (m) => toast(m), drill: true, talk: () => (isPhone() ? talk : null) }); return PP; }));
|
|
1437
|
+
PO.mount({ programs: () => S.D.programs || [], stateOf: (p) => (((S.M && S.M.groups) || []).find((g) => g.kind === 'program' && g.program.id === p.id) || {}).st || null,
|
|
1438
|
+
saved: (p) => { const L2 = S.D.programs || [], i = L2.findIndex((x) => x.id === p.id); if (i >= 0) L2[i] = { ...L2[i], ...p }; drawList(); },
|
|
1439
|
+
say: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)), openIni: (id) => goIni(id) });
|
|
1423
1440
|
mountNav('home', document, { more: () => moreMenu, settings: () => MORE.openSettings(), here: () => { if (VW.isOpen()) VW.close(); goHome(); } });
|
|
1424
1441
|
PHC = mountPhoneCard({ pmGet, pmPost, toast, ws: () => WS || null, openMeeting: (m) => openMeeting(m) }); drawList();
|
|
1425
1442
|
drawList(); drawTop();
|
|
@@ -1452,9 +1469,8 @@ load().then(() => {
|
|
|
1452
1469
|
const about = KEY.test(P.get('about') || '') ? P.get('about') : KEY.test(asked) ? asked : null;
|
|
1453
1470
|
if (isPhone() && ((open && !blockOpen) || sid || about)) { S.phoneChat = true; drawList(); } // the conversation the address names, not the list
|
|
1454
1471
|
if (open && !blockOpen) {
|
|
1455
|
-
// ?item=pt:<program>:<key> (the program panel's link to a program task) names the row by its id;
|
|
1472
|
+
// ?item=pt:<program>:<key> (the program panel's link to a program task) names the row by its id; Home lists no task, so the chat opens
|
|
1456
1473
|
const r = allRows().find((x) => x.key === open || (/^pt:/.test(open) && x.id === open));
|
|
1457
|
-
if (r && r.kind === 'ptask') { S.pg['g:' + r.program] = true; drawList(); }
|
|
1458
1474
|
if (r) select(r.id); else if (KEY.test(open)) openTarget({ ...homeTarget(), key: open, title: open });
|
|
1459
1475
|
}
|
|
1460
1476
|
else if (sid) { const s = S.D.sessions.find((x) => x.id === sid); if (s) { S.sel = 's:' + s.id; openTarget(sessionTarget(s)); drawList(); } else { openTarget(homeTarget()); toast('That session is not on this machine.'); } }
|
|
@@ -23,6 +23,7 @@ export const ICON = {
|
|
|
23
23
|
again: 'M4 12a8 8 0 1 0 2.3-5.6M4 4v4.5h4.5',
|
|
24
24
|
to: 'M5 12h14M13 6l6 6-6 6',
|
|
25
25
|
dots: 'M5 12h.01M12 12h.01M19 12h.01',
|
|
26
|
+
term: 'M4 5h16v14H4zM8 10l3 2-3 2M13 15h3',
|
|
26
27
|
};
|
|
27
28
|
const svg = (d, w = 2) => `<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"></path></svg>`;
|
|
28
29
|
/** One answer as an icon button. a = { icon, label, attr, pri }. */
|
|
@@ -37,11 +38,16 @@ export function permissionAsk(conv) {
|
|
|
37
38
|
const c = conv || {};
|
|
38
39
|
if (c.state === 'ended' || !c.ask) return null;
|
|
39
40
|
const opts = Array.isArray(c.ask.options) ? c.ask.options : [];
|
|
40
|
-
|
|
41
|
+
const ch = c.change || null;
|
|
42
|
+
// a prompt whose choices PMOS could not read still asks: the card says what it can and the answer is in the terminal (never a blue line
|
|
43
|
+
// with nothing under it)
|
|
44
|
+
if (!opts.length) {
|
|
45
|
+
return { kind: 'file', label: 'Asks before it goes on', title: (ch && ch.what) || clip(c.ask.question, 200) || 'Its terminal waits for your answer',
|
|
46
|
+
from: '', to: '', answers: [{ icon: 'term', label: 'Answer in its terminal', attr: 'data-hm-term', pri: true }], more: [] };
|
|
47
|
+
}
|
|
41
48
|
const deny = opts.find((o) => /^no\b/i.test(o.label)) || opts[opts.length - 1];
|
|
42
49
|
const allow = opts[0];
|
|
43
50
|
const more = opts.filter((o) => o !== allow && o !== deny);
|
|
44
|
-
const ch = c.change || null;
|
|
45
51
|
const send = !!ch && OUTSIDE.test(ch.system || '') && WRITE.test(ch.tool || '');
|
|
46
52
|
const verb = ch && ch.tool && !/^mcp__/.test(ch.tool) ? ch.tool + ' ' : '';
|
|
47
53
|
return {
|
|
@@ -115,7 +121,7 @@ export function openAsk(conv) {
|
|
|
115
121
|
const m = ms[i];
|
|
116
122
|
if (m.role === 'user') return false;
|
|
117
123
|
if (m.role === 'tool' && m.ask) return true;
|
|
118
|
-
if (m.role === 'assistant') return !!splitAsk(m.text).block;
|
|
124
|
+
if (m.role === 'assistant') return !!blockAsk(splitAsk(m.text).block); // only a block that draws a card
|
|
119
125
|
}
|
|
120
126
|
return false;
|
|
121
127
|
}
|
|
@@ -212,7 +212,12 @@ export function mountChat(el, host) {
|
|
|
212
212
|
const at = Date.parse((goal && goal.at) || '');
|
|
213
213
|
let k = -1;
|
|
214
214
|
items.forEach((it, i) => { if (it.at && Number.isFinite(at) && Date.parse(it.at) <= at && (goal.state !== 'done' || it.t === 'agent')) k = i; });
|
|
215
|
-
if (k < 0) {
|
|
215
|
+
if (k < 0) {
|
|
216
|
+
// it finished before every message shown here (an older run, or before the shown window): the divider leads, never trails the newest
|
|
217
|
+
const after = Number.isFinite(at) && items.some((it) => Date.parse(it.at || '') > at);
|
|
218
|
+
if (after) parts.unshift(dividerHtml(d)); else parts.push(dividerHtml(d));
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
216
221
|
if (goal.state === 'done') parts[k] = dividerHtml(d) + parts[k]; else parts[k] += dividerHtml(d);
|
|
217
222
|
}
|
|
218
223
|
/* ── the progress line (XcbOptions B) ── */
|
|
@@ -256,7 +261,16 @@ export function mountChat(el, host) {
|
|
|
256
261
|
if (k === 'all') { C.plAll = true; drawLine(); return; }
|
|
257
262
|
if (k === 'toggle') {
|
|
258
263
|
const m = lineModel();
|
|
259
|
-
if (m && m.tone === 'you') {
|
|
264
|
+
if (m && m.tone === 'you') {
|
|
265
|
+
// the card that asks; a goal that waits on the PM asks in Claude's newest message, so that one, with the box ready for the answer.
|
|
266
|
+
// Only with neither does the tap open the goal as on a working line (a tap is never silent: feedback batch 4, item 3)
|
|
267
|
+
const a = [...log.querySelectorAll('.hm-askw, .hm-askc, .hm-a.ask')].pop() || [...log.querySelectorAll('.hm-a')].pop();
|
|
268
|
+
if (a) {
|
|
269
|
+
a.scrollIntoView({ block: 'center', behavior: 'smooth' }); a.classList.remove('hm-flash'); void a.offsetWidth; a.classList.add('hm-flash');
|
|
270
|
+
if (!a.querySelector('.hm-askk') && host.desk()) { const box = el.querySelector('textarea'); if (box) box.focus({ preventScroll: true }); }
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
260
274
|
if (host.desk()) { if (vwShows()) window.czViewer.close(); else openGoal(); return; }
|
|
261
275
|
C.plOpen = !C.plOpen; drawLine();
|
|
262
276
|
}
|
|
@@ -81,23 +81,30 @@ function dueOf(end, done, now) {
|
|
|
81
81
|
return { text: d.getDate() + ' ' + MON[d.getMonth()], late: false };
|
|
82
82
|
}
|
|
83
83
|
const initials = (name) => { const w = String(name || '').trim().split(/\s+/).filter(Boolean); return !w.length ? '' : w.length > 1 ? (w[0][0] + w[1][0]).toUpperCase() : w[0].slice(0, 2).replace(/^./, (c) => c.toUpperCase()); };
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
/** A task's state is its only stage (Wawan, 2026-10-25): To do, In progress, Done, Won't do, Archived. An old or Jira 'In review' reads as In progress. */
|
|
85
|
+
export const TASK_STATES = ['To do', 'In progress', 'Done', "Won't do", 'Archived'];
|
|
86
|
+
const stateOf = (s) => (s === 'In review' ? 'In progress' : s);
|
|
87
|
+
/** The initiative's tasks. An Archived task is left out unless o.archived (like an archived initiative). A task carries no workflow stage: the
|
|
88
|
+
* layout's old per-task stage stays stored and is not read. */
|
|
89
|
+
export function taskRows(M, L, now = Date.now(), o = {}) {
|
|
90
|
+
const lay = L || { of: {} };
|
|
91
|
+
return (((M || {}).tasks || {}).rows || []).filter((t) => o.archived || t.state !== 'Archived').map((t) => {
|
|
92
|
+
const state = stateOf(t.state);
|
|
93
|
+
const done = state === 'Done', closed = done || state === "Won't do" || state === 'Archived';
|
|
88
94
|
const jira = /^Jira/.test(t.src || ''), req = /^req:/.test(t.key || '');
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
return { key: t.key, uid: t.uid || '', ref: t.ref || '', pmos: !!t.pmos, jira, req, title: t.title, state: t.state || (req ? '' : 'To do'), done, stage, stageSet: !!(lay.stage || {})[t.key],
|
|
95
|
+
const due = dueOf(t.end, closed, now);
|
|
96
|
+
return { key: t.key, uid: t.uid || '', ref: t.ref || '', pmos: !!t.pmos, jira, req, title: t.title, state: state || (req ? '' : 'To do'), done, closed, wontdo: state === "Won't do",
|
|
92
97
|
owner: t.owner || '', av: initials(t.owner), due: due.text, late: due.late, end: t.end || '', group: (lay.of || {})[t.key] || '', src: t.src || '', blocked: !!t.blocked, canCheck: !!(t.pmos && t.uid) };
|
|
93
98
|
});
|
|
94
99
|
}
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
// a task hangs under no workflow stage (Wawan, 2026-10-25), so there is no "by stage"; a layout that saved 'stage' reads as Your groups
|
|
101
|
+
export const BY_LABEL = { epic: 'Epic', mine: 'Your groups', owner: 'Owner', status: 'Status', none: 'No groups' }; // epic: tk-model.js ticketGroups
|
|
102
|
+
const STATUS = TASK_STATES;
|
|
103
|
+
const shut = (r) => (r.closed != null ? r.closed : r.done);
|
|
104
|
+
const order = (rows) => rows.filter((r) => !shut(r)).concat(rows.filter((r) => shut(r)));
|
|
105
|
+
export function taskGroups(rows, L, by) {
|
|
106
|
+
const lay = L || { names: [] }, b = BY_LABEL[by] ? by : 'mine';
|
|
107
|
+
const g = (key, title, list, o = {}) => ({ key, title, rows: order(list), open: list.filter((r) => !shut(r)).length, ...o });
|
|
101
108
|
if (b === 'none') return [g('all', null, rows)];
|
|
102
109
|
if (b === 'mine') {
|
|
103
110
|
const out = (lay.names || []).map((n) => g('g:' + n, n, rows.filter((r) => r.group === n), { mine: true }));
|
|
@@ -113,14 +120,10 @@ export function taskGroups(rows, L, by, stages) {
|
|
|
113
120
|
const keys = STATUS.concat([...new Set(rows.map((r) => r.state || 'No status').filter((s) => !STATUS.includes(s)))]);
|
|
114
121
|
return keys.map((s) => g('s:' + s, s, rows.filter((r) => (r.state || 'No status') === s))).filter((x) => x.rows.length);
|
|
115
122
|
}
|
|
116
|
-
|
|
117
|
-
const out = st.map((s) => g('t:' + s, s, rows.filter((r) => r.stage === s))).filter((x) => x.rows.length);
|
|
118
|
-
const none = rows.filter((r) => !r.stage || !st.includes(r.stage));
|
|
119
|
-
if (none.length) out.push(g('t:', 'No stage', none));
|
|
120
|
-
return out;
|
|
123
|
+
return [g('all', null, rows)];
|
|
121
124
|
}
|
|
122
125
|
export function listTasks(rows) {
|
|
123
|
-
const open = rows.filter((r) => !r
|
|
126
|
+
const open = rows.filter((r) => !shut(r) && !r.req);
|
|
124
127
|
const top = open.slice().sort((a, b) => (a.end || '9999').localeCompare(b.end || '9999')).slice(0, 3);
|
|
125
128
|
const jira = rows.filter((r) => r.jira).length, reqs = rows.filter((r) => r.req).length;
|
|
126
129
|
return { top, open: open.length, all: rows.length, sub: [plural(rows.length, 'task', 'tasks'), jira ? jira + ' from Jira' : '', reqs ? plural(reqs, 'PRD requirement', 'PRD requirements') : ''].filter(Boolean).join(' · ') };
|
|
@@ -131,21 +134,28 @@ const KIND = { record: 'Record', problem: 'Spec', research: 'Research', rice: 'P
|
|
|
131
134
|
const CHIP = { Record: 'Specs', Spec: 'Specs', PRD: 'Specs', Rubric: 'Specs', BRD: 'Specs', Research: 'Research', Design: 'Design', 'Plan doc': 'Plans', Review: 'Reports', Report: 'Reports', Notes: 'Notes', Slides: 'Slides', Linked: 'Linked', Added: 'Added' };
|
|
132
135
|
const LOOK = new Set(['draft', 'stale', 'due']);
|
|
133
136
|
const PILL = { draft: ['Draft', ''], ok: ['Up to date', 'ok'], live: ['Live', 'ok'], stale: ['Stale', 'w'], due: ['Due', 'w'], linked: ['Linked', ''] };
|
|
134
|
-
|
|
137
|
+
/** The groups documents fall in and the current one: an initiative on a library workflow (D99) groups under its own stages
|
|
138
|
+
* (M.docs.phases, M.docs.cur); Product feature under PHASES, from the stage. */
|
|
139
|
+
export function docPhases(M) {
|
|
135
140
|
const D = (M || {}).docs || {};
|
|
141
|
+
if (Array.isArray(D.phases) && D.phases.length) return { phases: D.phases, cur: D.cur || D.phases[0] };
|
|
142
|
+
return { phases: PHASES, cur: phaseOf(M && M.acts && M.acts.stage) };
|
|
143
|
+
}
|
|
144
|
+
export function docRows(M) {
|
|
145
|
+
const D = (M || {}).docs || {}, { phases } = docPhases(M);
|
|
136
146
|
return (D.rows || []).filter((d) => !d.tech).map((d) => {
|
|
137
147
|
const custom = !!d.custom || /^custom:/.test(d.key || '');
|
|
138
148
|
const kind = custom ? (d.link ? (/Slides/.test(d.link.kind || '') ? 'Slides' : 'Linked') : 'Added') : KIND[d.key] || 'Document';
|
|
139
|
-
const phase =
|
|
149
|
+
const phase = phases.includes(d.cat) ? d.cat : null;
|
|
140
150
|
return { key: d.key, title: d.title, kind, chip: CHIP[kind] || 'Other', core: !custom, phase, st: d.st || 'missing', state: d.state || '', by: d.by || '', when: d.when || (d.added ? 'added ' + d.added : ''), path: d.path || null,
|
|
141
|
-
slot: d.slot || '', act: d.act || null, running: !!d.running, link: d.link || null, look: LOOK.has(d.st), what: d.what || '' };
|
|
151
|
+
slot: d.slot || '', act: d.act || null, running: !!d.running, link: d.link || null, look: LOOK.has(d.st), what: d.what || '', ...(d.other ? { other: true } : {}) };
|
|
142
152
|
});
|
|
143
153
|
}
|
|
144
154
|
/** The pill a document row shows: its state, Skipped (an earlier stage did without it), Not started. */
|
|
145
|
-
export function docPill(d, curPhase) {
|
|
155
|
+
export function docPill(d, curPhase, phases = PHASES) {
|
|
146
156
|
if (d.running) return ['Drafting', ''];
|
|
147
157
|
if (d.st === 'missing') {
|
|
148
|
-
const pi =
|
|
158
|
+
const pi = phases.indexOf(d.phase), ci = phases.indexOf(curPhase);
|
|
149
159
|
return pi >= 0 && ci >= 0 && pi < ci ? ['Skipped', 'dash'] : ['Not started', 'dash'];
|
|
150
160
|
}
|
|
151
161
|
return PILL[d.st] || [d.state || d.st, ''];
|
|
@@ -169,19 +179,22 @@ export function docGroups(rows, stage, o = {}) {
|
|
|
169
179
|
const ks = [...new Set(list.map((d) => d.chip))];
|
|
170
180
|
return ks.map((k) => ({ key: 'k:' + k, title: k, rows: list.filter((d) => d.chip === k) }));
|
|
171
181
|
}
|
|
172
|
-
const
|
|
182
|
+
const P = Array.isArray(o.phases) && o.phases.length ? o.phases : PHASES;
|
|
183
|
+
const cur = o.cur !== undefined ? o.cur : phaseOf(stage), ci = P.indexOf(cur);
|
|
173
184
|
const out = [];
|
|
174
185
|
const take = (key, title, rs, more) => { if (rs.length) out.push({ key, title, rows: rs, ...more }); };
|
|
175
186
|
if (ci < 0) {
|
|
176
|
-
for (const p of
|
|
187
|
+
for (const p of P) take('p:' + p, p, list.filter((d) => d.phase === p));
|
|
177
188
|
} else {
|
|
178
189
|
take('p:' + cur, cur + ' · now', list.filter((d) => d.phase === cur), { now: true });
|
|
179
|
-
for (let i = ci - 1; i >= 0; i--) take('p:' +
|
|
180
|
-
const later = list.filter((d) =>
|
|
190
|
+
for (let i = ci - 1; i >= 0; i--) take('p:' + P[i], P[i], list.filter((d) => d.phase === P[i]), { fold: 2 });
|
|
191
|
+
const later = list.filter((d) => P.indexOf(d.phase) > ci);
|
|
181
192
|
take('p:later-made', 'Ahead', later.filter((d) => d.st !== 'missing'));
|
|
182
193
|
take('p:later', 'Later', later.filter((d) => d.st === 'missing'), { later: true });
|
|
183
194
|
}
|
|
184
|
-
|
|
195
|
+
// documents written under the fixed set before a workflow change stay reachable (D99)
|
|
196
|
+
take('p:other', 'Other documents', list.filter((d) => !d.phase && d.other), { fold: 2 });
|
|
197
|
+
take('p:none', 'Added', list.filter((d) => !d.phase && !d.other));
|
|
185
198
|
return out;
|
|
186
199
|
}
|
|
187
200
|
export function listDocs(rows) {
|
|
@@ -225,6 +225,7 @@ button.hi-pill { cursor: pointer; }
|
|
|
225
225
|
.hm-sct { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--cz-ink3); font-weight: 600; white-space: nowrap; }
|
|
226
226
|
.hm-sct.over { color: var(--cz-risk); }
|
|
227
227
|
.hm-bars.hm-scbars { margin: 10px 0 8px; }
|
|
228
|
+
.hm-bars.hm-scbars i { position: relative; } .hm-bars.hm-scbars i::after { content: ""; position: absolute; inset: -6px 0; } /* a taller hover target for the stage name */
|
|
228
229
|
.hm-bars.hm-scbars i.skip { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--cz-ink3) 40%, transparent) 0 4px, transparent 4px 7px); }
|
|
229
230
|
.hm-scl { border-top: 1px solid var(--cz-hair); padding-top: 8px; margin-top: 2px; }
|
|
230
231
|
.hm-scwhy { margin: 0; padding: 4px 0 2px 34px; font-size: 12.5px; color: var(--cz-ink3); }
|