create-pmos 0.425.0 → 0.426.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -13
- package/payload/KIT-VERSION +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/board-deliveries-test.js +153 -0
- package/workspace/board-programs-test.js +19 -10
- package/workspace/board-shot.js +4 -3
- package/workspace/briefing-premium-board-test.js +2 -2
- package/workspace/calm-timeline-test.js +190 -0
- package/workspace/changelog.json +12 -0
- package/workspace/ev-everywhere-test.js +3 -1
- package/workspace/guide/claude-proposes.md +16 -1
- package/workspace/guide/programs.md +2 -1
- package/workspace/lib/board-premium.js +3 -1
- package/workspace/lib/chat-file-locate.js +40 -2
- package/workspace/lib/engine/boards.js +8 -2
- package/workspace/lib/idle-close.js +60 -0
- package/workspace/lib/loose-proposals.js +302 -0
- package/workspace/lib/my-work-premium.js +1 -1
- package/workspace/lib/proposal-runs.js +77 -2
- package/workspace/lib/propose-cli.js +42 -1
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +16 -4
- package/workspace/lib/routes-brief-page.js +9 -1
- package/workspace/lib/routes-loose.js +210 -0
- package/workspace/lib/routes-pm-items.js +27 -17
- package/workspace/lib/task-cli.js +18 -11
- package/workspace/milestone-pins-test.js +170 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -1
- package/workspace/premium-briefing-depth-test.js +1 -1
- package/workspace/premium-chat-term-test.js +13 -2
- package/workspace/premium-core-doc-issue-test.js +1 -1
- package/workspace/product-lane-test.js +30 -17
- package/workspace/public/pm/bd-acts.js +6 -3
- package/workspace/public/pm/bd-deliveries.js +218 -0
- package/workspace/public/pm/bd-pin-card.css +16 -0
- package/workspace/public/pm/bd-pin-card.js +80 -0
- package/workspace/public/pm/bd-pins.js +33 -0
- package/workspace/public/pm/bd-pop.js +2 -0
- package/workspace/public/pm/bd-prog.js +5 -4
- package/workspace/public/pm/bd-span.js +140 -102
- package/workspace/public/pm/cozy-board.css +73 -11
- package/workspace/public/pm/cozy-home.css +16 -1
- package/workspace/public/pm/cozy-today.css +4 -0
- package/workspace/public/pm/home-app.js +14 -0
- package/workspace/public/pm/home-data.js +5 -3
- package/workspace/public/pm/home-list.js +46 -5
- package/workspace/public/pm/home-today.js +15 -5
- package/workspace/public/pm/ini-tasks.js +4 -1
- package/workspace/public/pm/loose-props.css +54 -0
- package/workspace/public/pm/loose-props.js +262 -0
- package/workspace/public/pm/premium-board.js +9 -5
- package/workspace/public/pm/term-view.js +81 -10
- package/workspace/public/premium-board.html +1 -0
- package/workspace/server.js +107 -6
- package/workspace/skills/loose-propose.skill +39 -0
- package/workspace/task-milestones-test.js +15 -6
- package/workspace/test-lists/board-deliveries.json +13 -0
- package/workspace/test-lists/calm-timeline.json +5 -0
- package/workspace/test-lists/loose-props.json +9 -0
- package/workspace/test-lists/milestone-pins.json +6 -0
- package/workspace/timeline-holds-test.js +44 -42
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/* pm/loose-props.js — Claude's clean-up of Home's "Not in an initiative" (feedback batch 13 item 3, option A; canvas In development, XlcA1Desk,
|
|
2
|
+
* XlcA2After, XlcA3Sheet, XlcA4Pick, and the twelve rules of XlcA0Grill). The fold and the routes are lib/loose-proposals.js and
|
|
3
|
+
* lib/routes-loose.js; the rows the server reads are pm/home-list.js looseSnapshot. Nothing is written before the PM's ✓.
|
|
4
|
+
*
|
|
5
|
+
* sync(M, D, H) after each read of Home: sends what the group shows (only when it changed) and keeps what Claude proposes; H.redraw()
|
|
6
|
+
* when the ✦ changes
|
|
7
|
+
* chipOf() → the ✦ on the group's header: { n, label } | null (hidden at 0: zero is silence)
|
|
8
|
+
* open(H) the ✦'s press: "Claude proposes N" in the Viewer. Groups Link, Tidy and Start an initiative, each proposal with ⌄, ✓ and ✕;
|
|
9
|
+
* a Link row's tile changes its initiative (Claude's pick first, then the PM's initiatives, last "+ New initiative from this
|
|
10
|
+
* row"); ✕ on a row leaves it out (struck, with Undo). ✓ in the header approves every row not left out. An open proposal
|
|
11
|
+
* shows 5 rows, then "+N more". After the first approval a History fold lists each one with its own Undo.
|
|
12
|
+
* closeOne(H, sid) the Home pill menu's ✓ on a session that is idle and safe to close (item 7)
|
|
13
|
+
* The host gives H.toast(text, undo?), H.reload(), H.where() → { ws, board } (the product a new initiative starts in), H.total() → the rows
|
|
14
|
+
* the group shows, H.today() → YYYY-MM-DD. */
|
|
15
|
+
import { pmGet, pmPost } from './http.js';
|
|
16
|
+
import { looseSnapshot } from './home-list.js';
|
|
17
|
+
|
|
18
|
+
const CSS = new URL('./loose-props.css', import.meta.url).href;
|
|
19
|
+
if (typeof document !== 'undefined' && document.head && !document.querySelector(`link[href="${CSS}"]`)) {
|
|
20
|
+
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; document.head.appendChild(l);
|
|
21
|
+
}
|
|
22
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
23
|
+
const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
24
|
+
export const I = {
|
|
25
|
+
spark: 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z',
|
|
26
|
+
check: 'M5 12l5 5 9-10', x: 'M6 6l12 12M18 6L6 18', down: 'M6 9l6 6 6-6', up: 'M6 15l6-6 6 6', undo: 'M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3',
|
|
27
|
+
link: 'M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1',
|
|
28
|
+
merge: 'M8 8h11v11H8zM5 16V5h11', done: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M8 12l3 3 5-6', away: 'M4 5h16v4H4zM5 9v10h14V9M10 13h4',
|
|
29
|
+
start: 'M12 5v14M5 12h14', clock: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M12 7v5l3 2', repeat: 'M17 2l3 3-3 3M4 11V9a4 4 0 0 1 4-4h12M7 22l-3-3 3-3M20 13v2a4 4 0 0 1-4 4H4',
|
|
30
|
+
chev: 'M7 10l5 5 5-5', plus: 'M12 5v14M5 12h14', power: 'M12 3v8M6.3 6.3a8 8 0 1 0 11.4 0',
|
|
31
|
+
};
|
|
32
|
+
const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
|
|
33
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
34
|
+
const md = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? MON[+m[2] - 1] + ' ' + +m[3] : ''; };
|
|
35
|
+
const ago = (iso, today) => {
|
|
36
|
+
const a = Date.parse(String(iso || '').slice(0, 10) + 'T00:00:00Z'), b = Date.parse(String(today || '').slice(0, 10) + 'T00:00:00Z');
|
|
37
|
+
if (!Number.isFinite(a) || !Number.isFinite(b)) return '';
|
|
38
|
+
const n = Math.max(0, Math.round((b - a) / 864e5));
|
|
39
|
+
return n === 0 ? 'today' : n + ' d ago';
|
|
40
|
+
};
|
|
41
|
+
/** Two letters for an initiative's tile ("IDPF data fixes" → ID, "Tender new CIAM" → TC). */
|
|
42
|
+
export const tileOf = (title) => { const w = String(title || '').trim().split(/[\s_-]+/).filter(Boolean); return (w.length > 1 && w[0].length < 4 ? w[0][0] + w[1][0] : String(w[0] || '?').slice(0, 2)).toUpperCase(); };
|
|
43
|
+
const SHOW = 5; // an open proposal shows 5 rows, then "+N more" (the grill's legacy pile)
|
|
44
|
+
|
|
45
|
+
const S = { props: null, history: [], inis: [], sig: '', H: null, open: new Set(), more: new Set(), out: new Set(), choices: {}, pick: null, busy: false };
|
|
46
|
+
|
|
47
|
+
/* ── reading and the ✦ ── */
|
|
48
|
+
const sigOf = (t) => { let h = 5381; for (let i = 0; i < t.length; i++) h = ((h * 33) ^ t.charCodeAt(i)) >>> 0; return h.toString(36); };
|
|
49
|
+
export async function sync(M, D, H) {
|
|
50
|
+
S.H = H;
|
|
51
|
+
const raw = looseSnapshot(M, D);
|
|
52
|
+
// to the day: a live chat's last output moves every few seconds, and idle is counted in days, so a new minute is not a change to send
|
|
53
|
+
const snap = { ...raw, rows: raw.rows.map((r) => ({ ...r, at: String(r.at || '').slice(0, 10) })) };
|
|
54
|
+
S.inis = snap.inis;
|
|
55
|
+
const sig = sigOf(JSON.stringify(snap));
|
|
56
|
+
const today = H.today ? H.today() : '';
|
|
57
|
+
// the page reads first, and sends what it shows only when the server holds something else: opening Home writes nothing new
|
|
58
|
+
let r = await pmGet('/api/loose-props?today=' + encodeURIComponent(today)).catch(() => null);
|
|
59
|
+
if (!r || r.ok === false) return;
|
|
60
|
+
if ((r.sig || '') !== sig && (snap.rows.length || r.sig)) r = await pmPost('/api/loose-props/rows', { ...snap, sig, today }).catch(() => null);
|
|
61
|
+
if (!r || r.ok === false) return;
|
|
62
|
+
const was = JSON.stringify(chipOf());
|
|
63
|
+
S.props = r.props || null; S.history = r.history || [];
|
|
64
|
+
if (JSON.stringify(chipOf()) !== was && H.redraw) H.redraw();
|
|
65
|
+
if (isShown()) draw();
|
|
66
|
+
}
|
|
67
|
+
export function chipOf() {
|
|
68
|
+
const p = S.props;
|
|
69
|
+
if (!p || !p.n) return null;
|
|
70
|
+
return { n: p.n, label: 'Claude proposes a clean-up of ' + plural(p.n, 'row', 'rows') + '. Open' };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* ── the Viewer ── */
|
|
74
|
+
const VW = () => (typeof window !== 'undefined' ? window.czViewer : null);
|
|
75
|
+
const isShown = () => { const v = VW(), c = v && v.current(); return !!(c && c.id === 'lp'); };
|
|
76
|
+
const ib = (attr, label, icon, cls = '') => `<button type="button" class="lp-ib${cls ? ' ' + cls : ''}" ${attr} aria-label="${esc(label)}" title="${esc(label)}">${SVG(icon, 16, 2.2)}</button>`;
|
|
77
|
+
const iconOf = (p) => ({ ini: I.link, merge: I.merge, finish: I.done, close: I.power, away: I.away, new: I.start }[p.type] || I.link);
|
|
78
|
+
function titleOf(p) {
|
|
79
|
+
const n = p.rows.filter((x) => !S.out.has(x.row)).length;
|
|
80
|
+
if (p.type === 'ini') return 'Link ' + n + ' to ' + (p.data.title || p.data.ini);
|
|
81
|
+
if (p.type === 'merge') return 'Merge ' + plural(n, 'double', 'doubles');
|
|
82
|
+
if (p.type === 'finish') return 'Finish ' + plural(n, 'chat that is done', 'chats that are done');
|
|
83
|
+
if (p.type === 'away') return 'Put away ' + plural(n, 'idle chat', 'idle chats');
|
|
84
|
+
if (p.type === 'close') return 'Close ' + plural(n, 'idle session that is safe', 'idle sessions that are safe');
|
|
85
|
+
return 'Start “' + (p.data.title || 'a new initiative') + '” from ' + n;
|
|
86
|
+
}
|
|
87
|
+
function whyOf(p) {
|
|
88
|
+
if (p.type === 'merge' && p.into) return 'Your item “' + p.into.title + '” stays; the chat with the same name joins it. ' + (p.why && !/^Your item stays/.test(p.why) ? p.why : '');
|
|
89
|
+
if (p.type === 'new') return (p.why ? p.why + ' ' : '') + 'It starts in the first stage of your board.';
|
|
90
|
+
return p.why || '';
|
|
91
|
+
}
|
|
92
|
+
/** The quiet line under a row: what it is, and why it is here. */
|
|
93
|
+
function metaOf(p, x) {
|
|
94
|
+
const today = S.H && S.H.today ? S.H.today() : '';
|
|
95
|
+
if (p.type === 'finish') return md(x.quoteAt) + ': “' + x.quote + '”';
|
|
96
|
+
if (p.type === 'away') return 'Last message ' + (ago(x.at, today) || 'long ago');
|
|
97
|
+
if (p.type === 'close') return [x.ini ? (iniById(x.ini) || {}).title || '' : 'Not in an initiative', x.say].filter(Boolean).join(' · ');
|
|
98
|
+
if (x.kind === 'meeting') return (x.daily || 'Meeting') + ' · links every one from today';
|
|
99
|
+
return [x.kind === 'item' ? 'Your item' : 'Chat', ago(x.at, today), x.waits ? 'waits on you' : '', x.late ? 'late' : ''].filter(Boolean).join(' · ');
|
|
100
|
+
}
|
|
101
|
+
const iniById = (id) => S.inis.find((i) => i.id === id) || null;
|
|
102
|
+
function tileHtml(p, x) {
|
|
103
|
+
if (p.type !== 'ini' && p.type !== 'new') return '';
|
|
104
|
+
const c = S.choices[x.row];
|
|
105
|
+
const title = c ? (c.new ? 'New: ' + x.title : (iniById(c.ini) || {}).title || c.ini) : p.type === 'ini' ? p.data.title || p.data.ini : p.data.title;
|
|
106
|
+
const t = c && c.new ? '+' : tileOf(title);
|
|
107
|
+
const on = S.pick === x.row;
|
|
108
|
+
return `<button type="button" class="lp-tile${c ? ' moved' : ''}${on ? ' on' : ''}" data-lp-tile="${esc(x.row)}" data-lp-p="${esc(p.id)}" aria-haspopup="menu" aria-expanded="${on}" aria-label="${esc('Goes to ' + title + '. Choose another')}" title="${esc(title)}"><b>${esc(t)}</b>${SVG(I.chev, 12, 2.4)}</button>`;
|
|
109
|
+
}
|
|
110
|
+
function rowHtml(p, x) {
|
|
111
|
+
const out = S.out.has(x.row);
|
|
112
|
+
const lead = x.kind === 'meeting' ? `<span class="lp-mk">${SVG(I.clock, 15)}</span>` : x.waits ? '<span class="lp-mk"><i class="lp-dot" role="img" aria-label="Waits on you"></i></span>' : x.late ? '<span class="lp-mk"><i class="lp-late" role="img" aria-label="Late"></i></span>' : '<span class="lp-mk"></span>';
|
|
113
|
+
const meta = out ? 'Left out by you' : metaOf(p, x);
|
|
114
|
+
const act = out ? ib(`data-lp-back="${esc(x.row)}" data-lp-scope="${esc(p.scope)}"`, 'Undo: put it back', I.undo) : ib(`data-lp-out="${esc(x.row)}" data-lp-scope="${esc(p.scope)}"`, 'Leave this one out', I.x);
|
|
115
|
+
return `<div class="lp-r${out ? ' out' : ''}">${lead}<span class="w"><b>${esc(x.title)}</b><small>${x.kind === 'meeting' && x.daily && !out ? SVG(I.repeat, 12, 2) : ''}${esc(meta)}</small></span>${out ? '' : tileHtml(p, x)}${act}</div>`
|
|
116
|
+
+ (S.pick === x.row ? pickHtml(p, x) : '');
|
|
117
|
+
}
|
|
118
|
+
/** The picker right under a tile (XlcA4Pick): Claude's pick first, then the PM's initiatives, last a new initiative from this row. */
|
|
119
|
+
function pickHtml(p, x) {
|
|
120
|
+
const c = S.choices[x.row], cur = c ? (c.new ? 'new' : c.ini) : p.type === 'ini' ? p.data.ini : 'start';
|
|
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
|
+
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
|
+
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>Claude’s pick</p>${first}${rest ? '<p>Your initiatives</p>' + rest : ''}`
|
|
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
|
+
}
|
|
127
|
+
function propHtml(p) {
|
|
128
|
+
const op = S.open.has(p.id), all = S.more.has(p.id), rows = all ? p.rows : p.rows.slice(0, SHOW), left = p.rows.length - rows.length;
|
|
129
|
+
return `<div class="lp-p" data-lp="${esc(p.id)}"><div class="lp-ph"><span class="lp-ic">${SVG(iconOf(p), 17)}</span><span class="w"><b>${esc(titleOf(p))}</b>${whyOf(p) ? `<small>${esc(whyOf(p))}</small>` : ''}</span>`
|
|
130
|
+
+ ib(`data-lp-fold="${esc(p.id)}" aria-expanded="${op}"`, op ? 'Hide the rows' : 'Show the rows', op ? I.up : I.down)
|
|
131
|
+
+ ib(`data-lp-keep="${esc(p.id)}"`, 'Approve', I.check, 'ok') + ib(`data-lp-drop="${esc(p.id)}"`, 'Drop it', I.x) + '</div>'
|
|
132
|
+
+ (op ? `<div class="lp-rows">${rows.map((x) => rowHtml(p, x)).join('')}${left > 0 ? `<button type="button" class="lp-more" data-lp-more="${esc(p.id)}">+${left} more</button>` : ''}</div>` : '')
|
|
133
|
+
+ '</div>';
|
|
134
|
+
}
|
|
135
|
+
const SECTION = { link: 'Link', tidy: 'Tidy', start: 'Start an initiative' };
|
|
136
|
+
function histHtml() {
|
|
137
|
+
const h = S.history || [];
|
|
138
|
+
if (!h.length) return '';
|
|
139
|
+
const when = (iso) => { const d = new Date(iso); return Number.isNaN(d.getTime()) ? '' : md(iso.slice(0, 10)) + ' ' + String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0'); };
|
|
140
|
+
return `<details class="lp-hist"><summary>History</summary>${h.map((x) => `<div class="lp-hr${x.undone ? ' undone' : ''}"><span class="w"><b>${esc(x.said || plural(x.n, 'row placed', 'rows placed'))}</b><small>${esc(when(x.at))}${x.undone ? ' · undone' : ''}</small></span>`
|
|
141
|
+
+ (x.undone ? '' : ib(`data-lp-undo="${esc(x.batch)}"`, 'Undo this approval', I.undo)) + '</div>').join('')}</details>`;
|
|
142
|
+
}
|
|
143
|
+
function bodyHtml() {
|
|
144
|
+
const P = S.props;
|
|
145
|
+
if (!P || !P.n) return `<div class="lp">${P && P.looking ? '<p class="lp-intro">Claude is looking at the rows now. Its proposals show here.</p>' : '<p class="lp-intro">Nothing to clean up now.</p>'}${histHtml()}</div>`;
|
|
146
|
+
const total = Math.max(S.H && S.H.total ? S.H.total() : 0, P.total || 0, P.n), rest = total - P.n;
|
|
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
|
+
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('');
|
|
149
|
+
return `<div class="lp"><p class="lp-intro">${esc(intro)}</p>${secs}${histHtml()}</div>`;
|
|
150
|
+
}
|
|
151
|
+
const presses = () => (S.props && S.props.n ? [{ act: 'all', label: 'Approve all ' + S.props.n, icon: I.check, solid: true }] : []);
|
|
152
|
+
function draw() {
|
|
153
|
+
const v = VW(), b = v && v.body(), c = v && v.current();
|
|
154
|
+
if (!b || !c || c.id !== 'lp') return;
|
|
155
|
+
const top = b.scrollTop, hist = b.querySelector('.lp-hist'), histOpen = !!(hist && hist.open);
|
|
156
|
+
b.innerHTML = bodyHtml();
|
|
157
|
+
b.scrollTop = top;
|
|
158
|
+
if (histOpen) { const h = b.querySelector('.lp-hist'); if (h) h.open = true; }
|
|
159
|
+
v.setPresses(c.id, presses());
|
|
160
|
+
const t = 'Claude proposes' + (S.props && S.props.n ? ' ' + S.props.n : '');
|
|
161
|
+
if (c.title !== t && v.retitle) v.retitle(c.id, t);
|
|
162
|
+
}
|
|
163
|
+
const say = (m, undo) => { if (S.H && S.H.toast) S.H.toast(m, undo); };
|
|
164
|
+
async function after(r) {
|
|
165
|
+
if (r && r.props !== undefined) { S.props = r.props || null; S.history = r.history || S.history; }
|
|
166
|
+
draw();
|
|
167
|
+
if (S.H && S.H.reload) await Promise.resolve(S.H.reload()).catch(() => {});
|
|
168
|
+
}
|
|
169
|
+
async function keep(ids, all) {
|
|
170
|
+
if (S.busy) return;
|
|
171
|
+
S.busy = true;
|
|
172
|
+
const at = S.H && S.H.where ? S.H.where() : null, today = S.H && S.H.today ? S.H.today() : undefined;
|
|
173
|
+
const res = await pmPost('/api/loose-props/keep', { ...(all ? { all: true } : { ids }), out: [...S.out], choices: S.choices, ...(at ? { where: at } : {}), today }).catch(() => null);
|
|
174
|
+
S.busy = false;
|
|
175
|
+
if (!res || res.ok === false) { say((res && res.error) || 'Nothing was placed.'); return; }
|
|
176
|
+
S.choices = {}; S.pick = null;
|
|
177
|
+
const batch = res.batch;
|
|
178
|
+
say(res.said + (res.warn ? '. ' + res.warn : ''), async () => {
|
|
179
|
+
const u = await pmPost('/api/loose-props/undo', { batch, today }).catch(() => null);
|
|
180
|
+
if (!u || u.ok === false) return { ok: false, error: (u && u.error) || 'The undo did not land.' };
|
|
181
|
+
if (u.kept) say(plural(u.kept, 'change was', 'changes were') + ' kept: a started initiative stays on the Board.');
|
|
182
|
+
await after(u);
|
|
183
|
+
return { ok: true };
|
|
184
|
+
});
|
|
185
|
+
await after(res);
|
|
186
|
+
if (!S.props || !S.props.n) { const v = VW(); if (v && isShown()) v.close(); }
|
|
187
|
+
}
|
|
188
|
+
/** The pill menu's ✓ on one session (batch 13 item 7, canvas XcsA1Pill): closes it if it is still idle and safe; the toast has Undo. */
|
|
189
|
+
export async function closeOne(H, sid) {
|
|
190
|
+
S.H = H;
|
|
191
|
+
const today = H && H.today ? H.today() : undefined;
|
|
192
|
+
const res = await pmPost('/api/loose-props/close', { sid, today }).catch(() => null);
|
|
193
|
+
if (!res || res.ok === false) { say((res && res.error) || 'The session was not closed.'); if (H && H.reload) await Promise.resolve(H.reload()).catch(() => {}); return; }
|
|
194
|
+
const batch = res.batch;
|
|
195
|
+
say(res.said, async () => {
|
|
196
|
+
const u = await pmPost('/api/loose-props/undo', { batch, today }).catch(() => null);
|
|
197
|
+
if (!u || u.ok === false) return { ok: false, error: (u && u.error) || 'The undo did not land.' };
|
|
198
|
+
await after(u);
|
|
199
|
+
return { ok: true };
|
|
200
|
+
});
|
|
201
|
+
await after(res);
|
|
202
|
+
}
|
|
203
|
+
async function onPress(e) {
|
|
204
|
+
const b = e.target.closest('button'); if (!b) { if (S.pick && !e.target.closest('.lp-pick')) { S.pick = null; draw(); } return; }
|
|
205
|
+
const d = b.dataset;
|
|
206
|
+
if (d.lpFold) { if (S.open.has(d.lpFold)) S.open.delete(d.lpFold); else S.open.add(d.lpFold); draw(); return; }
|
|
207
|
+
if (d.lpMore) { S.more.add(d.lpMore); draw(); return; }
|
|
208
|
+
if (d.lpTile) { S.pick = S.pick === d.lpTile ? null : d.lpTile; draw(); const m = VW().body().querySelector('.lp-pick [aria-checked="true"]') || VW().body().querySelector('.lp-pick button'); if (m) m.focus(); return; }
|
|
209
|
+
if ('lpTo' in d) {
|
|
210
|
+
const row = S.pick, p = (S.props.groups || []).flatMap((g) => g.props).find((x) => x.rows.some((y) => y.row === row));
|
|
211
|
+
if (row && p) {
|
|
212
|
+
const v = d.lpTo;
|
|
213
|
+
if (v === '+new') { const at = S.H && S.H.where ? S.H.where() : {}; const own = iniById(p.data.ini) || {}; S.choices[row] = { new: true, ws: own.ws || at.ws, board: own.board || at.board, anchor: own.anchor || '' }; }
|
|
214
|
+
else if (!v || (p.type === 'ini' && v === p.data.ini)) delete S.choices[row];
|
|
215
|
+
else { const i = iniById(v) || { id: v }; S.choices[row] = { ini: i.id, title: i.title, ...(i.ws ? { ws: i.ws } : {}) }; }
|
|
216
|
+
}
|
|
217
|
+
S.pick = null; draw(); return;
|
|
218
|
+
}
|
|
219
|
+
if (d.lpKeep) { await keep([d.lpKeep], false); return; }
|
|
220
|
+
if (d.lpDrop) {
|
|
221
|
+
const p = (S.props.groups || []).flatMap((g) => g.props).find((x) => x.id === d.lpDrop); if (!p) return;
|
|
222
|
+
b.disabled = true;
|
|
223
|
+
const r = await pmPost('/api/loose-props/drop', { scope: p.scope, rows: p.rows.map((x) => x.row) }).catch(() => null);
|
|
224
|
+
if (!r || r.ok === false) { b.disabled = false; say((r && r.error) || 'Nothing was changed.'); return; }
|
|
225
|
+
await refresh(); return;
|
|
226
|
+
}
|
|
227
|
+
if (d.lpOut || d.lpBack) {
|
|
228
|
+
const row = d.lpOut || d.lpBack, back = !!d.lpBack;
|
|
229
|
+
b.disabled = true;
|
|
230
|
+
const r = await pmPost('/api/loose-props/' + (back ? 'undrop' : 'drop'), { scope: d.lpScope, rows: [row] }).catch(() => null);
|
|
231
|
+
if (!r || r.ok === false) { b.disabled = false; say((r && r.error) || 'Nothing was changed.'); return; }
|
|
232
|
+
// the row stays drawn, struck, until the Viewer closes: Undo puts it back (XlcA1Desk)
|
|
233
|
+
if (back) S.out.delete(row); else { S.out.add(row); delete S.choices[row]; }
|
|
234
|
+
draw(); return;
|
|
235
|
+
}
|
|
236
|
+
if (d.lpUndo) {
|
|
237
|
+
b.disabled = true;
|
|
238
|
+
const r = await pmPost('/api/loose-props/undo', { batch: d.lpUndo, today: S.H && S.H.today ? S.H.today() : undefined }).catch(() => null);
|
|
239
|
+
if (!r || r.ok === false) { b.disabled = false; say((r && r.error) || 'The undo did not land.'); return; }
|
|
240
|
+
say(r.kept ? 'Undone. ' + plural(r.kept, 'change was', 'changes were') + ' kept: a started initiative stays on the Board.' : 'Undone.');
|
|
241
|
+
await after(r);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
async function refresh() {
|
|
245
|
+
const r = await pmGet('/api/loose-props?today=' + encodeURIComponent(S.H && S.H.today ? S.H.today() : '')).catch(() => null);
|
|
246
|
+
if (r && r.ok) { S.props = r.props || null; S.history = r.history || []; }
|
|
247
|
+
draw();
|
|
248
|
+
if (S.H && S.H.redraw) S.H.redraw();
|
|
249
|
+
}
|
|
250
|
+
/** The ✦'s press. */
|
|
251
|
+
export function open(H) {
|
|
252
|
+
const v = VW(); if (!v) return;
|
|
253
|
+
if (H) S.H = H;
|
|
254
|
+
S.out = new Set(); S.choices = {}; S.pick = null; S.more = new Set();
|
|
255
|
+
// the first proposal opens, so its rows read at once (XlcA1Desk); the rest stay folded until pressed
|
|
256
|
+
const first = S.props && S.props.groups && S.props.groups[0] && S.props.groups[0].props[0];
|
|
257
|
+
S.open = new Set(first ? [first.id] : []);
|
|
258
|
+
v.open({ id: 'lp', kind: 'Claude proposes', title: 'Claude proposes' + (S.props && S.props.n ? ' ' + S.props.n : ''), icon: I.spark, presses: presses(),
|
|
259
|
+
onPress: (act) => { if (act === 'all') keep([], true); },
|
|
260
|
+
render: (b) => { b.onclick = onPress; b.onkeydown = (e) => { if (e.key === 'Escape' && S.pick) { e.stopPropagation(); S.pick = null; draw(); } }; draw(); },
|
|
261
|
+
onClose: () => { S.out = new Set(); S.pick = null; if (S.H && S.H.redraw) S.H.redraw(); } });
|
|
262
|
+
}
|
|
@@ -24,6 +24,7 @@ import * as PK from './cozy-pick.js'; // the one product picker Home, Board an
|
|
|
24
24
|
import { mountNav } from './cozy-nav.js';
|
|
25
25
|
import { mountLivePill } from './cozy-live-pill.js';
|
|
26
26
|
import { stepsHelpHtml } from './bd-stages.js';
|
|
27
|
+
import { msMode } from './bd-pins.js';
|
|
27
28
|
import { timelineHtml, legendHtml, hasHold, planKeys, gapKeys, plainGaps, skipsOf, skipWords, gapWords, SPANS, md } from './bd-span.js';
|
|
28
29
|
import * as TL from './bd-scroll.js';
|
|
29
30
|
import * as Acts from './bd-acts.js';
|
|
@@ -40,6 +41,7 @@ import * as SM from './split-merge.js'; // split one initiative in two, or mer
|
|
|
40
41
|
import * as PM from './prog-move.js'; // move an initiative out of its program, or to another (canvas LpA1More, LpA2Other)
|
|
41
42
|
import * as Pop from './bd-pop.js'; // the order of a program's initiatives: the grip and Claude's order from the dates (canvas RoADrag, RoASuggest)
|
|
42
43
|
import * as BI from './bd-ini-panel.js';
|
|
44
|
+
import * as DL from './bd-deliveries.js'; // the Deliveries lane under the timeline's axis (batch 13 item 4, XcalmA6Lane)
|
|
43
45
|
import { nextHtml } from './bd-next.js';
|
|
44
46
|
import { statusOf as ivStatus } from './ini-view-model.js';
|
|
45
47
|
import { initiativeRename, taskRename } from './rename-press.js';
|
|
@@ -426,9 +428,10 @@ function drawTrack(L) {
|
|
|
426
428
|
/* ── the timeline (AgBoardTimeline; TsCOpen, TsCDesk, TsAllSpans, TsCPhone) ───────────────────────────────────────── */
|
|
427
429
|
function drawTime(L) {
|
|
428
430
|
const S = M.steps || [], phone = PHONE.matches, bw = $('#ibBody').clientWidth || innerWidth;
|
|
429
|
-
const T = timelineHtml(L, M, span, { groups: groups(L), progState, folded: PG.folded, prodHtml: (g) => PG.prodHtml(g, 'tg-prd'), prodCell: (g) => PG.prodCell(g), subHtml: (n) => PG.subHtml(n, 'tg-psb'), progTile: () => PG.progTile(), productsOf: PG.productsOf,
|
|
431
|
+
const T = timelineHtml(L, M, span, { groups: groups(L), progState, folded: PG.folded, prodHtml: (g) => PG.prodHtml(g, 'tg-prd'), prodCell: (g, dots) => PG.prodCell(g, dots), msMode: msMode(), subHtml: (n) => PG.subHtml(n, 'tg-psb'), progTile: () => PG.progTile(), productsOf: PG.productsOf,
|
|
430
432
|
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, trackPx: bw - 2 - (phone ? 0 : matchMedia('(max-width: 980px)').matches ? 180 : 250), avatar: (n) => V.avatar(n, 'sm'),
|
|
431
|
-
askHref: (none) => askHref(null, 'Propose start and end dates for ' + none.map((r) => r.title).join(', '))
|
|
433
|
+
askHref: (none) => askHref(null, 'Propose start and end dates for ' + none.map((r) => r.title).join(', ')),
|
|
434
|
+
lane: (c) => DL.laneHtml(c, { span, progState }) });
|
|
432
435
|
return T.html;
|
|
433
436
|
}
|
|
434
437
|
/** A phone's view switch (BdPhone): List, By stage, the stage track and the timeline (TsCPhone: it scrolls sideways like the desktop's). */
|
|
@@ -516,12 +519,12 @@ $('#ibBody').addEventListener('click', (e) => {
|
|
|
516
519
|
const op = e.target.closest('[data-open]'); if (op) { Acts.open[op.dataset.open](op); return; }
|
|
517
520
|
const st = e.target.closest('[data-steps]'); if (st) { togglePop('popSteps', st); return; }
|
|
518
521
|
const tk = e.target.closest('[data-tk]'); if (tk) { openTicket(tk.dataset.ini, tk.dataset.tk, tk); return; }
|
|
519
|
-
if (e.target.closest('[data-act], [data-hold]')) return; // pm/bd-acts.js handles its own presses (a ⏸ on the timeline opens its hold there)
|
|
522
|
+
if (e.target.closest('[data-act], [data-hold], [data-ms-pick]')) return; // pm/bd-acts.js handles its own presses (a ⏸ on the timeline opens its hold there; a ◇ its milestones, pm/bd-pin-card.js)
|
|
520
523
|
const pg = e.target.closest('[data-prog]'); if (pg) { PG.openProgram(pg.dataset.prog, pg); return; }
|
|
521
524
|
// a counted milestone ◇ lists its milestones right under it; on a phone the row's bar lane opens them in a sheet (batch 11 item 3)
|
|
522
525
|
const mc = e.target.closest('[data-ms-row]'); if (mc) { msPop(mc, rowOf(mc.dataset.msRow), mc.dataset.msIds.split(' ')); return; }
|
|
523
526
|
// a product lane's counted ◇ lists its milestones with their initiatives; on a phone a tap on the lane lists them all in a sheet (batch 11 item 17)
|
|
524
|
-
const ml = e.target.closest('[data-ms-lane]'); if (ml) { lanePop(ml, ml.dataset.msLane); return; }
|
|
527
|
+
const ml = e.target.closest('[data-ms-lane]'); if (ml) { lanePop(ml, ml.dataset.msLane, ml.dataset.laneName); return; }
|
|
525
528
|
const pl = PHONE.matches && e.target.closest('.tgq-r.tg-lane > .tg-p[data-lane-ms]'); if (pl) { lanePop(pl, pl.dataset.laneMs, pl.dataset.laneName); return; }
|
|
526
529
|
// a gap's press (batch 11 item 13): its words, and + New task with its dates while part of it is ahead
|
|
527
530
|
const gp = e.target.closest('[data-gap]'); if (gp) { gapPop(gp, rowOf(gp.dataset.gap)); return; }
|
|
@@ -529,6 +532,7 @@ $('#ibBody').addEventListener('click', (e) => {
|
|
|
529
532
|
const lane = PHONE.matches && e.target.closest('.tgq-r[data-row] > .tg-p'); if (lane) { const r = rowOf(lane.parentElement.dataset.row); if (r && ((r.milestones || []).length || plainGaps(r).length || skipsOf(r).length)) { msPop(lane, r, null, true); return; } }
|
|
530
533
|
const b = e.target.closest('[data-key]'); if (b) openIni(rowOf(b.dataset.key), b, view === 'time' ? 'time' : 'track');
|
|
531
534
|
});
|
|
535
|
+
DL.wire($('#ibBody'), { redraw: () => drawInit() }); // the Deliveries lane: hover links the row, the fold is remembered
|
|
532
536
|
$('#ibBody').addEventListener('keydown', (e) => { if ((e.key === 'Enter' || e.key === ' ') && e.target.matches('[data-steps]')) { e.preventDefault(); togglePop('popSteps', e.target); } });
|
|
533
537
|
/* By stage (BdByStage): a card dragged to another column moves the initiative there (POST /api/boards/move), with Undo in the toast. The column is
|
|
534
538
|
* one of the eight steps; the move goes to the first of the board's own stages that maps onto it. */
|
|
@@ -1019,7 +1023,7 @@ V.init({ M: () => M, wf: wfState, statusOf, usual: usualOf, trail: TI, docMeta,
|
|
|
1019
1023
|
Asks.init({ M: () => M, load, say, panel: actsPanel, close: closePanel, rowOf, openIni: openIniAny, openDoc: viewDoc, anchors, programs: () => PGS, reloadPrograms: loadPrograms });
|
|
1020
1024
|
Acts.init({ M: () => M, wf: wfState, load, say, panel: actsPanel, close: closePanel, redraw: () => { drawChips(); drawInit(); if (tab === 'docs') drawDocs(); }, F, rowOf, statusOf, openIni: openIniAny,
|
|
1021
1025
|
openTicket: (ini, tk) => openTicket(ini, tk, $('#bdFind')), askHref, pageHref, trail: TI, docMeta, loadDocMeta, viewDoc,
|
|
1022
|
-
grouping: () => ({ on: groupingOn(), byProduct }), setGrouping, sprintFilter: sprintFilterOn });
|
|
1026
|
+
grouping: () => ({ on: groupingOn(), byProduct }), setGrouping, sprintFilter: sprintFilterOn, timeline: () => curView() === 'time' });
|
|
1023
1027
|
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,
|
|
1024
1028
|
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 })),
|
|
1025
1029
|
acts: (r, b) => Acts.open.row(r, b), hold: (r, i, b) => Acts.open.hold(r, i, b), grillOpen: (r, b) => Asks.openGrill(r.id, r.title, (r.track && r.track.label) || 'Triage', false, b), onShow: iniShown, onHide: iniHidden,
|
|
@@ -1,22 +1,93 @@
|
|
|
1
1
|
/* pm/term-view.js — a running session's terminal, read only, in the Viewer card (initiative premium-agreed-design: nothing links to the console).
|
|
2
|
-
* openTermView(sid, { title }) → the Viewer body. It reads GET /api/sessions/transcript?id=<sid
|
|
3
|
-
*
|
|
2
|
+
* openTermView(sid, { title }) → the Viewer body. It reads GET /api/sessions/transcript?id=<sid>&raw=1 every 2 s while the card shows it and
|
|
3
|
+
* draws the bytes in a read-only terminal (xterm.js, served from /vendor) the size of the session's own, so a full-screen agent's cursor moves
|
|
4
|
+
* and redraws land where they did on the PM's screen. Plain text with the escapes taken out ran words together and piled spinner frames up
|
|
5
|
+
* line by line (PM, 2026-10-27: "Broken format on terminal view"). After the first read it asks only for what was printed since (since + gen).
|
|
6
|
+
* It keeps the view at the end unless the PM scrolled up. It writes nothing; keys typed in the card go nowhere.
|
|
7
|
+
* When xterm.js cannot load, it falls back to the plain text (GET …&max=12000, ANSI taken out). */
|
|
4
8
|
import { open, current } from './cozy-viewer.js';
|
|
5
9
|
import { pmGet } from './http.js';
|
|
6
10
|
|
|
11
|
+
let xtermP = null;
|
|
12
|
+
/** window.Terminal from /vendor/xterm.js, loaded once with its stylesheet. Resolves null when it cannot load. */
|
|
13
|
+
function loadXterm() {
|
|
14
|
+
if (window.Terminal) return Promise.resolve(window.Terminal);
|
|
15
|
+
if (xtermP) return xtermP;
|
|
16
|
+
xtermP = new Promise((done) => {
|
|
17
|
+
if (!document.querySelector('link[data-xterm-css]')) {
|
|
18
|
+
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = '/vendor/xterm.css'; l.setAttribute('data-xterm-css', ''); document.head.appendChild(l);
|
|
19
|
+
}
|
|
20
|
+
const s = document.createElement('script'); s.src = '/vendor/xterm.js';
|
|
21
|
+
s.onload = () => done(window.Terminal || null);
|
|
22
|
+
s.onerror = () => { xtermP = null; done(null); };
|
|
23
|
+
document.head.appendChild(s);
|
|
24
|
+
});
|
|
25
|
+
return xtermP;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The terminal's colours and face from the card's own computed style, so it follows light and dark. A token the page lacks leaves that
|
|
29
|
+
* colour to xterm's default. The size is not set here: xterm draws at its default and cozy-home.css scales .hv-xt .xterm down to 12px. */
|
|
30
|
+
function look(el) {
|
|
31
|
+
const cs = getComputedStyle(el);
|
|
32
|
+
const v = (n) => (cs.getPropertyValue(n) || '').trim() || undefined;
|
|
33
|
+
const bg = v('--cz-well'), fg = v('--cz-ink');
|
|
34
|
+
return { theme: { background: bg, foreground: fg, cursor: bg, cursorAccent: bg, selectionBackground: v('--cz-well2') },
|
|
35
|
+
fontFamily: v('--cz-mono') || 'ui-monospace, Menlo, monospace' };
|
|
36
|
+
}
|
|
37
|
+
|
|
7
38
|
export function openTermView(sid, o = {}) {
|
|
8
39
|
if (!/^sess-\d+$/.test(String(sid || ''))) return null;
|
|
9
40
|
const id = 'term:' + sid;
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
41
|
+
let stop = false, term = null, gen = null, end = null, plain = false;
|
|
42
|
+
const body = open({ id, kind: 'Terminal · read only', title: o.title || sid, icon: 'M4 5h16v14H4zM7 9l3 3-3 3M12 15h5',
|
|
43
|
+
html: '<pre class="hv-term" role="log" aria-live="off">Reading the terminal.</pre>',
|
|
44
|
+
onClose: () => { stop = true; if (term) { try { term.dispose(); } catch { /* already gone */ } term = null; } } });
|
|
45
|
+
const live = () => { const c = current(); return !stop && c && c.id === id; };
|
|
46
|
+
|
|
47
|
+
const plainTick = async () => {
|
|
13
48
|
const r = await pmGet('/api/sessions/transcript?id=' + encodeURIComponent(sid) + '&max=12000');
|
|
14
|
-
|
|
15
|
-
|
|
49
|
+
if (!live()) return;
|
|
50
|
+
let pre = body.querySelector('.hv-term');
|
|
51
|
+
if (!pre) { body.innerHTML = '<pre class="hv-term" role="log" aria-live="off"></pre>'; pre = body.querySelector('.hv-term'); }
|
|
52
|
+
const atEnd = pre.scrollHeight - pre.scrollTop - pre.clientHeight < 40;
|
|
16
53
|
pre.textContent = r && r.ok ? r.text || '(nothing printed yet)' : (r && r.error) || 'The terminal could not be read.';
|
|
17
|
-
if (
|
|
18
|
-
|
|
54
|
+
if (atEnd) pre.scrollTop = pre.scrollHeight;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const xtTick = async (Terminal) => {
|
|
58
|
+
const q = gen == null ? '' : '&gen=' + encodeURIComponent(gen) + '&since=' + encodeURIComponent(end);
|
|
59
|
+
const r = await pmGet('/api/sessions/transcript?id=' + encodeURIComponent(sid) + '&raw=1' + q);
|
|
60
|
+
if (!live()) return;
|
|
61
|
+
if (!r || !r.ok) { if (!term) { const pre = body.querySelector('.hv-term'); if (pre) pre.textContent = (r && r.error) || 'The terminal could not be read.'; } return; }
|
|
62
|
+
if (!term || r.reset) {
|
|
63
|
+
if (term) { try { term.dispose(); } catch { /* already gone */ } }
|
|
64
|
+
body.innerHTML = '<div class="hv-xt" role="log" aria-live="off" aria-label="Terminal, read only"></div>';
|
|
65
|
+
const host = body.firstChild;
|
|
66
|
+
const L = look(host);
|
|
67
|
+
term = new Terminal({ cols: r.cols || 80, rows: r.rows || 24, disableStdin: true, cursorBlink: false, scrollback: 5000, convertEol: false,
|
|
68
|
+
fontFamily: L.fontFamily, lineHeight: 1.25, theme: L.theme });
|
|
69
|
+
term.open(host);
|
|
70
|
+
if (r.data) term.write(r.data, () => term && term.scrollToBottom());
|
|
71
|
+
} else {
|
|
72
|
+
if (term.cols !== r.cols || term.rows !== r.rows) { try { term.resize(r.cols || 80, r.rows || 24); } catch { /* keep the old size */ } }
|
|
73
|
+
if (r.data) {
|
|
74
|
+
const b = term.buffer.active, atEnd = b.viewportY >= b.baseY;
|
|
75
|
+
term.write(r.data, () => { if (atEnd && term) term.scrollToBottom(); });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
gen = r.gen; end = r.end;
|
|
19
79
|
};
|
|
20
|
-
|
|
80
|
+
|
|
81
|
+
(async () => {
|
|
82
|
+
const Terminal = await loadXterm();
|
|
83
|
+
if (!Terminal) plain = true;
|
|
84
|
+
const loop = async () => {
|
|
85
|
+
if (!live()) return;
|
|
86
|
+
try { if (plain) await plainTick(); else await xtTick(Terminal); }
|
|
87
|
+
catch { if (!plain) { plain = true; term = null; } }
|
|
88
|
+
if (live()) setTimeout(loop, 2000);
|
|
89
|
+
};
|
|
90
|
+
loop();
|
|
91
|
+
})();
|
|
21
92
|
return body;
|
|
22
93
|
}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
<link rel="stylesheet" href="/pm/cozy.css" />
|
|
14
14
|
<link rel="stylesheet" href="/pm/cozy-pick.css" />
|
|
15
15
|
<link rel="stylesheet" href="/pm/cozy-board.css" />
|
|
16
|
+
<link rel="stylesheet" href="/pm/bd-pin-card.css" />
|
|
16
17
|
<link rel="stylesheet" href="/pm/cozy-panel.css" />
|
|
17
18
|
</head>
|
|
18
19
|
<body class="cz bd-page">
|