create-pmos 0.709.0 → 0.711.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 -39
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +26 -0
- package/workspace/chat-asks-test.js +1 -1
- package/workspace/guide/home.md +1 -1
- package/workspace/guide/layout.md +6 -6
- package/workspace/lib/routes-drift.js +3 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-stands.js +1 -1
- package/workspace/public/pm/bd-views.js +9 -1
- package/workspace/public/pm/bd-work-ds.css +15 -0
- package/workspace/public/pm/cozy-home.css +16 -8
- package/workspace/public/pm/cozy-nav.js +6 -5
- package/workspace/public/pm/cozy-pop-work.css +44 -0
- package/workspace/public/pm/cozy-pop-work.js +80 -34
- package/workspace/public/pm/cozy-task-pop.css +6 -0
- package/workspace/public/pm/cozy-today-app.js +31 -10
- package/workspace/public/pm/cozy-today-model.js +4 -2
- package/workspace/public/pm/cozy-today-page.css +27 -0
- package/workspace/public/pm/cozy-today-view.js +96 -29
- package/workspace/public/pm/home-app.js +1 -1
- package/workspace/public/pm/home-ask.js +8 -3
- package/workspace/public/pm/home-chat.js +4 -0
- package/workspace/public/pm/moves-view.js +4 -3
- package/workspace/public/pm/phone-ask.js +7 -7
- package/workspace/public/pm/premium-board.js +1 -1
- package/workspace/test-lists/phone-today-work.json +9 -0
|
@@ -27,7 +27,7 @@ export const ICON = {
|
|
|
27
27
|
};
|
|
28
28
|
const svg = (d, w = 2) => `<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"></path></svg>`;
|
|
29
29
|
/** One answer as an icon button. a = { icon, label, attr, pri }. */
|
|
30
|
-
export const iconBtn = (a) => `<button type="button" class="hm-icb${a.pri ? ' pri' : ''}" ${a.attr} aria-label="${esc(a.label)}" title="${esc(a.label)}"${a.off ? ' disabled' : ''}>${svg(ICON[a.icon] || a.icon, a.icon === 'yes' ? 2.4 : 2)}</button>`;
|
|
30
|
+
export const iconBtn = (a) => `<button type="button" class="hm-icb${a.pri ? ' pri' : ''}" ${a.attr} aria-label="${esc(a.label)}" title="${esc(a.label)}"${a.sw ? ` data-sw-${a.sw}` : ''}${a.off ? ' disabled' : ''}>${svg(ICON[a.icon] || a.icon, a.icon === 'yes' ? 2.4 : 2)}</button>`;
|
|
31
31
|
|
|
32
32
|
// systems where a write leaves PMOS; a read from them still asks as a plain Allow
|
|
33
33
|
const OUTSIDE = /jira|confluence|atlassian|slack|gmail|mail|calendar|google|drive|notion|linear|asana|teams|figma|wispr/i;
|
|
@@ -113,8 +113,13 @@ export function askCardHtml(a, { live = true, role = 'PMOS' } = {}) {
|
|
|
113
113
|
const ft = a.from || a.to ? `<p class="ft">${a.from ? `<s>${esc(a.from)}</s> → ` : ''}<b>${esc(a.to)}</b></p>` : '';
|
|
114
114
|
const more = live && a.more && a.more.length
|
|
115
115
|
? `<span class="hm-mw"><button type="button" class="hm-icb hm-dots" data-hm-pmore aria-haspopup="menu" aria-label="More choices: ${esc(a.more.map((o) => o.label).join(', '))}" title="${esc(a.more.map((o) => o.label).join(' · '))}">${svg(ICON.dots, 2.6)}</button><span class="hm-pmenu" role="menu" hidden>${a.more.map((o) => `<button type="button" role="menuitem" ${o.attr}>${esc(o.label)}</button>`).join('')}</span></span>` : '';
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
// a phone (PhoneTodayDS, job #1540): a live Allow · No card is a blue-lined line that swipes, right allows, left denies; its icon
|
|
117
|
+
// answers stay for the keyboard and a screen reader (cozy-home.css hides them from sight on a phone only)
|
|
118
|
+
const yes = a.answers.find((x) => x.icon === 'yes'), no = a.answers.find((x) => x.icon === 'no');
|
|
119
|
+
const sw = live && yes && no ? ` data-sw-right="yes" data-sw-left="no"` : '';
|
|
120
|
+
const hint = sw ? `<p class="hm-swh">${esc('Swipe right: ' + yes.label + ' · left: ' + no.label)}</p>` : '';
|
|
121
|
+
return `<div class="hm-askw" role="group" aria-label="${esc(role)} asks before it goes on"><div class="hm-askk" data-ask-kind="${a.kind}"${sw}><p class="k">${esc(a.label)}</p><b class="q">${esc(a.title)}</b>${ft}${hint}`
|
|
122
|
+
+ `<div class="acts">${a.answers.map((x) => iconBtn({ ...x, off: !live, sw: x === yes ? 'yes' : x === no ? 'no' : '' })).join('')}${more}</div></div></div>`;
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
/** True while something in the chat waits on the PM's answer: the permission prompt, a live question card or a live pmos-ask block.
|
|
@@ -30,6 +30,7 @@ import { goalUi } from './home-goal.js';
|
|
|
30
30
|
import { splitReport, reportChipHtml, blockSig } from './report-chat.js';
|
|
31
31
|
import { turnsOf } from './chat-context.js';
|
|
32
32
|
import { askCardHtml, answerText } from './chat-ask.js';
|
|
33
|
+
import { wireSwipe } from './cozy-phone-swipe.js'; // a phone: the ask card swipes (PhoneTodayDS, job #1540)
|
|
33
34
|
import { permissionAsk, splitAsk, blockAsk, iconBtn, openAsk, askCardHtml as kindCardHtml } from './home-ask.js';
|
|
34
35
|
import { splitChase, runStop, sweepLine, stopText } from './home-sweep.js';
|
|
35
36
|
import { splitSrc, srcHtml } from './chat-src.js'; // chief-of-staff C1: where each answer came from
|
|
@@ -85,6 +86,9 @@ export function mountChat(el, host) {
|
|
|
85
86
|
el.innerHTML = `<button type="button" class="hm-reopen" id="hmReopen" aria-label="Open the Viewer" title="Open the Viewer" hidden>${PANE}</button>`
|
|
86
87
|
+ '<div class="hm-chd" id="hmCh" hidden></div><div class="hm-sug" id="hmSug" hidden></div><div class="hm-plw" id="hmPl" hidden></div><div class="hm-log" id="hmLog" role="log" aria-live="polite"></div><div class="hm-foot" id="hmFoot"></div>';
|
|
87
88
|
const log = el.querySelector('#hmLog'), foot = el.querySelector('#hmFoot'), reopen = el.querySelector('#hmReopen'), head = el.querySelector('#hmCh'), sug = el.querySelector('#hmSug'), pl = el.querySelector('#hmPl');
|
|
89
|
+
// a phone: a live ask swiped right allows (or sends), left denies; it presses the card's own icon answer (home-ask.js askCardHtml)
|
|
90
|
+
if (log) wireSwipe(log, { on: () => typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches,
|
|
91
|
+
act: (row, way) => { const b = row.querySelector(way === 'right' ? '[data-sw-yes]' : '[data-sw-no]'); if (b && !b.disabled) b.click(); } });
|
|
88
92
|
const GU = goalUi({ C, host, el, draw: () => draw(), send: (t) => send(t), read: () => read(), openGoal: () => openGoal(), live: () => goalLive(), viewBody: () => document.querySelector('.obody.vw[data-vw="goal"]') });
|
|
89
93
|
GU.wire(el);
|
|
90
94
|
loadSlash(host.pmGet).then(() => { if (el.querySelector('#hmSlash:not([hidden])')) drawSlash(); });
|
|
@@ -13,7 +13,8 @@ const KEY = 'pmos.moves.looked';
|
|
|
13
13
|
const escDefault = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
14
14
|
const ICON = 'M3 12h4l3-8 4 16 3-8h4';
|
|
15
15
|
const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
|
|
16
|
-
const
|
|
16
|
+
const rowsOf = (l) => (Array.isArray(l.rows) ? l.rows : Array.isArray(l.moves) ? l.moves : null); // GET /api/drift/moves answers rows
|
|
17
|
+
const ok = (l) => l && l.ok && !!rowsOf(l);
|
|
17
18
|
|
|
18
19
|
export function lookedWeek() { try { return localStorage.getItem(KEY) || ''; } catch { return ''; } }
|
|
19
20
|
export function markLooked(week) { try { if (week) localStorage.setItem(KEY, week); } catch { /* this browser keeps no store */ } }
|
|
@@ -40,11 +41,11 @@ function moveHtml(m, esc) {
|
|
|
40
41
|
|
|
41
42
|
/** The list, one section per product. */
|
|
42
43
|
export function listHtml(lists, { esc = escDefault } = {}) {
|
|
43
|
-
const L = (lists || []).filter(ok).filter((l) => l.
|
|
44
|
+
const L = (lists || []).filter(ok).filter((l) => rowsOf(l).length);
|
|
44
45
|
if (!L.length) return '<p class="yd-exp">Nothing moved in dates or scope last week.</p>';
|
|
45
46
|
const many = L.length > 1;
|
|
46
47
|
return L.map((l) => {
|
|
47
|
-
const rows = l.
|
|
48
|
+
const rows = rowsOf(l).slice().sort((a, b) => (a.sourced === b.sourced ? 0 : a.sourced ? 1 : -1));
|
|
48
49
|
const head = many ? `<h3>${esc(l.name || l.ws)}</h3>` : '';
|
|
49
50
|
const sum = `<p class="yd-exp">${esc(plural(l.total, 'move', 'moves'))}${l.unsourced ? ', ' + esc(String(l.unsourced)) + ' with no source' : ''}.</p>`;
|
|
50
51
|
return `<section class="mv-prod">${head}${sum}<ul class="mv-list">${rows.map((m) => moveHtml(m, esc)).join('')}</ul></section>`;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
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
2
|
*
|
|
3
|
-
* On a phone,
|
|
3
|
+
* On a phone, Today's page with ?chats=1 is Ask PMOS (PhoneTodayDS, job #1540: a group heads with its work and product, the blue dot
|
|
4
|
+
* sits after the time): the chats, grouped by the work each is about, "Not in a work yet" last. The header is
|
|
4
5
|
* 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
6
|
* 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
|
*
|
|
@@ -13,8 +14,7 @@
|
|
|
13
14
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
14
15
|
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
16
|
const IC = {
|
|
16
|
-
|
|
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',
|
|
17
|
+
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
18
|
};
|
|
19
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
20
|
/** The chat's last words: "PMOS: …" from the session's last output, '' when there is none (zero is silence). */
|
|
@@ -24,12 +24,12 @@ export function lastLine(s) {
|
|
|
24
24
|
return t ? 'PMOS: ' + clip(t, 120) : '';
|
|
25
25
|
}
|
|
26
26
|
export function askGroups(rows, raw = [], o = {}) {
|
|
27
|
-
const titleOf = o.titleOf || (() => '');
|
|
27
|
+
const titleOf = o.titleOf || (() => ''), productOf = o.productOf || (() => '');
|
|
28
28
|
const byId = new Map((raw || []).filter(Boolean).map((s) => [s.id, s]));
|
|
29
29
|
const G = new Map();
|
|
30
30
|
for (const r of rows || []) {
|
|
31
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: [] });
|
|
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', product: r.ini ? productOf(r.ini) || '' : '', rows: [] });
|
|
33
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
34
|
}
|
|
35
35
|
const out = [...G.values()].map((g) => ({ ...g, n: g.rows.length }));
|
|
@@ -49,9 +49,9 @@ export function askHtml(groups, o = {}) {
|
|
|
49
49
|
const head = '<header class="pa-top"><h1>Ask PMOS</h1></header>';
|
|
50
50
|
const body = !o.ready ? '<p class="pa-none">Reading your chats.</p>'
|
|
51
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
|
|
52
|
+
: groups.map((g) => `<section class="pa-g" aria-label="${esc(g.title + (g.product ? ', ' + g.product : ''))}"><h2><span class="pa-gt">${esc(g.title)}</span>${g.product ? `<em>· ${esc(g.product)}</em>` : ''}</h2>`
|
|
53
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
|
-
+
|
|
54
|
+
+ `<span class="pa-x"><b>${esc(r.name)}</b>${r.last ? `<small>${esc(r.last)}</small>` : ''}</span>${r.word ? `<time>${esc(r.word)}</time>` : ''}${r.wait ? '<i class="pa-d" aria-hidden="true"></i>' : ''}</button></li>`).join('')}</ul></section>`).join('');
|
|
55
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
56
|
return `<div class="pa">${head}${body}</div>${foot}`;
|
|
57
57
|
}
|
|
@@ -862,7 +862,7 @@ function drawInit() {
|
|
|
862
862
|
const body = $('#ibBody');
|
|
863
863
|
body.dataset.view = v; body.dataset.span = v === 'time' ? span : '';
|
|
864
864
|
document.body.classList.toggle('wk-on', v === 'work');
|
|
865
|
-
const html = v === 'work' ? drawWork(L) : v === 'track' ? drawTrack(L) : v === 'time' ? drawTime(L) : v === 'list' ? (phone ? V.phoneListHtml(L) : V.listHtml(L, filtered())) : V.stagesHtml(L, { phone });
|
|
865
|
+
const html = v === 'work' ? drawWork(L) : v === 'track' ? drawTrack(L) : v === 'time' ? drawTime(L) : v === 'list' ? (phone ? ST.standsHtml(L, { sug: false, max: 2 }) + V.phoneListHtml(L) : V.listHtml(L, filtered())) : V.stagesHtml(L, { phone });
|
|
866
866
|
// a phone has no ⋯ menu: Metrics and Cancelled and archived stay one press away in every view, not only the track
|
|
867
867
|
const phx = phone && v !== 'track' ? `<div class="bd-whead bd-phx"><span class="bd-phb"><button type="button" class="bd-chip" data-open="metrics" aria-haspopup="dialog">Metrics</button><button type="button" class="bd-chip" data-open="gone" aria-haspopup="dialog">Cancelled and archived</button></span></div>` : '';
|
|
868
868
|
if (v === 'time') TL.hold(); else TL.forget();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "The phone Today, Ask PMOS and Work (job #1540, done test planning/done-tests/phone-today-work.md C1-C7, C10): the pure parts of Today's phone page, the menu, Ask PMOS, the Work list row and the initiative on a phone. No browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"phone-today-work.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"phone-today-work.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|