create-pmos 0.701.0 → 0.703.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.701.0",
3
+ "version": "0.703.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -33,6 +33,25 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.703.0",
38
+ "at": "2026-11-22T10:51:01.624Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1528,
43
+ "t": "Lists stay short, 50 rows a step from one shared block (A455)",
44
+ "s": "Lists stay short, 50 rows a step from one shared block (A455)",
45
+ "k": "new"
46
+ },
47
+ {
48
+ "n": 1530,
49
+ "t": "Esc and Stage in Backlog and This sprint; tests for the Gantt parent bar and the bulk stage move",
50
+ "s": "Esc and Stage in Backlog and This sprint; tests for the Gantt parent bar and the bulk stage move",
51
+ "k": "fix"
52
+ }
53
+ ]
54
+ },
36
55
  {
37
56
  "v": "0.701.0",
38
57
  "at": "2026-11-22T10:38:05.886Z",
@@ -429,19 +448,6 @@
429
448
  "k": "new"
430
449
  }
431
450
  ]
432
- },
433
- {
434
- "v": "0.656.0",
435
- "at": "2026-11-22T02:59:28.675Z",
436
- "f": 4,
437
- "prs": [
438
- {
439
- "n": 1440,
440
- "t": "Act alone only with a source, ask the rest once a day",
441
- "s": "Act alone only with a source, ask the rest once a day",
442
- "k": "new"
443
- }
444
- ]
445
451
  }
446
452
  ]
447
453
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@d4082a56
1
+ kernel-source: pmos@fe33d1a2
2
2
  assembled: 2026-11-22
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-11-22T10:38:02Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T10:50:57Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-11-22T10:38:02Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T10:50:57Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-11-22T10:38:02Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T10:50:57Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,23 @@
1
1
  [
2
+ {
3
+ "v": "0.703.0",
4
+ "at": "2026-11-22T10:51:01.624Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1528,
9
+ "t": "Lists stay short, 50 rows a step from one shared block (A455)",
10
+ "s": "Lists stay short, 50 rows a step from one shared block (A455)",
11
+ "k": "new"
12
+ },
13
+ {
14
+ "n": 1530,
15
+ "t": "Esc and Stage in Backlog and This sprint; tests for the Gantt parent bar and the bulk stage move",
16
+ "s": "Esc and Stage in Backlog and This sprint; tests for the Gantt parent bar and the bulk stage move",
17
+ "k": "fix"
18
+ }
19
+ ]
20
+ },
2
21
  {
3
22
  "v": "0.701.0",
4
23
  "at": "2026-11-22T10:38:05.886Z",
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "The Backlog"
4
4
  description: "Every open task of your products in one list, the way Jira lists them, and the tasks PMOS takes and finishes itself."
5
- timestamp: 2026-11-20
5
+ timestamp: 2026-11-22
6
6
  ---
7
7
 
8
8
  # The Backlog
@@ -33,11 +33,11 @@ When no task in the list has a Jira ticket, the **Jira ticket** column does not
33
33
 
34
34
  ## The groups
35
35
 
36
- The groups show in this order. An empty group does not show.
36
+ The groups show in this order. An empty group does not show. An open group shows its first 5 tasks. **Show 50 more of N** under them shows the next 50, and the last press says **Show the other N**. To reach one task without opening the group, use **Find** on the Board: its **Tasks** part searches every task in the Backlog, shown or not.
37
37
 
38
38
  1. **Needs your review.** PMOS finished these tasks and cannot pass them alone.
39
39
  2. **PMOS is working.** You do not need to do anything. The ⋯ menu has **Stop** and **Give to a person**.
40
- 3. **PMOS can take these.** PMOS has what it needs to start. Press ✓ to give one task to PMOS, or ✕ to keep it from PMOS. **Yes to these 5** gives only the rows you can see. After you open the whole group, it says **Yes to all**. After a yes, one line with **Undo** shows.
40
+ 3. **PMOS can take these.** PMOS has what it needs to start. Press ✓ to give one task to PMOS, or ✕ to keep it from PMOS. **Yes to these 5** gives only the rows you can see. After every row of the group shows, it says **Yes to all**. After a yes, one line with **Undo** shows.
41
41
  4. **With people.** A person has the task.
42
42
  5. **Nobody has these.** No person or agent has the task.
43
43
  6. **No home.** The task is in no initiative, for example a Jira ticket of a sprint that no initiative holds. PMOS proposes an initiative only when the ticket's epic is the epic of that initiative. Press ✓ to put the ticket there, or ✕ to refuse the proposal. Jira is not changed.
@@ -21,6 +21,8 @@ In the terminal, `pmos task set <task> --parent <task>` sets the parent, and `--
21
21
 
22
22
  To select tasks, Cmd-click or Ctrl-click each one, or Shift-click to select a range. This works in the Work breakdown's List and Gantt, in Work › Backlog and in This sprint. A bar shows the number of selected tasks. Use it to put the tasks under a parent, move them to a stage, give them to a person, move their dates by a number of days, or mark them done. One **Undo** puts all of them back. Press Esc to clear the selection.
23
23
 
24
+ To move tasks to a stage, select tasks of one initiative. The stages are the stages of that initiative.
25
+
24
26
  PMOS does not change the stage, owner or status of a Jira ticket. It skips these tickets and tells you why.
25
27
 
26
28
  ## Jira tickets in the breakdown
@@ -213,7 +213,7 @@ A Jira date and the planned finish of an initiative get no ✓: PMOS cannot writ
213
213
 
214
214
  ## Library
215
215
 
216
- **Library** in the navigation is a catalogue of everything that was made for your work, from every product: documents, links, meeting notes and prototypes. Each thing is one row: its kind icon, its name, a grey line with its kind, product (when you have two or more), what it is about, who made it and the day, and its state when it is not Final (a Final edition, such as v2, shows no state either). A long group shows its first 40 rows; **Show 40 more** under them shows the next ones. Reports are not here: a report repeats, so it lives in Routine.
216
+ **Library** in the navigation is a catalogue of everything that was made for your work, from every product: documents, links, meeting notes and prototypes. Each thing is one row: its kind icon, its name, a grey line with its kind, product (when you have two or more), what it is about, who made it and the day, and its state when it is not Final (a Final edition, such as v2, shows no state either). A long group shows its first 50 rows; **Show 50 more of N** under them shows the next 50, and the last press says **Show the other N**. Search finds every row, shown or not. Reports are not here: a report repeats, so it lives in Routine.
217
217
 
218
218
  - **Kind** says what the thing is: PRD, Strategic brief, Design brief, Done test, Meeting notes, Prototype, Link · Confluence, and so on. PMOS reads it from the file's `type` first, then from its title ("Brief: …") and its file name. When the title only repeats the kind, the name leaves it out: "Brief: Scarlet lucky draw" shows as "Scarlet lucky draw", Kind Strategic brief.
219
219
  - **About** is the program and the initiative ("Project Ascent › Tender new CIAM"). It is empty when it repeats the name.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.701.0",
3
+ "version": "0.703.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.701.0",
9
+ "version": "0.703.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.701.0",
3
+ "version": "0.703.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",
@@ -25,6 +25,7 @@ import * as WF from './bd-wf.js';
25
25
  import * as Pins from './bd-pin-card.js';
26
26
  import { holdSpans, holdWords, holdRange, md } from './bd-span.js';
27
27
  import { stageName } from './stage-chip.js'; // W1: the one stage
28
+ import { findTasks } from './bd-backlog.js'; // Find's Tasks: every backlog task, drawn or not (lists stay short, A455)
28
29
 
29
30
  const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
30
31
  const I = {
@@ -177,7 +178,7 @@ export function findScope() {
177
178
  return [
178
179
  { label: 'On this Board · Initiatives', rows: h.ini.map((r) => { const s = V.statusLine(r); return { id: r.id || r.key, icon: 'flag', title: r.title, sub: [stageName(r) || r.stage, s.text].filter(Boolean).join(' · '), tag: 'Board', open: () => { const x = A.rowOf(r.key); if (x) A.openIni(x); } }; }) },
179
180
  { label: 'On this Board · Work-items in Jira', rows: h.tk.map(({ k, r }) => ({ icon: 'jira', title: k.key + ' · ' + k.title, sub: [k.blocked ? 'Blocked' : k.status, k.assignee, r.title].filter(Boolean).join(' · '), tag: 'Jira', open: () => A.openTicket(r.key, k.key) })) },
180
- ];
181
+ ].concat(((t) => (t && t.rows.length ? [t] : []))(findTasks(q)));
181
182
  } };
182
183
  }
183
184
  function openFind() { import('./cozy-search.js').then((S) => S.openSearch({ scope: findScope() })); }
@@ -14,6 +14,7 @@
14
14
  * Every write is a route's own (lib/routes-backlog.js, and the Board's task routes for a person, a date, an initiative and Archive) and comes
15
15
  * with Undo where the route has one. The words say PMOS, never the model's name. pm/premium-board.js calls sync() after each read of the board. */
16
16
  import * as BM from './bk-model.js';
17
+ import { inView, nextShown, moreHtml, totalOf, logMore, findRows } from './list-cap.js'; // lists stay short (A455): 5 first, then 50 a press; Find over every task
17
18
  import { productName } from './scope-chip.js'; // the product's display name ("IDPF"), never its folder id
18
19
  import * as SP from './bd-sprint.js';
19
20
  import * as WS from './work-select.js'; // the bulk move with one Undo, shared with the initiative popup and This sprint (WorkBulkDS)
@@ -38,7 +39,7 @@ let DATA = null; // { tasks, modes, readAt, err }
38
39
  let loading = false, lastScope = '', loadedAt = 0;
39
40
  let CHIPS = new Set(), PICK = {}, SORT = 'due';
40
41
  let FOLD = {}; // group key → open (true) | folded (false), as the PM left it
41
- let MORE = new Set(); // the groups whose "N more" was pressed
42
+ let MORE = new Map(); // group key → rows shown after its Show more presses (lists stay short, A455: 5 first, then 50 a press)
42
43
  let SEL = new Set(); // ticked rows: ws|board|id
43
44
  let ANCHOR = ''; // the last row picked in This sprint (Shift-click adds the range from it)
44
45
  let host = null, sw = null;
@@ -273,14 +274,19 @@ function groupHtml(g, cols = COLS) {
273
274
  + `<button type="button" class="bk-lnk" data-spall>Show all ${g.total}</button></div>` + g.rows.map((t) => rowHtml(t, BM.groupOf(t, partB()), cols)).join('');
274
275
  }
275
276
  const open = FOLD[g.k] != null ? FOLD[g.k] : g.open;
276
- const rows = open ? (MORE.has(g.k) ? g.rows : g.rows.slice(0, BM.SHOW)) : [];
277
+ const rows = open ? inView(g.rows, MORE.get(g.k) || BM.SHOW) : [];
277
278
  // Yes acts on the rows in view, never blind (design check 1 a): "Yes to these 5" while the group is cut to 5, "Yes to all 31" once open
278
279
  const can = yesRows(g, rows), whole = rows.length === g.rows.length;
279
280
  const yes = can.length ? `<button type="button" class="bk-yes" data-bkyes="${g.k}">${SPARK} ${whole ? (can.length === 1 ? 'Yes to this one' : 'Yes to all ' + can.length) : 'Yes to these ' + can.length}</button>` : '';
280
- const more = open && g.rows.length > rows.length ? `<button type="button" class="bk-r bk-more" data-bkmore="${g.k}">${SV(I.chev)}${g.rows.length - rows.length} more</button>` : '';
281
+ const more = open ? moreHtml({ attr: 'data-bkmore', key: g.k, left: g.rows.length - rows.length, total: g.rows.length, cls: 'bk-r bk-more', icon: SV(I.chev) }) : '';
281
282
  return `<div class="bk-r bk-g${open ? ' open' : ''}" role="row"><button type="button" class="bk-gt" data-bkfold="${g.k}" aria-expanded="${open}">${SV(open ? I.down : I.chev)}<b>${esc(g.n)}</b><span class="k">${g.rows.length}</span>${g.sub ? `<small>· ${esc(g.sub)}</small>` : ''}</button>${yes}</div>`
282
283
  + rows.map((t) => rowHtml(t, g.k, cols)).join('') + more;
283
284
  }
285
+ /** One Show more press on group button m: the group shows 50 more rows (list-cap.js), never past its size. */
286
+ function stepMore(more, m) {
287
+ const k = m.dataset.bkmore, total = totalOf(m), n = nextShown(more.get(k) || BM.SHOW, total);
288
+ more.set(k, n); logMore('backlog:' + k, n, total);
289
+ }
284
290
  /** The rows of group g that a Yes acts on: the eligible rows in view. */
285
291
  function yesRows(g, rows) {
286
292
  if (g.k === 'take') return rows.filter((t) => t.take && !t.declined);
@@ -338,7 +344,7 @@ function drawBar() {
338
344
  if (!n || !on()) { if (bar) { bar.remove(); bar = null; } return; }
339
345
  if (!bar) { bar = document.createElement('div'); bar.className = 'bk-bar'; bar.setAttribute('role', 'toolbar'); bar.setAttribute('aria-label', 'Ticked tasks'); document.body.appendChild(bar); bar.addEventListener('click', barPress); }
340
346
  bar.innerHTML = `<span class="c">${n} selected</span><button type="button" class="pm" data-bkb="give">${SPARK} Give to PMOS</button><button type="button" data-bkb="person">Give to a person</button>`
341
- + `<button type="button" data-bkb="ini">Move to initiative</button><button type="button" data-bkb="parent">Under a parent</button><button type="button" data-bkb="date">Set date</button><button type="button" data-bkb="shift">Move dates</button>`
347
+ + `<button type="button" data-bkb="ini">Move to initiative</button><button type="button" data-bkb="parent">Under a parent</button><button type="button" data-bkb="section">Stage</button><button type="button" data-bkb="date">Set date</button><button type="button" data-bkb="shift">Move dates</button>`
342
348
  + `<button type="button" data-bkb="done">Done</button><button type="button" data-bkb="archive">Archive</button>`
343
349
  + `<button type="button" class="x" data-bkb="clear" aria-label="Clear the ticks" title="Clear">${SV(I.x)}</button>`;
344
350
  }
@@ -360,6 +366,16 @@ async function barPress(e) {
360
366
  pickPop(b, 'Under a parent', [['', 'Top level (no parent)']].concat(L), async (v) => { const p = v ? DATA.tasks.find((t) => uidOf(t) === v) : null; await bulkMany(T, 'parent', p ? p.id : '', p ? p.title : 'the top level'); });
361
367
  return;
362
368
  }
369
+ if (k === 'section') {
370
+ // the bulk move to a stage (WorkBulkDS): the stages of the one initiative the picked tasks share; Jira tickets keep the stage Jira gives them
371
+ const inis = new Set(T.map((t) => t.ini || '')), ini = [...inis][0], t0 = T[0];
372
+ if (inis.size !== 1 || !ini) { AP().say('Pick tasks of one initiative to move them to a stage.'); return; }
373
+ let st = [];
374
+ try { const r = await (await fetch('/api/boards/items?ws=' + encodeURIComponent(t0.ws) + '&board=' + encodeURIComponent(t0.board), { credentials: 'same-origin' })).json(); st = (((r && r.initiatives) || []).find((x) => x.id === ini) || {}).stages || []; } catch { st = []; }
375
+ if (!st.length) { AP().say('This initiative has no stages to move tasks to.'); return; }
376
+ pickPop(b, 'Stage', [['', 'Not in a stage']].concat(st.map((x) => [x.key, x.name])), async (v) => { const x = st.find((y) => y.key === v); await bulkMany(T, 'section', v, x ? x.name : 'no stage'); });
377
+ return;
378
+ }
363
379
  if (k === 'shift') { pickPop(b, 'Move dates', [['-7', '1 week earlier'], ['-1', '1 day earlier'], ['1', '1 day later'], ['7', '1 week later']], async (v) => { const n = WS.shiftOf(v); if (n != null) await bulkMany(T, 'shift', n); }, { free: 'Days: +3, -2, 1w' }); return; }
364
380
  if (k === 'done') { await bulkMany(T, 'done', null); }
365
381
  }
@@ -565,13 +581,13 @@ async function press(e, emb) {
565
581
  if (t0.closest('[data-bksaid]')) { const u = SAID && SAID.undo; SAID = null; draw(); if (u) await u(); return; }
566
582
  const f = t0.closest('[data-bkfold]');
567
583
  if (f) { const k = f.dataset.bkfold; FOLD[k] = f.getAttribute('aria-expanded') !== 'true'; savePrefs(); draw(); const n = host.querySelector(`[data-bkfold="${k}"]`); if (n) n.focus(); return; }
568
- const m = t0.closest('[data-bkmore]'); if (m) { MORE.add(m.dataset.bkmore); draw(); return; }
584
+ const m = t0.closest('[data-bkmore]'); if (m) { stepMore(MORE, m); draw(); return; }
569
585
  const ck = t0.closest('[data-bkck]'); if (ck) { if (ck.checked) SEL.add(ck.dataset.bkck); else SEL.delete(ck.dataset.bkck); const r = ck.closest('.bk-i'); if (r) r.classList.toggle('sel', ck.checked); drawBar(); return; }
570
586
  const yes = t0.closest('[data-bkyes]');
571
587
  if (yes) {
572
588
  const G = (emb ? BM.groupsOf(SC.tasks(), { partB: partB() }) : BM.groupsOf(DATA.tasks, { chips: CHIPS, pick: PICK, sort: SORT, partB: partB() })).find((g) => g.k === yes.dataset.bkyes);
573
589
  if (!G) return;
574
- const L = yesRows(G, (emb ? emb.more : MORE).has(G.k) ? G.rows : G.rows.slice(0, BM.SHOW));
590
+ const L = yesRows(G, inView(G.rows, (emb ? emb.more : MORE).get(G.k) || BM.SHOW));
575
591
  if (G.k === 'take') await giveTo(L, true);
576
592
  else await placeAll(L, true);
577
593
  return;
@@ -634,26 +650,34 @@ function kindsPop(at) {
634
650
 
635
651
  /* ── one list, two places (design check 2): the initiative popup draws an initiative's tasks with this same code ───────────────────────────
636
652
  * listHtml(tasks, o) → the HTML of the grouped list: the same groups, rows, states and actions as the Backlog. o: { ini: an initiative id
637
- * (only its tasks), cols: a subset of COLS in order (the popup leaves out 'ini'), fold: { group: open? }, more: Set of groups shown whole,
653
+ * (only its tasks), cols: a subset of COLS in order (the popup leaves out 'ini'), fold: { group: open? }, more: Map group → rows shown,
638
654
  * partB }. bindList(el, api, tasks) wires the presses inside el (open, Give to PMOS ✓ ✕, Review, ⋯ Stop / Give to a person, Undo, fold,
639
655
  * N more, Yes) through api: { post(path, body) → json, say(msg, undo?), openTask(task, from), reload() } and tasks() → the current task
640
656
  * list (the rows of GET /api/backlog). After a press it calls api.reload(); the page reads again and draws listHtml anew. No tick boxes
641
657
  * and no bar in an embedded list: ticking is the Backlog's. */
658
+ /** Board Find over EVERY backlog task, drawn or not (lists stay short, A455): → { label, rows } for cozy-search's scope, or null when
659
+ * the Backlog has not read its tasks. A row opens the task as a press on its name would. */
660
+ export function findTasks(q, max = 6) {
661
+ const all = DATA && Array.isArray(DATA.tasks) ? DATA.tasks : null;
662
+ if (!all) return null;
663
+ const hits = findRows(all, q, (t) => [t.title, t.key, t.epic, t.who], max);
664
+ return { label: 'On this Board · Tasks', rows: hits.map((t) => ({ icon: t.src === 'jira' ? 'jira' : 'check', title: (t.key ? t.key + ' · ' : '') + t.title, sub: [t.who, t.due ? dueText(t.due) : ''].filter(Boolean).join(' · '), tag: 'Backlog', open: () => AP().openTask(t, null) })) };
665
+ }
642
666
  export function listHtml(tasks, o = {}) {
643
667
  const cols = colsOf(tasks || [], (Array.isArray(o.cols) ? o.cols : COLS).filter((c) => COL[c]));
644
668
  const G = BM.groupsOf(tasks || [], { ini: o.ini, sort: o.sort || 'due', partB: o.partB !== false });
645
669
  const keep = FOLD, more = MORE;
646
- FOLD = o.fold || {}; MORE = o.more || new Set();
670
+ FOLD = o.fold || {}; MORE = o.more instanceof Map ? o.more : new Map();
647
671
  try {
648
672
  const body = G.map((g) => groupHtml(g, cols)).join('');
649
673
  return body ? `<div class="bk bk-emb" role="table" aria-label="Tasks" style="--bk-cols: ${colsCss(cols)}">${headHtml(cols)}${body}</div>` : '';
650
674
  } finally { FOLD = keep; MORE = more; }
651
675
  }
652
676
  export function bindList(el, api, tasks) {
653
- const fold = {}, more = new Set();
677
+ const fold = {}, more = new Map();
654
678
  el.addEventListener('click', async (e) => {
655
679
  const f = e.target.closest('[data-bkfold]'), m = e.target.closest('[data-bkmore]');
656
- if (f || m) { if (f) fold[f.dataset.bkfold] = f.getAttribute('aria-expanded') !== 'true'; else more.add(m.dataset.bkmore); el.dispatchEvent(new CustomEvent('bk:redraw', { detail: { fold, more } })); return; }
680
+ if (f || m) { if (f) fold[f.dataset.bkfold] = f.getAttribute('aria-expanded') !== 'true'; else stepMore(more, m); el.dispatchEvent(new CustomEvent('bk:redraw', { detail: { fold, more } })); return; }
657
681
  if (e.target.closest('[data-bkck],[data-bkchip],[data-bkmode],[data-bkall],[data-bksaid]')) return;
658
682
  SC = { api, tasks }; LASTAPI = api;
659
683
  try { await press(e, { fold, more }); } finally { SC = null; }
@@ -698,6 +722,11 @@ export function sync(api) {
698
722
  const fb = document.getElementById('bdFilter');
699
723
  if (fb) fb.addEventListener('click', (e) => { if (!on() || !DATA) return; e.stopImmediatePropagation(); e.preventDefault(); if (pop && pop.classList.contains('bk-tune')) closePop(); else tune(fb); }, true);
700
724
  document.addEventListener('click', (e) => { if (pop && !pop.contains(e.target) && !e.target.closest('[data-bkb],#bdFilter,[data-bkmenu],[data-bkmode]')) closePop(); });
725
+ // Esc clears the picked rows in Backlog and This sprint (WorkBulkDS), as the bar's × does; an open pop list or a text field keeps its own Esc
726
+ document.addEventListener('keydown', (e) => {
727
+ if (e.key !== 'Escape' || e.defaultPrevented || !SEL.size || !on() || pop || (e.target && e.target.closest && e.target.closest('input, textarea, select, [role="dialog"]'))) return;
728
+ SEL.clear(); ANCHOR = ''; draw();
729
+ });
701
730
  }
702
731
  apply();
703
732
  if (on() && DATA && Date.now() - loadedAt > 3000) load();
@@ -212,10 +212,11 @@ const xOf = (W) => { const a = Date.parse(W.span.a), b = Date.parse(W.span.b); r
212
212
  function barHtml(x, W) {
213
213
  const X = xOf(W);
214
214
  if (x.kind === 'stage') return x.start || x.end ? CB.stageBar({ start: x.start, end: x.end, tone: x.tone, late: x.late, ms: x.ms, name: x.name, gaps: x.gaps, marks: x.open ? [] : x.marks }, X, { today: W.today }) : '';
215
- // a parent (WorkSubtasksDS): one outlined bar from its earliest subtask start to its latest end, filled as its subtasks finish
215
+ // a parent (WorkSubtasksDS): one outlined bar from its earliest subtask start to the end of its latest subtask's last day (as a task bar
216
+ // ends), filled as its subtasks finish
216
217
  if (x.kids) {
217
218
  if (!x.start && !x.end) return '';
218
- const l = Math.max(0, X(x.start || x.end)), r = Math.min(100, X(x.end || x.start) + 0.6), f = x.nLeaf ? Math.round((x.nDone / x.nLeaf) * 100) : 0;
219
+ const l = Math.max(0, X(x.start || x.end)), r = Math.min(100, X(new Date(Date.parse(String(x.end || x.start).slice(0, 10)) + 864e5).toISOString())), f = x.nLeaf ? Math.round((x.nDone / x.nLeaf) * 100) : 0;
219
220
  return `<i class="pw-pbar${x.done ? ' dn' : ''}" style="left:${l.toFixed(2)}%;width:${Math.max(0.8, r - l).toFixed(2)}%" title="${esc(x.title + ': ' + x.count)}"><b style="width:${f}%"></b></i>`;
220
221
  }
221
222
  return CB.taskBar(x, X, W.today);
@@ -0,0 +1,51 @@
1
+ /* list-cap.js — lists stay short (initiative lists-stay-short, bet A455).
2
+ *
3
+ * One shared block for every long list in the workspace: a list draws a short summary first, then STEP rows
4
+ * a press, and search reaches every row whether it is drawn or not. Any product, any list; no state of its own
5
+ * (the page keeps how many rows each list shows, the block says what the next press draws and how to say it).
6
+ *
7
+ * STEP rows one press draws (and the first draw of a list with no summary)
8
+ * inView(rows, shown = STEP) → the rows in view
9
+ * nextShown(shown, total) → how many rows show after one more press (never past total)
10
+ * moreLabel(left) → "Show 50 more of N" | "Show the other N" | ''
11
+ * moreHtml({ attr, key, left, total, cls, icon }) → the button, or '' when nothing is left; total (the list's size) rides on
12
+ * data-lc-total, so a press knows when to stop without reading the list again
13
+ * findRows(rows, q, textsOf, max) → the rows whose texts hold q (any case), over ALL rows
14
+ * logMore(list, shown, total) one [list-cap] debug line per press (the health log)
15
+ */
16
+ export const STEP = 50;
17
+
18
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
19
+
20
+ export const inView = (rows, shown = STEP) => (rows || []).slice(0, Math.max(0, shown));
21
+
22
+ export const nextShown = (shown, total) => Math.min(Math.max(0, total), Math.max(0, shown) + STEP);
23
+
24
+ export function moreLabel(left) {
25
+ if (!(left > 0)) return '';
26
+ return left > STEP ? `Show ${STEP} more of ${left}` : `Show the other ${left}`;
27
+ }
28
+
29
+ export function moreHtml({ attr, key, left, total, cls = '', icon = '' } = {}) {
30
+ const label = moreLabel(left);
31
+ if (!label) return '';
32
+ const n = Number.isFinite(total) ? ` data-lc-total="${total}"` : '';
33
+ return `<button type="button"${cls ? ` class="${esc(cls)}"` : ''} ${attr}="${esc(key)}"${n}>${icon}${esc(label)}</button>`;
34
+ }
35
+
36
+ export function findRows(rows, q, textsOf, max = Infinity) {
37
+ const s = String(q || '').trim().toLowerCase();
38
+ if (!s) return [];
39
+ const out = [];
40
+ for (const r of rows || []) {
41
+ if ((textsOf(r) || []).some((t) => t != null && String(t).toLowerCase().includes(s))) { out.push(r); if (out.length >= max) break; }
42
+ }
43
+ return out;
44
+ }
45
+
46
+ /** The list's size from a pressed button's data-lc-total (Infinity when it has none: the next draw stops at the end anyway). */
47
+ export const totalOf = (btn) => { const n = Number(btn && btn.dataset ? btn.dataset.lcTotal : NaN); return Number.isFinite(n) ? n : Infinity; };
48
+
49
+ export function logMore(list, shown, total) {
50
+ try { console.debug('[list-cap]', list, shown, total); } catch { /* no console */ }
51
+ }
@@ -27,6 +27,7 @@ import * as SC from './scope-chip.js';
27
27
  const { scopeChipHtml, openScope, matches: scopeMatches, narrowed, scopeWords, whenNames } = SC;
28
28
  import { FAMILIES, GROUPS, STATES, view, counts, passes, matches, aboutText, stateText, dayText, when, noteOf, hiddenText } from './library-model.js';
29
29
  import { openItem } from './library-open.js';
30
+ import { STEP, nextShown, moreHtml, totalOf, logMore } from './list-cap.js'; // lists stay short (A455): one step for every long list
30
31
 
31
32
  const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
32
33
  const svg = (d, cls = '') => `<svg class="pm-ic${cls ? ' ' + cls : ''}" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
@@ -42,7 +43,6 @@ const CHEV_D = 'M6 9l6 6 6-6', CHEV_R = 'M9 6l6 6-6 6', TICK = 'M5 12.5l4.5 4.5L
42
43
  const SPARK = 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z', OPEN = 'M14 4h6v6M20 4l-9 9M18 14v5H5V6h5';
43
44
  const store = { get(k) { try { return JSON.parse(localStorage.getItem(k) || 'null'); } catch { return null; } }, set(k, v) { try { localStorage.setItem(k, JSON.stringify(v)); } catch { /* a private window */ } } };
44
45
  const saved = store.get('pmos.lib.view') || {};
45
- const CAP = 40; // rows a group draws before Show more (A435)
46
46
  const S = {
47
47
  items: null, programs: [], error: '', at: 0, q: '', P: null, sel: { programs: [], projects: [] },
48
48
  kinds: Array.isArray(saved.kinds) ? saved.kinds : [], states: Array.isArray(saved.states) ? saved.states : [],
@@ -242,7 +242,7 @@ function rowsHtml(groups) {
242
242
  } else if (!flat) h += `<div class="pm-group" role="presentation">${esc(g.label)}${S.group === 'work' ? ` <em>${g.n}</em>` : ''}</div>`;
243
243
  const shelf = g.level === 2 && g.key !== 'w:none' ? g.label : '';
244
244
  let rows = '', n = 0;
245
- const key = g.key || g.label, cap = S.more.get(key) || CAP, all = g.rows.filter((r) => !r.checks).length;
245
+ const key = g.key || g.label, cap = S.more.get(key) || STEP, all = g.rows.filter((r) => !r.checks).length;
246
246
  for (const r of g.rows) {
247
247
  if (r.checks) { rows += checksHtml(r); continue; }
248
248
  if (n++ >= cap) continue; // a long shelf draws its first rows; Show more draws the next ones (the real Library holds 1,000+ rows)
@@ -250,7 +250,7 @@ function rowsHtml(groups) {
250
250
  if (r.older.length && S.ed.has(r.x.id)) for (const o of r.older) { rows += rowHtml({ x: o, older: [] }, S.shown.length, true, shelf); S.shown.push(o); }
251
251
  }
252
252
  const left = all - cap;
253
- if (left > 0) rows += `<button type="button" class="pm-chip lb-more" data-lb-more="${esc(key)}">${esc(left > CAP ? 'Show ' + CAP + ' more of ' + left : 'Show the other ' + left)}</button>`;
253
+ rows += moreHtml({ attr: 'data-lb-more', key, left, total: all, cls: 'pm-chip lb-more' });
254
254
  h += `<div class="rows" role="list">${rows}</div>`;
255
255
  }
256
256
  return h;
@@ -424,7 +424,7 @@ body.onclick = async (e) => {
424
424
  if (folded) { S.open.add(k); S.shut.delete(k); } else { S.shut.add(k); S.open.delete(k); }
425
425
  draw(); return;
426
426
  }
427
- if ((b = t.closest('[data-lb-more]'))) { const k = b.dataset.lbMore; S.more.set(k, (S.more.get(k) || CAP) + CAP); draw(); return; }
427
+ if ((b = t.closest('[data-lb-more]'))) { const k = b.dataset.lbMore, total = totalOf(b), n = nextShown(S.more.get(k) || STEP, total); S.more.set(k, n); logMore('library', n, total); draw(); return; }
428
428
  if ((b = t.closest('[data-lb-ed]'))) { const k = b.dataset.lbEd; if (S.ed.has(k)) S.ed.delete(k); else S.ed.add(k); draw(); return; }
429
429
  if ((b = t.closest('[data-lb-ck]'))) { const k = b.dataset.lbCk; if (S.ck.has(k)) S.ck.delete(k); else S.ck.add(k); draw(); return; }
430
430
  if ((b = t.closest('[data-lb-name]'))) { S.naming = b.dataset.lbName; draw(); return; }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "Lists stay short (initiative lists-stay-short, bet A455, done test L1-L8): the shared 50-row step, its label and search over all rows, and that the Library, the Backlog and the Board's Find use it. No server, browser, model or network.",
3
+ "modules": [
4
+ "list-cap.test.js"
5
+ ],
6
+ "seconds": {
7
+ "list-cap.test.js": 1
8
+ }
9
+ }