create-pmos 0.423.0 → 0.424.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 +13 -13
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-products-test.js +16 -3
- package/workspace/changelog.json +12 -0
- package/workspace/guide/claude-proposes.md +37 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/home-pill-test.js +138 -0
- package/workspace/lib/headless.js +14 -1
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/proposal-runs.js +148 -0
- package/workspace/lib/proposals.js +370 -0
- package/workspace/lib/propose-cli.js +96 -0
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-board-premium.js +11 -0
- package/workspace/lib/routes-boards.js +1 -1
- package/workspace/lib/routes-proposals.js +325 -0
- package/workspace/lib/routes-task-links.js +35 -28
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -2
- package/workspace/public/pm/bd-asks.js +3 -0
- package/workspace/public/pm/cozy-today.css +23 -0
- package/workspace/public/pm/cozy-viewer.js +14 -3
- package/workspace/public/pm/cozy-vw-shell.css +8 -0
- package/workspace/public/pm/home-app.js +20 -6
- package/workspace/public/pm/home-task.js +2 -1
- package/workspace/public/pm/home-today.js +66 -16
- package/workspace/public/pm/ini-groups.js +30 -5
- package/workspace/public/pm/ini-links.js +6 -48
- package/workspace/public/pm/ini-props.js +218 -0
- package/workspace/public/pm/ini-view-model.js +6 -1
- package/workspace/public/pm/ini-view.css +47 -0
- package/workspace/public/pm/ini-view.js +23 -6
- package/workspace/public/pm/premium-vw-item.js +2 -1
- package/workspace/public/pm/task-card.css +13 -0
- package/workspace/public/pm/task-card.js +37 -2
- package/workspace/server.js +37 -2
- package/workspace/skills/initiative-propose.skill +45 -0
- package/workspace/stage-card-test.js +1 -1
- package/workspace/task-links-test.js +26 -14
- package/workspace/test-lists/claude-proposes.json +5 -0
- package/workspace/test-lists/home-sessions-pill.json +6 -0
- package/workspace/tk-tasks-test.js +13 -0
|
@@ -94,7 +94,7 @@ const S = {
|
|
|
94
94
|
doneOpen: false, stepsMore: false, sheet: false, rec: {}, pin: new Set(JSON.parse(store.get('pmos.home.pin') || '[]')),
|
|
95
95
|
cardFold: store.get('pmos.home.cardfold') === '1', // the card's checklist folded to one line (AgInitSpec), kept in this browser
|
|
96
96
|
// the one list (premium-uncovered-features): the filter, the picked product, which groups and initiatives are open, kept in this browser
|
|
97
|
-
filter: 'today', product: store.get('pmos.home.product') || null, kidsOff: new Set(), rest: new Set(), cap: false, day: false,
|
|
97
|
+
filter: 'today', product: store.get('pmos.home.product') || null, kidsOff: new Set(), rest: new Set(), cap: false, day: false, ses: null,
|
|
98
98
|
pg: (() => { try { return JSON.parse(store.get('pmos.home.pg') || '{}') || {}; } catch { return {}; } })(),
|
|
99
99
|
eodHidden: store.get('pmos.home.eod') === L.dayOf(), phoneChat: false,
|
|
100
100
|
};
|
|
@@ -267,13 +267,10 @@ function homeListHtml() {
|
|
|
267
267
|
const M = L.homeList(S.D, { now: NOW(), filter: S.filter, product: S.product && L.productsOf(S.D).some((p) => p.key === S.product) ? S.product : null });
|
|
268
268
|
S.M = M;
|
|
269
269
|
const R = L.reviewModel(S.D, NOW());
|
|
270
|
-
// the first initiative where it is your turn shows what is under it, until the PM closes it
|
|
271
|
-
const firstTurn = M.groups.filter((g) => g.kind === 'product' || g.kind === 'program').flatMap((g) => g.inis).find((x) => x.turn);
|
|
272
|
-
const open = (id) => S.kids.has(id) || (!!firstTurn && firstTurn.id === id && !S.kidsOff.has(id));
|
|
273
270
|
// a group is open until the PM folds it; another product starts folded; "Not in an initiative" starts folded on a phone (HvAC, HvACDesk)
|
|
274
271
|
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));
|
|
275
272
|
return TD.listHtml(M, todayModel(), {
|
|
276
|
-
sel: S.sel || (S.ini && S.ini !== 'product' ? 'i:' + S.ini : null), selHead: S.head,
|
|
273
|
+
sel: S.sel || (S.ini && S.ini !== 'product' ? 'i:' + S.ini : null), selHead: S.head, ses: S.ses, 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] : '',
|
|
277
274
|
product: S.product, review: R, mic: canDictate(), phone: isPhone(), day: S.day, top: S.ready ? RECROW.html() + MEN.rowHtml(S.D, { sel: S.sel }) : '',
|
|
278
275
|
});
|
|
279
276
|
}
|
|
@@ -1431,7 +1428,11 @@ $('#hmDesk').onclick = (e) => { if (S.sheet && e.target === $('#hmDesk')) sheet(
|
|
|
1431
1428
|
$('#hmList').onclick = (e) => { // delegated: every press on the list is a <button>
|
|
1432
1429
|
const b = e.target.closest('button'); if (!b) return;
|
|
1433
1430
|
const d = b.dataset;
|
|
1434
|
-
if (d.
|
|
1431
|
+
if (d.hmSes) { sesPill(d.hmSes === S.ses ? null : d.hmSes); return; } // an initiative's pill: what sits in it, under it (a sheet on a phone)
|
|
1432
|
+
if ('hmSesx' in d) { sesPill(null); return; }
|
|
1433
|
+
if (d.hmSesnew) { sesPill(null, false); newIn(d.hmSesnew); return; }
|
|
1434
|
+
if (S.ses && !b.closest('.hv-spp, .hv-sps')) sesPill(null, false); // a press anywhere else in the list closes it
|
|
1435
|
+
if (d.hmSel) { if (S.ses) sesPill(null, false); if (S.day) S.day = false; select(d.hmSel); return; }
|
|
1435
1436
|
if ('hrMentions' in d) { if (S.day) S.day = false; S.sel = 'mentions'; drawList(); MEN.openMentions(menCtx()); return; }
|
|
1436
1437
|
if ('hmDay' in d) { day(!S.day); return; }
|
|
1437
1438
|
if ('hmDayx' in d) { day(false); return; }
|
|
@@ -1462,6 +1463,19 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
|
|
|
1462
1463
|
if (d.hmRecopen) { openMeeting({ note: d.hmRecopen }); return; }
|
|
1463
1464
|
};
|
|
1464
1465
|
$('#hmList').addEventListener('keydown', (e) => { if (e.key === 'Escape' && e.target.id === 'hmCap' && S.cap) { e.stopPropagation(); S.cap = false; drawList(); } else if (e.key === 'Escape' && S.day) { e.stopPropagation(); day(false); } });
|
|
1466
|
+
/** Open (id) or close (null) the list behind an initiative's pill (batch 12 item 6). Closing gives the focus back to the pill, unless the
|
|
1467
|
+
* press that closed it goes somewhere else (back false). */
|
|
1468
|
+
function sesPill(id, back = true) {
|
|
1469
|
+
const was = S.ses;
|
|
1470
|
+
S.ses = id || null;
|
|
1471
|
+
drawList();
|
|
1472
|
+
const f = id ? $('#hmList .hv-spp .hm-rm, #hmList .hv-sps .hm-rm') : back && was ? $(`#hmList [data-hm-ses="${CSS.escape(was)}"]`) : null;
|
|
1473
|
+
if (f) f.focus();
|
|
1474
|
+
}
|
|
1475
|
+
// Escape closes it wherever the focus is (a redraw of the list can drop the focus to the page); a press outside the list closes it too
|
|
1476
|
+
window.addEventListener('keydown', (e) => { if (e.key === 'Escape' && S.ses && menuEl.hidden) { e.preventDefault(); e.stopPropagation(); sesPill(null); } }, true); // before the Viewer's own Escape
|
|
1477
|
+
// a press outside the list (the chat, the Viewer) closes an open pill list too
|
|
1478
|
+
document.addEventListener('pointerdown', (e) => { if (S.ses && !e.target.closest('#hmList')) sesPill(null, false); });
|
|
1465
1479
|
$('#hmList').addEventListener('submit', async (e) => { // the capture box: Enter adds the task
|
|
1466
1480
|
if (e.target.id !== 'hmCapF') return;
|
|
1467
1481
|
e.preventDefault();
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* status, the dates, the owner and the notes, and its move icon the section, the group or the initiative. Every write is the board's own route and is the PM's press; each says so
|
|
7
7
|
* in a toast with Undo, and a refusal shows the route's reason and changes nothing. Talk it through in chat is under ⋯ (the chat is beside
|
|
8
8
|
* the Viewer on Home). The PM's own items (a note, a mention made into a task) open in My work's item view (home-work.js). */
|
|
9
|
-
import { taskOf, checkOf, mountCard, boardSaver, cardStyle, placeOf } from './task-card.js';
|
|
9
|
+
import { taskOf, checkOf, mountCard, boardSaver, cardStyle, placeOf, historyFor } from './task-card.js';
|
|
10
10
|
|
|
11
11
|
/** h: { VW, pmPost, toast, toastUndo?, now, ws, board, iniTitle(id), openIni(id), askInChat(task), onChange(), rename?(task),
|
|
12
12
|
* owners?() → [names], inis?() → [{ id, title }] } */
|
|
@@ -41,6 +41,7 @@ export function openTask(task, h) {
|
|
|
41
41
|
inis: () => (h.inis ? h.inis() : []),
|
|
42
42
|
groups: () => (layout ? layout.names || [] : null),
|
|
43
43
|
sections: () => sections,
|
|
44
|
+
history: historyFor({ ws, board, t, post: (p, b) => h.pmPost(p, b) }), // what Claude changed with your ✓ (batch 12, TpA6)
|
|
44
45
|
});
|
|
45
46
|
},
|
|
46
47
|
});
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* The list column, top to bottom: one header line ("Good morning" with a chevron that opens Your day, the product picker when Home reads
|
|
5
5
|
* more than one product, on a desktop the filter icon for Kept and Done, New), the "N are yours" line, the Today card only while the day has
|
|
6
6
|
* a moment (a recording, a meeting soon or on now, the end of the day, the weekly review open), each program's group, then each product's
|
|
7
|
-
* group (an initials tile, the name, the goal dots, a chevron; one-line rows with the stage track on the right; sessions,
|
|
8
|
-
* meetings
|
|
7
|
+
* group (an initials tile, the name, the goal dots, a chevron; one-line rows with the stage track on the right; an initiative's sessions,
|
|
8
|
+
* next steps and meetings sit in a pill on its row that lists them on a press; its tasks are on its page in the Viewer, not here), and "Not in an initiative" as a folded line. Your day (dayHtml) is a sheet over the list: the date
|
|
9
9
|
* and the day's meetings, Your move with its count, and This week with the Weekly review. Every group folds; home-app.js keeps the folds.
|
|
10
10
|
* The model is home-list.js (pure). This file only turns it into HTML: every control is a <button> (or the capture form) with a data-hm-*
|
|
11
11
|
* press that home-app.js handles. Text from the records goes through esc(). */
|
|
@@ -56,14 +56,14 @@ const MS = '<span class="hv-ms" role="img" aria-label="Milestone" title="Milesto
|
|
|
56
56
|
/** A row of the list: a next step, a task, a note, a mention, a session or a meeting. o: { sel, kid } */
|
|
57
57
|
export function rowHtml(r, o) {
|
|
58
58
|
const sel = o.sel === r.id;
|
|
59
|
-
const cls = ['hm-r', 'hv-r', o.kid ? 'kid' : '', sel ? 'sel' : '', 'st-' + (r.state || 'quiet'), r.kind === 'task' ? 'task' : '', r.kind === 'item' ? 'item' : '', r.done ? 'done' : ''].filter(Boolean).join(' ');
|
|
59
|
+
const cls = ['hm-r', 'hv-r', o.kid ? 'kid' : '', o.sub ? 'two' : '', sel ? 'sel' : '', 'st-' + (r.state || 'quiet'), r.kind === 'task' ? 'task' : '', r.kind === 'item' ? 'item' : '', r.done ? 'done' : ''].filter(Boolean).join(' ');
|
|
60
60
|
const lead = isCheck(r) ? checkHtml(r) : '';
|
|
61
61
|
// ending a session and putting a next step off stay on the row, shown on the row that is open (the frame draws neither)
|
|
62
62
|
const end = !sel ? '' : r.kind === 'session' && r.sid ? `<button type="button" class="ut-ib hm-x" data-hm-end="${esc(r.id)}" aria-label="End ${esc(r.name)}" title="End this session">${svg(P.x, 14)}</button>`
|
|
63
63
|
: r.kind === 'need' && r.row && r.row.kind !== 'source' ? `<button type="button" class="ut-ib hm-x" data-hm-end="${esc(r.id)}" aria-label="Put off ${esc(r.name)} until tomorrow" title="Put off until tomorrow">${svg(P.x, 14)}</button>` : '';
|
|
64
64
|
const link = r.link && r.kind === 'loose-rec' ? '<span class="hv-st">Link it</span>' : '';
|
|
65
65
|
return `<div class="${cls}" data-id="${esc(r.id)}">${lead}<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${sel ? ' aria-current="true"' : ''}${r.hint ? ` title="${esc(r.hint)}"` : ''}>${lead ? '' : markHtml(r)}`
|
|
66
|
-
+ `<span class="hm-rt${r.ms ? ' ms' : ''}"><b>${esc(r.name)}</b>${r.ms ? MS : ''}</span>${clock(r.when || whenOf(r))}${link}</button>${end}</div>`;
|
|
66
|
+
+ `<span class="hm-rt${r.ms ? ' ms' : ''}"><b>${esc(r.name)}</b>${r.ms ? MS : ''}${o.sub ? `<em>${esc(o.sub)}</em>` : ''}</span>${o.sub ? '' : clock(r.when || whenOf(r))}${link}</button>${end}</div>`;
|
|
67
67
|
}
|
|
68
68
|
/** The chat's header line on a desktop (HvACDesk .ch): the open row's mark, its title and the chip of where it sits (the initiative's stage
|
|
69
69
|
* track and name, or the program's tile and name). h: { row, title, scope, at, stage, prog }. A chip that repeats the title is left out, and
|
|
@@ -79,15 +79,62 @@ export function chatHeadHtml(h) {
|
|
|
79
79
|
const name = h.titleHtml ? `<span class="hm-chn">${h.titleHtml}</span>` : `<b class="hm-chb">${esc(h.title)}</b>`;
|
|
80
80
|
return `${mk}${same ? lead : ''}${name}${same && !h.prog ? track(h.at == null ? -1 : h.at, h.stage || '', h.steps) : ''}${chip}`;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
*
|
|
82
|
+
/* ── what sits in an initiative: the pill on its row (batch 12 item 6, canvas HsA1Desk, HsA2Phone, HsA3Sheet) ──
|
|
83
|
+
* Sessions, next steps and today's meetings no longer nest under the initiative (Wawan, 2026-10-26: Home grew too long). The row keeps one
|
|
84
|
+
* line; a pill on it shows the most urgent mark of what sits in it and how many: a blue dot (and a blue number) when one waits on you, amber
|
|
85
|
+
* when one is blocked, a ring when one runs, a clock for a meeting today, else a grey dot. A press lists them right under the pill (a sheet on
|
|
86
|
+
* a phone), each with its mark and one quiet line; a press on one opens it as the nested row did; + starts a new session in the initiative. */
|
|
87
|
+
const RANKED = ['needs', 'blocked', 'working', 'meeting', 'quiet'];
|
|
88
|
+
const kidState = (k) => (k.kind === 'meeting' && k.state !== 'working' ? 'meeting' : k.step ? 'needs' : RANKED.includes(k.state) ? k.state : 'quiet');
|
|
89
|
+
const KID_WORD = { needs: 'Asks you', blocked: 'Blocked, asks you', working: 'Running', quiet: 'Open' };
|
|
90
|
+
/** The quiet line under one row of the list: what it is and where it stands, in words (the mark says it again by shape). */
|
|
91
|
+
export function kidSub(k) {
|
|
92
|
+
if (k.kind === 'meeting') return k.hint || 'Meeting';
|
|
93
|
+
if (k.step) return k.hint || 'Next step';
|
|
94
|
+
return [KID_WORD[kidState(k)] || 'Open', k.kind === 'session' && k.hint ? k.hint : ''].filter(Boolean).join(' · ');
|
|
95
|
+
}
|
|
96
|
+
/** The pill's model: the most urgent state, the count and its accessible words. Nothing in the initiative: null (zero is silence). */
|
|
97
|
+
export function pillOf(r) {
|
|
98
|
+
const kids = (r && r.kids) || [];
|
|
99
|
+
if (!kids.length) return null;
|
|
100
|
+
const st = kids.map(kidState);
|
|
101
|
+
const top = RANKED.find((x) => st.includes(x));
|
|
102
|
+
const n = (x) => st.filter((y) => y === x).length;
|
|
103
|
+
const words = [n('needs') + n('blocked') ? (n('needs') + n('blocked')) + ' waits on you' : '', n('working') ? n('working') + ' running' : '', n('meeting') ? plural(n('meeting'), 'meeting today', 'meetings today') : '', n('quiet') ? n('quiet') + ' open' : ''].filter(Boolean).join(', ');
|
|
104
|
+
return { top, n: kids.length, say: plural(kids.length, 'thing', 'things') + ' in ' + r.name + ': ' + words };
|
|
105
|
+
}
|
|
106
|
+
/** The pill's key: the group and the row, since two products can hold an initiative with the same id. */
|
|
107
|
+
const sesKey = (r, o) => (o.gk || '') + '|' + r.id;
|
|
108
|
+
const pillMark = (top) => (top === 'meeting' ? svg(P.clock, 13) : `<i class="hv-pm ${top}" aria-hidden="true"></i>`);
|
|
109
|
+
function pillHtml(r, o) {
|
|
110
|
+
const m = pillOf(r);
|
|
111
|
+
if (!m) return '';
|
|
112
|
+
const on = o.ses === sesKey(r, o);
|
|
113
|
+
return `<button type="button" class="hv-sp ${m.top}${on ? ' on' : ''}" data-hm-ses="${esc(sesKey(r, o))}" aria-haspopup="dialog" aria-expanded="${on}" aria-label="${esc(m.say)}. ${on ? 'Hide' : 'Show'}" title="${esc(m.say)}">${pillMark(m.top)}<span class="n">${m.n}</span></button>`;
|
|
114
|
+
}
|
|
115
|
+
/** The list behind the pill: the rows that used to nest, waiting first, then + for a new session here. */
|
|
116
|
+
function sesListHtml(r, o) {
|
|
117
|
+
const kids = r.kids.slice().sort((a, b) => RANKED.indexOf(kidState(a)) - RANKED.indexOf(kidState(b)));
|
|
118
|
+
return kids.map((k) => rowHtml(k, { ...o, kid: false, sub: kidSub(k) })).join('')
|
|
119
|
+
+ `<div class="hv-spf"><button type="button" class="ut-ib hv-ib" data-hm-sesnew="${esc(r.ini || '')}" aria-label="New session in ${esc(r.name)}" title="New session here">${svg(P.plus, 18)}</button></div>`;
|
|
120
|
+
}
|
|
121
|
+
/** On a phone the list is a sheet over Home (as Your day was): the initiative's name and stage track on top. M is homeList(). */
|
|
122
|
+
export function sesSheetHtml(M, o) {
|
|
123
|
+
const g = o.ses && M.groups.find((x) => o.ses.startsWith(x.key + '|'));
|
|
124
|
+
const r = g && (g.inis || []).concat(g.rest || []).find((x) => o.ses === g.key + '|' + x.id);
|
|
125
|
+
if (!r || !r.kids.length) return '';
|
|
126
|
+
return `<button type="button" class="hv-scrim" data-hm-sesx tabindex="-1" aria-label="Close"></button><section class="hv-sheet hv-sps" data-esc-layer role="dialog" aria-label="In ${esc(r.name)}" tabindex="-1"><div class="hv-grab" aria-hidden="true"></div>`
|
|
127
|
+
+ `<div class="hv-sbar"><b>${esc(r.name)}</b>${track(r.at, r.stage, r.steps)}<button type="button" class="ut-ib hv-ib" data-hm-sesx aria-label="Close" title="Close">${svg(P.x, 20)}</button></div>`
|
|
128
|
+
+ `<div class="hv-sc">${sesListHtml(r, o)}</div></section>`;
|
|
129
|
+
}
|
|
130
|
+
/** An initiative row: its mark, its title, the pill of what sits in it, and the stage track. The title (and the track) open the initiative;
|
|
131
|
+
* the pill lists what is in it. On a desktop the list opens right under the pill; on a phone it is a sheet (sesSheetHtml). */
|
|
84
132
|
function iniHtml(r, o, po) {
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
+ `<span class="hm-rt"><b>${esc(r.name)}</b></span>${badge}${track(r.at, r.stage, r.steps)}</button>${chev}</div>${nest}`;
|
|
133
|
+
const on = o.ses === sesKey(r, o) && !o.phone && r.kids.length;
|
|
134
|
+
const pop = on ? `<div class="hv-spp" data-esc-layer role="dialog" aria-label="In ${esc(r.name)}">${sesListHtml(r, o)}</div>` : '';
|
|
135
|
+
const t = track(r.at, r.stage, r.steps);
|
|
136
|
+
return `<div class="hm-r hv-r ini st-${esc(r.state)}${o.sel === r.id ? ' sel' : ''}${on ? ' sp-on' : ''}" data-id="${esc(r.id)}"${po ? ` data-po-id="${esc(r.ini || r.id)}"` : ''}>${po ? gripHtml(r.name) : ''}<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${o.sel === r.id ? ' aria-current="true"' : ''} title="${esc(r.hint)}">${markHtml(r.yours && r.state !== 'blocked' ? { state: 'needs' } : r)}`
|
|
137
|
+
+ `<span class="hm-rt"><b>${esc(r.name)}</b></span></button>${pillHtml(r, o)}${t ? `<button type="button" class="hv-tk" data-hm-sel="${esc(r.id)}" tabindex="-1" aria-hidden="true">${t}</button>` : ''}${pop}</div>`;
|
|
91
138
|
}
|
|
92
139
|
|
|
93
140
|
/* ── a group (HvAC .pg, .card; PgHomePhone .psub) ── */
|
|
@@ -109,7 +156,7 @@ function productHtml(g, o) {
|
|
|
109
156
|
const restAll = o.restOpen(g.key);
|
|
110
157
|
const rest = restAll ? g.rest : g.rest.slice(0, Math.max(0, QUIET - g.inis.length));
|
|
111
158
|
const more = g.rest.length - rest.length;
|
|
112
|
-
const body = flat + g.inis.concat(rest).map((r) => iniHtml(r, o)).join('')
|
|
159
|
+
const body = flat + g.inis.concat(rest).map((r) => iniHtml(r, { ...o, gk: g.key })).join('')
|
|
113
160
|
+ (more > 0 ? `<button type="button" class="hv-fold" data-hm-rest="${esc(g.key)}" aria-expanded="false" aria-label="${more} more ${more === 1 ? 'initiative' : 'initiatives'} with nothing today. Show"><span class="hv-mk"></span>${more} more${svg(P.chevD, 16)}</button>`
|
|
114
161
|
: restAll && g.rest.length > QUIET ? `<button type="button" class="hv-fold" data-hm-rest="${esc(g.key)}" aria-expanded="true"><span class="hv-mk"></span>Fewer${svg(P.chevU, 16)}</button>` : '');
|
|
115
162
|
return `<section class="hm-pg hv-g" aria-label="${esc(g.name)}">${head}<div class="hv-card">${body || `<p class="hm-none">${g.primary ? 'No initiative is open on this board.' : 'Nothing is open here.'}</p>`}</div></section>`;
|
|
@@ -129,7 +176,10 @@ function programHtml(g, o) {
|
|
|
129
176
|
+ `<button type="button" class="hv-pf" data-hm-pg="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(g.name)}. ${esc(line)}${g.yours ? '. ' + yoursWords(g) : ''}. ${open ? 'Close' : 'Open'} the group">${ms}<span class="hv-cv">${svg(open ? P.chevD : P.chevR, 16)}</span></button></div>`;
|
|
130
177
|
if (!open) return `<section class="hm-pg hv-g prg" aria-label="${esc(g.name)}">${head}</section>`;
|
|
131
178
|
// the program's tasks are on its panel (On the program), not on Home: Home lists no tasks (Wawan, 2026-10-25)
|
|
132
|
-
|
|
179
|
+
// a product's sub-heading only when the program's rows on Home come from two or more products (batch 12 item 6): one product repeated
|
|
180
|
+
// under every program said nothing
|
|
181
|
+
const many = g.subs.length > 1;
|
|
182
|
+
const body = g.subs.map((x) => `${many ? `<div class="hv-psub" role="heading" aria-level="3"><span class="hv-st2 t${x.tone}" aria-hidden="true">${esc(x.initials)}</span>${esc(x.name)}</div>` : ''}<div class="po-list" data-po-list="${esc(g.program.id)}">${x.inis.map((r) => iniHtml(r, { ...o, gk: g.key }, true)).join('')}</div>`).join('');
|
|
133
183
|
return `<section class="hm-pg hv-g prg" aria-label="${esc(g.name)}">${head}<div class="hv-card">${body || `<p class="hm-none">${(g.program.members || []).length ? 'No open initiatives' : 'No initiatives yet'}. Open the program to move some in.</p>`}</div></section>`;
|
|
134
184
|
}
|
|
135
185
|
/** "Not in an initiative" (HvAC .lh): a line under the groups. Folded it shows a blue dot when a row waits on you, an amber square when one
|
|
@@ -191,7 +241,7 @@ export function todayHtml(T, o) {
|
|
|
191
241
|
const MONTH = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
192
242
|
const WEEKDAY = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
193
243
|
const MOMENT = new Set(['rec', 'soon', 'live', 'eod', 'review']);
|
|
194
|
-
/** M is homeList(); T todayCard(); o: { sel,
|
|
244
|
+
/** M is homeList(); T todayCard(); o: { sel, ses (the initiative row whose pill is open), pOpen, restOpen, pin, avHtml, ready, err, product (the picked key), review, phone, day (Your day is open) } */
|
|
195
245
|
export function listHtml(M, T, o) {
|
|
196
246
|
const many = M.products.length > 1;
|
|
197
247
|
const picked = o.product ? M.products.find((p) => p.key === o.product) : null;
|
|
@@ -218,7 +268,7 @@ export function listHtml(M, T, o) {
|
|
|
218
268
|
if (o.cap) body += `<form class="hm-cap" id="hmCapF"><label class="vh" for="hmCap">Add a task to your own list</label><input id="hmCap" autocomplete="off" maxlength="250" placeholder="A task for your own list. Esc to cancel">`
|
|
219
269
|
+ (o.mic ? `<button type="button" class="ut-ib" data-hm-capmic aria-label="Say it instead" title="Say it instead">${svg(P.mic, 16)}</button>` : '') + '</form>';
|
|
220
270
|
}
|
|
221
|
-
return head + card + `<div class="hv-body">${o.top || ''}${body}</div
|
|
271
|
+
return head + card + `<div class="hv-body">${o.top || ''}${body}</div>` + (o.phone && o.ses && !M.list ? sesSheetHtml(M, o) : ''); // o.top: the pinned recording row and Mentions (home-rec-row.js, home-mentions.js)
|
|
222
272
|
}
|
|
223
273
|
/** Your day (HvAOpen): a sheet over the list from "Good morning". The date, the day's meetings and their load (a press opens the calendar,
|
|
224
274
|
* or the day's moment card on a phone), Your move with its count, This week with the Weekly review (and the untouched work it looks at).
|
|
@@ -24,14 +24,26 @@ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&':
|
|
|
24
24
|
const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
25
25
|
const P = {
|
|
26
26
|
layers: 'M3 7l9-4 9 4-9 4zM3 12l9 4 9-4M3 17l9 4 9-4', send: 'M4 12l16-8-6 16-3-7zM11 13l9-9', more: 'M5 12h.01M12 12h.01M19 12h.01',
|
|
27
|
-
check: 'M5 12l5 5 9-10', plus: 'M12 5v14M5 12h14', tk: 'M12 3l9 9-9 9-9-9z', draft: 'M12 3v4M12 17v4M3 12h4M17 12h4M5.6 5.6l2.8 2.8M15.6 15.6l2.8 2.8M5.6 18.4l2.8-2.8M15.6 8.4l2.8-2.8',
|
|
27
|
+
check: 'M5 12l5 5 9-10', x: 'M6 6l12 12M18 6L6 18', plus: 'M12 5v14M5 12h14', tk: 'M12 3l9 9-9 9-9-9z', draft: 'M12 3v4M12 17v4M3 12h4M17 12h4M5.6 5.6l2.8 2.8M15.6 15.6l2.8 2.8M5.6 18.4l2.8-2.8M15.6 8.4l2.8-2.8',
|
|
28
28
|
};
|
|
29
29
|
const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
|
|
30
30
|
const LAY = new Map(); // initiative id → its layout (GET /api/initiative-layout), as the last read or write answered
|
|
31
31
|
const TK = new Map(); // initiative id → its drafted tickets (GET /api/jira/tickets)
|
|
32
32
|
const READING = new Set(); // 'L|id', 'T|id' while a read is on its way
|
|
33
|
+
const ONLY = new Map(); // initiative id → { key, name }: the stage the stage card showed while Tasks is grouped another way (batch 12 item 0)
|
|
33
34
|
/** For the tests: forget every read. */
|
|
34
|
-
export const resetGroups = () => { LAY.clear(); TK.clear(); READING.clear(); };
|
|
35
|
+
export const resetGroups = () => { LAY.clear(); TK.clear(); READING.clear(); ONLY.clear(); };
|
|
36
|
+
/** The stage card pressed while Tasks is grouped another way: Tasks keeps its grouping and shows that stage's tasks only. true when that
|
|
37
|
+
* applies (the grouping is not Stage); with Stage the caller opens the stage's own section as before. */
|
|
38
|
+
export function onlyStage(id, key) {
|
|
39
|
+
if (!idOk(id) || byOf(id) === 'stage') return false;
|
|
40
|
+
ONLY.set(id, { key: key == null ? '' : String(key), name: '' });
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
/** The stage sections whose key is `key`, from the WBS (a folded line's stages included). */
|
|
44
|
+
const stagesOf = (S, key) => S.flatMap((s) => (s.stages ? s.stages : [s])).filter((s) => (s.key || '') === key);
|
|
45
|
+
/** A section left with nothing to show under the filter. */
|
|
46
|
+
const bare = (s) => !(s.top && s.top.length) && !(s.groups && s.groups.length) && !(s.done && s.done.length) && !(s.archived && s.archived.length) && !s.tk && !s.jira && !s.tkEmpty;
|
|
35
47
|
|
|
36
48
|
const idOk = (id) => /^[A-Za-z0-9][A-Za-z0-9._-]{0,80}$/.test(String(id || ''));
|
|
37
49
|
const atOf = (H) => (H && H.where ? H.where() || {} : {});
|
|
@@ -67,13 +79,25 @@ export function view(v) {
|
|
|
67
79
|
if (!idOk(id) || !v.tasks || v.tasks.empty) return v;
|
|
68
80
|
const by = byOf(id);
|
|
69
81
|
if (by === 'stage') return { ...v, tasks: { ...v.tasks, by } };
|
|
70
|
-
const
|
|
71
|
-
|
|
82
|
+
const f = ONLY.get(id), keep = f ? stagesOf(v.tasks.sections || [], f.key) : null;
|
|
83
|
+
if (f && !keep.length) ONLY.delete(id); // the stage is gone from the view: show every task again
|
|
84
|
+
if (!f || !keep.length) {
|
|
85
|
+
const { sections, sum } = groupSections(v.tasks, by, LAY.get(id), TK.get(id));
|
|
86
|
+
return { ...v, tasks: { ...v.tasks, by, sections, gsum: sum } };
|
|
87
|
+
}
|
|
88
|
+
f.name = keep[0].name || keep[0].label || 'Not in a stage';
|
|
89
|
+
// the Jira tickets (By epic's groups) are the work of the stage that carries them; another stage shows its own tasks only
|
|
90
|
+
const withJira = keep.some((s) => s.jira);
|
|
91
|
+
const { sections, sum } = groupSections({ ...v.tasks, sections: keep }, by, LAY.get(id), withJira ? TK.get(id) : null);
|
|
92
|
+
const shown = sections.filter((s) => (s.kind === 'epic' ? withJira : !bare(s)));
|
|
93
|
+
return { ...v, tasks: { ...v.tasks, by, sections: shown, gsum: withJira ? sum : null, only: f.name } };
|
|
72
94
|
}
|
|
73
95
|
export function headHtml(v) {
|
|
74
96
|
if (!v || !idOk(v.id) || !v.tasks || v.tasks.empty) return '';
|
|
75
97
|
const by = v.tasks.by || 'stage';
|
|
76
|
-
|
|
98
|
+
// the stage the card showed: its name and a ✕ that shows every stage again (filters earn space: only while one is on)
|
|
99
|
+
const only = v.tasks.only ? `<button type="button" class="ig-only" data-ig-all aria-label="${esc('Showing ' + v.tasks.only + ' only. Show every stage')}" title="Show every stage">${esc(v.tasks.only)}${SVG(P.x, 14, 2)}</button>` : '';
|
|
100
|
+
return only + `<button type="button" class="iv-ib ig-by${by !== 'stage' ? ' on' : ''}" data-ig-by aria-haspopup="menu" aria-label="Group tasks by" title="${esc('Group tasks by · ' + GROUP_BY[by])}">${SVG(P.layers, 18)}</button>`;
|
|
77
101
|
}
|
|
78
102
|
export function sumHtml(v) {
|
|
79
103
|
const s = v && v.tasks && v.tasks.gsum; if (!s) return '';
|
|
@@ -191,6 +215,7 @@ export function press(b, d, root, H) {
|
|
|
191
215
|
const id = root && root.dataset.iv; if (!idOk(id)) return false;
|
|
192
216
|
if ('igBy' in d) { if (POP && POP.anchor === b) closePop(); else groupMenu(b, id, H); return true; }
|
|
193
217
|
if (d.igGmore) { groupMore(b, id, H, d.igGmore); return true; }
|
|
218
|
+
if ('igAll' in d) { ONLY.delete(id); if (H.redraw) H.redraw(); return true; }
|
|
194
219
|
if (d.igSend != null) { send(id, H, { group: d.igSend }); return true; }
|
|
195
220
|
if ('igSendall' in d) { send(id, H); return true; }
|
|
196
221
|
if (d.igTk) { openTk(id, H, d.igTk); return true; }
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
*
|
|
6
6
|
* of(v) → the links view to draw for the one view's model (the newest of the Board's read and a write's answer), with a
|
|
7
7
|
* title for every task; null while a draft is shown (Claude adjusts Live only)
|
|
8
|
-
* headHtml(lk) the Tasks header's chips, each hidden at zero: the
|
|
9
|
-
*
|
|
8
|
+
* headHtml(lk) the Tasks header's chips, each hidden at zero: the grey ✦ (the quiet moves since last seen; an orange dot when
|
|
9
|
+
* something waits on you), the orange late count. Claude's link proposals moved under the initiative's one blue ✦
|
|
10
|
+
* after its title (batch 12 items 2 and 3, pm/ini-props.js)
|
|
11
|
+
* taskTitle(id, uid) a task's title from the links view drawn last (pm/ini-props.js names the tasks of a link proposal)
|
|
10
12
|
* barExtra(x, lk, quick) what a Timeline bar carries: its two link dots (grey when that end is linked), the orange start edge of a task that
|
|
11
13
|
* waits on a late one, the small blue ✦ of a quiet move not yet seen
|
|
12
14
|
* dataOf(lk) the Timeline's links, for the drawing (data-lk on .ivt)
|
|
@@ -77,6 +79,7 @@ export function of(v) {
|
|
|
77
79
|
return out;
|
|
78
80
|
}
|
|
79
81
|
const nameOf = (lk, uid) => { const t = lk && lk.T.get(uid); return t ? t.title : uid; };
|
|
82
|
+
export const taskTitle = (id, uid) => nameOf(VIEWS.get(id), uid);
|
|
80
83
|
const waitsOn = (lk, uid) => (lk ? lk.links.filter((l) => l.to === uid) : []);
|
|
81
84
|
const thenOf = (lk, uid) => (lk ? lk.links.filter((l) => l.from === uid) : []);
|
|
82
85
|
|
|
@@ -84,8 +87,6 @@ const thenOf = (lk, uid) => (lk ? lk.links.filter((l) => l.from === uid) : []);
|
|
|
84
87
|
export function headHtml(lk) {
|
|
85
88
|
if (!lk) return '';
|
|
86
89
|
let h = '';
|
|
87
|
-
const np = (lk.proposals || []).length;
|
|
88
|
-
if (np) h += `<button type="button" class="lk-chip pr" data-lk-chip="prop" aria-haspopup="dialog" aria-expanded="${OPEN === 'prop:' + lk.id}" aria-label="${esc('Claude proposes ' + plural(np, 'change', 'changes') + ' to the links. Open')}" title="Claude proposes">${SVG(PL.spark, 14, 2)}<b>${np}</b></button>`;
|
|
89
90
|
const nm = lk.moved ? lk.moved.n : 0, na = (lk.asks || []).filter((a) => !a.sent).length;
|
|
90
91
|
if (nm || na) h += `<button type="button" class="lk-chip mv" data-lk-chip="moved" aria-haspopup="dialog" aria-expanded="false" aria-label="${esc((nm ? 'Claude moved ' + plural(nm, 'task', 'tasks') + ' to keep your links' : '') + (nm && na ? '; ' : '') + (na ? plural(na, 'thing waits', 'things wait') + ' on you' : '') + '. Open')}" title="Kept in line">${SVG(PL.spark, 14, 2)}${nm ? `<b>${nm}</b>` : ''}${na ? '<i class="lk-ask" aria-hidden="true"></i>' : ''}</button>`;
|
|
91
92
|
const nl = (lk.late || []).length;
|
|
@@ -349,48 +350,6 @@ async function ownMove(H, id, uid, patch) {
|
|
|
349
350
|
return true;
|
|
350
351
|
}
|
|
351
352
|
|
|
352
|
-
/* ── the blue ✦: Claude's proposals, ✓ each, Add all, ✕ for good ── */
|
|
353
|
-
function propHtml(lk) {
|
|
354
|
-
const P = lk.proposals || [];
|
|
355
|
-
const nl = P.filter((p) => p.kind === 'link').length;
|
|
356
|
-
const head = nl === P.length ? 'Claude proposes ' + plural(nl, 'link', 'links') : 'Claude proposes';
|
|
357
|
-
const row = (p) => {
|
|
358
|
-
let ic, t, s;
|
|
359
|
-
if (p.kind === 'link') { ic = SVG(PL[p.type] || PL.fs, 16, 1.8); t = `${esc(clip(nameOf(lk, p.from), 30))} ${SVG('M5 12h14M13 6l6 6-6 6', 12, 2.2)} ${esc(clip(nameOf(lk, p.to), 30))}`; s = p.why; }
|
|
360
|
-
else if (p.kind === 'pull') { ic = SVG(PL.undo, 16, 1.8); t = esc('Pull ' + plural(p.tasks.length, 'task', 'tasks') + ' in by ' + plural(p.days, 'day', 'days')); s = p.why + ': ' + p.tasks.map((u) => clip(nameOf(lk, u), 30)).join(', '); }
|
|
361
|
-
else { ic = SVG(PL.cal, 16, 1.8); t = esc('Move ' + plural(p.tasks.length, 'task', 'tasks') + ' to keep your links'); s = p.tasks.map((m) => clip(m.title || nameOf(lk, m.task), 26) + ' ' + span(m.to.start, m.to.due)).join(', '); }
|
|
362
|
-
return `<div class="lk-pr"><span class="ic" aria-hidden="true">${ic}</span><span class="w"><b>${t}</b><small>${esc(s)}</small></span>`
|
|
363
|
-
+ `<button type="button" class="vs-ti ok" data-lk-yes="${esc(p.id)}" aria-label="Approve" title="Approve">${SVG(PL.check, 16, 2.4)}</button><button type="button" class="vs-ti" data-lk-no="${esc(p.id)}" aria-label="Drop it" title="Drop it">${SVG(PL.x, 15, 2)}</button></div>`;
|
|
364
|
-
};
|
|
365
|
-
return `<div class="tkc-pop lk-m" role="dialog" aria-label="${esc(head)}"><div class="lk-mh">${SVG(PL.spark, 14, 2)}<b>${esc(head)}</b>${P.length > 1 ? `<button type="button" class="vs-ok" data-lk-all aria-label="Add all" title="Add all">${SVG(PL.check, 16, 2.4)}</button>` : ''}</div>${P.map(row).join('')}</div>`;
|
|
366
|
-
}
|
|
367
|
-
function openProps(b, H, id) {
|
|
368
|
-
const lk = VIEWS.get(id); if (!lk) return;
|
|
369
|
-
OPEN = 'prop:' + id; redrawAll();
|
|
370
|
-
openPop(b, propHtml(lk), async (x) => {
|
|
371
|
-
const q = x.dataset;
|
|
372
|
-
if ('lkAll' in q || q.lkYes) {
|
|
373
|
-
const ids = 'lkAll' in q ? (VIEWS.get(id).proposals || []).map((p) => p.id) : [q.lkYes];
|
|
374
|
-
closePop();
|
|
375
|
-
const res = await write(H, '/accept', { initiative: id, ids });
|
|
376
|
-
if (!res || res.ok === false) { failed(H, res); return; }
|
|
377
|
-
took(id, res);
|
|
378
|
-
const n = res.linked.length, m = res.moved.length;
|
|
379
|
-
say(H, [n ? plural(n, 'link', 'links') + ' added' : '', m ? 'moved ' + plural(m, 'task', 'tasks') + ' to keep ' + (n === 1 ? 'it' : 'them') : ''].filter(Boolean).join(', ').replace(/^./, (c) => c.toUpperCase()) + '.',
|
|
380
|
-
n ? async () => { for (const l of res.linked) await write(H, '/unlink', l); CACHE.delete(id); await after(H); } : undefined);
|
|
381
|
-
await after(H);
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
if (q.lkNo) {
|
|
385
|
-
const res = await write(H, '/drop', { initiative: id, id: q.lkNo });
|
|
386
|
-
if (!res || res.ok === false) { failed(H, res); return; }
|
|
387
|
-
const v = VIEWS.get(id); if (v) { v.proposals = v.proposals.filter((p) => p.id !== q.lkNo); CACHE.set(id, { v: { ...v, T: undefined }, at: new Date().toISOString() }); }
|
|
388
|
-
if (v && v.proposals.length && POP) POP.el.innerHTML = propHtml(v); else closePop();
|
|
389
|
-
if (H.redraw) H.redraw();
|
|
390
|
-
}
|
|
391
|
-
}, { sheet: true, onClose: () => { OPEN = null; redrawAll(); } });
|
|
392
|
-
}
|
|
393
|
-
|
|
394
353
|
/* ── the grey ✦: what Claude moved quietly, Undo all; Needs you (✓ / ✕); the switch for quiet moves ── */
|
|
395
354
|
function movedHtml(lk) {
|
|
396
355
|
const B = lk.moved ? lk.moved.batches : [], A = (lk.asks || []).filter((a) => !a.sent);
|
|
@@ -521,8 +480,7 @@ export function press(b, d, root, H) {
|
|
|
521
480
|
const id = root && root.dataset.iv; if (!id) return false;
|
|
522
481
|
if (d.lkChip) {
|
|
523
482
|
if (POP && POP.anchor === b) { closePop(); return true; }
|
|
524
|
-
if (d.lkChip === '
|
|
525
|
-
else if (d.lkChip === 'moved') openMoved(b, H, id);
|
|
483
|
+
if (d.lkChip === 'moved') openMoved(b, H, id);
|
|
526
484
|
else { PIN = PIN && PIN.uid === '*late' ? null : { id, uid: '*late' }; b.setAttribute('aria-pressed', String(!!PIN)); redrawAll(); }
|
|
527
485
|
return true;
|
|
528
486
|
}
|