create-pmos 0.540.0 → 0.542.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 +33 -39
- 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/README.md +1 -1
- package/workspace/adler-moments-test.js +4 -8
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/briefing-premium-initiative-test.js +1 -1
- package/workspace/briefing-premium-sources-test.js +3 -3
- package/workspace/briefing-premium-test.js +2 -4
- package/workspace/changelog.json +32 -0
- package/workspace/ev-everywhere-test.js +3 -3
- package/workspace/fixtures/doc-category-labelled.json +1 -1
- package/workspace/guide/agent-capabilities.md +236 -28
- package/workspace/guide/breakdown.md +5 -20
- package/workspace/guide/claude-proposes.md +269 -37
- package/workspace/guide/cli.md +603 -0
- package/workspace/guide/home.md +182 -21
- package/workspace/guide/index.md +23 -59
- package/workspace/guide/initiatives-and-next-steps.md +235 -5
- package/workspace/guide/intelligence-okr-goals.md +122 -5
- package/workspace/guide/jira.md +2 -15
- package/workspace/guide/knowledge-graph.md +143 -18
- package/workspace/guide/layout.md +209 -4
- package/workspace/guide/notes.md +74 -6
- package/workspace/guide/proactive-engine.md +3 -14
- package/workspace/guide/programs.md +199 -4
- package/workspace/guide/reports.md +405 -41
- package/workspace/guide/scheduled-tasks-and-cli.md +6 -28
- package/workspace/guide/settings-and-switches.md +397 -0
- package/workspace/guide/statuses.md +141 -4
- package/workspace/home-rows-test.js +19 -24
- package/workspace/lib/briefing-premium-agent.js +7 -2
- package/workspace/lib/cos-chat.js +75 -0
- package/workspace/lib/done-feed.js +33 -0
- package/workspace/lib/grill-runs.js +1 -1
- package/workspace/lib/headless.js +29 -2
- package/workspace/lib/loop-health.js +65 -0
- package/workspace/lib/pmos-verbs.js +41 -40
- package/workspace/lib/proposal-runs.js +1 -1
- package/workspace/lib/proposals.js +44 -9
- package/workspace/lib/routes-sources.js +2 -0
- package/workspace/lib/routes-your-move.js +25 -4
- package/workspace/lib/verify-runs.js +22 -1
- package/workspace/lib/verify-work-cli.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/batch-press.js +184 -0
- package/workspace/public/pm/bd-fc-card.js +2 -1
- package/workspace/public/pm/bd-next.js +2 -1
- package/workspace/public/pm/chat-src.js +18 -0
- package/workspace/public/pm/cozy-home.css +4 -0
- package/workspace/public/pm/cozy-lab-ins.js +17 -1
- package/workspace/public/pm/cozy-nav.js +22 -21
- package/workspace/public/pm/cozy-search.js +18 -9
- package/workspace/public/pm/cozy-today.css +7 -0
- package/workspace/public/pm/cozy-viewer.js +1 -1
- package/workspace/public/pm/goal-chat.js +1 -1
- package/workspace/public/pm/good-morning.js +1 -1
- package/workspace/public/pm/home-app.js +65 -14
- package/workspace/public/pm/home-chat.js +8 -4
- package/workspace/public/pm/home-day.js +46 -14
- package/workspace/public/pm/home-today.js +5 -4
- package/workspace/public/pm/ini-props.js +7 -2
- package/workspace/public/pm/ini-view.css +14 -0
- package/workspace/public/pm/move-rank.js +67 -9
- package/workspace/public/pm/outbox-view.js +35 -0
- package/workspace/public/pm/page-chat.css +2 -0
- package/workspace/public/pm/page-chat.js +33 -5
- package/workspace/replaced-tests.json +19 -1
- package/workspace/run-tests.js +23 -4
- package/workspace/server.js +2 -1
- package/workspace/task-links-test.js +6 -2
- package/workspace/test-lists/chief-of-staff-chat.json +9 -0
- package/workspace/guide/adler.md +0 -71
- package/workspace/guide/agents-act.md +0 -68
- package/workspace/guide/ask-the-past.md +0 -46
- package/workspace/guide/board.md +0 -58
- package/workspace/guide/briefing-premium.md +0 -14
- package/workspace/guide/console-calendar.md +0 -24
- package/workspace/guide/core-documents.md +0 -58
- package/workspace/guide/data-freshness.md +0 -164
- package/workspace/guide/descriptions.md +0 -43
- package/workspace/guide/docs.md +0 -39
- package/workspace/guide/forecast.md +0 -66
- package/workspace/guide/horizon-scan.md +0 -82
- package/workspace/guide/idle-lab.md +0 -46
- package/workspace/guide/initiative-driver.md +0 -102
- package/workspace/guide/initiatives-roadmap.md +0 -131
- package/workspace/guide/integrated-work.md +0 -93
- package/workspace/guide/launcher.md +0 -39
- package/workspace/guide/lifecycle.md +0 -64
- package/workspace/guide/metric-drafts.md +0 -75
- package/workspace/guide/moments.md +0 -43
- package/workspace/guide/my-work.md +0 -40
- package/workspace/guide/next-prompt.md +0 -64
- package/workspace/guide/outcomes.md +0 -39
- package/workspace/guide/people.md +0 -48
- package/workspace/guide/pm-only-acts.md +0 -88
- package/workspace/guide/pm-only-lines.md +0 -61
- package/workspace/guide/present-in-a-meeting.md +0 -57
- package/workspace/guide/published-board.md +0 -116
- package/workspace/guide/ready-made-dashboards.md +0 -62
- package/workspace/guide/rehearse.md +0 -52
- package/workspace/guide/report-design.md +0 -126
- package/workspace/guide/report-slides.md +0 -43
- package/workspace/guide/report-structure.md +0 -91
- package/workspace/guide/reports-needs-you.md +0 -34
- package/workspace/guide/reports-set-up.md +0 -68
- package/workspace/guide/settings.md +0 -67
- package/workspace/guide/today.md +0 -44
- package/workspace/guide/validate-with-typesafe.md +0 -144
- package/workspace/guide/welcome.md +0 -90
- package/workspace/guide/what-you-missed.md +0 -42
- package/workspace/guide/workflows.md +0 -107
- package/workspace/guide/your-impact.md +0 -57
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/* pm/batch-press.js — one press per initiative (chief-of-staff C4, board CsF on the main canvas, In development): every ✦ Claude has on one
|
|
2
|
+
* initiative as one commit-style summary, grouped Dates, Names, Done, Links, each line with its source.
|
|
3
|
+
*
|
|
4
|
+
* batchOf(props) PURE → { groups: [{ group, title, lines: [line] }], check: [p], n, sure }
|
|
5
|
+
* line: { key, sig, pid, text, meta, src } (sig: what ✕ drops; pid: the proposal it belongs to)
|
|
6
|
+
* REASONS the 3 optional reason chips of each group
|
|
7
|
+
* openBatch(at, H) the Viewer: "<Initiative> · N changes". One ✓ in the header keeps every line Claude is sure of (POST
|
|
8
|
+
* /api/proposals/keep all: true), one toast with one Undo for the whole batch (POST /api/proposals/undo).
|
|
9
|
+
* ✕ on a line leaves it out at once (POST /api/proposals/drop with its signature) and opens 3 reason chips and
|
|
10
|
+
* Say why, all optional: a skipped reason is never asked again. A picked reason is the ✕'s `why` (a second drop
|
|
11
|
+
* line with the same signature; the fold keeps the newest reason), which the next run of that job reads.
|
|
12
|
+
* "Check these" (an expected outcome, a description, a duplicate, a grill finding, a Lab result) need their own
|
|
13
|
+
* ✓ and never ride on the one press; ⋯ opens the full ✦ on the initiative (pm/ini-props.js), nothing dropped.
|
|
14
|
+
* at: { ws, board, ini, title, props? } H: { pmGet, pmPost, toast, toastUndo, reload, full() }
|
|
15
|
+
* On a phone the groups are folded, the counts first and the lines on a tap (CsF phone). Nothing is written before a press. */
|
|
16
|
+
|
|
17
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
18
|
+
const SVG = (d, w = 16, sw = 2) => `<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>`;
|
|
19
|
+
const I = { check: 'M5 12l5 5 9-10', x: 'M6 6l12 12M18 6L6 18', spark: 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', more: 'M5 12h.01M12 12h.01M19 12h.01' };
|
|
20
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
21
|
+
const md = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? +m[3] + ' ' + MON[+m[2] - 1] : ''; };
|
|
22
|
+
const clip = (s, n) => { s = String(s || '').replace(/\s+/g, ' ').trim(); return s.length > n ? s.slice(0, n - 1) + '…' : s; };
|
|
23
|
+
const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
|
|
24
|
+
const srcOf = (p) => (p.sources || []).map((s) => s && s.label).filter(Boolean).join(', ');
|
|
25
|
+
|
|
26
|
+
export const GROUP_TITLE = { dates: 'Dates', names: 'Names', status: 'Done', links: 'Links' };
|
|
27
|
+
const ORDER = ['dates', 'names', 'status', 'links'];
|
|
28
|
+
export const REASONS = {
|
|
29
|
+
dates: ['Wrong date', 'Not this work', 'Already done'],
|
|
30
|
+
names: ['The name was fine', 'Not this work', 'Already done'],
|
|
31
|
+
status: ['Not done yet', 'Not this work', 'Wrong evidence'],
|
|
32
|
+
links: ['Wrong link', 'Not this work', 'Already linked'],
|
|
33
|
+
check: ['Not right', 'Not this work', 'Already done'],
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** The commit-style lines of one sure proposal: dates, names and status are one line per item; links one line per proposal. */
|
|
37
|
+
function linesOf(p) {
|
|
38
|
+
const src = srcOf(p) || p.why || '';
|
|
39
|
+
if (p.group === 'links') {
|
|
40
|
+
const l = p.link || {};
|
|
41
|
+
const n = (l.tasks || []).length;
|
|
42
|
+
const text = l.kind === 'link' ? (l.toTitle || 'A task') + ' waits on ' + (l.fromTitle || 'another task') : l.kind === 'pull' ? 'Pull ' + plural(n, 'task', 'tasks') + ' in' : l.kind ? 'Move ' + plural(n, 'task', 'tasks') + ' to keep your links' : clip(p.title || 'A link', 90);
|
|
43
|
+
return [{ key: p.id, sig: '', link: l.id || '', pid: p.id, text, meta: '', src: p.why || '' }];
|
|
44
|
+
}
|
|
45
|
+
return (p.items || []).map((x, i) => {
|
|
46
|
+
let text = '', meta = '';
|
|
47
|
+
if (p.group === 'dates') { text = x.title || x.task || 'A task'; meta = (x.from && x.from.due ? md(x.from.due) + ' → ' : '→ ') + md((x.to && x.to.due) || x.due); }
|
|
48
|
+
else if (p.group === 'names') { text = '“' + clip(x.from || '', 60) + '” → “' + clip(x.to || '', 60) + '”'; meta = ''; }
|
|
49
|
+
else if (p.group === 'status') { text = x.title || x.task || 'A task'; meta = ''; }
|
|
50
|
+
else { text = x.title || p.title || ''; }
|
|
51
|
+
if (x.jira) meta = [meta, 'Jira: a drafted comment'].filter(Boolean).join(' · ');
|
|
52
|
+
return { key: p.id + ':' + (x.sig || i), sig: x.sig || '', pid: p.id, text: clip(text, 120), meta, src };
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/** The summary of one initiative's open ✦ (GET /api/proposals props). PURE. */
|
|
56
|
+
export function batchOf(props) {
|
|
57
|
+
const all = ((props && props.groups) || []).flatMap((g) => g.props || []);
|
|
58
|
+
const groups = [], check = [];
|
|
59
|
+
for (const p of all) {
|
|
60
|
+
if (p.section === 'sure' && ORDER.includes(p.group)) {
|
|
61
|
+
let g = groups.find((x) => x.group === p.group);
|
|
62
|
+
if (!g) groups.push(g = { group: p.group, title: GROUP_TITLE[p.group], lines: [] });
|
|
63
|
+
g.lines.push(...linesOf(p));
|
|
64
|
+
} else check.push(p);
|
|
65
|
+
}
|
|
66
|
+
groups.sort((a, b) => ORDER.indexOf(a.group) - ORDER.indexOf(b.group));
|
|
67
|
+
for (const g of groups) g.lines = g.lines.filter((l) => l.text);
|
|
68
|
+
const live = groups.filter((g) => g.lines.length);
|
|
69
|
+
const sure = live.reduce((n, g) => n + g.lines.length, 0);
|
|
70
|
+
return { groups: live, check, sure, n: sure + check.length };
|
|
71
|
+
}
|
|
72
|
+
const CHECK_WORD = { outcome: 'Expected outcome', description: 'Description', found: 'Found elsewhere', grill: 'Grill finding', prototyped: 'Claude prototyped it', improved: 'Claude improved it', scanned: 'Claude scanned for it' };
|
|
73
|
+
const checkTitle = (p) => clip(p.title || (p.group === 'outcome' && p.items && p.items[0] ? p.items[0].title : '') || (p.data && p.data.text) || CHECK_WORD[p.group] || p.group, 110);
|
|
74
|
+
|
|
75
|
+
/* ── the Viewer ── */
|
|
76
|
+
const S = { at: null, H: null, props: null, why: null, left: new Map(), timer: null };
|
|
77
|
+
const isPhone = () => typeof matchMedia === 'function' && matchMedia('(max-width: 700px)').matches;
|
|
78
|
+
function lineHtml(g, l) {
|
|
79
|
+
const out = S.left.get(l.key);
|
|
80
|
+
const xb = out ? '' : `<button type="button" class="pp-ib" data-bp-x="${esc(l.key)}" aria-label="${esc('Leave out: ' + l.text)}" title="Leave this out">${SVG(I.x, 15, 2)}</button>`;
|
|
81
|
+
const why = out && out.ask ? `<div class="bp-why" role="group" aria-label="Why? (optional)"><small>Left out. Why? (optional)</small>${(REASONS[g] || REASONS.check).map((r) => `<button type="button" class="bp-chip" data-bp-why="${esc(l.key)}" data-r="${esc(r)}">${esc(r)}</button>`).join('')}`
|
|
82
|
+
+ `<button type="button" class="bp-chip" data-bp-say="${esc(l.key)}">Say why</button>${out.say ? `<input class="bp-say" data-bp-in="${esc(l.key)}" maxlength="200" aria-label="Why, in your words">` : ''}</div>` : out ? '<div class="bp-why"><small>Left out.</small></div>' : '';
|
|
83
|
+
return `<div class="pp-it bp-ln${out ? ' out' : ''}"><span class="w"><b>${esc(l.text)}</b>${l.meta || l.src ? `<small>${esc([l.meta, l.src].filter(Boolean).join(' · '))}</small>` : ''}</span>${xb}</div>${why}`;
|
|
84
|
+
}
|
|
85
|
+
function checkHtml(p) {
|
|
86
|
+
const out = S.left.get(p.id);
|
|
87
|
+
const acts = out ? '' : `<button type="button" class="pp-ib" data-bp-cx="${esc(p.id)}" aria-label="${esc('Drop: ' + checkTitle(p))}" title="Drop it">${SVG(I.x, 15, 2)}</button><button type="button" class="pp-ib ok" data-bp-ck="${esc(p.id)}" aria-label="${esc('Keep: ' + checkTitle(p))}" title="Keep it">${SVG(I.check, 15, 2.4)}</button>`;
|
|
88
|
+
const why = out && out.ask ? `<div class="bp-why" role="group" aria-label="Why? (optional)"><small>Left out. Why? (optional)</small>${REASONS.check.map((r) => `<button type="button" class="bp-chip" data-bp-why="${esc(p.id)}" data-r="${esc(r)}">${esc(r)}</button>`).join('')}<button type="button" class="bp-chip" data-bp-say="${esc(p.id)}">Say why</button>${out.say ? `<input class="bp-say" data-bp-in="${esc(p.id)}" maxlength="200" aria-label="Why, in your words">` : ''}</div>` : '';
|
|
89
|
+
return `<div class="pp-it bp-ln${out ? ' out' : ''}"><span class="w"><b>${esc(checkTitle(p))}</b><small>${esc([CHECK_WORD[p.group] || '', srcOf(p) || clip(p.why, 120)].filter(Boolean).join(' · '))}</small></span>${acts}</div>${why}`;
|
|
90
|
+
}
|
|
91
|
+
function bodyHtml() {
|
|
92
|
+
const B = batchOf(S.props), VW = window.czViewer;
|
|
93
|
+
if (!B.n) return '<p class="pp-none">Nothing waits here now.</p>';
|
|
94
|
+
const lead = B.sure ? `<p class="bp-lead">${SVG(I.spark, 14, 2)} Here is everything I want to change on ${esc(S.at.title)}, on one screen. Keep all of it at once, or leave out one line.</p>` : '';
|
|
95
|
+
const phone = isPhone();
|
|
96
|
+
const secs = B.groups.map((g) => ({ id: g.group, title: g.title, count: g.lines.length, open: !phone, html: g.lines.map((l) => lineHtml(g.group, l)).join('') }));
|
|
97
|
+
if (B.check.length) secs.push({ id: 'check', title: 'Check these', count: B.check.length, open: !phone || !B.sure, html: '<p class="bp-sub">Each one needs its own answer.</p>' + B.check.map(checkHtml).join('') });
|
|
98
|
+
return `<div class="pp bp">${lead}${VW.czSections(secs, { key: 'batch' })}<button type="button" class="bp-full" data-bp-full>${SVG(I.more, 16, 2.4)} Open everything Claude proposes on ${esc(S.at.title)}</button></div>`;
|
|
99
|
+
}
|
|
100
|
+
const presses = () => { const B = batchOf(S.props); return B.sure ? [{ act: 'all', label: 'Keep all ' + B.sure, icon: I.check, solid: true }] : []; };
|
|
101
|
+
function draw() {
|
|
102
|
+
const VW = window.czViewer, b = VW.body(), cur = VW.current();
|
|
103
|
+
if (!b || !cur || cur.id !== 'bp:' + S.at.ini) return;
|
|
104
|
+
const top = b.scrollTop, focus = document.activeElement && document.activeElement.dataset ? document.activeElement.dataset.bpIn : null;
|
|
105
|
+
b.innerHTML = bodyHtml(); b.scrollTop = top;
|
|
106
|
+
if (focus) { const i = b.querySelector(`[data-bp-in="${CSS.escape(focus)}"]`); if (i) i.focus(); }
|
|
107
|
+
VW.setPresses(cur.id, presses());
|
|
108
|
+
const B = batchOf(S.props), t = S.at.title + ' · ' + plural(B.n, 'change', 'changes');
|
|
109
|
+
if (VW.retitle && cur.title !== t) VW.retitle(cur.id, t);
|
|
110
|
+
}
|
|
111
|
+
const post = (route, body) => S.H.pmPost(route, { ws: S.at.ws || undefined, board: S.at.board, initiative: S.at.ini, ...body }).catch(() => null);
|
|
112
|
+
async function fresh() {
|
|
113
|
+
const r = await S.H.pmGet('/api/proposals?ws=' + encodeURIComponent(S.at.ws || '') + '&board=' + encodeURIComponent(S.at.board || '') + '&initiative=' + encodeURIComponent(S.at.ini) + '&grill=all').catch(() => null);
|
|
114
|
+
if (r && r.ok !== false) { S.props = r.props; draw(); }
|
|
115
|
+
}
|
|
116
|
+
const lineOf = (key) => { const B = batchOf(S.props); for (const g of B.groups) { const l = g.lines.find((x) => x.key === key); if (l) return l; } return null; };
|
|
117
|
+
const checkOf = (id) => batchOf(S.props).check.find((p) => p.id === id) || null;
|
|
118
|
+
/** ✕: the line leaves at once; the reason chips stay open under it until the PM picks one, says why, or does something else. */
|
|
119
|
+
async function leaveOut(key) {
|
|
120
|
+
const l = lineOf(key), p = l ? null : checkOf(key);
|
|
121
|
+
if (!l && !p) return;
|
|
122
|
+
const res = l && l.link ? await post('/api/task-links/drop', { id: l.link }) : await post('/api/proposals/drop', { sig: l ? l.sig || ((S.props.groups || []).flatMap((g) => g.props).find((x) => x.id === l.pid) || {}).sig : p.sig });
|
|
123
|
+
if (!res || res.ok === false) { S.H.toast((res && res.error) || 'Nothing was changed.'); return; }
|
|
124
|
+
for (const v of S.left.values()) v.ask = false; // a reason not given is never asked again
|
|
125
|
+
S.left.set(key, { ask: !(l && l.link), sig: l ? l.sig || null : p.sig, say: false, g: l ? null : 'check' });
|
|
126
|
+
draw();
|
|
127
|
+
}
|
|
128
|
+
async function giveWhy(key, why) {
|
|
129
|
+
const o = S.left.get(key); if (!o || !why) return;
|
|
130
|
+
o.ask = false; draw();
|
|
131
|
+
if (o.sig) await post('/api/proposals/drop', { sig: o.sig, why });
|
|
132
|
+
S.H.toast('Thanks. I will remember that next time.');
|
|
133
|
+
}
|
|
134
|
+
async function keepAll() {
|
|
135
|
+
const res = await post('/api/proposals/keep', { all: true });
|
|
136
|
+
if (!res || res.ok === false) { S.H.toast((res && res.error) || 'Nothing was kept.'); return; }
|
|
137
|
+
const at = S.at, batch = res.batch;
|
|
138
|
+
S.H.toastUndo(res.said || 'Kept on ' + at.title + '.', async () => {
|
|
139
|
+
const u = await S.H.pmPost('/api/proposals/undo', { ws: at.ws || undefined, board: at.board, batch }).catch(() => null);
|
|
140
|
+
if (S.at && S.at.ini === at.ini) await fresh();
|
|
141
|
+
if (S.H.reload) S.H.reload();
|
|
142
|
+
return u || { ok: false };
|
|
143
|
+
});
|
|
144
|
+
S.props = res.props; S.left.clear(); draw();
|
|
145
|
+
if (S.H.reload) S.H.reload();
|
|
146
|
+
}
|
|
147
|
+
async function keepOne(id) {
|
|
148
|
+
const res = await post('/api/proposals/keep', { ids: [id] });
|
|
149
|
+
if (!res || res.ok === false) { S.H.toast((res && res.error) || 'Nothing was kept.'); return; }
|
|
150
|
+
const at = S.at, batch = res.batch;
|
|
151
|
+
S.H.toastUndo(res.said || 'Kept.', async () => { const u = await S.H.pmPost('/api/proposals/undo', { ws: at.ws || undefined, board: at.board, batch }).catch(() => null); if (S.at && S.at.ini === at.ini) await fresh(); return u || { ok: false }; });
|
|
152
|
+
S.props = res.props; draw();
|
|
153
|
+
if (S.H.reload) S.H.reload();
|
|
154
|
+
}
|
|
155
|
+
async function onPress(e) {
|
|
156
|
+
const b = e.target.closest('button'); if (!b || b.disabled) return;
|
|
157
|
+
const d = b.dataset;
|
|
158
|
+
if (d.bpX) { b.disabled = true; await leaveOut(d.bpX); return; }
|
|
159
|
+
if (d.bpCx) { b.disabled = true; await leaveOut(d.bpCx); return; }
|
|
160
|
+
if (d.bpCk) { b.disabled = true; await keepOne(d.bpCk); return; }
|
|
161
|
+
if (d.bpWhy) { await giveWhy(d.bpWhy, d.r); return; }
|
|
162
|
+
if (d.bpSay) { const o = S.left.get(d.bpSay); if (o) { o.say = true; draw(); const i = document.querySelector(`[data-bp-in="${CSS.escape(d.bpSay)}"]`); if (i) i.focus(); } return; }
|
|
163
|
+
if ('bpFull' in d) { if (S.H.full) S.H.full(); }
|
|
164
|
+
}
|
|
165
|
+
/** The ✦ Viewer's styles (ini-view.css) load once, as the initiative page loads them. */
|
|
166
|
+
function sheet() {
|
|
167
|
+
const href = new URL('./ini-view.css', import.meta.url).href;
|
|
168
|
+
if (typeof document === 'undefined' || [...document.querySelectorAll('link[rel="stylesheet"]')].some((l) => l.href === href)) return;
|
|
169
|
+
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = href; document.head.appendChild(l);
|
|
170
|
+
}
|
|
171
|
+
export function openBatch(at, H) {
|
|
172
|
+
const VW = window.czViewer; if (!VW || !at || !at.ini) return;
|
|
173
|
+
sheet();
|
|
174
|
+
S.at = at; S.H = H; S.props = at.props || null; S.left = new Map(); // at.props: the ✦ the page already read (as the full ✦ seeds from it)
|
|
175
|
+
VW.open({ id: 'bp:' + at.ini, kind: 'Claude proposes', title: at.title, sub: 'One press keeps all of it', icon: I.spark, presses: [],
|
|
176
|
+
onPress: (act) => { if (act === 'all') keepAll(); },
|
|
177
|
+
render: (body) => {
|
|
178
|
+
body.innerHTML = '<p class="pp-none">Reading what Claude proposes…</p>'; body.onclick = onPress;
|
|
179
|
+
body.onkeydown = (e) => { if (e.key === 'Enter' && e.target.matches('[data-bp-in]')) { e.preventDefault(); giveWhy(e.target.dataset.bpIn, e.target.value.trim()); } };
|
|
180
|
+
if (S.props) draw();
|
|
181
|
+
if (!S.props || S.props.look) fresh();
|
|
182
|
+
},
|
|
183
|
+
onClose: () => { S.left.clear(); } });
|
|
184
|
+
}
|
|
@@ -26,7 +26,8 @@ export function cardWords(r) {
|
|
|
26
26
|
|
|
27
27
|
function cardHtml(r) {
|
|
28
28
|
const w = cardWords(r); if (!w) return '';
|
|
29
|
-
|
|
29
|
+
// no count on the ✦ (chief-of-staff C4, the UI grill's delete list): it opens the initiative and its one-press summary
|
|
30
|
+
const go = w.n ? `<div class="bd-fc-go"><button type="button" class="bd-fc-sp" data-fc-props aria-label="See what Claude proposes" title="What Claude proposes">${SPARK}</button></div>` : '';
|
|
30
31
|
return `<p class="bd-pc-h">${esc(w.head)}</p>${w.why ? `<p class="bd-amut bd-pc-sub">${esc(w.why)}</p>` : ''}${go}`;
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -111,7 +111,8 @@ export function nextHtml(r, o = {}) {
|
|
|
111
111
|
if (!x) return '';
|
|
112
112
|
const words = (x.verb ? x.verb + ' ' : '') + x.obj + (x.tail ? ' · ' + x.tail : '');
|
|
113
113
|
const count = [x.count, o.due === false ? '' : x.due].filter(Boolean)[0] || '';
|
|
114
|
-
|
|
114
|
+
// chief-of-staff C5 (UI grill delete list): no "Draft … with Claude" link on a row; the words stay, and the chat over the Board drafts it
|
|
115
|
+
const act = x.act && x.act.kind !== 'draft' && o.icon !== false
|
|
115
116
|
? `<button type="button" class="bd-nxa" data-nx="${esc(x.act.kind)}" data-nxrow="${esc(r.key)}"${x.act.q ? ` data-q="${esc(x.act.q)}"` : ''}${x.act.stage ? ` data-stage="${esc(x.act.stage)}"` : ''} aria-label="${esc(x.act.label)}" title="${esc(x.act.label)}">${SV(IC[x.act.kind])}</button>` : '';
|
|
116
117
|
return `<div class="bd-nx">${x.you ? '<i class="cz-dot you" role="img" aria-label="Waits on you"></i>' : ''}`
|
|
117
118
|
+ `<span class="tx" title="${esc(x.title || words)}">${x.verb ? esc(x.verb) + ' ' : ''}<em${x.tone ? ` class="${x.tone}"` : ''}>${esc(x.obj)}</em>${x.tail ? ' · ' + esc(x.tail) : ''}</span>`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* pm/chat-src.js — where an answer came from (chief-of-staff C1, board CsA: "Reads run at once and show their source"). Pure.
|
|
2
|
+
*
|
|
3
|
+
* splitSrc(text) → { text, src: [{ name, fresh }] } takes the answer's ```pmos-src block out of the words (lib/cos-chat.js asks for it)
|
|
4
|
+
* srcHtml(src) → one quiet line under the answer: an eye and "Board · read now", "Jira · read 4 min ago"; '' with no source */
|
|
5
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
6
|
+
const EYE = '<svg aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg>';
|
|
7
|
+
const RE = /```pmos-src\s*\n([\s\S]*?)```/;
|
|
8
|
+
export function splitSrc(text) {
|
|
9
|
+
const t = String(text == null ? '' : text), m = RE.exec(t);
|
|
10
|
+
if (!m) return { text: t, src: [] };
|
|
11
|
+
let a = null; try { a = JSON.parse(m[1]); } catch { a = null; }
|
|
12
|
+
const src = Array.isArray(a) ? a.filter((x) => x && typeof x.name === 'string' && x.name.trim()).slice(0, 8).map((x) => ({ name: x.name.trim().slice(0, 40), fresh: typeof x.fresh === 'string' ? x.fresh.trim().slice(0, 40) : '' })) : [];
|
|
13
|
+
return { text: (t.slice(0, m.index) + t.slice(m.index + m[0].length)).trim(), src };
|
|
14
|
+
}
|
|
15
|
+
export function srcHtml(src) {
|
|
16
|
+
if (!src || !src.length) return '';
|
|
17
|
+
return `<p class="hm-src" aria-label="Sources">${src.map((s) => `<span>${EYE}${esc(s.name)}${s.fresh ? ' · ' + esc(s.fresh) : ''}</span>`).join('')}</p>`;
|
|
18
|
+
}
|
|
@@ -838,3 +838,7 @@ form.hm-box textarea { min-height: 48px; border: 0; background: none; resize: no
|
|
|
838
838
|
@media (max-width: 760px) {
|
|
839
839
|
.np-t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; } /* a phone shows 3 lines; a tap still fills the whole text */
|
|
840
840
|
}
|
|
841
|
+
|
|
842
|
+
/* chief-of-staff C1 (board CsA): where an answer came from, one quiet line under it (pm/chat-src.js) */
|
|
843
|
+
.hm-src { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 2px; }
|
|
844
|
+
.hm-src span { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-meta); color: var(--cz-ink3); }
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* (zero is silence; onboarding A4, gradual exposure). Every press is icon-only.
|
|
7
7
|
*
|
|
8
8
|
* mount({ el, where() → { ws, board }, iniHref(id), toast(text, undo?) }) then load() after each read of the page
|
|
9
|
-
* load() reads GET /api/lab and draws
|
|
9
|
+
* load() reads GET /api/lab and draws
|
|
10
|
+
* openLab({ where, toast }) the same Lab in the Viewer (chief-of-staff C3, UI grill delete list: the Lab section is gone from
|
|
11
|
+
* Intelligence; Your move's "Lab" row opens it here, so nothing it shows is dropped) */
|
|
10
12
|
import { pmGet, pmPost } from './http.js';
|
|
11
13
|
import * as LC from './cozy-lab.js';
|
|
12
14
|
|
|
@@ -94,3 +96,17 @@ export function mount(H) {
|
|
|
94
96
|
H.el.addEventListener('click', press);
|
|
95
97
|
H.el.addEventListener('keydown', (e) => { if (e.key === 'Enter' && e.target.matches('[data-lab-reason]')) { e.preventDefault(); const x = e.target.closest('.lab-card').querySelector('[data-lab-drop]'); if (x) x.click(); } });
|
|
96
98
|
}
|
|
99
|
+
|
|
100
|
+
/* the Lab's styles (cozy-lab.css), once, for a page that has not loaded them (Home) */
|
|
101
|
+
function labSheet() {
|
|
102
|
+
const href = new URL('./cozy-lab.css', import.meta.url).href;
|
|
103
|
+
if ([...document.querySelectorAll('link[rel="stylesheet"]')].some((l) => l.href === href)) return;
|
|
104
|
+
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = href; document.head.appendChild(l);
|
|
105
|
+
}
|
|
106
|
+
/** The Lab in the Viewer, opened from Your move. H: { where() → { ws, board }, toast(text, undo?) } */
|
|
107
|
+
export function openLab(H) {
|
|
108
|
+
const VW = typeof window !== 'undefined' ? window.czViewer : null; if (!VW) return;
|
|
109
|
+
labSheet();
|
|
110
|
+
VW.open({ id: 'lab', kind: 'Lab', title: 'Lab', icon: LC.I.scan,
|
|
111
|
+
render: (body) => { const el = document.createElement('div'); el.className = 'lab-vw'; body.innerHTML = ''; body.appendChild(el); mount({ ...H, el }); load(); } });
|
|
112
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* item 5, canvas FmA1Menu and FmA4Desk: fewer menus).
|
|
4
4
|
*
|
|
5
5
|
* One button, bottom left on desktop and bottom right on a phone, opens the menu: the three places, Home, Board and Intelligence; then a
|
|
6
|
-
* tray of
|
|
6
|
+
* tray of four icons, Chat, Search (⌘K on a desk), Guide and Settings. It is the one way between places, and it holds nothing else: New for you is a fold
|
|
7
7
|
* in Your day, Sources are Settings › Connectors, Theme is Settings › General, and More is gone (feedback batch 16 item 5).
|
|
8
8
|
* The button keeps its two dots on every page: blue when something is new for you, amber when a source needs you (Claude repairs the rest by itself). Open, the blue dot sits on
|
|
9
9
|
* the Home row (where Your day is) and the amber dot on the Settings icon; the button's own name says both ("Open the menu. 3 new for you.
|
|
@@ -15,13 +15,16 @@
|
|
|
15
15
|
* The counts come from GET /api/news-for-you and GET /api/sources, read when the page opens and every two minutes while it is shown; each
|
|
16
16
|
* read of New for you is passed on as the event 'cz:news-for-you' (detail: the answer), so Home's Your day and Good morning follow it.
|
|
17
17
|
* Nothing here leads to the console, and nothing here writes.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* ONE DOT (chief-of-staff C3 and the UI grill's delete list, 2026-11-08). The button carries one dot: amber while a source needs the PM,
|
|
19
|
+
* else blue while a call in Your move is the PM's (the event 'cz:calls', detail { count }: Home sends it from Your move) or a place has
|
|
20
|
+
* something new to show. The "N new for you" count is gone from the button and its name (New for you stays a fold of Your day), and so
|
|
21
|
+
* are Adler's ears over the phone button (AdP6): Your move is the one place that says what is yours.
|
|
22
|
+
* THE CHAT (C5, board CsB): the tray's chat icon opens the one chat over the page you are on (pm/page-chat.js openCos), with a soft
|
|
23
|
+
* "You are on …" chip. A page that has its own chat column (Home) passes opts.chat() and the icon focuses that chat instead.
|
|
21
24
|
*/
|
|
22
25
|
import { esc, svg, ICON, wsQ } from './cozy-evui.js';
|
|
23
26
|
import { fabLabel, bannerOf } from './cozy-evmodel.js';
|
|
24
|
-
import { mountToastFaces, loadPrefs
|
|
27
|
+
import { mountToastFaces, loadPrefs } from './cozy-adler.js';
|
|
25
28
|
import { pmPost } from './http.js'; // Adler (batch 16 item 2): every toast carries his S face; Settings > Adler is read once
|
|
26
29
|
|
|
27
30
|
export const PLACES = [
|
|
@@ -53,14 +56,15 @@ export function setTheme(pick, doc = document, { keep = true } = {}) {
|
|
|
53
56
|
|
|
54
57
|
/** The menu's markup; pure, so a unit test can read it. here: home | board | insights. o: { news, stale: { text } | null } */
|
|
55
58
|
export function menuHtml(here, o = {}) {
|
|
56
|
-
const
|
|
59
|
+
const calls = o.calls > 0, dot = (c) => `<i class="ev-md ${c}" aria-hidden="true"></i>`;
|
|
57
60
|
return PLACES.map((p) => {
|
|
58
61
|
const opened = p.key !== here && !!(o.fresh && o.fresh.has(p.key));
|
|
59
|
-
const you = (p.key === 'home' &&
|
|
60
|
-
const lab = p.key === 'home' &&
|
|
62
|
+
const you = (p.key === 'home' && calls) || opened;
|
|
63
|
+
const lab = p.key === 'home' && calls ? ` aria-label="${p.label}. ${o.calls === 1 ? 'One call is yours' : o.calls + ' calls are yours'} in Your move"` : opened ? ` aria-label="${p.label}. New: it has something to show now"` : '';
|
|
61
64
|
return `<a href="${p.href}"${p.key === here ? ' aria-current="page"' : ''}${lab}>${svg(p.d, 18)}${p.key === here ? `<b>${p.label}</b>` : `<span>${p.label}</span>`}${you ? dot('you') : ''}</a>`;
|
|
62
65
|
}).join('')
|
|
63
66
|
+ '<div class="ev-tray">'
|
|
67
|
+
+ `<button type="button" class="ev-tb" data-cz-chat aria-label="Ask PMOS" title="Ask PMOS">${svg(ICON.chat, 20)}</button>`
|
|
64
68
|
+ `<button type="button" class="ev-tb" data-cz-search aria-label="Search (⌘K)" title="Search ⌘K">${svg(ICON.search, 20)}</button>`
|
|
65
69
|
+ `<button type="button" class="ev-tb" data-cz-guide aria-label="Guide" title="Guide">${svg(ICON.guide, 20)}</button>`
|
|
66
70
|
+ `<button type="button" class="ev-tb" data-cz-settings aria-label="Settings${o.stale ? '. ' + esc(o.stale.text) : ''}" title="Settings">${svg(ICON.settings, 20)}${o.stale ? dot('risk') : ''}</button>`
|
|
@@ -73,7 +77,7 @@ function addCss(doc) {
|
|
|
73
77
|
}
|
|
74
78
|
async function getj(p) { try { const r = await fetch(p, { credentials: 'same-origin' }); return r.ok ? await r.json() : null; } catch { return null; } }
|
|
75
79
|
|
|
76
|
-
/** What the button adds to its name while the
|
|
80
|
+
/** What the button adds to its name while a call is the PM's: 'One call is yours' · '3 calls are yours'. */
|
|
77
81
|
export const callWords = (n) => (n === 1 ? 'One call is yours' : n + ' calls are yours');
|
|
78
82
|
|
|
79
83
|
/** Mount the menu once. `here` is home | board | insights. Returns the wrapper. */
|
|
@@ -89,25 +93,21 @@ export function mountNav(here, doc = document, opts = {}) {
|
|
|
89
93
|
w.innerHTML = '<div class="ev-scrim" id="czScrim" hidden></div>'
|
|
90
94
|
+ `<nav class="cz-fabm ev-menu" id="czMenu" aria-label="Menu" hidden></nav>`
|
|
91
95
|
+ `<button type="button" class="cz-fab" id="czFab" aria-controls="czMenu" aria-expanded="false" aria-label="${fabLabel(here, false)}">${svg(ICON.menu, 22)}</button>`
|
|
92
|
-
+ '<i class="ev-fd you" id="czFdYou" hidden></i><i class="ev-fd risk" id="czFdRisk" hidden></i
|
|
96
|
+
+ '<i class="ev-fd you" id="czFdYou" hidden></i><i class="ev-fd risk" id="czFdRisk" hidden></i>';
|
|
93
97
|
doc.body.appendChild(w);
|
|
94
98
|
mountToastFaces(doc); loadPrefs();
|
|
95
99
|
const fab = w.querySelector('#czFab'), menu = w.querySelector('#czMenu'), scrim = w.querySelector('#czScrim');
|
|
96
100
|
const draw = () => {
|
|
97
|
-
menu.innerHTML = menuHtml(here, {
|
|
101
|
+
menu.innerHTML = menuHtml(here, { calls: N.calls, stale: N.stale, fresh: N.fresh });
|
|
98
102
|
const opened = [...N.fresh].some((k) => k !== here);
|
|
99
|
-
|
|
103
|
+
// one dot: amber while a source needs the PM, else blue while a call is theirs or a place has something new
|
|
100
104
|
w.querySelector('#czFdRisk').hidden = !N.stale || !menu.hidden;
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
w.querySelector('#czFdYou').hidden = !!N.stale || !(N.calls > 0 || opened) || !menu.hidden;
|
|
106
|
+
if (menu.hidden) fab.setAttribute('aria-label', fabLabel(here, false, N.stale) + (opened ? '. A place has something new to show' : '') + (N.calls > 0 ? '. ' + callWords(N.calls) : ''));
|
|
103
107
|
};
|
|
104
|
-
// AdP6: the ears are drawn once and kept while the count stays above zero, so a redraw never replays them
|
|
105
|
-
const ears = w.querySelector('#czEars');
|
|
106
|
-
const earsOn = () => N.calls > 0 && menu.hidden && !asleep();
|
|
107
|
-
const drawEars = () => { const on = earsOn(); if (on && !ears.firstChild) ears.innerHTML = adlerPeek(); ears.hidden = !on || !ears.firstChild; };
|
|
108
108
|
const set = (open) => {
|
|
109
109
|
menu.hidden = !open; scrim.hidden = !open; fab.setAttribute('aria-expanded', String(open));
|
|
110
|
-
fab.setAttribute('aria-label', fabLabel(here, open, N.stale
|
|
110
|
+
fab.setAttribute('aria-label', fabLabel(here, open, N.stale)); fab.innerHTML = svg(open ? ICON.close : ICON.menu, 22);
|
|
111
111
|
draw();
|
|
112
112
|
if (open) { const f = menu.querySelector('a, button'); if (f) f.focus(); }
|
|
113
113
|
};
|
|
@@ -123,7 +123,8 @@ export function mountNav(here, doc = document, opts = {}) {
|
|
|
123
123
|
if (a && opts.here && !e.metaKey && !e.ctrlKey && !e.shiftKey) { e.preventDefault(); set(false); opts.here(); return; }
|
|
124
124
|
const b = e.target.closest('button'); if (!b) return;
|
|
125
125
|
set(false);
|
|
126
|
-
if ('
|
|
126
|
+
if ('czChat' in b.dataset) { if (opts.chat) opts.chat(); else import('./page-chat.js').then((M) => M.openCos({ here: opts.where ? opts.where() : PLACES.find((p) => p.key === here) ? PLACES.find((p) => p.key === here).label : '' })); }
|
|
127
|
+
else if ('czSearch' in b.dataset) import('./cozy-search.js').then((M) => M.openSearch({ ...(opts.search ? { go: opts.search() } : {}), ...(opts.scope ? { scope: opts.scope() } : {}) }));
|
|
127
128
|
// a stale source opens Settings at Connectors, the stale one first (FmA3Settings: open where it matters)
|
|
128
129
|
else if ('czGuide' in b.dataset) import('./premium-vw-open.js').then((M) => M.openGuide('index'));
|
|
129
130
|
else if ('czSettings' in b.dataset) import('./cozy-settings.js').then((M) => M.openSettings(N.stale ? 'connectors' : undefined));
|
|
@@ -156,7 +157,7 @@ export function mountNav(here, doc = document, opts = {}) {
|
|
|
156
157
|
doc.addEventListener('visibilitychange', () => { if (!doc.hidden) read(); });
|
|
157
158
|
doc.addEventListener('cz:news', (e) => { if (e.detail && Number.isFinite(e.detail.count)) { N.news = e.detail.count; draw(); } else read(); });
|
|
158
159
|
doc.addEventListener('cz:calls', (e) => { const n = e.detail && Number(e.detail.count); N.calls = Number.isFinite(n) && n > 0 ? n : 0; draw(); });
|
|
159
|
-
doc.addEventListener('adler:prefs', () =>
|
|
160
|
+
doc.addEventListener('adler:prefs', () => draw());
|
|
160
161
|
window.addEventListener('pm:sources', (e) => { const d = e.detail; if (d && d.ok) { N.stale = bannerOf(d.sources); draw(); } });
|
|
161
162
|
return w;
|
|
162
163
|
}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
*
|
|
3
3
|
* One palette over the page: the query, the kind chips with their counts (All, Initiatives, Documents, Slides, Reports, Artifacts, Meetings)
|
|
4
4
|
* (no worktree chip since workspace grill W4); the results grouped (Initiatives · Documents, slides and reports · Artifacts and designs ·
|
|
5
|
-
* Meetings),
|
|
5
|
+
* Meetings). First, once two letters are typed, "Ask PMOS: …" (chief-of-staff C5: Ctrl K / Cmd K stays Search, and the chat is its first row;
|
|
6
|
+
* a page's own find, the U2 scope, keeps its own hits above it):
|
|
7
|
+
* it puts the words in the one chat, over the page you are on (pm/page-chat.js openCos), or in Home's own box on Home. ↑ ↓ move, ↵ opens,
|
|
8
|
+
* Esc closes. On a phone it is the whole screen.
|
|
6
9
|
* openSearch({ go?, q?, scope? }) go: the page's own opener ({ ini } | { ses } | { doc }), used before a page change
|
|
7
10
|
* scope: the page Search opens from (UI grill U2: one search; the Board's and Intelligence's own find boxes are gone). { name, hits(q) }
|
|
8
11
|
* where hits returns [{ label, rows: [{ id?, title, sub?, tag?, icon?, open() }] }]: the page's own groups, drawn first ("On this Board ·
|
|
@@ -136,25 +139,27 @@ function drawList() {
|
|
|
136
139
|
const own = scopeGroups(q), ownIds = new Set(own.flatMap((g) => g.rows.map((r) => r.id).filter(Boolean)));
|
|
137
140
|
if (ownIds.size) rows = rows.filter((r) => !(r.kind === 'initiative' && ownIds.has(r.id)));
|
|
138
141
|
const groups = own.concat(searchGroups(rows, { phone: isPhone() }));
|
|
139
|
-
S.rows = groups.flatMap((g) => g.rows);
|
|
140
142
|
const ask = q.length >= 2 ? { kind: 'ask', title: q } : null;
|
|
141
|
-
|
|
143
|
+
// chief-of-staff C5: the one chat is the first row of Search; a page's own find (U2 scope) keeps its own hits first, then the chat
|
|
144
|
+
const ownRows = own.flatMap((g) => g.rows);
|
|
145
|
+
S.rows = ownRows.concat(ask ? [ask] : [], groups.slice(own.length).flatMap((g) => g.rows));
|
|
142
146
|
S.at = Math.min(S.at, Math.max(0, S.rows.length - 1));
|
|
143
147
|
let h = '', i = 0;
|
|
148
|
+
const askHtml = () => `<button type="button" class="ev-mi${i === S.at ? ' hl' : ''}" role="option" id="evo${i}" data-ev-i="${i}" aria-selected="${i === S.at}">${svg(ICON.chat, 18)}<span class="ev-t">Ask PMOS: <b>“${esc(q)}”</b></span><span class="ev-k">${onHome() ? 'In the chat' : 'Opens the chat here'}</span></button>`;
|
|
144
149
|
// the page's own groups first (UI grill U2): what Search itself could not read is said after them
|
|
145
150
|
own.forEach((g) => { h += `<p class="ev-mlbl">${esc(g.label)}</p>` + g.rows.map((r) => rowHtml(r, i++)).join(''); });
|
|
151
|
+
if (ask) { h += askHtml(); i++; }
|
|
146
152
|
const rest = groups.slice(own.length);
|
|
147
153
|
if (q.length < 2) h = `<p class="ev-sp-empty">Type two letters or more. Search reads ${S.scope ? esc(S.scope.name) + ' first, then ' : ''}the initiatives, the documents, slides and reports, the artifacts and designs, and the meetings.</p>`;
|
|
148
154
|
else if (S.err) h += cantRead({ what: 'Search', why: S.err, sources: false });
|
|
149
155
|
else if (S.busy && !rest.length) h += skelRows(3);
|
|
150
156
|
// nothing found: Adler with his magnifier (canvas AdU4); the words stay the same
|
|
151
|
-
else if (!groups.length) h
|
|
157
|
+
else if (!groups.length) h += `<div class="ev-sp-empty ev-sp-ad" role="status">${adler('needs-you', 'l', { label: false, prop: 'magnifier' })}<p>Nothing matches “${esc(q)}”${S.kind !== 'all' ? ' in this kind' : ''}.</p></div>`;
|
|
152
158
|
rest.forEach((g, gi) => {
|
|
153
159
|
h += `<p class="ev-mlbl">${esc(g.label)}</p>` + g.rows.map((r) => rowHtml(r, i++)).join('');
|
|
154
160
|
if (gi === 0 && isPhone() && g.key === 'initiative') h += '<div class="ev-sp-chips ev-phchips" aria-hidden="true"></div>';
|
|
155
161
|
});
|
|
156
162
|
if (S.res && S.res.more && q.length >= 2) h += `<p class="ev-sp-empty">${S.res.more} more match. Pick a kind to see them.</p>`;
|
|
157
|
-
if (ask) h += `<div class="ev-hr" role="separator"></div><button type="button" class="ev-mi${i === S.at ? ' hl' : ''}" role="option" id="evo${i}" data-ev-i="${i}" aria-selected="${i === S.at}">${svg(ICON.chat, 18)}<span class="ev-t">Ask Claude about <b>“${esc(q)}”</b></span><span class="ev-k">Starts a chat in Home</span></button>`;
|
|
158
163
|
const chips = S.el.querySelector('#evChips');
|
|
159
164
|
if (chips && chips.parentNode !== S.el) S.el.insertBefore(chips, box); // home first, so the redraw below never drops it
|
|
160
165
|
box.innerHTML = h;
|
|
@@ -183,12 +188,16 @@ function go(r) {
|
|
|
183
188
|
}
|
|
184
189
|
openFileCard(r);
|
|
185
190
|
}
|
|
186
|
-
/** "Ask
|
|
191
|
+
/** "Ask PMOS: …" puts the words in the one chat, not sent: Home's own box on Home, else the chat over this page (the chip says where). */
|
|
192
|
+
function put(box, text) { box.value = text; box.dispatchEvent(new Event('input', { bubbles: true })); box.focus(); }
|
|
187
193
|
function askClaude(q) {
|
|
188
|
-
const text = 'Tell me about “' + q + '” in this product.';
|
|
189
194
|
const box = onHome() && document.getElementById('hmIn');
|
|
190
|
-
if (box) { box
|
|
191
|
-
|
|
195
|
+
if (box) { put(box, q); return; }
|
|
196
|
+
const here = String(document.title || '').replace(/\s*[·|–-]\s*PMOS\s*$/i, '').trim();
|
|
197
|
+
import('./page-chat.js').then(async (M) => {
|
|
198
|
+
await M.openCos({ here, ws: wsParam() || undefined });
|
|
199
|
+
let n = 0; const t = setInterval(() => { const b = document.querySelector('.pc-chat textarea'); if (b || ++n > 20) { clearInterval(t); if (b) put(b, q); } }, 50);
|
|
200
|
+
}).catch(() => location.assign(homeUrl({ say: q })));
|
|
192
201
|
}
|
|
193
202
|
|
|
194
203
|
/** A file read-only from its worktree, in the Viewer: Markdown as text, HTML as a still picture (no scripts), anything else as text. */
|
|
@@ -713,3 +713,10 @@ body.cz-home .hm-hd.hv-bar > .hv-hi { flex: 1 0 auto; max-width: 100%; }
|
|
|
713
713
|
.gm-qp { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; border-radius: 14px; background: var(--cz-bluebg); }
|
|
714
714
|
.gm-qp > span { flex: 1; min-width: 0; font-size: var(--fs-body); font-weight: var(--fw-strong); color: var(--cz-blueink); line-height: 1.35; }
|
|
715
715
|
.gm-qp em { display: block; font-style: normal; font-weight: var(--fw-regular); font-size: var(--fs-label); color: var(--cz-ink2); }
|
|
716
|
+
|
|
717
|
+
/* chief-of-staff C2/C3: the expired line and Done with Undo in Your day */
|
|
718
|
+
.yd-exp { margin: 8px 0 4px; font-size: var(--fs-meta); color: var(--cz-ink3); line-height: 1.5; }
|
|
719
|
+
.yd-mvs.dn { color: var(--cz-ok, var(--cz-blueink)); }
|
|
720
|
+
.yd-dn .yd-mvt b { font-weight: inherit; color: var(--cz-ink2); }
|
|
721
|
+
.ob-d h3 { margin: 12px 0 6px; font-size: var(--fs-row); font-weight: var(--fw-strong); }
|
|
722
|
+
.ob-body { white-space: pre-wrap; font: inherit; line-height: 1.5; margin: 8px 0; padding: 12px 14px; border-radius: 14px; background: var(--cz-well); color: var(--cz-ink); }
|
|
@@ -183,7 +183,7 @@ export function headHtml(it) {
|
|
|
183
183
|
? `<button type="button" class="cz-vw-pri${x.text && !phone ? '' : ' i'}${x.blue ? ' blue' : ''}" data-cz-vw="press" data-cz-vw-p="${esc(x.act)}" aria-label="${esc(x.label)}" title="${esc(x.label)}">${svg(path(x.icon), 15, 2.2)}${x.text && !phone ? `<span>${esc(x.text)}</span>` : ''}</button>`
|
|
184
184
|
: `<button type="button" class="cz-vw-ib" data-cz-vw="press" data-cz-vw-p="${esc(x.act)}" aria-label="${esc(x.label)}" title="${esc(x.label)}"${x.pressed != null ? ` aria-pressed="${x.pressed ? 'true' : 'false'}"` : ''}>${svg(path(x.icon), 18)}</button>`).join('');
|
|
185
185
|
const sub = o.sub ? `<p class="cz-vw-sub">${esc(o.sub)}</p>` : '';
|
|
186
|
-
const chip = o.chip && (o.chip.n > 0 || o.chip.looking) ? `<button type="button" class="cz-vw-chip${o.chip.looking ? ' live' : ''}" data-cz-vw="chip" aria-haspopup="dialog" aria-label="${esc(o.chip.label || 'Claude proposes ' + o.chip.n + '. Open')}" title="${esc(o.chip.label || 'Claude proposes')}">${svg(ICONS.spark, 13, 2)}${o.chip.n > 0 ? `<b>${esc(o.chip.n)}</b>` : ''}</button>` : '';
|
|
186
|
+
const chip = o.chip && (o.chip.n > 0 || o.chip.looking) ? `<button type="button" class="cz-vw-chip${o.chip.looking ? ' live' : ''}" data-cz-vw="chip" aria-haspopup="dialog" aria-label="${esc(o.chip.label || 'Claude proposes ' + o.chip.n + '. Open')}" title="${esc(o.chip.label || 'Claude proposes')}">${svg(ICONS.spark, 13, 2)}${o.chip.n > 0 && !o.chip.quiet ? `<b>${esc(o.chip.n)}</b>` : ''}</button>` : '';
|
|
187
187
|
return (o.canBack || phone ? ib('back', o.canBack ? (o.backTo ? 'Back to ' + o.backTo : 'Back') : 'Close the viewer', P.back) : '')
|
|
188
188
|
+ (o.fwdTo ? ib('fwd', 'Forward to ' + o.fwdTo, P.fwd) : '')
|
|
189
189
|
+ (o.check ? `<button type="button" class="cz-vw-tile cz-vw-chk s-${esc(o.check.state || 'todo')}" data-cz-vw="press" data-cz-vw-p="check" aria-label="${esc(o.check.label || 'Mark done')}" title="${esc(o.check.title || o.check.label || 'Mark done')}"${o.check.disabled ? ' disabled' : ''}><span class="bx"></span></button>`
|
|
@@ -67,7 +67,7 @@ export function shownUser(text) {
|
|
|
67
67
|
const head = (end >= 0 ? rest.slice(0, end) : rest).trim(), fi = head.lastIndexOf('[Attached files, read each one: ');
|
|
68
68
|
return '/goal ' + (fi > 0 ? head.slice(0, fi).trim() + '\n' + head.slice(fi) : head);
|
|
69
69
|
}
|
|
70
|
-
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
|
|
70
|
+
if (t.startsWith(OPENING) || t.startsWith('[PMOS report]') || t.startsWith('[PMOS program]') || t.startsWith('[PMOS workflow]') || t.startsWith('[PMOS initiative]') || t.startsWith('[PMOS chief of staff]')) { 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
|
|
71
71
|
return t;
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -217,7 +217,7 @@ export function gmModel(Y, D, now = Date.now(), o = {}) {
|
|
|
217
217
|
// Your move: the top 3 of W3's ranked list, the call left out (say it once); with no ranked list, the other calls
|
|
218
218
|
const ranked = Y.rank ? Y.rank.rows.filter((r) => !(c && r.kind === 'call' && r.call && r.call.id === c.id)) : (Y.calls || []).slice(1).map((x) => ({ key: 'call:' + x.id, kind: 'call', call: x, title: x.name, sub: '', age: '' }));
|
|
219
219
|
const move = ranked.slice(0, 3).map((r) => ({ ...r, goal: tagOf(o.tags, r.ws, r.ini), late: r.rank <= 2 && r.days != null && r.days > 0 }));
|
|
220
|
-
const more = ranked.length - move.length + (Y.rank ? Y.rank.older.length : 0);
|
|
220
|
+
const more = ranked.length - move.length + (Y.rank ? (Y.rank.wait || []).length + (Y.rank.older || []).length : 0); // chief-of-staff C3: Can wait folds too
|
|
221
221
|
|
|
222
222
|
// the lead: honest first; a call that moves a goal ties today to the quarter; else Your day's own line. A failed source is one quiet line
|
|
223
223
|
// under the lead, never the lead itself (G1, G3), and the face is never happier than the data
|