create-pmos 0.444.0 → 0.446.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 (83) hide show
  1. package/package.json +25 -25
  2. package/payload/KIT-VERSION +2 -2
  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/payload/state/log.md +1 -1
  7. package/workspace/README.md +1 -1
  8. package/workspace/adler-moments-test.js +8 -0
  9. package/workspace/adler-seasons-art-test.js +3 -0
  10. package/workspace/board-columns-test.js +168 -0
  11. package/workspace/board-programs-test.js +1 -1
  12. package/workspace/briefing-premium-board-test.js +83 -6
  13. package/workspace/briefing-premium-insights-test.js +43 -0
  14. package/workspace/calm-timeline-test.js +3 -1
  15. package/workspace/changelog.json +24 -0
  16. package/workspace/guide/jira.md +13 -1
  17. package/workspace/guide/ready-made-dashboards.md +2 -2
  18. package/workspace/lib/board-fold.js +33 -5
  19. package/workspace/lib/console-state.js +5 -1
  20. package/workspace/lib/factory-join.js +46 -14
  21. package/workspace/lib/freshness.js +14 -1
  22. package/workspace/lib/initiative-rows.js +38 -4
  23. package/workspace/lib/issues.js +8 -1
  24. package/workspace/lib/jira-cli.js +18 -2
  25. package/workspace/lib/jira-moves.js +119 -0
  26. package/workspace/lib/jira-tickets.js +23 -4
  27. package/workspace/lib/notes.js +4 -2
  28. package/workspace/lib/offloop.js +75 -29
  29. package/workspace/lib/page-build.js +97 -0
  30. package/workspace/lib/plan-items.js +24 -3
  31. package/workspace/lib/plan-tree.js +62 -9
  32. package/workspace/lib/ready-reports.js +22 -8
  33. package/workspace/lib/refresh.js +14 -2
  34. package/workspace/lib/routes-board-premium.js +9 -1
  35. package/workspace/lib/routes-boards.js +74 -15
  36. package/workspace/lib/routes-brief-page.js +3 -1
  37. package/workspace/lib/routes-calendar-import.js +13 -1
  38. package/workspace/lib/routes-ready-reports.js +28 -5
  39. package/workspace/lib/task-links.js +12 -1
  40. package/workspace/lib/workflows-store.js +14 -3
  41. package/workspace/milestone-pins-test.js +1 -1
  42. package/workspace/package-lock.json +2 -2
  43. package/workspace/package.json +1 -1
  44. package/workspace/panels-test.js +150 -6
  45. package/workspace/program-panel-test.js +6 -6
  46. package/workspace/public/pm/bd-cols.js +149 -0
  47. package/workspace/public/pm/bd-pane.js +41 -0
  48. package/workspace/public/pm/bd-span.js +29 -11
  49. package/workspace/public/pm/cozy-board.css +45 -0
  50. package/workspace/public/pm/cozy-insights.css +8 -0
  51. package/workspace/public/pm/cozy-live-pill.css +1 -0
  52. package/workspace/public/pm/cozy-live-pill.js +10 -1
  53. package/workspace/public/pm/cozy-panels.css +24 -3
  54. package/workspace/public/pm/cozy-panels.js +275 -108
  55. package/workspace/public/pm/cozy-viewer.js +3 -1
  56. package/workspace/public/pm/dash-view.js +5 -2
  57. package/workspace/public/pm/home-app.js +8 -8
  58. package/workspace/public/pm/ini-edit.js +5 -1
  59. package/workspace/public/pm/ini-tasks.js +134 -29
  60. package/workspace/public/pm/ini-view-model.js +4 -3
  61. package/workspace/public/pm/ini-view.css +74 -25
  62. package/workspace/public/pm/ini-view.js +4 -4
  63. package/workspace/public/pm/ini-wf-model.js +9 -0
  64. package/workspace/public/pm/ini-wf.js +14 -9
  65. package/workspace/public/pm/ins-pane.js +55 -0
  66. package/workspace/public/pm/jira-move.js +50 -0
  67. package/workspace/public/pm/live-model.js +3 -2
  68. package/workspace/public/pm/pn-narrow.js +76 -0
  69. package/workspace/public/pm/premium-board.js +77 -26
  70. package/workspace/public/pm/premium-insights.js +7 -1
  71. package/workspace/public/premium-board.html +2 -0
  72. package/workspace/ready-dash-ui-test.js +4 -4
  73. package/workspace/server.js +71 -20
  74. package/workspace/skills/jira-move.skill +35 -0
  75. package/workspace/stage-card-tasks-test.js +1 -0
  76. package/workspace/task-links-test.js +1 -0
  77. package/workspace/task-plans-test.js +1 -1
  78. package/workspace/task-views-test.js +161 -12
  79. package/workspace/test-lists/board-columns.json +5 -0
  80. package/workspace/test-lists/jira-moves.json +11 -0
  81. package/workspace/test-lists/page-speed-fold.json +5 -0
  82. package/workspace/test-lists/page-speed-reads.json +5 -0
  83. package/workspace/timeline-holds-test.js +1 -1
@@ -176,11 +176,11 @@ button.iv-wf:hover, .iv-prog:hover { background: var(--cz-well2) !important; col
176
176
  .iv-wbs { display: flex; flex-direction: column; border-radius: 18px; border: 1px solid var(--cz-hair); overflow: hidden; }
177
177
  .iv-ws { display: flex !important; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 4px 12px 4px 14px !important; position: relative; }
178
178
  .iv-wbs > .iv-ws + .iv-ws::before, .iv-wbs > .iv-wl + .iv-ws::before, .iv-wl > .iv-ws + .iv-ws::before, .iv-wl > .iv-wl + .iv-ws::before { content: ""; position: absolute; left: 14px; right: 12px; top: 0; height: 1px; background: var(--cz-hair); }
179
- .iv-ws .w { flex: 1; min-width: 0; color: inherit; font-weight: 400; display: flex; flex-direction: column; }
180
- .iv-ws .w b { font-size: var(--fs-3); font-weight: 800; }
181
- .iv-ws .w small { font-size: var(--fs-2); font-weight: 600; color: var(--cz-ink3); }
182
- .iv-ws .w small.w { color: var(--cz-risk); font-weight: 700; }
183
- .iv-ws.mut .w b { color: var(--cz-ink3); font-weight: 700; }
179
+ .iv-ws > .w { flex: 1; min-width: 0; color: inherit; font-weight: 400; display: flex; flex-direction: column; }
180
+ .iv-ws > .w b { font-size: var(--fs-3); font-weight: 800; }
181
+ .iv-ws > .w small { font-size: var(--fs-2); font-weight: 600; color: var(--cz-ink3); }
182
+ .iv-ws > .w small.w { color: var(--cz-risk); font-weight: 700; }
183
+ .iv-ws.mut > .w b { color: var(--cz-ink3); font-weight: 700; }
184
184
  .iv-ws.in { padding-left: 24px !important; }
185
185
  .iv-ws .n, .iv-grp .n, .iv-fr .n { font-size: var(--fs-2); color: var(--cz-ink3); font-weight: 700; white-space: nowrap; }
186
186
  .iv-ws .n.w { color: var(--cz-risk); }
@@ -189,11 +189,11 @@ button.iv-wf:hover, .iv-prog:hover { background: var(--cz-well2) !important; col
189
189
  .iv-wl > .iv-ws.in { margin-left: -46px; width: calc(100% + 60px); }
190
190
  .iv-tr { display: flex !important; align-items: flex-start; gap: 12px; min-height: 44px; padding: 7px 0 !important; width: 100%; }
191
191
  .iv-tr + .iv-tr, .iv-sub > .iv-tr + .iv-tr { border-top: 1px solid var(--cz-hair); }
192
- .iv-tr .w { flex: 1; min-width: 0; color: inherit; font-weight: 400; display: flex; flex-direction: column; }
192
+ .iv-tr > .w { flex: 1; min-width: 0; color: inherit; font-weight: 400; display: flex; flex-direction: column; }
193
193
  .iv-tt { display: block; font-size: var(--fs-3); font-weight: 700; color: var(--cz-ink); }
194
194
  button.iv-tt:hover { text-decoration: underline; text-decoration-color: var(--cz-hair); }
195
- .iv-tr .w > span { font-size: var(--fs-2); color: var(--cz-ink3); }
196
- .iv-tr .w > span.w { color: var(--cz-risk); font-weight: 700; }
195
+ .iv-tr > .w > span { font-size: var(--fs-2); color: var(--cz-ink3); }
196
+ .iv-tr > .w > span.w { color: var(--cz-risk); font-weight: 700; }
197
197
  .iv-tr.done .iv-tt { color: var(--cz-ink3); font-weight: 600; }
198
198
  .iv-tt em { font-style: normal; color: var(--cz-blueink); font-weight: 800; }
199
199
  .iv-cb { width: 18px; height: 18px; border-radius: 5px; border: 1.6px solid color-mix(in srgb, var(--cz-ink3) 60%, var(--cz-card)) !important; flex: none; margin-top: 1px !important; display: inline-flex !important; align-items: center; justify-content: center; background: var(--cz-card) !important; color: var(--cz-card) !important; }
@@ -201,6 +201,13 @@ button.iv-tt:hover { text-decoration: underline; text-decoration-color: var(--cz
201
201
  .iv-cb.off { opacity: .6; }
202
202
  .iv-jq { width: 12px; height: 12px; border-radius: 3px; background: var(--cz-blue); flex: none; margin: 4px 3px 0; }
203
203
  .iv-jq.dn { background: var(--cz-ink3); }
204
+ /* a Jira ticket moving in Jira (Exploring · Move Jira tasks, JmA3States): its mark is a dashed outline until Jira answers */
205
+ .iv-jq.mv, .ig-sq.mv { background: transparent !important; border: 1.5px dashed var(--cz-blue); box-sizing: border-box; }
206
+ .iv-jm.mv { opacity: .55; }
207
+ .iv-jmv { color: var(--cz-blueink); font-weight: 700; white-space: nowrap; }
208
+ .ivk-d[data-ivk-jira] { cursor: grab; }
209
+ .tkc.ivq .ivq-st.jq { flex-wrap: wrap; }
210
+ .tkc.ivq .ivq-st.jq > .ivq-jn { flex-basis: 100%; margin: 2px 8px 4px; font-size: var(--fs-1); font-weight: 600; color: var(--cz-ink3); }
204
211
  .iv-bxw > .iv-jq { margin: 3px 3px 0; }
205
212
  .iv-more, .iv-grp { display: flex !important; align-items: center; gap: 8px; width: 100%; min-height: 40px; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink2); border-top: 1px solid var(--cz-hair) !important; }
206
213
  .iv-grp b { flex: 1; font-size: var(--fs-3); font-weight: 700; color: var(--cz-ink); }
@@ -237,6 +244,9 @@ button.iv-chip:hover { background: var(--cz-well) !important; }
237
244
 
238
245
  /* the box: one press marks done; the caret (hover or focus; a long press on a phone) opens the status picker */
239
246
  .iv-bxw { position: relative; display: inline-flex; flex: none; align-self: flex-start; }
247
+ button.iv-bxw.jr { padding: 0; border: 0; background: none; cursor: pointer; min-height: 0; border-radius: 6px; }
248
+ button.iv-bxw.jr:hover .iv-cb { box-shadow: 0 0 0 3px var(--cz-well); }
249
+ .iv-cb.mv { background: transparent !important; border: 1.5px dashed var(--cz-blue) !important; }
240
250
  .iv-cb.pr { border-color: var(--cz-blue) !important; background: linear-gradient(90deg, var(--cz-card) 50%, var(--cz-bluebg) 50%) !important; }
241
251
  .iv-cb.wo { background: var(--cz-well) !important; position: relative; }
242
252
  .iv-cb.wo::after { content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 1.6px; margin-top: -.8px; background: var(--cz-ink3); transform: rotate(-45deg); }
@@ -253,7 +263,7 @@ button.iv-chip:hover { background: var(--cz-well) !important; }
253
263
  /* the date: a press; the start and due picker opens under it. No dates: a calendar icon on hover */
254
264
  .iv-dc { display: inline-flex !important; align-items: center; vertical-align: top; white-space: nowrap; gap: 4px; height: 22px; padding: 0 6px !important; margin: 0 -6px !important; border-radius: 999px !important; color: var(--cz-ink3) !important; font-weight: 600; }
255
265
  .iv-dc:hover, .iv-dc[aria-expanded="true"] { background: var(--cz-bluebg) !important; color: var(--cz-blueink) !important; }
256
- .iv-dc.w { color: var(--cz-risk) !important; font-weight: 700; }
266
+ .iv-dc.w { color: var(--cz-late) !important; font-weight: 700; } /* late says --cz-late everywhere (StsA1Desk) */
257
267
  .iv-dc.none { margin-left: 0 !important; opacity: 0; }
258
268
  .iv-tr:hover .iv-dc.none, .iv-dc.none:focus-visible, .iv-dc.none[aria-expanded="true"] { opacity: 1; }
259
269
  .iv-jm { width: 18px; height: 18px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-blueink); margin-top: 1px; }
@@ -290,7 +300,7 @@ button.iv-chip:hover { background: var(--cz-well) !important; }
290
300
  .ivt-gh b { flex: 1; min-width: 0; font-size: var(--fs-3); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
291
301
  .ivt-gh.mut b { color: var(--cz-ink3); font-weight: 700; }
292
302
  .ivt-gh .n, .ivt-df .n { font-size: var(--fs-2); color: var(--cz-ink3); font-weight: 700; white-space: nowrap; }
293
- .ivt-gh .n.w { color: var(--cz-risk); }
303
+ .ivt-gh .n.w { color: var(--cz-late); }
294
304
  .ivt-df { display: flex !important; align-items: center; gap: 8px; width: 100%; min-height: 40px; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink2); }
295
305
  .ivt-df .n { margin-left: auto; }
296
306
  .ivt-r.g .ivt-c { background: color-mix(in srgb, var(--cz-well) 40%, var(--cz-card)); }
@@ -298,13 +308,16 @@ button.iv-chip:hover { background: var(--cz-well) !important; }
298
308
  .ivt-grid { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
299
309
  .ivt-grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--cz-hair); }
300
310
  .ivt-band { position: absolute; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: color-mix(in srgb, var(--cz-blue) 16%, transparent); }
301
- .ivt-b { position: absolute !important; top: 50%; height: 20px; margin-top: -10px !important; border-radius: 999px !important; background: var(--cz-well2) !important; display: flex !important; align-items: center; justify-content: flex-end; padding: 0 3px !important; z-index: 1; touch-action: pan-y; }
311
+ .ivt-b { position: absolute !important; top: 50%; height: 20px; margin-top: -10px !important; border-radius: 999px !important; background: var(--cz-card) !important; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--cz-ink3) 55%, var(--cz-card)); display: flex !important; align-items: center; justify-content: flex-end; padding: 0 3px !important; z-index: 1; touch-action: pan-y; }
302
312
  .ivt-b[data-ivt-drag] { cursor: grab; }
303
313
  .ivt-b.drag { cursor: grabbing; box-shadow: 0 0 0 2px var(--cz-blue); z-index: 4; }
304
- .ivt-b.pr, .ivt-d.pr { background: color-mix(in srgb, var(--cz-blue) 30%, var(--cz-card)) !important; }
305
- .ivt-b.lt { background: color-mix(in srgb, var(--cz-risk) 30%, var(--cz-card)) !important; }
306
- .ivt-b.dn { background: color-mix(in srgb, var(--cz-ink3) 22%, var(--cz-card)) !important; }
307
- .ivt-b.jr { background: color-mix(in srgb, var(--cz-blueink) 22%, var(--cz-card)) !important; } /* a Jira ticket's days, kept in PMOS (batch 11 item 23) */
314
+ /* the bar wears its task box (StsA1Desk): To do hollow, In progress solid blue, Done grey, Won't do dashed. Late keeps the status fill and
315
+ * draws .ivt-late after the bar: a --cz-late line from the day after the due day to Today, ending in a dot. A Jira ticket's bar is the same. */
316
+ .ivt-b.pr { background: color-mix(in srgb, var(--cz-blue) 82%, var(--cz-card)) !important; box-shadow: none; }
317
+ .ivt-b.dn { background: color-mix(in srgb, var(--cz-ink3) 30%, var(--cz-card)) !important; box-shadow: none; }
318
+ .ivt-b.wo { background: transparent !important; box-shadow: none; outline: 1.5px dashed color-mix(in srgb, var(--cz-ink3) 55%, var(--cz-card)); outline-offset: -1.5px; }
319
+ .ivt-late { position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--cz-late); z-index: 1; pointer-events: auto; }
320
+ .ivt-late::after { content: ""; position: absolute; right: -4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--cz-late); }
308
321
  .ivt-gp { position: absolute; top: 3px; bottom: 3px; width: 6px; border-radius: 3px; background: var(--cz-card); box-shadow: 0 0 0 1px var(--cz-hair); cursor: ew-resize; opacity: 0; }
309
322
  .ivt-gp.l { left: 2px; } .ivt-gp.r { right: 2px; }
310
323
  .ivt-b:hover .ivt-gp, .ivt-b.drag .ivt-gp { opacity: 1; }
@@ -312,9 +325,10 @@ button.iv-chip:hover { background: var(--cz-well) !important; }
312
325
  .ivt-b .ivt-av { pointer-events: none; }
313
326
  .ivt-d { position: absolute !important; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px !important; border-radius: 50% !important; background: var(--cz-card) !important; border: 2.5px solid var(--cz-ink3) !important; z-index: 1; }
314
327
  .ivt-d.pr { border-color: var(--cz-blue) !important; }
315
- .ivt-d.lt { border-color: var(--cz-risk) !important; }
328
+ .ivt-d.to { border-color: color-mix(in srgb, var(--cz-ink3) 55%, var(--cz-card)) !important; }
329
+ .ivt-d.pr:not(.ms) { background: var(--cz-blue) !important; }
316
330
  .ivt-d.dn { border-color: color-mix(in srgb, var(--cz-ink3) 40%, var(--cz-card)) !important; }
317
- .ivt-d.jr { border-color: var(--cz-blueink) !important; border-radius: 2px !important; transform: rotate(45deg); }
331
+ .ivt-d.wo { border-style: dashed !important; }
318
332
  .ivt-g { position: absolute !important; top: 50%; height: 20px; width: 36px; margin-top: -10px !important; border-radius: 999px !important; border: 1.5px dashed color-mix(in srgb, var(--cz-ink3) 50%, var(--cz-card)) !important; display: inline-flex !important; align-items: center; justify-content: center; color: var(--cz-ink3) !important; z-index: 1; }
319
333
  .ivt-g:hover { border-color: var(--cz-blue) !important; color: var(--cz-blueink) !important; }
320
334
  .ivt-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--cz-solid); color: var(--cz-onsolid); font-size: var(--fs-2); font-weight: 700; padding: 3px 8px; border-radius: 8px; white-space: nowrap; pointer-events: none; }
@@ -323,10 +337,42 @@ button.iv-chip:hover { background: var(--cz-well) !important; }
323
337
  .ivt-lg { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-2); color: var(--cz-ink3); padding: 8px 4px 0; }
324
338
  .ivt-lg span { display: inline-flex; align-items: center; gap: 6px; }
325
339
  .ivt-lg i { display: inline-block; width: 18px; height: 8px; border-radius: 4px; background: var(--cz-well2); }
326
- .ivt-lg i.pr { background: color-mix(in srgb, var(--cz-blue) 30%, var(--cz-card)); }
327
- .ivt-lg i.lt { background: color-mix(in srgb, var(--cz-risk) 30%, var(--cz-card)); }
328
340
  .ivt-lg i.dd { width: 10px; height: 10px; border-radius: 50%; background: var(--cz-card); border: 2px solid var(--cz-ink3); }
329
341
  .ivt-lg .h { margin-left: auto; }
342
+ /* the columns (StsA5Columns): Task, then Key, Status, Start, Due, Owner as the PM keeps them (the view sheet's Columns). Each cell's width is
343
+ * its place's --tl-cNw (ini-tasks.js place); the name column is the title's room plus theirs. A narrow panel hides them from the right,
344
+ * zeroing the width it hides; a phone shows none (the title sits above its bar). The box shows once: in Status, or before the title. */
345
+ .ivt.cols { --nw: calc(clamp(150px, 24cqw, 280px) + var(--tl-c1w, 0px) + var(--tl-c2w, 0px) + var(--tl-c3w, 0px) + var(--tl-c4w, 0px) + var(--tl-c5w, 0px)); }
346
+ .ivt.cols .ivt-n { gap: 0; }
347
+ .ivt-t { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
348
+ .ivt-r.ax .ivt-t, .ivt-r.ax .ivt-col { font-size: var(--fs-1); font-weight: 700; color: var(--cz-ink3); }
349
+ .ivt-col { flex: none; box-sizing: border-box; padding-left: 8px; display: flex; align-items: center; min-width: 0; font-size: var(--fs-2); color: var(--cz-ink2); white-space: nowrap; overflow: hidden; }
350
+ .ivt-col.p1 { width: var(--tl-c1w); } .ivt-col.p2 { width: var(--tl-c2w); } .ivt-col.p3 { width: var(--tl-c3w); } .ivt-col.p4 { width: var(--tl-c4w); } .ivt-col.p5 { width: var(--tl-c5w); }
351
+ .ivt-col .lt { color: var(--cz-late); font-weight: 700; }
352
+ .ivt-key { font-size: var(--fs-2); font-weight: 700; color: var(--cz-blueink) !important; text-decoration: underline; text-underline-offset: 2px; padding: 0 !important; min-height: 0 !important; }
353
+ .ivt-st { display: inline-flex !important; align-items: center; gap: 7px; height: 28px; padding: 0 8px 0 4px !important; margin-left: -4px; border-radius: 8px !important; font-size: var(--fs-2); color: var(--cz-ink2) !important; white-space: nowrap; min-height: 0 !important; }
354
+ .ivt-st .iv-cb { margin-top: 0 !important; }
355
+ button.ivt-st:hover, button.ivt-st[aria-expanded="true"] { background: var(--cz-well) !important; }
356
+ .ivt-st.dr .iv-cb { border-style: dashed !important; border-radius: 50% !important; }
357
+ .ivt-bx, .ivt-t > .iva-mg { display: inline-flex; flex: none; }
358
+ @container (min-width: 521px) {
359
+ .ivt.cols .ivt-bx[class*="bx-p"] { display: none; }
360
+ .ivt.cols .ivt-wn[class*="wn-p"] { display: none; }
361
+ }
362
+ @container (max-width: 939px) { .ivt.cols { --tl-c5w: 0px !important; } .ivt-col.p5 { display: none; } .ivt-bx.bx-p5, .ivt-wn.wn-p5 { display: inline-flex !important; } }
363
+ @container (max-width: 859px) { .ivt.cols { --tl-c4w: 0px !important; } .ivt-col.p4 { display: none; } .ivt-bx.bx-p4, .ivt-wn.wn-p4 { display: inline-flex !important; } }
364
+ @container (max-width: 759px) { .ivt.cols { --tl-c3w: 0px !important; } .ivt-col.p3 { display: none; } .ivt-bx.bx-p3, .ivt-wn.wn-p3 { display: inline-flex !important; } }
365
+ @container (max-width: 679px) { .ivt.cols { --tl-c2w: 0px !important; } .ivt-col.p2 { display: none; } .ivt-bx.bx-p2, .ivt-wn.wn-p2 { display: inline-flex !important; } }
366
+ @container (max-width: 559px) { .ivt.cols { --tl-c1w: 0px !important; } .ivt-col.p1 { display: none; } .ivt-bx.bx-p1, .ivt-wn.wn-p1 { display: inline-flex !important; } }
367
+ /* the view sheet's Columns (StsA7Picker): a check box for each, two to a row; Task always */
368
+ .ivs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
369
+ .ivs-ck { display: flex !important; align-items: center; gap: 10px; height: 36px; padding: 0 6px !important; border-radius: 10px !important; font-size: var(--fs-3); font-weight: 600; color: var(--cz-ink) !important; text-align: left; }
370
+ .ivs-ck:hover { background: var(--cz-well) !important; }
371
+ .ivs-ck[aria-disabled="true"] { cursor: default; background: transparent !important; }
372
+ .ivs-ck i { width: 18px; height: 18px; border-radius: 5px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1.6px solid color-mix(in srgb, var(--cz-ink3) 60%, var(--cz-card)); color: var(--cz-card); box-sizing: border-box; }
373
+ .ivs-ck.on i { background: var(--cz-blue); border-color: var(--cz-blue); }
374
+ .ivs-ck small { margin-left: auto; font-size: var(--fs-1); font-weight: 600; color: var(--cz-ink3); }
375
+
330
376
  /* a phone: the title sits above its bar; no drag (tap a bar for the picker) */
331
377
  @container (max-width: 520px) {
332
378
  .ivt { --nw: 0px; }
@@ -358,7 +404,7 @@ button.iv-chip:hover { background: var(--cz-well) !important; }
358
404
  .ivk-d { background: var(--cz-card); border-radius: 12px; border: 1px solid var(--cz-hair); padding: 9px 9px 7px; display: flex; gap: 9px; align-items: flex-start; min-width: 0; }
359
405
  .ivk-d[draggable="true"] { cursor: grab; }
360
406
  .ivk-d.drag { opacity: .5; }
361
- .ivk-d .w { flex: 1; min-width: 0; color: inherit; font-weight: 400; display: flex; flex-direction: column; gap: 2px; }
407
+ .ivk-d > .w { flex: 1; min-width: 0; color: inherit; font-weight: 400; display: flex; flex-direction: column; gap: 2px; }
362
408
  .ivk-d .iv-tt { font-size: var(--fs-3); line-height: 1.3; overflow-wrap: anywhere; }
363
409
  .ivk-d.x .iv-tt { color: var(--cz-ink3); font-weight: 600; }
364
410
  .ivk-m { display: flex; align-items: center; gap: 6px; font-size: var(--fs-2); color: var(--cz-ink3); min-height: 22px; }
@@ -775,10 +821,13 @@ button.lk-mt:hover { color: var(--cz-ink) !important; }
775
821
  .iva-md.st { width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px !important; }
776
822
  .iva-md.dn { background: var(--cz-ink3) !important; border-color: var(--cz-ink3) !important; }
777
823
  .iva-md.lt { border-color: var(--cz-late) !important; }
778
- .iva-tb { position: absolute; top: 50%; height: 10px; margin-top: -5px !important; border-radius: 5px !important; background: var(--cz-well2) !important; z-index: 1; padding: 0 !important; min-width: 6px; }
779
- .iva-tb.pr { background: color-mix(in srgb, var(--cz-blue) 45%, var(--cz-card)) !important; }
780
- .iva-tb.lt { background: color-mix(in srgb, var(--cz-late) 45%, var(--cz-card)) !important; }
781
- .iva-tb.dn { background: color-mix(in srgb, var(--cz-ink3) 30%, var(--cz-card)) !important; }
824
+ .iva-tb { position: absolute; top: 50%; height: 10px; margin-top: -5px !important; border-radius: 5px !important; background: var(--cz-card) !important; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--cz-ink3) 55%, var(--cz-card)); z-index: 1; padding: 0 !important; min-width: 6px; }
825
+ .iva-tb.pr { background: color-mix(in srgb, var(--cz-blue) 82%, var(--cz-card)) !important; box-shadow: none; }
826
+ .iva-tb.dn { background: color-mix(in srgb, var(--cz-ink3) 30%, var(--cz-card)) !important; box-shadow: none; }
827
+ .iva-tb.wo { background: transparent !important; box-shadow: none; outline: 1.5px dashed color-mix(in srgb, var(--cz-ink3) 55%, var(--cz-card)); outline-offset: -1.5px; }
828
+ /* a late task on the stage card: its status fill, then a 3 px --cz-late line to Today with a dot (StsA2Stage) */
829
+ .iva-late { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--cz-late); z-index: 1; }
830
+ .iva-late::after { content: ""; position: absolute; right: -3.5px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--cz-late); }
782
831
  .iva-tb.dr { background: transparent !important; outline: 1.5px dashed var(--cz-ink3); outline-offset: -1.5px; }
783
832
  .iva-r.k .iv-bxw { align-self: center; }
784
833
  .iva-r.k .iv-cb { margin-top: 0 !important; }
@@ -796,7 +845,7 @@ button.iva-tb:hover, button.iva-r.g:not(:disabled):hover { filter: brightness(.9
796
845
  .iva-r.g.nm .iva-l, .iva-r.k .iva-l { position: absolute; top: 5px; width: auto; --at: max(0px, min((100% - var(--an) - 14px) * var(--tl-p, 0), 100% - var(--an) - 234px)); left: calc(var(--an) + var(--at)); max-width: calc(100% - var(--an) - var(--at) - 8px); padding: 0; z-index: 3; gap: 5px; }
797
846
  .iva-r.g.nm .iva-l small, .iva-r.g.nm .iva-ch { display: none; }
798
847
  .iva-r.g.nm .iva-l b { font-size: var(--fs-2); }
799
- .iva-r.g.nm .iva-b, .iva-r.g.nm .iva-md, .iva-r.k .iva-tb, .iva-r.k .iva-md { top: 32px; }
848
+ .iva-r.g.nm .iva-b, .iva-r.g.nm .iva-md, .iva-r.k .iva-tb, .iva-r.k .iva-md, .iva-r.k .iva-late { top: 32px; }
800
849
  .iva-r.k .iva-n, .iva-r.k .iva-l { padding-left: 0; }
801
850
  .iva-r.k .iva-l { padding-left: 0; }
802
851
  .iva-r.k .iva-mg { display: none; }
@@ -176,7 +176,7 @@ function taskHtml(x, o, arch) {
176
176
  // the box marks done in one press; its caret opens the status picker right under it (an archived task has only the caret)
177
177
  const car = o.quick && x.uid ? `<button type="button" class="iv-car" data-iv-stat="${esc(x.uid)}" data-st="${esc(x.status)}" data-ms="${x.ms ? 1 : 0}" aria-haspopup="dialog" aria-label="${esc('Change the status: ' + x.title)}" title="Status">${SVG(P.down, 10, 2.6)}</button>` : '';
178
178
  const cls = ['iv-cb', x.done ? 'on' : '', x.prog ? 'pr' : '', x.wont ? 'wo' : ''].filter(Boolean).join(' ');
179
- const chk = x.jkey && !x.dr ? `<span class="iv-bxw">${TV.jqMark(x)}${arch ? car : ''}</span>` : x.dr ? `<span class="iv-bxw"><span class="iv-cb dr" aria-hidden="true"></span>${car}</span>` : x.canCheck && !arch ? `<span class="iv-bxw"><button type="button" class="${cls}" data-iv-check="${esc(x.uid)}" aria-pressed="${x.done}" aria-label="${esc((x.done ? 'Reopen: ' : 'Mark done: ') + x.title)}" title="${x.done ? 'Reopen' : 'Mark done'}">${x.done ? SVG(P.check, 12, 3) : ''}</button>${car}</span>`
179
+ const chk = x.jkey && !x.dr ? `<span class="iv-bxw">${TV.jqMark(x)}${arch ? car : TV.jcar(x.jkey, x.status, x.jst, x.title, o)}</span>` : x.dr ? `<span class="iv-bxw"><span class="iv-cb dr" aria-hidden="true"></span>${car}</span>` : x.canCheck && !arch ? `<span class="iv-bxw"><button type="button" class="${cls}" data-iv-check="${esc(x.uid)}" aria-pressed="${x.done}" aria-label="${esc((x.done ? 'Reopen: ' : 'Mark done: ') + x.title)}" title="${x.done ? 'Reopen' : 'Mark done'}">${x.done ? SVG(P.check, 12, 3) : ''}</button>${car}</span>`
180
180
  : `<span class="iv-bxw"><span class="iv-cb off${x.done ? ' on' : ''}" aria-hidden="true">${x.done ? SVG(P.check, 12, 3) : ''}</span>${arch ? car : ''}</span>`;
181
181
  // a task linked to the Jira ticket it names looks like the ticket rows beside it (batch 14 item 6): the Jira square, the key in blue.
182
182
  // A key PMOS has not read is only text: a plain task with its box (0.442.0 hotfix)
@@ -191,7 +191,7 @@ function taskHtml(x, o, arch) {
191
191
  if (edit) {
192
192
  // one line (StA1Rows): the title, then at the right its days (a phone: the due day only; nothing without dates), the late days, the
193
193
  // links' marks and the owner's face (a desktop)
194
- const parts = [x.days ? TV.dateBtn(x, o) + (x.lateText ? `<span class="iv-late">, ${esc(x.lateText)}</span>` : '') + TV.slipHtml(x) : TV.msNoDate(x) ? TV.dateBtn(x, o) : '', LK.metaHtml(x, o.lk, o.quick)].filter(Boolean);
194
+ const parts = [x.jkey ? TV.movingHtml(x.jmove) : '', x.days ? TV.dateBtn(x, o) + (x.lateText ? `<span class="iv-late">, ${esc(x.lateText)}</span>` : '') + TV.slipHtml(x) : TV.msNoDate(x) ? TV.dateBtn(x, o) : '', LK.metaHtml(x, o.lk, o.quick)].filter(Boolean);
195
195
  const av = x.av && x.owner && x.owner !== 'You' ? `<span class="iv-av iv-rav" role="img" aria-label="${esc('Owner: ' + x.owner)}" title="${esc(x.owner)}">${esc(x.av)}</span>` : '';
196
196
  const grip = lift ? `<span class="iv-grip" data-iv-grip="${esc(x.uid)}" title="Drag to move" aria-hidden="true">${SVG(GRIP, 16, 3)}</span>` : '';
197
197
  // Your groups (batch 11 item 20): a task still drags to another of the PM's groups
@@ -202,7 +202,7 @@ function taskHtml(x, o, arch) {
202
202
  let meta = x.sub ? `<span class="${x.late ? 'w' : ''}">${esc(x.sub)}</span>` : '';
203
203
  if (o.quick && x.uid) {
204
204
  // no dates: the calendar icon sits last and shows on hover, so an undated row reads the same as before
205
- const parts = [x.prog ? 'In progress' : '', x.days ? TV.dateBtn(x, o) + (x.lateText ? `<span class="iv-late">, ${esc(x.lateText)}</span>` : '') + TV.slipHtml(x) : '', LK.metaHtml(x, o.lk, o.quick), x.owner && x.owner !== 'You' ? esc(x.owner) : ''];
205
+ const parts = [x.jkey ? TV.movingHtml(x.jmove) : '', x.prog && !(x.jmove && x.jmove.state === 'moving') ? 'In progress' : '', x.days ? TV.dateBtn(x, o) + (x.lateText ? `<span class="iv-late">, ${esc(x.lateText)}</span>` : '') + TV.slipHtml(x) : '', LK.metaHtml(x, o.lk, o.quick), x.owner && x.owner !== 'You' ? esc(x.owner) : ''];
206
206
  meta = `<span class="iv-rm">${parts.filter(Boolean).join('<span class="iv-sep" aria-hidden="true"> · </span>')}${x.days ? '' : TV.dateBtn(x, o)}</span>`;
207
207
  } else if (TV.msNoDate(x)) {
208
208
  meta = `<span class="iv-rm">${x.sub ? `<span>${esc(x.sub)}</span> ` : ''}<span class="iv-dc ms">Set the due date</span></span>`;
@@ -225,7 +225,7 @@ function bodyHtml(v, sec, o) {
225
225
  // batch 18 item 16 (StA6Jira): its title opens it in place: Jira's title and status read-only, the start and due kept in PMOS
226
226
  h += shown.map((k) => o.quick && o.ivId && ED.openOf(o.ivId) === k.key ? ED.ticketHtml(k, o)
227
227
  : o.quick
228
- ? `<div class="iv-tr iv-tkr"><span class="iv-jq" aria-hidden="true"></span><span class="w"><button type="button" class="iv-tt" ${o.ivId ? 'data-iv-edit' : 'data-iv-ticket'}="${esc(k.key)}"><em>${esc(k.key)}</em> ${esc(k.title)}</button><span class="iv-rm"><span class="${k.warn ? 'w' : ''}">${esc(k.sub)}</span>${k.days ? '<span class="iv-sep" aria-hidden="true"> · </span>' : ''}${TV.dateBtn(TV.jiraRow(k), o)}</span></span></div>`
228
+ ? `<div class="iv-tr iv-tkr"><span class="iv-bxw"><span class="iv-jq${k.move && k.move.state === 'moving' ? ' mv' : ''}" aria-hidden="true"></span>${TV.jcar(k.key, k.status, k.raw, k.key + ' ' + k.title, o)}</span><span class="w"><button type="button" class="iv-tt" ${o.ivId ? 'data-iv-edit' : 'data-iv-ticket'}="${esc(k.key)}"><em>${esc(k.key)}</em> ${esc(k.title)}</button><span class="iv-rm">${TV.movingHtml(k.move) || `<span class="${k.warn ? 'w' : ''}">${esc(k.sub)}</span>`}${k.days ? '<span class="iv-sep" aria-hidden="true"> · </span>' : ''}${TV.dateBtn(TV.jiraRow(k), o)}</span></span></div>`
229
229
  : `<button type="button" class="iv-tr iv-tk" data-iv-ticket="${esc(k.key)}"><span class="iv-jq" aria-hidden="true"></span><span class="w"><b class="iv-tt"><em>${esc(k.key)}</em> ${esc(k.title)}</b><span class="${k.warn ? 'w' : ''}">${esc(k.sub)}</span></span></button>`).join('');
230
230
  if (sec.jira.open.length > shown.length) h += `<button type="button" class="iv-more" data-iv-fold="${esc(sec.key + ':tk')}" aria-expanded="false">${esc((sec.jira.open.length - shown.length) + ' more open' + (byEp.size > 1 ? ' · by epic' : ''))}${SVG(P.right, 14, 2)}</button>`;
231
231
  h += `<p class="iv-q">${esc(sec.jira.done + ' of ' + sec.jira.total + ' done in Jira' + (sec.jira.at ? ' · ' + sec.jira.at : ''))}</p>`;
@@ -22,6 +22,15 @@ export function kindLine(row) {
22
22
  /** A workflow's stages in order, a milestone marked ◆. */
23
23
  export const chainText = (wf) => ((wf && wf.stages) || []).map((s) => (s.milestone ? '◆\u00a0' : '') + s.name).join(' → ');
24
24
 
25
+ /** Several libraries (GET /api/workflows of the initiative's workspace, then of the home workspace) as one list: the first list wins for an id
26
+ * both hold; Product feature first, then by name, archived last (as the server sorts one library). */
27
+ export function mergeLibraries(...lists) {
28
+ const byId = new Map();
29
+ for (const l of lists) for (const w of l || []) if (w && w.id && !byId.has(w.id)) byId.set(w.id, w);
30
+ const rank = (w) => (w.id === 'product-feature' ? 0 : w.archived ? 2 : 1);
31
+ return [...byId.values()].sort((a, b) => rank(a) - rank(b) || String(a.name || '').localeCompare(String(b.name || '')));
32
+ }
33
+
25
34
  /** The Change picker: every workflow that is not archived (Product feature first, as GET /api/workflows answers), with its stage count. */
26
35
  export function pickerItems(lib, row) {
27
36
  const cur = wfOf(row).id;
@@ -19,15 +19,20 @@ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&':
19
19
  const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
20
20
  const NEXT = 'M5 12h14M13 6l6 6-6 6', PLUS = 'M12 5v14M5 12h14', CLOSE = 'M6 6l12 12M18 6L6 18';
21
21
 
22
- /* ── the library (GET /api/workflows), read again on each picker ── */
23
- const LIB = { list: null, at: 0 };
24
- export async function library(ui, force) {
25
- if (!force && LIB.list && Date.now() - LIB.at < 15000) return LIB.list;
26
- const r = await ui.pmGet('/api/workflows');
27
- if (r && r.ok && Array.isArray(r.workflows)) { LIB.list = r.workflows; LIB.at = Date.now(); }
22
+ /* ── the library (GET /api/workflows), read again on each picker ──
23
+ * Settings › Workflows saves to the home workspace's library, and an initiative may sit in another workspace (a product). The picker lists both,
24
+ * the initiative's own workspace first for a workflow both have; a switch to one only the home library holds is written into the initiative's
25
+ * workspace by the server. */
26
+ const LIB = { list: null, at: 0, ws: '' };
27
+ export async function library(ui, force, ws = '') {
28
+ if (!force && LIB.list && LIB.ws === ws && Date.now() - LIB.at < 15000) return LIB.list;
29
+ const [home, own] = await Promise.all([ui.pmGet('/api/workflows'), ws ? ui.pmGet('/api/workflows?ws=' + encodeURIComponent(ws)) : null]);
30
+ const lists = [own, home].filter((r) => r && r.ok && Array.isArray(r.workflows)).map((r) => r.workflows);
31
+ if (lists.length) { LIB.list = WM.mergeLibraries(...lists); LIB.at = Date.now(); LIB.ws = ws; }
28
32
  return LIB.list || [];
29
33
  }
30
- export const _lib = (list) => { LIB.list = list; LIB.at = list ? Date.now() : 0; }; // for a test
34
+ export const _lib = (list) => { LIB.list = list; LIB.at = list ? Date.now() : 0; LIB.ws = ''; }; // for a test
35
+ const wsOf = (ui, id) => { try { return (ui.bw(id) || {}).ws || ''; } catch { return ''; } };
31
36
 
32
37
  async function after(ui, r, ok) {
33
38
  if (!r || r.ok === false) { ui.toast((r && r.error) || 'Nothing was changed.'); return false; }
@@ -39,7 +44,7 @@ async function after(ui, r, ok) {
39
44
  /* ── the Change picker (WfTriage) ── */
40
45
  export async function openPicker(anchor, ui, id) {
41
46
  const row = ui.row(id) || {};
42
- const lib = await library(ui);
47
+ const lib = await library(ui, false, wsOf(ui, id));
43
48
  const items = WM.pickerItems(lib, row);
44
49
  const cur = lib.find((w) => w.id === ((row.wf || {}).id || 'product-feature'));
45
50
  const by = WM.setByPmos(row);
@@ -68,7 +73,7 @@ function newWorkflow(ui, id) {
68
73
  /* ── switch to another workflow (WfAChange) ── */
69
74
  export async function openSwitch(anchor, ui, id, wfId) {
70
75
  const row = ui.row(id) || {};
71
- const lib = await library(ui);
76
+ const lib = await library(ui, false, wsOf(ui, id));
72
77
  const to = lib.find((w) => w.id === wfId);
73
78
  if (!to) { ui.toast('That workflow could not be read.'); return; }
74
79
  const title = ui.title(id), fromWf = row.wf || { name: 'Product feature', icon: 'feature' };
@@ -0,0 +1,55 @@
1
+ /* pm/ins-pane.js — Intelligence as the first panel (panels on Board and Intelligence, P-B; canvas In development BiI1Split to BiI4Wide, sticky
2
+ * "What to build" items 0, 3 and 5). What the panels engine (cozy-panels.js mountPanels) needs from the page, the narrow form, the Moved by
3
+ * column that steps aside, and the open row's mark.
4
+ * SOURCES the goal and budget rows and the goal cards: a drag on the row or ⌘/Ctrl-click opens it beside.
5
+ * fit() the px the key results table needs to be whole without Moved by: about 880. Under it the page shows its goal cards.
6
+ * mount({ page, table, selecting() }) once: the narrow form (pm/pn-narrow.js), Moved by, and the mark that follows the open Viewers. */
7
+ import { narrowForm } from './pn-narrow.js';
8
+ import { panels, onChange as vwChange } from './cozy-viewer.js';
9
+
10
+ export const SOURCES = '#goalTbl .ins-row[data-goal], #goalTbl .ins-row[data-budget], #goalCards .ins-card[data-goal]';
11
+ export const fit = () => 880;
12
+ const MV = 150; // the narrowest Moved by that still reads: its dots and an initiative's name
13
+
14
+ /** The ids an open Viewer shows: goal:<id> and budget:<id>, each Viewer's. */
15
+ export function openIds(list) {
16
+ const out = { goal: new Set(), budget: new Set() };
17
+ for (const p of list || []) {
18
+ const m = p.open && p.item && /^(goal|budget):(.+)$/.exec(p.item.id || '');
19
+ if (m) out[m[1]].add(m[2]);
20
+ }
21
+ return out;
22
+ }
23
+
24
+ let S = null;
25
+ /** Mark the rows and cards an open Viewer shows (BiI1Split: blue, its left edge). While goals are picked for a dashboard the pick keeps .sel. */
26
+ export function markOpen() {
27
+ if (!S) return;
28
+ const ids = openIds(panels.list()), pick = S.selecting();
29
+ document.querySelectorAll('#goalTbl .ins-row[data-goal], #goalTbl .ins-row[data-budget], #goalCards .ins-card[data-goal]').forEach((r) => {
30
+ const on = r.dataset.goal != null ? ids.goal.has(r.dataset.goal) : ids.budget.has(r.dataset.budget);
31
+ r.classList.toggle('vwo', on);
32
+ if (!pick) r.classList.toggle('sel', on);
33
+ });
34
+ }
35
+
36
+ /** Moved by steps aside while the table is too narrow for it (BiI1Split); it comes back once the table is as wide as when it left. */
37
+ function movedBy() {
38
+ const T = S.table, page = S.page;
39
+ if (!T || T.hidden || page.classList.contains('cz-pn-narrow')) return;
40
+ const w = T.clientWidth; if (!w) return;
41
+ if (page.classList.contains('ins-nomv')) { if (S.back && w >= S.back) { page.classList.remove('ins-nomv'); S.back = 0; } return; }
42
+ const h = T.querySelector('.ins-th .ins-mvh'); if (!h) return;
43
+ const mw = h.getBoundingClientRect().width;
44
+ if (mw < MV) { S.back = w + (MV - mw); page.classList.add('ins-nomv'); }
45
+ }
46
+
47
+ export function mount(o = {}) {
48
+ if (S) return;
49
+ S = { page: o.page, table: o.table, selecting: o.selecting || (() => false), back: 0 };
50
+ narrowForm({ page: o.page, sheets: /\/pm\/(cozy-insights|premium-report-intel)\.css(\?|$)/, onChange: () => { movedBy(); markOpen(); } });
51
+ if (typeof ResizeObserver === 'function' && o.table) new ResizeObserver(() => movedBy()).observe(o.table);
52
+ vwChange(() => markOpen());
53
+ }
54
+ /** After the table is drawn again: its Moved by and marks. */
55
+ export function drawn() { if (!S) return; movedBy(); markOpen(); }
@@ -0,0 +1,50 @@
1
+ /* pm/jira-move.js — a Jira ticket's status moved from PMOS (Wawan 2026-10-29 "why can't move Jira task here on PMOS?"; main canvas page
2
+ * "Exploring · Move Jira tasks", JmA1Kanban, JmA3States). A Kanban drag, or the status press on the List or the Timeline, asks the move:
3
+ * POST /api/jira/move. The server writes it and starts the jira-move agent, which moves the ticket with the PM's own Atlassian connection
4
+ * (PMOS holds no Jira login, D53). Until Jira answers, the next read draws the ticket in its new place as "Moving in Jira"; this file asks
5
+ * GET /api/jira/move every few seconds and says what Jira did in the host's toast: moved (with Undo, the same move back), refused (Jira's
6
+ * reason), or not reached.
7
+ *
8
+ * move(H, { key, to, from, fromRaw }) H: the Tasks host (where, reload, toast, __id); to/from: To do | In progress | Done
9
+ * TO the three states a Jira ticket offers here (Won't do and Archive stay PMOS-only) */
10
+ import { pmPost } from './http.js';
11
+
12
+ export const TO = ['To do', 'In progress', 'Done'];
13
+ const EVERY = 4000, FOR = 16 * 60 * 1000;
14
+ const WATCH = new Map(); // move id → true while this page waits on it
15
+ const say = (H, m, undo) => { if (H && H.toast) H.toast(m, undo); };
16
+ const after = async (H) => { if (H && H.reload) await H.reload(); else if (H && H.redraw) H.redraw(); };
17
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
18
+
19
+ async function read(ws, id) {
20
+ try { const r = await fetch('/api/jira/move?' + new URLSearchParams({ ...(ws ? { ws } : {}), id }), { credentials: 'same-origin' }); return await r.json(); } catch { return null; }
21
+ }
22
+ async function watch(H, ws, id, m) {
23
+ if (WATCH.has(id)) return;
24
+ WATCH.set(id, true);
25
+ const t0 = Date.now();
26
+ try {
27
+ while (Date.now() - t0 < FOR) {
28
+ await sleep(EVERY);
29
+ const r = await read(ws, id), x = r && r.ok ? r.move : null;
30
+ if (r && r.ok === false && /newer move/.test(r.error || '')) return; // a newer move of the ticket took over; its own watch speaks
31
+ if (!x || x.state === 'moving') continue;
32
+ await after(H);
33
+ if (x.state === 'moved') { say(H, `${m.key} is ${x.status || x.to} in Jira.`, m.from && m.from !== m.to ? () => move(H, { key: m.key, to: m.from, from: m.to, fromRaw: x.status || '' }) : undefined); return; }
34
+ if (x.state === 'refused') { say(H, `Jira kept ${m.key} in ${m.fromRaw || m.from || 'its status'}: ${String(x.why || 'Jira did not say why').replace(/\.$/, '')}.`); return; }
35
+ if (x.state === 'stale') break;
36
+ }
37
+ say(H, `Jira did not answer. ${m.key} stays in ${m.fromRaw || m.from || 'its status'} until it does.`);
38
+ } finally { WATCH.delete(id); }
39
+ }
40
+ /** Ask Jira to move one ticket. → true when the move was asked. */
41
+ export async function move(H, m) {
42
+ if (!m || !m.key || !TO.includes(m.to) || m.to === m.from) return false;
43
+ const at = H && H.where ? H.where() : {}, ini = H && H.__id ? H.__id() : '';
44
+ const r = await pmPost('/api/jira/move', { ws: at.ws, initiative: ini, key: m.key, to: m.to, from: m.from || '', fromRaw: m.fromRaw || '' }).catch(() => null);
45
+ if (!r || r.ok === false) { say(H, (r && r.error) || `Jira was not asked: ${m.key} stays where it is.`); await after(H); return false; }
46
+ if (r.unchanged) return false;
47
+ await after(H);
48
+ watch(H, at.ws, r.id, m);
49
+ return true;
50
+ }
@@ -85,13 +85,13 @@ export function keepOrder(prev, items) {
85
85
  return prev.map((p) => by.get(p.id)).filter(Boolean);
86
86
  }
87
87
 
88
- const WORD = { ask: 'asks you', run: 'running', stop: 'stopped, open it to restart', done: 'finished, not read yet' };
88
+ const WORD = { ask: 'asks you', run: 'running', stop: 'stopped, open it to restart', done: 'finished, not read yet', away: 'put away, open it to bring it back' };
89
89
  /** The pill's name for a screen reader and its tooltip: what is live, by kind, then the key. */
90
90
  export function pillLabel(items, { mac = false } = {}) {
91
91
  const parts = [];
92
92
  const r = items.find((x) => x.kind === 'rec');
93
93
  if (r) parts.push((r.paused ? 'recording paused at ' : 'recording ') + r.time);
94
- for (const k of ['ask', 'run', 'stop', 'done']) {
94
+ for (const k of ['ask', 'run', 'stop', 'done', 'away']) {
95
95
  const n = items.filter((x) => x.mark === k).length;
96
96
  if (n) parts.push(n + ' ' + WORD[k]);
97
97
  }
@@ -99,6 +99,7 @@ export function pillLabel(items, { mac = false } = {}) {
99
99
  }
100
100
  /** One row's spoken name: its name, its state, when the PM last touched it, and "open now" for the one on screen. */
101
101
  export function rowLabel(x) {
102
+ if (x.kind === 'away') return x.name + ', ' + WORD.away; // a panel put away (cozy-panels.js): no time
102
103
  const st = x.kind === 'rec' ? (x.paused ? 'recording, paused' : 'recording') : WORD[x.mark];
103
104
  return x.name + ', ' + st + (x.kind === 'rec' ? ', ' + x.time : ', last touched ' + x.time) + (x.open ? ', open now' : '');
104
105
  }
@@ -0,0 +1,76 @@
1
+ /* pm/pn-narrow.js — a page's narrow form, keyed on its panel's width and not the window's (panels on Board and Intelligence, P-B; canvas
2
+ * In development BiB2Half, BiI2Half, sticky "What to build" item 3).
3
+ *
4
+ * The panels engine (cozy-panels.js) puts the class cz-pn-narrow on the page element while the page panel is narrower than the page's fit().
5
+ * The narrow form is the page's phone form, so the phone CSS stays the one source: for each of the page's own style sheets, every rule in a
6
+ * phone media block (max-width up to 760 px) is copied right after the block, scoped to the narrow page element and what is inside it; every
7
+ * rule in a desktop-only block (min-width 721 px or more) is narrowed so it does not match there. The cascade order and the specificity stay
8
+ * as written (:is() and :where()). The shell (the menu, the Live pill, popovers on the body) and the shared sheets keep their desktop look, and
9
+ * a phone is exactly as before, because the copies match only under the class.
10
+ *
11
+ * narrowForm({ page, sheets: RegExp, onChange?(narrow) }) → { narrow() } once, on the page. sheets: the hrefs of the page's own sheets
12
+ * (a sheet the page adds later is scoped when it loads). onChange runs when the class comes or goes. */
13
+ const N = '.cz-pn-narrow';
14
+ const IN = `:where(${N}, ${N} *)`, OUT = `:where(:not(${N}, ${N} *))`;
15
+ const PH = /\(max-width:\s*(\d+)px\)/, DESK = /\(min-width:\s*(\d+)px\)/;
16
+ const done = new WeakSet();
17
+
18
+ /** The top-level parts of a selector list (commas inside :is(), :not() and [..] stay put). */
19
+ function parts(sel) {
20
+ const out = []; let d = 0, q = '', cur = '';
21
+ for (const c of sel) {
22
+ if (q) { if (c === q) q = ''; cur += c; continue; }
23
+ if (c === '"' || c === "'") q = c;
24
+ else if (c === '(' || c === '[') d++;
25
+ else if (c === ')' || c === ']') d--;
26
+ else if (c === ',' && !d) { out.push(cur.trim()); cur = ''; continue; }
27
+ cur += c;
28
+ }
29
+ if (cur.trim()) out.push(cur.trim());
30
+ return out;
31
+ }
32
+ /** One selector with the guard added; a pseudo-element stays last, where it must be. */
33
+ function guard(one, g) {
34
+ const m = /(::[\w-]+(\([^)]*\))?(:[\w-]+)*|:(before|after|first-line|first-letter))$/.exec(one);
35
+ const base = m ? one.slice(0, m.index) : one, tail = m ? m[0] : '';
36
+ return `:is(${base || '*'})${g}${tail}`;
37
+ }
38
+ export const scoped = (sel, g = IN) => parts(sel).map((x) => guard(x, g)).join(', ');
39
+
40
+ /** A media block's kind: 'phone' (max-width up to 760 px, no min-width), 'desk' (min-width over 720 px), or null (left as it is). */
41
+ function kindOf(media) {
42
+ const t = String(media || ''), mx = PH.exec(t), mn = DESK.exec(t);
43
+ if (/print|orientation|prefers|hover|pointer/.test(t) && !mx && !mn) return null;
44
+ if (mx && !mn && +mx[1] <= 760) return 'phone';
45
+ if (mn && +mn[1] > 720 && +mn[1] <= 761) return 'desk';
46
+ return null;
47
+ }
48
+ function scopeSheet(sheet) {
49
+ if (!sheet || done.has(sheet)) return;
50
+ let R; try { R = sheet.cssRules; } catch { return; } // not ours (another origin) or not loaded yet
51
+ done.add(sheet);
52
+ for (let i = R.length - 1; i >= 0; i--) {
53
+ const r = R[i]; if (!(r instanceof CSSMediaRule)) continue;
54
+ const k = kindOf(r.conditionText || r.media.mediaText); if (!k) continue;
55
+ if (k === 'desk') { for (const s of r.cssRules) if (s instanceof CSSStyleRule) { try { s.selectorText = scoped(s.selectorText, OUT); } catch { /* left as written */ } } continue; }
56
+ const copies = [...r.cssRules].filter((s) => s instanceof CSSStyleRule && s.style.length).map((s) => `${scoped(s.selectorText)} { ${s.style.cssText} }`);
57
+ for (let j = copies.length - 1; j >= 0; j--) { try { sheet.insertRule(copies[j], i + 1); } catch { /* a selector this browser cannot read */ } }
58
+ }
59
+ }
60
+ const ours = (l, re) => !!(l && l.href && re.test(l.href));
61
+
62
+ export function narrowForm(o = {}) {
63
+ const page = o.page, re = o.sheets instanceof RegExp ? o.sheets : /$^/;
64
+ const each = () => [...document.styleSheets].forEach((s) => { if (ours(s, re)) scopeSheet(s); });
65
+ each();
66
+ // a sheet a module adds later (a panel's own CSS): scoped once it has loaded
67
+ new MutationObserver((ms) => ms.forEach((m) => m.addedNodes.forEach((n) => {
68
+ if (n.tagName === 'LINK' && ours(n, re)) { if (n.sheet) scopeSheet(n.sheet); else n.addEventListener('load', () => scopeSheet(n.sheet), { once: true }); }
69
+ }))).observe(document.head, { childList: true });
70
+ document.querySelectorAll('link[rel="stylesheet"]').forEach((l) => { if (ours(l, re) && !l.sheet) l.addEventListener('load', () => scopeSheet(l.sheet), { once: true }); });
71
+ let was = !!(page && page.classList.contains('cz-pn-narrow'));
72
+ if (page && typeof o.onChange === 'function') {
73
+ new MutationObserver(() => { const now = page.classList.contains('cz-pn-narrow'); if (now !== was) { was = now; o.onChange(now); } }).observe(page, { attributes: true, attributeFilter: ['class'] });
74
+ }
75
+ return { narrow: () => !!(page && page.classList.contains('cz-pn-narrow')) };
76
+ }