create-pmos 0.426.0 → 0.428.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 +25 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-programs-test.js +16 -2
- package/workspace/briefing-premium-board-test.js +25 -20
- package/workspace/briefing-premium-test.js +2 -1
- package/workspace/changelog.json +24 -0
- package/workspace/guide/briefing-premium.md +4 -2
- package/workspace/guide/claude-proposes.md +3 -1
- package/workspace/guide/home.md +32 -7
- package/workspace/guide/programs.md +1 -0
- package/workspace/home-other-product-test.js +12 -2
- package/workspace/lib/context-use.js +54 -0
- package/workspace/lib/routes-live.js +3 -1
- package/workspace/lib/routes-meeting-material.js +22 -1
- package/workspace/lib/settings-store.js +14 -0
- package/workspace/lib/transcript-read.js +9 -2
- package/workspace/milestone-pins-test.js +13 -0
- package/workspace/milestone-suggest-test.js +10 -4
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +40 -13
- package/workspace/premium-rec-tab-test.js +8 -0
- package/workspace/premium-vw-item-test.js +7 -3
- package/workspace/premium-vw-jira-test.js +2 -1
- package/workspace/program-charter-test.js +1 -1
- package/workspace/program-leave-test.js +2 -2
- package/workspace/program-order-test.js +3 -2
- package/workspace/program-panel-test.js +2 -1
- package/workspace/public/pm/bd-acts.js +20 -26
- package/workspace/public/pm/bd-ini-panel.js +90 -32
- package/workspace/public/pm/bd-pin-card.js +4 -1
- package/workspace/public/pm/bd-span.js +22 -12
- package/workspace/public/pm/cozy-home.css +7 -0
- package/workspace/public/pm/cozy-live-pill.css +1 -0
- package/workspace/public/pm/cozy-live-pill.js +2 -1
- package/workspace/public/pm/cozy-rec-tab.js +12 -3
- package/workspace/public/pm/cozy-today.css +3 -0
- package/workspace/public/pm/cozy-viewer.js +157 -23
- package/workspace/public/pm/cozy-vw-shell.css +13 -0
- package/workspace/public/pm/cozy.css +6 -0
- package/workspace/public/pm/ctx-wedge.js +45 -0
- package/workspace/public/pm/hi-pop.css +82 -0
- package/workspace/public/pm/hi-pop.js +65 -0
- package/workspace/public/pm/home-app.js +70 -28
- package/workspace/public/pm/home-chat.js +7 -2
- package/workspace/public/pm/home-data.js +2 -1
- package/workspace/public/pm/home-ini.css +6 -76
- package/workspace/public/pm/home-ini.js +50 -68
- package/workspace/public/pm/home-list.js +29 -3
- package/workspace/public/pm/home-today.js +26 -9
- package/workspace/public/pm/ini-more.js +67 -0
- package/workspace/public/pm/ini-view-model.js +3 -2
- package/workspace/public/pm/ini-view.css +3 -1
- package/workspace/public/pm/ini-view.js +7 -5
- package/workspace/public/pm/live-model.js +1 -1
- package/workspace/public/pm/order-model.js +85 -0
- package/workspace/public/pm/premium-board.js +57 -11
- package/workspace/public/pm/premium-insights.js +11 -1
- package/workspace/public/pm/premium-vw-item.js +3 -1
- package/workspace/public/pm/premium-vw-jira.js +2 -0
- package/workspace/public/pm/prog-order.js +15 -2
- package/workspace/public/pm/sort-order.css +17 -0
- package/workspace/public/pm/sort-order.js +108 -0
- package/workspace/public/pm/tk-view.js +3 -2
- package/workspace/public/pm/wf-page.js +1 -1
- package/workspace/public/premium-board.html +1 -0
- package/workspace/server.js +28 -0
- package/workspace/sort-order-test.js +201 -0
- package/workspace/stage-card-test.js +1 -0
- package/workspace/task-card-test.js +1 -1
- package/workspace/test-lists/batch13-context-use.json +5 -0
- package/workspace/test-lists/sort-order.json +6 -0
- package/workspace/test-lists/viewer-trail.json +5 -0
- package/workspace/tk-tasks-test.js +5 -3
- package/workspace/viewer-trail-test.js +145 -0
|
@@ -9,7 +9,7 @@ import { vwOpen, vwStyle, vwClose } from './premium-viewer.js';
|
|
|
9
9
|
import { esc, iniId, taskId, stateOf, readingHtml, errorHtml, iniHtml, taskHtml, findTask, cardTask } from './premium-vw-item-model.js';
|
|
10
10
|
import { mountCard, boardSaver, checkOf, cardStyle, toastUndo, placeOf, deleteEntry, historyFor } from './task-card.js';
|
|
11
11
|
import { pmPost } from './http.js';
|
|
12
|
-
import { setCheck } from './cozy-viewer.js';
|
|
12
|
+
import { setCheck, retitle } from './cozy-viewer.js';
|
|
13
13
|
|
|
14
14
|
const TRIES = 20, WAIT = 1500, KEEP = 30000;
|
|
15
15
|
const cache = new Map(); // query → { at, p }: two tabs of one initiative read once
|
|
@@ -91,6 +91,8 @@ export function openWorkItem(o) {
|
|
|
91
91
|
openRef: (ref) => import('./premium-vw-jira.js').then((J) => J.openTicket({ ws, board, initiative: m.id, ref })) });
|
|
92
92
|
const R = await TV.readTicket({ ws, board, ini: m.id, iniTitle: m.title, ref: t.jira.key });
|
|
93
93
|
if (!host.isConnected) return;
|
|
94
|
+
// the header names the ticket by its key and Jira's title, not the key alone (batch 14 item 12: "MSD-4329" said nothing)
|
|
95
|
+
if (R.model && R.model.ok && R.model.title && R.model.title !== t.jira.key) { try { retitle('vw:' + vid, t.jira.key + ' ' + R.model.title); } catch { /* the old dialog has no header */ } }
|
|
94
96
|
Object.assign(v.ticket, TV.ticketOf({ base, model: R.model, notes: R.notes != null ? R.notes : t.notes, ini: m.id, iniTitle: m.title, readAt: t.jira.readAt || (R.model && R.model.readAt) }));
|
|
95
97
|
v.draw();
|
|
96
98
|
});
|
|
@@ -79,6 +79,8 @@ export async function openTicket(o) {
|
|
|
79
79
|
const rd = el.querySelector('[data-jread]'); if (rd) rd.onclick = async () => { rd.disabled = true; toast(await askHere(readAsk(ref)) ? 'Claude is reading ' + ref + ' in this popup\'s chat.' : 'Open the ticket from its popup to read it.'); };
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
+
// the header names the ticket by its key and its title, not the key alone (batch 14 item 12: "MSD-4329" alone said nothing)
|
|
83
|
+
if (R.model.title && R.model.title !== ref) { try { (await import('./cozy-viewer.js')).retitle('vw:jira:' + ref, (R.model.key || ref) + ' ' + R.model.title); } catch { /* the old dialog keeps its tab name */ } }
|
|
82
84
|
TV.mountTicket(el, TV.ticketOf({ base: { key: R.model.key || ref, epic: R.epicKey }, model: R.model, notes: R.notes, ini: R.ini, iniTitle: R.iniTitle }), { ws, board, post: (p, b) => import('./http.js').then((H) => H.pmPost(p, b)),
|
|
83
85
|
openRef: (k) => openTicket({ ws, board, initiative, ref: k }) });
|
|
84
86
|
};
|
|
@@ -11,10 +11,13 @@
|
|
|
11
11
|
* THE PAGE'S MARKUP: a container [data-po-list="<program id>"] holds the rows [data-po-id="<initiative id>"] of that program shown here (a product
|
|
12
12
|
* sub-list on a multi-product Board is its own container). The ✦ button is [data-po-sug="<program id>"].
|
|
13
13
|
* Desktop: drag by the grip. Phone: hold the row, then drag. Keyboard: Alt + ↑ or ↓ moves the focused row. Escape puts a lifted row back.
|
|
14
|
+
* A list [data-po-list="@…"] is one of Home's and the Board's own lists (the programs and products, or a product's initiatives): a move there
|
|
15
|
+
* goes to sort-order.js moveIn, with the same grip, hold and keys.
|
|
14
16
|
* Only the PM changes the order: every write is a page press. Claude suggests; ✓ applies it, Undo is in the toast, ✕ is "not now" until a
|
|
15
17
|
* date changes (remembered in this browser, pmos.order.notnow). */
|
|
16
18
|
import { pmPost } from './http.js';
|
|
17
19
|
import { fullOrder, moveTo, suggestOrder } from './program-model.js';
|
|
20
|
+
import { moveIn } from './sort-order.js'; // a list whose key starts with '@' is Home's and the Board's own order (batch 14 item 8), not a program's
|
|
18
21
|
|
|
19
22
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
20
23
|
const SV = (d, w = 2) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
@@ -39,6 +42,9 @@ export function sugHtml(p, st) {
|
|
|
39
42
|
|
|
40
43
|
let O = null;
|
|
41
44
|
const progOf = (id) => ((O && O.programs()) || []).find((p) => p && p.id === id) || null;
|
|
45
|
+
const own = (list) => String(list.dataset.poList || '').startsWith('@');
|
|
46
|
+
/** The program a list orders, or { own: true } for one of Home's and the Board's own lists. */
|
|
47
|
+
const ownerOf = (list) => (list ? (own(list) ? { own: true } : progOf(list.dataset.poList)) : null);
|
|
42
48
|
const idsIn = (list) => [...list.querySelectorAll('[data-po-id]')].filter((r) => r.closest('[data-po-list]') === list).map((r) => r.dataset.poId);
|
|
43
49
|
|
|
44
50
|
/** Saves the order; o.saved draws it. Returns the answer ({ ok, was, program } or { ok: false, error }). */
|
|
@@ -73,7 +79,7 @@ function mark(y) {
|
|
|
73
79
|
D.row.style.transform = `translateY(${Math.round(y - D.y0) - 6}px)`;
|
|
74
80
|
}
|
|
75
81
|
function start(row, y) {
|
|
76
|
-
const list = row.closest('[data-po-list]'), p =
|
|
82
|
+
const list = row.closest('[data-po-list]'), p = ownerOf(list);
|
|
77
83
|
if (!p) return false;
|
|
78
84
|
D = { row, list, p, id: row.dataset.poId, y0: y, before: undefined, slot: null };
|
|
79
85
|
row.classList.add('po-lift'); list.classList.add('po-on'); document.body.classList.add('po-dragging');
|
|
@@ -86,6 +92,7 @@ async function finish(cancel) {
|
|
|
86
92
|
d.row.classList.remove('po-lift'); d.row.style.transform = ''; d.list.classList.remove('po-on'); document.body.classList.remove('po-dragging');
|
|
87
93
|
if (d.slot) d.slot.remove();
|
|
88
94
|
if (cancel || d.before === undefined) return;
|
|
95
|
+
if (d.p.own) { const shown = idsIn(d.list), next = moveTo(shown, d.id, d.before === d.id ? null : d.before); if (!same(shown, next)) await moveIn(d.list, next); return; }
|
|
89
96
|
const { all, next } = moved(d.p, d.list, d.id, d.before);
|
|
90
97
|
if (same(all, next)) return;
|
|
91
98
|
await save(d.p, next);
|
|
@@ -167,11 +174,17 @@ export function mount(o) {
|
|
|
167
174
|
document.addEventListener('keydown', async (e) => {
|
|
168
175
|
if (e.key === 'Escape') { if (D) { e.stopPropagation(); finish(true); return; } if (POP) { e.stopPropagation(); closePop(true); return; } }
|
|
169
176
|
if (!e.altKey || (e.key !== 'ArrowUp' && e.key !== 'ArrowDown')) return;
|
|
170
|
-
const row = e.target.closest && e.target.closest('[data-po-id]'), list = row && row.closest('[data-po-list]'), p =
|
|
177
|
+
const row = e.target.closest && e.target.closest('[data-po-id]'), list = row && row.closest('[data-po-list]'), p = ownerOf(list);
|
|
171
178
|
if (!p) return;
|
|
172
179
|
e.preventDefault();
|
|
173
180
|
const shown = idsIn(list), k = shown.indexOf(row.dataset.poId), to = e.key === 'ArrowUp' ? k - 1 : k + 1;
|
|
174
181
|
if (k < 0 || to < 0 || to >= shown.length) return;
|
|
182
|
+
if (p.own) {
|
|
183
|
+
const id = row.dataset.poId, grip = !!e.target.closest('[data-po-grip]'), lk = list.dataset.poList;
|
|
184
|
+
const ok = await moveIn(list, moveTo(shown, id, e.key === 'ArrowUp' ? shown[to] : shown[to + 1] ?? null));
|
|
185
|
+
if (ok) { const n = document.querySelector(`[data-po-list="${CSS_ESC(lk)}"] [data-po-id="${CSS_ESC(id)}"]`); const f = n && (grip ? n.querySelector('[data-po-grip]') : n.querySelector('button:not([data-po-grip])')); if (f) f.focus(); }
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
175
188
|
const { all, next } = moved(p, list, row.dataset.poId, e.key === 'ArrowUp' ? shown[to] : shown[to + 1] ?? null);
|
|
176
189
|
if (same(all, next)) return;
|
|
177
190
|
const id = row.dataset.poId, grip = !!e.target.closest('[data-po-grip]');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* pm/sort-order.css — the sort menu and the header grips of Home and the Board (pm/sort-order.js; canvas SoAHomePhone, SoADesk). Loaded once
|
|
2
|
+
* by sort-order.js mount. Token variables only (cozy.css). The grip itself and the lifted row are prog-order.css. */
|
|
3
|
+
.so-menu { position: fixed; z-index: 80; background: var(--cz-card); color: var(--cz-ink); border-radius: 18px; box-shadow: 0 24px 60px -24px rgba(42,46,53,.45), 0 0 0 1px var(--cz-hair); padding: 8px; display: flex; flex-direction: column; gap: 2px; box-sizing: border-box; font-family: var(--cz-font, inherit); }
|
|
4
|
+
.so-mi { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--cz-ink); text-align: left; cursor: pointer; }
|
|
5
|
+
.so-mi span { flex: 1; }
|
|
6
|
+
.so-mi svg { width: 16px; height: 16px; color: var(--cz-blueink); }
|
|
7
|
+
.so-mi:hover, .so-mi.on { background: var(--cz-well); }
|
|
8
|
+
.so-mi:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: -2px; }
|
|
9
|
+
.so-hr { height: 1px; background: var(--cz-hair); margin: 4px 6px; }
|
|
10
|
+
/* a program's or product's header carries the grip in its left gutter (hover on a desktop; a phone holds the header, then drags) */
|
|
11
|
+
[data-po-list="@top"] > [data-po-id] { position: relative; }
|
|
12
|
+
.so-grip { left: 2px; top: 12px; margin-top: 0; }
|
|
13
|
+
.so-g { display: flex; flex-direction: column; position: relative; }
|
|
14
|
+
.so-g > .so-grip { left: 8px; top: 11px; }
|
|
15
|
+
[data-po-list="@top"] > [data-po-id]:hover > * > .so-grip, [data-po-list="@top"] > [data-po-id]:focus-within > * > .so-grip { opacity: 1; }
|
|
16
|
+
[data-po-list="@top"] > [data-po-id] .po-grip:not(.so-grip) { opacity: 0; }
|
|
17
|
+
[data-po-list="@top"] [data-po-id] [data-po-id]:hover .po-grip, [data-po-list="@top"] [data-po-id] [data-po-id]:focus-within .po-grip { opacity: 1; }
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/* pm/sort-order.js — the sort button, its menu and the hand-arranged order of Home and the Board (batch 14 item 8, option A; canvas
|
|
2
|
+
* SoAHomePhone, SoABoardPhone, SoADesk). ONE layout for both pages and the Timeline: the setting look.order (POST /api/settings), sorted by
|
|
3
|
+
* pm/order-model.js. The drag itself is pm/prog-order.js: a list whose key starts with '@' is one of these lists, not a program's.
|
|
4
|
+
*
|
|
5
|
+
* btnHtml(cls) the icon-only sort button [data-so-btn]; its name says the sort now
|
|
6
|
+
* gripHtml(name) the drag grip of a program's or a product's header (the same grip as a row's)
|
|
7
|
+
* layout() the layout now ({ sort, top, inis }); DEFAULT until load() answers
|
|
8
|
+
* load() reads the saved layout (GET /api/settings)
|
|
9
|
+
* mount(o) once per page. o: { redraw() draws the page again, say(msg, undo) the page's toast }
|
|
10
|
+
* moveIn(list, ids) prog-order.js calls it when a row of an '@' list moved: saves the new order, switches to My order, toast with Undo
|
|
11
|
+
*
|
|
12
|
+
* THE PAGE'S MARKUP: the programs and products sit in [data-po-list="@top"], each [data-po-id="<key>"] (order-model.js keys); the
|
|
13
|
+
* initiatives of a product sit in [data-po-list="@<product key>"], each [data-po-id="<initiative id>"]. Only the PM changes the order. */
|
|
14
|
+
import { pmGet, pmPost } from './http.js';
|
|
15
|
+
import { MODES, DEFAULT, labelOf, arranged } from './order-model.js';
|
|
16
|
+
|
|
17
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
18
|
+
const SV = (d, w = 1.8) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
19
|
+
const SORT = 'M7 4v16M4 17l3 3 3-3M13 6h8M13 12h6M13 18h4', OK = 'M5 12l5 5 9-10', GRIP = 'M9 6h.01M9 12h.01M9 18h.01M15 6h.01M15 12h.01M15 18h.01';
|
|
20
|
+
const CSS = new URL('./sort-order.css', import.meta.url).href;
|
|
21
|
+
|
|
22
|
+
let L = { ...DEFAULT }, O = null;
|
|
23
|
+
export const layout = () => L;
|
|
24
|
+
|
|
25
|
+
/** The button's name and tooltip now, for a page that draws the button in its HTML (the Board). */
|
|
26
|
+
export const labels = () => ({ aria: 'Sort. Now: ' + labelOf(L.sort), title: 'Sort · ' + labelOf(L.sort), on: L.sort !== 'mine' });
|
|
27
|
+
export const btnHtml = (cls = '') => `<button type="button" class="${esc(cls)}" data-so-btn aria-haspopup="menu" aria-label="Sort. Now: ${esc(labelOf(L.sort))}" title="Sort · ${esc(labelOf(L.sort))}">${SV(SORT)}</button>`;
|
|
28
|
+
export const gripHtml = (name) => `<button type="button" class="po-grip so-grip" data-po-grip aria-label="Move ${esc(name)}. Drag, or press Alt and an arrow key" title="Drag to move">${SV(GRIP, 2.6)}</button>`;
|
|
29
|
+
|
|
30
|
+
export async function load() {
|
|
31
|
+
const r = await pmGet('/api/settings').catch(() => null);
|
|
32
|
+
const s = r && r.ok && Array.isArray(r.settings) ? r.settings.find((x) => x.key === 'look.order') : null;
|
|
33
|
+
if (s && s.value) L = s.value;
|
|
34
|
+
return L;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Saves the layout; the page draws it. Returns true when it was saved. */
|
|
38
|
+
async function save(next) {
|
|
39
|
+
const r = await pmPost('/api/settings', { key: 'look.order', value: next }).catch(() => null);
|
|
40
|
+
if (!r || !r.ok) { if (O) O.say((r && r.error) || 'The order was not saved.'); return false; }
|
|
41
|
+
L = r.value || next;
|
|
42
|
+
if (O) O.redraw();
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** What every '@' list on screen shows now, so a drag out of another sort keeps what the PM sees (order-model.js arranged). */
|
|
47
|
+
function seen() {
|
|
48
|
+
const out = { top: [], inis: {} };
|
|
49
|
+
for (const list of document.querySelectorAll('[data-po-list^="@"]')) {
|
|
50
|
+
const k = list.dataset.poList.slice(1), ids = [...list.querySelectorAll('[data-po-id]')].filter((r) => r.closest('[data-po-list]') === list).map((r) => r.dataset.poId);
|
|
51
|
+
if (k === 'top') out.top = ids; else out.inis[k] = ids;
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function moveIn(list, ids) {
|
|
57
|
+
const was = L, k = list.dataset.poList.slice(1);
|
|
58
|
+
const ok = await save(arranged(L, k, ids, seen()));
|
|
59
|
+
if (ok && O) O.say(was.sort === 'mine' ? 'Moved · Home and the Board use this order' : 'Moved · now My order on Home and the Board', () => save(was));
|
|
60
|
+
return ok;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* ── the menu ── */
|
|
64
|
+
let MENU = null;
|
|
65
|
+
function closeMenu(focus) {
|
|
66
|
+
if (!MENU) return;
|
|
67
|
+
const b = MENU.btn; MENU.el.remove(); MENU = null;
|
|
68
|
+
b.setAttribute('aria-expanded', 'false');
|
|
69
|
+
if (focus && b.isConnected) b.focus();
|
|
70
|
+
}
|
|
71
|
+
function openMenu(btn) {
|
|
72
|
+
closeMenu();
|
|
73
|
+
const el = document.createElement('div');
|
|
74
|
+
el.className = 'so-menu'; el.setAttribute('role', 'menu'); el.setAttribute('aria-label', 'Sort');
|
|
75
|
+
el.innerHTML = MODES.map(([k, label], i) => `${i === 1 ? '<div class="so-hr" role="separator"></div>' : ''}<button type="button" role="menuitemradio" aria-checked="${L.sort === k}" class="so-mi${L.sort === k ? ' on' : ''}" data-so-mode="${k}"><span>${esc(label)}</span>${L.sort === k ? SV(OK, 2.2) : ''}</button>`).join('');
|
|
76
|
+
document.body.appendChild(el);
|
|
77
|
+
const b = btn.getBoundingClientRect(), w = Math.min(260, window.innerWidth - 24);
|
|
78
|
+
el.style.width = w + 'px';
|
|
79
|
+
el.style.left = Math.max(12, Math.min(window.innerWidth - w - 12, b.right - w)) + 'px';
|
|
80
|
+
el.style.top = Math.min(b.bottom + 6, Math.max(12, window.innerHeight - el.offsetHeight - 12)) + 'px';
|
|
81
|
+
btn.setAttribute('aria-expanded', 'true');
|
|
82
|
+
MENU = { el, btn };
|
|
83
|
+
(el.querySelector('.so-mi.on') || el.querySelector('.so-mi')).focus();
|
|
84
|
+
el.addEventListener('click', async (e) => {
|
|
85
|
+
const m = e.target.closest('[data-so-mode]'); if (!m) return;
|
|
86
|
+
const k = m.dataset.soMode; closeMenu(true);
|
|
87
|
+
if (k !== L.sort) await save({ ...L, sort: k });
|
|
88
|
+
});
|
|
89
|
+
el.addEventListener('keydown', (e) => {
|
|
90
|
+
if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp') return;
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
const items = [...el.querySelectorAll('.so-mi')], i = items.indexOf(document.activeElement);
|
|
93
|
+
items[(i + (e.key === 'ArrowDown' ? 1 : -1) + items.length) % items.length].focus();
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function mount(o) {
|
|
98
|
+
O = o;
|
|
99
|
+
if (!document.querySelector(`link[href="${CSS}"]`)) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; document.head.appendChild(l); }
|
|
100
|
+
if (mount.on) return;
|
|
101
|
+
mount.on = true;
|
|
102
|
+
document.addEventListener('click', (e) => {
|
|
103
|
+
const b = e.target.closest('[data-so-btn]');
|
|
104
|
+
if (b) { e.preventDefault(); e.stopPropagation(); if (MENU && MENU.btn === b) closeMenu(); else openMenu(b); return; }
|
|
105
|
+
if (MENU && !e.target.closest('.so-menu')) closeMenu();
|
|
106
|
+
});
|
|
107
|
+
document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && MENU) { e.stopPropagation(); closeMenu(true); } }, true);
|
|
108
|
+
}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* What blocks it leads: a summary card only when Jira flags it ("Blocked by PLAT-88", "Jira · 4 min ago", what that holds up). Then:
|
|
5
5
|
* facts card Status, Due, Assignee, Sprint, Points in plain text, and "Jira owns these. They change only in Jira." (with how fresh the
|
|
6
6
|
* read is when no summary card says it). A fact no reading holds is left out (zero is silence).
|
|
7
|
-
* Description the ticket's text as
|
|
7
|
+
* Description the ticket's text as PMOS keeps it ("PMOS's copy, Jira may differ": PMOS never reads Jira's description; batch 14
|
|
8
|
+
* item 12, an agent-filled ticket file said "from Jira"), shown open, cut at five lines with an icon that opens the rest.
|
|
8
9
|
* Your notes the PM's own words (POST /api/boards/tickets/note), edited in place; Jira never sees them.
|
|
9
10
|
* where it sits the same row as the task: initiative › stage › epic. It opens the initiative; Jira keeps the epic, so there is no move.
|
|
10
11
|
* folds Acceptance criteria, Subtasks, Linked: each only when the record holds something for it.
|
|
@@ -95,7 +96,7 @@ export function tkHtml(t, o = {}) {
|
|
|
95
96
|
const foot = 'Jira owns these. They change only in Jira.' + (!S && fr ? ' ' + fr.charAt(0).toUpperCase() + fr.slice(1) + '.' : '');
|
|
96
97
|
const card = `<div class="ovf tkv-f">${facts}<p class="foot">${foot}</p></div>`;
|
|
97
98
|
const long = t.description.length > DESC_CUT || t.description.split('\n').filter((x) => x.trim()).length > 5;
|
|
98
|
-
const desc = t.description ? `<div class="ovb"><p class="ovl">Description <small>· ${t.inJira ? '
|
|
99
|
+
const desc = t.description ? `<div class="ovb"><p class="ovl">Description <small>· ${t.inJira ? 'PMOS\'s copy, Jira may differ' : 'draft, not in Jira yet'}</small></p><div class="ovd${long && !o.more ? ' cut' : ''}"><div class="ovdx">${textHtml(t.description)}</div>`
|
|
99
100
|
+ (long ? `<div class="ovdm"><button type="button" class="ovib" data-tkv="more" aria-expanded="${o.more ? 'true' : 'false'}" aria-label="${o.more ? 'Show less' : 'Show all of it'}" title="${o.more ? 'Show less' : 'Show all of it'}">${ico(o.more ? I.up : I.down, 16)}</button></div>` : '') + '</div></div>' : '';
|
|
100
101
|
const notes = `<div class="ovb"><label class="ovl" for="tkvNotes">Your notes</label><textarea class="nt" id="tkvNotes" data-tkv-notes rows="2" maxlength="4000" placeholder="Add notes. Only you see them.">${esc(o.notes != null ? o.notes : t.notes)}</textarea></div>`;
|
|
101
102
|
const path = [t.stage, t.epic ? (t.epic.title ? 'Epic ' + t.epic.title : t.epic.key) : ''].filter(Boolean).map(esc);
|
|
@@ -336,7 +336,7 @@ function select(id) {
|
|
|
336
336
|
S.sel = id; S.renaming = false; S.msg = ''; S.phoneOpen = true;
|
|
337
337
|
if (S.edit && id !== S.edit.id) S.edit = null;
|
|
338
338
|
VW.close();
|
|
339
|
-
const u = new URL(location.href); if (id && id !== 'new') u.searchParams.set('wf', id); else u.searchParams.delete('wf');
|
|
339
|
+
const u = new URL(location.href); if (id && id !== 'new') u.searchParams.set('wf', id); else u.searchParams.delete('wf'); VW.replaceUrl(u.pathname + u.search);
|
|
340
340
|
draw();
|
|
341
341
|
}
|
|
342
342
|
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
<span class="bd-vr bd-hide-s"></span>
|
|
41
41
|
<button type="button" class="bd-ib" id="bdFind" aria-label="Find an initiative or work-item" title="Find an initiative or work-item" aria-haspopup="dialog"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M11 4a7 7 0 1 0 0 14a7 7 0 1 0 0-14M20 20l-4-4"/></svg></button>
|
|
42
42
|
<button type="button" class="bd-ib bd-show-s" id="bdView" aria-label="Change view" title="Change view"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 5h18v4H3zM3 11h18v4H3zM3 17h12v3H3z"/></svg></button>
|
|
43
|
+
<button type="button" class="bd-ib" id="bdSort" data-so-btn aria-haspopup="menu" aria-label="Sort. Now: My order" title="Sort · My order"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 4v16M4 17l3 3 3-3M13 6h8M13 12h6M13 18h4"/></svg></button>
|
|
43
44
|
<button type="button" class="bd-ib" id="bdFilter" aria-label="Filter by owner, kind or sprint" title="Filter by owner, kind or sprint" aria-haspopup="dialog"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16l-6 8v6l-4-2v-4z"/></svg></button>
|
|
44
45
|
<button type="button" class="bd-ib bd-hide-s" id="bdBell" aria-label="Notifications" title="Notifications" aria-haspopup="dialog"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 16v-5a6 6 0 0 1 12 0v5l2 2H4zM10 21h4"/></svg></button>
|
|
45
46
|
<button type="button" class="bd-ib solid" id="newIni" aria-label="New program or initiative" title="New program or initiative" aria-haspopup="menu"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button>
|
package/workspace/server.js
CHANGED
|
@@ -126,6 +126,7 @@ const consoleState = require('./lib/console-state'); // read-only console surf
|
|
|
126
126
|
const boardCache = require('./lib/board-cache'); // the workflow board, cached + derived off the event loop (R4)
|
|
127
127
|
const fmParse = require('./lib/file-mode-parse'); // canonical file-mode parsers, shared with metrics.py (D64 D)
|
|
128
128
|
const skillsReg = require('./lib/skills-registry'); // discovered and generated skills: quarantine, provenance, local approval (D76)
|
|
129
|
+
const contextUse = require('./lib/context-use'); // how full a session's context is, and Claude's ✦ Compact proposal (batch 13 item 8)
|
|
129
130
|
const modelLib = require('./lib/models'); // tier routing — one code path, shared with the agents' CLI (D75)
|
|
130
131
|
const memoryLib = require('./lib/memory'); // curated repository memory — one ledger code path, shared with the agents' CLI (D72)
|
|
131
132
|
const audit = require('./lib/audit'); // the workflow audit — the sweep the agents' CLI runs, read-only here (D77)
|
|
@@ -3453,6 +3454,14 @@ function sessionProgress(s, shown) {
|
|
|
3453
3454
|
return steps && steps.length ? { done: steps.filter((x) => x.state === 'done').length, n: steps.length } : null;
|
|
3454
3455
|
} catch { return null; }
|
|
3455
3456
|
}
|
|
3457
|
+
/** How full the session's context is (lib/context-use.js). The window comes from the model PMOS started or switched it to, else the CLI's
|
|
3458
|
+
* own setting. advise: 'compact' when Claude proposes it (70%+, the PM's turn), else null. */
|
|
3459
|
+
function sessionCtx(s, hx, shown) {
|
|
3460
|
+
if (!hx || !hx.context || s.state === 'exited') return null;
|
|
3461
|
+
const m = s.model || {};
|
|
3462
|
+
const c = contextUse.of(hx.context, [m.switched && m.switched.model, m.model].concat(contextUse.cliHints(s.root)));
|
|
3463
|
+
return c ? { ...c, advise: contextUse.advise(c, shown) } : null;
|
|
3464
|
+
}
|
|
3456
3465
|
function sessionList() {
|
|
3457
3466
|
const now = Date.now();
|
|
3458
3467
|
// ONE profiles read per broadcast, not one per session: the line is a formatter over the
|
|
@@ -3496,6 +3505,8 @@ function sessionList() {
|
|
|
3496
3505
|
shown: sessionState.presented(d.state, hx && hx.turn), quietMs: d.quietMs,
|
|
3497
3506
|
// the chat progress line's Home ring (XcbOptions B, case 8): { done, n } of the goal's points or the session's own steps, else null
|
|
3498
3507
|
progress: sessionProgress(s, sessionState.presented(d.state, hx && hx.turn)),
|
|
3508
|
+
// context use (batch 13 item 8, XctxA1Desk): { used, window, pct, level, at, advise } of the newest turn, else null
|
|
3509
|
+
ctx: sessionCtx(s, hx, sessionState.presented(d.state, hx && hx.turn)),
|
|
3499
3510
|
// The rendered word for that state — computed HERE rather than in each client, because it is
|
|
3500
3511
|
// the same join (`sessionState.label`) with the same clock, and a client re-deriving it was
|
|
3501
3512
|
// already producing a second, slightly different sentence for one session.
|
|
@@ -7706,6 +7717,23 @@ async function handleRequest(req, res) {
|
|
|
7706
7717
|
if (!mc.core.attachOutcome(w.root, body.id, { outcome: body.outcome, applied_tier: body.tier })) return json(res, { ok: false, error: 'an id from a routed prompt and an outcome of ' + mc.core.OUTCOMES.join(', ') + ' are needed (and the decisions ledger opted in)' }, 400);
|
|
7707
7718
|
return json(res, { ok: true });
|
|
7708
7719
|
}
|
|
7720
|
+
if (p === '/api/session/compact' && req.method === 'POST') {
|
|
7721
|
+
// batch 13 item 8 — the PM's ✓ on Claude's ✦ Compact proposal: type the harness's own `/compact` into the pane. On the PM's press only,
|
|
7722
|
+
// only for a running Claude session, and only on the PM's turn: a compact typed while it works would land in the middle of a turn.
|
|
7723
|
+
let body = {}; try { body = JSON.parse((await readBody(req)) || '{}'); } catch { return json(res, { ok: false, error: 'invalid JSON body' }, 400); }
|
|
7724
|
+
const s = sessions.get(String(body.id || ''));
|
|
7725
|
+
if (!s) return json(res, { ok: false, error: 'no such session' }, 404);
|
|
7726
|
+
if (!s.pty || s.state === 'exited') return json(res, { ok: false, error: 'that session is not running — there is nothing to compact' }, 400);
|
|
7727
|
+
if (s.agent !== 'claude') return json(res, { ok: false, error: `'${s.agent}' has no compact command PMOS has checked — nothing was typed` }, 400);
|
|
7728
|
+
const hx = transcriptHarness(s);
|
|
7729
|
+
const shown = sessionState.presented(harness.deriveState(s.state, s.lastOutputAt, Date.now()).state, hx && hx.turn);
|
|
7730
|
+
if (shown !== 'needs' && shown !== 'quiet') return json(res, { ok: false, error: 'it is working — compact it when its turn ends' }, 409);
|
|
7731
|
+
try { s.pty.write('/compact\r'); }
|
|
7732
|
+
catch (e) { return json(res, { ok: false, error: 'could not write to the session — ' + String((e && e.message) || e).slice(0, 100) }, 500); }
|
|
7733
|
+
touchSession(s);
|
|
7734
|
+
pushSessions();
|
|
7735
|
+
return json(res, { ok: true, note: 'typed /compact into the pane' });
|
|
7736
|
+
}
|
|
7709
7737
|
if (p === '/api/session/model' && req.method === 'POST') {
|
|
7710
7738
|
// D75 — switch the model of a RUNNING Claude session, on the PM's press only. It types the harness's own
|
|
7711
7739
|
// `/model <model>` command into the pane; effort is not changed by it. Never automatic, never for a binary
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* sort-order-test.js — sort or arrange Home and the Board by hand, ONE order for both (batch 14 item 8, option A; canvas SoAHomePhone,
|
|
4
|
+
* SoABoardPhone, SoADesk). Serves the real pages from the real server; GET /api/programs answers Project Ascent (fixtures/program-ascent.js)
|
|
5
|
+
* and /api/settings is answered here from one layout, so Home reads what the Board saved. order-model.test.js covers the sorting itself.
|
|
6
|
+
* B Board: the sort button in the header; the programs and products follow the layout; dragging a product's header saves My order and
|
|
7
|
+
* the toast has Undo; the menu's Name A to Z sorts and the button says so; a move out of another sort keeps the order on screen
|
|
8
|
+
* H Home: the same order as the Board; the sort button in its header; a product's initiatives are one list the grip arranges
|
|
9
|
+
* P phone: the button fits the header, no sideways scroll, no grip shows, and a held product header drags */
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const { spawn } = require('child_process');
|
|
12
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
13
|
+
const T = require('./test-run').configure({ name: 'sort-order' });
|
|
14
|
+
const BP = require('./lib/board-premium.js');
|
|
15
|
+
const F = require('./fixtures/board-premium-facts.js');
|
|
16
|
+
const B = require('./lib/briefing-premium.js');
|
|
17
|
+
const HF = require('./fixtures/briefing-premium-facts.js');
|
|
18
|
+
const A = require('./fixtures/program-ascent.js');
|
|
19
|
+
|
|
20
|
+
const BASE = T.BASE;
|
|
21
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
22
|
+
const until = async (fn, ms = 8000, step = 100) => { 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); } };
|
|
23
|
+
const results = [];
|
|
24
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
25
|
+
let srv = null; let browser = null;
|
|
26
|
+
const finish = async (code) => {
|
|
27
|
+
if (browser) await browser.close().catch(() => {});
|
|
28
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
29
|
+
T.killTmux();
|
|
30
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
31
|
+
console.log(`\n${results.length - bad}/${results.length} sort-order assertions passed`);
|
|
32
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
33
|
+
};
|
|
34
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
35
|
+
|
|
36
|
+
/** The one layout both pages read and write (the setting look.order). */
|
|
37
|
+
let LAY = { sort: 'mine', top: [], inis: {} };
|
|
38
|
+
const posts = [];
|
|
39
|
+
const route = async (page) => {
|
|
40
|
+
await page.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: A.programs() }) }));
|
|
41
|
+
await page.route(/\/api\/settings(\?.*)?$/, (r) => {
|
|
42
|
+
if (r.request().method() === 'POST') {
|
|
43
|
+
const b = JSON.parse(r.request().postData() || '{}');
|
|
44
|
+
if (b.key !== 'look.order') return r.continue();
|
|
45
|
+
posts.push(b.value); LAY = b.value;
|
|
46
|
+
return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, key: b.key, value: LAY }) });
|
|
47
|
+
}
|
|
48
|
+
r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, settings: [{ key: 'look.order', value: LAY }], overrides: [], categories: [] }) });
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
(async () => {
|
|
53
|
+
const exe = findBrowser();
|
|
54
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
55
|
+
let chromium;
|
|
56
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
57
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
58
|
+
await T.waitForServer(BASE);
|
|
59
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
60
|
+
|
|
61
|
+
const board = async (o = {}) => {
|
|
62
|
+
const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 }, hasTouch: !!o.touch, isMobile: !!o.touch });
|
|
63
|
+
const page = await ctx.newPage();
|
|
64
|
+
const errors = [];
|
|
65
|
+
page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
|
|
66
|
+
await page.clock.setFixedTime(new Date(F.NOW));
|
|
67
|
+
await page.route('**/api/board-premium*', (r) => { const q = new URL(r.request().url()).searchParams; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(F.programFacts(q.get('ws') || 'idpf')), as_of: Date.now() }) }); });
|
|
68
|
+
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
|
|
69
|
+
await route(page);
|
|
70
|
+
await page.addInitScript(() => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); localStorage.setItem('pmos.board.view', 'track'); localStorage.setItem('pmos.board.pview', 'track'); localStorage.setItem('pmos.board.grouping', 'program'); } } catch { /* none */ } });
|
|
71
|
+
await page.goto(BASE + '/premium-board.html?ws=idpf&board=idpf');
|
|
72
|
+
await page.waitForSelector('#ibBody [data-po-list="@top"] [data-po-id]', { timeout: 15000 });
|
|
73
|
+
await page.waitForTimeout(500);
|
|
74
|
+
return { ctx, page, errors };
|
|
75
|
+
};
|
|
76
|
+
const top = (p, sel) => p.evaluate((s) => [...document.querySelectorAll(s + ' [data-po-list="@top"] > [data-po-id]')].map((r) => r.dataset.poId), sel);
|
|
77
|
+
const toastOf = (p) => p.evaluate(() => { const t = document.querySelector('#bdToast'); return t && !t.hidden ? t.textContent : ''; });
|
|
78
|
+
|
|
79
|
+
/* B — the Board */
|
|
80
|
+
let boardTop = [];
|
|
81
|
+
{
|
|
82
|
+
LAY = { sort: 'mine', top: [], inis: {} };
|
|
83
|
+
const { ctx, page: p, errors } = await board();
|
|
84
|
+
const btn = await p.evaluate(() => { const b = document.querySelector('#bdSort'); return b ? { label: b.getAttribute('aria-label'), text: b.textContent.trim() } : null; });
|
|
85
|
+
ok('B the sort button sits in the header, icon only, and says the sort now', !!btn && btn.label === 'Sort. Now: My order' && btn.text === '', JSON.stringify(btn));
|
|
86
|
+
const k0 = await top(p, '#ibBody');
|
|
87
|
+
ok('B nothing arranged yet: the program first, then the product', k0[0] === 'g:project-ascent' && k0.length >= 2 && k0.slice(1).every((k) => k.startsWith('p:')), JSON.stringify(k0));
|
|
88
|
+
const pk = k0[k0.length - 1];
|
|
89
|
+
if (process.env.SHOTS) { await p.hover(`#ibBody [data-po-list="@top"] > [data-po-id="${pk}"] .bd-prdb`); await p.screenshot({ path: process.env.SHOTS + '/board-grip.png' }); }
|
|
90
|
+
// drag the product's header above the program
|
|
91
|
+
await p.hover(`#ibBody [data-po-list="@top"] > [data-po-id="${pk}"] .bd-prdb`);
|
|
92
|
+
const g = await p.locator(`#ibBody [data-po-list="@top"] > [data-po-id="${pk}"] > .so-grip`).boundingBox();
|
|
93
|
+
const t0 = await p.locator('#ibBody [data-po-list="@top"] > [data-po-id="g:project-ascent"]').boundingBox();
|
|
94
|
+
ok('B a product header has its own grip, shown on hover', !!g && g.width > 0, JSON.stringify(g));
|
|
95
|
+
if (g) {
|
|
96
|
+
await p.mouse.move(g.x + g.width / 2, g.y + g.height / 2); await p.mouse.down();
|
|
97
|
+
await p.mouse.move(g.x + g.width / 2, t0.y + 6, { steps: 8 }); await p.mouse.up();
|
|
98
|
+
}
|
|
99
|
+
await until(async () => (await top(p, '#ibBody'))[0] === pk);
|
|
100
|
+
const k1 = await top(p, '#ibBody');
|
|
101
|
+
ok('B the drop saves My order with the product first, and the list follows it', posts.length === 1 && posts[0].sort === 'mine' && posts[0].top[0] === pk && k1[0] === pk, JSON.stringify({ posts, k1 }));
|
|
102
|
+
const tt = await until(() => toastOf(p));
|
|
103
|
+
ok('B the toast says Home and the Board use this order, with Undo', /Home and the Board use this order/.test(tt) && !!(await p.$('#bdToast .bd-undo')), tt);
|
|
104
|
+
await p.click('#bdToast .bd-undo');
|
|
105
|
+
await until(async () => (await top(p, '#ibBody'))[0] === 'g:project-ascent');
|
|
106
|
+
ok('B Undo saves the layout before back', posts.length === 2 && posts[1].top.length === 0 && (await top(p, '#ibBody'))[0] === 'g:project-ascent', JSON.stringify(posts));
|
|
107
|
+
// the menu
|
|
108
|
+
await p.click('#bdSort');
|
|
109
|
+
const menu = await until(() => p.evaluate(() => { const m = document.querySelector('.so-menu'); return m ? [...m.querySelectorAll('.so-mi')].map((b) => b.textContent.trim() + (b.getAttribute('aria-checked') === 'true' ? '*' : '')) : null; }));
|
|
110
|
+
ok('B the menu: My order (ticked), Your turn first, Next date first, By stage, Name A to Z', !!menu && menu.join('|') === 'My order*|Your turn first|Next date first|By stage|Name, A to Z', JSON.stringify(menu));
|
|
111
|
+
if (process.env.SHOTS) await p.screenshot({ path: process.env.SHOTS + '/board-menu.png' });
|
|
112
|
+
await p.click('.so-menu [data-so-mode="name"]');
|
|
113
|
+
await until(() => posts.length === 3);
|
|
114
|
+
const label = await until(() => p.evaluate(() => { const l = document.querySelector('#bdSort').getAttribute('aria-label'); return /Name/.test(l) ? l : null; }));
|
|
115
|
+
const kn = await top(p, '#ibBody');
|
|
116
|
+
const names = await p.evaluate(() => [...document.querySelectorAll('#ibBody [data-po-list="@top"] > [data-po-id]')].map((r) => (r.querySelector('.bd-prdb span, .bt-pg b, b') || r).textContent.trim().toLowerCase()));
|
|
117
|
+
ok('B Name, A to Z: one save, the button says it, and the groups go A to Z', posts[2].sort === 'name' && !!label && names.join('|') === names.slice().sort((a, b) => a.localeCompare(b)).join('|'), JSON.stringify({ label, kn, names }));
|
|
118
|
+
// a move out of another sort keeps what is on screen and goes back to My order
|
|
119
|
+
const rows = await p.evaluate(() => { const l = [...document.querySelectorAll('#ibBody [data-po-list^="@p:"]')][0]; return l ? { key: l.dataset.poList.slice(1), ids: [...l.querySelectorAll(':scope > [data-po-id]')].map((r) => r.dataset.poId) } : null; });
|
|
120
|
+
if (rows && rows.ids.length > 1) {
|
|
121
|
+
await p.focus(`#ibBody [data-po-list="@${rows.key}"] > [data-po-id="${rows.ids[1]}"] [data-po-grip]`);
|
|
122
|
+
await p.keyboard.press('Alt+ArrowUp');
|
|
123
|
+
await until(() => posts.length === 4);
|
|
124
|
+
const last = posts[3] || {};
|
|
125
|
+
ok('B Alt + ↑ on a product\'s initiative: My order, that list in its new order, and the top kept as it was on screen', last.sort === 'mine' && (last.inis[rows.key] || []).slice(0, 2).join() === [rows.ids[1], rows.ids[0]].join() && last.top.join() === kn.join(), JSON.stringify({ last, rows, kn }));
|
|
126
|
+
const foc = await until(() => p.evaluate(() => { const r = document.activeElement && document.activeElement.closest('[data-po-id]'); return r && r.dataset.poId; }));
|
|
127
|
+
ok('B the focus stays on the row that moved', foc === rows.ids[1], String(foc));
|
|
128
|
+
} else ok('B the fixture has a product with two initiatives', false, JSON.stringify(rows));
|
|
129
|
+
boardTop = await top(p, '#ibBody');
|
|
130
|
+
ok('B no page error', !errors.length, errors.join(' | '));
|
|
131
|
+
await ctx.close();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* H — Home reads the same layout */
|
|
135
|
+
const home = async (o = {}) => {
|
|
136
|
+
const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 }, hasTouch: !!o.touch, isMobile: !!o.touch });
|
|
137
|
+
const page = await ctx.newPage();
|
|
138
|
+
const errors = [];
|
|
139
|
+
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
140
|
+
const json = (body) => (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(body) });
|
|
141
|
+
await page.route(/\/api\/briefing-premium(\?.*)?$/, json({ ok: true, state: 'ready', model: B.build(HF.facts()), as_of: Date.now() }));
|
|
142
|
+
await page.route('**/api/briefing-premium/thread**', json({ ok: true, turns: [], working: false }));
|
|
143
|
+
await page.route('**/api/board-premium*', (r) => { const q = new URL(r.request().url()).searchParams; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(F.programFacts(q.get('ws') || 'idpf')), as_of: Date.now() }) }); });
|
|
144
|
+
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
|
|
145
|
+
await route(page);
|
|
146
|
+
const am = new Date(); am.setHours(10, 0, 0, 0); await page.clock.setFixedTime(am);
|
|
147
|
+
await page.goto(BASE + '/premium.html?theme=light');
|
|
148
|
+
await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-po-list="@top"] > [data-po-id]')), 20000);
|
|
149
|
+
await page.waitForTimeout(300);
|
|
150
|
+
return { ctx, page, errors };
|
|
151
|
+
};
|
|
152
|
+
{
|
|
153
|
+
const { ctx, page: p, errors } = await home();
|
|
154
|
+
const hk = await top(p, '#hmList');
|
|
155
|
+
const shared = boardTop.filter((k) => hk.includes(k));
|
|
156
|
+
ok('H Home lists the programs and products in the Board\'s order', shared.length >= 2 && hk.filter((k) => boardTop.includes(k)).join() === shared.join(), JSON.stringify({ hk, boardTop }));
|
|
157
|
+
const btn = await p.evaluate(() => { const b = document.querySelector('#hmList .hm-hd [data-so-btn]'); return b ? b.getAttribute('aria-label') : null; });
|
|
158
|
+
ok('H the same sort button sits in Home\'s header and says the sort now', btn === 'Sort. Now: My order', String(btn));
|
|
159
|
+
const own = await p.evaluate(() => [...document.querySelectorAll('#hmList [data-po-list^="@p:"]')].length);
|
|
160
|
+
ok('H a product\'s initiatives are one list the grip arranges', own >= 1, String(own));
|
|
161
|
+
if (process.env.SHOTS) { await p.hover('#hmList [data-po-list="@top"] > [data-po-id]:last-child .hv-gh'); await p.screenshot({ path: process.env.SHOTS + '/home-desk.png' }); }
|
|
162
|
+
// drag the last group to the top on Home: the Board would read it the same way
|
|
163
|
+
const last = hk[hk.length - 1];
|
|
164
|
+
await p.hover(`#hmList [data-po-list="@top"] > [data-po-id="${last}"] .hv-gh`);
|
|
165
|
+
const g = await p.locator(`#hmList [data-po-list="@top"] > [data-po-id="${last}"] > .so-grip`).boundingBox();
|
|
166
|
+
const t0 = await p.locator(`#hmList [data-po-list="@top"] > [data-po-id="${hk[0]}"]`).boundingBox();
|
|
167
|
+
const n0 = posts.length;
|
|
168
|
+
if (g) { await p.mouse.move(g.x + g.width / 2, g.y + g.height / 2); await p.mouse.down(); await p.mouse.move(g.x + g.width / 2, t0.y + 6, { steps: 8 }); await p.mouse.up(); }
|
|
169
|
+
await until(async () => (await top(p, '#hmList'))[0] === last);
|
|
170
|
+
ok('H the header grip moves a group on Home: one save, first in the shared order', !!g && posts.length === n0 + 1 && LAY.top[0] === last && (await top(p, '#hmList'))[0] === last, JSON.stringify({ g, top: LAY.top }));
|
|
171
|
+
ok('H no page error', !errors.length, errors.join(' | '));
|
|
172
|
+
await ctx.close();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* P — a phone */
|
|
176
|
+
{
|
|
177
|
+
const { ctx, page: p, errors } = await home({ w: 390, h: 844, touch: true });
|
|
178
|
+
const fit = await p.evaluate(() => { const b = document.querySelector('#hmList .hm-hd [data-so-btn]'); const r = b && b.getBoundingClientRect(); return r ? r.right <= window.innerWidth && r.width >= 32 : false; });
|
|
179
|
+
ok('P phone: the sort button fits Home\'s header', fit);
|
|
180
|
+
const grips = await p.evaluate(() => [...document.querySelectorAll('#hmList [data-po-grip]')].filter((g) => getComputedStyle(g).display !== 'none').length);
|
|
181
|
+
ok('P phone: no grip shows (hold instead)', grips === 0, String(grips));
|
|
182
|
+
const hk = await top(p, '#hmList');
|
|
183
|
+
const s = await p.locator(`#hmList [data-po-list="@top"] > [data-po-id="${hk[hk.length - 1]}"] .hv-gh`).boundingBox();
|
|
184
|
+
const t = await p.locator(`#hmList [data-po-list="@top"] > [data-po-id="${hk[0]}"]`).boundingBox();
|
|
185
|
+
const cdp = await ctx.newCDPSession(p);
|
|
186
|
+
const pt = (y) => [{ x: s.x + s.width / 2, y }];
|
|
187
|
+
const n0 = posts.length;
|
|
188
|
+
await cdp.send('Input.dispatchTouchEvent', { type: 'touchStart', touchPoints: pt(s.y + s.height / 2) });
|
|
189
|
+
await sleep(600);
|
|
190
|
+
const lifted = await p.evaluate((k) => !!document.querySelector(`[data-po-list="@top"] > [data-po-id="${k}"].po-lift`), hk[hk.length - 1]);
|
|
191
|
+
for (let k = 1; k <= 6; k++) await cdp.send('Input.dispatchTouchEvent', { type: 'touchMove', touchPoints: pt(s.y + s.height / 2 - ((s.y + s.height / 2 - (t.y + 6)) * k) / 6) });
|
|
192
|
+
if (process.env.SHOTS) await p.screenshot({ path: process.env.SHOTS + '/home-phone-drag.png' });
|
|
193
|
+
await cdp.send('Input.dispatchTouchEvent', { type: 'touchEnd', touchPoints: [] });
|
|
194
|
+
await until(() => posts.length === n0 + 1);
|
|
195
|
+
ok('P phone: hold a group\'s header, it lifts; drag it up and the order saves', lifted && posts.length === n0 + 1 && LAY.top[0] === hk[hk.length - 1], JSON.stringify({ lifted, top: LAY.top, hk }));
|
|
196
|
+
ok('P phone: no sideways scroll', await p.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1));
|
|
197
|
+
ok('P phone: no page error', !errors.length, errors.join(' | '));
|
|
198
|
+
await ctx.close();
|
|
199
|
+
}
|
|
200
|
+
finish();
|
|
201
|
+
})();
|
|
@@ -139,6 +139,7 @@ async function pure() {
|
|
|
139
139
|
ok('D1 every part names its stage on hover (the current one says now)', c.titles.length >= 7 && c.titles.every(Boolean) && c.titles.some((x) => /^Build · .*now$/.test(x)), JSON.stringify(c.titles));
|
|
140
140
|
ok('D1 the old CTA button, the C overview tile, the switch and the step list are gone from the card; at most one primary on the page', !c.cta && !c.ov && !c.sw && c.steps === 0 && c.pri <= 1, JSON.stringify(c));
|
|
141
141
|
ok('D1 the → names ◆ Deliver, the next stage', c.next && /^Next: ◆ Deliver\. Move to Deliver$/.test(c.tail) && c.ms, c.tail);
|
|
142
|
+
ok('D1 batch 14 item 11: the button shows the next stage\'s name with the → ("◆ Deliver"), not a bare arrow', /◆ Deliver$/.test(c.head), c.head);
|
|
142
143
|
await shot(p, 'desk-build', V + ' .iv-sc');
|
|
143
144
|
// the move popover opens under the next-stage line
|
|
144
145
|
await p.click(V + ' [data-iv-next]');
|
|
@@ -95,7 +95,7 @@ async function pure() {
|
|
|
95
95
|
ok('P6 a Jira ticket: what blocks it leads ("Blocked by PLAT-88", "Jira · 4 min ago", what it holds)', /czs-line warn[^]*<span>Blocked by PLAT-88<\/span><span class="czs-r">Jira · 4 min ago<\/span>/.test(j) && /PLAT-88 is Gateway upgrade\. It holds Build\./.test(j), j.slice(0, 700));
|
|
96
96
|
ok('P6 the facts in plain text, then "Jira owns these. They change only in Jira."', /<span class="k">Status<\/span><span class="v" data-tkv-f="status">In progress<\/span>/.test(j) && /data-tkv-f="assignee"><span class="av j">DS<\/span>Dita S\./.test(j)
|
|
97
97
|
&& /data-tkv-f="sprint">MAD Sprint 115/.test(j) && /data-tkv-f="points">5/.test(j) && !/data-tkv-f="due"/.test(j) && /<p class="foot">Jira owns these\. They change only in Jira\.<\/p>/.test(j) && !/data-tkc-state|<button[^>]*data-tkc/.test(j));
|
|
98
|
-
ok('P6 the description from Jira, cut at five lines with an icon to open the rest; the notes are the PM\'s, editable', /Description <small>·
|
|
98
|
+
ok('P6 the description from Jira, cut at five lines with an icon to open the rest; the notes are the PM\'s, editable', /Description <small>· PMOS's copy, Jira may differ<\/small><\/p><div class="ovd cut">/.test(j) && /data-tkv="more" aria-expanded="false" aria-label="Show all of it"/.test(j)
|
|
99
99
|
&& /<textarea class="nt" id="tkvNotes" data-tkv-notes[^>]*>Ask Dita if the legacy IdP can stay up\.<\/textarea>/.test(j) && !/Acceptance Criteria/.test(j.slice(0, j.indexOf('czs-secs'))));
|
|
100
100
|
ok('P6 where it sits: initiative › stage › epic, no move icon; the folds Acceptance criteria 4, Subtasks 1 of 3 done, Linked 2; Open in Jira at the foot', /<b>Descope platform build<\/b><small>Build<span class="sep" aria-hidden="true">›<\/span>Epic Federation<\/small>/.test(j) && !/ovmv/.test(j)
|
|
101
101
|
&& /<b>Acceptance criteria<\/b><span class="czs-n">4<\/span>/.test(j) && /<b>Subtasks<\/b><span class="czs-n">1 of 3 done<\/span>/.test(j) && /<b>Linked<\/b><span class="czs-n">2<\/span>/.test(j) && /class="ovft"><a href="https:\/\/jira\.example\/browse\/CIAM-214"[^>]*>[^]*Open in Jira<\/a>/.test(j));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "batch 14 item 8: sort or arrange Home and the Board by hand, ONE order for both and the Timeline (canvas SoAHomePhone, SoABoardPhone, SoADesk).",
|
|
3
|
+
"modules": ["order-model.test.js"],
|
|
4
|
+
"panels": ["sort-order-test.js"],
|
|
5
|
+
"seconds": { "order-model.test.js": 1, "sort-order-test.js": 40 }
|
|
6
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "batch 14 item 7: one trail for the Viewer's back and forward, the browser's Back and Forward and a phone's back swipe (canvas Exploring · Navigation NvADesk, NvAPhone, NvAPhoneTrail, NvAFlow).",
|
|
3
|
+
"panels": ["viewer-trail-test.js"],
|
|
4
|
+
"seconds": { "viewer-trail-test.js": 25 }
|
|
5
|
+
}
|
|
@@ -311,12 +311,14 @@ const LAYOUT = { ok: true, auto: true, held: [], by: 'stage', names: [], of: {},
|
|
|
311
311
|
await E.ctx.close();
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
-
/* G6 · New →
|
|
314
|
+
/* G6 · New → Task opens the initiative with the cursor in the Tasks field (XtaA4NewTask) */
|
|
315
315
|
{
|
|
316
316
|
const N = await open({ layout: { by: 'stage', picked: true } }), n = N.page;
|
|
317
317
|
await n.click('[data-hm-new]');
|
|
318
|
-
await n.click('#hmMenu [data-hm-mi]:has-text("
|
|
319
|
-
|
|
318
|
+
await n.click('#hmMenu [data-hm-mi]:has-text("Task")').catch(() => n.click('[data-hm-mi]:has-text("Task")'));
|
|
319
|
+
// with an initiative open, Task adds there at once (batch 14 item 10); from all work it asks which initiative first
|
|
320
|
+
const pick = await n.$('#hmMenu:not([hidden]) [data-hm-mi]:has-text("Self-serve onboarding v2")');
|
|
321
|
+
if (pick && await pick.isVisible()) await pick.click();
|
|
320
322
|
ok('G6 New → A task: the page with the Tasks field open, the cursor in it', await until(() => n.evaluate(() => { const f = document.querySelector('#czViewer [data-hi-v="page"] #ivAddTask'); return !!f && document.activeElement === f; }), 15000));
|
|
321
323
|
ok('G6 no old Tasks view: no #ovTask anywhere', !(await n.$('#ovTask')));
|
|
322
324
|
await shot(n, 'new-task-1440.png');
|