create-pmos 0.425.0 → 0.427.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 (75) hide show
  1. package/package.json +25 -25
  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 +24 -0
  12. package/workspace/ev-everywhere-test.js +3 -1
  13. package/workspace/guide/claude-proposes.md +19 -2
  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/context-use.js +54 -0
  18. package/workspace/lib/engine/boards.js +8 -2
  19. package/workspace/lib/idle-close.js +60 -0
  20. package/workspace/lib/loose-proposals.js +302 -0
  21. package/workspace/lib/my-work-premium.js +1 -1
  22. package/workspace/lib/proposal-runs.js +77 -2
  23. package/workspace/lib/propose-cli.js +42 -1
  24. package/workspace/lib/route-modules.js +1 -0
  25. package/workspace/lib/routes-boards.js +16 -4
  26. package/workspace/lib/routes-brief-page.js +9 -1
  27. package/workspace/lib/routes-live.js +3 -1
  28. package/workspace/lib/routes-loose.js +210 -0
  29. package/workspace/lib/routes-pm-items.js +27 -17
  30. package/workspace/lib/task-cli.js +18 -11
  31. package/workspace/lib/transcript-read.js +9 -2
  32. package/workspace/milestone-pins-test.js +170 -0
  33. package/workspace/package-lock.json +2 -2
  34. package/workspace/package.json +1 -1
  35. package/workspace/premium-board-actions-test.js +2 -1
  36. package/workspace/premium-briefing-depth-test.js +1 -1
  37. package/workspace/premium-chat-term-test.js +13 -2
  38. package/workspace/premium-core-doc-issue-test.js +1 -1
  39. package/workspace/product-lane-test.js +30 -17
  40. package/workspace/public/pm/bd-acts.js +6 -3
  41. package/workspace/public/pm/bd-deliveries.js +218 -0
  42. package/workspace/public/pm/bd-pin-card.css +16 -0
  43. package/workspace/public/pm/bd-pin-card.js +80 -0
  44. package/workspace/public/pm/bd-pins.js +33 -0
  45. package/workspace/public/pm/bd-pop.js +2 -0
  46. package/workspace/public/pm/bd-prog.js +5 -4
  47. package/workspace/public/pm/bd-span.js +140 -102
  48. package/workspace/public/pm/cozy-board.css +73 -11
  49. package/workspace/public/pm/cozy-home.css +23 -1
  50. package/workspace/public/pm/cozy-live-pill.css +1 -0
  51. package/workspace/public/pm/cozy-live-pill.js +2 -1
  52. package/workspace/public/pm/cozy-today.css +7 -0
  53. package/workspace/public/pm/cozy.css +6 -0
  54. package/workspace/public/pm/ctx-wedge.js +45 -0
  55. package/workspace/public/pm/home-app.js +29 -2
  56. package/workspace/public/pm/home-chat.js +7 -2
  57. package/workspace/public/pm/home-data.js +6 -3
  58. package/workspace/public/pm/home-list.js +46 -5
  59. package/workspace/public/pm/home-today.js +22 -6
  60. package/workspace/public/pm/ini-tasks.js +4 -1
  61. package/workspace/public/pm/live-model.js +1 -1
  62. package/workspace/public/pm/loose-props.css +54 -0
  63. package/workspace/public/pm/loose-props.js +262 -0
  64. package/workspace/public/pm/premium-board.js +9 -5
  65. package/workspace/public/pm/term-view.js +81 -10
  66. package/workspace/public/premium-board.html +1 -0
  67. package/workspace/server.js +135 -6
  68. package/workspace/skills/loose-propose.skill +39 -0
  69. package/workspace/task-milestones-test.js +15 -6
  70. package/workspace/test-lists/batch13-context-use.json +5 -0
  71. package/workspace/test-lists/board-deliveries.json +13 -0
  72. package/workspace/test-lists/calm-timeline.json +5 -0
  73. package/workspace/test-lists/loose-props.json +9 -0
  74. package/workspace/test-lists/milestone-pins.json +6 -0
  75. package/workspace/timeline-holds-test.js +44 -42
@@ -364,7 +364,8 @@ body.bd-page[data-bd-view="time"] #cIni:not([hidden]) { flex: 1; display: flex;
364
364
  button.tg-n { cursor: pointer; }
365
365
  button.tg-n:hover b { color: var(--cz-blueink); }
366
366
  .tg-n:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: -2px; border-radius: 8px; }
367
- .tg-n b { font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 7px; }
367
+ .tg-n b { font-size: 13.5px; font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.3; overflow-wrap: anywhere; } /* names wrap to two lines, never cut (batch 13 item 4) */
368
+ .tg-n b .bd-pgi { display: inline-flex; vertical-align: -2px; margin-right: 6px; }
368
369
  .tg-n small { font-size: 12px; color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
369
370
  .tg-h .tg-n b { font-size: 12.5px; color: var(--cz-ink2); }
370
371
  .tg-h .tg-n small { font-size: 11px; font-weight: 700; }
@@ -379,14 +380,18 @@ button.tg-n:hover b { color: var(--cz-blueink); }
379
380
  .tg-td { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--cz-ink); opacity: .75; z-index: 2; }
380
381
  .tg-bar { position: absolute; top: 50%; height: 12px; margin-top: -6px; border-radius: 6px; background: var(--bd-plan); z-index: 1; overflow: visible; }
381
382
  .tg-bar > b { display: block; height: 100%; border-radius: 6px; background: var(--bd-done); }
382
- .tg-bar.t-risk { background: color-mix(in srgb, var(--cz-dot-risk) 30%, var(--cz-card)); }
383
- .tg-bar.t-you { background: color-mix(in srgb, var(--cz-blue) 22%, var(--cz-card)); }
384
383
  /* the committed end (PgTimeline .tdm): an open ◇ for Deliver or Evaluate, its date right of it; filled blue while the initiative is at it */
385
- .tg-end { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; transform: rotate(45deg); border-radius: 2px; background: var(--cz-card); border: 2px solid var(--bd-done); box-sizing: border-box; z-index: 2; }
386
- .tg-end.ms { background: var(--cz-blue); border-color: var(--cz-blue); }
384
+ .tg-end { appearance: none; padding: 0; position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; transform: rotate(45deg); border-radius: 2px; background: var(--cz-card); border: 2px solid var(--bd-done); box-sizing: border-box; z-index: 2; cursor: pointer; }
385
+ .tg-end::before { content: ''; position: absolute; inset: -8px; }
386
+ .tg-end:focus-visible, .tg-tm:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 3px; }
387
387
  .tg-end.late { border-color: var(--cz-dot-late); }
388
- .tg-endl { position: absolute; top: 50%; transform: translate(11px, -50%); font-size: 11.5px; font-weight: 700; color: var(--cz-ink2); white-space: nowrap; z-index: 3; }
389
- .tg-endl.l { transform: translate(calc(-100% - 11px), -50%); }
388
+ /* the one label at a bar's end (batch 13 item 4, XcalmA1Desk): what lands, then when; the date alone carries the tone */
389
+ .tg-endl { position: absolute; top: 50%; transform: translate(11px, -50%); font-size: 12px; font-weight: 700; color: var(--cz-ink); white-space: nowrap; z-index: 3; line-height: 18px; }
390
+ .tg-endl > b { font-weight: 700; color: var(--cz-ink3); }
391
+ .tg-endl > b.risk { color: var(--cz-risk); }
392
+ .tg-endl > b.late { color: var(--cz-late); }
393
+ .tg-endl > b.q { color: var(--cz-ink3); }
394
+ .tg-endl.l { transform: translate(calc(-100% - 11px), -50%); background: var(--cz-card); padding: 0 7px; border-radius: 6px; box-shadow: 0 0 0 1px var(--cz-hair); }
390
395
  .tg-over { position: absolute; top: 50%; height: 12px; margin-top: -6px; border-radius: 6px; background: repeating-linear-gradient(135deg, var(--cz-c-f0a27a) 0 4px, var(--cz-c-fbdccb) 4px 8px); z-index: 1; }
391
396
  .tg-fc { position: absolute; top: 50%; height: 12px; margin-top: -6px; border-radius: 6px; border: 1.5px dashed var(--cz-dot-late); box-sizing: border-box; z-index: 1; }
392
397
  .tg-fc.solo { border-color: var(--cz-blue); }
@@ -432,7 +437,6 @@ button.tg-n:hover b { color: var(--cz-blueink); }
432
437
  .tg-s .tg-p { overflow: visible; }
433
438
  .tg-s .tg-body .tg-p { overflow: hidden; }
434
439
  .tg-s .tg-bar { cursor: pointer; }
435
- .tg-out { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(42,46,53,.04) 6px 12px); }
436
440
  .tg-s .tg-h .tg-p span.pin { color: var(--cz-ink3); }
437
441
  .tg-s .tg-h .tg-p span.pin b { color: var(--cz-ink3); }
438
442
  /* Today: the pill on the line in view; off screen the back button beside "Initiative" with its arrow pointing the way (TsCDesk, TsCGrill 4) */
@@ -475,7 +479,7 @@ button.tg-n:hover b { color: var(--cz-blueink); }
475
479
  .tgq-r.sel { background: var(--cz-bluebg); }
476
480
  .tgq-r.tg-pg { background: var(--bd-progbg); }
477
481
  .tgq-n { all: unset; box-sizing: border-box; position: sticky; left: 0; z-index: 4; display: inline-flex; align-items: center; gap: 6px; max-width: var(--vw, 100%); padding: 2px 10px; font-size: 13px; cursor: pointer; }
478
- .tgq-n b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
482
+ .tgq-n b { font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.3; }
479
483
  .tgq-n:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: -2px; border-radius: 8px; }
480
484
  .tgq-n.tg-pgn { display: flex; width: var(--vw, 100%); cursor: default; padding: 4px 6px 2px 10px; }
481
485
  .tgq-r .tg-p { position: relative; height: 22px; min-height: 0; overflow: hidden; }
@@ -488,6 +492,56 @@ button.tg-n:hover b { color: var(--cz-blueink); }
488
492
  .tg-rel { display: inline-flex; align-items: center; gap: 4px; color: var(--cz-blueink); }
489
493
  .tg-note { margin: 6px 0 0; font-size: 11.5px; color: var(--cz-ink3); }
490
494
 
495
+ /* ── the Deliveries lane (batch 13 item 4, calmer timeline A6: XcalmA6Lane, XcalmA6Fold, XcalmA6Phone; pm/bd-deliveries.js) ──
496
+ one row under the axis: a list per column, the date then the name; missed orange, at risk amber, on hold grey; the current column a faint wash.
497
+ Hover an entry: its row gets a wash and its ◇ a ring. Folded: one line. A phone: the next 3 in a card above the rows. */
498
+ .tg-dl { min-height: 0; }
499
+ .tg-dl .dl-n { flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 10px; padding-top: 10px; }
500
+ .tg-dl.shut .dl-n { align-items: center; padding-top: 8px; }
501
+ .dl-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--cz-well); display: grid; place-items: center; color: var(--cz-ink2); }
502
+ .dl-ic svg, .dl-fb svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
503
+ .dl-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
504
+ .dl-t b { font-size: 13.5px; font-weight: 800; }
505
+ .dl-t small { font-size: 12px; color: var(--cz-ink3); }
506
+ .dl-fb { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--cz-ink3); }
507
+ .dl-fb:hover { background: var(--cz-well); color: var(--cz-ink); }
508
+ .dl-fb:focus-visible, .dl-e:focus-visible, .dl-more:focus-visible, .dl-dn:focus-visible, .dl-fn:focus-visible, .dl-pl:focus-visible, .dl-all:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; border-radius: 8px; }
509
+ .dl-p { display: flex; align-items: stretch; min-height: 0; }
510
+ .dl-c { flex: none; box-sizing: border-box; min-width: 0; padding: 16px 6px 10px 8px; border-left: 1px solid var(--cz-hair); display: flex; flex-direction: column; gap: 4px; }
511
+ .dl-c:first-child { border-left: 0; }
512
+ .dl-c.now { background: color-mix(in srgb, var(--cz-blue) 6%, transparent); }
513
+ .dl-e, .dl-pl, .dl-fn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 3px 6px; margin: 0 -6px; border-radius: 8px; }
514
+ .dl-e:hover, .dl-pl:hover { background: var(--cz-well); }
515
+ .dl-e small, .dl-pl small, .dl-fn small { font-size: 11.5px; font-weight: 800; color: var(--cz-ink3); white-space: nowrap; }
516
+ .dl-e b { font-size: 12.5px; font-weight: 700; color: var(--cz-ink); line-height: 1.3; display: flex; gap: 4px; align-items: flex-start; min-width: 0; }
517
+ .dl-e b span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
518
+ .dl-pg { flex: none; display: inline-grid; place-items: center; color: var(--bd-prog); margin-top: 1px; }
519
+ .dl-pg svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
520
+ .dl-e.late small, .dl-ph .late, .dl-fold .late, .dl-fn small.late, .dl-pl small.late { color: var(--cz-late); }
521
+ .dl-e.risk small, .dl-fn small.risk, .dl-pl small.risk { color: var(--cz-risk); }
522
+ .dl-e.hold small, .dl-fn small.hold, .dl-pl small.hold { color: var(--cz-ink3); font-weight: 600; }
523
+ .dl-e.fc small, .dl-fn small.fc, .dl-pl small.fc { color: var(--cz-blueink); }
524
+ .dl-e.dn small { color: var(--cz-ok); } .dl-e.dn b { color: var(--cz-ink3); }
525
+ .dl-more, .dl-dn, .dl-all { all: unset; box-sizing: border-box; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--cz-ink3); padding: 2px 0; }
526
+ .dl-more:hover, .dl-dn:hover, .dl-all:hover { color: var(--cz-ink); }
527
+ .dl-more.n { font-size: 12.5px; color: var(--cz-ink2); }
528
+ .dl-fold { position: sticky; left: calc(var(--nw) + 12px); display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 6px; padding: 10px 12px; font-size: 12.5px; color: var(--cz-ink3); white-space: nowrap; }
529
+ .dl-fx { color: var(--cz-ink3); font-weight: 600; }
530
+ .dl-fn { flex-direction: row; align-items: center; gap: 6px; margin: 0; padding: 2px 4px; font-weight: 800; color: var(--cz-ink); }
531
+ .dl-fn:hover { background: var(--cz-well); }
532
+ .tg-r.dl-hl, .tgq-r.dl-hl { background: color-mix(in srgb, var(--cz-blue) 7%, transparent); }
533
+ .tg-s .tg-r.dl-hl > .tg-n { background: linear-gradient(color-mix(in srgb, var(--cz-blue) 7%, transparent), color-mix(in srgb, var(--cz-blue) 7%, transparent)), var(--cz-card); }
534
+ .dl-ring { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cz-blue) 35%, transparent); }
535
+ .dl-ph { border: 1px solid var(--cz-hair); border-radius: 16px; background: var(--cz-card); padding: 10px 14px 8px; margin-bottom: 12px; }
536
+ .dl-phh { display: flex; align-items: center; gap: 6px; min-height: 32px; font-size: 13.5px; }
537
+ .dl-phh b { font-weight: 800; }
538
+ .dl-phh .late { font-size: 12.5px; color: var(--cz-ink3); }
539
+ .dl-all { margin-left: auto; min-height: 44px; padding: 0 4px; font-size: 13px; color: var(--cz-ink2); }
540
+ .dl-pl { flex-direction: row; align-items: baseline; gap: 12px; margin: 0 -6px; min-height: 36px; }
541
+ .dl-pl small { flex: none; width: 52px; font-size: 13px; }
542
+ .dl-pl b { font-size: 13.5px; font-weight: 700; display: flex; gap: 5px; min-width: 0; }
543
+ .dl-pl b span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
544
+
491
545
  /* ── between desktop and phone: the Output column narrows first ── */
492
546
  @media (max-width: 1200px) {
493
547
  .bt-r { grid-template-columns: 200px 480px minmax(0, 1fr); }
@@ -1111,12 +1165,13 @@ html[data-theme="dark"] body.bd-page { --bd-prog: rgb(180,170,240); --bd-progbg:
1111
1165
  .tg-q .tg-body > .tg-r:not(.tg-h) { min-height: 44px; }
1112
1166
  .tg-q .tg-n.ini2 { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; }
1113
1167
  .tg-q .tg-n.ini2 .cz-dot { width: 7px; height: 7px; }
1168
+ .tg-q .tg-n.ini2 .cz-dot, .tg-nodot { flex: none; width: 7px; height: 7px; }
1114
1169
  .tg-pg { background: var(--bd-progbg); }
1115
1170
  .tg-q .tg-body > .tg-pg { min-height: 56px; }
1116
1171
  .tg-pgn { flex-direction: row; align-items: center; gap: 6px; padding-right: 6px; }
1117
1172
  .tg-pgo { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
1118
1173
  .tg-pgo .tt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
1119
- .tg-pgo .tt b { font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1174
+ .tg-pgo .tt b { font-size: 13.5px; font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.3; }
1120
1175
  .tg-pgo .tt small { font-size: 12px; color: var(--cz-ink3); font-weight: 600; }
1121
1176
  .tg-pgo:hover .tt b { color: var(--bd-prog); }
1122
1177
  .tg-kid .tg-n, .tg-gr .tg-n { padding-left: 50px; position: relative; }
@@ -1301,7 +1356,7 @@ body.bd-spick .bd-hd .bd-tools { margin-left: auto; }
1301
1356
  .tgq-r .tg-tm, .tgq-r .tg-tmc { top: 50%; }
1302
1357
  /* the product lane (batch 11 item 17; PlmA1Board, PlmA2Folded, PlmA3Phone): a product's head row carries every milestone of its initiatives,
1303
1358
  * the rows' ◇ rolled up, over a thin grey line from the first start to the last end. The name cell keeps the fold button; the lane is the track. */
1304
- .tg-lane, .tg-s .tg-lane > .tg-n { background: var(--bd-row); }
1359
+ .tg-lane, .tg-s .tg-lane > .tg-n { background: var(--cz-card); } /* product rows are plain: one tint, the program's (batch 13 item 4) */
1305
1360
  .tg-q .tg-body > .tg-lane { min-height: 56px; }
1306
1361
  .tg-lnn { flex-direction: row; align-items: center; }
1307
1362
  .tg-lnn .bd-prdb { min-width: 0; overflow: hidden; }
@@ -1331,6 +1386,13 @@ span.tg-ng { cursor: default; }
1331
1386
  .tg-ng::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: var(--bd-plan); }
1332
1387
  .tg-ng:hover::before, .tg-ng[aria-expanded="true"]::before { background: var(--bd-done); }
1333
1388
  .tg-ng:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 0; border-radius: 6px; }
1389
+ /* a hold is the gap's hairline (batch 13 item 4): pressing it opens the hold card; a hold whose return date passed is orange */
1390
+ .tg-ng.ho { min-width: 16px; }
1391
+ .tg-ng.ho.late::before { background: var(--cz-dot-late); }
1392
+ /* one dot per initiative off track in a folded group's name cell (XcalmA2Folded) */
1393
+ .tg-offd { display: inline-flex; gap: 3px; flex: none; margin: 0 4px 0 auto; }
1394
+ .tg-offd .cz-dot { width: 7px; height: 7px; }
1395
+ .bd-prdb .tg-offd + svg, .bd-prdb .tg-offd + .n { margin-left: 6px; }
1334
1396
  .tg-sk { position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--cz-card); color: var(--cz-ink3); z-index: 3; }
1335
1397
  .tg-sk.on { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: none; color: var(--cz-ink2); }
1336
1398
  .tg-sk svg, .tg-lgd .k.sk svg, .tg-sk-i svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@@ -173,7 +173,11 @@ body.cz-home { min-height: 100vh; overflow: hidden; }
173
173
  * the top right, and where the column reaches it the log keeps its first line clear of it */
174
174
  .hm-chat { container-type: inline-size; }
175
175
  @media (min-width: 761px) {
176
- body.cz-home:not(.hm-vw-open) .hm-log, body.cz-home:not(.hm-vw-open) .hm-foot { box-sizing: border-box; width: 100%; max-width: 880px; align-self: center; }
176
+ /* the log scrolls at the panel's edge, not at the column's (PM, 2026-10-27 "Bad layout": the scrollbar stood in the middle of the page);
177
+ * its content and the header line keep to the same centred column as the box */
178
+ body.cz-home:not(.hm-vw-open) .hm-foot { box-sizing: border-box; width: 100%; max-width: 880px; align-self: center; }
179
+ body.cz-home:not(.hm-vw-open) .hm-log { box-sizing: border-box; width: 100%; padding-inline: max(0px, calc((100% - 880px) / 2)); }
180
+ body.cz-home:not(.hm-vw-open) .hm-chd { padding-left: max(0px, calc((100% - 880px) / 2)); }
177
181
  @container (max-width: 968px) { .hm-reopen:not([hidden]) ~ .hm-log { padding-top: 46px; } }
178
182
  }
179
183
  /* the header line over the conversation on a desktop (HvACDesk .ch): the open row's mark, its title, the chip of where it sits; the Viewer
@@ -406,6 +410,14 @@ form.hm-box textarea { min-height: 48px; border: 0; background: none; resize: no
406
410
  .hm-iss.done { color: var(--cz-ink3); }
407
411
  .hm-md { font-size: 14px; line-height: 1.55; color: var(--cz-ink); overflow-wrap: anywhere; }
408
412
  .hm-md h1, .hm-md h2, .hm-md h3 { font-size: 15px; margin: 12px 0 4px; }
413
+ /* a table Claude wrote (chat-md.js .mdtab): Home does not load premium.css, so the chat's tables had no rules, padding or edge (PM, 2026-10-27) */
414
+ :is(.hm-md, .hm-ab .md) .mdtab { margin: 4px 0 12px; overflow-x: auto; border: 1px solid var(--cz-hair); border-radius: 12px; }
415
+ :is(.hm-md, .hm-ab .md) .mdtab table { border-collapse: collapse; width: 100%; font-size: 13px; }
416
+ :is(.hm-md, .hm-ab .md) .mdtab th, :is(.hm-md, .hm-ab .md) .mdtab td { padding: 7px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--cz-hair); overflow-wrap: normal; }
417
+ :is(.hm-md, .hm-ab .md) .mdtab th { font-weight: 600; background: var(--cz-well); }
418
+ :is(.hm-md, .hm-ab .md) .mdtab tr:last-child td { border-bottom: 0; }
419
+ :is(.hm-md, .hm-ab .md) .mdtab .al-c { text-align: center; }
420
+ :is(.hm-md, .hm-ab .md) .mdtab .al-r { text-align: right; }
409
421
  .hx-t small { font-size: 12px; color: var(--cz-ink3); overflow-wrap: anywhere; } /* a linked document's address, as text */
410
422
  .hv-why select { font: inherit; font-size: 13.5px; color: var(--cz-ink); padding: 0 10px; height: 36px; border-radius: 12px; border: 1px solid var(--cz-hair); background: var(--cz-card); box-sizing: border-box; }
411
423
  .hx-b { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink); font-size: 12.5px; cursor: pointer; font-family: var(--cz-sans); }
@@ -466,6 +478,9 @@ form.hm-box textarea { min-height: 48px; border: 0; background: none; resize: no
466
478
  * with room for it, so the last message scrolls clear of it */
467
479
  @media (max-width: 760px) { body.cz-home .cz-fabw { bottom: calc(var(--bd-hmfoot, 232px) + 10px); } body.cz-home.hm-sheet .cz-fabw { bottom: 118px; } .hm-log { padding-bottom: 76px; } }
468
480
  .hv-term { margin: 0; height: 100%; box-sizing: border-box; padding: 16px 20px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-family: var(--cz-mono); font-size: 12px; line-height: 1.5; color: var(--cz-ink2); background: var(--cz-well); }
481
+ .hv-xt { height: 100%; box-sizing: border-box; padding: 12px 16px; overflow: auto; background: var(--cz-well); } /* term-view.js: the session's terminal drawn by xterm.js, read only */
482
+ .hv-xt .xterm { display: inline-block; zoom: .8; } /* xterm's 15px default drawn at 12px */
483
+ .hv-xt .xterm-viewport { background: transparent !important; }
469
484
 
470
485
  /* ── the parts other chat modules draw inside a message: context and report chips (premium-vw-ctx, report-chat), the /goal card (goal-chat),
471
486
  * Claude's question card (chat-ask), attachments (premium-attach) ── */
@@ -741,3 +756,10 @@ form.hm-box textarea { min-height: 48px; border: 0; background: none; resize: no
741
756
  /* a milestone task's small grey ◇ after its name (feedback batch 11 item 3) */
742
757
  .hm-rt.ms { flex-direction: row; align-items: center; gap: 6px; }
743
758
  .hv-ms { flex: none; display: inline-flex; color: var(--cz-ink3); }
759
+ /* the chat header's context pie and Claude's ✦ Compact in the offer chip (batch 13 item 8) */
760
+ .hm-ch .cz-ctx { margin-left: auto; margin-right: 6px; }
761
+ .hm-sugc.cpt { white-space: normal; }
762
+ .hm-sugs { font-style: normal; color: var(--cz-blueink); }
763
+ .hm-sugw { color: var(--cz-ink2); font-weight: 700; min-width: 0; }
764
+ .hm-sugx.ok { color: var(--cz-blueink); }
765
+ #hmTopTitle .cz-ctx { margin-left: 8px; vertical-align: -2px; }
@@ -34,6 +34,7 @@
34
34
  .lv-t small { display: block; font-size: 12.5px; font-weight: 600; color: var(--cz-ink3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
35
35
  .lv-tm { font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }
36
36
  .cz-live .lv-tm { font-size: 13px; }
37
+ .lv-row .cz-ctx { margin: 0 8px 0 4px; } /* the context pie before the time (batch 13 item 8; drawn by ctx-wedge.js, styled in cozy.css) */
37
38
  .lv-tm.rec { color: var(--cz-red); }
38
39
  .lv-tm.stop { color: var(--cz-late); }
39
40
 
@@ -17,6 +17,7 @@
17
17
  import { onRecording } from './rec-state.js';
18
18
  import { ownTab, bring } from './rec-tab-core.js';
19
19
  import { liveItems, keepOrder, pillLabel, rowLabel, clock, elapsed } from './live-model.js';
20
+ import { wedgeHtml } from './ctx-wedge.js'; // the same context pie as Home's rows, before the time (batch 13 item 8)
20
21
 
21
22
  const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
22
23
  const SHEET = new URL('./cozy-live-pill.css', import.meta.url).href;
@@ -60,7 +61,7 @@ export function mountLivePill(doc = document, opts = {}) {
60
61
  const was = L.marks.get(x.id), once = L.open && was && was !== x.mark;
61
62
  return `<a class="lv-row${x.open ? ' cur' : ''}" href="${esc(x.href)}" data-lv="${esc(x.id)}" aria-label="${esc(rowLabel(x))}" aria-keyshortcuts="${i + 1}">`
62
63
  + `<span class="lv-mk">${x.kind === 'rec' ? `<i class="lv-m rec${x.paused ? ' paused' : ''}"></i>` : markHtml(x.mark, once)}</span>`
63
- + `<span class="lv-t">${esc(x.name)}<small>${esc(x.sub)}</small></span>`
64
+ + `<span class="lv-t">${esc(x.name)}<small>${esc(x.sub)}</small></span>${wedgeHtml(x.ctx)}`
64
65
  + `<span class="lv-tm${x.kind === 'rec' && !x.paused ? ' rec' : x.mark === 'stop' ? ' stop' : ''}">${esc(x.time)}</span></a>`;
65
66
  }).join('');
66
67
  }
@@ -380,6 +380,10 @@ body.cz-home .hv-r.two .hm-rt b { font-size: 15px; }
380
380
  .hv-tk .hv-mt { margin-left: 2px; }
381
381
  .hv-spp { position: absolute; z-index: 20; top: calc(100% - 4px); right: 8px; width: min(340px, calc(100% - 16px)); background: var(--cz-card); border-radius: 18px; padding: 6px; box-shadow: 0 24px 50px -20px rgba(42,46,53,.4), 0 0 0 1px var(--cz-hair); box-sizing: border-box; }
382
382
  .hv-spp .hv-r::before, .hv-sps .hv-r::before { display: none; }
383
+ /* batch 13 item 7 (canvas XcsA1Pill): a session idle and safe to close, light blue with the ✦ in its line and one ✓ */
384
+ .hv-spp .hv-r.safe, .hv-sps .hv-r.safe { background: var(--cz-bluebg); border-radius: 14px; }
385
+ .hv-r .hm-sv { font-style: normal; color: var(--cz-blueink); margin-right: 4px; }
386
+ .hv-r .hm-cls { color: var(--cz-blueink); background: var(--cz-card); align-self: center; flex: none; }
383
387
  .hv-spf { display: flex; padding: 2px 2px 0; margin-top: 4px; border-top: 1px solid var(--cz-hair); }
384
388
  body.cz-home .hv-r.sp-on { background: var(--cz-well2); z-index: 5; }
385
389
  body.cz-home .hv-r.sp-on + .hv-r::before { display: none; }
@@ -439,3 +443,6 @@ body.cz-home .hv-r.sp-on + .hv-r::before { display: none; }
439
443
  .hv-card .hv-r.two .hm-rm { min-height: 58px; }
440
444
  }
441
445
  body.cz-home .hm-hd.hv-bar { padding: 0; }
446
+
447
+ /* A session's context (batch 13 item 8, XctxA1Desk): the pie sits at the row's end. Claude's ✦ Compact uses item 7's ✦ and ✓ (.hm-sv, .hm-cls) */
448
+ .hm-rm .cz-ctx { margin: 0 6px 0 8px; }
@@ -190,6 +190,12 @@ body.cz { margin: 0; font-family: var(--cz-sans); color: var(--cz-ink); backgrou
190
190
  .cz-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; position: relative; }
191
191
  .cz-dot.you { background: var(--cz-blue); } .cz-dot.late { background: var(--cz-dot-late); } .cz-dot.risk { background: var(--cz-dot-risk); }
192
192
  .cz-dot.red { background: var(--cz-dot-red); } .cz-dot.ok { background: var(--cz-dot-ok); } .cz-dot.q { background: var(--cz-dot-q); }
193
+ /* How full a session's context is (batch 13 item 8, XctxA1Desk): a small pie at the row's end, from 50%. Grey, amber from 70%, red from 90%
194
+ * with the critical pulse. A pie, not a ring: the hollow ring already means running. pm/ctx-wedge.js draws it. */
195
+ .cz-ctx { --c: var(--cz-ink3); width: 14px; height: 14px; border-radius: 50%; flex: none; display: inline-block; position: relative; background: conic-gradient(var(--c) var(--p, 0%), var(--cz-well2) 0); }
196
+ .cz-ctx.warn { --c: var(--cz-dot-risk); } .cz-ctx.crit { --c: var(--cz-dot-red); }
197
+ .cz-ctx.p50 { --p: 50%; } .cz-ctx.p55 { --p: 55%; } .cz-ctx.p60 { --p: 60%; } .cz-ctx.p65 { --p: 65%; } .cz-ctx.p70 { --p: 70%; } .cz-ctx.p75 { --p: 75%; } .cz-ctx.p80 { --p: 80%; } .cz-ctx.p85 { --p: 85%; } .cz-ctx.p90 { --p: 90%; } .cz-ctx.p95 { --p: 95%; } .cz-ctx.p100 { --p: 100%; }
198
+ .cz-ctx.crit::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--c); animation: cz-crit 1.6s ease-out infinite; }
193
199
 
194
200
  /* ── Motion signals importance only, by level. Nothing else moves. ── */
195
201
  .cz-dot.m-info::after, .cz-dot.m-warn::after, .cz-dot.m-crit::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; }
@@ -0,0 +1,45 @@
1
+ /* ctx-wedge.js — how full a session's context is, as Home, the chat header and the Live pill draw it (batch 13 item 8, canvas XctxA1Desk).
2
+ *
3
+ * A session row from /api/sessions carries `ctx` (lib/context-use.js): { used, window, pct, level, at, advise }. Under 50% nothing shows
4
+ * (zero is silence). From 50% a small pie at the row's end; amber from 70%, red with the critical pulse from 90%. Hover or a long press
5
+ * says "116k of 200k used · last turn 10:12". `advise: 'compact'` is Claude's ✦ proposal: the row's quiet line says so and ✓ types /compact.
6
+ * Safe to close (item 7) outranks it: a row keeps one ✦. */
7
+
8
+ const esc = (x) => String(x == null ? '' : x).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
9
+ const k = (n) => (n >= 1e6 ? (n / 1e6).toFixed(n % 1e6 ? 1 : 0) + 'M' : Math.round(n / 1000) + 'k');
10
+ const hm = (iso) => { const d = new Date(iso); return isNaN(d) ? '' : String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0'); };
11
+
12
+ /** "116k of 200k used · last turn 10:12" */
13
+ export function ctxLine(c) {
14
+ if (!c || !(c.used > 0)) return '';
15
+ const head = c.window ? `${k(c.used)} of ${k(c.window)} used` : `${k(c.used)} used`;
16
+ const t = c.at ? hm(c.at) : '';
17
+ return t ? `${head} · last turn ${t}` : head;
18
+ }
19
+ /** The pie, or '' under 50% or with no window. */
20
+ export function wedgeHtml(c) {
21
+ if (!c || c.pct == null || c.pct < 50) return '';
22
+ const say = `Context ${c.pct}% full: ${ctxLine(c)}`;
23
+ // the fill is a class in 5-point steps (cozy.css .cz-ctx.p50 … .p100): no inline style (conformance R28-1)
24
+ const step = Math.min(100, Math.floor(c.pct / 5) * 5);
25
+ return `<span class="cz-ctx p${step}${c.level === 'warn' || c.level === 'crit' ? ' ' + c.level : ''}" role="img" aria-label="${esc(say)}" title="${esc(ctxLine(c))}"></span>`;
26
+ }
27
+ /* ✕ on the proposal (and ✓, until the compact lands) hides it until the session is 10 points fuller; a pie that shrank starts again.
28
+ * Kept in this browser only. */
29
+ const HID = 'cz-ctx-x:';
30
+ const hidAt = (sid) => { try { const v = Number(localStorage.getItem(HID + sid)); return v > 0 ? v : 0; } catch { return 0; } };
31
+ export function hideOffer(sid, pct) { try { localStorage.setItem(HID + sid, String(pct || 0)); } catch { /* a private window: it shows again */ } }
32
+ /** Claude proposes to compact it: the words of the ✦ line, else null. `closes`: the row already proposes closing (item 7), which wins. */
33
+ export function compactOffer(c, closes = false, sid = '') {
34
+ if (closes || !c || c.advise !== 'compact') return null;
35
+ const h = sid ? hidAt(sid) : 0;
36
+ if (h && c.pct < h) { try { localStorage.removeItem(HID + sid); } catch { /* nothing kept */ } } // it shrank: it was compacted, start again
37
+ else if (h && c.pct < h + 10) return null;
38
+ return c.pct >= 90 ? `${c.pct}% full. Compact now, or new turns may lose the start of this chat` : `${c.pct}% full. Compact it before the next task`;
39
+ }
40
+ /** The ✓ that accepts it: types /compact into that session (POST /api/session/compact). */
41
+ export function compactBtnHtml(sid, pct) {
42
+ const say = `Compact this session; Claude says its context is ${pct}% full`;
43
+ // the same ✓ as item 7's close (.hm-cls): one look for "accept what Claude proposes" on a row
44
+ return `<button type="button" class="ut-ib hv-ib hm-cls" data-hm-compact="${esc(sid)}" aria-label="${esc(say)}" title="Compact this session (types /compact)"><svg aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12l5 5 9-10"/></svg></button>`;
45
+ }
@@ -44,7 +44,9 @@ import { mountRecRow, clockOf as recClock } from './home-rec-row.js';
44
44
  import { mountSesName } from './home-ses-name.js'; // session names A: tap the session's name to rename it (canvas XmsNames)
45
45
  import * as SM from './split-merge.js'; // split one initiative in two, or merge two: Claude suggests, the PM approves (batch 11 item 14)
46
46
  import * as PM from './prog-move.js'; // move an initiative out of its program, or to another (canvas LpA1More, LpA2Other, LpA4Phone)
47
+ import * as CW from './ctx-wedge.js'; // how full a session's context is, and Claude's ✦ Compact (batch 13 item 8, XctxA1Desk)
47
48
  import * as PO from './prog-order.js'; // a program's order on Home: the grip, hold-then-drag on a phone, ✦ Claude's order from the dates (canvas RoAPhone)
49
+ import * as LPV from './loose-props.js'; // Claude's clean-up of "Not in an initiative": the ✦ on its header and the Viewer (batch 13 item 3)
48
50
  import { initiativeRename, taskRename } from './rename-press.js'; // tap the title to rename (canvas RnATask, RnASaved) // the pinned recording row above it (XvARecHome)
49
51
 
50
52
  const $ = (s, r = document) => r.querySelector(s);
@@ -113,6 +115,14 @@ function toastUndo(msg, undo) {
113
115
  el.querySelector('.undo').onclick = async () => { el.classList.remove('on', 'act'); const r = await undo(); if (r && r.ok === false) toast(r.error || 'It could not be undone.'); };
114
116
  clearTimeout(toast.t); toast.t = setTimeout(() => el.classList.remove('on', 'act'), 8000);
115
117
  }
118
+ /** What Claude's clean-up needs from Home (pm/loose-props.js): the toast with Undo, a fresh read, the product a new initiative starts in,
119
+ * the rows the group shows, and today. */
120
+ const lpHost = {
121
+ toast: (m, undo) => (undo ? toastUndo(m, undo) : toast(m)), reload: () => load(), redraw: () => drawList(),
122
+ where: () => ({ ws: boardWs(), board: boardId() }),
123
+ total: () => { const g = S.M && S.M.groups.find((x) => x.kind === 'loose'); return g ? g.n : 0; },
124
+ today: () => L.dayOf(),
125
+ };
116
126
  /** A rename landed (or its Undo did): every place that names it reads the new name now, and the server's read follows. */
117
127
  function renamedHere(kind, id, title) {
118
128
  if (kind === 'task') for (const t of ((S.D.items && S.D.items.items) || [])) { if (t && t.uid === id) t.title = title; }
@@ -185,6 +195,8 @@ async function load() {
185
195
  const others = await Promise.all(otherProducts(D).map((a) => getRetry('/api/board-premium?ws=' + encodeURIComponent(a.ws), 4).then((r) => (r && r.ok && r.model ? { ws: a.ws, name: a.name, model: r.model } : null))));
186
196
  const got = others.filter(Boolean);
187
197
  if (got.length || D.others.length) { D.others = got; drawList(); }
198
+ // what "Not in an initiative" shows goes to the server, so Claude's clean-up reads the same rows; the ✦ comes back (batch 13 item 3)
199
+ if (S.M && S.filter === 'today') LPV.sync(S.M, S.D, lpHost).catch(() => {});
188
200
  // an initiative of another product opened before its board was read (a link, a quick press): read it again from its own board
189
201
  if (S.ini && !S.IM && otherIni(S.ini)) goIni(S.ini, { page: VW.isOpen() });
190
202
  }
@@ -271,6 +283,7 @@ function todayModel() {
271
283
  function homeListHtml() {
272
284
  const M = L.homeList(S.D, { now: NOW(), filter: S.filter });
273
285
  S.M = M;
286
+ const lg = M.groups.find((g) => g.kind === 'loose'); if (lg) lg.chip = LPV.chipOf();
274
287
  const R = L.reviewModel(S.D, NOW());
275
288
  // a group is open until the PM folds it; another product starts folded; "Not in an initiative" starts folded on a phone (HvAC, HvACDesk)
276
289
  const pOpen = (g) => (g.key in S.pg ? !!S.pg[g.key] : g.kind === 'loose' ? !isPhone() : g.kind === 'program' || g.primary || M.products.length === 1);
@@ -476,7 +489,7 @@ function drawTop() {
476
489
  // is back + that name only, no second line (XmsNames, XcbOptions)
477
490
  const ses = cur.ses ? S.D.sessions.find((x) => x.id === cur.ses) : null;
478
491
  const title = ses ? H.nameOf(ses) : cur.title;
479
- const th = ses && isPhone() ? SN.titleHtml(ses.id, title) : esc(title || '');
492
+ const th = ses && isPhone() ? SN.titleHtml(ses.id, title) + CW.wedgeHtml(ses.ctx) : esc(title || ''); // its context pie after the name (XctxA2Phones)
480
493
  const tb = $('#hmTopTitle'); if (tb.__h !== th) { tb.__h = th; tb.innerHTML = th; }
481
494
  $('#hmTopSub').textContent = '';
482
495
  $('#hmNeedsN').textContent = !S.ready ? 'Reading' : n ? n + (n === 1 ? ' next step' : ' next steps') : 'Today';
@@ -504,6 +517,10 @@ const chat = mountChat($('#hmChat'), {
504
517
  unqueue: (sid, at) => { pmPost('/api/home-desk/queue-drop', { session: sid, at }); if (S.D.desk && S.D.desk.queued && S.D.desk.queued[sid]) S.D.desk.queued[sid] = S.D.desk.queued[sid].filter((x) => x.at !== at); },
505
518
  onScope: (b) => menu(b, scopeItems(), 'Where this goes'),
506
519
  suggestLink: (t, first) => suggestLink(t, first),
520
+ // Claude's ✦ Compact in the chat's offer chip (batch 13 item 8): only when the link chip has nothing to say
521
+ compactOffer: (sid) => { const s = S.D.sessions.find((x) => x.id === sid); const w = s && CW.compactOffer(s.ctx, !!(s.close_ok && s.close_ok.safe), sid); return w ? { text: w, pct: s.ctx.pct } : null; },
522
+ compact: (sid) => compact(sid),
523
+ dismissCompact: (sid, pct) => CW.hideOffer(sid, pct),
507
524
  linkTo: (sid, ini) => link(sid, ini),
508
525
  dismissLink: (sid) => { try { localStorage.setItem('cz-linksug-x:' + sid, '1'); } catch { /* a private window: it shows again next time */ } },
509
526
  onLink: (b, t) => menu(b, H.boardRows(S.D).map((r) => ({ label: r.title, sub: r.stage, go: () => link(t.sid, r.id) })), 'Link it to an initiative'),
@@ -526,7 +543,7 @@ function chatHead(t) {
526
543
  if (t.prog) return { row: r, title: t.title, scope: t.prog.title, prog: true };
527
544
  const title = r && r.kind !== 'ini' ? r.name : t.title;
528
545
  // session names A: an open session's name is the rename press (or the field while it is renamed)
529
- if (t.ses) { const s = S.D.sessions.find((x) => x.id === t.ses); if (s) return { ...chatHeadOf(t, r, H.nameOf(s)), titleHtml: SN.titleHtml(s.id, H.nameOf(s), 'hm-chb') }; }
546
+ if (t.ses) { const s = S.D.sessions.find((x) => x.id === t.ses); if (s) return { ...chatHeadOf(t, r, H.nameOf(s)), titleHtml: SN.titleHtml(s.id, H.nameOf(s), 'hm-chb'), ctx: s.ctx || null }; }
530
547
  return chatHeadOf(t, r, title);
531
548
  }
532
549
  function chatHeadOf(t, r, title) {
@@ -1445,6 +1462,7 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
1445
1462
  if (d.hmSes) { sesPill(d.hmSes === S.ses ? null : d.hmSes); return; } // an initiative's pill: what sits in it, under it (a sheet on a phone)
1446
1463
  if ('hmSesx' in d) { sesPill(null); return; }
1447
1464
  if (d.hmSesnew) { sesPill(null, false); newIn(d.hmSesnew); return; }
1465
+ if (d.hmCompact) { compact(d.hmCompact); return; } // ✓ on Claude's ✦ Compact (batch 13 item 8): the pill's list stays open
1448
1466
  if (S.ses && !b.closest('.hv-spp, .hv-sps')) sesPill(null, false); // a press anywhere else in the list closes it
1449
1467
  if (d.hmSel) { if (S.ses) sesPill(null, false); if (S.day) S.day = false; select(d.hmSel); return; }
1450
1468
  if ('hrMentions' in d) { if (S.day) S.day = false; S.sel = 'mentions'; drawList(); MEN.openMentions(menCtx()); return; }
@@ -1457,6 +1475,8 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
1457
1475
  if (b.getAttribute('aria-expanded') === 'true') { S.kids.delete(d.hmKids); S.kidsOff.add(d.hmKids); } else { S.kids.add(d.hmKids); S.kidsOff.delete(d.hmKids); }
1458
1476
  keepKids(); drawList(); const f = $(`#hmList [data-hm-kids="${CSS.escape(d.hmKids)}"]`); if (f) f.focus(); return;
1459
1477
  }
1478
+ if ('lpOpen' in d) { LPV.open(lpHost); return; }
1479
+ if (d.hmClose) { LPV.closeOne(lpHost, d.hmClose); return; } // the pill menu's ✓: close a session Claude says is idle and safe (batch 13 item 7)
1460
1480
  if (d.hmPg) { const open = b.getAttribute('aria-expanded') === 'true'; S.pg[d.hmPg] = !open; store.set('pmos.home.pg', JSON.stringify(S.pg)); drawList(); const f = $(`#hmList [data-hm-pg="${CSS.escape(d.hmPg)}"]`); if (f) f.focus(); return; }
1461
1481
  if ('hmProd' in d) { goIni('product'); return; }
1462
1482
  if (d.hmRest) { if (S.rest.has(d.hmRest)) S.rest.delete(d.hmRest); else S.rest.add(d.hmRest); keepKids(); drawList(); return; }
@@ -1478,6 +1498,13 @@ $('#hmList').onclick = (e) => { // delegated: every press on the list is a <bu
1478
1498
  if (d.hmRecopen) { if (!(ownTab() && bring(tabUrl(d.hmRecopen, { ws: WS || '' })))) openMeeting({ note: d.hmRecopen }); return; }
1479
1499
  };
1480
1500
  $('#hmList').addEventListener('keydown', (e) => { if (e.key === 'Escape' && e.target.id === 'hmCap' && S.cap) { e.stopPropagation(); S.cap = false; drawList(); } else if (e.key === 'Escape' && S.day) { e.stopPropagation(); day(false); } });
1501
+ /** Claude's ✦ Compact, accepted (batch 13 item 8): type /compact into that session. Its pie shrinks after the session's next reply. */
1502
+ async function compact(sid) {
1503
+ const s = S.D.sessions.find((x) => x.id === sid);
1504
+ const r = await pmPost('/api/session/compact', { id: sid });
1505
+ if (r && r.ok && s && s.ctx) { CW.hideOffer(sid, s.ctx.pct); drawList(); } // the ✦ stays away until the session's next reply moves the pie
1506
+ toast(r && r.ok ? 'Compacting “' + (s ? H.nameOf(s) : 'the session') + '”. Its context shrinks when it answers.' : (r && r.error) || 'Nothing was typed.');
1507
+ }
1481
1508
  /** Open (id) or close (null) the list behind an initiative's pill (batch 12 item 6). Closing gives the focus back to the pill, unless the
1482
1509
  * press that closed it goes somewhere else (back false). */
1483
1510
  function sesPill(id, back = true) {
@@ -159,8 +159,11 @@ export function mountChat(el, host) {
159
159
  // A loose chat that reads like one initiative gets one quiet chip at its top: "Looks like <initiative> · Link it ×" (XvALinkSuggest).
160
160
  function drawSug() {
161
161
  const t = C.t, g = t && t.scope && t.scope.loose && t.sid && host.suggestLink ? host.suggestLink(t, firstUser()) : null;
162
- sug.hidden = !g; C.sug = g;
163
- put(sug, g ? `<span class="hm-sugc">Looks like <b>${esc(g.title)}</b><button type="button" class="hm-sugl" data-hm-sug="link">Link it</button><button type="button" class="hm-sugx" data-hm-sug="x" aria-label="Not this one" title="Not this one">${SVG(XX, 13)}</button></span>` : '');
162
+ // with nothing to link, the same chip carries Claude's ✦ Compact from 70% on the PM's turn (batch 13 item 8, XctxA1Desk): ✓ types /compact
163
+ const cp = !g && sid() && host.compactOffer ? host.compactOffer(sid()) : null;
164
+ sug.hidden = !g && !cp; C.sug = g; C.cpt = cp;
165
+ put(sug, g ? `<span class="hm-sugc">Looks like <b>${esc(g.title)}</b><button type="button" class="hm-sugl" data-hm-sug="link">Link it</button><button type="button" class="hm-sugx" data-hm-sug="x" aria-label="Not this one" title="Not this one">${SVG(XX, 13)}</button></span>`
166
+ : cp ? `<span class="hm-sugc cpt"><i class="hm-sugs" aria-hidden="true">✦</i><span class="hm-sugw">${esc(cp.text)}</span><button type="button" class="hm-sugx ok" data-hm-cpt="ok" aria-label="Compact this session" title="Compact (types /compact)">${SVG(OK, 13)}</button><button type="button" class="hm-sugx" data-hm-cpt="x" aria-label="Not now" title="Not now">${SVG(XX, 13)}</button></span>` : '');
164
167
  }
165
168
  function draw() {
166
169
  const t = C.t; if (!t) return;
@@ -438,6 +441,8 @@ export function mountChat(el, host) {
438
441
  return;
439
442
  }
440
443
  const b = e.target.closest('button, [data-file], [data-att], [data-ctx]'); if (!b || !el.contains(b)) return;
444
+ // ✓ types /compact (and hides the ✦ until the pie moves); ✕ hides it until the session is 10 points fuller
445
+ if (b.dataset.hmCpt && C.cpt) { if (b.dataset.hmCpt === 'ok') host.compact(sid()); else host.dismissCompact(sid(), C.cpt.pct); C.cpt = null; sug.hidden = true; put(sug, ''); return; }
441
446
  if (b.dataset.hmSug && C.sug) { const g = C.sug; if (b.dataset.hmSug === 'link') host.linkTo(C.t.sid, g.id); else { host.dismissLink(C.t.sid); drawSug(); } return; }
442
447
  const d = b.dataset;
443
448
  const ic = b.closest('.hm-icard'), card = C.t && C.t.intro && C.t.intro.card;
@@ -72,7 +72,9 @@ export function sessionRow(s, roles) {
72
72
  // a chat's tmux name carries a 'chat: ' prefix (lib/briefing-premium-agent.js); the row shows its title only (testing fixes)
73
73
  const name = nameOf(s);
74
74
  return { id: 's:' + s.id, kind: 'session', sid: s.id, key: keyOfSession(s), ini: iniOfSession(s), name, state: st, initial: role.initial, role,
75
- hint: role.name, icon: 'chat', created: s.created || '', prog: s.progress && s.progress.n > 0 ? s.progress : null }; // the state is the dot beside the row, not a word (testing fixes)
75
+ hint: role.name, icon: 'chat', created: s.created || '', prog: s.progress && s.progress.n > 0 ? s.progress : null,
76
+ ...(s.close_ok && st === 'quiet' ? { close: s.close_ok } : {}), // idle 30 min: { safe, say } (batch 13 item 7, lib/idle-close.js)
77
+ ctx: s.ctx || null }; // how full its context is, and Claude's ✦ Compact (batch 13 item 8; pm/ctx-wedge.js) // the state is the dot beside the row, not a word (testing fixes)
76
78
  }
77
79
  /** The sessions as Home reads them. A session PMOS started (a skill, a background job) reads 'needs' as soon as its prompt is done:
78
80
  * its turn ending asks nothing of the PM, so it is a finished run, quiet, and never a row that waits on the PM (testing fixes).
@@ -117,8 +119,9 @@ export const UPDATE_KEY = 'chat:weekly-update';
117
119
  /* ── initiatives ── */
118
120
  export const boardRows = (D) => (D.board && D.board.initiatives && D.board.initiatives.list && D.board.initiatives.list.rows) || (D.board && D.board.rows) || [];
119
121
  export const live = (s) => s.shown !== 'exited' && s.state !== 'exited';
120
- /** A session Home lists: a live one, or a chat that rests until its next message. */
121
- export const listed = (s) => live(s) || resting(s);
122
+ /** A session Home lists: a live one, or a chat that rests until its next message. One the PM put away or finished from the clean-up
123
+ * (batch 13 item 3: s.away) is not listed until the PM's next message in it; Search still finds it. */
124
+ export const listed = (s) => (live(s) || resting(s)) && !(s && s.away);
122
125
  /** The kids of one initiative: its needs, its live sessions and today's meetings about it, the loudest first. */
123
126
  export function kidsOf(D, id) {
124
127
  const needs = needsOf(D).filter((r) => r.ini === id && !r.needSession);
@@ -15,7 +15,7 @@
15
15
  * fileUnder(text, inis) the initiative a typed task names (its title or id in the text), or null: the task then goes on the PM's own list
16
16
  * D is home-data.js's D plus { work (GET /api/my-work-premium model), items (GET /api/boards/items), others ([{ ws, name, model }], the boards of
17
17
  * the other products), phoneDay (GET /api/phone-day), review (GET /api/home-review) }. A part that did not answer is left out, never guessed. */
18
- import { needsOf, boardRows, productCard, productName, sessionRow, nameOf, iniOfSession, todayOf, listed, OPEN, hm } from './home-data.js';
18
+ import { needsOf, boardRows, productCard, productName, sessionRow, nameOf, iniOfSession, keyOfSession, todayOf, listed, OPEN, hm } from './home-data.js';
19
19
  import { programState, groupRows } from './program-model.js';
20
20
  import { homeSub } from './ms-suggest.js';
21
21
  import { STEPS, stageKey } from './premium-initiative-head.js';
@@ -100,6 +100,9 @@ export function tasksOf(D, ini, now = Date.now()) {
100
100
  }).map((r) => ({ ...r, rank: urgency(r.task, now) }))
101
101
  .sort((a, b) => (b.mine - a.mine) || (a.rank[0] - b.rank[0]) || (a.rank[1] - b.rank[1]));
102
102
  }
103
+ /** One of the PM's own items of today (GET /api/my-work-premium, the Today tab). The check box says it is the PM's own: no "your own note" on
104
+ * every row (testing fixes). */
105
+ const itemRow = (r) => ({ id: 'w:' + r.key, kind: 'item', key: r.key, name: r.title, hint: [r.overdue ? 'late' : '', String(r.sub || '').replace(/^Yours\b\s*(·\s*)?/, '')].filter(Boolean).join(' · '), check: true, mine: true, late: !!r.overdue, item: r });
103
106
  function meetRow(m, ini) {
104
107
  return { id: 'm:' + (m.id || m.title), kind: 'meeting', ini: ini || null, name: m.title, hint: (m.state === 'now' ? 'Now' : hm(m.start)) + (ini ? ' meeting' : ' · not linked'), state: m.state === 'now' ? 'working' : 'quiet', icon: 'clock', meeting: m };
105
108
  }
@@ -113,20 +116,22 @@ export const ownSteps = (r) => (r && r.wf && r.wf.id && r.wf.id !== 'product-fea
113
116
  export const rowAt = (r) => (ownSteps(r) ? r.wfStage.n - 1 : stageAt(r && r.stage));
114
117
  /** A row under an initiative that is the PM's move now (Your move, and the initiative's count badge): a next step, a session
115
118
  * that waits on the PM, or a task of the PM's own that is late. */
116
- const isMove = (k) => k.step || (k.kind === 'session' && (k.state === 'needs' || k.state === 'blocked')) || (k.kind === 'task' && k.mine && k.late);
119
+ const isMove = (k) => k.step || (k.kind === 'session' && (k.state === 'needs' || k.state === 'blocked')) || ((k.kind === 'task' || k.kind === 'item') && k.mine && k.late);
117
120
  function iniRowOf(D, r, needs, now) {
118
121
  // a mention is not a row here: Mentions is its own row at the top of Home (home-mentions.js, XvANew), so it shows once
119
122
  const steps = needs.filter((x) => x.ini === r.id && !x.needSession).map((x) => ({ ...x, step: true, hint: 'Next step' + (bareHint(x) ? ' · ' + bareHint(x) : '') }));
120
123
  const ses = (D.sessions || []).filter((s) => listed(s) && iniOfSession(s) === r.id).map((s) => sessionRow(s, D.desk && D.desk.roles));
121
124
  const tasks = tasksOf(D, r.id, now);
122
125
  const meet = todayOf(D).filter((m) => meetIni(m) === r.id && m.state !== 'past').map((m) => meetRow(m, r.id));
126
+ // the PM's own items linked to it (the clean-up, batch 13 item 3): a late one keeps its late check box here
127
+ const items = (((D.work && D.work.queue && D.work.queue.tabs) || []).find((t) => t.key === 'today') || { groups: [] }).groups.flatMap((g) => g.rows || []).filter((x) => x.ini === r.id).map(itemRow);
123
128
  const turn = steps.length > 0 || ses.some((s) => s.state === 'needs' || s.state === 'blocked');
124
129
  const mine = tasks.filter((t) => t.mine).length;
125
130
  const run = ses.filter((s) => s.state === 'working').length;
126
131
  const right = turn ? 'your turn' + (mine ? ' · ' + plural(mine, 'task', 'tasks') : '') : mine ? plural(mine, 'task', 'tasks') : run ? run + ' running' : 'Nothing today';
127
132
  // next steps, sessions and today's meetings sit under the initiative; its tasks do not (Wawan, 2026-10-25: Home lists no tasks, the
128
133
  // initiative's page in the Viewer holds them). The row keeps them for Your move, where the PM's own late ones still lead
129
- const kids = [...steps, ...ses.sort((a, b) => (RANK[b.state] || 0) - (RANK[a.state] || 0)), ...meet];
134
+ const kids = [...steps, ...ses.sort((a, b) => (RANK[b.state] || 0) - (RANK[a.state] || 0)), ...items, ...meet];
130
135
  const hint = [(r.wf && r.wf.name) || 'Product feature', r.stage].filter(Boolean).join(' · '); // D99: Kind becomes Workflow
131
136
  return { id: 'i:' + r.id, kind: 'ini', ini: r.id, name: r.title, hint, right, turn, busy: kids.length > 0, state: turn ? 'needs' : run ? 'working' : 'quiet', kids, tasks, board: r, updated: r.updated || '',
132
137
  stage: r.stage || '', at: rowAt(r), steps: ownSteps(r), yours: kids.filter(isMove).length, late: kids.some((k) => k.kind === 'task' && k.mine && k.late) };
@@ -225,7 +230,8 @@ export function homeList(D, o = {}) {
225
230
  const looseNeeds = needs.filter((x) => !used.has(x.id) && !(x.ini && groups.some((g) => g.inis.concat(g.rest).some((i) => i.ini === x.ini))));
226
231
  const loose = [];
227
232
  for (const x of looseNeeds) loose.push({ ...x, flat: true });
228
- for (const r of tabRows('today')) loose.push({ id: 'w:' + r.key, kind: 'item', key: r.key, name: r.title, hint: [r.overdue ? 'late' : '', String(r.sub || '').replace(/^Yours\b\s*(·\s*)?/, '')].filter(Boolean).join(' · '), check: true, mine: true, late: !!r.overdue, item: r }); // the check box says it is the PM's own: no "your own note" on every row (testing fixes)
233
+ // an item the PM linked to an initiative (the clean-up, batch 13 item 3) sits under that initiative, not here
234
+ for (const r of tabRows('today')) if (!r.ini || !groups.some((g) => g.inis.concat(g.rest).some((i) => i.ini === r.ini))) loose.push(itemRow(r));
229
235
  for (const m of todayOf(D).filter((x) => !meetIni(x) && x.state !== 'past')) loose.push(meetRow(m, null));
230
236
  for (const s of (D.sessions || []).filter((s) => listed(s) && !iniOfSession(s) && s.shown !== 'needs' && s.shown !== 'blocked')) loose.push({ ...sessionRow(s, D.desk && D.desk.roles), loose: true });
231
237
  // the folded line's signals (HvAC .lh): a blue dot when a row waits on the PM, an amber square when one of the PM's own is late
@@ -249,6 +255,41 @@ export function homeList(D, o = {}) {
249
255
  counts: { products: products.length, initiatives: nIni } };
250
256
  }
251
257
 
258
+ /* ── the clean-up of "Not in an initiative" (batch 13 item 3; lib/loose-proposals.js, pm/loose-props.js) ── */
259
+ const tsOf = (v) => { const n = typeof v === 'number' ? v : Date.parse(v || ''); return Number.isFinite(n) && n > 0 ? n : 0; };
260
+ const normTitle = (t) => String(t || '').toLowerCase().replace(/\s+/g, ' ').trim();
261
+ /** What the server keeps of the loose group, so Claude's run and the ✦ read what Home shows: { rows, inis }.
262
+ * rows: [{ id, kind, title, at, waits?, late?, sids?, key?, words?, item?, event?, daily? }] (a next step from the brief is left out: it has
263
+ * no record to link). inis: the open initiatives of every product on Home, with what a new one there needs ({ id, title, ws, board, anchor }). */
264
+ export function looseSnapshot(M, D) {
265
+ const g = (M && M.groups || []).find((x) => x.kind === 'loose');
266
+ const S = (D && D.sessions) || [];
267
+ const rows = [], seen = new Set();
268
+ for (const r of (g && g.rows) || []) {
269
+ let x = null;
270
+ if (r.kind === 'session' && r.sid) {
271
+ const key = r.key || null, mine = S.filter((s) => (key ? keyOfSession(s) === key : s.id === r.sid));
272
+ const at = Math.max(0, ...mine.map((s) => Math.max(tsOf(s.touched_at), tsOf(s.exited_at), s.shown !== 'exited' && s.state !== 'exited' ? tsOf(s.lastOutputAt) : 0, tsOf(s.created))));
273
+ const me = S.find((s) => s.id === r.sid) || {};
274
+ x = { id: key ? 'c:' + key : 's:' + r.sid, kind: 'session', title: r.name, at: at ? new Date(at).toISOString() : '', sids: (mine.length ? mine : [me]).map((s) => s.id).filter(Boolean), ...(key ? { key } : {}),
275
+ ...(r.state === 'needs' || r.state === 'blocked' ? { waits: true } : {}), ...(me.lastWords ? { words: String(me.lastWords).slice(0, 240) } : {}) };
276
+ } else if (r.kind === 'item' && r.item && r.item.id) {
277
+ x = { id: 'w:' + r.item.id, kind: 'item', title: r.name, at: r.item.at || '', item: r.item.id, ...(r.late ? { late: true } : {}) };
278
+ } else if (r.kind === 'meeting' && r.meeting) {
279
+ const m = r.meeting;
280
+ x = { id: 'm:' + (m.series ? 's:' + m.series : 't:' + normTitle(m.title)), kind: 'meeting', title: r.name, at: m.start || '', event: { title: m.title, ...(m.series ? { series: m.series } : {}) }, ...(m.series ? { daily: 'Repeats' } : {}) };
281
+ }
282
+ if (x && !seen.has(x.id)) { seen.add(x.id); rows.push(x); }
283
+ }
284
+ const inis = [], have = new Set();
285
+ for (const p of (M && M.products) || []) {
286
+ const b = (p.model && p.model.board) || (p.primary && D && D.board && D.board.board) || {};
287
+ const list = (p.model && p.model.initiatives && p.model.initiatives.list && p.model.initiatives.list.rows) || (p.primary ? boardRows(D) : []);
288
+ for (const r of list.filter(OPEN)) if (r && r.id && !have.has(r.id)) { have.add(r.id); inis.push({ id: r.id, title: r.title || r.id, ws: p.ws || b.ws || '', board: b.id || '', anchor: r.anchor || '' }); }
289
+ }
290
+ return { rows, inis };
291
+ }
292
+
252
293
  /* ── Your move (HvAOpen) ── */
253
294
  /** Every row that is the PM's move, in one list for the Your day sheet: the PM's own late tasks and items first, then each next step and
254
295
  * waiting session in the list's order. A row keeps its list id, so a press opens what the list row opens. Each row:
@@ -261,7 +302,7 @@ function moveOf(groups, needs) {
261
302
  for (const t of g.tasks || []) if (t.mine && t.late) put(late, t, g.name);
262
303
  if (g.msRow) put(rest, g.msRow, g.msRow.hint);
263
304
  for (const r of g.flat || []) put(rest, r, '');
264
- for (const i of (g.inis || []).concat(g.rest || [])) for (const k of i.kids.concat(i.tasks || [])) if (isMove(k)) put(k.kind === 'task' ? late : rest, k, i.name);
305
+ for (const i of (g.inis || []).concat(g.rest || [])) for (const k of i.kids.concat(i.tasks || [])) if (isMove(k)) put(k.kind === 'task' || k.kind === 'item' ? late : rest, k, i.name);
265
306
  }
266
307
  for (const r of needs) if (!seen.has(r.id) && !r.needSession) put(rest, r, r.kind === 'session' ? '' : bareHint(r));
267
308
  return late.concat(rest);