create-pmos 0.631.0 → 0.633.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 +27 -69
- 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-adddoc-test.js +3 -0
- package/workspace/briefing-premium-board-test.js +4 -2
- package/workspace/briefing-premium-doc-edit-test.js +3 -0
- package/workspace/briefing-premium-initiative-test.js +4 -0
- package/workspace/briefing-premium-insights-test.js +1 -1
- package/workspace/briefing-premium-sources-test.js +2 -2
- package/workspace/changelog.json +26 -0
- package/workspace/core-docs-workflow-test.js +3 -0
- package/workspace/ev-everywhere-test.js +7 -17
- package/workspace/guide/layout.md +12 -5
- package/workspace/guide/notes.md +7 -3
- package/workspace/ini-workflow-test.js +3 -0
- package/workspace/lib/extension-cli.js +4 -1
- package/workspace/lib/extension-setup.js +93 -0
- package/workspace/lib/meeting-focus.js +5 -3
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-extension.js +23 -0
- package/workspace/lib/routes-meeting-focus.js +2 -2
- package/workspace/live-pill-round-test.js +7 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +3 -1
- package/workspace/premium-vw-backlog-test.js +2 -2
- package/workspace/premium-vw-doc-test.js +3 -0
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-vw-jira-test.js +4 -3
- package/workspace/public/pm/bd-ini-panel.js +4 -1
- package/workspace/public/pm/bd-prog-panel.js +3 -3
- package/workspace/public/pm/bd-views.js +8 -2
- package/workspace/public/pm/buddy-core.js +2 -2
- package/workspace/public/pm/cozy-board.css +15 -0
- package/workspace/public/pm/cozy-buddy.js +2 -0
- package/workspace/public/pm/cozy-ev.css +25 -0
- package/workspace/public/pm/cozy-ext.js +76 -0
- package/workspace/public/pm/cozy-home.css +38 -2
- package/workspace/public/pm/cozy-nav.js +72 -6
- package/workspace/public/pm/cozy-phone-rec.css +68 -0
- package/workspace/public/pm/cozy-phone-rec.js +105 -0
- package/workspace/public/pm/cozy-phone-settings.css +18 -0
- package/workspace/public/pm/cozy-phone-settings.js +73 -0
- package/workspace/public/pm/cozy-phone-swipe.js +51 -0
- package/workspace/public/pm/cozy-pop-work.css +56 -0
- package/workspace/public/pm/cozy-pop-work.js +72 -4
- package/workspace/public/pm/cozy-rec-tab.js +10 -0
- package/workspace/public/pm/cozy-settings.js +6 -2
- package/workspace/public/pm/cozy-today-app.js +56 -5
- package/workspace/public/pm/cozy-today-page.css +75 -1
- package/workspace/public/pm/cozy-today-view.js +87 -0
- package/workspace/public/pm/cozy-viewer.js +27 -7
- package/workspace/public/pm/home-app.js +31 -2
- package/workspace/public/pm/home-chat.js +8 -0
- package/workspace/public/pm/home-ini.js +7 -3
- package/workspace/public/pm/phone-ask.js +57 -0
- package/workspace/split-merge-ui-test.js +3 -1
- package/workspace/stage-card-tasks-test.js +6 -0
- package/workspace/stage-card-test.js +3 -0
- package/workspace/task-delete-test.js +3 -0
- package/workspace/task-links-test.js +3 -0
- package/workspace/task-plans-test.js +3 -0
- package/workspace/task-views-test.js +3 -0
- package/workspace/test-lists/meeting-buddy.json +1 -1
- package/workspace/test-lists/phone-design-v2.json +9 -0
- package/workspace/tk-tasks-test.js +4 -0
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
* press (pmPost). Nothing here opens the old dialog or links to the console. */
|
|
17
17
|
import './fetch-share.js'; // first: identical GETs in flight are asked once (page-open-speed)
|
|
18
18
|
import { mountNav, openMenu } from './cozy-nav.js';
|
|
19
|
+
import { askGroups, askHtml } from './phone-ask.js'; // Ask PMOS on a phone (phone design, Ph2_asklist): the chats by work
|
|
20
|
+
import { sessionRows } from './pop-sessions.js';
|
|
19
21
|
import { mountPhoneHead } from './phone-chat-head.js'; // the phone chat's top bar: the context line, its sheet and ⋯ (batch 31 item 5)
|
|
20
22
|
import { mountSetupChecklist } from './setup-checklist.js';
|
|
21
23
|
import { mountOnboard } from './cozy-onboard.js';
|
|
@@ -287,7 +289,7 @@ function otherProducts(D) {
|
|
|
287
289
|
const av = (D.brief && D.brief.products && D.brief.products.available) || [];
|
|
288
290
|
const own = ((D.board && D.board.board) || {}).ws || WS;
|
|
289
291
|
// Today reads every product (slice 5 of the six-place navigation): the product pick is Work's and Goals', not Today's
|
|
290
|
-
return av.filter((a) => (a.on ||
|
|
292
|
+
return av.filter((a) => (a.on || TD_PAGE) && a.ws && a.ws !== own).slice(0, 4); // a phone's Today too (phone design, Ph2_today)
|
|
291
293
|
}
|
|
292
294
|
async function loadIni() {
|
|
293
295
|
const id = S.ini;
|
|
@@ -370,7 +372,7 @@ function homeListHtml() {
|
|
|
370
372
|
S.M = M;
|
|
371
373
|
// Adler's ears over the floating button (batch 17 item 4-B, AdP6): the place menu hears how many calls are the PM's
|
|
372
374
|
// on Today (a desk) the number is Today's own (pm/cozy-today-app.js: Do first and what waits today), so it is not sent here
|
|
373
|
-
if (!
|
|
375
|
+
if (!TD_PAGE) { const n = (M.move || []).filter((r) => r.call).length; if (n !== S.calls) { S.calls = n; document.dispatchEvent(new CustomEvent('cz:calls', { detail: { count: n } })); } }
|
|
374
376
|
// the ✦ chip on "Not in an initiative" is gone (UI grill delete list): Claude's clean-up is a row in Your move (rankIn extra)
|
|
375
377
|
const R = L.reviewModel(S.D, NOW());
|
|
376
378
|
// a group is open until the PM folds it; another product starts folded; "Not in an initiative" starts folded on a phone (HvAC, HvACDesk)
|
|
@@ -914,8 +916,33 @@ function drawList() {
|
|
|
914
916
|
document.body.classList.toggle('hm-plist', isPhone() && !S.phoneChat); // a phone: the list is the page until a row opens its conversation (HmPhone)
|
|
915
917
|
drawRailCard();
|
|
916
918
|
drawRecTop();
|
|
919
|
+
drawAsk();
|
|
917
920
|
if (TDY) TDY.draw(); // Today on a desk (today.html): the log and the agenda, from the same reads
|
|
918
921
|
}
|
|
922
|
+
/* Ask PMOS on a phone (phone design, board Ph2_asklist): Home's page is the list of chats by work; Home's own list is not drawn there
|
|
923
|
+
* (cozy-home.css). A row opens its chat as Home does; the composer at the foot starts a chat with PMOS. today.html draws Today instead. */
|
|
924
|
+
const ASK_PAGE = new URLSearchParams(location.search).has('chats'); // the menu's Ask PMOS (cozy-nav.js); a bare /premium.html keeps Home's list
|
|
925
|
+
function drawAsk() {
|
|
926
|
+
const on = isPhone() && !TD_PAGE && ASK_PAGE;
|
|
927
|
+
document.body.classList.toggle('pa-on', on);
|
|
928
|
+
let el = document.getElementById('paList');
|
|
929
|
+
if (!on) { if (el) el.hidden = true; return; }
|
|
930
|
+
if (!el) {
|
|
931
|
+
el = document.createElement('section'); el.id = 'paList'; el.className = 'pa-page'; el.setAttribute('aria-label', 'Ask PMOS');
|
|
932
|
+
$('#hmDesk').prepend(el);
|
|
933
|
+
el.addEventListener('click', (e) => {
|
|
934
|
+
const b = e.target.closest('[data-ask-sid], [data-ask-new]'); if (!b) return;
|
|
935
|
+
if ('askNew' in b.dataset) { S.phoneChat = true; VW.close(); openTarget(homeTarget()); drawList(); chat.focus(); return; }
|
|
936
|
+
const sx = (S.D.sessions || []).find((x) => x.id === b.dataset.askSid);
|
|
937
|
+
if (!sx) { toast('That chat has ended. It is not on this computer any more.'); return; }
|
|
938
|
+
S.phoneChat = true; VW.close(); S.sel = 's:' + sx.id; openTarget(sessionTarget(sx)); followViewer(sx); drawList(); chat.focus();
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
el.hidden = false;
|
|
942
|
+
const R = sessionRows(S.D.sessions || [], { titleOf: (id) => (iniRowOf(id) ? iniTitle(id) : ''), now: NOW() });
|
|
943
|
+
const h = askHtml(askGroups(R.all, S.D.sessions || [], { titleOf: (id) => (iniRowOf(id) ? iniTitle(id) : ''), now: NOW() }), { ready: S.ready });
|
|
944
|
+
if (el.__h !== h) { el.__h = h; el.innerHTML = h; }
|
|
945
|
+
}
|
|
919
946
|
/** The list's own fold (batch 20 item 6): kept on this computer, the one thing that folds or unfolds the list. With a Viewer open it is the rail. */
|
|
920
947
|
function setFold(on) {
|
|
921
948
|
S.folded = !!on; store.set('pmos.home.fold', on ? '1' : '0'); drawList(); // '0': the PM opened it, and a full Viewer keeps it open from now on
|
|
@@ -2417,6 +2444,8 @@ if (TD_PAGE) TDY = mountToday({ S, VW, POP, pmGet, pmPost, toast, toastUndo, isP
|
|
|
2417
2444
|
const x = await startAgent({ ws: w.ws || WS || undefined, task: 'draft', initiative: w.initiative, what: w.what }); if (x.ok) started++; else failed++; }
|
|
2418
2445
|
if (started) load(); return { started, failed, error: started ? '' : 'PMOS did not start them. Nothing changed.' }; },
|
|
2419
2446
|
openInbox: () => MORE.openInbox(searchGo, ''), reload: () => load(), review: () => L.reviewModel(S.D, NOW()), meetings: () => H.todayOf(S.D), record: (row) => (REC ? REC.record(row) : Promise.resolve({ ok: false, error: 'PMOS is still starting. Press play again in a moment.' })),
|
|
2447
|
+
// the phone's Record with no event (Ph2_today): a recording of its own; the notes, for "Recording filed under …" (Ph2_recdone)
|
|
2448
|
+
fresh: () => (REC ? REC.fresh() : Promise.resolve({ ok: false, error: 'PMOS is still starting. Press Record again in a moment.' })), notes: () => noteRows(),
|
|
2420
2449
|
news: () => (S.news && S.news.ok ? S.news.count || 0 : 0), chatNow: () => (chat.current ? chat.current() : null),
|
|
2421
2450
|
openLab: (f) => import('./cozy-lab-ins.js').then((LB) => LB.openLab({ where: () => ({ ws: f.ws, board: f.board }), iniHref: (id) => '/premium-initiative.html?' + (f.ws ? 'ws=' + encodeURIComponent(f.ws) + '&' : '') + 'id=' + encodeURIComponent(id), toast: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)) })) });
|
|
2422
2451
|
PHC = mountPhoneCard({ pmGet, pmPost, toast, ws: () => WS || null, openMeeting: (m) => openMeeting(m), skip: ['meeting'] }); drawList();
|
|
@@ -752,6 +752,14 @@ export function mountChat(el, host) {
|
|
|
752
752
|
holdT = setTimeout(() => { unhold(); a.classList.add('held'); }, 450);
|
|
753
753
|
});
|
|
754
754
|
for (const ev of ['pointerup', 'pointercancel', 'pointermove']) el.addEventListener(ev, (e) => { if (ev !== 'pointermove' || Math.abs(e.movementX) + Math.abs(e.movementY) > 6) clearTimeout(holdT); });
|
|
755
|
+
/* The phone (phone design, Ph2_ask): the tools and the "Worked …" line show only on a touch of the message, the newest one too. A tap on a
|
|
756
|
+
* message shows them, a second tap or a tap on another message moves them; a press on a link or a button inside does its own job. */
|
|
757
|
+
el.addEventListener('click', (e) => {
|
|
758
|
+
if (!(typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches) || el.closest('.cz-pop-chat')) return;
|
|
759
|
+
const a = e.target.closest('.hm-a'); if (!a || a.classList.contains('hm-intro') || e.target.closest('button, a, input, textarea, select, summary, .hm-tools')) return;
|
|
760
|
+
if (String(getSelection ? getSelection() : '').trim()) return; // selecting words to copy them is not a tap
|
|
761
|
+
const was = a.classList.contains('held'); unhold(); if (!was) a.classList.add('held');
|
|
762
|
+
});
|
|
755
763
|
el.addEventListener('change', (e) => { if (e.target.id === 'hmFile') { upload([...e.target.files]); e.target.value = ''; } });
|
|
756
764
|
// a pasted file, or one dropped on the conversation, is attached like a picked one
|
|
757
765
|
el.addEventListener('paste', (e) => { if (e.target.id !== 'hmIn' || !C.t || !C.t.key) return; const fs = e.clipboardData ? [...e.clipboardData.files] : []; if (!fs.length) return; e.preventDefault(); upload(fs); });
|
|
@@ -281,7 +281,7 @@ function popExtra(id) {
|
|
|
281
281
|
allParts: () => {
|
|
282
282
|
C.VW.drill();
|
|
283
283
|
C.VW.open({ kind: X.ctx.kindOf(id), title: C.iniTitle(id), icon: 'goal', id: 'all:' + id, back: true,
|
|
284
|
-
render: (b) => { b.dataset.pwAll = '1'; const M = curM(); b.innerHTML = M ? pageHtml(id, M) : ''; wire(b, id); wirePage(b, id); } });
|
|
284
|
+
render: (b) => { b.dataset.pwAll = '1'; ALLB = b; const M = curM(); b.innerHTML = M ? pageHtml(id, M) : ''; wire(b, id); wirePage(b, id); } });
|
|
285
285
|
},
|
|
286
286
|
props: () => { const v = X.ctx.view(id); if (v) PP.open(v, H); },
|
|
287
287
|
};
|
|
@@ -495,7 +495,7 @@ export function iniPage(o = {}) {
|
|
|
495
495
|
let rename = X.ctx.renameIni ? X.ctx.renameIni(id, '') : null;
|
|
496
496
|
if (rename) rename = { ...rename, value: X.ctx.iniTitle(id) };
|
|
497
497
|
const dh = dashFor(id);
|
|
498
|
-
BODY = VW.open({ id: 'ov:' + id, kind: X.ctx.kindOf(id), title: X.ctx.iniTitle(id), icon: 'goal', wrap: true, more: () => (PW.on(BODY) ? PW.moreItems(null, popExtra(id)) : []).concat(pageMore(id)), rename, pop: o.pop || undefined,
|
|
498
|
+
BODY = VW.open({ id: 'ov:' + id, kind: X.ctx.kindOf(id), title: X.ctx.iniTitle(id), icon: 'goal', wrap: true, more: () => (PW.on(BODY) ? PW.moreItems(null, popExtra(id)) : []).concat(pageMore(id), PW.on(BODY) && !PW.inPop(BODY) ? moreOf(id, 'page').filter((x) => x.sep || /full record|Sprint/.test(x.label)) : []), rename, // a phone's page (Ph2_init) keeps the record and the sprint pop: o.pop || undefined,
|
|
499
499
|
discuss: () => X.ctx.newIn(id), discussHome: true, // the one view (OvViewers): Discuss starts a new session about it, where + New session was
|
|
500
500
|
// the kind of work (batch 29 item 11, KdV1-3): its glyph stands before Discuss; a tap opens the three kinds
|
|
501
501
|
presses: [WK.pressOf(kindNow(id))].concat(dh ? dh.presses() : []), onPress: (a, btn) => {
|
|
@@ -526,6 +526,7 @@ export function iniAddTask() {
|
|
|
526
526
|
const KIND = { docs: 'Documents', stage: 'Stage' };
|
|
527
527
|
const ICON = { docs: 'doc', stage: 'goal' };
|
|
528
528
|
let BODY = null;
|
|
529
|
+
let ALLB = null; // the body of Every part, while it is open
|
|
529
530
|
/* round 3 item 11b: a Today row that is a task opens its initiative at that task: the row lit, open in place (date, owner, status), in view */
|
|
530
531
|
let LIT = null; // { id, uid, seen }
|
|
531
532
|
/** The task the initiative's next draw lights. id: the initiative; uid: the task. */
|
|
@@ -600,7 +601,10 @@ function draw(b) {
|
|
|
600
601
|
}
|
|
601
602
|
function redrawView() {
|
|
602
603
|
if (!BODY || !BODY.isConnected || !X.ctx) return;
|
|
603
|
-
const cur = X.ctx.VW.current(); if (!cur
|
|
604
|
+
const cur = X.ctx.VW.current(); if (!cur) return;
|
|
605
|
+
// Every part (the old page as a drill-in, the way a phone reaches it): its presses redraw it in place
|
|
606
|
+
if (cur.id === 'all:' + X.ctx.S.ini) { if (ALLB && ALLB.isConnected) { const M = curM(), st = ALLB.scrollTop; ALLB.innerHTML = M ? pageHtml(X.ctx.S.ini, M) : ''; light(ALLB, X.ctx.S.ini); ALLB.scrollTop = st; } return; }
|
|
607
|
+
if (cur.id !== 'ov:' + X.ctx.S.ini) return;
|
|
604
608
|
const ae = document.activeElement, keep = ae && BODY.contains(ae) && ae.id ? ae.id : null, val = keep && ae.value != null ? ae.value : null;
|
|
605
609
|
const st = BODY.scrollTop; draw(BODY); BODY.scrollTop = st;
|
|
606
610
|
if (keep) { const n = BODY.querySelector('#' + keep); if (n) { if (val != null) n.value = val; n.focus(); } }
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* pm/phone-ask.js — Ask PMOS on a phone (phone design, board Ph2_asklist on Exploring 2; build brief nav-structure/phone/build-brief-v2.md).
|
|
2
|
+
*
|
|
3
|
+
* On a phone, Home's page (premium.html) is Ask PMOS: the chats, grouped by the work each is about, "Not in a work yet" last. The header is
|
|
4
|
+
* the title only (the ⋯ of the menu at its right); no search and no new-chat icon: a new chat starts from the composer at the foot. A chat
|
|
5
|
+
* that waits for you carries a blue dot. A row: the chat's name and when it was last used, then its last words ("PMOS: …").
|
|
6
|
+
*
|
|
7
|
+
* askGroups(rows, raw, { titleOf }) → [{ ini, title, n, rows: [{ id, name, word, last, wait }] }] PURE
|
|
8
|
+
* rows: pop-sessions.js sessionRows(...).all; raw: GET /api/sessions .sessions (for each chat's last words). Groups keep the order of
|
|
9
|
+
* their newest chat; "Not in a work yet" (ini null) is last.
|
|
10
|
+
* askHtml(groups, { ready }) → string PURE
|
|
11
|
+
* The rows are buttons data-ask-sid="<session id>"; the composer is a button data-ask-new. home-app.js opens them (the chat as on Home).
|
|
12
|
+
* Reads and writes nothing itself. Text from records goes through esc(). */
|
|
13
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
14
|
+
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>`;
|
|
15
|
+
const IC = {
|
|
16
|
+
ini: 'M12 4a8 8 0 1 0 0 16a8 8 0 1 0 0-16M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6',
|
|
17
|
+
loose: 'M4 5h16v11H9l-5 4z', plus: 'M12 5v14M5 12h14', mic: 'M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3zM5 11a7 7 0 0 0 14 0M12 18v3', up: 'M12 19V5M6 11l6-6 6 6',
|
|
18
|
+
};
|
|
19
|
+
const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).trimEnd() + '…' : t; };
|
|
20
|
+
/** The chat's last words: "PMOS: …" from the session's last output, '' when there is none (zero is silence). */
|
|
21
|
+
export function lastLine(s) {
|
|
22
|
+
const w = s && (s.lastWords || (s.hx && s.hx.lastWords));
|
|
23
|
+
const t = Array.isArray(w) ? w.filter(Boolean).slice(-1)[0] : w;
|
|
24
|
+
return t ? 'PMOS: ' + clip(t, 120) : '';
|
|
25
|
+
}
|
|
26
|
+
export function askGroups(rows, raw = [], o = {}) {
|
|
27
|
+
const titleOf = o.titleOf || (() => '');
|
|
28
|
+
const byId = new Map((raw || []).filter(Boolean).map((s) => [s.id, s]));
|
|
29
|
+
const G = new Map();
|
|
30
|
+
for (const r of rows || []) {
|
|
31
|
+
const k = r.ini || '';
|
|
32
|
+
if (!G.has(k)) G.set(k, { ini: r.ini || null, title: r.ini ? titleOf(r.ini) || r.work || r.ini : 'Not in a work yet', rows: [] });
|
|
33
|
+
G.get(k).rows.push({ id: r.id, name: r.name, word: r.state === 'wait' || r.state === 'work' ? r.at ? timeOnly(r.at, o.now) : '' : r.word, last: lastLine(byId.get(r.id)), wait: r.state === 'wait', work: r.state === 'work' });
|
|
34
|
+
}
|
|
35
|
+
const out = [...G.values()].map((g) => ({ ...g, n: g.rows.length }));
|
|
36
|
+
return out.filter((g) => g.ini).concat(out.filter((g) => !g.ini));
|
|
37
|
+
}
|
|
38
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
39
|
+
const DOW = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
40
|
+
/** The time word of a chat that works or waits: when it was last touched ("10:20", "Tue", "12 Nov"). */
|
|
41
|
+
function timeOnly(iso, now = Date.now()) {
|
|
42
|
+
const d = new Date(iso); if (Number.isNaN(d.getTime())) return '';
|
|
43
|
+
const n = new Date(now);
|
|
44
|
+
if (d.toDateString() === n.toDateString()) return pad(d.getHours()) + ':' + pad(d.getMinutes());
|
|
45
|
+
if (now - d.getTime() < 6 * 864e5 && d.getTime() <= now) return DOW[d.getDay()];
|
|
46
|
+
return d.getDate() + ' ' + MON[d.getMonth()];
|
|
47
|
+
}
|
|
48
|
+
export function askHtml(groups, o = {}) {
|
|
49
|
+
const head = '<header class="pa-top"><h1>Ask PMOS</h1></header>';
|
|
50
|
+
const body = !o.ready ? '<p class="pa-none">Reading your chats.</p>'
|
|
51
|
+
: !groups.length ? '<p class="pa-none">No chats yet. Write to PMOS below to start one.</p>'
|
|
52
|
+
: groups.map((g) => `<section class="pa-g" aria-label="${esc(g.title)}"><h2><span class="pa-gi${g.ini ? '' : ' loose'}">${svg(g.ini ? IC.ini : IC.loose, 14)}</span><span class="pa-gt">${esc(g.title)}</span><em>${esc(g.n)}</em></h2>`
|
|
53
|
+
+ `<ul>${g.rows.map((r) => `<li><button type="button" class="pa-r${r.wait ? ' wait' : ''}" data-ask-sid="${esc(r.id)}" aria-label="${esc(r.name + (r.wait ? '. Waits for you' : r.work ? '. PMOS is working' : '') + (r.last ? '. ' + r.last : ''))}">`
|
|
54
|
+
+ `${r.wait ? '<i class="pa-d" aria-hidden="true"></i>' : ''}<span class="pa-x"><b>${esc(r.name)}</b>${r.last ? `<small>${esc(r.last)}</small>` : ''}</span>${r.word ? `<time>${esc(r.word)}</time>` : ''}</button></li>`).join('')}</ul></section>`).join('');
|
|
55
|
+
const foot = `<div class="pa-foot"><button type="button" class="pa-new" data-ask-new aria-label="Message PMOS: start a new chat"><span class="pa-pl">${svg(IC.plus, 18)}</span><span class="pa-ph">Message PMOS</span><span class="pa-mic">${svg(IC.mic, 18)}</span><span class="pa-go">${svg(IC.up, 18, 2)}</span></button></div>`;
|
|
56
|
+
return `<div class="pa">${head}${body}</div>${foot}`;
|
|
57
|
+
}
|
|
@@ -22,6 +22,8 @@ const { makeRepos, codeRepo, write, git } = require('./plan-test-repos');
|
|
|
22
22
|
|
|
23
23
|
const BASE = T.BASE;
|
|
24
24
|
const SHOTS = process.env.SHOTS || '';
|
|
25
|
+
// the phone design (Ph2_init): a phone shows an initiative as the popup's phone page; the old page is ⋯ › Every part
|
|
26
|
+
const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', { state: 'attached', timeout: 20000 }); await pg.evaluate(() => { const r = (window.__czVwMore ? window.__czVwMore(document.body) : []).find((x) => x.label === 'Every part'); if (r) r.go(); }); await pg.waitForTimeout(800); };
|
|
25
27
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
26
28
|
const until = async (fn, ms = 15000, step = 150) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
27
29
|
const results = [];
|
|
@@ -164,7 +166,7 @@ const shot = (p, name) => (SHOTS ? p.screenshot({ path: path.join(SHOTS, name) }
|
|
|
164
166
|
const { ctx, page: p, errors } = await open({ w: 390, h: 844 });
|
|
165
167
|
const key = await p.evaluate(() => { const d = document.querySelector('#ibBody .sm-dot'); const b = d && d.closest('[data-key]'); return b ? b.dataset.key : null; });
|
|
166
168
|
ok('P phone: the dot on the row', !!key);
|
|
167
|
-
if (key) await p.click(`#ibBody [data-key="${key}"]`);
|
|
169
|
+
if (key) { await p.click(`#ibBody [data-key="${key}"]`); await everyPart(p); }
|
|
168
170
|
ok('P phone: the card in the full-screen Viewer', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .sm-card'))));
|
|
169
171
|
await shot(p, 'phone-suggest.png');
|
|
170
172
|
await p.click('#czViewer [data-sm="no"]');
|
|
@@ -110,12 +110,18 @@ const TICKETS = [{ key: 'IDPF-3387', title: 'Refactor the AppAuthService', statu
|
|
|
110
110
|
await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2, #ibBody .bt-l').length > 0), 20000);
|
|
111
111
|
await page.evaluate(() => { const b = [...document.querySelectorAll('[data-row="board:usage-billing"] .bt-nm, [data-key="board:usage-billing"]')].find((x) => x.offsetParent); if (b) b.click(); });
|
|
112
112
|
}
|
|
113
|
+
// a phone shows the initiative as the popup's phone page (phone design, Ph2_init); the old page with its Tasks is ⋯ › Every part
|
|
114
|
+
if (touch && where === 'home') { await everyPart(page); await sleep(800); }
|
|
113
115
|
await until(() => page.evaluate((v) => !!document.querySelector(v === 'list' ? '#czViewer .iv-wbs' : '#czViewer :is(.ivt, .iva, .ivk)'), view), 20000);
|
|
114
116
|
// Build and Deliver open (the Board's initiative is in Discover; Home's is in Build)
|
|
115
117
|
await openStage(page, 'build'); await openStage(page, 'deliver');
|
|
116
118
|
await sleep(200);
|
|
117
119
|
return { ctx, page, errors, posts, S };
|
|
118
120
|
};
|
|
121
|
+
const everyPart = async (pg) => {
|
|
122
|
+
await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .pw-ph')), 20000);
|
|
123
|
+
return pg.evaluate(() => { const r = (window.__czVwMore ? window.__czVwMore(document.body) : []).find((x) => x.label === 'Every part'); if (r) r.go(); return !!r; });
|
|
124
|
+
};
|
|
119
125
|
const openStage = (pg, key) => pg.evaluate((k) => {
|
|
120
126
|
const rest = document.querySelector('#czViewer .iv-rest[aria-expanded="false"]');
|
|
121
127
|
const h = document.querySelector(`#czViewer .iv-ws[data-iv-sec="${k}"]`);
|
|
@@ -25,6 +25,8 @@ const BRF = require('./fixtures/briefing-premium-facts.js');
|
|
|
25
25
|
|
|
26
26
|
const BASE = T.BASE;
|
|
27
27
|
const SHOTS = process.env.PMOS_SHOTS || '';
|
|
28
|
+
// the phone design (Ph2_init): a phone shows an initiative as the popup's phone page; the old page is ⋯ › Every part
|
|
29
|
+
const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', { state: 'attached', timeout: 20000 }); await pg.evaluate(() => { const r = (window.__czVwMore ? window.__czVwMore(document.body) : []).find((x) => x.label === 'Every part'); if (r) r.go(); }); await pg.waitForTimeout(800); };
|
|
28
30
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
29
31
|
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { const v = await fn(); if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
30
32
|
const results = [];
|
|
@@ -116,6 +118,7 @@ async function pure() {
|
|
|
116
118
|
if (sessions) await page.route(/\/api\/sessions(\?.*)?$/, (r) => json(r, { sessions }));
|
|
117
119
|
if (trail) await page.route('**/api/board-trail*', (r) => json(r, trail));
|
|
118
120
|
await page.goto(BASE + '/premium.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
121
|
+
if (w <= 760) await everyPart(page);
|
|
119
122
|
const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-hi-v="page"] .iv-mc')), 30000);
|
|
120
123
|
return { ctx, page, errors, posts, up };
|
|
121
124
|
};
|
|
@@ -48,6 +48,8 @@ const openCard = async (pg, uid, V = '#czViewer') => {
|
|
|
48
48
|
await pg.waitForSelector('.tkc.ivq [data-ive-card]', { timeout: 8000 });
|
|
49
49
|
return pg.click('.tkc.ivq [data-ive-card]');
|
|
50
50
|
};
|
|
51
|
+
// the phone design (Ph2_init): a phone shows an initiative as the popup's phone page; the old page is ⋯ › Every part
|
|
52
|
+
const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', { state: 'attached', timeout: 20000 }); await pg.evaluate(() => { const r = (window.__czVwMore ? window.__czVwMore(document.body) : []).find((x) => x.label === 'Every part'); if (r) r.go(); }); await pg.waitForTimeout(800); };
|
|
51
53
|
(async () => {
|
|
52
54
|
const exe = findBrowser();
|
|
53
55
|
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
@@ -149,6 +151,7 @@ const openCard = async (pg, uid, V = '#czViewer') => {
|
|
|
149
151
|
{
|
|
150
152
|
const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
|
|
151
153
|
const opened = await p.evaluate(() => { const r = document.querySelector('#ibBody [data-key="board:scarlet"], #ibBody [data-row="board:scarlet"] .tg-n'); if (r) r.click(); return !!r; });
|
|
154
|
+
await everyPart(p);
|
|
152
155
|
await p.waitForSelector('.iv-tr', { timeout: 8000 }).catch(() => {});
|
|
153
156
|
await unfold(p);
|
|
154
157
|
const box = await p.$('.iv-tr:has(.iv-tt:text-is("Ship the article summaries API")) .iv-cb');
|
|
@@ -65,6 +65,8 @@ function model() {
|
|
|
65
65
|
return m;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
// the phone design (Ph2_init): a phone shows an initiative as the popup's phone page; the old page is ⋯ › Every part
|
|
69
|
+
const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', { state: 'attached', timeout: 20000 }); await pg.evaluate(() => { const r = (window.__czVwMore ? window.__czVwMore(document.body) : []).find((x) => x.label === 'Every part'); if (r) r.go(); }); await pg.waitForTimeout(800); };
|
|
68
70
|
(async () => {
|
|
69
71
|
const exe = findBrowser();
|
|
70
72
|
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
@@ -102,6 +104,7 @@ function model() {
|
|
|
102
104
|
await page.waitForSelector('#ibBody [data-key]', { timeout: 15000 });
|
|
103
105
|
await page.waitForTimeout(400);
|
|
104
106
|
await page.locator(`[data-key="board:${INI}"]`).first().click();
|
|
107
|
+
if ((o.w || 1520) <= 760) await everyPart(page);
|
|
105
108
|
await page.waitForSelector('#czViewer .iv-th', { timeout: 8000 });
|
|
106
109
|
await page.waitForTimeout(400);
|
|
107
110
|
return { ctx, page, errors, posts };
|
|
@@ -66,6 +66,8 @@ function model() {
|
|
|
66
66
|
return m;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
// the phone design (Ph2_init): a phone shows an initiative as the popup's phone page; the old page is ⋯ › Every part
|
|
70
|
+
const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', { state: 'attached', timeout: 20000 }); await pg.evaluate(() => { const r = (window.__czVwMore ? window.__czVwMore(document.body) : []).find((x) => x.label === 'Every part'); if (r) r.go(); }); await pg.waitForTimeout(800); };
|
|
69
71
|
(async () => {
|
|
70
72
|
const exe = findBrowser();
|
|
71
73
|
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
@@ -164,6 +166,7 @@ function model() {
|
|
|
164
166
|
const { ctx, page, errors } = await open({ w: 390, h: 844 });
|
|
165
167
|
const n = page.locator('[data-key="board:partner-rate-limits"]').first();
|
|
166
168
|
await n.click();
|
|
169
|
+
await everyPart(page);
|
|
167
170
|
await page.waitForSelector('#czViewer [data-vs-chip]', { timeout: 8000 });
|
|
168
171
|
await page.locator('#czViewer [data-vs-chip]').click();
|
|
169
172
|
await page.waitForSelector('.vs-pop.sheet', { timeout: 4000 });
|
|
@@ -65,6 +65,8 @@ const BRF = require('./fixtures/briefing-premium-facts.js');
|
|
|
65
65
|
const IP = require('./lib/initiative-premium.js');
|
|
66
66
|
const IF = require('./fixtures/initiative-premium-facts.js');
|
|
67
67
|
|
|
68
|
+
// the phone design (Ph2_init): a phone shows an initiative as the popup's phone page; the old page is ⋯ › Every part
|
|
69
|
+
const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', { state: 'attached', timeout: 20000 }); await pg.evaluate(() => { const r = (window.__czVwMore ? window.__czVwMore(document.body) : []).find((x) => x.label === 'Every part'); if (r) r.go(); }); await pg.waitForTimeout(800); };
|
|
68
70
|
(async () => {
|
|
69
71
|
const exe = findBrowser();
|
|
70
72
|
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
@@ -89,6 +91,7 @@ const IF = require('./fixtures/initiative-premium-facts.js');
|
|
|
89
91
|
await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2, #ibBody .bt-l').length > 0), 20000);
|
|
90
92
|
// the initiative's panel, from its row's name
|
|
91
93
|
await page.evaluate(() => { const b = [...document.querySelectorAll('[data-row="board:usage-billing"] .bt-nm, [data-key="board:usage-billing"]')].find((x) => x.offsetParent); if (b) b.click(); });
|
|
94
|
+
if (w <= 760) await everyPart(page);
|
|
92
95
|
await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv .iv-th')));
|
|
93
96
|
return { ctx, page, errors, posts };
|
|
94
97
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "The meeting buddy and the one-press start (initiative meeting-buddy, done test T1-T6): lib/meeting-focus.js callLinkOf and the caught bullet ids, pm/buddy-core.js, the Meet panel's address, Today's play icon. Pure, node.",
|
|
2
|
+
"_comment": "The meeting buddy and the one-press start (initiative meeting-buddy, done test T1-T6): lib/meeting-focus.js callLinkOf and the caught bullet ids, pm/buddy-core.js, the Meet panel's address, Today's play icon; T7 the extension set up from Settings › Connectors › Google Meet (lib/extension-setup.js, pm/cozy-ext.js). Pure, node.",
|
|
3
3
|
"modules": [
|
|
4
4
|
"meeting-buddy.test.js"
|
|
5
5
|
],
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "The agreed phone design (phone-design-v2, done test C1-C5, C8): the pure parts of the phone menu, swipe, Today rows, Ask PMOS, the recording's So far and slides. No browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"phone-design-v2.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"phone-design-v2.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -71,6 +71,8 @@ const BOARD = (() => { const M = BP.build(BF.facts()); const r = M.rows.find((x)
|
|
|
71
71
|
const BRIEF = BRP.build(BRF.facts());
|
|
72
72
|
const LAYOUT = { ok: true, auto: true, held: [], by: 'stage', names: [], of: {}, stage: {}, sets: [] };
|
|
73
73
|
|
|
74
|
+
// the phone design (Ph2_init): a phone shows an initiative as the popup's phone page; the old page is ⋯ › Every part
|
|
75
|
+
const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', { state: 'attached', timeout: 20000 }); await pg.evaluate(() => { const r = (window.__czVwMore ? window.__czVwMore(document.body) : []).find((x) => x.label === 'Every part'); if (r) r.go(); }); await pg.waitForTimeout(800); };
|
|
74
76
|
(async () => {
|
|
75
77
|
const exe = findBrowser();
|
|
76
78
|
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
@@ -111,10 +113,12 @@ const LAYOUT = { ok: true, auto: true, held: [], by: 'stage', names: [], of: {},
|
|
|
111
113
|
await page.goto(BASE + '/premium-board.html?theme=' + theme);
|
|
112
114
|
await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2, #ibBody .bt-l').length > 0), 20000);
|
|
113
115
|
await page.evaluate((id) => { const b = [...document.querySelectorAll(`[data-row="board:${id}"] .bt-nm, [data-key="board:${id}"]`)].find((x) => x.offsetParent); if (b) b.click(); }, I);
|
|
116
|
+
if (w <= 760) await everyPart(page);
|
|
114
117
|
const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv .iv-th')), 20000);
|
|
115
118
|
return { ctx, page, errors, posts, up, set: (v) => { cur = v; } };
|
|
116
119
|
}
|
|
117
120
|
await page.goto(BASE + '/premium.html?ini=' + I + '&ws=w1&board=w1&theme=' + theme);
|
|
121
|
+
if (w <= 760) await everyPart(page);
|
|
118
122
|
const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-mc')), 30000);
|
|
119
123
|
return { ctx, page, errors, posts, up, set: (v) => { cur = v; } };
|
|
120
124
|
};
|