create-pmos 0.691.0 → 0.693.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 +20 -14
- 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/adler-moments-test.js +3 -35
- package/workspace/adler-seasons-test.js +1 -1
- package/workspace/briefing-premium-adddoc-test.js +1 -1
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/briefing-premium-doc-edit-test.js +1 -1
- package/workspace/briefing-premium-work-test.js +2 -2
- package/workspace/changelog.json +19 -0
- package/workspace/chat-asks-test.js +1 -1
- package/workspace/core-docs-workflow-test.js +1 -1
- package/workspace/ev-everywhere-test.js +3 -14
- package/workspace/guide/cli.md +3 -1
- package/workspace/guide/home.md +1 -1
- package/workspace/guide/layout.md +2 -2
- package/workspace/guide/settings-and-switches.md +0 -1
- package/workspace/impact-screens-test.js +2 -47
- package/workspace/ini-workflow-test.js +1 -1
- package/workspace/lib/board-premium.js +10 -2
- package/workspace/lib/initiative-cli.js +31 -4
- package/workspace/lib/initiative-origin.js +131 -0
- package/workspace/lib/initiative-writer.js +35 -2
- package/workspace/lib/routes-boards.js +4 -1
- package/workspace/live-pill-round-test.js +6 -18
- package/workspace/milestone-suggest-test.js +4 -28
- package/workspace/news-viewers-test.js +3 -29
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -2
- package/workspace/premium-briefing-depth-test.js +4 -4
- package/workspace/premium-chat-attach-test.js +3 -2
- package/workspace/premium-chat-chart-tab-test.js +8 -7
- package/workspace/premium-chat-context-test.js +3 -1
- package/workspace/premium-chat-goal-view-test.js +3 -1
- package/workspace/premium-chat-line-test.js +8 -6
- package/workspace/premium-chat-report-tab-test.js +13 -5
- package/workspace/premium-chat-term-test.js +2 -2
- package/workspace/premium-chat-viewer-test.js +10 -16
- package/workspace/premium-core-doc-issue-test.js +7 -2
- package/workspace/premium-discuss-landing-test.js +9 -5
- package/workspace/premium-html-viewer-test.js +7 -3
- package/workspace/premium-link-suggest-test.js +6 -10
- package/workspace/premium-phone-card-test.js +2 -2
- package/workspace/premium-viewer-download-test.js +1 -1
- package/workspace/premium-viewer-flicker-test.js +1 -1
- package/workspace/premium-viewer-share-test.js +2 -2
- package/workspace/premium-viewer-test.js +1 -1
- package/workspace/premium-vw-cal-test.js +1 -1
- package/workspace/premium-vw-copy-test.js +3 -3
- package/workspace/premium-vw-doc-test.js +1 -1
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-work-depth-test.js +2 -2
- package/workspace/program-charter-test.js +1 -12
- package/workspace/program-leave-test.js +2 -2
- package/workspace/program-order-test.js +3 -65
- package/workspace/project-onboard-flow-test.js +5 -5
- package/workspace/public/pm/bd-work.js +24 -5
- package/workspace/public/pm/cozy-home.css +0 -6
- package/workspace/public/pm/cozy-panels.js +2 -6
- package/workspace/public/pm/cozy-popup.css +1 -0
- package/workspace/public/pm/cozy-popup.js +15 -2
- package/workspace/public/pm/cozy-today-page.css +1 -1
- package/workspace/public/pm/cozy-today.css +0 -14
- package/workspace/public/pm/cozy-viewer.js +14 -38
- package/workspace/public/pm/goal-chat.js +2 -2
- package/workspace/public/pm/home-app.js +8 -67
- package/workspace/public/pm/home-chat.js +1 -1
- package/workspace/public/pm/home-ses-name.js +3 -2
- package/workspace/public/pm/home-today.js +4 -18
- package/workspace/public/premium-intelligence.html +1 -1
- package/workspace/public/premium-viewer.html +1 -1
- package/workspace/public/premium-workflows.html +1 -1
- package/workspace/ready-dash-ui-test.js +1 -1
- package/workspace/rename-test.js +2 -2
- package/workspace/server.js +11 -12
- package/workspace/session-names-test.js +34 -56
- package/workspace/sort-order-test.js +2 -71
- package/workspace/split-merge-ui-test.js +1 -1
- package/workspace/stage-card-tasks-test.js +1 -1
- package/workspace/stage-card-test.js +1 -1
- package/workspace/task-card-test.js +1 -1
- package/workspace/task-press-test.js +1 -1
- package/workspace/task-views-test.js +1 -1
- package/workspace/test-lists/adler-seasons-art.json +3 -6
- package/workspace/test-lists/batch18-asks.json +1 -1
- package/workspace/test-lists/briefing-premium.json +1 -11
- package/workspace/test-lists/premium-agreed-viewer.json +1 -1
- package/workspace/test-lists/who-raised-each-idea.json +5 -0
- package/workspace/test-run.js +0 -2
- package/workspace/test-timings.json +0 -4
- package/workspace/tk-tasks-test.js +3 -17
- package/workspace/viewer-trail-test.js +2 -2
- package/workspace/workflows-setup-test.js +4 -2
- package/workspace/adler-seasons-art-test.js +0 -116
- package/workspace/briefing-premium-initiative-test.js +0 -289
- package/workspace/briefing-premium-products-test.js +0 -209
- package/workspace/briefing-premium-sources-test.js +0 -250
- package/workspace/briefing-premium-test.js +0 -282
- package/workspace/home-other-product-test.js +0 -197
- package/workspace/home-pill-test.js +0 -138
- package/workspace/home-railcard-test.js +0 -196
- package/workspace/home-rows-test.js +0 -389
- package/workspace/panels-test.js +0 -454
- package/workspace/public/premium.html +0 -48
- package/workspace/test-lists/batch18-panels.json +0 -9
- package/workspace/test-lists/home-railcard.json +0 -9
- package/workspace/test-lists/home-sessions-pill.json +0 -6
- package/workspace/test-lists/viewer-home-rows.json +0 -9
|
@@ -136,7 +136,7 @@ const S = {
|
|
|
136
136
|
ini: P.get('ini') || null, // the initiative whose page is open ('product' for the product)
|
|
137
137
|
head: null, // the selected heading of the list: a program's or a product's group key
|
|
138
138
|
sel: null, // the selected row's id
|
|
139
|
-
allNeeds: false, kids: new Set(), shut: new Set(JSON.parse(store.get('pmos.home.shut') || '[]')),
|
|
139
|
+
allNeeds: false, kids: new Set(), shut: new Set(JSON.parse(store.get('pmos.home.shut') || '[]')),
|
|
140
140
|
IM: null, IMid: null, // the selected initiative's model (GET /api/initiative-premium)
|
|
141
141
|
iniWs: {}, // another product's initiative found by a read (loadIni), by id: the workspace it was found in
|
|
142
142
|
doneOpen: false, stepsMore: false, sheet: false, rec: {}, pin: new Set(JSON.parse(store.get('pmos.home.pin') || '[]')),
|
|
@@ -385,7 +385,6 @@ function homeListHtml() {
|
|
|
385
385
|
const T = null; // the top of Home (A′, HmA2) is off: the list is navigation only (Wawan 2026-11-17); topOf(M) draws it again
|
|
386
386
|
S.topHtml = T ? TOP.topHtml(T) : ''; // drawn into its own node (drawTopNode), so a late read changes the top, never the rows under it
|
|
387
387
|
const sel = S.sel || (S.ini && S.ini !== 'product' ? 'i:' + S.ini : null);
|
|
388
|
-
S.lo = { sel, ses: S.ses, restOpen: (k) => S.rest.has(k), pin: S.pin, phone: false }; // the folded rail's card draws Home's rows with these
|
|
389
388
|
return TD.listHtml(M, todayModel(), {
|
|
390
389
|
sel, selHead: S.head, ses: S.ses, pOpen, here: isPhone() ? null : TD.groupOfOpen(M, sel) || S.head, restOpen: (k) => S.rest.has(k), cap: S.cap, pin: S.pin, avHtml, ready: S.ready, err: S.D.err.length ? S.D.err[0] : '',
|
|
391
390
|
pick: S.D.pick, tones: pickTones(), review: R, mic: canDictate(), phone: isPhone(), day: S.day, news: S.news && S.news.ok ? S.news.count : 0, top: S.ready ? revealLeft(S.reveal) + RECROW.html() + (S.drift ? DRIFT.rowHtml(S.drift.c, { esc, sel: S.sel === 'drift' }) : '') + (T ? '<i data-hm-topslot hidden></i>' : '') : '', held: T ? T.held : null, // chief-of-staff C3: the Mentions and Your impact cards are gone; their asks land in Your move
|
|
@@ -916,9 +915,7 @@ function drawList() {
|
|
|
916
915
|
if (FST && sc.firstElementChild !== FST) sc.prepend(FST);
|
|
917
916
|
if (SETUP_CHECKLIST && !sc.contains(SETUP_CHECKLIST)) sc.prepend(SETUP_CHECKLIST);
|
|
918
917
|
if (PHC && PHC.el.parentNode === sc) PHC.el.remove();
|
|
919
|
-
document.body.classList.toggle('hm-folded', S.folded && !isPhone());
|
|
920
918
|
document.body.classList.toggle('hm-plist', isPhone() && !S.phoneChat); // a phone: the list is the page until a row opens its conversation (HmPhone)
|
|
921
|
-
drawRailCard();
|
|
922
919
|
drawRecTop();
|
|
923
920
|
drawAsk();
|
|
924
921
|
if (TDY) TDY.draw(); // Today on a desk (today.html): the log and the agenda, from the same reads
|
|
@@ -947,47 +944,6 @@ function drawAsk() {
|
|
|
947
944
|
const h = askHtml(askGroups(R.all, S.D.sessions || [], { titleOf: (id) => (iniRowOf(id) ? iniTitle(id) : ''), now: NOW() }), { ready: S.ready });
|
|
948
945
|
if (el.__h !== h) { el.__h = h; el.innerHTML = h; }
|
|
949
946
|
}
|
|
950
|
-
/** 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. */
|
|
951
|
-
function setFold(on) {
|
|
952
|
-
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
|
|
953
|
-
if (VW.isOpen() && VW.panels) {
|
|
954
|
-
VW.panels.relayout();
|
|
955
|
-
// a Viewer the panels lay out (full, two side by side) does not ask the page again: the press folds or unfolds the list now, in every layout
|
|
956
|
-
if (VW.panels.railOn() !== (S.folded && !isPhone())) VW.panels.rail(S.folded && !isPhone());
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
/* ── the folded rail's card (batch 18 item 14, FlA1–FlA5) ──
|
|
960
|
-
* With the Viewer wide, Home's list folds to a rail of group tiles (cozy-viewer.js). A tile's press opens a card beside it with that group's
|
|
961
|
-
* rows, Home's own (iniHtml): a row opens as on Home and the card closes, the rail and the Viewer's width stay; the pill lists the sessions
|
|
962
|
-
* in place. A second press on the tile, ×, Escape or a press outside closes it. The card sits in the rail, inside #hmList, so the list's
|
|
963
|
-
* own presses work in it. S.rc: the group whose card is open. */
|
|
964
|
-
function drawRailCard() {
|
|
965
|
-
const bar = $('#hmList > .cz-vw-railbar');
|
|
966
|
-
if (!bar || isPhone() || !VW.railOn() || !S.M || !S.M.groups.some((g) => g.key === S.rc)) S.rc = null;
|
|
967
|
-
let card = bar && bar.querySelector(':scope > .hv-rc');
|
|
968
|
-
if (!S.rc) { if (card) card.remove(); VW.railSync(null); return; }
|
|
969
|
-
if (!card) { card = document.createElement('div'); card.className = 'hv-rc'; card.setAttribute('role', 'dialog'); card.setAttribute('data-esc-layer', ''); bar.append(card); }
|
|
970
|
-
const g = S.M.groups.find((x) => x.key === S.rc);
|
|
971
|
-
card.setAttribute('aria-label', g.name);
|
|
972
|
-
const html = TD.railCardHtml(S.M, S.rc, S.lo);
|
|
973
|
-
if (card.__h !== html) { card.__h = html; card.innerHTML = html; }
|
|
974
|
-
VW.railSync(S.rc);
|
|
975
|
-
// beside the tile, its top with the tile's, kept inside the window
|
|
976
|
-
const t = bar.querySelector(`[data-cz-vw-rail="${CSS.escape(S.rc)}"]`);
|
|
977
|
-
if (!t) return;
|
|
978
|
-
const r = t.getBoundingClientRect();
|
|
979
|
-
card.style.left = Math.round(r.right + 12) + 'px';
|
|
980
|
-
card.style.top = Math.round(Math.max(12, Math.min(r.top - 10, innerHeight - card.offsetHeight - 12))) + 'px';
|
|
981
|
-
}
|
|
982
|
-
function railCard(key, o = {}) {
|
|
983
|
-
const was = S.rc;
|
|
984
|
-
S.rc = key || null; S.ses = null;
|
|
985
|
-
drawList();
|
|
986
|
-
if (S.rc) { const f = $('#hmList .hv-rc .hv-rcb .hm-rm, #hmList .hv-rc .hv-rcb .hv-fold'); if (f && o.focus !== false) f.focus({ preventScroll: true }); return; }
|
|
987
|
-
const t = was && o.back && $(`#hmList [data-cz-vw-rail="${CSS.escape(was)}"]`); if (t) t.focus();
|
|
988
|
-
}
|
|
989
|
-
VW.railCard((key) => railCard(S.rc === key ? null : key, { back: true }));
|
|
990
|
-
document.addEventListener('cz:vw-rail', (e) => { if (!e.detail.on && S.rc) S.rc = null; });
|
|
991
947
|
/* A phone chat has no floating menu, so while a meeting records its pill sits in the top bar (XcbOptions B, case 7): a red dot and the
|
|
992
948
|
* clock (home-rec-row.js ticks every [data-hr-clock]); a press opens the live meeting in place. No recording: no pill. */
|
|
993
949
|
function drawRecTop() {
|
|
@@ -1038,7 +994,7 @@ function drawTop() {
|
|
|
1038
994
|
if (PH) PH.draw();
|
|
1039
995
|
}
|
|
1040
996
|
const SN = mountSesName({ esc, pmPost, toast, toastUndo: (m, u) => toastUndo(m, u), session: (sid) => S.D.sessions.find((x) => x.id === sid) || null, shown: (x) => H.nameOf(x),
|
|
1041
|
-
changed: () => { drawTop(); chat.refresh(); drawList(); } });
|
|
997
|
+
changed: () => { drawTop(); chat.refresh(); drawList(); POP.refresh(); } });
|
|
1042
998
|
|
|
1043
999
|
/* ── the chat ── */
|
|
1044
1000
|
// a chat Home opened by itself on load (the first Needs-you row) is not the PM touching it: a touch counts after the PM's first press or
|
|
@@ -2037,7 +1993,7 @@ function menCtx() {
|
|
|
2037
1993
|
function chatAbout(t) {
|
|
2038
1994
|
S.phoneChat = isPhone(); if (isPhone()) VW.close();
|
|
2039
1995
|
S.sel = null; // the conversation is about its own item, not the row picked in the list (its header named that row)
|
|
2040
|
-
|
|
1996
|
+
addressChat({ ...homeTarget(), key: t.key, title: t.title, scope: t.scope && t.scope.text ? { text: String(t.scope.text), icon: t.scope.icon || I.chat } : { text: 'Report · ' + t.title, icon: I.chat }, intro: t.intro ? { role: CLAUDE, text: t.intro } : undefined,
|
|
2041
1997
|
placeholder: t.placeholder || 'Message PMOS', context: t.context });
|
|
2042
1998
|
drawList(); chat.focus();
|
|
2043
1999
|
}
|
|
@@ -2206,7 +2162,6 @@ $('#hmDesk').onclick = (e) => { if (S.sheet && e.target === $('#hmDesk')) sheet(
|
|
|
2206
2162
|
$('#hmList').onclick = (e) => { // delegated: every press on the list is a <button>
|
|
2207
2163
|
const b = e.target.closest('button'); if (!b) return;
|
|
2208
2164
|
const d = b.dataset;
|
|
2209
|
-
if ('hmRcx' in d) { railCard(null, { back: true }); return; } // × on the folded rail's card
|
|
2210
2165
|
// the top of Home (home-your-move-waiting): a Your move row presses as it does on Good morning; Waiting on others opens its nudge or source
|
|
2211
2166
|
if (b.closest('.hy')) {
|
|
2212
2167
|
if (/^mv-/.test(d.yd || '')) { movePress(b); return; }
|
|
@@ -2214,14 +2169,12 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
|
|
|
2214
2169
|
if ('hmTopall' in d) { S.topAll = !S.topAll; drawList(); const f = $('#hmList [data-hm-topall]'); if (f) f.focus(); return; }
|
|
2215
2170
|
if (d.hmNudge || d.hmWait) { waitPress(b); return; }
|
|
2216
2171
|
}
|
|
2217
|
-
// a pick in the rail's card: the card closes, the rail stays folded and the Viewer as wide (FlA4After)
|
|
2218
|
-
if (S.rc && b.closest('.hv-rc') && (d.hmSel || d.hmProg || d.hmProdopen || d.hmSesnew)) { S.rc = null; S.ses = null; VW.keepWide(); }
|
|
2219
2172
|
if (d.hmSes) { sesPill(d.hmSes === S.ses ? null : d.hmSes); return; } // an initiative's pill: what sits in it, under it (a sheet on a phone)
|
|
2220
2173
|
if ('hmSesx' in d) { sesPill(null); return; }
|
|
2221
2174
|
if (d.hmSesnew) { sesPill(null, false); newIn(d.hmSesnew); return; }
|
|
2222
2175
|
if (d.hmProdnew) { sesPill(null, false); const g = ((S.M && S.M.groups) || []).find((x) => x.key === d.hmProdnew); if (g && g.kind === 'program') goProgram(g.program.id); else if (g && !g.primary && g.product && g.product.ws) goOtherProduct(g); else goIni('product'); { const c = chat.current(); if (c && c.newChat) c.newChat(); } return; }
|
|
2223
2176
|
if (d.hmCompact) { compact(d.hmCompact); return; } // ✓ on Claude's ✦ Compact (batch 13 item 8): the pill's list stays open
|
|
2224
|
-
if (S.ses && !b.closest('.hv-spp, .hv-sps
|
|
2177
|
+
if (S.ses && !b.closest('.hv-spp, .hv-sps')) sesPill(null, false); // a press anywhere else in the list closes it
|
|
2225
2178
|
if (d.hmSel) { if (S.ses) sesPill(null, false); if (S.day) S.day = false; select(d.hmSel); return; }
|
|
2226
2179
|
if ('hrImpact' in d) { if (S.day) S.day = false; S.sel = 'impact'; if (isPhone()) S.phoneChat = true; openTarget(homeTarget()); drawList(); return; } // Your impact: Home's own chat, on the weekly check
|
|
2227
2180
|
if ('hrDrift' in d) { if (S.day) S.day = false; S.sel = 'drift'; if (isPhone()) S.phoneChat = true; openTarget(homeTarget()); drawList(); return; } // What you might have missed: Home's own chat, on the weekly ✦
|
|
@@ -2255,7 +2208,6 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
|
|
|
2255
2208
|
if ('hmNew' in d) { menu(b, newItems(), 'New'); return; }
|
|
2256
2209
|
// the list header's fold (batch 18 item 15; batch 20 item 6): with a Viewer open the list folds to the rail; with none, it folds away and the
|
|
2257
2210
|
// button at the top left brings it back. Only this fold and its unfold change the list: a Viewer's width, wide or close never do
|
|
2258
|
-
if ('hmFold' in d) { setFold(true); return; }
|
|
2259
2211
|
if ('hmMeet' in d) { const m = H.meetLineOf(S.D.today); if (m) openMeeting(m.meeting); return; }
|
|
2260
2212
|
if ('hmCal' in d) { openCalendar(); return; }
|
|
2261
2213
|
if ('hmRec' in d) { MORE.openRecorder().then(() => drawList()); return; }
|
|
@@ -2276,23 +2228,13 @@ function sesPill(id, back = true) {
|
|
|
2276
2228
|
const was = S.ses;
|
|
2277
2229
|
S.ses = id || null;
|
|
2278
2230
|
drawList();
|
|
2279
|
-
const f = id ? $('#hmList .hv-spp .hm-rm, #hmList .hv-sps .hm-rm
|
|
2231
|
+
const f = id ? $('#hmList .hv-spp .hm-rm, #hmList .hv-sps .hm-rm') : back && was ? $(`#hmList [data-hm-ses="${CSS.escape(was)}"]`) : null;
|
|
2280
2232
|
if (f) f.focus();
|
|
2281
2233
|
}
|
|
2282
2234
|
// Escape closes it wherever the focus is (a redraw of the list can drop the focus to the page); a press outside the list closes it too
|
|
2283
2235
|
window.addEventListener('keydown', (e) => { if (e.key === 'Escape' && S.ses && menuEl.hidden) { e.preventDefault(); e.stopPropagation(); sesPill(null); } }, true); // before the Viewer's own Escape
|
|
2284
2236
|
// a press outside the list (the chat, the Viewer) closes an open pill list too
|
|
2285
2237
|
document.addEventListener('pointerdown', (e) => { if (S.ses && !e.target.closest('#hmList')) sesPill(null, false); });
|
|
2286
|
-
// the rail's card: Escape closes it (after an open pill list) and gives the focus back to its tile; a press outside it closes it
|
|
2287
|
-
window.addEventListener('keydown', (e) => { if (e.key === 'Escape' && S.rc && !e.defaultPrevented && menuEl.hidden) { e.preventDefault(); e.stopPropagation(); railCard(null, { back: true }); } }, true);
|
|
2288
|
-
document.addEventListener('pointerdown', (e) => { if (S.rc && !e.target.closest('.hv-rc, .cz-vw-railtile')) railCard(null); });
|
|
2289
|
-
// arrows move between the card's rows
|
|
2290
|
-
$('#hmList').addEventListener('keydown', (e) => {
|
|
2291
|
-
if ((e.key !== 'ArrowDown' && e.key !== 'ArrowUp') || !e.target.closest('.hv-rc')) return;
|
|
2292
|
-
const all = [...document.querySelectorAll('#hmList .hv-rc .hv-rcb .hm-rm, #hmList .hv-rc .hv-rcb .hv-fold, #hmList .hv-rc .hv-rcb [data-hm-sesnew]')];
|
|
2293
|
-
const i = all.indexOf(e.target.closest('button')); if (!all.length) return;
|
|
2294
|
-
e.preventDefault(); all[Math.max(0, Math.min(all.length - 1, i < 0 ? 0 : i + (e.key === 'ArrowDown' ? 1 : -1)))].focus();
|
|
2295
|
-
});
|
|
2296
2238
|
$('#hmList').addEventListener('submit', async (e) => { // the capture box: Enter adds the task
|
|
2297
2239
|
if (e.target.id !== 'hmCapF') return;
|
|
2298
2240
|
e.preventDefault();
|
|
@@ -2343,9 +2285,6 @@ async function todayPress(k, b) {
|
|
|
2343
2285
|
load();
|
|
2344
2286
|
}
|
|
2345
2287
|
}
|
|
2346
|
-
$('#hmDesk').insertAdjacentHTML('afterbegin', `<button type="button" class="hm-unfold" id="hmUnfold" aria-label="Show the list" title="Show the list">${SVG(I.fold, 16)}</button>`);
|
|
2347
|
-
$('#hmUnfold').onclick = () => setFold(false);
|
|
2348
|
-
VW.listFold({ folded: () => S.folded && !isPhone(), chosen: () => store.get('pmos.home.fold') !== null, show: () => setFold(false) });
|
|
2349
2288
|
function cta() {
|
|
2350
2289
|
if (S.ini === 'product') { const C = H.productCard(S.D); if (C.sent) openUpdateViewer(); else { select('n:update'); } return; }
|
|
2351
2290
|
const h = S.H || {};
|
|
@@ -2431,7 +2370,9 @@ PH.draw();
|
|
|
2431
2370
|
/* The one popup (slice 2): Home's own chat is the popup's chat, so the page never holds two; a session picked in it opens the way Home opens a
|
|
2432
2371
|
* session; the chat icon opens a session's initiative on the popup's left. */
|
|
2433
2372
|
POP.useChat({ el: $('#hmChat'), open: (t) => openTarget(t), current: () => (chat.current ? chat.current() : null), focus: () => chat.focus(),
|
|
2434
|
-
sessionTarget: (row) => { const s = (S.D.sessions || []).find((x) => x.id === row.id); return s ? sessionTarget(s) : null; }
|
|
2373
|
+
sessionTarget: (row) => { const s = (S.D.sessions || []).find((x) => x.id === row.id); return s ? sessionTarget(s) : null; },
|
|
2374
|
+
// on a desk the popup's top bar replaced Home's chat header: ⋯ › Rename session, and the title becomes the name field (session names A)
|
|
2375
|
+
nameHtml: (sid, name) => SN.titleHtml(sid, name), renaming: (sid) => SN.renaming(sid) });
|
|
2435
2376
|
POP.setTitles((id) => (iniRowOf(id) ? iniTitle(id) : ''));
|
|
2436
2377
|
POP.setOpener((id) => { openIniFrom(id).then(() => iniPage()); });
|
|
2437
2378
|
mountPanels({
|
|
@@ -648,7 +648,7 @@ export function mountChat(el, host) {
|
|
|
648
648
|
const shutAdd = (focus) => { if (!C.addOpen) return; C.addOpen = false; drawFoot({ role: role() }); if (focus) { const a = foot.querySelector('#hmAdd'); if (a) a.focus(); } };
|
|
649
649
|
document.addEventListener('click', (e) => { if (C.addOpen && e.target.isConnected && !e.target.closest('.hm-addw')) shutAdd(false); }, true);
|
|
650
650
|
// Escape closes the goal choice or method menu wherever the focus is: the redraw that opens the choice can drop the focus to the page
|
|
651
|
-
document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !e.defaultPrevented && el.isConnected && !el.contains(e.target) && !document.
|
|
651
|
+
document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !e.defaultPrevented && el.isConnected && !el.contains(e.target) && ![...document.querySelectorAll('[data-esc-layer]')].some((x) => !el.contains(x)) && GU.escape()) e.preventDefault(); });
|
|
652
652
|
el.addEventListener('keydown', (e) => {
|
|
653
653
|
if (e.key === 'Escape' && C.addOpen) { e.preventDefault(); e.stopPropagation(); shutAdd(true); return; }
|
|
654
654
|
if (e.key === 'Escape' && NPU.escape()) { e.preventDefault(); e.stopPropagation(); return; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* pm/home-ses-name.js — tap a session's name to rename it (session names A, canvas XmsNames; the agreed rename field of RnATask).
|
|
2
|
-
* The open session's name is the press in the phone's top bar
|
|
2
|
+
* The open session's name is the press in the phone's top bar; on a desk, "Rename session" in the popup's ⋯ menu (cozy-popup.js). A tap turns it into one field with a blue
|
|
3
3
|
* check: Enter saves, Esc cancels, an empty or unchanged name saves nothing, a refusal keeps the field with the reason. The PM's name locks
|
|
4
4
|
* the session's name: Claude never renames it again (lib/session-name.js). "Renamed" with Undo, and every row shows the new name at once.
|
|
5
5
|
*
|
|
@@ -13,7 +13,8 @@ const CHECK = '<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true
|
|
|
13
13
|
export function mountSesName(host) {
|
|
14
14
|
const { esc } = host;
|
|
15
15
|
const R = { sid: null, value: '', busy: false, err: '' };
|
|
16
|
-
|
|
16
|
+
// the field you can see: on a desk the popup's top bar holds it, and Home's own chat header (hidden there) draws one too
|
|
17
|
+
const field = () => { const all = [...document.querySelectorAll('[data-hm-ren] input')]; return all.find((i) => i.offsetParent) || all[0] || null; };
|
|
17
18
|
|
|
18
19
|
function titleHtml(sid, title, cls = '') {
|
|
19
20
|
if (!sid) return esc(title || '');
|
|
@@ -131,10 +131,10 @@ function pillHtml(r, o) {
|
|
|
131
131
|
}
|
|
132
132
|
/** A product's own chats as a row for the pill (the same pill and list an initiative row has; Wawan, batch 20 item 10). */
|
|
133
133
|
const prodRow = (g) => ({ id: 'product', at: -1, name: g.name, kids: g.kids || [], prodNew: g.key });
|
|
134
|
-
const prodPillHtml = (g, o) =>
|
|
134
|
+
const prodPillHtml = (g, o) => pillHtml(prodRow(g), { ...o, gk: g.key });
|
|
135
135
|
function prodPopHtml(g, o) {
|
|
136
136
|
const r = prodRow(g);
|
|
137
|
-
return !o.
|
|
137
|
+
return !o.phone && r.kids.length && o.ses === sesKey(r, { gk: g.key }) ? `<div class="hv-spp hv-spp-p" data-esc-layer role="dialog" aria-label="In ${esc(g.name)}">${sesListHtml(r, o)}</div>` : '';
|
|
138
138
|
}
|
|
139
139
|
/** The list behind the pill: the rows that used to nest, waiting first, then + for a new session here. */
|
|
140
140
|
function sesListHtml(r, o) {
|
|
@@ -156,7 +156,7 @@ export function sesSheetHtml(M, o) {
|
|
|
156
156
|
function iniHtml(r, o, po) {
|
|
157
157
|
const on = o.ses === sesKey(r, o) && !o.phone && r.kids.length;
|
|
158
158
|
// in the folded rail's card (batch 18 item 14, FlA2) the sessions open in place under the row, inside the card
|
|
159
|
-
const pop = !on ? '' :
|
|
159
|
+
const pop = !on ? '' : `<div class="hv-spp" data-esc-layer role="dialog" aria-label="In ${esc(r.name)}">${sesListHtml(r, o)}</div>`;
|
|
160
160
|
const t = track(r.at, r.stage, r.steps);
|
|
161
161
|
return `<div class="hm-r hv-r ini st-${esc(r.state)}${o.sel === r.id ? ' sel' : ''}${on ? ' sp-on' : ''}" data-id="${esc(r.id)}"${po ? ` data-po-id="${esc(r.ini || r.id)}"` : ''}>${po ? gripHtml(r.name) : ''}<button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${o.sel === r.id ? ' aria-current="true"' : ''} title="${esc(r.hint)}">${markHtml(r.yours && r.state !== 'blocked' ? { state: 'needs' } : r)}`
|
|
162
162
|
+ `<span class="hm-rt"><b>${esc(r.name)}</b></span></button>${pillHtml(r, o)}${t ? `<button type="button" class="hv-tk" data-hm-sel="${esc(r.id)}" tabindex="-1" aria-hidden="true">${t}</button>` : ''}${o.card ? '' : pop}</div>${o.card ? pop : ''}`;
|
|
@@ -252,19 +252,6 @@ export function groupOfOpen(M, sel) {
|
|
|
252
252
|
}
|
|
253
253
|
return null;
|
|
254
254
|
}
|
|
255
|
-
/** The folded rail's card (batch 18 item 14, FlA1–FlA5): a group's tile, name and › (opens the program or product), a program's next
|
|
256
|
-
* milestone, ×; then Home's own rows for that group (the quiet ones folded, the open one shown), the pill's sessions in place. */
|
|
257
|
-
export function railCardHtml(M, key, o) {
|
|
258
|
-
const g = M && (M.groups || []).find((x) => x.key === key && x.kind !== 'loose');
|
|
259
|
-
if (!g) return '';
|
|
260
|
-
const prog = g.kind === 'program';
|
|
261
|
-
const tile = prog ? `<span class="hv-tl tp" aria-hidden="true">${svg(P.layers, 16)}</span>` : `<span class="hv-tl t${g.tone}" aria-hidden="true">${esc(g.initials)}</span>`;
|
|
262
|
-
const go = prog ? `data-hm-prog="${esc(g.program.id)}" aria-label="Open ${esc(g.name)}, a program"` : `data-hm-prodopen="${esc(g.key)}" aria-label="Open ${esc(g.name)}, a product"`;
|
|
263
|
-
const oc = { ...o, card: true };
|
|
264
|
-
return `<div class="hv-rch"><button type="button" class="hv-pt" ${go}>${tile}<b>${esc(g.name)}</b>${svg(P.chevR, 16)}</button>${prog ? msHtml(g) : ''}`
|
|
265
|
-
+ `<button type="button" class="ut-ib hv-ib" data-hm-rcx aria-label="Close" title="Close">${svg(P.x, 18)}</button></div>`
|
|
266
|
-
+ `<div class="hv-rcb">${prog ? programBody(g, oc, false) : productBody(g, oc, false)}</div>`;
|
|
267
|
-
}
|
|
268
255
|
/** "Not in an initiative" (HvAC .lh): a line under the groups. Folded it shows a blue dot when a row waits on you, an amber square when one
|
|
269
256
|
* of your own is late, and the count; open, the rows in a card. */
|
|
270
257
|
function looseHtml(g, o) {
|
|
@@ -346,8 +333,7 @@ export function listHtml(M, T, o) {
|
|
|
346
333
|
+ (o.phone ? '' : `<button type="button" class="ut-ib hv-ib${flt ? ' on' : ''}" data-hm-flt aria-haspopup="menu" aria-label="Show: Today, Mine, Kept or Done${flt ? '. Now ' + esc(flt.label) : ''}" title="Show: Today, Mine, Kept or Done">${svg(P.filter, 18)}</button>`)
|
|
347
334
|
+ SO.btnHtml('ut-ib hv-ib' + (SO.layout().sort !== 'mine' ? ' on' : ''))
|
|
348
335
|
+ `<button type="button" class="ut-ib hv-ib" data-hm-new aria-haspopup="menu" aria-label="New" title="New">${svg(P.plus, 20)}</button>`
|
|
349
|
-
|
|
350
|
-
+ (o.phone ? '' : `<button type="button" class="ut-ib hv-ib" data-hm-fold aria-label="Fold the list to the rail" title="Fold the list to the rail">${svg(P.fold, 18)}</button>`) + '</span></div>'
|
|
336
|
+
+ '</span></div>'
|
|
351
337
|
// Claude grilled something by itself this week and left findings (canvas FcPhone, Home): one quiet line with ✦, else nothing
|
|
352
338
|
+ (o.grill ? `<p class="hv-sub hv-gn"><span>${esc(o.grill.text)}</span><button type="button" class="ut-ib hv-ib" data-hm-gn="${esc(o.grill.id)}" aria-label="${esc('Open the ' + o.grill.n + (o.grill.n === 1 ? ' finding' : ' findings') + ' on ' + o.grill.title)}" title="Open the findings">${svg('M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', 18)}</button></p>` : '');
|
|
353
339
|
// the Today card only while the day has a moment; the plain day (its meetings and load) is in Your day
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<div class="ins-col" id="insCol">
|
|
60
60
|
<!-- What PMOS found: one finding at a time ("1 of 3", ‹ ›), and its drafted move as the expanded Suggestion with Change it first, Yes and No -->
|
|
61
61
|
<section class="pm-block ins-hero" id="insHero" aria-labelledby="hFound">
|
|
62
|
-
<div class="head"><span class="ins-ad" aria-hidden="true"><svg class="pm-ic pm-star" viewBox="0 0 24 24"><path d="M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z"/></svg></span><h2 class="pm-h-sm" id="hFound">What PMOS found</h2><span class="sp"></span><a class="pm-btn" id="askWhy" href="/
|
|
62
|
+
<div class="head"><span class="ins-ad" aria-hidden="true"><svg class="pm-ic pm-star" viewBox="0 0 24 24"><path d="M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z"/></svg></span><h2 class="pm-h-sm" id="hFound">What PMOS found</h2><span class="sp"></span><a class="pm-btn" id="askWhy" href="/today.html?ask=insights" aria-label="Ask why" title="Ask why"><svg class="pm-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16v11H9l-5 4z"/></svg></a><span class="ins-pg" id="insPg"></span></div>
|
|
63
63
|
<div class="ins-txt" id="insText" aria-live="polite"><p class="ins-say"><b id="insEye"></b> <span id="brief">Reading the records.</span> <span id="insWhy"></span></p><div class="pm-sug x ins-mv" id="insMv" role="group" aria-label="PMOS suggests" hidden></div></div>
|
|
64
64
|
<span class="ins-hact" id="insAct"></span>
|
|
65
65
|
</section>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
parts are the Viewer's own, shared with every page that opens it. -->
|
|
21
21
|
<body class="cz pm-ds vz-solo">
|
|
22
22
|
<main class="vz-host" data-cz-viewer-host></main>
|
|
23
|
-
<p class="pm-meta vz-gone" id="vzGone" hidden>Nothing is open. <a href="/
|
|
23
|
+
<p class="pm-meta vz-gone" id="vzGone" hidden>Nothing is open. <a href="/today.html">Go to Today</a></p>
|
|
24
24
|
<script type="module" src="/pm/premium-vw-page.js"></script>
|
|
25
25
|
</body>
|
|
26
26
|
</html>
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
</script>
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
|
-
<p>Workflows moved to <a href="/
|
|
15
|
+
<p>Workflows moved to <a href="/today.html?settings=workflows">Settings › Workspaces › Workflows</a>.</p>
|
|
16
16
|
</body>
|
|
17
17
|
</html>
|
|
@@ -193,7 +193,7 @@ const SPONSORS = '# Inline login slips to early December unless passkeys move to
|
|
|
193
193
|
const pg = await c.newPage(); const errs = [], gets = [];
|
|
194
194
|
pg.on('pageerror', (e) => errs.push(String((e && e.stack) || e)));
|
|
195
195
|
await pg.route('**/api/ready-reports/dashboard*', (r) => { const u = new URL(r.request().url()); gets.push({ scope: u.searchParams.get('scope'), from: u.searchParams.get('from') }); return r.fulfill({ contentType: 'application/json', body: JSON.stringify(RR.product()) }); });
|
|
196
|
-
await pg.goto(BASE + '/
|
|
196
|
+
await pg.goto(BASE + '/today.html?ini=product');
|
|
197
197
|
// batch 21 item 2: the product page is the same ONE page as a program's (prog-page.js): no toggle, Initiatives open first
|
|
198
198
|
const pd = await until(() => pg.evaluate(() => { const v = document.querySelector('#czViewer .pv'); if (!v) return null; return { goal: !!v.querySelector('.pv-gc'), tabs: [...v.querySelectorAll('[data-pv="tab"]')].map((t) => t.dataset.k + (t.getAttribute('aria-selected') === 'true' ? '*' : '')), over: v.scrollWidth > v.clientWidth + 1, toggle: !!document.querySelector('#czViewer [data-cz-vw-p="dash"]') }; }), 15000);
|
|
199
199
|
ok('P (' + nm + ') the product page is the one page: the goal card, Tasks, Initiatives (open first), Reports (batch 29 item 8 took Documents off); no toggle', !!pd && pd.goal && pd.tabs.join() === 'tasks,initiatives*,reports' && !pd.toggle && !pd.over, JSON.stringify(pd));
|
package/workspace/rename-test.js
CHANGED
|
@@ -116,9 +116,9 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
116
116
|
await p.click('#czViewer [data-cz-vw-rn]');
|
|
117
117
|
await p.fill('#czViewer .cz-vw-ren input', 'Descope parity');
|
|
118
118
|
await p.check('#czViewer .cz-vw-jt input');
|
|
119
|
-
await Promise.all([p.waitForURL(/\/
|
|
119
|
+
await Promise.all([p.waitForURL(/\/today\.html\?/, { timeout: 15000 }).catch(() => null), p.click('#czViewer .cz-vw-sv')]);
|
|
120
120
|
const u = new URL(p.url());
|
|
121
|
-
ok('I with the Jira box ticked,
|
|
121
|
+
ok('I with the Jira box ticked, Today opens the initiative\'s chat with the request typed, not sent', u.pathname === '/today.html' && u.searchParams.get('about') === 'init:descope-parity'
|
|
122
122
|
&& u.searchParams.get('say') === 'Rename the Jira epic IDPF-12 to "Descope parity".', u.href);
|
|
123
123
|
ok('I a row with no Jira epic has no Jira box', await (async () => {
|
|
124
124
|
const X = await open({ qs: '?ws=idpf&focus=usage-billing' });
|
package/workspace/server.js
CHANGED
|
@@ -7353,13 +7353,13 @@ async function handleRequest(req, res) {
|
|
|
7353
7353
|
const p = built ? built[2] : url.pathname;
|
|
7354
7354
|
|
|
7355
7355
|
// Today (public/today.html, slice 5 of the six-place navigation) is the page the app lands on: '/' and '/index.html' serve it. It is Home
|
|
7356
|
-
// with data-today: a desk draws Today's log and agenda, a phone keeps Home. Home (
|
|
7357
|
-
// classic shell (/classic.html) were removed (workspace-legacy-cleanup); their old links open
|
|
7358
|
-
// old first-run pages (/welcome, /premium-welcome.html) open
|
|
7356
|
+
// with data-today: a desk draws Today's log and agenda, a phone keeps Home's list for a conversation. Home's own page (premium.html) is gone; its addresses open Today. The console (/console.html, /c3.html) and the
|
|
7357
|
+
// classic shell (/classic.html) were removed (workspace-legacy-cleanup); their old links open Today with the same query. The
|
|
7358
|
+
// old first-run pages (/welcome, /premium-welcome.html) open Today's setup conversation (below).
|
|
7359
7359
|
// premium-agreed-design H3: Home replaced the Briefing, My work and Chat. My work and Chat open Home with their own query, so an
|
|
7360
7360
|
// ?item=, ?about=, ?open= or ?say= link still lands on what it named.
|
|
7361
7361
|
if (p === '/premium-work' || p === '/premium-work.html' || p === '/premium-chat' || p === '/premium-chat.html') {
|
|
7362
|
-
res.writeHead(302, { Location: '/
|
|
7362
|
+
res.writeHead(302, { Location: '/today.html' + url.search, 'Cache-Control': 'no-store' });
|
|
7363
7363
|
return res.end();
|
|
7364
7364
|
}
|
|
7365
7365
|
// premium-agreed-design (Home): the initiative is a layout inside Home. ?id=<x> becomes ?ini=<x>; the other query keys go along.
|
|
@@ -7367,20 +7367,19 @@ async function handleRequest(req, res) {
|
|
|
7367
7367
|
const q = new URLSearchParams(url.search);
|
|
7368
7368
|
if (q.has('id')) { q.set('ini', q.get('id')); q.delete('id'); }
|
|
7369
7369
|
const s = q.toString();
|
|
7370
|
-
res.writeHead(302, { Location: '/
|
|
7370
|
+
res.writeHead(302, { Location: '/today.html' + (s ? '?' + s : ''), 'Cache-Control': 'no-store' });
|
|
7371
7371
|
return res.end();
|
|
7372
7372
|
}
|
|
7373
|
-
// Today is the place of Home.
|
|
7374
|
-
//
|
|
7375
|
-
|
|
7376
|
-
if ((p === '/premium' || p === '/premium.html') && process.env.PMOS_DESK_HOME !== 'keep') {
|
|
7373
|
+
// Today is the place of Home. home-page-retire (Wawan 2026-11-22, "Remove Home on desktop and phone"): every Home address opens Today with the
|
|
7374
|
+
// same query, and premium.html is gone (slice 1b). On a desk Today opens what the query names in the one popup (pm/home-app.js addressChat).
|
|
7375
|
+
if (p === '/premium' || p === '/premium.html') {
|
|
7377
7376
|
res.writeHead(302, { Location: '/today.html' + url.search, 'Cache-Control': 'no-store' });
|
|
7378
7377
|
return res.end();
|
|
7379
7378
|
}
|
|
7380
7379
|
// One console address stays: the Chrome extension's popup frames /console.html?capture=1, which serves capture.html.
|
|
7381
7380
|
const capture = (p === '/console.html' || p === '/c3.html') && url.searchParams.get('capture') === '1';
|
|
7382
7381
|
if (!capture && (p === '/c3.html' || p === '/c3' || p === '/console' || p === '/console.html' || p === '/classic' || p === '/classic.html')) {
|
|
7383
|
-
res.writeHead(302, { Location: '/
|
|
7382
|
+
res.writeHead(302, { Location: '/today.html' + url.search, 'Cache-Control': 'no-store' });
|
|
7384
7383
|
return res.end();
|
|
7385
7384
|
}
|
|
7386
7385
|
// The audience tab (batch 12 item 1, S3): what the call sees while the PM presents from the recording tab. It makes no press.
|
|
@@ -7396,10 +7395,10 @@ async function handleRequest(req, res) {
|
|
|
7396
7395
|
// claude-onboarding-build: first run is a conversation in Home now. The old Welcome pages (/welcome and the three-step /premium-welcome.html)
|
|
7397
7396
|
// open Home's project setup; their old query (?ws=, ?step=) has nothing left to say there.
|
|
7398
7397
|
if (p === '/welcome' || p === '/welcome.html' || p === '/premium-welcome' || p === '/premium-welcome.html') {
|
|
7399
|
-
res.writeHead(302, { Location: '/
|
|
7398
|
+
res.writeHead(302, { Location: '/today.html?onboard=1', 'Cache-Control': 'no-store' });
|
|
7400
7399
|
return res.end();
|
|
7401
7400
|
}
|
|
7402
|
-
const PAGES = { '/premium-routine': 'premium-routine.html', '/premium-routine.html': 'premium-routine.html', '/': 'today.html', '/index.html': 'today.html', '/today': 'today.html', '/today.html': 'today.html', '/premium
|
|
7401
|
+
const PAGES = { '/premium-routine': 'premium-routine.html', '/premium-routine.html': 'premium-routine.html', '/': 'today.html', '/index.html': 'today.html', '/today': 'today.html', '/today.html': 'today.html', '/premium-board': 'premium-board.html', '/premium-board.html': 'premium-board.html', '/premium-intelligence': 'premium-intelligence.html', '/premium-intelligence.html': 'premium-intelligence.html', '/premium-events': 'premium-events.html', '/premium-events.html': 'premium-events.html', '/premium-library': 'premium-library.html', '/premium-library.html': 'premium-library.html', '/premium-goals': 'premium-goals.html', '/premium-goals.html': 'premium-goals.html', '/premium-insights': 'premium-intelligence.html', '/premium-insights.html': 'premium-intelligence.html', '/premium-viewer': 'premium-viewer.html', '/premium-viewer.html': 'premium-viewer.html', '/premium-rec': 'premium-rec.html', '/premium-rec.html': 'premium-rec.html', '/premium-workflows': 'premium-workflows.html', '/premium-workflows.html': 'premium-workflows.html', '/pm/present': 'premium-present.html', '/premium-buddy': 'premium-buddy.html', '/premium-buddy.html': 'premium-buddy.html' };
|
|
7403
7402
|
const page = capture ? 'capture.html' : Object.prototype.hasOwnProperty.call(PAGES, p) ? PAGES[p] : null;
|
|
7404
7403
|
if (page) {
|
|
7405
7404
|
// pm-os-absorb Run 2 (R25, X11): the per-launch nonce goes into the base meta line, nowhere else. no-store, so a
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* session-names-test.js — session names A (testing feedback 2026-10-25; canvas XmsNames). Serves
|
|
4
|
-
* /api/sessions answers one loose session
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* R4 Undo gives back Claude's name and unlocks its naming (release) · R5 the PM's name survives a later auto name
|
|
3
|
+
/* session-names-test.js — session names A (testing feedback 2026-10-25; canvas XmsNames). Serves Today from the real server;
|
|
4
|
+
* /api/sessions answers one loose session, and every write is captured, not written. The session opens from its address (?session=), and
|
|
5
|
+
* on a phone its top bar holds the name. On a desktop the popup's top bar replaced Home's chat header (home-desk-layout-delete):
|
|
6
|
+
* D1 the session opens in the popup with its name as the title · D2 ⋯ › Rename session makes the title one field with a check, holding
|
|
7
|
+
* the name, with the focus; Esc cancels and saves nothing · D3 Enter saves through POST /api/session/meta; the title shows the new name;
|
|
8
|
+
* "Renamed" with Undo
|
|
10
9
|
* P1 on a phone the top bar is back + the name only (no second line, no ⋯) · P2 the name is a 44 px press and the field fills the bar;
|
|
11
10
|
* Enter saves · E no page error */
|
|
12
11
|
const path = require('path');
|
|
@@ -67,70 +66,49 @@ const json = (r, body, status = 200) => r.fulfill({ status, contentType: 'applic
|
|
|
67
66
|
cur.s = { ...cur.s, name: b.name, name_by: 'pm' }; return json(r, { ok: true, id: b.id, name: b.name, name_by: 'pm' });
|
|
68
67
|
});
|
|
69
68
|
};
|
|
70
|
-
const rowText = (page) => page.evaluate(() => [...document.querySelectorAll('#hmList button')].map((b) => b.textContent.replace(/\s+/g, ' ').trim()).join(' | '));
|
|
71
69
|
const headOf = (page) => page.evaluate(() => { const h = document.querySelector('#hmCh'); if (!h || h.hidden) return null; const b = h.querySelector('[data-hm-rn]'), i = h.querySelector('.hm-ren input');
|
|
72
70
|
return { name: b ? b.textContent.trim() : '', field: i ? i.value : null, check: !!h.querySelector('.hm-ren .sv'), cursor: b ? getComputedStyle(b).cursor : '', pencil: !!h.querySelector('[aria-label*="pencil" i]') }; });
|
|
73
|
-
|
|
71
|
+
// Home's list is gone (home-desk-layout-delete): the session opens from its address, in the popup's chat on a desktop, as the page on a phone
|
|
72
|
+
const openRow = async (page) => { await page.goto(BASE + '/today.html?theme=light&session=s-ciam'); const ok2 = await until(() => page.evaluate(() => !!document.querySelector('#hmCh [data-hm-rn], #hmTop [data-hm-rn]')), 12000); await sleep(500); return !!ok2; };
|
|
74
73
|
|
|
75
|
-
/* ── desktop ── */
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
await
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
let
|
|
86
|
-
ok('
|
|
87
|
-
await
|
|
88
|
-
|
|
89
|
-
ok('
|
|
90
|
-
|
|
91
|
-
await
|
|
92
|
-
|
|
93
|
-
ok('
|
|
94
|
-
await
|
|
95
|
-
|
|
96
|
-
await
|
|
97
|
-
await page.keyboard.press('Enter');
|
|
98
|
-
h = await until(async () => { const x = await headOf(page); return x && x.name === 'My CIAM vendor list' ? x : null; });
|
|
99
|
-
ok('R3 Enter saves through POST /api/session/meta with the session id and the name', posts.length === 1 && posts[0].id === 's-ciam' && posts[0].name === 'My CIAM vendor list' && !posts[0].release, JSON.stringify(posts));
|
|
100
|
-
ok('R3 the header and the Home row show the new name at once', !!h && (await rowText(page)).includes('My CIAM vendor list'), await rowText(page));
|
|
101
|
-
const toast = await page.evaluate(() => { const t = document.querySelector('#toast'); return t && t.classList.contains('on') ? t.textContent.replace(/\s+/g, ' ').trim() : ''; });
|
|
102
|
-
ok('R3 the toast says Renamed with Undo', /^Renamed\s*Undo$/.test(toast), toast);
|
|
103
|
-
await page.click('#toast .undo');
|
|
104
|
-
h = await until(async () => { const x = await headOf(page); return x && x.name === AUTO ? x : null; });
|
|
105
|
-
ok('R4 Undo gives back PMOS\'s name and unlocks its naming (release)', !!h && posts.length === 2 && posts[1].release === true && cur.s.name_by === null, JSON.stringify(posts));
|
|
106
|
-
// the PM names it again; later the server reports a newer auto name, which must not show
|
|
107
|
-
await page.click('#hmCh [data-hm-rn]');
|
|
108
|
-
await until(async () => ((await headOf(page)) || {}).field != null);
|
|
109
|
-
await page.fill('#hmCh .hm-ren input', 'My CIAM vendor list'); await page.keyboard.press('Enter');
|
|
110
|
-
await until(async () => ((await headOf(page)) || {}).name === 'My CIAM vendor list');
|
|
111
|
-
cur.s = { ...cur.s, auto_name: 'Draft the CIAM RFP', hx: { title: CLI, turns: 14 } };
|
|
112
|
-
await sleep(9500); // one poll of /api/sessions
|
|
113
|
-
h = await headOf(page);
|
|
114
|
-
ok('R5 the PM\'s name survives a later auto name: the header and the row keep it', h && h.name === 'My CIAM vendor list' && !(await rowText(page)).includes('Draft the CIAM RFP'), JSON.stringify(h));
|
|
115
|
-
await ctx.close();
|
|
74
|
+
/* ── desktop: the popup ── */
|
|
75
|
+
const dcur = { s: { ...mk(), auto_name: AUTO } }, dposts = [];
|
|
76
|
+
const dctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
|
|
77
|
+
const dp = await dctx.newPage(); await setup(dp, dcur, dposts);
|
|
78
|
+
await dp.goto(BASE + '/today.html?theme=light&session=s-ciam');
|
|
79
|
+
const ttl = () => dp.evaluate(() => { const t = document.querySelector('.cz-pop-tw'); if (!t) return null; const b = t.querySelector('.cz-pop-t span'), i = t.querySelector('.hm-ren input');
|
|
80
|
+
return { name: b ? b.textContent.trim() : '', field: i ? i.value : null, check: !!t.querySelector('.hm-ren .sv'), focus: !!i && document.activeElement === i }; });
|
|
81
|
+
const d1 = await until(async () => { const x = await ttl(); return x && x.name === AUTO ? x : null; }, 15000);
|
|
82
|
+
ok('D1 on a desktop the session opens in the popup, its name the title', !!d1, JSON.stringify(await ttl()));
|
|
83
|
+
const rename = async () => { await dp.click('.cz-pop [data-pop="more"]'); await dp.click('.cz-pop-m [data-hm-rn]'); return until(async () => { const x = await ttl(); return x && x.field != null ? x : null; }); };
|
|
84
|
+
let d = await rename();
|
|
85
|
+
ok('D2 ⋯ › Rename session makes the title one field with a check, holding the name, with the focus', d && d.field === AUTO && d.check && d.focus, JSON.stringify(d));
|
|
86
|
+
await dp.keyboard.type('x'); await dp.keyboard.press('Escape');
|
|
87
|
+
d = await until(async () => { const x = await ttl(); return x && x.field == null ? x : null; });
|
|
88
|
+
ok('D2 Esc cancels: the name is back and nothing was saved', d && d.name === AUTO && dposts.length === 0, JSON.stringify({ d, dposts }));
|
|
89
|
+
await rename();
|
|
90
|
+
await dp.fill('.cz-pop-tw .hm-ren input', 'My CIAM vendor list'); await dp.keyboard.press('Enter');
|
|
91
|
+
d = await until(async () => { const x = await ttl(); return x && x.name === 'My CIAM vendor list' ? x : null; }, 8000);
|
|
92
|
+
ok('D3 Enter saves through POST /api/session/meta, and the title shows the new name', !!d && dposts.length === 1 && dposts[0].id === 's-ciam' && dposts[0].name === 'My CIAM vendor list', JSON.stringify({ d: await ttl(), dposts }));
|
|
93
|
+
const dt = await dp.evaluate(() => { const t = document.querySelector('#toast'); return t && t.classList.contains('on') ? t.textContent.replace(/\s+/g, ' ').trim() : ''; });
|
|
94
|
+
ok('D3 the toast says Renamed with Undo', /^Renamed\s*Undo$/.test(dt), dt);
|
|
95
|
+
await dctx.close();
|
|
116
96
|
|
|
117
97
|
/* ── phone ── */
|
|
118
98
|
const pcur = { s: { ...mk(), auto_name: AUTO } }, pposts = [];
|
|
119
99
|
const pctx = await browser.newContext({ viewport: { width: 390, height: 844 }, hasTouch: true });
|
|
120
100
|
const pp = await pctx.newPage(); await setup(pp, pcur, pposts);
|
|
121
|
-
await pp
|
|
122
|
-
const loose = await until(async () => pp.$('#hmList button:has-text("Not in an initiative")'), 10000); // the phone folds loose chats into one row
|
|
123
|
-
if (loose) { await loose.click(); await sleep(400); }
|
|
124
|
-
await openRow(pp, AUTO);
|
|
101
|
+
await openRow(pp);
|
|
125
102
|
const bar = await until(() => pp.evaluate(() => {
|
|
126
103
|
const top = document.querySelector('#hmTop'); if (!top || getComputedStyle(top).display === 'none') return null;
|
|
127
104
|
const vis = (el) => !!el && getComputedStyle(el).display !== 'none' && el.getBoundingClientRect().width > 0;
|
|
128
105
|
const b = top.querySelector('[data-hm-rn]'); const r = b ? b.getBoundingClientRect() : null;
|
|
129
106
|
return { name: b ? b.textContent.trim() : '', h: r ? r.height : 0, sub: (document.querySelector('#hmTopSub') || {}).textContent || '', subShown: vis(document.querySelector('#hmTopSub')),
|
|
130
|
-
more: vis(document.querySelector('#hmMoreP')), needs: vis(document.querySelector('#hmNeeds')), back: vis(document.querySelector('#hmBack')) };
|
|
107
|
+
ctx: vis(top.querySelector('.hm-ctx')), more: vis(document.querySelector('#hmMoreP')), needs: vis(document.querySelector('#hmNeeds')), back: vis(document.querySelector('#hmBack')) };
|
|
131
108
|
}));
|
|
132
109
|
ok('P1 the phone top bar is back + the session name only: no second line, no ⋯', bar && bar.name === AUTO && bar.back && !bar.sub && !bar.subShown && !bar.more && !bar.needs, JSON.stringify(bar));
|
|
133
|
-
|
|
110
|
+
// with its context pie beside it the name sits on the row's 22 px line (XctxA2Phones, cozy-home.css); without it, a 44 px press
|
|
111
|
+
ok('P2 the name is a 44 px press, or the row line beside its context pie', bar && (bar.h >= 44 || (bar.ctx && bar.h >= 22)), JSON.stringify(bar));
|
|
134
112
|
await pp.click('#hmTop [data-hm-rn]');
|
|
135
113
|
const pf = await until(() => pp.evaluate(() => { const f = document.querySelector('#hmTop .hm-ren'), i = f && f.querySelector('input'); if (!f) return null; const r = f.getBoundingClientRect(), t = document.querySelector('#hmTop').getBoundingClientRect(); return { v: i.value, w: r.width, tw: t.width, h: r.height }; }));
|
|
136
114
|
ok('P2 a tap makes the field fill the bar beside back', pf && pf.v === AUTO && pf.w > pf.tw * 0.7 && pf.h >= 44, JSON.stringify(pf));
|