create-pmos 0.425.0 → 0.426.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/board-deliveries-test.js +153 -0
  7. package/workspace/board-programs-test.js +19 -10
  8. package/workspace/board-shot.js +4 -3
  9. package/workspace/briefing-premium-board-test.js +2 -2
  10. package/workspace/calm-timeline-test.js +190 -0
  11. package/workspace/changelog.json +12 -0
  12. package/workspace/ev-everywhere-test.js +3 -1
  13. package/workspace/guide/claude-proposes.md +16 -1
  14. package/workspace/guide/programs.md +2 -1
  15. package/workspace/lib/board-premium.js +3 -1
  16. package/workspace/lib/chat-file-locate.js +40 -2
  17. package/workspace/lib/engine/boards.js +8 -2
  18. package/workspace/lib/idle-close.js +60 -0
  19. package/workspace/lib/loose-proposals.js +302 -0
  20. package/workspace/lib/my-work-premium.js +1 -1
  21. package/workspace/lib/proposal-runs.js +77 -2
  22. package/workspace/lib/propose-cli.js +42 -1
  23. package/workspace/lib/route-modules.js +1 -0
  24. package/workspace/lib/routes-boards.js +16 -4
  25. package/workspace/lib/routes-brief-page.js +9 -1
  26. package/workspace/lib/routes-loose.js +210 -0
  27. package/workspace/lib/routes-pm-items.js +27 -17
  28. package/workspace/lib/task-cli.js +18 -11
  29. package/workspace/milestone-pins-test.js +170 -0
  30. package/workspace/package-lock.json +2 -2
  31. package/workspace/package.json +1 -1
  32. package/workspace/premium-board-actions-test.js +2 -1
  33. package/workspace/premium-briefing-depth-test.js +1 -1
  34. package/workspace/premium-chat-term-test.js +13 -2
  35. package/workspace/premium-core-doc-issue-test.js +1 -1
  36. package/workspace/product-lane-test.js +30 -17
  37. package/workspace/public/pm/bd-acts.js +6 -3
  38. package/workspace/public/pm/bd-deliveries.js +218 -0
  39. package/workspace/public/pm/bd-pin-card.css +16 -0
  40. package/workspace/public/pm/bd-pin-card.js +80 -0
  41. package/workspace/public/pm/bd-pins.js +33 -0
  42. package/workspace/public/pm/bd-pop.js +2 -0
  43. package/workspace/public/pm/bd-prog.js +5 -4
  44. package/workspace/public/pm/bd-span.js +140 -102
  45. package/workspace/public/pm/cozy-board.css +73 -11
  46. package/workspace/public/pm/cozy-home.css +16 -1
  47. package/workspace/public/pm/cozy-today.css +4 -0
  48. package/workspace/public/pm/home-app.js +14 -0
  49. package/workspace/public/pm/home-data.js +5 -3
  50. package/workspace/public/pm/home-list.js +46 -5
  51. package/workspace/public/pm/home-today.js +15 -5
  52. package/workspace/public/pm/ini-tasks.js +4 -1
  53. package/workspace/public/pm/loose-props.css +54 -0
  54. package/workspace/public/pm/loose-props.js +262 -0
  55. package/workspace/public/pm/premium-board.js +9 -5
  56. package/workspace/public/pm/term-view.js +81 -10
  57. package/workspace/public/premium-board.html +1 -0
  58. package/workspace/server.js +107 -6
  59. package/workspace/skills/loose-propose.skill +39 -0
  60. package/workspace/task-milestones-test.js +15 -6
  61. package/workspace/test-lists/board-deliveries.json +13 -0
  62. package/workspace/test-lists/calm-timeline.json +5 -0
  63. package/workspace/test-lists/loose-props.json +9 -0
  64. package/workspace/test-lists/milestone-pins.json +6 -0
  65. package/workspace/timeline-holds-test.js +44 -42
@@ -5,7 +5,7 @@
5
5
  * pmos task add <initiative> "<title>" [--stage <stage>] [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]
6
6
  * a new task, by the same function as the page's Add a task (lib/routes-boards.js taskAdd, POST /api/boards/tasks/add)
7
7
  * pmos task set <task> [<task> …] [--stage <stage>|none] [--due YYYY-MM-DD|none] [--start …|none] [--owner <who>] [--notes <text>]
8
- * [--milestone|--no-milestone]
8
+ * [--milestone|--no-milestone] [--pin|--no-pin|--pin-default]
9
9
  * place tasks under a workflow stage of their initiative, or change their dates, owner or notes, by the same function as the Viewer's
10
10
  * edit (lib/routes-boards.js taskEdit, POST /api/boards/tasks/edit). The Tasks section groups tasks by stage (feedback batch 6:
11
11
  * an agent asked to group tasks by stage had no command for it).
@@ -38,9 +38,11 @@ const USAGE = [
38
38
  ' pmos task add <initiative> "<title>" [--stage <stage>] [--due YYYY-MM-DD] [--start YYYY-MM-DD] [--owner <who>] [--notes <text>]',
39
39
  ' Add a task. Every new task goes here; pmos item add is the older breakdown record.',
40
40
  ' pmos task set <task> [<task> …] [--stage <stage>|none] [--due YYYY-MM-DD|none] [--start YYYY-MM-DD|none] [--owner <who>] [--notes <text>]',
41
- ' [--milestone|--no-milestone]',
41
+ ' [--milestone|--no-milestone] [--pin|--no-pin|--pin-default]',
42
42
  ' Group tasks under a stage of the initiative\'s workflow (key or name; none takes it out), or change dates, owner or notes.',
43
43
  ' --milestone makes a task a milestone: its due date shows as ◇ on the Board and the timeline. Set it only when the PM asks.',
44
+ ' --pin shows a milestone on the Board timeline, --no-pin hides it, --pin-default goes back to the rule (the last milestone',
45
+ ' shows). Set it only when the PM asks.',
44
46
  ' pmos task list <initiative> [--all] its open tasks; --all adds Done, Won\'t do and Archived',
45
47
  ' pmos task remove <task> [<task> …] [--why <text>]',
46
48
  ' Delete a task added by mistake (a placeholder, a duplicate) when the PM asks. It goes from every list; the page\'s Undo brings',
@@ -58,7 +60,8 @@ const USAGE = [
58
60
  ' pmos task unlink <from> <to>',
59
61
  ' every command: [--json] [--root <dir>]. Nothing is sent.',
60
62
  ];
61
- const BOOL = new Set(['json', 'help', 'all', 'milestone', 'no-milestone', 'propose']);
63
+ const BOOL = new Set(['json', 'help', 'all', 'milestone', 'no-milestone', 'pin', 'no-pin', 'pin-default', 'propose']);
64
+ const PIN_FLAGS = ['pin', 'no-pin', 'pin-default'];
62
65
  const VALUE = new Set(['to', 'why', 'root', 'due', 'start', 'owner', 'notes', 'stage', 'type', 'lag']);
63
66
  const ONLY = { add: ['due', 'start', 'owner', 'notes', 'stage'], list: ['all'], state: ['to', 'why'], remove: ['why'], set: ['due', 'start', 'owner', 'notes', 'stage'], link: ['type', 'lag', 'why'], unlink: [] };
64
67
  const OPEN = new Set(['To do', 'In progress']);
@@ -102,7 +105,7 @@ function boardsCtx(root, stateDir) {
102
105
  const w = { id: driver.wsIdOf(root), name: path.basename(root), root };
103
106
  return { w, ctx: { getWs: () => w, workspaceList: () => [w], stateDirFor: () => stateDir, selfRoot: path.resolve(__dirname, '..', '..') } };
104
107
  }
105
- const line = (t) => `${t.id} · ${t.state} · ${t.title}${t.kind === 'Epic' ? ' (epic)' : ''}${t.milestone ? ' · ◇ milestone' : ''}${t.stage ? ' · under ' + t.stage : ''}${t.due ? ' · due ' + t.due : ''}`;
108
+ const line = (t) => `${t.id} · ${t.state} · ${t.title}${t.kind === 'Epic' ? ' (epic)' : ''}${t.milestone ? ' · ◇ milestone' : ''}${t.pinned === true ? ' · pinned' : t.pinned === false ? ' · not pinned' : ''}${t.stage ? ' · under ' + t.stage : ''}${t.due ? ' · due ' + t.due : ''}`;
106
109
  /** The workflow row of an initiative, deriving the rows when they are still being read. */
107
110
  function rowOf(boards, ctx, w, id) {
108
111
  let r = boards.initiativeWorkflow(ctx, w, id);
@@ -128,6 +131,8 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
128
131
  if (flags.all && verb !== 'list') return fail(`--all is not an option of ${verb}`, 2);
129
132
  for (const k of ['milestone', 'no-milestone']) if (flags[k] && verb !== 'set') return fail(`--${k} is not an option of ${verb}`, 2);
130
133
  if (flags.milestone && flags['no-milestone']) return fail('--milestone and --no-milestone contradict each other', 2);
134
+ for (const k of PIN_FLAGS) if (flags[k] && verb !== 'set') return fail(`--${k} is not an option of ${verb}`, 2);
135
+ if (PIN_FLAGS.filter((k) => flags[k]).length > 1) return fail('give one of --pin, --no-pin and --pin-default', 2);
131
136
  if (flags.propose && verb !== 'link') return fail(`--propose is not an option of ${verb}`, 2);
132
137
  const root = flags.root ? path.resolve(cwd, flags.root) : repoRoot(cwd);
133
138
  const stateDir = driver.stateDirOf(root, { create: verb !== 'list' });
@@ -141,11 +146,12 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
141
146
  const tasksOf = (id) => {
142
147
  const r = rowOf(boards, ctx, w, id);
143
148
  const board = r.ok ? r.board.id : null;
144
- const F = boards.foldOf(ctx, w), S = F.sections || new Map(), MS = F.milestones || new Map();
149
+ const F = boards.foldOf(ctx, w), S = F.sections || new Map(), MS = F.milestones || new Map(), PN = F.pins || new Map();
150
+ const pinOf = (tid) => (PN.has(tid) ? { pinned: PN.get(tid) } : {}); // the PM's pin on the Board timeline (batch 13 item 4); unset = the rule
145
151
  const msOf = (tid, own) => (MS.has(tid) ? MS.get(tid) : !!own); // the PM's ◇ flag (feedback batch 11 item 3)
146
152
  const stageOf = (tid, from) => (S.has(tid) ? S.get(tid) : (from && from.stage) || ''); // the group the Tasks section shows it under
147
- const own = [...(F.tasks || new Map()).values()].filter((t) => t.initiative === id).map((t) => ({ ...t, stage: stageOf(t.id, t.from), milestone: msOf(t.id) }));
148
- const items = TI.rowsOf(root, new Set([id]), board).map((x) => ({ id: x.uid, board, kind: 'Task', title: x.title, state: x.status, owner: x.owner, due: x.end, store: 'item', stage: stageOf(x.uid), milestone: msOf(x.uid, x.milestone) }));
153
+ const own = [...(F.tasks || new Map()).values()].filter((t) => t.initiative === id).map((t) => ({ ...t, stage: stageOf(t.id, t.from), milestone: msOf(t.id), ...pinOf(t.id) }));
154
+ const items = TI.rowsOf(root, new Set([id]), board).map((x) => ({ id: x.uid, board, kind: 'Task', title: x.title, state: x.status, owner: x.owner, due: x.end, store: 'item', stage: stageOf(x.uid), milestone: msOf(x.uid, x.milestone), ...pinOf(x.uid) }));
149
155
  return own.concat(items);
150
156
  };
151
157
 
@@ -176,7 +182,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
176
182
  try { boards.seedInitiative(ctx, w, id); } catch { /* the To finish tasks are made on the next read */ }
177
183
  const all = tasksOf(id);
178
184
  const shown = flags.all ? all : all.filter((t) => OPEN.has(t.state));
179
- if (json) { say(JSON.stringify({ ok: true, tasks: shown.map((t) => ({ id: t.id, board: t.board, kind: t.kind, title: t.title, state: t.state, owner: t.owner, due: t.due, stage: t.stage || '', ...(t.milestone ? { milestone: true } : {}), ...(t.from ? { from: t.from } : {}) })) })); return 0; }
185
+ if (json) { say(JSON.stringify({ ok: true, tasks: shown.map((t) => ({ id: t.id, board: t.board, kind: t.kind, title: t.title, state: t.state, owner: t.owner, due: t.due, stage: t.stage || '', ...(t.milestone ? { milestone: true } : {}), ...(typeof t.pinned === 'boolean' ? { pinned: t.pinned } : {}), ...(t.from ? { from: t.from } : {}) })) })); return 0; }
180
186
  if (!shown.length) { say(all.length ? `No open task on ${id}. --all lists the ${all.length} closed.` : `No task on ${id}.`); return 0; }
181
187
  for (const t of shown) say(line(t));
182
188
  return 0;
@@ -194,8 +200,8 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
194
200
  };
195
201
 
196
202
  if (verb === 'set') {
197
- const keys = ['stage', 'due', 'start', 'owner', 'notes'].filter((k) => flags[k] !== undefined).concat(flags.milestone || flags['no-milestone'] ? ['milestone'] : []);
198
- if (!pos.length || !keys.length) { say('usage: pmos task set <task> [<task> …] [--stage <stage>|none] [--due YYYY-MM-DD|none] [--start YYYY-MM-DD|none] [--owner <who>] [--notes <text>] [--milestone|--no-milestone]'); return 2; }
203
+ const keys = ['stage', 'due', 'start', 'owner', 'notes'].filter((k) => flags[k] !== undefined).concat(flags.milestone || flags['no-milestone'] ? ['milestone'] : []).concat(PIN_FLAGS.some((k) => flags[k]) ? ['pinned'] : []);
204
+ if (!pos.length || !keys.length) { say('usage: pmos task set <task> [<task> …] [--stage <stage>|none] [--due YYYY-MM-DD|none] [--start YYYY-MM-DD|none] [--owner <who>] [--notes <text>] [--milestone|--no-milestone] [--pin|--no-pin|--pin-default]'); return 2; }
199
205
  const folded = boards.foldOf(ctx, w);
200
206
  const done = [], refused = [];
201
207
  for (const id of pos) {
@@ -212,11 +218,12 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
212
218
  for (const k of ['due', 'start']) if (flags[k] !== undefined) body[k] = String(flags[k]).toLowerCase() === 'none' ? '' : flags[k];
213
219
  for (const k of ['owner', 'notes']) if (flags[k] !== undefined) body[k] = flags[k];
214
220
  if (flags.milestone || flags['no-milestone']) body.milestone = !!flags.milestone;
221
+ if (PIN_FLAGS.some((k) => flags[k])) body.pinned = flags.pin ? true : flags['no-pin'] ? false : null;
215
222
  const e = boards.taskEdit(ctx, body, g);
216
223
  if (!e.body || e.body.ok !== true) refused.push({ task: id, error: (e.body && e.body.error) || 'the write was refused' });
217
224
  else done.push({ task: id, title: t.title, set: Object.fromEntries(keys.map((k) => [k, k === 'stage' ? body.section : body[k]])) });
218
225
  }
219
- const what = (x) => Object.entries(x).map(([k, v]) => (k === 'stage' ? (v ? 'under ' + v : 'under no stage') : k === 'milestone' ? (v ? 'a milestone' : 'not a milestone') : v === '' ? 'no ' + k : k + ' ' + v)).join(', ');
226
+ const what = (x) => Object.entries(x).map(([k, v]) => (k === 'stage' ? (v ? 'under ' + v : 'under no stage') : k === 'milestone' ? (v ? 'a milestone' : 'not a milestone') : k === 'pinned' ? (v === true ? 'pinned to the timeline' : v === false ? 'off the timeline' : 'pinned by the rule') : v === '' ? 'no ' + k : k + ' ' + v)).join(', ');
220
227
  // a date changed outside a drag: inside the approved links, what waits on it moves quietly (batch 11 item 15, the grey ✦ on the page)
221
228
  let kept = 0;
222
229
  if (done.length && (flags.due !== undefined || flags.start !== undefined)) {
@@ -0,0 +1,170 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* milestone-pins-test.js — choose which milestones the Board timeline shows, on the page (feedback batch 13 item 4, calmer timeline A5; canvas
4
+ * Ready for development, row "Calmer Board timeline": XcalmA5Milestones). Serves the real page from the real server; GET /api/board-premium
5
+ * answers a board built by lib/board-premium.js. POST /api/boards/tasks/edit is answered here and its bodies are kept.
6
+ * C the ◇ card: a press on a row's ◇ (`[data-ms-pick]`; one is put on the row when pm/bd-span.js draws none yet) opens a card with the
7
+ * milestone's name, its date and "N of M milestones on the timeline", then every milestone with an icon-only pin toggle
8
+ * T a toggle writes { task, pinned } at once, the card counts again and keeps the focus; a refused write puts it back and says why
9
+ * F the Filter on the timeline: "Milestones on the timeline: Pinned · All · None" with its line; a pick is remembered; Clear goes back
10
+ * to Pinned; the List view's Filter has no such group
11
+ * P the phone: the card is a bottom sheet
12
+ * SHOTS_4B=<dir>: the card and the Filter, desktop and phone, into <dir>. */
13
+ const path = require('path');
14
+ const { spawn } = require('child_process');
15
+ const { findBrowser } = require('./lib/find-browser');
16
+ const T = require('./test-run').configure({ name: 'milestone-pins' });
17
+ const BP = require('./lib/board-premium.js');
18
+ const F = require('./fixtures/board-premium-facts.js');
19
+
20
+ const BASE = T.BASE;
21
+ const results = [];
22
+ const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
23
+ let srv = null; let browser = null;
24
+ const finish = async (code) => {
25
+ if (browser) await browser.close().catch(() => {});
26
+ if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
27
+ T.killTmux();
28
+ const bad = results.filter((x) => !x.cond).length;
29
+ console.log(`\n${results.length - bad}/${results.length} milestone-pins assertions passed`);
30
+ process.exit(code !== undefined ? code : (bad ? 1 : 0));
31
+ };
32
+ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
33
+
34
+ const ROWS = [
35
+ F.row('migration', 'Migration — move from Okta to Descope', { owner: 'Wawan', stage: 'Build', start: '2026-10-01', end: '2027-09-05', progress: 20 }),
36
+ F.row('passkey', 'Passkey sign-in', { owner: 'Lee', start: '2026-09-15', end: '2027-02-26', progress: 45 }),
37
+ ];
38
+ const it = (ini, uid, title, o) => ({ uid, key: '', kind: 'Task', src: 'pmos', title, status: 'To do', owner: 'Wawan', ini, start: null, end: null, ref: uid, board: 'w1', milestone: true, ...o });
39
+ const ITEMS = [
40
+ it('migration', 'm-it1', 'Iteration 1 live', { end: '2027-01-20' }),
41
+ it('migration', 'm-it2', 'Iteration 2 live', { end: '2027-03-25' }),
42
+ it('migration', 'm-rel', 'Release: all users on Descope', { end: '2027-06-01', pinned: true }),
43
+ it('migration', 'm-eval', 'Evaluation at 30 days', { end: '2027-07-01' }),
44
+ it('migration', 'm-okta', 'Okta decommissioned', { end: '2027-09-05' }),
45
+ it('passkey', 'p-beta', 'Beta to staff', { end: '2026-12-18' }),
46
+ ];
47
+
48
+ (async () => {
49
+ const exe = findBrowser();
50
+ if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
51
+ let chromium;
52
+ try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
53
+ srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
54
+ await T.waitForServer(BASE);
55
+ browser = await chromium.launch({ executablePath: exe });
56
+
57
+ /** The Board on the timeline. o: { w, h, phone, refuse, view } */
58
+ const open = async (o = {}) => {
59
+ const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 }, hasTouch: !!o.phone, isMobile: !!o.phone });
60
+ const page = await ctx.newPage();
61
+ const errors = [], posts = [];
62
+ page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
63
+ await page.clock.setFixedTime(new Date(F.NOW));
64
+ // the pins written so far come back on the next read, as the server's would
65
+ const PIN = new Map();
66
+ const model = () => BP.build(F.facts({ rows: ROWS.map((r) => ({ ...r })), total: ROWS.length, columns: [], items: ITEMS.map((x) => (PIN.has(x.uid) ? { ...x, pinned: PIN.get(x.uid) } : { ...x })) }));
67
+ await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: model(), as_of: Date.now() }) }));
68
+ await page.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: [] }) }));
69
+ await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
70
+ await page.route('**/api/boards/tasks/edit', (r) => {
71
+ const b = JSON.parse(r.request().postData() || '{}'); posts.push(b);
72
+ if (o.refuse) return r.fulfill({ status: 409, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'no state folder here' }) });
73
+ PIN.set(b.task, b.pinned);
74
+ return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, from: { pinned: null }, item: null }) });
75
+ });
76
+ await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } }, [{ 'pmos.board.view': o.view || 'time', 'pmos.board.pview': o.view || 'time', 'pmos.board.span': 'year' }]);
77
+ await page.goto(BASE + '/premium-board.html?ws=w1&board=w1');
78
+ await page.waitForSelector('#ibBody [data-row]', { timeout: 15000 });
79
+ await page.waitForTimeout(400);
80
+ return { ctx, page, errors, posts };
81
+ };
82
+ const shots = process.env.SHOTS_4B;
83
+ const shot = async (p, name) => { if (shots) await p.screenshot({ path: path.join(shots, name + '.png') }); };
84
+ /** The row's ◇ for a milestone: pm/bd-span.js's, else one put on the row's lane the way it draws it (the lead build draws them). */
85
+ const pick = async (p, key, id) => {
86
+ await p.evaluate(([k, i]) => {
87
+ if (document.querySelector(`[data-ms-pick="${k}"][data-ms-id="${i}"]`)) return;
88
+ const lane = document.querySelector(`#ibBody [data-row="${k}"] .tg-p`) || document.querySelector(`#ibBody [data-row="${k}"]`);
89
+ const b = document.createElement('button'); b.type = 'button'; b.className = 'tg-tm'; b.dataset.msPick = k; b.dataset.msId = i; b.setAttribute('aria-label', 'Milestone'); b.style.cssText = 'position:absolute;left:60%;top:8px;width:14px;height:14px';
90
+ lane.appendChild(b);
91
+ }, [key, id]);
92
+ await p.click(`[data-ms-pick="${key}"][data-ms-id="${id}"]`);
93
+ await p.waitForSelector('#bdPop.bd-pc:not([hidden])', { timeout: 4000 });
94
+ };
95
+ const card = (p) => p.evaluate(() => {
96
+ const c = document.querySelector('#bdPop'); if (!c || c.hidden) return null;
97
+ return { h: (c.querySelector('.bd-pc-h') || {}).textContent || '', sub: (c.querySelector('.bd-pc-sub') || {}).textContent || '',
98
+ rows: [...c.querySelectorAll('.bd-pc-r')].map((r) => { const b = r.querySelector('[data-pin-ms]'); return [r.querySelector('.bd-pc-n').textContent, b.getAttribute('aria-pressed'), b.textContent.trim(), b.getAttribute('aria-label')]; }),
99
+ focus: document.activeElement && document.activeElement.dataset ? document.activeElement.dataset.pinMs || '' : '' };
100
+ });
101
+
102
+ /* C T — desktop */
103
+ {
104
+ const { ctx, page: p, errors, posts } = await open();
105
+ await pick(p, 'board:migration', 'm-rel');
106
+ let c = await card(p);
107
+ ok('C the card names the ◇ pressed, its date and how many milestones are on the timeline',
108
+ c && c.h === 'Release: all users on Descope' && c.sub === 'Jun 1 ’27 · 2 of 5 milestones on the timeline', JSON.stringify(c));
109
+ ok('C every milestone by date, pinned = the PM\'s pin plus the last one; each toggle is an icon with a label',
110
+ c && c.rows.map((r) => r[0] + '|' + r[1]).join(',') === 'Iteration 1 liveJan 20 ’27|false,Iteration 2 liveMar 25 ’27|false,Release: all users on DescopeJun 1 ’27|true,Evaluation at 30 daysJul 1 ’27|false,Okta decommissionedSep 5 ’27|true'
111
+ && c.rows.every((r) => r[2] === '' && /^Show(n)? on the timeline: /.test(r[3])), JSON.stringify(c && c.rows));
112
+ await shot(p, 'pins-card-1440');
113
+ await p.click('#bdPop [data-pin-ms="m-it2"]');
114
+ await p.waitForTimeout(500);
115
+ c = await card(p);
116
+ ok('T a toggle writes pinned true for that task, on this board', posts.length === 1 && posts[0].task === 'm-it2' && posts[0].pinned === true && posts[0].board === 'w1', JSON.stringify(posts));
117
+ ok('T the card stays open, counts again and keeps the focus on the toggle', c && /3 of 5 milestones on the timeline/.test(c.sub) && c.rows[1][1] === 'true' && c.focus === 'm-it2', JSON.stringify(c));
118
+ await p.click('#bdPop [data-pin-ms="m-okta"]');
119
+ await p.waitForTimeout(500);
120
+ c = await card(p);
121
+ ok('T unpinning the last one writes pinned false', posts[1] && posts[1].task === 'm-okta' && posts[1].pinned === false && c && /2 of 5/.test(c.sub), JSON.stringify(posts));
122
+ await p.keyboard.press('Escape');
123
+ ok('C Escape closes the card', await p.evaluate(() => document.querySelector('#bdPop').hidden));
124
+ ok('C the ◇ press does not open the initiative', await p.evaluate(() => !document.querySelector('.iv-tr')));
125
+
126
+ /* F — the Filter */
127
+ await p.click('#bdFilter');
128
+ const f = await p.evaluate(() => { const c = document.querySelector('#bdPop'); const g = c.querySelector('[role="radiogroup"][aria-label="Milestones on the timeline"]'); return g ? { chips: [...g.querySelectorAll('[data-msmode]')].map((b) => b.textContent + '|' + b.getAttribute('aria-checked')), line: c.textContent.includes('Pinned = the last milestone, plus any you pin.') } : null; });
129
+ ok('F the timeline\'s Filter has "Milestones on the timeline: Pinned · All · None" with its line, Pinned on', f && f.chips.join() === 'Pinned|true,All|false,None|false' && f.line, JSON.stringify(f));
130
+ await shot(p, 'pins-filter-1440');
131
+ await p.click('#bdPop [data-msmode="all"]');
132
+ ok('F All is picked and remembered', await p.evaluate(() => localStorage.getItem('pmos.board.msMode') === 'all' && document.querySelector('#bdPop [data-msmode="all"]').getAttribute('aria-checked') === 'true'));
133
+ await p.click('#bdPop [data-fclear]');
134
+ ok('F Clear goes back to Pinned', await p.evaluate(() => localStorage.getItem('pmos.board.msMode') === 'pinned'));
135
+ ok('the Board threw nothing', !errors.length, errors.join('\n'));
136
+ await ctx.close();
137
+ }
138
+
139
+ /* T — a refused write */
140
+ {
141
+ const { ctx, page: p } = await open({ refuse: true });
142
+ await pick(p, 'board:migration', 'm-rel');
143
+ await p.click('#bdPop [data-pin-ms="m-it1"]');
144
+ await p.waitForTimeout(400);
145
+ const c = await card(p), toast = await p.evaluate(() => document.body.textContent.includes('no state folder here'));
146
+ ok('T a refused write puts the toggle back and says why', c && c.rows[0][1] === 'false' && /2 of 5/.test(c.sub) && toast, JSON.stringify(c));
147
+ await ctx.close();
148
+ }
149
+
150
+ /* F — no group off the timeline */
151
+ {
152
+ const { ctx, page: p } = await open({ view: 'list' });
153
+ await p.click('#bdFilter');
154
+ ok('F the List view\'s Filter has no milestone group', await p.evaluate(() => !document.querySelector('#bdPop [data-msmode]')));
155
+ await ctx.close();
156
+ }
157
+
158
+ /* P — the phone */
159
+ {
160
+ const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
161
+ await pick(p, 'board:migration', 'm-okta');
162
+ const sheet = await p.evaluate(() => document.querySelector('#bdPop').classList.contains('sheet'));
163
+ const c = await card(p);
164
+ ok('P the card is a bottom sheet with the same list', sheet && c && c.rows.length === 5 && c.h === 'Okta decommissioned', JSON.stringify(c));
165
+ await shot(p, 'pins-card-390');
166
+ ok('the phone threw nothing', !errors.length, errors.join('\n'));
167
+ await ctx.close();
168
+ }
169
+ finish();
170
+ })();
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.425.0",
3
+ "version": "0.426.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.425.0",
9
+ "version": "0.426.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.425.0",
3
+ "version": "0.426.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -246,7 +246,8 @@ const ALLOWED = /^\/api\/(?:boards\/(?:asks\/(?:add|accept|decline)|move|archive
246
246
 
247
247
  /* P the POST allow-list and the refusals */
248
248
  const all = P.posts.concat(I.posts);
249
- const other = all.filter((x) => !ALLOWED.test(x.path) && x.path !== '/api/briefing-premium/seen'); // an opened popup's record (popup context slice 11, R1) is not a press
249
+ const other = all.filter((x) => !ALLOWED.test(x.path) && x.path !== '/api/briefing-premium/seen' // an opened popup's record (popup context slice 11, R1) is not a press
250
+ && x.path !== '/api/loose-props/rows'); // what Home shows loose, sent once when it changed so Claude can propose a clean-up (batch 13 item 3); it changes no work
250
251
  ok('P1 the pages post only to the asks, move, lifecycle, archive, initiative-layout and proposals/look routes', all.length > 10 && !other.length, JSON.stringify(other));
251
252
  const noNonce = await post('/api/boards/move', { id: 'fx-bare', to: ready.model.board.stages[1] }, { 'Content-Type': 'application/json', Origin: BASE });
252
253
  const lifeNo = await post('/api/lifecycle', { initiative_id: 'fx-bare', state: 'on-hold' }, { 'Content-Type': 'application/json', Origin: BASE });
@@ -326,7 +326,7 @@ const GANTT = [
326
326
  repReply = null;
327
327
 
328
328
  /* W: the POST allow-list */
329
- const allowed = new Set(['/api/mentions/read', '/api/pm-items/add', '/api/driver/keep', '/api/driver/return', '/api/driver/drop', '/api/scan/proposal', '/api/scan/now', '/api/scan/stop', '/api/sources/refresh', '/api/sources/refresh-all', '/api/report-setups/setup', '/api/report-setups/dismiss', '/api/briefing-premium/seen', '/api/news-for-you/seen']); // news-for-you/seen: closing New for you marks what it showed seen // seen: an opened popup's record (popup context slice 11, R1)
329
+ const allowed = new Set(['/api/mentions/read', '/api/pm-items/add', '/api/driver/keep', '/api/driver/return', '/api/driver/drop', '/api/scan/proposal', '/api/scan/now', '/api/scan/stop', '/api/sources/refresh', '/api/sources/refresh-all', '/api/report-setups/setup', '/api/report-setups/dismiss', '/api/briefing-premium/seen', '/api/news-for-you/seen', '/api/loose-props/rows']); // news-for-you/seen: closing New for you marks what it showed seen // seen: an opened popup's record (popup context slice 11, R1) // loose-props/rows: what Home shows loose, sent when it changed (batch 13 item 3); it changes no work
330
330
  const strays = posts.filter((x) => !allowed.has(x.path) && !/^\/api\/home-desk\//.test(x.path)); // /api/home-desk/*: Home's own chat (a conversation seen), not Around you
331
331
  ok('W1 every POST is one of the existing routes in the PRD', posts.length > 0 && strays.length === 0, JSON.stringify(strays));
332
332
  const fields = { '/api/driver/keep': ['ws', 'proposal'], '/api/driver/return': ['ws', 'proposal', 'note'], '/api/driver/drop': ['ws', 'proposal'], '/api/mentions/read': ['id', 'read'], '/api/pm-items/add': ['line'], '/api/scan/proposal': ['ws', 'id', 'action', 'why'], '/api/scan/now': ['ws'], '/api/sources/refresh': ['ws', 'source'], '/api/sources/refresh-all': ['ws'], '/api/report-setups/setup': ['ws', 'finding'], '/api/report-setups/dismiss': ['ws', 'finding', 'name'] };
@@ -6,6 +6,7 @@
6
6
  * header, so the icon sits in the box's toolbar; nothing links to the console)
7
7
  * O2 an ended chat: the icon copies the line that resumes it
8
8
  * O3 no session: no icon
9
+ * O4 the terminal is drawn from the raw bytes by a read-only xterm.js: cursor moves and redraws land as on screen; later reads ask only for what is new
9
10
  * Set CHAT_TERM_SHOTS=<dir> to save the header at 1280 light and 390 dark. */
10
11
  const { findBrowser } = require('./lib/find-browser');
11
12
  require('./test-run').configure({ name: 'premium-chat-term' });
@@ -53,12 +54,22 @@ const pressTerm = async (p) => { await p.click('#hmAdd'); await p.click('#hmTerm
53
54
  { const { p, ctx, errs } = await open({ session: 'sess-7' });
54
55
  const i = await until(async () => { const v = await p.evaluate(icon); return v && v.shown ? v : null; }) || await p.evaluate(icon);
55
56
  ok('O1 a running session shows the terminal in the box\'s + menu', i && i.shown && i.label === 'Watch its terminal' && i.inBox, JSON.stringify(i));
56
- let read = null; await p.route('**/api/sessions/transcript?**', (r) => { read = new URL(r.request().url()).searchParams.get('id'); r.fulfill({ json: { ok: true, id: 'sess-7', text: 'claude> working on the sheet' } }); });
57
+ // raw=1 (PM, 2026-10-27 "Broken format on terminal view"): the bytes as printed, drawn in a read-only terminal; then only what is new
58
+ let read = null; const asked = [];
59
+ const RAW = 'claude> working\x1b[1Con the sheet\r\n\x1b[2m*Compacting\x1b[0m\r*Compacted.\r\n';
60
+ await p.route('**/api/sessions/transcript?**', (r) => { const q = new URL(r.request().url()).searchParams; read = q.get('id'); asked.push(q.get('since'));
61
+ if (q.get('raw') !== '1') return r.fulfill({ json: { ok: true, id: 'sess-7', text: 'claude> working on the sheet' } });
62
+ if (q.get('since') === String(RAW.length) && q.get('gen') === '0') return r.fulfill({ json: { ok: true, id: 'sess-7', cols: 60, rows: 12, gen: 0, end: RAW.length + 6, reset: false, data: 'next\r\n' } });
63
+ r.fulfill({ json: { ok: true, id: 'sess-7', cols: 60, rows: 12, gen: 0, end: RAW.length, reset: true, data: RAW } }); });
57
64
  let pops = 0; ctx.on('page', () => { pops++; });
58
65
  await pressTerm(p);
59
- const v = await until(() => p.evaluate(() => { const w = document.querySelector('#czViewer:not([hidden])'); return w && /working on the sheet/.test(w.textContent) ? (w.querySelector('.cz-vw-kind') || {}).textContent : null; }));
66
+ const v = await until(() => p.evaluate(() => { const w = document.querySelector('#czViewer:not([hidden])'); return w && /working/.test(w.textContent) ? (w.querySelector('.cz-vw-kind') || {}).textContent : null; }));
60
67
  ok('O1 pressing it shows that same session\'s terminal, read only, in the Viewer; no tab opens and nothing links to the console', v === 'Terminal · read only' && read === 'sess-7' && pops === 0
61
68
  && !(await p.evaluate(() => [...document.querySelectorAll('a[href]')].some((a) => /console/.test(a.getAttribute('href'))))), JSON.stringify([v, read, pops]));
69
+ const lines = () => p.evaluate(() => [...document.querySelectorAll('#czViewer .xterm-rows > div')].map((d) => d.textContent.replace(/\u00a0/g, ' ').trimEnd()).filter(Boolean));
70
+ const l1 = await until(async () => { const l = await lines(); return l.includes('next') ? l : null; }, 9000) || await lines();
71
+ ok('O4 the terminal draws the bytes as a terminal would: a cursor move is a space and a redraw replaces its line, not a new one', l1[0] === 'claude> working on the sheet' && l1[1] === '*Compacted.' && !l1.some((x) => /Compacting/.test(x)), JSON.stringify(l1));
72
+ ok('O4 after the first read it asks only for what is new', l1.includes('next') && asked.includes(String(RAW.length)) && l1.filter((x) => x === 'claude> working on the sheet').length === 1, JSON.stringify([asked, l1]));
62
73
  if (shots) await p.screenshot({ path: `${shots}/term-1280-light.png` });
63
74
  ok('O1 no error on the page', !errs.length, errs.join(' | '));
64
75
  await ctx.close();
@@ -163,7 +163,7 @@ const BODY = '## Purpose\n\nWhy this board exists.\n\n## Scope\n\nWhat it covers
163
163
 
164
164
  /* P the POST allow-list and the refusals */
165
165
  const all = P.posts.concat(I.posts, J.posts);
166
- const other = all.filter((x) => !ALLOWED.test(x.path));
166
+ const other = all.filter((x) => !ALLOWED.test(x.path) && x.path !== '/api/loose-props/rows'); // what Home shows loose, sent when it changed so Claude can propose a clean-up (batch 13 item 3); it changes no work
167
167
  ok('P1 the pages post only to the issue route (and the conversation note)', all.length >= 3 && !other.length, JSON.stringify(other));
168
168
  const sentAll = all.filter((x) => x.path === '/api/core-docs/issue');
169
169
  ok('P2 every issue press carried the nonce and no writer field', sentAll.length >= 3 && sentAll.every((x) => x.headers['x-pmos-nonce'] === nonce && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)));
@@ -3,13 +3,16 @@
3
3
  /* product-lane-test.js — milestones on the product lane (feedback batch 11 item 17; canvas In development, row "Milestones on the product lane":
4
4
  * PlmA1Board, PlmA2Folded, PlmA3Phone, sticky plmRules). Serves the real page from the real server; GET /api/board-premium answers All products,
5
5
  * two products built by lib/board-premium.js from rows and work items that carry the ◇ flag. The page's clock is the fixture's (17 Oct 2026).
6
- * L the lane: the product's head row carries every milestone of its initiatives (the ◇ tasks and each row's end ◇), the same ◇ (filled done,
7
- * orange late), close ones merged into a counted ◇ with the range under it, a thin line from the first start to the last end
6
+ * Since the calmer timeline (feedback batch 13 item 4, XcalmA2Folded) the lane is the roll-up of a FOLDED product; open, the head row draws
7
+ * nothing (its rows say it), and no ◇ carries a date under it.
8
+ * O open, the head row is plain: the name and the fold, an empty track, no goal dots
9
+ * L folded, the lane: the product's head row carries every milestone of its initiatives (the ◇ tasks and each row's end ◇), the same ◇ (filled
10
+ * done, orange late), close ones merged into a counted ◇, a thin line from the first start to the last end, the last end as its one label
8
11
  * H hover on a single ◇ names the milestone and its initiative
9
12
  * P pressing a counted ◇ lists its milestones with their initiatives; a line opens that initiative
10
- * F folded, the lane is the same; the head shows the count
11
- * S Quarter puts a date under each ◇, 5 yr none
12
- * Q the phone: ◇ only, no dates; a tap on the lane opens a sheet with the product's milestones in date order
13
+ * F folded, the head shows one dot per initiative off track, no count
14
+ * S no span puts a date under a ◇
15
+ * Q the phone: ◇ only; a tap on the folded lane opens a sheet with the product's milestones in date order
13
16
  * SHOTS_17=<dir>: the Board, the counted ◇'s list, folded and the phone sheet, into <dir>. */
14
17
  const path = require('path');
15
18
  const { spawn } = require('child_process');
@@ -97,20 +100,30 @@ function model() {
97
100
  tm: [...r.querySelectorAll('.tg-tm')].map((x) => x.className + '|' + x.getAttribute('title')),
98
101
  tmc: [...r.querySelectorAll('.tg-tmc')].map((x) => x.className + '|' + x.textContent),
99
102
  tml: [...r.querySelectorAll('.tg-tml')].map((x) => x.textContent),
103
+ endl: [...r.querySelectorAll('.tg-endl')].map((x) => x.textContent), dots: [...r.querySelectorAll('.tg-offd .cz-dot')].map((x) => x.className), gd: r.querySelectorAll('.bd-gd').length,
100
104
  };
101
105
  }, key);
102
106
 
103
- /* L H P — desktop, Year */
107
+ /* O — open, desktop, Year */
104
108
  {
105
109
  const { ctx, page: p, errors } = await open();
106
110
  const a = await laneOf(p, 'p:pmos-scarlet'), b = await laneOf(p, 'p:pmos-idpf');
107
- ok('L each product\'s head row is a lane: its name cell with the fold, its track with a thin line', a && b && /pmos-scarlet/.test(a.name) && a.span >= 1 && b.span >= 1, JSON.stringify({ a, b }));
108
- ok('L the lane rolls up the ◇ tasks and each end ◇ of its initiatives; Dec 11 and Dec 18 merge into one counted ◇',
109
- a && a.tm.length === 4 && a.tmc.length === 1 && /^tg-tmc dn|^tg-tmc/.test(a.tmc[0]) && a.tmc[0].endsWith('|2') && a.tml.join() === 'Oct 16,Dec 11–18,Jan 29,Feb 26,Mar 31', JSON.stringify(a));
111
+ ok('O open, each product\'s head row is plain: its name cell with the fold, an empty track, no goal dots (batch 13 item 4)', a && b && /pmos-scarlet/.test(a.name) && !a.span && !b.span && !a.tm.length && !a.tmc.length && !a.endl.length && !a.gd, JSON.stringify({ a, b }));
112
+ ok('the open Board threw nothing', !errors.length, errors.join('\n'));
113
+ await ctx.close();
114
+ }
115
+
116
+ /* L H P — folded, desktop, Year */
117
+ {
118
+ const { ctx, page: p, errors } = await open({ fold: ['p:pmos-scarlet', 'p:pmos-idpf'] });
119
+ const a = await laneOf(p, 'p:pmos-scarlet'), b = await laneOf(p, 'p:pmos-idpf');
120
+ ok('L folded, each product\'s head row is a lane: its name cell with the fold, its track with a thin line and its last end', a && b && /pmos-scarlet/.test(a.name) && a.span >= 1 && b.span >= 1 && a.endl.join() === 'Mar ’27', JSON.stringify({ a, b }));
121
+ ok('L the lane rolls up the ◇ tasks and each end ◇ of its initiatives; Dec 11 and Dec 18 merge into one counted ◇; no date under a ◇',
122
+ a && a.tm.length === 4 && a.tmc.length === 1 && /^tg-tmc dn|^tg-tmc/.test(a.tmc[0]) && a.tmc[0].endsWith('|2') && !a.tml.length, JSON.stringify(a));
110
123
  ok('L the same ◇: late is orange, the Evaluate task IS the end ◇ (said once), a plain end ◇ is named Deliver',
111
124
  a && /^tg-tm late\|Design review · Passkey sign-in · Oct 16 · late$/.test(a.tm[0]) && a.tm.some((x) => /KPI evaluated · Scarlet/.test(x)) && a.tm.some((x) => /^tg-tm\|Deliver · Passkey sign-in · Feb 26$/.test(x)) && !a.tm.some((x) => /Committed/.test(x)), JSON.stringify(a && a.tm));
112
125
  ok('H a single ◇\'s hover names the milestone and its initiative', a && a.tm.some((x) => x.endsWith('|Feature delivered · Scarlet — ST What’s The News · Jan 29')), JSON.stringify(a && a.tm));
113
- ok('L the other product\'s lane: Mar 2 and Mar 6 merge; Apr 30 and Jun 30 are the ends', b && b.tmc.length === 1 && b.tml.join() === 'Mar 2–6,Apr 30,Jun 30', JSON.stringify(b));
126
+ ok('L the other product\'s lane: Mar 2 and Mar 6 merge; Apr 30 and Jun 30 are the ends', b && b.tmc.length === 1 && b.tm.length === 2 && b.tm.every((x) => /Apr 30|Jun 30/.test(x)), JSON.stringify(b));
114
127
  const lg = await p.evaluate(() => (document.querySelector('.tg-lgd') || {}).textContent || '');
115
128
  ok('L the legend gets no new entry', !/lane|product/i.test(lg), lg);
116
129
  await shot(p, 'lane-board-1440');
@@ -120,7 +133,7 @@ function model() {
120
133
  await shot(p, 'lane-list-1440');
121
134
  await p.click('.tg-msp [data-ms-ini="board:passkey"]');
122
135
  await p.waitForTimeout(400);
123
- ok('P a line opens its initiative', await p.evaluate(() => !document.querySelector('.tg-msp') && !!document.querySelector('#ibBody [data-row="board:passkey"].sel')));
136
+ ok('P a line opens its initiative', await p.evaluate(() => !document.querySelector('.tg-msp') && (!!document.querySelector('#ibBody [data-row="board:passkey"].sel') || /Passkey sign-in/.test((document.querySelector('.cz-vw-title') || {}).textContent || ''))));
124
137
  ok('the Board threw nothing', !errors.length, errors.join('\n'));
125
138
  await ctx.close();
126
139
  }
@@ -130,18 +143,18 @@ function model() {
130
143
  const { ctx, page: p } = await open({ fold: ['p:pmos-scarlet', 'p:pmos-idpf'] });
131
144
  const a = await laneOf(p, 'p:pmos-scarlet');
132
145
  const rows = await p.evaluate(() => document.querySelectorAll('#ibBody .tg-r[data-row]').length);
133
- ok('F folded, the lane looks the same and the head shows the count', a && a.n === '2' && a.tm.length === 4 && a.tmc.length === 1 && rows === 0, JSON.stringify({ a, rows }));
146
+ ok('F folded, the head shows one dot per initiative off track (Passkey\'s late milestone) and no count', a && a.n === '' && a.dots.length === 1 && /late/.test(a.dots[0]) && rows === 0, JSON.stringify({ a, rows }));
134
147
  await shot(p, 'lane-folded-1440');
135
148
  await ctx.close();
136
149
  }
137
150
 
138
151
  /* S — Quarter and 5 yr */
139
152
  {
140
- const { ctx, page: p } = await open({ span: 'quarter' });
153
+ const { ctx, page: p } = await open({ span: 'quarter', fold: ['p:pmos-scarlet'] });
141
154
  const a = await laneOf(p, 'p:pmos-scarlet');
142
- ok('S Quarter puts a date under every ◇ in view', a && a.tml.length >= 4 && a.tml.every((x) => /^[A-Z][a-z]{2} \d/.test(x)), JSON.stringify(a && a.tml));
155
+ ok('S Quarter puts no date under a ◇: the hover says it (batch 13 item 4)', a && !a.tml.length && (a.tm.length + a.tmc.length) >= 1, JSON.stringify(a));
143
156
  await ctx.close();
144
- const { ctx: c5, page: p5 } = await open({ span: 'y5' });
157
+ const { ctx: c5, page: p5 } = await open({ span: 'y5', fold: ['p:pmos-scarlet'] });
145
158
  const a5 = await laneOf(p5, 'p:pmos-scarlet');
146
159
  ok('S 5 yr draws the ◇s with no dates', a5 && !a5.tml.length && (a5.tm.length + a5.tmc.length) >= 1, JSON.stringify(a5));
147
160
  await c5.close();
@@ -149,13 +162,13 @@ function model() {
149
162
 
150
163
  /* Q — the phone */
151
164
  {
152
- const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true });
165
+ const { ctx, page: p, errors } = await open({ w: 390, h: 844, phone: true, fold: ['p:pmos-scarlet'] });
153
166
  const a = await p.evaluate(() => { const r = document.querySelector('#ibBody .tgq-r.tg-lane[data-lane="p:pmos-scarlet"]'); return r ? { marks: r.querySelectorAll('.tg-tm, .tg-tmc').length, dates: r.querySelectorAll('.tg-tml').length, btn: r.querySelectorAll('.tg-p button').length } : null; });
154
167
  ok('Q the phone draws the lane\'s ◇s with no dates', a && a.marks >= 1 && a.dates === 0 && a.btn === 0, JSON.stringify(a));
155
168
  await p.evaluate(() => { const t = document.querySelector('#ibBody .tgq-r.tg-lane[data-lane="p:pmos-scarlet"] > .tg-p'); t.click(); });
156
169
  await p.waitForTimeout(200);
157
170
  const sh = await p.evaluate(() => { const m = document.querySelector('.tg-msp.sh'); return m ? { h: (m.querySelector('.h') || {}).textContent, lines: [...m.querySelectorAll('[data-ms-ini]')].map((x) => x.querySelector('span').firstChild.textContent + '|' + x.querySelector('.k').textContent) } : null; });
158
- ok('Q a tap on the lane opens a sheet with the product\'s milestones in date order',
171
+ ok('Q a tap on the folded lane opens a sheet with the product\'s milestones in date order',
159
172
  sh && sh.h === 'pmos-scarlet' && sh.lines.join() === 'Design review|Oct 16,Pilot with 2 newsrooms|Dec 11,Security sign-off|Dec 18,Feature delivered|Jan 29,Deliver|Feb 26,KPI evaluated|Mar 31', JSON.stringify(sh));
160
173
  await shot(p, 'lane-phone-390');
161
174
  ok('the phone threw nothing', !errors.length, errors.join('\n'));
@@ -7,7 +7,7 @@
7
7
  * Each one is done at once, with Undo in the toast, which writes the opposite line through the same route.
8
8
  * Cancelled and archived the side panel: All, On hold, Cancelled, Archived, each with Resume, Reopen or Restore
9
9
  * Find, Filter (BdFilter) Find: a jump list of the initiatives and the Jira work-items on this Board. Filter: owner, workflow, category, sprint, applied as
10
- * the PM picks; the "Showing" bar above the view lists what is on (the page's filter state F)
10
+ * the PM picks, and on the timeline which milestones it draws (pm/bd-pin-card.js); the "Showing" bar above the view lists what is on (the page's filter state F)
11
11
  * Sprints and releases (BdSprint) the chip's popover: the Jira sprints, the releases, the backlog; a release opens its panel (work-items done, days
12
12
  * left, the initiatives it carries, your sign-off, the backlog preview). Sprint moves are proposals that go to Home.
13
13
  * A metric's trend (BdPanel) a chip's popover: the count week by week where the records allow it, "Show only …" and Insights
@@ -23,6 +23,7 @@ import * as Pop from './bd-pop.js';
23
23
  import * as V from './bd-views.js';
24
24
  import * as Asks from './bd-asks.js';
25
25
  import * as WF from './bd-wf.js';
26
+ import * as Pins from './bd-pin-card.js';
26
27
  import { holdSpans, holdWords, holdRange, md } from './bd-span.js';
27
28
 
28
29
  const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
@@ -42,7 +43,7 @@ const plural = (n, a, b) => (n === 1 ? a : b);
42
43
  const cap = (s) => (s ? s.charAt(0).toUpperCase() + s.slice(1) : '');
43
44
 
44
45
  let A = null; // the page: { M(), load(), say(msg, undo?), panel(html, from, cls), close(), redraw(), F, rowOf(key), statusOf(r), openIni(r), openTicket(ini, tk), askHref(r, q), pageHref(r), trail(r), docMeta(path, ws), loadDocMeta([{ path, ws }]), viewDoc(path) }
45
- export function init(api) { A = api; }
46
+ export function init(api) { A = api; Pins.init(api); }
46
47
  const M = () => A.M();
47
48
  const post = (p, body) => pmPost(p, { ws: M().board.ws, ...body });
48
49
  const errOf = (r) => (r && r.error) || 'Nothing was recorded. The server did not say why.';
@@ -204,6 +205,7 @@ function filterHtml() {
204
205
  return grp + `<p class="bd-mlbl">Owner</p><div class="bd-fg">${owners.map((o) => chip('owners', o, (o === 'No owner' ? '' : V.avatar(o, 'xs')) + esc(o))).join('')}</div>`
205
206
  + (W.list.length > 1 ? `<p class="bd-mlbl">Workflow</p><div class="bd-fg" role="radiogroup" aria-label="Workflow">${W.list.map((w) => { const on = WF.narrowed(W.list) && W.cur.id === w.id; return `<button type="button" class="bd-chip${on ? ' on' : ''}" role="radio" aria-checked="${on}" data-fwf="${esc(w.id)}">${WF.wfIcon(w, 16)}${esc(w.name)}</button>`; }).join('')}</div>` : '')
206
207
  + (cats.length ? `<p class="bd-mlbl">Category</p><div class="bd-fg">${cats.map((k) => chip('cats', k, esc(WF.catLabel(k)))).join('')}</div>` : '')
208
+ + (A.timeline && A.timeline() ? Pins.filterGroup() : '') // which milestones the timeline draws (batch 13 item 4, XcalmA5Milestones)
207
209
  + (sprints.length && (!A.sprintFilter || A.sprintFilter()) ? `<p class="bd-mlbl">Sprint</p><div class="bd-fg">${sprints.map((s) => chip('sprints', s.name, esc(s.name + (s.now ? ' · now' : '')))).join('')}${chip('sprints', 'Backlog')}</div>` : '')
208
210
  + `<div class="bd-arow bd-ffoot"><button type="button" class="bd-btn sm ghost" data-fclear>Clear</button><span class="bd-amut bd-push">Applies as you pick</span></div>`;
209
211
  }
@@ -410,7 +412,8 @@ document.addEventListener('click', async (e) => {
410
412
  const fl = t.closest('[data-flt]'); if (fl && Pop.isOpen() && Pop.el().contains(fl)) { const S = A.F[fl.dataset.flt], v = fl.dataset.v; if (S.has(v)) S.delete(v); else S.add(v); Pop.redraw(filterHtml()); A.redraw(); return; }
411
413
  const fg = t.closest('[data-fgrp]'); if (fg && Pop.isOpen() && Pop.el().contains(fg)) { A.setGrouping(fg.dataset.fgrp === 'product'); Pop.redraw(filterHtml()); return; }
412
414
  const fw = t.closest('[data-fwf]'); if (fw && Pop.isOpen() && Pop.el().contains(fw)) { WF.setPick(fw.getAttribute('aria-checked') === 'true' ? '' : fw.dataset.fwf); Pop.redraw(filterHtml()); A.redraw(); return; }
413
- if (t.closest('[data-fclear]')) { A.F.owners.clear(); A.F.cats.clear(); A.F.sprints.clear(); WF.setPick(''); Pop.redraw(filterHtml()); A.redraw(); return; }
415
+ const mm = t.closest('[data-msmode]'); if (mm && Pop.isOpen() && Pop.el().contains(mm)) { Pins.pickMode(mm); Pop.redraw(filterHtml()); A.redraw(); const b = Pop.el().querySelector(`[data-msmode="${mm.dataset.msmode}"]`); if (b) b.focus(); return; }
416
+ if (t.closest('[data-fclear]')) { A.F.owners.clear(); A.F.cats.clear(); A.F.sprints.clear(); WF.setPick(''); Pins.pickMode({ dataset: { msmode: 'pinned' } }); Pop.redraw(filterHtml()); A.redraw(); return; }
414
417
  const sp = t.closest('[data-sprint]'); if (sp) { const S = A.F.sprints, v = sp.dataset.sprint; if (S.has(v)) S.delete(v); else { S.clear(); S.add(v); } Pop.close(false); A.say(S.has(v) ? 'Showing the initiatives with work in ' + v + '.' : 'Showing every sprint.'); A.redraw(); return; }
415
418
  const rl = t.closest('[data-rel]'); if (rl) { Pop.close(false); openRelease(+rl.dataset.rel, $('#chSprint')); return; }
416
419
  if (t.closest('[data-backlog]')) { Pop.close(false); openRelease(-1, $('#chSprint'), 'backlog'); return; }