create-pmos 0.552.0 → 0.554.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 -27
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-board-test.js +4 -4
- package/workspace/briefing-premium-initiative-test.js +2 -2
- package/workspace/briefing-premium-test.js +1 -1
- package/workspace/changelog.json +32 -0
- package/workspace/chat-asks-test.js +5 -5
- package/workspace/ev-everywhere-test.js +2 -2
- package/workspace/goals-clear-ui-test.js +1 -1
- package/workspace/guide/agent-capabilities.md +31 -31
- package/workspace/guide/claude-proposes.md +68 -68
- package/workspace/guide/cli.md +22 -22
- package/workspace/guide/cloud.md +3 -3
- package/workspace/guide/home.md +38 -38
- package/workspace/guide/index.md +5 -5
- package/workspace/guide/intelligence-okr-goals.md +4 -4
- package/workspace/guide/layout.md +23 -23
- package/workspace/guide/notes.md +8 -8
- package/workspace/guide/programs.md +18 -18
- package/workspace/guide/reports.md +16 -16
- package/workspace/guide/settings-and-switches.md +37 -37
- package/workspace/guide/statuses.md +3 -3
- package/workspace/home-other-product-test.js +8 -8
- package/workspace/home-pill-test.js +3 -3
- package/workspace/home-rows-test.js +7 -7
- package/workspace/intel-report-ui-test.js +1 -1
- package/workspace/intelligence-gaps-ui-test.js +2 -2
- package/workspace/lib/agent-roles.js +1 -1
- package/workspace/lib/autonomy.js +1 -1
- package/workspace/lib/bg-queue.js +1 -1
- package/workspace/lib/board-pack-route.js +18 -2
- package/workspace/lib/briefing-premium-agent.js +2 -2
- package/workspace/lib/decision-memory.js +2 -2
- package/workspace/lib/driver-decide.js +2 -2
- package/workspace/lib/driver.js +6 -2
- package/workspace/lib/folder-needs.js +1 -1
- package/workspace/lib/goal-chat.js +5 -5
- package/workspace/lib/goal-watch.js +1 -1
- package/workspace/lib/grill-runs.js +5 -5
- package/workspace/lib/idle-lab.js +5 -5
- package/workspace/lib/impact-runs.js +2 -2
- package/workspace/lib/job-graph.js +2 -2
- package/workspace/lib/metric-draft-runs.js +4 -4
- package/workspace/lib/metric-read-runs.js +5 -5
- package/workspace/lib/news-for-you.js +1 -1
- package/workspace/lib/proposal-runs.js +6 -6
- package/workspace/lib/refresh.js +1 -1
- package/workspace/lib/routes-board-premium.js +1 -1
- package/workspace/lib/routes-goal-status.js +4 -4
- package/workspace/lib/routes-impact.js +1 -1
- package/workspace/lib/routes-insight-moves.js +1 -1
- package/workspace/lib/routes-loose.js +2 -2
- package/workspace/lib/routes-mentions.js +1 -1
- package/workspace/lib/routes-metric-drafts.js +9 -9
- package/workspace/lib/routes-proposals.js +8 -8
- package/workspace/lib/routes-ready-reports.js +1 -1
- package/workspace/lib/routes-slash.js +1 -1
- package/workspace/lib/source-heal.js +3 -3
- package/workspace/lib/state-root.js +22 -1
- package/workspace/lib/task-items.js +1 -1
- package/workspace/lib/task-links.js +2 -2
- package/workspace/lib/today.js +2 -2
- package/workspace/live-pill-round-test.js +1 -1
- package/workspace/metric-drafts-ui-test.js +1 -1
- package/workspace/milestone-suggest-test.js +5 -5
- package/workspace/news-viewers-test.js +3 -3
- package/workspace/okr-goals-ui-test.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-chat-chart-tab-test.js +1 -1
- package/workspace/premium-chat-context-test.js +4 -4
- package/workspace/premium-chat-goal-setup-test.js +3 -3
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-line-test.js +6 -6
- package/workspace/premium-chat-notes-test.js +4 -4
- package/workspace/premium-chat-report-tab-test.js +4 -4
- package/workspace/premium-rec-now-test.js +2 -2
- package/workspace/public/pm/batch-press.js +4 -4
- package/workspace/public/pm/bd-fc-card.js +1 -1
- package/workspace/public/pm/bd-goal.js +39 -2
- package/workspace/public/pm/bd-next.js +10 -10
- package/workspace/public/pm/bd-prog-panel.js +5 -5
- package/workspace/public/pm/bd-views.js +9 -4
- package/workspace/public/pm/chat-ask.js +1 -1
- package/workspace/public/pm/chat-context.js +3 -3
- package/workspace/public/pm/cozy-board.css +15 -0
- package/workspace/public/pm/cozy-evmodel.js +1 -1
- package/workspace/public/pm/cozy-home.css +1 -1
- package/workspace/public/pm/cozy-lab-ins.js +4 -4
- package/workspace/public/pm/cozy-lab.js +1 -1
- package/workspace/public/pm/cozy-news.js +2 -2
- package/workspace/public/pm/cozy-onboard.js +2 -2
- package/workspace/public/pm/cozy-rec-now.js +5 -5
- package/workspace/public/pm/cozy-rec-present.js +1 -1
- package/workspace/public/pm/cozy-reveal.js +2 -2
- package/workspace/public/pm/cozy-settings.js +19 -19
- package/workspace/public/pm/cozy-steps.js +2 -2
- package/workspace/public/pm/cozy-viewer.js +1 -1
- package/workspace/public/pm/ctx-wedge.js +1 -1
- package/workspace/public/pm/dash-view.js +1 -1
- package/workspace/public/pm/goal-chat.js +6 -6
- package/workspace/public/pm/good-morning.js +2 -2
- package/workspace/public/pm/grill-words.js +1 -1
- package/workspace/public/pm/home-app.js +19 -19
- package/workspace/public/pm/home-ask.js +1 -1
- package/workspace/public/pm/home-chat.js +6 -6
- package/workspace/public/pm/home-data.js +2 -2
- package/workspace/public/pm/home-day.js +3 -3
- package/workspace/public/pm/home-drift.js +1 -1
- package/workspace/public/pm/home-goal.js +1 -1
- package/workspace/public/pm/home-impact.js +1 -1
- package/workspace/public/pm/home-ini.js +1 -1
- package/workspace/public/pm/home-line.js +5 -5
- package/workspace/public/pm/home-mentions.js +4 -4
- package/workspace/public/pm/home-moment.js +1 -1
- package/workspace/public/pm/home-need.js +1 -1
- package/workspace/public/pm/home-phone-card.js +1 -1
- package/workspace/public/pm/home-stage-card.js +2 -2
- package/workspace/public/pm/home-sweep.js +1 -1
- package/workspace/public/pm/home-today.js +2 -2
- package/workspace/public/pm/ini-about.js +2 -2
- package/workspace/public/pm/ini-agent.js +5 -5
- package/workspace/public/pm/ini-links.js +5 -5
- package/workspace/public/pm/ini-props.js +11 -11
- package/workspace/public/pm/ini-view-model.js +1 -1
- package/workspace/public/pm/ini-view.js +2 -2
- package/workspace/public/pm/intent.js +3 -3
- package/workspace/public/pm/loose-props.js +5 -5
- package/workspace/public/pm/metric-drafts.js +1 -1
- package/workspace/public/pm/ms-suggest.js +3 -3
- package/workspace/public/pm/next-prompt-ui.js +2 -2
- package/workspace/public/pm/okr-list.js +1 -1
- package/workspace/public/pm/page-chat.js +2 -2
- package/workspace/public/pm/premium-attach.js +1 -1
- package/workspace/public/pm/premium-board.js +15 -8
- package/workspace/public/pm/premium-initiative-head.js +1 -1
- package/workspace/public/pm/premium-insights.js +3 -3
- package/workspace/public/pm/premium-meeting.js +1 -1
- package/workspace/public/pm/premium-mtg-replay.js +1 -1
- package/workspace/public/pm/premium-notes.js +2 -2
- package/workspace/public/pm/premium-report-read.js +6 -6
- package/workspace/public/pm/premium-report-tab.js +7 -7
- package/workspace/public/pm/premium-shell.js +18 -18
- package/workspace/public/pm/premium-vw-ctx.js +3 -3
- package/workspace/public/pm/premium-vw-jira.js +1 -1
- package/workspace/public/pm/premium-welcome.js +1 -1
- package/workspace/public/pm/prog-order.js +2 -2
- package/workspace/public/pm/program-charter.js +3 -3
- package/workspace/public/pm/program-model.js +1 -1
- package/workspace/public/pm/ready-lib.js +4 -4
- package/workspace/public/pm/report-flow.js +7 -7
- package/workspace/public/pm/report-orders-ui.js +2 -2
- package/workspace/public/pm/split-merge.js +5 -5
- package/workspace/public/pm/story.js +1 -1
- package/workspace/public/pm/task-card.js +1 -1
- package/workspace/public/pm/tk-draft.js +1 -1
- package/workspace/public/pm/tk-send.js +2 -2
- package/workspace/public/pm/wf-page.js +2 -2
- package/workspace/ready-dash-ui-test.js +1 -1
- package/workspace/rec-present-test.js +2 -2
- package/workspace/server.js +12 -8
- package/workspace/session-names-test.js +3 -3
- package/workspace/skills/doc-check.skill +2 -0
- package/workspace/skills/idle-lab-prototype.skill +2 -0
- package/workspace/skills/measure.skill +2 -0
- package/workspace/skills/metric-read.skill +2 -0
- package/workspace/skills/milestone-review.skill +2 -0
- package/workspace/skills/report-biweekly.skill +2 -0
- package/workspace/skills/report-daily.skill +2 -0
- package/workspace/skills/report-design.skill +2 -0
- package/workspace/skills/report-monthly.skill +2 -0
- package/workspace/skills/report-weekly.skill +2 -0
- package/workspace/split-merge-ui-test.js +3 -3
- package/workspace/stage-card-test.js +4 -4
- package/workspace/task-links-test.js +1 -1
- package/workspace/task-views-test.js +7 -7
- package/workspace/tk-tasks-test.js +2 -2
|
@@ -67,7 +67,7 @@ export async function sync(M, D, H) {
|
|
|
67
67
|
export function chipOf() {
|
|
68
68
|
const p = S.props;
|
|
69
69
|
if (!p || !p.n) return null;
|
|
70
|
-
return { n: p.n, label: '
|
|
70
|
+
return { n: p.n, label: 'PMOS proposes a clean-up of ' + plural(p.n, 'row', 'rows') + '. Open' };
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/* ── the Viewer ── */
|
|
@@ -121,7 +121,7 @@ function pickHtml(p, x) {
|
|
|
121
121
|
const opt = (id, title, attr, mark) => `<button type="button" role="menuitemradio" aria-checked="${cur === id}" ${attr}><span class="lp-tl">${mark || esc(tileOf(title))}</span><span class="t">${esc(title)}</span>${cur === id ? SVG(I.check, 15, 2.4) : ''}</button>`;
|
|
122
122
|
const first = p.type === 'ini' ? opt(p.data.ini, p.data.title || p.data.ini, `data-lp-to="${esc(p.data.ini)}"`) : opt('start', p.data.title, 'data-lp-to=""');
|
|
123
123
|
const rest = S.inis.filter((i) => i.id !== (p.type === 'ini' ? p.data.ini : '')).map((i) => opt(i.id, i.title, `data-lp-to="${esc(i.id)}"`)).join('');
|
|
124
|
-
return `<div class="lp-pick" role="menu" data-esc-layer aria-label="Where ${esc(x.title)} goes"><p>
|
|
124
|
+
return `<div class="lp-pick" role="menu" data-esc-layer aria-label="Where ${esc(x.title)} goes"><p>PMOS’s pick</p>${first}${rest ? '<p>Your initiatives</p>' + rest : ''}`
|
|
125
125
|
+ `<button type="button" role="menuitemradio" aria-checked="${cur === 'new'}" data-lp-to="+new" class="nw"><span class="lp-tl">${SVG(I.plus, 14, 2.2)}</span><span class="t">New initiative from this row</span></button></div>`;
|
|
126
126
|
}
|
|
127
127
|
function propHtml(p) {
|
|
@@ -142,7 +142,7 @@ function histHtml() {
|
|
|
142
142
|
}
|
|
143
143
|
function bodyHtml() {
|
|
144
144
|
const P = S.props;
|
|
145
|
-
if (!P || !P.n) return `<div class="lp">${P && P.looking ? '<p class="lp-intro">
|
|
145
|
+
if (!P || !P.n) return `<div class="lp">${P && P.looking ? '<p class="lp-intro">PMOS is looking at the rows now. Its proposals show here.</p>' : '<p class="lp-intro">Nothing to clean up now.</p>'}${histHtml()}</div>`;
|
|
146
146
|
const total = Math.max(S.H && S.H.total ? S.H.total() : 0, P.total || 0, P.n), rest = total - P.n;
|
|
147
147
|
const intro = plural(total, 'row sits', 'rows sit') + ' outside an initiative. ' + (rest > 0 ? 'I can place ' + P.n + '; the other ' + rest + ' stay where they are.' : 'I can place ' + (P.n === 1 ? 'it' : 'all ' + P.n) + '.') + ' The tick at the top approves all.';
|
|
148
148
|
const secs = P.groups.map((g) => `<section class="lp-sec" aria-label="${esc(SECTION[g.group])}"><h4>${esc(SECTION[g.group])}</h4>${g.props.map(propHtml).join('')}</section>`).join('');
|
|
@@ -157,7 +157,7 @@ function draw() {
|
|
|
157
157
|
b.scrollTop = top;
|
|
158
158
|
if (histOpen) { const h = b.querySelector('.lp-hist'); if (h) h.open = true; }
|
|
159
159
|
v.setPresses(c.id, presses());
|
|
160
|
-
const t = '
|
|
160
|
+
const t = 'PMOS proposes' + (S.props && S.props.n ? ' ' + S.props.n : '');
|
|
161
161
|
if (c.title !== t && v.retitle) v.retitle(c.id, t);
|
|
162
162
|
}
|
|
163
163
|
const say = (m, undo) => { if (S.H && S.H.toast) S.H.toast(m, undo); };
|
|
@@ -255,7 +255,7 @@ export function open(H) {
|
|
|
255
255
|
// the first proposal opens, so its rows read at once (XlcA1Desk); the rest stay folded until pressed
|
|
256
256
|
const first = S.props && S.props.groups && S.props.groups[0] && S.props.groups[0].props[0];
|
|
257
257
|
S.open = new Set(first ? [first.id] : []);
|
|
258
|
-
v.open({ id: 'lp', kind: '
|
|
258
|
+
v.open({ id: 'lp', kind: 'PMOS proposes', title: 'PMOS proposes' + (S.props && S.props.n ? ' ' + S.props.n : ''), icon: I.spark, presses: presses(),
|
|
259
259
|
onPress: (act) => { if (act === 'all') keep([], true); },
|
|
260
260
|
render: (b) => { b.onclick = onPress; b.onkeydown = (e) => { if (e.key === 'Escape' && S.pick) { e.stopPropagation(); S.pick = null; draw(); } }; draw(); },
|
|
261
261
|
onClose: () => { S.out = new Set(); S.pick = null; if (S.H && S.H.redraw) S.H.redraw(); } });
|
|
@@ -99,7 +99,7 @@ function editRows(rows, label) {
|
|
|
99
99
|
+ field(r, 'source', r.source || '', 'Where ' + r.name + ' is measured', { ph: 'Measured by', max: 40 }) + '</span></div>').join('')}</div>`;
|
|
100
100
|
}
|
|
101
101
|
const editFoot = (scope, id, ask, busy) => `<div class="md-ft"><p class="md-why">Name, target and where it is measured. Anything else, ask me in Home.</p>`
|
|
102
|
-
+ ib({ href: ask, icon: I.ask, label: 'Ask
|
|
102
|
+
+ ib({ href: ask, icon: I.ask, label: 'Ask PMOS in Home to change something else', title: 'Ask in Home' })
|
|
103
103
|
+ ib({ act: 'cancel', scope, id, icon: I.x, label: 'Cancel the edit', title: 'Cancel', busy })
|
|
104
104
|
+ ib({ act: 'save', scope, id, icon: I.check, label: 'Save the edit', title: 'Save', solid: true, busy }) + '</div>';
|
|
105
105
|
|
|
@@ -79,11 +79,11 @@ export function firstHtml(p, L) {
|
|
|
79
79
|
const n = L.length, from = fromWords(L);
|
|
80
80
|
const all = L.length > 1 ? `<span class="msg-ends"><button type="button" class="msg-ok" data-ms-act="keepall" aria-label="Keep all ${n} suggestions" title="Keep all">${SV(I.check, 15, 2.4)}</button>`
|
|
81
81
|
+ `<button type="button" class="msg-ib" data-ms-act="dropall" aria-label="Drop all ${n} suggestions" title="Drop all">${SV(I.x, 15)}</button></span>` : '';
|
|
82
|
-
return `<div class="msg-box" role="group" aria-label="
|
|
83
|
-
+ `<span class="msg-ht"><b>
|
|
82
|
+
return `<div class="msg-box" role="group" aria-label="PMOS's suggested milestones"><div class="msg-hd"><span class="msg-mk ad" aria-hidden="true">${adler('needs-you', 28, { label: false })}</span>`
|
|
83
|
+
+ `<span class="msg-ht"><b>PMOS suggests ${n} ${plural(n, 'milestone', 'milestones')}</b>${from ? ' from ' + esc(from) : ''}</span>${all}</div>`
|
|
84
84
|
+ `<div role="list">${L.map((i) => rowHtml(p, i, 'first')).join('')}</div></div>`;
|
|
85
85
|
}
|
|
86
|
-
export function rowsHtml(p, L) { return L.length ? `<div class="msg-list" role="list" aria-label="
|
|
86
|
+
export function rowsHtml(p, L) { return L.length ? `<div class="msg-list" role="list" aria-label="PMOS's milestone changes">${L.map((i) => rowHtml(p, i, '')).join('')}</div>` : ''; }
|
|
87
87
|
export function homeSub(p) {
|
|
88
88
|
const L = openOf(p); if (!L.length) return '';
|
|
89
89
|
if (!((p && p.milestones) || []).length && L.every((i) => i.op === 'add')) return L.length + ' ' + plural(L.length, 'milestone', 'milestones') + ' suggested';
|
|
@@ -35,14 +35,14 @@ export function nextPromptUi({ el, host, box, redrawFoot }) {
|
|
|
35
35
|
function draw() {
|
|
36
36
|
let html = '';
|
|
37
37
|
if (N.mode === 'cards' && N.cards.length) {
|
|
38
|
-
html = `<div class="np-list" role="group" aria-label="Suggested next prompts">${N.cards.map((c, i) => `<button type="button" class="np-card${c.rec ? ' rec' : ''}" data-np-use="${i}" aria-label="Use this prompt: ${esc(c.text)}"${c.rec ? ' title="
|
|
38
|
+
html = `<div class="np-list" role="group" aria-label="Suggested next prompts">${N.cards.map((c, i) => `<button type="button" class="np-card${c.rec ? ' rec' : ''}" data-np-use="${i}" aria-label="Use this prompt: ${esc(c.text)}"${c.rec ? ' title="PMOS recommends this one"' : ''}>${STAR}<span class="np-t">${esc(c.text)}</span></button>`).join('')}</div>`;
|
|
39
39
|
} else if (N.mode === 'spin') {
|
|
40
40
|
html = `<div class="np-spin" role="status"><span class="np-sp">${ic(SPIN, 14)}</span><span>Sharpening…</span></div>`;
|
|
41
41
|
} else if (N.mode === 'sharp' && N.sharp) {
|
|
42
42
|
const P = N.prefs || {}, st = P.style || 'engineer';
|
|
43
43
|
const menu = N.menu ? `<div class="np-menu" role="menu" aria-label="Style of sharper prompts" data-esc-layer><p class="np-mh">Sharpen as</p>${STYLES.map(([k, l, d]) => `<button type="button" role="menuitemradio" aria-checked="${st === k}" class="np-mi" data-np-voice="${k}"><span class="np-ck">${st === k ? ic(CHECK) : ''}</span><span><b>${esc(l)}</b><em>${esc(k === 'own' && !P.rules ? 'Write your rules in Settings first' : d)}</em></span></button>`).join('')}`
|
|
44
44
|
+ `<span class="np-sep" role="separator"></span><button type="button" role="menuitemcheckbox" class="np-mi np-swr" aria-checked="${!!P.sharpen}" data-np-sw><b>Sharpen as I type</b><span class="np-sw${P.sharpen ? ' on' : ''}" aria-hidden="true"><i></i></span></button></div>` : '';
|
|
45
|
-
html = `<div class="np-card rec np-sh"><button type="button" class="np-use" data-np-sharp aria-label="Use the sharper prompt: ${esc(N.sharp)}" title="
|
|
45
|
+
html = `<div class="np-card rec np-sh"><button type="button" class="np-use" data-np-sharp aria-label="Use the sharper prompt: ${esc(N.sharp)}" title="PMOS sharpened your prompt">${STAR}<span class="np-t">${esc(N.sharp)}</span></button>`
|
|
46
46
|
+ `<button type="button" class="np-ib" data-np-menu aria-haspopup="menu" aria-expanded="${N.menu}" aria-label="Style of sharper prompts" title="Style of sharper prompts">${ic(SLIDERS)}</button>${menu}</div>`;
|
|
47
47
|
}
|
|
48
48
|
if (wrap.__h !== html) { wrap.__h = html; wrap.innerHTML = html; }
|
|
@@ -243,7 +243,7 @@ export function metricsHtml(L, view) {
|
|
|
243
243
|
/** "3 on their line · checkout sign-in is behind", one dot per goal. S = GET /api/goal-status → { on, behind, broken, dots, line }. */
|
|
244
244
|
export function productLine(S) {
|
|
245
245
|
if (!S || !Array.isArray(S.dots)) return null;
|
|
246
|
-
if (!S.dots.length) return { text: S.line || 'No goal yet ·
|
|
246
|
+
if (!S.dots.length) return { text: S.line || 'No goal yet · PMOS can draft them', dots: [] };
|
|
247
247
|
const low = (t) => String(t || '').replace(/^./, (c) => c.toLowerCase());
|
|
248
248
|
const bad = (S.broken || []).map((t) => low(t) + ' is over its limit').concat((S.behind || []).map((t) => low(t) + ' is behind'));
|
|
249
249
|
const none = S.dots.filter((d) => d.dot === 'none').length;
|
|
@@ -23,7 +23,7 @@ import * as VW from './cozy-viewer.js';
|
|
|
23
23
|
import { pmGet, pmPost, pmHeaders } from './http.js';
|
|
24
24
|
|
|
25
25
|
export const CHAT_ID = 'page-chat';
|
|
26
|
-
const CLAUDE = { key: 'claude', name: '
|
|
26
|
+
const CLAUDE = { key: 'claude', name: 'PMOS', initial: 'P' };
|
|
27
27
|
const CHAT_ICON = 'M5 6.5A2.5 2.5 0 0 1 7.5 4h9A2.5 2.5 0 0 1 19 6.5v7a2.5 2.5 0 0 1-2.5 2.5H11l-4 3.5V16h.5A2.5 2.5 0 0 1 5 13.5z';
|
|
28
28
|
const FLAG = 'M5 21V4h11l-2 4 2 4H5';
|
|
29
29
|
const SHEETS = ['./cozy-home.css', './home-line.css', './page-chat.css'];
|
|
@@ -41,7 +41,7 @@ export function keyOf(it) {
|
|
|
41
41
|
export function targetOf(it, ws) {
|
|
42
42
|
const title = String((it && it.title) || 'this').slice(0, 80);
|
|
43
43
|
return { key: keyOf(it), ws: ws || undefined, title, about: title, scope: { text: title, icon: FLAG }, role: CLAUDE, rich: false,
|
|
44
|
-
placeholder: 'Message
|
|
44
|
+
placeholder: 'Message PMOS about ' + title, empty: 'Ask about ' + title + '. PMOS reads its records and works in a real Claude Code session.' };
|
|
45
45
|
}
|
|
46
46
|
/** Home's own address for the same conversation (⋯ › Open in a new tab). */
|
|
47
47
|
const homeHref = (it, key) => '/premium.html?' + new URLSearchParams({ about: key, label: String(it.title || '').slice(0, 80) }).toString();
|
|
@@ -151,6 +151,6 @@ export function openAttachment(p) {
|
|
|
151
151
|
const name = shownName(p), url = fileUrl(p);
|
|
152
152
|
const view = IMG.test(name) ? `<img class="atview" alt="${esc(name)}" src="${esc(url)}">`
|
|
153
153
|
: PDF.test(name) ? `<iframe class="atpdf" title="${esc(name)}" src="${esc(url)}"></iframe>`
|
|
154
|
-
: `<div class="vwfnone" role="status"><b>${esc(name)}</b><p class="vwmut">PMOS does not show this kind of file here.
|
|
154
|
+
: `<div class="vwfnone" role="status"><b>${esc(name)}</b><p class="vwmut">PMOS does not show this kind of file here. PMOS can read it.</p><div class="vwrow"><a class="vwbtn pri" href="${esc(url)}" download="${esc(name)}">Download</a></div></div>`;
|
|
155
155
|
return vwOpen({ id: 'att:' + p, title: name, icon: 'doc', html: `<div class="vwdoc"><article class="cf vwfile atfile"><header class="cfh"><h1 class="cft">${esc(name)}</h1></header>${view}<footer class="cff"><span>Attached to your message · saved on this machine</span></footer></article></div>` });
|
|
156
156
|
}
|
|
@@ -136,7 +136,10 @@ const rowOf = (key) => (M && M.rows || []).find((r) => r.key === key) || goneRow
|
|
|
136
136
|
/** The rows on screen grouped (pm/bd-prog.js groupsOf): programs first, then the product; or By product. null when no program holds a row here. */
|
|
137
137
|
/** In the PM's sort or own order, the same as Home's (batch 14 item 8): the programs and products, then each product's initiatives. A
|
|
138
138
|
* program's own initiatives keep the program's order. */
|
|
139
|
-
const groups = (L) =>
|
|
139
|
+
const groups = (L) => (goalOn() ? goalGroupsOf(L) : progGroups(L));
|
|
140
|
+
/** By goal (board AwH, every view since batch 29 item 4): the goals' groups, each goal's rows in the PM's sort or own order. */
|
|
141
|
+
const goalGroupsOf = (L) => { const pk = prodKey((M.board && (M.board.product || M.board.name)) || ''), lay = SO.layout(); return GL.asGroups(L, GOALS, (rs) => sortInis(pk, rs, lay, INI_ACC)); };
|
|
142
|
+
const progGroups = (L) => {
|
|
140
143
|
const G = PG.groupsOf(PGS, L, M, byProduct);
|
|
141
144
|
if (!G) return G;
|
|
142
145
|
const lay = SO.layout();
|
|
@@ -509,9 +512,10 @@ function trackRow(r, cls = '', po = false) {
|
|
|
509
512
|
const cellsCls = () => 'bt-cells' + (TK.mode === 'cats' ? ' bands' : TK.mode === 'wf' ? ' wfn' : '');
|
|
510
513
|
const cellsStyle = () => (TK.mode === 'wf' ? ` style="--n:${Math.max(1, TK.steps.length)}"` : '');
|
|
511
514
|
const isME = (r) => r.track && r.track.k >= 6;
|
|
512
|
-
/** By goal (board AwH): on
|
|
515
|
+
/** By goal (board AwH): in every view (batch 29 item 4) and on a shared Board link, when a goal resolves for a row here; else the
|
|
516
|
+
* programs-first grouping draws as before. */
|
|
513
517
|
const goalsHere = () => !!(GOALS && GOALS.goals.length && M && GL.goalGroups(M.initiatives.list.rows, GOALS));
|
|
514
|
-
const goalOn = () => grouping === 'goal' &&
|
|
518
|
+
const goalOn = () => grouping === 'goal' && goalsHere();
|
|
515
519
|
function readGoals() {
|
|
516
520
|
if (!M) return;
|
|
517
521
|
const rows = M.initiatives.list.rows, sig = ((M.board && M.board.ws) || '') + '|' + rows.map((r) => r.anchor || '').join(',');
|
|
@@ -521,7 +525,6 @@ function readGoals() {
|
|
|
521
525
|
}
|
|
522
526
|
function drawTrack(L) {
|
|
523
527
|
TK = trackMode(L);
|
|
524
|
-
readGoals();
|
|
525
528
|
const S = TK.mode === 'pf' ? M.steps || [] : TK.steps || [];
|
|
526
529
|
// one product and no program: its initiatives in the PM's sort or own order, the same as Home's (batch 14 item 8); grouped, groups() sorts each
|
|
527
530
|
const sorted = sortInis(prodKey((M.board && (M.board.product || M.board.name)) || ''), L, SO.layout(), INI_ACC);
|
|
@@ -542,7 +545,7 @@ function drawTrack(L) {
|
|
|
542
545
|
// Grouped, each product folds its own Monitor and Evaluate rows after the first of each, under "N more" (PgBoard .tf); the foot keeps
|
|
543
546
|
// only the ones this page has not loaded
|
|
544
547
|
const GG = goalOn() && TK.mode !== 'cats' ? GL.goalGroups(sorted, GOALS) : null;
|
|
545
|
-
const G = GG ? null :
|
|
548
|
+
const G = GG ? null : progGroups(sorted);
|
|
546
549
|
let inGroups = 0;
|
|
547
550
|
const meFold = (rs) => { const seen2 = new Set(), on = [], off = []; for (const r of rs) { if (isME(r) && seen2.has(r.track.k) && !foldOpen) off.push(r); else { if (isME(r)) seen2.add(r.track.k); on.push(r); } } return { on, off }; };
|
|
548
551
|
// the programs and products are one list the grip arranges, and each product's initiatives another, shared with Home (batch 14 item 8)
|
|
@@ -578,7 +581,10 @@ function drawTime(L) {
|
|
|
578
581
|
const cols = phone ? null : CO.colsFor(bw - 2, { avatar: (n) => V.avatar(n, 'sm') });
|
|
579
582
|
colsFit = cols ? cols.keys.length : 1;
|
|
580
583
|
const nameW = cols ? cols.nw : phone ? 0 : matchMedia('(max-width: 980px)').matches ? 180 : 250;
|
|
581
|
-
|
|
584
|
+
// By goal: a goal's head takes a product's place (pm/bd-goal.js cellHtml); a goal is never a program, so the program rows stay as they are
|
|
585
|
+
const T = timelineHtml(L, M, span, { groups: groups(L), progState, folded: PG.folded,
|
|
586
|
+
prodHtml: (g) => (g.kind === 'goal' ? `<div class="tg-prd tg-gl${PG.folded(g.key) ? ' closed' : ''}" role="row">${GL.cellHtml(g, !PG.folded(g.key))}</div>` : PG.prodHtml(g, 'tg-prd')),
|
|
587
|
+
prodCell: (g, dots) => (g.kind === 'goal' ? GL.cellHtml(g, !PG.folded(g.key), dots) : PG.prodCell(g, dots)), msMode: msMode(), subHtml: (n) => PG.subHtml(n, 'tg-psb'), progTile: () => PG.progTile(), productsOf: PG.productsOf,
|
|
582
588
|
progRisk: (id) => (M.programForecasts || []).find((x) => x.id === id) || null,
|
|
583
589
|
foldBtn: (g) => PG.foldBtn(g.key, g.program.title), memberIcon: (id) => PG.memberIcon(PGS, id), sel: peek && peek.kind !== 'acts' ? peek.key : null, status: statusOf, phone, cols, trackPx: bw - 2 - nameW, avatar: (n) => V.avatar(n, 'sm'),
|
|
584
590
|
askHref: (none) => askHref(null, 'Propose start and end dates for ' + none.map((r) => r.title).join(', ')),
|
|
@@ -613,6 +619,7 @@ $('#bdVieww').addEventListener('change', (e) => { const c = e.target.closest('[d
|
|
|
613
619
|
$('#bdVieww').addEventListener('keydown', (e) => { if (e.key === 'Escape' && closeMenu('bdViewMenu', 'bdView')) { e.stopPropagation(); $('#bdView').focus(); } });
|
|
614
620
|
document.addEventListener('click', (e) => { if (!e.target.closest('#bdVieww')) closeMenu('bdViewMenu', 'bdView'); });
|
|
615
621
|
function drawInit() {
|
|
622
|
+
readGoals(); // By goal in every view (batch 29 item 4): the goals of the rows on screen, read once per set of anchors
|
|
616
623
|
const phone = small(), L = visible(), v = curView();
|
|
617
624
|
const body = $('#ibBody');
|
|
618
625
|
body.dataset.view = v; body.dataset.span = v === 'time' ? span : '';
|
|
@@ -1214,12 +1221,12 @@ function openFindings(r, from) {
|
|
|
1214
1221
|
FCC.init({ rowOf: (k) => rowOf(k), openFindings });
|
|
1215
1222
|
const openIniAny = (r) => { if (r && curView() === 'time') TL.reveal(r.key); openIni(r, $('#chNeed') || $('#bdFind'), 'track'); };
|
|
1216
1223
|
V.init({ M: () => M, wf: wfState, statusOf, usual: usualOf, trail: TI, docMeta, sel: () => (peek && peek.kind !== 'acts' ? peek.key : null), docSel: () => Acts.docSel(),
|
|
1217
|
-
groups: (L) => groups(L), folded: PG.folded, laneHead: (g) => PG.laneHtml(g, g.kind === 'program' ? progState(g.program) : null), subTile: (n) => PG.tileHtml(n, 'bd-ti s'),
|
|
1224
|
+
groups: (L) => groups(L), folded: PG.folded, laneHead: (g) => (g.kind === 'goal' ? GL.laneHtml(g, !PG.folded(g.key)) : PG.laneHtml(g, g.kind === 'program' ? progState(g.program) : null)), progGroups: (L) => progGroups(L), subTile: (n) => PG.tileHtml(n, 'bd-ti s'),
|
|
1218
1225
|
memberIcon: (id) => PG.memberIcon(PGS, id), product: () => (M.board.product || M.board.name || ''), programOf: (r) => programOf(PGS, r.ws || M.board.ws || '', r.id), tileHtml: PG.tileHtml, progTile: PG.progTile });
|
|
1219
1226
|
Asks.init({ M: () => M, load, say, panel: actsPanel, close: closePanel, rowOf, openIni: openIniAny, openDoc: viewDoc, anchors, programs: () => PGS, reloadPrograms: loadPrograms });
|
|
1220
1227
|
Acts.init({ M: () => M, wf: wfState, load, say, panel: actsPanel, close: closePanel, redraw: () => { drawChips(); drawInit(); }, F, rowOf, statusOf, openIni: openIniAny,
|
|
1221
1228
|
openTicket: (ini, tk) => openTicket(ini, tk, $('#bdFind')), askHref, pageHref, trail: TI, docMeta, loadDocMeta, viewDoc,
|
|
1222
|
-
grouping: () => ({ on: groupingOn(), byProduct, by: grouping === 'goal' && !
|
|
1229
|
+
grouping: () => ({ on: groupingOn(), byProduct, by: grouping === 'goal' && !goalsHere() ? (groupingOn() ? 'program' : 'product') : grouping, goal: goalsHere() }), setGrouping, sprintFilter: sprintFilterOn, timeline: () => curView() === 'time',
|
|
1223
1230
|
tune: tuneParts, sprintOnly, toggleSprintOnly: () => { if (F.chips.has('sprint')) F.chips.delete('sprint'); else F.chips.add('sprint'); }, sortPick, refreshJira: () => refreshJira() });
|
|
1224
1231
|
BI.mount({ M: () => M, statusOf, dayTitle, usual: usualOf, fmt, md, ago, segHtml, barHtml: V.barHtml, grill: (id) => GR[id], rowOf, pageHref, askHref, refreshJira: () => refreshJira(), viewDoc,
|
|
1225
1232
|
send: (r) => import('./tk-send.js').then((S) => S.openSend({ ws: r.ws || M.board.ws || null, board: r.boardId || M.board.id, initiative: r.id, toast: say })),
|
|
@@ -220,5 +220,5 @@ export function headHtml(h, o = {}) {
|
|
|
220
220
|
const t = o.title || 'this initiative';
|
|
221
221
|
return `<div class="czi-box ${esc(h.turn)}"><div class="czi-row"><span class="czi-turn ${esc(h.turn)}"><i class="cz-dot ${dot}" aria-hidden="true"></i>${esc(h.turnLabel)}</span><span class="czi-sp"></span><span class="czi-stage">${esc(h.stage)}</span></div>`
|
|
222
222
|
+ ladder + (o.folded ? folded : list)
|
|
223
|
-
+ `<div class="czi-acts"><button type="button" class="czi-cta${h.primary ? '' : ' alt'}" data-czcta>${esc(h.cta)}</button><button type="button" class="czi-ov" data-czov aria-label="Overview of ${esc(t)} with
|
|
223
|
+
+ `<div class="czi-acts"><button type="button" class="czi-cta${h.primary ? '' : ' alt'}" data-czcta>${esc(h.cta)}</button><button type="button" class="czi-ov" data-czov aria-label="Overview of ${esc(t)} with PMOS" title="Overview of ${esc(t)} with PMOS"><span aria-hidden="true">P</span></button></div></div>`;
|
|
224
224
|
}
|
|
@@ -278,7 +278,7 @@ function prodRow(m) {
|
|
|
278
278
|
function allProductsHtml() {
|
|
279
279
|
if (!PF || !PF.rows || PF.rows.length < 2) return '';
|
|
280
280
|
const R = PF.rows, cell = (n) => (n ? `<b>${n}</b>` : '<span class="note">—</span>');
|
|
281
|
-
return `<div class="ins-tbl ins-allp" role="table" aria-label="All products"><div class="ins-tr ins-th ins-pcols" role="row"><div role="columnheader">All products <span>${R.length}</span></div><div role="columnheader">North Star</div><div role="columnheader">Key results read</div><div role="columnheader">Late</div><div role="columnheader">Checks overdue</div><div role="columnheader">Next, by
|
|
281
|
+
return `<div class="ins-tbl ins-allp" role="table" aria-label="All products"><div class="ins-tr ins-th ins-pcols" role="row"><div role="columnheader">All products <span>${R.length}</span></div><div role="columnheader">North Star</div><div role="columnheader">Key results read</div><div role="columnheader">Late</div><div role="columnheader">Checks overdue</div><div role="columnheader">Next, by PMOS</div></div>`
|
|
282
282
|
+ R.map((r) => `<div class="ins-tr ins-row ins-pcols" role="row" data-prod="${esc(r.ws)}" tabindex="0" aria-label="${esc(r.name)}"><div class="nm" role="cell"><span class="ins-pav" aria-hidden="true">${esc(r.initials)}</span><b>${esc(r.name)}</b></div>`
|
|
283
283
|
+ `<div role="cell" class="note">${esc(r.ns)}</div><div role="cell">${r.total === null ? '<span class="note">no OKR file</span>' : `<b>${r.read}</b> <span class="note">of ${r.total}</span>`}</div><div role="cell">${cell(r.late)}</div><div role="cell">${cell(r.over)}</div>`
|
|
284
284
|
+ `<div role="cell">${r.next ? `<span class="ins-dv"><span class="sp" aria-hidden="true">${SV(I.spark)}</span><span>${esc(r.next)}</span></span>` : ''}</div></div>`).join('') + '</div>';
|
|
@@ -598,7 +598,7 @@ function drEditHtml(r) {
|
|
|
598
598
|
+ (r.kind === 'chase' ? `<textarea class="ins-dri" data-drf="body" rows="3" maxlength="2000" aria-label="The message">${esc(raw.body || '')}</textarea>` : '')
|
|
599
599
|
+ (metric && raw.type !== 'Done or not' ? `<input class="ins-dri" data-drf="target" inputmode="decimal" value="${esc(raw.target == null ? '' : String(raw.target))}" aria-label="Target" placeholder="Target">` : '')
|
|
600
600
|
+ (metric ? `<input class="ins-dri" data-drf="source" value="${esc(r.source || '')}" maxlength="40" aria-label="Measured by" placeholder="Measured by">` : '') + '</div>'
|
|
601
|
-
+ `<div class="acts"><a class="cz-ib sm" href="${esc(homeAsk('insights', 'Change the draft ' + r.name + ': '))}" aria-label="Ask
|
|
601
|
+
+ `<div class="acts"><a class="cz-ib sm" href="${esc(homeAsk('insights', 'Change the draft ' + r.name + ': '))}" aria-label="Ask PMOS in Home to change something else" title="Ask PMOS in Home">${SV('M4 5h16v11H9l-5 4z')}</a>`
|
|
602
602
|
+ `<button type="button" class="cz-ib sm" data-okd="cancel" data-row="${esc(r.id)}" aria-label="Cancel the edit" title="Cancel">${SV(I.x)}</button><button type="button" class="cz-ib sm solid" data-okd="save" data-row="${esc(r.id)}" aria-label="Save ${esc(r.name)}" title="Save">${SV(I.chk)}</button></div></div>`;
|
|
603
603
|
}
|
|
604
604
|
const drHtml = (r) => (drEdit === r.id && r.state === 'open' ? drEditHtml(r) : OK.draftHtml(r));
|
|
@@ -708,7 +708,7 @@ function openCheck(id) {
|
|
|
708
708
|
let el = null;
|
|
709
709
|
const editHtml = (r) => `<form class="gc-ed" data-gc-ed><label class="ins-fl">Name<input class="ins-inp" name="name" maxlength="120" value="${esc(r.name)}"></label>`
|
|
710
710
|
+ (r.raw && r.raw.type !== 'Done or not' ? `<label class="ins-fl">Target<input class="ins-inp" name="target" inputmode="decimal" maxlength="20" value="${esc(r.raw && r.raw.target != null ? String(r.raw.target) : '')}"></label>` : '')
|
|
711
|
-
+ `<label class="ins-fl">Measured by<input class="ins-inp" name="source" maxlength="40" value="${esc(r.source || '')}"></label><div class="gc-foot"><a class="cz-ib sm" href="${esc(homeAsk('insights', 'Change how ' + r.name + ' is counted: '))}" aria-label="Ask
|
|
711
|
+
+ `<label class="ins-fl">Measured by<input class="ins-inp" name="source" maxlength="40" value="${esc(r.source || '')}"></label><div class="gc-foot"><a class="cz-ib sm" href="${esc(homeAsk('insights', 'Change how ' + r.name + ' is counted: '))}" aria-label="Ask PMOS in Home to change how it is counted" title="Ask in Home">${SV('M4 5h16v11H9l-5 4z')}</a><span class="gc-sp"></span>`
|
|
712
712
|
+ `<button type="button" class="cz-ib sm" data-gc="edit-x" aria-label="Cancel the edit" title="Cancel">${SV(I.x)}</button><button type="submit" class="cz-ib sm solid" aria-label="Save" title="Save">${SV(I.chk)}</button></div></form>`;
|
|
713
713
|
const draw = () => { if (!el || !document.contains(el)) return; const r = rowOf(), top = el.scrollTop; el.innerHTML = st.edit ? editHtml(r) : GC.checkHtml(r, st); el.scrollTop = top; };
|
|
714
714
|
CHK = { id, st, draw };
|
|
@@ -278,7 +278,7 @@ export const RECORD_LINE = 'Makes a note for this meeting, or uses the one it ha
|
|
|
278
278
|
export const RESUME_LINE = 'Starts listening again on this meeting’s note. The meeting stays open for one hour after a pause.';
|
|
279
279
|
export const STOP_LINE = 'A stopped meeting cannot be resumed. The final notes are written now.';
|
|
280
280
|
export const CONSENT_LINE = 'Tell everyone first. Recording writes down each speaker’s name and words. Everyone on the call should know before it starts.';
|
|
281
|
-
export const FOCUS_LINE = 'Focus reads this meeting every 3 seconds. While the note records, PMOS’s companion, a read-only
|
|
281
|
+
export const FOCUS_LINE = 'Focus reads this meeting every 3 seconds. While the note records, PMOS’s companion, a read-only PMOS run that sends nothing, may read the last minutes of the talk at most every 40 seconds and writes its own notes.';
|
|
282
282
|
/** The mark a meeting row carries when its note records or is paused. */
|
|
283
283
|
export const rowMark = (rows, row) => { const n = noteOfRow(rows, row); return n && n.state === 'recording' ? 'Recording' : n && n.state === 'paused' ? 'Paused' : ''; };
|
|
284
284
|
|
|
@@ -195,7 +195,7 @@ export function wordPopHtml(heard, sug, P) {
|
|
|
195
195
|
const label = n > 1 ? 'Fix it in ' + n + ' places' : 'Fix it';
|
|
196
196
|
return `<div class="vzr-wpop" role="dialog" aria-label="${esc('Fix “' + h + '”')}" data-w="${esc(h)}"><span class="vzr-grab" aria-hidden="true"></span><p class="vzr-wl">Heard as “${esc(h)}”</p>`
|
|
197
197
|
+ `<div class="vzr-wf"><input data-a="wfin" aria-label="${esc('Fix “' + h + '”')}" value="${esc(best || h)}" maxlength="60" spellcheck="false"><button type="button" class="vzr-go" data-a="wfok" aria-label="${esc(label)}" title="${esc(label)}">${ic('chk', 16)}</button></div>`
|
|
198
|
-
+ (best ? `<p class="vzr-sug"><span class="vzr-star" aria-hidden="true">✦</span><span>
|
|
198
|
+
+ (best ? `<p class="vzr-sug"><span class="vzr-star" aria-hidden="true">✦</span><span>PMOS suggests <b>${esc(best)}</b>: ${esc(why)}</span></p><div class="vzr-alt" role="group" aria-label="Other spellings">${alts.map((x, i) => `<button type="button" data-a="walt" data-v="${esc(x)}" aria-pressed="${i === 0}">${esc(x)}</button>`).join('')}</div>` : '')
|
|
199
199
|
+ (n ? `<p class="vzr-scope"><b>${n === 1 ? '1 place' : n + ' places'}</b> in this meeting</p>${P.by.length > 1 || (P.by[0] && P.by[0].k !== 'summary') ? `<div class="vzr-brk">${P.by.map((x) => `<span>${esc(x.text)}</span>`).join('')}</div>` : ''}` : '')
|
|
200
200
|
+ '<i class="vzr-arr" aria-hidden="true"></i></div>';
|
|
201
201
|
}
|
|
@@ -112,7 +112,7 @@ function draw(el) {
|
|
|
112
112
|
+ `<div class="ntd" id="ntEd" contenteditable="true" role="textbox" aria-multiline="true" aria-label="Note" spellcheck="true" data-ph="Write a note. Type # for a heading, - for a bullet, [] for a checkbox."></div>`
|
|
113
113
|
+ `<div class="ntf"><span class="ntw">This conversation · saved on this machine</span>`
|
|
114
114
|
+ `<button type="button" class="ntic" data-nt="sel" aria-label="Add selection to message" title="Add selection to message. Nothing is sent.">${I_ADD}</button>`
|
|
115
|
-
+ `<button type="button" class="ntic pri" data-nt="share" aria-label="Share with
|
|
115
|
+
+ `<button type="button" class="ntic pri" data-nt="share" aria-label="Share with PMOS" title="Share with PMOS: the note goes on your message as a file">${I_SHARE}</button></div></div>`;
|
|
116
116
|
const ed = el.querySelector('#ntEd'); N.ed = ed;
|
|
117
117
|
ed.append(...toDom(parseMd(n ? n.text || '' : ''), document, { editable: true }));
|
|
118
118
|
empty();
|
|
@@ -220,7 +220,7 @@ async function share() {
|
|
|
220
220
|
attachSaved({ name: n.title, saved: n.name, path: n.path, size: new Blob([n.text || '']).size, note: true });
|
|
221
221
|
if (C.toChat) C.toChat();
|
|
222
222
|
if (C.input) C.input.focus();
|
|
223
|
-
say('The note is on your message.
|
|
223
|
+
say('The note is on your message. PMOS reads it when you send.');
|
|
224
224
|
}
|
|
225
225
|
/** The dialog switched conversation: the open Notes tab belonged to the old one. */
|
|
226
226
|
export function syncNotes() { const k = C && C.getKey(); if (N.key && k !== N.key) { flushNotes(); N.key = null; vwClose('notes'); } }
|
|
@@ -543,7 +543,7 @@ async function ordAct(k, v) {
|
|
|
543
543
|
if (!r.ok) return say('The order was not applied: ' + r.error + '.', 'bad');
|
|
544
544
|
R.gal = null;
|
|
545
545
|
await readOrders(); if (R !== me) return;
|
|
546
|
-
return say(r.next ? `From the next cycle this report starts in the ${r.next.name} order. Today's draft stays as agreed.` : `
|
|
546
|
+
return say(r.next ? `From the next cycle this report starts in the ${r.next.name} order. Today's draft stays as agreed.` : `PMOS is writing this draft again in the ${r.order.name} order. Undo puts this one back, for one day.`);
|
|
547
547
|
}
|
|
548
548
|
if (k === 'undo') {
|
|
549
549
|
const r = await post('undo', { path: R.row.path }); if (!r) return;
|
|
@@ -610,11 +610,11 @@ async function openChat() {
|
|
|
610
610
|
* no indication of me having to wait"). Nothing running → ''. */
|
|
611
611
|
export function waitWords(x, draft) {
|
|
612
612
|
const st = x && x.structure, de = x && x.design, out = [];
|
|
613
|
-
if (draft && draft.state === 'drafting') out.push('
|
|
613
|
+
if (draft && draft.state === 'drafting') out.push('PMOS is writing this report again with your sections. It takes a few minutes; the new draft opens here when it lands.');
|
|
614
614
|
else if (draft && draft.state === 'held') out.push('The new draft waits for a check of ' + (draft.sources || []).join(', ') + '.');
|
|
615
|
-
if (st && st.running) out.push('
|
|
616
|
-
else if (st && st.current != null && st.current !== st.saved) out.push('New sections are ready. Open the report from your chat and press Use this;
|
|
617
|
-
if (de && de.running) out.push('
|
|
615
|
+
if (st && st.running) out.push('PMOS is reshaping the sections to your change. It takes a minute or two. Until you keep it, this draft has the standard sections.');
|
|
616
|
+
else if (st && st.current != null && st.current !== st.saved) out.push('New sections are ready. Open the report from your chat and press Use this; PMOS then writes the draft again with them.');
|
|
617
|
+
if (de && de.running) out.push('PMOS is making the look' + ((de.samples || []).length ? ' from ' + de.samples.map((y) => y.name).join(', ') : '') + '. It takes a minute or two. Until then, the slides use the standard PMOS look.');
|
|
618
618
|
return out;
|
|
619
619
|
}
|
|
620
620
|
function waitHtml() {
|
|
@@ -1113,7 +1113,7 @@ export async function openReport(row, hand = {}) {
|
|
|
1113
1113
|
sch: schedPick(null), schErr: '', shr: null, ord: null, gal: null, ordHide: ordHidden(), rv: null, rvHide: new Set(), rvSent: new Set(), shares: null, more: [], hand, cuts: hand.cuts ? { on: 'team', team: null, sponsors: null, err: '' } : null, cycles: (hand.cycles || []).slice(), onIssue: hand.onIssue || null, onChange: hand.onChange || null, vid: 'report:' + row.path };
|
|
1114
1114
|
const head = me.head = () => ({ id: me.vid, kind: 'Report' + (me.audience ? ' · ' + me.audience : ''), title: me.name, icon: me.view === 'doc' ? 'doc' : 'report', full: true, url: viewUrl(row, me.ws), more: me.more,
|
|
1115
1115
|
// the template behind one icon (batch 22 item 14, canvas RfH1): format, readers, when it goes out, and its history
|
|
1116
|
-
presses: me.setup ? [{ act: 'chat', label: 'Talk to
|
|
1116
|
+
presses: me.setup ? [{ act: 'chat', label: 'Talk to PMOS about this report', icon: RF_ICON.chat }, { act: 'template', label: 'Template: format, readers, look, sources', icon: RF_ICON.tune }] : [],
|
|
1117
1117
|
onPress: (a) => { if (R !== me) return; if (a === 'template') openTemplate(); else if (a === 'chat') openChat(); },
|
|
1118
1118
|
render: (b) => { syncMore(); b.__rpHtml = b.innerHTML = panelHtml(); wire(b); }, onClose: () => { if (R === me && !me.reopen) { present(false); R = null; } } });
|
|
1119
1119
|
vOpen(head());
|
|
@@ -354,7 +354,7 @@ function setupHtml(t) {
|
|
|
354
354
|
if (!t.loaded) return '<p class="vz-empty" role="status">Reading the report.</p>';
|
|
355
355
|
if (t.gone) return `<p class="vz-msg">This template (${esc(t.block.id)}) is deleted, or it is not set up in this workspace. Its issued reports are kept.</p>${cyclesHtml(t)}`;
|
|
356
356
|
const cur = s.status === 'paused' ? 'off' : s.schedule;
|
|
357
|
-
const want = t.block.schedule && !sameSched(t.block.schedule, cur) ? `<div class="vz-ask"><p>
|
|
357
|
+
const want = t.block.schedule && !sameSched(t.block.schedule, cur) ? `<div class="vz-ask"><p>PMOS proposes: <b>${esc(schedWords(t.block.schedule))}</b></p><div>${btn('sched-use', 'Change the schedule', { off: t.busy })}</div></div>` : '';
|
|
358
358
|
return `<div class="rp-brief"><p class="rp-lbl">At a glance</p>${glance(s.purpose, s.audience, schedHtml(t, cur) + (s.next_draft ? ` <span class="vz-note">next draft ${esc(s.next_draft.slice(0, 10))}</span>` : ''), OUT[s.output] || s.output)}</div>${want}`
|
|
359
359
|
+ `<div class="vz-sg" role="group" aria-label="Step"><button type="button" data-rt="view|structure" aria-pressed="${t.view === 'structure'}">Structure</button><button type="button" data-rt="view|design" aria-pressed="${t.view === 'design'}">Design</button></div>`
|
|
360
360
|
+ (t.view === 'design' ? designHtml(t) : structureHtml(t)) + cyclesHtml(t)
|
|
@@ -374,7 +374,7 @@ function structureHtml(t) {
|
|
|
374
374
|
const L = plan && plan.outline ? plan.outline.map((x) => [x.title, x.notes || '']) : FRAME;
|
|
375
375
|
const want = shapeOf(t.block);
|
|
376
376
|
const ask = want && !(S && S.running) ? `<div class="vz-ask"><p>Your change: <b>“${esc(want)}”</b></p><div>${btn('s-turn', 'Make the next version', { off: t.busy })}</div></div>` : '';
|
|
377
|
-
const working = S && S.running ? '<p class="vz-msg rp-wait" role="status">
|
|
377
|
+
const working = S && S.running ? '<p class="vz-msg rp-wait" role="status">PMOS is reshaping the sections to your change. It takes a minute or two; Use this shows here when it is ready.</p>' : '';
|
|
378
378
|
const held = t.busy || !!(S && S.running); // a running job holds only these two; Discard and Delete template stay free
|
|
379
379
|
const save = shown != null && S && shown !== S.saved ? btn('s-accept', 'Use this', { off: held }) : '';
|
|
380
380
|
const undo = V.some((v) => v.n < (S ? S.current : 0)) ? btn('s-undo', 'Undo', { sec: true, off: held }) : '';
|
|
@@ -387,7 +387,7 @@ function designHtml(t) {
|
|
|
387
387
|
if (Z.err) return `<p class="vz-msg">${esc(Z.err)}</p>`;
|
|
388
388
|
const V = Z.versions || [], saved = Z.saved ? Z.saved.version : null, s = t.setup || {};
|
|
389
389
|
const ask = t.block.design && !Z.running ? `<div class="vz-ask"><p>Your change: <b>“${esc(t.block.design)}”</b></p><div>${btn('d-turn', 'Make the next version', { off: t.busy })}</div></div>` : '';
|
|
390
|
-
const working = Z.running ? '<p class="vz-msg rp-wait" role="status">
|
|
390
|
+
const working = Z.running ? '<p class="vz-msg rp-wait" role="status">PMOS is making the look. It takes a minute or two; Use it shows here when it is ready.</p>' : '';
|
|
391
391
|
const preview = t.dv != null && t.dv !== saved;
|
|
392
392
|
const head = `<div class="vz-r1"><div class="rp-grow"><h2 class="rp-h2">${esc(s.name || t.block.id)}</h2><p class="vz-note">${esc([s.audience, OUT[s.output] || s.output, s.status === 'paused' ? 'not scheduled' : 'goes out ' + schedWords(s.schedule).replace(/^./, (c) => c.toLowerCase())].filter(Boolean).join(' · '))}</p></div>`
|
|
393
393
|
+ (preview ? '<span class="cz-pill you">Previewing new look</span>' : t.dv != null ? '<span class="cz-pill ok">Saved look</span>' : '') + '</div>';
|
|
@@ -483,7 +483,7 @@ async function press(t, e) {
|
|
|
483
483
|
if (a === 's-accept') { await act(t, async () => { const r = await post('/api/report-structure/accept', { id, n: t.sv }); if (!r || !r.ok) return why(r, 'The structure was not saved.'); t.S = r.structure;
|
|
484
484
|
// the open draft is written again with these sections, so the PM reads the report they asked for now, not next cycle (batch 22 item 13)
|
|
485
485
|
const d = await post('/api/report-setups/draft', { id });
|
|
486
|
-
return 'S' + t.sv + ' is saved. ' + (d && d.ok ? '
|
|
486
|
+
return 'S' + t.sv + ' is saved. ' + (d && d.ok ? 'PMOS is writing the draft again with these sections. It opens under Reports when it lands.' : 'The next cycle follows it. The draft was not written again: ' + why(d, 'no answer') + '.'); }); return; }
|
|
487
487
|
if (a === 's-undo') { const V = t.S.versions.filter((x) => x.n < t.S.current); const to = V[V.length - 1].n; await act(t, async () => { const r = await post('/api/report-structure/revert', { id, n: to }); if (!r || !r.ok) return why(r, 'Undo did not go through.'); t.S = r.structure; t.sv = t.S.current; return 'Back to S' + to + '.'; }); return; }
|
|
488
488
|
if (a === 'd-accept') { await act(t, async () => { const r = await post('/api/report-design/accept', { id, n: t.dv }); if (!r || !r.ok) return why(r, 'The design was not saved.'); t.Z = r.design; return 'Using the new look (D' + t.dv + '). The next cycle follows it, and every section and figure stays.'; }); return; }
|
|
489
489
|
if (a === 'd-keep') {
|
|
@@ -535,7 +535,7 @@ async function startLook(t, id, look) {
|
|
|
535
535
|
const d = await post('/api/report-design/turn', { id, text, points: [] });
|
|
536
536
|
if (!d || !d.ok) { t.block = Object.assign({}, t.block, { design: text }); return ' The look did not start: ' + why(d, 'no answer') + '. Press Make the next version to try again.'; }
|
|
537
537
|
t.Z = Object.assign({}, t.Z, { running: true }); poll(t, 'design');
|
|
538
|
-
return '
|
|
538
|
+
return ' PMOS is making the look' + (added ? ' from ' + added : '') + ' now.';
|
|
539
539
|
}
|
|
540
540
|
/** Draft it (RfH4, RfH7): the answers set the report up, T1 and the conversation are recorded, and its current state opens (RfH1). */
|
|
541
541
|
async function setUp(t) {
|
|
@@ -555,11 +555,11 @@ async function setUp(t) {
|
|
|
555
555
|
let shaping = '';
|
|
556
556
|
if (shape) {
|
|
557
557
|
const s2 = await post('/api/report-structure/turn', { id: r.setup.id, text: shape });
|
|
558
|
-
shaping = s2 && s2.ok ? '
|
|
558
|
+
shaping = s2 && s2.ok ? ' PMOS is reshaping the sections to your change.' : ' The change to its sections did not start: ' + why(s2, 'no answer') + '.';
|
|
559
559
|
}
|
|
560
560
|
// the look Claude proposed with it (batch 22 item 13): the PM's words, and the file to follow
|
|
561
561
|
if (look.text || look.sample) shaping += await startLook(t, r.setup.id, look);
|
|
562
562
|
const d = r.drafted || {};
|
|
563
|
-
const first = d.drafting ? "The report's own session is drafting it." : d.path ? 'The first draft is written.
|
|
563
|
+
const first = d.drafting ? "The report's own session is drafting it." : d.path ? 'The first draft is written. PMOS reads it as your readers would.' : 'The first draft was not written' + (d.error ? ': ' + d.error : '') + '.';
|
|
564
564
|
return current(t, first + (once ? ' It goes out once.' : '') + shaping);
|
|
565
565
|
}
|
|
@@ -275,14 +275,14 @@ export async function openSources() {
|
|
|
275
275
|
* opens the list. Nothing here writes: a message goes through the same ask route as every other conversation. */
|
|
276
276
|
export function openChatPage(key, label) {
|
|
277
277
|
const say = label
|
|
278
|
-
? 'Talk to
|
|
279
|
-
: 'Talk to
|
|
280
|
-
openDlg({ eye: label ? 'Chat · ' + label : 'Chat', title: label ? 'Ask about ' + label : 'Chat', say, stream: turnA(ptx(say)), noteKey: key, pane: `<article class="paper doc"><p class="note">${esc(label ? 'This conversation is about ' + label + '. Files
|
|
278
|
+
? 'Talk to PMOS about ' + label + '. It works in a real Claude Code session: it can read, change files, run commands and take slash commands.'
|
|
279
|
+
: 'Talk to PMOS. It works in a real Claude Code session: it can read, change files, run commands and take slash commands. Pick another session from the list.';
|
|
280
|
+
openDlg({ eye: label ? 'Chat · ' + label : 'Chat', title: label ? 'Ask about ' + label : 'Chat', say, stream: turnA(ptx(say)), noteKey: key, pane: `<article class="paper doc"><p class="note">${esc(label ? 'This conversation is about ' + label + '. Files PMOS opens show here.' : 'Files PMOS opens show here.')}</p></article>`, paneEmpty: true, label: label || 'Chat', sessions: true });
|
|
281
281
|
if (chatPage()) { // the held-open chat (desktop Home) leaves the page live; on a phone Home's chat is a popup and keeps openDlg's veil and inert page
|
|
282
282
|
document.documentElement.style.overflow = '';
|
|
283
283
|
$('#veil').classList.remove('on');
|
|
284
284
|
}
|
|
285
|
-
$('#askIn').placeholder = label ? 'Message
|
|
285
|
+
$('#askIn').placeholder = label ? 'Message PMOS about ' + label : 'Message PMOS, or type /';
|
|
286
286
|
if (desk()) setFull(true); else setTab('chat');
|
|
287
287
|
vwShutPane(); // premium-chat-viewer V1: the conversation has the room until something opens in the viewer
|
|
288
288
|
loadThread(key);
|
|
@@ -341,7 +341,7 @@ export function openDlg(o) {
|
|
|
341
341
|
$('#oMain').innerHTML = o.pane || `<article class="paper doc">${o.html}</article>`; $('#oLab').textContent = o.label || 'Detail';
|
|
342
342
|
if (o.paneEmpty) $('#oMain').dataset.empty = '1'; else delete $('#oMain').dataset.empty; // a placeholder note is not a tab (premium-chat-viewer V2)
|
|
343
343
|
vwReset(); // extra viewer tabs belong to the dialog that opened them
|
|
344
|
-
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><div class="slashm" id="slashM" role="listbox" aria-label="Commands" hidden></div>${attachRowMarkup()}${attachMarkup()}<textarea id="askIn" rows="1" placeholder="Message
|
|
344
|
+
$('#dBody').innerHTML = `<div class="stream" role="log">${o.stream || turnA(ptx(o.say))}</div><form class="askbar" id="askF"><div class="slashm" id="slashM" role="listbox" aria-label="Commands" hidden></div>${attachRowMarkup()}${attachMarkup()}<textarea id="askIn" rows="1" placeholder="Message PMOS, or type /" maxlength="8000" autocomplete="off" enterkeyhint="send" aria-label="A message for PMOS" aria-controls="slashM"></textarea><button type="submit" data-act="ask" id="askGo" aria-label="Send to PMOS" title="Send to PMOS"><svg class="i" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></svg></button></form><div class="askfoot"><p class="fine2" id="askNote">${CHAT_NOTE}</p></div>`;
|
|
345
345
|
mountNotes({ getKey: () => S.key, ws: new URLSearchParams(location.search).get('ws'), input: $('#askIn'), note: $('#askNote'), show: () => { if (!desk()) setTab('out'); }, toChat: () => { if (!desk()) setTab('chat'); } });
|
|
346
346
|
mountAttach({ getKey: () => S.key, input: $('#askIn'), note: $('#askNote'), onSlash: () => { const i = $('#askIn'); if (!i.value.startsWith('/')) i.value = '/' + i.value; i.focus(); drawSlash(); growAsk(); }, onPad: () => openNotes() });
|
|
347
347
|
quietNote();
|
|
@@ -485,7 +485,7 @@ const INTERRUPT = /^\[Request interrupted by user/;
|
|
|
485
485
|
export function sessionHtml(c, goal = null, { answer = false } = {}) {
|
|
486
486
|
if (!c) return '';
|
|
487
487
|
if (c.state === 'ended' && !(c.messages || []).length) return turnAgent('<p class="tt" role="status">This session has ended. Your next message starts a new one.</p>');
|
|
488
|
-
if (c.state !== 'conv' && c.state !== 'ended') return turnAgent(`<p class="tt" role="status">${esc(c.missing || '
|
|
488
|
+
if (c.state !== 'conv' && c.state !== 'ended') return turnAgent(`<p class="tt" role="status">${esc(c.missing || 'PMOS is starting.')}</p>`);
|
|
489
489
|
const msgs = c.messages || [], last = msgs.length - 1;
|
|
490
490
|
const waiting = !c.ask && c.turn !== 'agent' && c.turn !== 'tool';
|
|
491
491
|
const ctx = new Map(turnsOf(msgs, waiting || c.state === 'ended').filter((t) => t.done).map((t) => [t.at, t.items])); // premium-chat-viewer slice 2
|
|
@@ -500,13 +500,13 @@ export function sessionHtml(c, goal = null, { answer = false } = {}) {
|
|
|
500
500
|
}
|
|
501
501
|
const g = splitGoal(m.text), rp = splitReport(g.text); // premium-reports-from-chat: a pmos-report block becomes a chip that opens the Report tab
|
|
502
502
|
const live = i === last && waiting && !!goal && goal.state === 'grilling';
|
|
503
|
-
return turnAgent(`<p class="agtag">
|
|
503
|
+
return turnAgent(`<p class="agtag">PMOS</p>${rp.text ? mdHtml(rp.text) : ''}${goalBlockHtml(g.block, { live, state: goal && goal.state })}${reportChipHtml(rp.block, i)}${chipsHtml(ctx.get(i))}`);
|
|
504
504
|
});
|
|
505
505
|
if (goalProgressHtml(goal)) out.push(goalChipHtml(goal)); // the goal itself is in the viewer's Goal tab (goalView below)
|
|
506
506
|
// item-chat-history: an ended session keeps its conversation on the item; the next message picks it up
|
|
507
507
|
if (c.state === 'ended') out.push(turnAgent('<p class="tt" role="status">This session has ended. Your conversation is kept here, and your next message picks it up.</p>'));
|
|
508
|
-
else if (c.ask) out.push(turnAgent(`<p class="agtag">
|
|
509
|
-
else if (c.turn === 'agent' || c.turn === 'tool') out.push(turnAgent(`<p class="tt" role="status">${c.turn === 'tool' && c.openCall ? 'Running ' + esc(c.openCall) + '.' : '
|
|
508
|
+
else if (c.ask) out.push(turnAgent(`<p class="agtag">PMOS asks before it goes on</p><p class="tt">${esc(c.ask.question)}</p><div class="chatopts">${(c.ask.options || []).map((o) => `<button type="button" class="cta alt" data-chat-press="${esc(o.n)}">${esc(o.label)}</button>`).join('')}</div>`));
|
|
509
|
+
else if (c.turn === 'agent' || c.turn === 'tool') out.push(turnAgent(`<p class="tt" role="status">${c.turn === 'tool' && c.openCall ? 'Running ' + esc(c.openCall) + '.' : 'PMOS is working.'} <button type="button" class="cta alt" data-chat-press="esc">Stop</button></p>`));
|
|
510
510
|
return out.join('');
|
|
511
511
|
}
|
|
512
512
|
let threadTimer = null;
|
|
@@ -588,7 +588,7 @@ export function drawThread(th, key, conv) {
|
|
|
588
588
|
goalView(key, conv);
|
|
589
589
|
reportAuto(key, conv);
|
|
590
590
|
const go = $('#askGo'); if (go) go.disabled = !!th.working; // an earlier read-only run still answering
|
|
591
|
-
const n = $('#askNote'); if (n) n.textContent = th.working ? 'The agent is answering. You can write again when it has.' : conv && conv.ask ? '
|
|
591
|
+
const n = $('#askNote'); if (n) n.textContent = th.working ? 'The agent is answering. You can write again when it has.' : conv && conv.ask ? 'PMOS is waiting for your answer above.' : CHAT_NOTE;
|
|
592
592
|
if (atEnd) b.scrollTop = b.scrollHeight;
|
|
593
593
|
}
|
|
594
594
|
export async function loadThread(key) {
|
|
@@ -739,7 +739,7 @@ async function sendText(key, text, files) {
|
|
|
739
739
|
const res = await chatPost('ask', files && files.length ? { key, text, files, ...ctx } : { key, text, ...ctx });
|
|
740
740
|
if (go) go.disabled = false;
|
|
741
741
|
if (!res || res.ok !== true) { $('#askNote').textContent = (res && res.error) || 'The message was not sent.'; return false; }
|
|
742
|
-
$('#askNote').textContent = res.started ? '
|
|
742
|
+
$('#askNote').textContent = res.started ? 'PMOS is starting a session for this.' : 'Sent.';
|
|
743
743
|
const b = $('#dBody'); b.scrollTop = b.scrollHeight;
|
|
744
744
|
loadThread(key);
|
|
745
745
|
return true;
|
|
@@ -771,11 +771,11 @@ async function onGoalPress(e) {
|
|
|
771
771
|
if (!S.key || (!say && !gb)) return;
|
|
772
772
|
if (say) { say.disabled = true; await sendText(S.key, say.dataset.chatSay); return; }
|
|
773
773
|
const act = gb.dataset.goal;
|
|
774
|
-
if (act === 'change') { const inp = $('#askIn'); inp.placeholder = 'Tell
|
|
774
|
+
if (act === 'change') { const inp = $('#askIn'); inp.placeholder = 'Tell PMOS what to change'; inp.focus(); return; }
|
|
775
775
|
if (!S.goal) return;
|
|
776
776
|
gb.disabled = true;
|
|
777
777
|
const r = await chatPost('goal', { key: S.key, id: S.goal.id, act, draft: S.draft });
|
|
778
|
-
$('#askNote').textContent = r && r.ok ? ({ start: '
|
|
778
|
+
$('#askNote').textContent = r && r.ok ? ({ start: 'PMOS is starting on the goal.', cancel: 'The goal is cancelled.', stop: 'The goal is stopped.' }[act]) : (r && r.error) || 'The press did not reach the session.';
|
|
779
779
|
loadThread(S.key);
|
|
780
780
|
}
|
|
781
781
|
$('#dBody').addEventListener('click', onGoalPress);
|
|
@@ -809,7 +809,7 @@ $('#dBody').addEventListener('submit', async (e) => {
|
|
|
809
809
|
e.preventDefault();
|
|
810
810
|
const inp = $('#askIn'), text = inp.value.trim(), key = S.key;
|
|
811
811
|
if (!key && S.sid) { // premium-session-list: a session the list opened that has no row of its own
|
|
812
|
-
if (!text) { $('#askNote').textContent = 'Write a message for
|
|
812
|
+
if (!text) { $('#askNote').textContent = 'Write a message for PMOS.'; return; }
|
|
813
813
|
const id = S.sid, pk = 'sid:' + id, p = pendAdd(pk, text);
|
|
814
814
|
inp.value = ''; drawSlash(); growAsk(); pendDraw(pk); // the turn shows at once (batch 24 item 2)
|
|
815
815
|
const r = await pmPost('/api/session/say', { id, text }).catch(() => null);
|
|
@@ -824,11 +824,11 @@ $('#dBody').addEventListener('submit', async (e) => {
|
|
|
824
824
|
if (!key) { $('#askNote').textContent = 'This row has no conversation, so the message was not sent.'; return; }
|
|
825
825
|
const files = attachNames();
|
|
826
826
|
if (files === null) { $('#askNote').textContent = 'A file is still saving. Send when its chip shows its size.'; return; }
|
|
827
|
-
if (!text && !files.length) { $('#askNote').textContent = 'Write a message for
|
|
827
|
+
if (!text && !files.length) { $('#askNote').textContent = 'Write a message for PMOS.'; return; }
|
|
828
828
|
// the turn shows and the box empties at once (batch 24 item 2); a send that fails takes the turn away and puts the words back
|
|
829
829
|
const p = pendAdd(key, text, files);
|
|
830
830
|
inp.value = ''; drawSlash(); growAsk(); pendDraw(key);
|
|
831
|
-
if (await sendText(key, text, files)) { p.sent = true; inp.placeholder = 'Message
|
|
831
|
+
if (await sendText(key, text, files)) { p.sent = true; inp.placeholder = 'Message PMOS, or type /'; clearAttach(); pendDraw(key); }
|
|
832
832
|
else {
|
|
833
833
|
PEND.list = pendOf(key).filter((x) => x !== p); pendDraw(key);
|
|
834
834
|
if (S.key === key && !inp.value) { inp.value = text; growAsk(); }
|
|
@@ -1459,7 +1459,7 @@ function pickSession(id) {
|
|
|
1459
1459
|
$('#dlg').classList.remove('srl-open');
|
|
1460
1460
|
$('#dEye').textContent = r.group === 'pmos' ? 'Started by PMOS' : r.goal ? 'Goal' : 'Session'; $('#dTitle').textContent = r.name; $('#dSub').hidden = true;
|
|
1461
1461
|
const st = $('#dBody .stream'); if (st) clearHtml(st);
|
|
1462
|
-
$('#askF').hidden = !!r.headless; $('#askIn').value = ''; $('#askIn').placeholder = r.key ? 'Message
|
|
1462
|
+
$('#askF').hidden = !!r.headless; $('#askIn').value = ''; $('#askIn').placeholder = r.key ? 'Message PMOS, or type /' : 'Message this session';
|
|
1463
1463
|
if (r.key) { S.sid = null; S.key = r.key; loadThread(r.key); } else { S.key = null; S.sid = id; loadSid(id); }
|
|
1464
1464
|
syncAttach(); syncNotes();
|
|
1465
1465
|
sessionCard(r); railDraw();
|
|
@@ -1477,7 +1477,7 @@ async function loadSid(id) {
|
|
|
1477
1477
|
const b = $('#dBody'), atEnd = b.scrollHeight - b.scrollTop - b.clientHeight < 80;
|
|
1478
1478
|
if (c && c.ok) PEND.sidConv = c;
|
|
1479
1479
|
putHtml(box, c && c.ok ? sessionHtml(c) + pendHtml('sid:' + id, c) : turnA(ptx('The conversation of this session could not be read.')));
|
|
1480
|
-
$('#askNote').textContent = c && c.ask ? '
|
|
1480
|
+
$('#askNote').textContent = c && c.ask ? 'PMOS is waiting for your answer above.' : 'Your message goes to this session.';
|
|
1481
1481
|
if (atEnd) b.scrollTop = b.scrollHeight;
|
|
1482
1482
|
if (c && c.ok && c.state !== 'ended' && $('#dlg').classList.contains('on')) R.sidTimer = setTimeout(() => loadSid(id), 2000);
|
|
1483
1483
|
}
|
|
@@ -34,8 +34,8 @@ export function chipsHtml(items) {
|
|
|
34
34
|
fold = items.filter((it) => !shown.includes(it));
|
|
35
35
|
}
|
|
36
36
|
const id = fold.length ? foldId(fold) : '';
|
|
37
|
-
const more = fold.length ? `<details class="ctxmore" role="listitem" data-ctx-fold="${esc(id)}"${OPEN.has(id) ? ' open' : ''}><summary aria-label="${fold.length} more files and pages
|
|
38
|
-
return `<div class="ctxc" role="list" aria-label="What
|
|
37
|
+
const more = fold.length ? `<details class="ctxmore" role="listitem" data-ctx-fold="${esc(id)}"${OPEN.has(id) ? ' open' : ''}><summary aria-label="${fold.length} more files and pages PMOS read">+${fold.length} read</summary><div class="ctxc">${fold.map((it) => chipHtml(it, false)).join('')}</div></details>` : '';
|
|
38
|
+
return `<div class="ctxc" role="list" aria-label="What PMOS worked with">${shown.map((it, i) => chipHtml(it, i === 0)).join('')}${more}</div>`;
|
|
39
39
|
}
|
|
40
40
|
if (typeof document !== 'undefined') document.addEventListener('toggle', (e) => { const d = e.target; if (!d || !d.dataset || d.dataset.ctxFold == null) return; if (d.open) OPEN.add(d.dataset.ctxFold); else OPEN.delete(d.dataset.ctxFold); }, true);
|
|
41
41
|
/** An item from a chip's data attributes. */
|
|
@@ -61,7 +61,7 @@ export function ticketHtml(key, t) {
|
|
|
61
61
|
/** The Slack tab as HTML. Pure. */
|
|
62
62
|
export function slackHtml(it) {
|
|
63
63
|
const what = it.url ? 'A Slack message' : it.ts ? 'A message in a Slack channel' : 'A Slack channel';
|
|
64
|
-
return `<div class="vwdoc"><div class="vwfnone" role="status"><b>${esc(what)}</b><p class="vwmut">
|
|
64
|
+
return `<div class="vwdoc"><div class="vwfnone" role="status"><b>${esc(what)}</b><p class="vwmut">PMOS worked with this in Slack. PMOS keeps no copy of Slack messages, so it opens in Slack.</p>`
|
|
65
65
|
+ `<div class="vwrow"><a class="vwbtn pri" href="${esc(slackUrl(it))}" target="_blank" rel="noopener noreferrer">Open in Slack</a></div><code>${esc(it.url || it.channel + (it.ts ? ' · ' + it.ts : ''))}</code></div></div>`;
|
|
66
66
|
}
|
|
67
67
|
|