create-pmos 0.610.0 → 0.611.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 (114) hide show
  1. package/package.json +50 -14
  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-columns-test.js +2 -1
  7. package/workspace/board-deliveries-test.js +2 -1
  8. package/workspace/board-programs-test.js +7 -3
  9. package/workspace/board-publish-ui-test.js +2 -1
  10. package/workspace/board-shared-ui-test.js +2 -1
  11. package/workspace/board-workflows-test.js +2 -1
  12. package/workspace/briefing-premium-board-test.js +3 -2
  13. package/workspace/briefing-premium-doc-edit-test.js +2 -1
  14. package/workspace/briefing-premium-insights-test.js +4 -3
  15. package/workspace/briefing-premium-test.js +3 -2
  16. package/workspace/calm-timeline-test.js +2 -1
  17. package/workspace/changelog.json +49 -0
  18. package/workspace/core-docs-workflow-test.js +2 -1
  19. package/workspace/ev-everywhere-test.js +3 -2
  20. package/workspace/guide/home.md +2 -2
  21. package/workspace/guide/index.md +4 -0
  22. package/workspace/guide/layout.md +62 -2
  23. package/workspace/guide/programs.md +16 -2
  24. package/workspace/guide/routine.md +50 -0
  25. package/workspace/guide/scheduled-tasks-and-cli.md +1 -1
  26. package/workspace/guide/settings-and-switches.md +1 -1
  27. package/workspace/impact-screens-test.js +3 -1
  28. package/workspace/ini-workflow-test.js +2 -1
  29. package/workspace/lib/classic-board.js +15 -0
  30. package/workspace/lib/events-place.js +216 -0
  31. package/workspace/lib/library-items.js +78 -0
  32. package/workspace/lib/notes.js +6 -1
  33. package/workspace/lib/route-modules.js +4 -0
  34. package/workspace/lib/routes-events-place.js +166 -0
  35. package/workspace/lib/routes-library.js +89 -0
  36. package/workspace/lib/routes-pop-work.js +39 -0
  37. package/workspace/lib/routes-report-setups.js +20 -0
  38. package/workspace/lib/routes-today-log.js +48 -0
  39. package/workspace/lib/routine-reports.js +52 -0
  40. package/workspace/lib/today-log.js +131 -0
  41. package/workspace/live-pill-round-test.js +10 -7
  42. package/workspace/metric-drafts-ui-test.js +3 -1
  43. package/workspace/milestone-pins-test.js +2 -1
  44. package/workspace/milestone-suggest-test.js +3 -1
  45. package/workspace/package-lock.json +2 -2
  46. package/workspace/package.json +1 -1
  47. package/workspace/panels-test.js +2 -1
  48. package/workspace/premium-board-actions-test.js +3 -1
  49. package/workspace/premium-rec-tab-test.js +2 -1
  50. package/workspace/premium-vw-backlog-test.js +3 -1
  51. package/workspace/premium-vw-item-test.js +3 -1
  52. package/workspace/premium-vw-jira-test.js +3 -1
  53. package/workspace/product-lane-test.js +2 -1
  54. package/workspace/program-charter-test.js +3 -1
  55. package/workspace/program-leave-test.js +2 -1
  56. package/workspace/program-order-test.js +2 -1
  57. package/workspace/program-panel-test.js +3 -1
  58. package/workspace/public/pm/bd-ini-panel.js +72 -7
  59. package/workspace/public/pm/bd-prog-panel.js +55 -8
  60. package/workspace/public/pm/bd-work.css +130 -0
  61. package/workspace/public/pm/bd-work.js +356 -0
  62. package/workspace/public/pm/cozy-ev.css +2 -1
  63. package/workspace/public/pm/cozy-events-view.js +142 -0
  64. package/workspace/public/pm/cozy-events.css +107 -0
  65. package/workspace/public/pm/cozy-events.js +210 -0
  66. package/workspace/public/pm/cozy-evmodel.js +1 -1
  67. package/workspace/public/pm/cozy-library.css +36 -0
  68. package/workspace/public/pm/cozy-live-pill.js +1 -0
  69. package/workspace/public/pm/cozy-nav.js +5 -5
  70. package/workspace/public/pm/cozy-pop-work.css +165 -0
  71. package/workspace/public/pm/cozy-pop-work.js +427 -0
  72. package/workspace/public/pm/cozy-routine-model.js +111 -0
  73. package/workspace/public/pm/cozy-routine-pop.js +196 -0
  74. package/workspace/public/pm/cozy-routine.css +102 -0
  75. package/workspace/public/pm/cozy-routine.js +156 -0
  76. package/workspace/public/pm/cozy-schedwork.js +6 -5
  77. package/workspace/public/pm/cozy-today-app.js +236 -0
  78. package/workspace/public/pm/cozy-today-model.js +176 -0
  79. package/workspace/public/pm/cozy-today-page.css +100 -0
  80. package/workspace/public/pm/cozy-today-view.js +76 -0
  81. package/workspace/public/pm/home-app.js +18 -3
  82. package/workspace/public/pm/home-ini.js +36 -5
  83. package/workspace/public/pm/library-model.js +69 -0
  84. package/workspace/public/pm/library-open.js +34 -0
  85. package/workspace/public/pm/pop-work-model.js +335 -0
  86. package/workspace/public/pm/premium-board.js +130 -8
  87. package/workspace/public/pm/premium-library.js +122 -0
  88. package/workspace/public/premium-board.html +1 -0
  89. package/workspace/public/premium-events.html +42 -0
  90. package/workspace/public/premium-library.html +31 -0
  91. package/workspace/public/premium-routine.html +31 -0
  92. package/workspace/public/today.html +50 -0
  93. package/workspace/ready-dash-ui-test.js +3 -1
  94. package/workspace/rename-test.js +2 -1
  95. package/workspace/run-tests.js +4 -1
  96. package/workspace/server.js +3 -2
  97. package/workspace/sort-order-test.js +2 -1
  98. package/workspace/split-merge-ui-test.js +3 -1
  99. package/workspace/stage-card-tasks-test.js +3 -1
  100. package/workspace/stage-card-test.js +2 -1
  101. package/workspace/task-delete-test.js +2 -1
  102. package/workspace/task-links-test.js +2 -1
  103. package/workspace/task-milestones-test.js +4 -2
  104. package/workspace/task-plans-test.js +3 -1
  105. package/workspace/task-press-test.js +3 -1
  106. package/workspace/task-views-test.js +3 -1
  107. package/workspace/test-lists/events-place.json +11 -0
  108. package/workspace/test-lists/library-place.json +9 -0
  109. package/workspace/test-lists/pop-work.json +9 -0
  110. package/workspace/test-lists/routine-place.json +9 -0
  111. package/workspace/test-lists/today-log.json +9 -0
  112. package/workspace/test-lists/work-view.json +9 -0
  113. package/workspace/timeline-holds-test.js +3 -1
  114. package/workspace/tk-tasks-test.js +2 -1
@@ -0,0 +1,130 @@
1
+ /* pm/bd-work.css — Work, one view (initiative work-one-view; boards 4, 5 and 24). The list of initiatives in one card with a thin border,
2
+ * the timeline on its right, the key under it, and the view menu. Workspace tokens only, so dark mode follows cozy.css. Every class starts
3
+ * with wk-. On a desk only: body.wk-on hides the View chip and the count pill with its (i), which Work does not have. */
4
+ body.bd-page.wk-on [id="bdVieww"], body.bd-page.wk-on [id="bdChipset"] { display: none !important; }
5
+ body.bd-page.wk-on .bd-hd .bd-tools { margin-left: auto; }
6
+
7
+ .wk, .wk-key { --wk-plan: var(--bd-plan); --wk-pass: var(--bd-done); --wk-late: var(--cz-late); --wk-risk: var(--cz-risk);
8
+ }
9
+ .wk { border-radius: 16px; box-shadow: inset 0 0 0 1px var(--cz-hair); background: var(--cz-card); overflow: visible; font-family: inherit; margin-top: 4px; }
10
+ .wk-r { display: grid; grid-template-columns: var(--wk-cols); column-gap: 16px; align-items: center; height: 44px; padding: 0 0 0 16px; font-size: var(--fs-row); line-height: 20px; color: var(--cz-ink2); position: relative; }
11
+ .wk:not(.has-x) .wk-r { padding-right: 16px; }
12
+ .wk-r + .wk-r { box-shadow: inset 0 1px 0 var(--cz-hair); }
13
+ .wk-r > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
14
+ .wk-h { height: 38px; background: var(--cz-well); border-radius: 16px 16px 0 0; font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink3); z-index: 4; }
15
+ .wk-hd { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; }
16
+ .wk-hd:hover, .wk-hd.on { color: var(--cz-ink); }
17
+ .wk-hd:focus-visible, .wk-i:focus-visible, .wk-st:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
18
+ .wk-g { height: 36px; background: var(--cz-well); font-size: var(--fs-label); font-weight: var(--fw-strong); color: var(--cz-ink2); }
19
+ .wk-g > span:first-child { grid-column: 1 / -2; }
20
+ .wk:not(.has-x) .wk-g > span:first-child { grid-column: 1 / -1; }
21
+ .wk-g small { font-size: var(--fs-label); font-weight: var(--fw-regular); color: var(--cz-ink3); margin-left: 8px; }
22
+ .wk-i { cursor: pointer; }
23
+ .wk-i:hover, .wk-i.hov { background: var(--cz-well); }
24
+ .wk-i.sel { background: var(--cz-bluebg); }
25
+ .wk-i:last-child { border-radius: 0 0 16px 16px; }
26
+ .wk-r .n { font-weight: var(--fw-strong); color: var(--cz-ink); }
27
+ .wk-r .q { color: var(--cz-ink3); }
28
+ .wk-d { font-variant-numeric: tabular-nums; }
29
+ .wk-d em { font-style: normal; }
30
+ .wk-d.late { color: var(--wk-late); }
31
+ .wk-d.risk { color: var(--wk-risk); }
32
+ .wk-st { all: unset; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; border-radius: 6px; padding: 2px 6px; margin-left: -6px; }
33
+ .wk-st:hover { background: var(--cz-well2); color: var(--cz-ink); }
34
+
35
+ /* the timeline column */
36
+ .wk-x { align-self: stretch; position: relative; overflow: visible !important; box-shadow: inset 1px 0 0 var(--cz-hair); }
37
+ .wk-bw { position: absolute; inset: 0 8px; }
38
+ .wk-gl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--cz-hair); }
39
+ .wk-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--cz-ink); opacity: .7; z-index: 3; }
40
+ .wk-xh { display: block; }
41
+ .wk-tl { position: absolute; inset: 0 8px; }
42
+ .wk-tk { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink3); white-space: nowrap; }
43
+ .wk-nowl { position: absolute; bottom: -9px; transform: translateX(-50%); z-index: 7; font-size: var(--fs-badge); font-weight: var(--fw-strong); font-style: normal; line-height: 18px; padding: 0 7px; border-radius: 999px; background: var(--cz-ink); color: var(--cz-card); white-space: nowrap; }
44
+ .wk-bar { position: absolute; top: 50%; height: 20px; margin-top: -10px; border-radius: 999px; background: var(--wk-plan); overflow: hidden; min-width: 4px; }
45
+ .wk-bar > em { display: block; height: 100%; background: var(--wk-pass); }
46
+ .wk-late { position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--wk-late); z-index: 1; }
47
+ .wk-late::after { content: ''; position: absolute; right: -4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--wk-late); }
48
+ .wk-ms { 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(--wk-pass); z-index: 2; text-decoration: none; }
49
+ .wk-ms.late { border-color: var(--wk-late); }
50
+ .wk-ms.risk { border-color: var(--wk-risk); }
51
+ .wk-sd { position: absolute; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--cz-card); z-index: 2; }
52
+ .wk-sd.next { width: 8px; height: 8px; margin: -4px 0 0 -4px; box-shadow: inset 0 0 0 1.5px var(--wk-pass); }
53
+ .wk-sd.cur { width: 16px; height: 16px; margin: -8px 0 0 -8px; background: var(--cz-blue); border: 3px solid var(--cz-card); box-shadow: 0 0 0 2px var(--cz-blue); z-index: 3; }
54
+ .wk-sd.cur.late { background: var(--wk-late); box-shadow: 0 0 0 2px var(--wk-late); }
55
+ .wk-sd.cur.risk { background: var(--wk-risk); box-shadow: 0 0 0 2px var(--wk-risk); }
56
+ .wk-i.hov { z-index: 5; }
57
+
58
+ /* the stages card under a pointed row */
59
+ .wk-card { position: absolute; left: auto; right: 0; width: max(100%, calc(var(--n, 8) * 80px + 24px)); box-sizing: border-box; top: 36px; z-index: 20; padding: 10px 12px 12px; border-radius: 14px; background: var(--cz-card); box-shadow: 0 12px 32px -8px rgba(30, 34, 42, .3), 0 0 0 1px var(--cz-hair); white-space: normal; cursor: default; }
60
+ .wk-card p { margin: 0 0 10px; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
61
+ .wk-cg { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); position: relative; }
62
+ .wk-cg::before { content: ''; position: absolute; left: calc(50% / var(--n)); right: calc(50% / var(--n)); top: 7px; height: 4px; border-radius: 2px; background: var(--wk-plan); }
63
+ .wk-cs { position: relative; text-align: center; min-width: 0; }
64
+ .wk-cs i { display: block; width: 8px; height: 8px; margin: 5px auto 9px; border-radius: 50%; background: var(--cz-card); box-shadow: 0 0 0 1.5px var(--wk-pass); position: relative; }
65
+ .wk-cs.done i { background: var(--wk-pass); }
66
+ .wk-cs.cur i { width: 14px; height: 14px; margin: 2px auto 6px; background: var(--cz-blue); box-shadow: 0 0 0 3px var(--cz-card), 0 0 0 5px var(--cz-blue); }
67
+ .wk-cs.cur.late i { background: var(--wk-late); box-shadow: 0 0 0 3px var(--cz-card), 0 0 0 5px var(--wk-late); }
68
+ .wk-cs.cur.risk i { background: var(--wk-risk); box-shadow: 0 0 0 3px var(--cz-card), 0 0 0 5px var(--wk-risk); }
69
+ .wk-cs b { display: block; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink2); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
70
+ .wk-cs.cur b { color: var(--cz-ink); }
71
+ .wk-cs small { display: block; font-size: var(--fs-meta); color: var(--cz-ink3); margin-top: 2px; }
72
+
73
+ /* the hide button and the span chooser at the top left of the timeline */
74
+ .wk-hide, .wk-show, .wk-span { all: unset; cursor: pointer; box-sizing: border-box; height: 20px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink3); background: var(--cz-card); box-shadow: inset 0 0 0 1px var(--cz-hair); z-index: 6; }
75
+ .wk-hide { position: absolute; left: 4px; top: 50%; margin-top: -10px; width: 20px; }
76
+ .wk-show { position: absolute; right: 12px; top: 50%; margin-top: -10px; width: 20px; }
77
+ .wk-spw { position: absolute; left: 28px; top: 50%; margin-top: -10px; z-index: 6; }
78
+ .wk-span { padding: 0 5px 0 7px; gap: 3px; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink2); }
79
+ .wk-hide:hover, .wk-show:hover, .wk-span:hover { color: var(--cz-ink); background: var(--cz-well); }
80
+ .wk-hide:focus-visible, .wk-show:focus-visible, .wk-span:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
81
+ .wk-hide svg, .wk-show svg, .wk-span svg { fill: none; stroke: currentColor; stroke-width: 2.2; }
82
+ .wk-spm { position: absolute; left: 0; top: 26px; z-index: 30; display: grid; gap: 1px; padding: 6px; border-radius: 12px; background: var(--cz-card); box-shadow: 0 8px 28px rgba(42, 46, 53, .18), inset 0 0 0 1px var(--cz-hair); min-width: 112px; }
83
+ .wk-spm[hidden] { display: none; }
84
+ .wk-spm .h { font-size: var(--fs-badge); font-weight: var(--fw-strong); line-height: 1; color: var(--cz-ink3); padding: 5px 8px 6px; }
85
+ .wk-spm .o { all: unset; cursor: pointer; font-size: var(--fs-meta); font-weight: var(--fw-regular); line-height: 1; color: var(--cz-ink); padding: 7px 8px; border-radius: 7px; display: flex; justify-content: space-between; gap: 14px; }
86
+ .wk-spm .o:hover, .wk-spm .o:focus-visible { background: var(--cz-well); }
87
+ .wk-spm .o.on { background: var(--cz-well); font-weight: var(--fw-strong); }
88
+ .wk-spm .o.on::after { content: '✓'; font-weight: var(--fw-strong); color: var(--cz-ink2); }
89
+
90
+ /* the key under the list */
91
+ .wk-key { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin: 12px 4px 0; font-size: var(--fs-label); color: var(--cz-ink3); }
92
+ .wk-key span { display: inline-flex; align-items: center; gap: 7px; }
93
+ .wk-key i { display: inline-block; flex: none; }
94
+ .wk-key .k-bar { width: 26px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--wk-pass) 50%, var(--wk-plan) 50%); }
95
+ .wk-key .k-ms { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); border: 2px solid var(--bd-done); box-sizing: border-box; }
96
+ .wk-key .k-late { width: 22px; height: 4px; border-radius: 2px; background: var(--cz-late); }
97
+
98
+ /* the view menu (board 5): one narrow panel under the tune button */
99
+ .wk-menu { position: fixed; z-index: 80; width: 300px; max-height: calc(100vh - 80px); overflow: auto; padding: 14px 14px 10px; border-radius: 18px; background: var(--cz-card); box-shadow: 0 1px 2px rgba(30, 40, 60, .1), 0 16px 40px rgba(30, 40, 60, .18), inset 0 0 0 1px var(--cz-hair); font-size: var(--fs-row); color: var(--cz-ink); box-sizing: border-box; font-family: var(--cz-sans); }
100
+ .wk-menu h6 { margin: 0 2px 8px; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink3); }
101
+ .wk-pl { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
102
+ .wk-pl button { all: unset; cursor: pointer; height: 30px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; font-size: var(--fs-body); font-weight: var(--fw-regular); color: var(--cz-ink2); background: var(--cz-well); }
103
+ .wk-pl button.on { background: var(--cz-ink); color: var(--cz-card); font-weight: var(--fw-strong); }
104
+ .wk-pl button:focus-visible, .wk-sw:focus-visible, .wk-rs:focus-visible, .wk-mx:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
105
+ .wk-mr { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; column-gap: 8px; min-height: 34px; padding: 0 4px 0 2px; border-radius: 9px; }
106
+ .wk-mr.off { color: var(--cz-ink3); }
107
+ .wk-mr small { font-size: var(--fs-meta); color: var(--cz-ink3); font-weight: var(--fw-regular); }
108
+ .wk-mr .gp { width: 8px; height: 12px; justify-self: center; opacity: .5; background: radial-gradient(circle, var(--cz-ink2) 1.1px, transparent 1.4px) 0 0 / 4px 4px; cursor: grab; }
109
+ .wk-mr.drag { opacity: .5; }
110
+ .wk-mr.drop { box-shadow: inset 0 2px 0 var(--cz-blue); }
111
+ .wk-tlr { grid-template-columns: minmax(0, 1fr) auto; height: 40px; padding: 0 10px 0 12px; border-radius: 12px; background: var(--cz-well); margin: 0 0 14px; font-weight: var(--fw-strong); }
112
+ .wk-sw { all: unset; cursor: pointer; width: 30px; height: 18px; border-radius: 999px; background: var(--cz-well2); box-shadow: inset 0 0 0 1px var(--cz-hair); position: relative; }
113
+ .wk-sw::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--cz-card); box-shadow: 0 1px 2px rgba(30, 40, 60, .25); transition: left .12s; }
114
+ .wk-sw.on { background: var(--cz-blue); box-shadow: none; }
115
+ .wk-sw.on::after { left: 14px; }
116
+ .wk-menu hr { border: 0; height: 1px; background: var(--cz-hair); margin: 6px 2px; }
117
+ .wk-mx { all: unset; cursor: pointer; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 6px; border-radius: 9px; font-size: var(--fs-body); color: var(--cz-ink2); }
118
+ .wk-mx:hover { background: var(--cz-well); color: var(--cz-ink); }
119
+ .wk-mx svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
120
+ .wk-mx .k { margin-left: auto; font-size: var(--fs-label); color: var(--cz-ink3); }
121
+ .wk-ft { display: flex; justify-content: space-between; align-items: center; margin: 8px 2px 0; padding-top: 8px; box-shadow: inset 0 1px 0 var(--cz-hair); font-size: var(--fs-meta); color: var(--cz-ink3); }
122
+ .wk-rs { all: unset; cursor: pointer; font-weight: var(--fw-strong); color: var(--cz-blue); border-radius: 6px; padding: 2px 4px; }
123
+
124
+ /* the stage list under a Stage cell */
125
+ .wk-stm { position: fixed; z-index: 80; min-width: 168px; padding: 6px; border-radius: 12px; background: var(--cz-card); box-shadow: 0 8px 28px rgba(42, 46, 53, .18), inset 0 0 0 1px var(--cz-hair); display: grid; gap: 1px; font-family: var(--cz-sans); }
126
+ .wk-stm .h { font-size: var(--fs-badge); font-weight: var(--fw-strong); color: var(--cz-ink3); padding: 5px 8px 6px; }
127
+ .wk-stm button { all: unset; cursor: pointer; font-size: var(--fs-meta); color: var(--cz-ink); padding: 7px 8px; border-radius: 7px; display: flex; justify-content: space-between; gap: 14px; }
128
+ .wk-stm button:hover, .wk-stm button:focus-visible { background: var(--cz-well); }
129
+ .wk-stm button.on { font-weight: var(--fw-strong); background: var(--cz-well); }
130
+ .wk-stm button.on::after { content: '✓'; color: var(--cz-ink2); }
@@ -0,0 +1,356 @@
1
+ /* pm/bd-work.js — Work, one view (slice 4 of the six-place navigation, initiative work-one-view; boards 4, 5 and 24 on Exploring 2).
2
+ * One list of initiatives with the timeline on its right. No List / By stage / Track / Timeline tabs.
3
+ * · Columns, in one order: Initiative, Product, Stage, Next milestone, Date. Status, Program, Goal and Workflow can be shown. Initiative
4
+ * always shows. One text size, one row height; only the initiative name is bold.
5
+ * · Next milestone is the real milestone name; with none it says "Plan end" in grey and the date is the plan end. Never a stage name.
6
+ * · Only a late or at-risk date has colour: "4 Nov · 14 days late", "27 Nov · at risk". A closed initiative is never late.
7
+ * · The bar: light grey the plan, dark grey the part that has passed, the next milestone a diamond, a red line from a missed date to today.
8
+ * No stage dots until a row is pointed at (or its bar pressed): then its stages show on the bar and a small card lists each stage
9
+ * with its date ("no date" where none). PMOS does not invent a date.
10
+ * · The span chooser sits on the timeline header beside the hide button: Quarter, Half, Year, 2 yr, 5 yr, Full (the default).
11
+ * · The view menu (board 5): Group by pills, the Timeline switch, the Columns with a switch each and drag to order, "PMOS remembers this"
12
+ * and Reset. The view is kept in this browser (localStorage pmos.work.view).
13
+ * · More than one product: the groups are the goals of all of them, and the Product column tells the rows apart; with one product the
14
+ * Product column hides by itself.
15
+ * The parts that decide (nextOf, dateOf, colsShown, groupsOf, windowOf, stagesOf) are pure and tested in work-view.test.js. The markup has no
16
+ * handlers: pm/premium-board.js wires the presses (wire() below does the hover and the menu). */
17
+ import { stageOfRow, stagesOfRow, wfOf, catOfRow, posOf } from './bd-wf.js';
18
+ import { stageName as oneStageName } from './stage-chip.js';
19
+
20
+ export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
21
+ const SV = (d, n) => `<svg viewBox="0 0 24 24"${n ? ` width="${n}" height="${n}"` : ''} aria-hidden="true"><path d="${d}"/></svg>`;
22
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
23
+ const DAY = 864e5;
24
+
25
+ /* ── the columns ─────────────────────────────────────────────────────────────────────────────────────────────── */
26
+ /** Every column but Initiative, in its usual order, with its width in px. on: shown by default. */
27
+ export const COLS = [
28
+ { k: 'product', n: 'Product', w: 124, on: true },
29
+ { k: 'stage', n: 'Stage', w: 112, on: true },
30
+ { k: 'ms', n: 'Next milestone', w: 168, on: true },
31
+ { k: 'date', n: 'Date', w: 176, on: true },
32
+ { k: 'status', n: 'Status', w: 104, on: false },
33
+ { k: 'program', n: 'Program', w: 150, on: false },
34
+ { k: 'goal', n: 'Goal', w: 170, on: false },
35
+ { k: 'wf', n: 'Workflow', w: 140, on: false },
36
+ ];
37
+ const byK = Object.fromEntries(COLS.map((c) => [c.k, c]));
38
+ export const GROUPS = [['goal', 'Goal'], ['product', 'Product'], ['stage', 'Stage'], ['status', 'Status'], ['program', 'Program'], ['none', 'No groups']];
39
+ export const SPANS = [['quarter', 'Quarter', 91], ['half', 'Half', 182], ['year', 'Year', 365], ['y2', '2 yr', 730], ['y5', '5 yr', 1826], ['full', 'Full', 0]];
40
+ export const KEY = 'pmos.work.view';
41
+
42
+ /** The usual view: grouped by goal, the timeline on, the default columns in their order, Full. */
43
+ export const usual = () => ({ group: 'goal', tl: true, span: 'full', cols: COLS.map((c) => ({ k: c.k, on: c.on })) });
44
+
45
+ /** The view as kept, mended: an unknown key falls back to the usual one, a column missing from a kept list is added off at the end. */
46
+ export function mend(v) {
47
+ const u = usual();
48
+ if (!v || typeof v !== 'object') return u;
49
+ const seen = new Set(), cols = [];
50
+ for (const c of Array.isArray(v.cols) ? v.cols : []) if (c && byK[c.k] && !seen.has(c.k)) { seen.add(c.k); cols.push({ k: c.k, on: !!c.on }); }
51
+ for (const c of COLS) if (!seen.has(c.k)) cols.push({ k: c.k, on: cols.length ? false : c.on });
52
+ return {
53
+ group: GROUPS.some(([k]) => k === v.group) ? v.group : u.group,
54
+ tl: v.tl !== false,
55
+ span: SPANS.some(([k]) => k === v.span) ? v.span : u.span,
56
+ cols: cols.length ? cols : u.cols,
57
+ };
58
+ }
59
+ let mem = null;
60
+ const box = () => { try { return typeof localStorage !== 'undefined' ? localStorage : null; } catch { return null; } };
61
+ export function read() {
62
+ if (mem) return mem;
63
+ let v = null; try { const s = box(); v = s ? JSON.parse(s.getItem(KEY) || 'null') : null; } catch { v = null; }
64
+ mem = mend(v); return mem;
65
+ }
66
+ function write(v) { mem = mend(v); try { const s = box(); if (s) s.setItem(KEY, JSON.stringify(mem)); } catch { /* a private window keeps it for this page */ } return mem; }
67
+ export const setGroup = (g) => write({ ...read(), group: g });
68
+ export const setTimeline = (on) => write({ ...read(), tl: !!on });
69
+ export const setSpan = (s) => write({ ...read(), span: s });
70
+ export const reset = () => write(usual());
71
+ /** A column's switch. The columns that show stay on top, in their order; one switched on goes under them, one switched off goes on top of the others. */
72
+ export function setCol(k, on) {
73
+ const v = read(); if (!byK[k]) return v;
74
+ const rest = v.cols.filter((c) => c.k !== k), shown = rest.filter((c) => c.on), hid = rest.filter((c) => !c.on);
75
+ return write({ ...v, cols: [...shown, { k, on: !!on }, ...hid] });
76
+ }
77
+ /** Drag a column to the place of another: `k` moves before `before` (or to the end of the columns that show when before is null). */
78
+ export function moveCol(k, before) {
79
+ const v = read(), c = v.cols.find((x) => x.k === k); if (!c || k === before) return v;
80
+ const rest = v.cols.filter((x) => x.k !== k);
81
+ let i = before ? rest.findIndex((x) => x.k === before) : rest.filter((x) => x.on).length;
82
+ if (i < 0) i = rest.length;
83
+ const t = before ? rest[i] : null, moved = { ...c, on: t ? t.on : c.on };
84
+ rest.splice(i, 0, moved);
85
+ return write({ ...v, cols: rest });
86
+ }
87
+ /** The columns to draw beside Initiative: the ones switched on, in their order; Product leaves by itself with one product. */
88
+ export const colsShown = (v, o = {}) => v.cols.filter((c) => c.on && !(c.k === 'product' && !o.many)).map((c) => c.k);
89
+
90
+ /* ── dates ───────────────────────────────────────────────────────────────────────────────────────────────────── */
91
+ export const day = (v) => { if (v instanceof Date) return new Date(v.getFullYear(), v.getMonth(), v.getDate()); const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; };
92
+ const today = (now) => day(now || new Date());
93
+ /** "4 Nov", and the year when it is not this year: "20 Oct 2027" (boards 4 and 24). */
94
+ export const dm = (d, now = new Date()) => d.getDate() + ' ' + MON[d.getMonth()] + (d.getFullYear() !== now.getFullYear() ? ' ' + d.getFullYear() : '');
95
+ const plural = (n, a, b) => (n === 1 ? a : b);
96
+
97
+ /** A row's next milestone: the earliest milestone not done, by its own name; with none, "Plan end" and the end of its plan (plan: true).
98
+ * Never a stage name. null when the row has neither. → { name, d, plan } */
99
+ export function nextOf(r) {
100
+ const M = (r.milestones || []).filter((m) => m && !m.done && day(m.date)).sort((a, b) => day(a.date) - day(b.date));
101
+ if (M.length) return { name: String(M[0].name || 'Milestone'), d: day(M[0].date), plan: false };
102
+ const e = day(r.end);
103
+ return e ? { name: 'Plan end', d: e, plan: true } : null;
104
+ }
105
+ /** The Date cell: the date, and its tone only when late or at risk ("14 days late", "at risk"). A closed initiative is never late. */
106
+ export function dateOf(r, now = new Date()) {
107
+ const n = nextOf(r); if (!n) return { text: '', tone: '', note: '' };
108
+ const t = today(now), over = Math.round((t - n.d) / DAY), text = dm(n.d, now);
109
+ if (r.closed || r.status === 'done') return { text, tone: '', note: '' };
110
+ if (over > 0) return { text, tone: 'late', note: over + ' ' + plural(over, 'day', 'days') + ' late', over };
111
+ if (r.status === 'late') return { text, tone: 'late', note: 'late' };
112
+ if (r.status === 'at risk') return { text, tone: 'risk', note: 'at risk' };
113
+ return { text, tone: '', note: '' };
114
+ }
115
+
116
+ /* ── stages ──────────────────────────────────────────────────────────────────────────────────────────────────── */
117
+ const norm = (s) => String(s || '').trim().toLowerCase();
118
+ export const stageText = (r) => oneStageName(r) || ((s) => (s && s.name) || '')(stageOfRow(r)) || r.stage || '';
119
+ const STATUS = { todo: 'To do', doing: 'In progress', done: 'Done', wontdo: "Won't do", archived: 'Archived' };
120
+ export const statusText = (r) => STATUS[catOfRow(r)] || '';
121
+ /** The stages of a row's own workflow with their dates (the due date of the dated work in each, as the Board reads it) and where it stands:
122
+ * 'done' before the stage now, 'cur' the stage now, 'next' after. A stage the row skipped is left out. → [{ key, name, d, at, ms }] */
123
+ export function stagesOf(r) {
124
+ const L = (stagesOfRow(r) || []).filter((s) => s && !s.skipped && s.status !== 'skipped');
125
+ const cur = stageOfRow(r), ci = cur ? L.findIndex((s) => s.key === cur.key || norm(s.name) === norm(cur.name)) : -1;
126
+ const spans = Array.isArray(r.stageSpans) ? r.stageSpans : [];
127
+ return L.map((s, i) => {
128
+ const sp = spans.filter((x) => norm(x.stage) === norm(s.key) || norm(x.stage) === norm(s.name)).map((x) => day(x.due)).filter(Boolean).sort((a, b) => b - a)[0] || null;
129
+ return { key: s.key, name: s.name, d: sp, at: ci < 0 ? 'next' : i < ci ? 'done' : i === ci ? 'cur' : 'next', ms: !!s.milestone };
130
+ });
131
+ }
132
+
133
+ /* ── groups ──────────────────────────────────────────────────────────────────────────────────────────────────── */
134
+ /** The rows in groups: [{ key, name, rows }], or null with No groups. o: { goalGroups(rows) → [{ key, name, rows }] | null, goalOf(r),
135
+ * programOf(r), product(r) }. A row with no value goes in a last group ("No goal yet", "No program", "No stage"). */
136
+ export function groupsOf(rows, by, o = {}) {
137
+ if (by === 'none') return null;
138
+ if (by === 'goal' && o.goalGroups) { const G = o.goalGroups(rows); if (G && G.length) return G; }
139
+ const keyOf = {
140
+ goal: (r) => (o.goalOf && o.goalOf(r)) || '',
141
+ product: (r) => (o.product ? o.product(r) : r.product) || '',
142
+ stage: (r) => stageText(r),
143
+ status: (r) => statusText(r),
144
+ program: (r) => (o.programOf && o.programOf(r)) || '',
145
+ }[by];
146
+ if (!keyOf) return null;
147
+ const none = { goal: 'No goal yet', product: 'No product', stage: 'No stage', status: 'No status', program: 'No program' }[by];
148
+ const m = new Map();
149
+ for (const r of rows) { const k = keyOf(r) || ''; if (!m.has(k)) m.set(k, []); m.get(k).push(r); }
150
+ let G = [...m.entries()].map(([k, rs]) => ({ key: by + ':' + (k || '-'), name: k || none, rows: rs, empty: !k }));
151
+ if (by === 'stage') G.sort((a, b) => (a.empty - b.empty) || (Math.min(...a.rows.map(posOf)) - Math.min(...b.rows.map(posOf))));
152
+ else if (by === 'status') { const O = { 'To do': 0, 'In progress': 1, Done: 2 }; G.sort((a, b) => (O[a.name] ?? 9) - (O[b.name] ?? 9)); }
153
+ else G.sort((a, b) => a.empty - b.empty);
154
+ // one group that holds every row and names nothing (no goal yet anywhere) says nothing: the list is flat (zero is silence)
155
+ return G.length === 1 && G[0].empty ? null : G;
156
+ }
157
+
158
+ /* ── sort: a column title sorts by it; pressed again, the usual order comes back ───────────────────────────────── */
159
+ let sortBy = null;
160
+ export const sorted = () => sortBy;
161
+ export const setSort = (k) => { sortBy = k === sortBy ? null : (k === 'title' || byK[k]) ? k : null; };
162
+ const str = (v) => String(v || '~');
163
+ const SORTS = {
164
+ title: (a, b) => String(a.title).localeCompare(String(b.title)),
165
+ product: (a, b, o) => str(o.product(a)).localeCompare(str(o.product(b))),
166
+ stage: (a, b) => posOf(a) - posOf(b),
167
+ ms: (a, b) => { const x = nextOf(a), y = nextOf(b); return str(x && !x.plan ? x.name : '~').localeCompare(str(y && !y.plan ? y.name : '~')); },
168
+ date: (a, b) => { const x = nextOf(a), y = nextOf(b); return (x ? +x.d : Infinity) - (y ? +y.d : Infinity) || 0; },
169
+ status: (a, b) => str(statusText(a)).localeCompare(str(statusText(b))),
170
+ program: (a, b, o) => str(o.programOf && o.programOf(a)).localeCompare(str(o.programOf && o.programOf(b))),
171
+ goal: (a, b, o) => str(o.goalOf && o.goalOf(a)).localeCompare(str(o.goalOf && o.goalOf(b))),
172
+ wf: (a, b) => String(wfOf(a).name).localeCompare(String(wfOf(b).name)),
173
+ };
174
+ const sortRows = (rows, o) => (sortBy && SORTS[sortBy] ? rows.slice().sort((a, b) => SORTS[sortBy](a, b, o) || String(a.title).localeCompare(String(b.title))) : rows);
175
+
176
+ /* ── the timeline's window ───────────────────────────────────────────────────────────────────────────────────── */
177
+ /** The window of a span. Full: from the earliest start to the latest end of the rows (their milestones and today too), so no bar is cut.
178
+ * The other spans are a fixed length that starts a quarter of the way before today. → { from, to, span } (Dates) */
179
+ export function windowOf(span, rows, now = new Date()) {
180
+ const t = today(now), S = SPANS.find(([k]) => k === span) || SPANS[SPANS.length - 1];
181
+ if (S[2]) { const from = new Date(+t - Math.round(S[2] * 0.25) * DAY); return { from, to: new Date(+from + S[2] * DAY), span: S[0] }; }
182
+ const ds = [t];
183
+ for (const r of rows || []) { for (const v of [r.start, r.end]) { const d = day(v); if (d) ds.push(d); } for (const m of r.milestones || []) { const d = day(m && m.date); if (d) ds.push(d); } }
184
+ const lo = Math.min(...ds), hi = Math.max(...ds), pad = Math.max(7 * DAY, (hi - lo) * 0.03);
185
+ return { from: new Date(lo - pad), to: new Date(Math.max(hi + pad, lo + 60 * DAY)), span: 'full' };
186
+ }
187
+ const X = (W, d) => ((d - W.from) / (W.to - W.from)) * 100;
188
+ const P = (x) => Math.max(0, Math.min(100, x)).toFixed(2) + '%';
189
+ const inW = (W, d) => d && d >= W.from && d <= W.to;
190
+ /** The ticks of a window: months up to about half a year, quarters up to about two years, then years. [{ at, mid, label }] */
191
+ export function ticksOf(W) {
192
+ const len = (W.to - W.from) / DAY, out = [];
193
+ const unit = len <= 200 ? 'm' : len <= 800 ? 'q' : 'y', step = unit === 'm' ? 1 : unit === 'q' ? 3 : 12;
194
+ let d = new Date(W.from.getFullYear(), unit === 'y' ? 0 : W.from.getMonth() - (unit === 'q' ? W.from.getMonth() % 3 : 0), 1);
195
+ let first = true;
196
+ while (d < W.to) {
197
+ const nx = new Date(d.getFullYear(), d.getMonth() + step, 1), q = Math.floor(d.getMonth() / 3) + 1;
198
+ const label = unit === 'y' ? String(d.getFullYear()) : unit === 'q' ? 'Q' + q + (q === 1 || first ? ' ' + d.getFullYear() : '') : MON[d.getMonth()] + (d.getMonth() === 0 || first ? ' ' + d.getFullYear() : '');
199
+ const mid = new Date((Math.max(+d, +W.from) + Math.min(+nx, +W.to)) / 2);
200
+ out.push({ at: d, mid, label, show: Math.min(+nx, +W.to) - Math.max(+d, +W.from) > (W.to - W.from) * 0.05 });
201
+ d = nx; first = false;
202
+ }
203
+ return out;
204
+ }
205
+
206
+ /* ── markup ──────────────────────────────────────────────────────────────────────────────────────────────────── */
207
+ const I = { hide: 'M13 6l6 6-6 6M6 6l6 6-6 6', show: 'M11 6l-6 6 6 6M18 6l-6 6 6 6', chev: 'M7 10l5 5 5-5', sort: 'M12 5v14M6 13l6 6 6-6' };
208
+ let LAST = null; // what the list was drawn with: the hover redraws one row's bar from it
209
+
210
+ function cellHtml(r, k, o) {
211
+ if (k === 'product') return `<span role="cell">${esc(o.product(r))}</span>`;
212
+ if (k === 'stage') { const s = stageText(r); return `<span role="cell" class="wk-stc">${o.canMove && o.canMove(r) ? `<button type="button" class="wk-st" data-wkstage="${esc(r.key)}" aria-haspopup="menu" aria-label="Stage: ${esc(s || 'none')}. Change the stage" title="Change the stage">${esc(s)}</button>` : esc(s)}</span>`; }
213
+ if (k === 'ms') { const n = nextOf(r); return `<span role="cell"${n && n.plan ? ' class="q"' : ''}>${n ? esc(n.name) : ''}</span>`; }
214
+ if (k === 'date') { const d = dateOf(r, o.now); return `<span role="cell" class="wk-d${d.tone ? ' ' + d.tone : ''}">${esc(d.text)}${d.note ? `<em> · ${esc(d.note)}</em>` : ''}</span>`; }
215
+ if (k === 'status') return `<span role="cell">${esc(statusText(r))}</span>`;
216
+ if (k === 'program') return `<span role="cell">${esc((o.programOf && o.programOf(r)) || '')}</span>`;
217
+ if (k === 'goal') return `<span role="cell">${esc((o.goalOf && o.goalOf(r)) || '')}</span>`;
218
+ if (k === 'wf') return `<span role="cell">${esc(wfOf(r).name)}</span>`;
219
+ return '<span role="cell"></span>';
220
+ }
221
+ const words = (r, keys, o) => keys.map((k) => {
222
+ if (k === 'product') return o.product(r);
223
+ if (k === 'stage') return stageText(r);
224
+ if (k === 'ms') { const n = nextOf(r); return n ? 'next ' + n.name : ''; }
225
+ if (k === 'date') { const d = dateOf(r, o.now); return d.text + (d.note ? ', ' + d.note : ''); }
226
+ if (k === 'status') return statusText(r);
227
+ if (k === 'program') return (o.programOf && o.programOf(r)) || '';
228
+ if (k === 'goal') return (o.goalOf && o.goalOf(r)) || '';
229
+ if (k === 'wf') return wfOf(r).name;
230
+ return '';
231
+ }).filter(Boolean).join(', ');
232
+
233
+ /** The grid lines and today's line of the timeline, the same on every row. */
234
+ const gridHtml = (W, T, now) => T.map((t) => (inW(W, t.at) ? `<i class="wk-gl" style="left:${P(X(W, t.at))}"></i>` : '')).join('') + (inW(W, today(now)) ? `<i class="wk-now" style="left:${P(X(W, today(now)))}"></i>` : '');
235
+ /** One row's bar: the plan, the part that has passed, the late line, the next milestone; pointed at, its stage dots and its card. */
236
+ export function barHtml(r, W, o = {}) {
237
+ const now = o.now || new Date(), t = today(now), s = day(r.start), e = day(r.end), n = nextOf(r), dt = dateOf(r, now);
238
+ let h = '';
239
+ if (s && e && e >= s && e >= W.from && s <= W.to) {
240
+ const a = X(W, s), b = X(W, e), pass = Math.min(+t, +e) > +s ? ((Math.min(+t, +e) - s) / (e - s)) * 100 : 0;
241
+ h += `<b class="wk-bar" style="left:${P(a)};width:${P(Math.min(100, b) - Math.max(0, a))}"><em style="width:${Math.max(0, Math.min(100, pass)).toFixed(1)}%"></em></b>`;
242
+ }
243
+ if (n && dt.tone === 'late' && dt.over > 0 && n.d < W.to) h += `<u class="wk-late" style="left:${P(X(W, n.d))};width:${P(X(W, t) - Math.max(0, X(W, n.d)))}" aria-hidden="true"></u>`;
244
+ if (n && inW(W, n.d)) h += `<s class="wk-ms${dt.tone ? ' ' + dt.tone : ''}" style="left:${P(X(W, n.d))}" title="${esc(n.name + ' · ' + dt.text)}"></s>`;
245
+ if (o.hov) {
246
+ const S = stagesOf(r);
247
+ h += S.map((x) => (x.d && inW(W, x.d) ? `<i class="wk-sd ${x.at}${x.at === 'cur' && dt.tone ? ' ' + dt.tone : ''}" style="left:${P(X(W, x.d))}" title="${esc(x.name)}"></i>` : '')).join('');
248
+ if (S.length) h += `<div class="wk-card" role="tooltip" style="--n:${S.length}"><p>${esc(r.title)} · its stages</p><div class="wk-cg" style="--n:${S.length}">${S.map((x) => `<div class="wk-cs ${x.at}${x.at === 'cur' && dt.tone ? ' ' + dt.tone : ''}"><i></i><b>${esc(x.name)}</b><small>${x.d ? esc(dm(x.d, now)) : 'no date'}</small></div>`).join('')}</div></div>`;
249
+ }
250
+ return h;
251
+ }
252
+
253
+ /** The whole list. rows: the initiatives on screen. o: { now, many, sel, hov, canMove(r), product(r), programOf(r), goalOf(r),
254
+ * goalGroups(rows) } → html */
255
+ export function listHtml(rows, o = {}) {
256
+ const v = read(), now = o.now || new Date(), keys = colsShown(v, o), tl = v.tl !== false;
257
+ const W = windowOf(v.span, rows, now), T = ticksOf(W), grid = gridHtml(W, T, now);
258
+ const oo = { ...o, now, product: o.product || ((r) => r.product || '') };
259
+ LAST = { o: oo, W, grid };
260
+ const tpl = (tl ? 'minmax(200px,248px) ' : 'minmax(0,1fr) ') + keys.map((k) => byK[k].w + 'px').join(' ') + (tl ? ' minmax(240px,1fr)' : '');
261
+ const sortHd = (k, n) => { const on = sortBy === k; return `<span role="columnheader" aria-sort="${on ? 'ascending' : 'none'}"><button type="button" class="wk-hd${on ? ' on' : ''}" data-wksort="${k}" title="Sort by ${esc(n.toLowerCase())}">${esc(n)}${on ? SV(I.sort, 12) : ''}</button></span>`; };
262
+ const spanName = (SPANS.find(([k]) => k === v.span) || SPANS[5])[1];
263
+ const tlHead = !tl ? '' : `<span role="columnheader" class="wk-x wk-xh"><span class="wk-tl">${T.filter((t) => t.show && X(W, t.mid) > 14).map((t) => `<span class="wk-tk" style="left:${P(X(W, t.mid))}">${esc(t.label)}</span>`).join('')}`
264
+ + (inW(W, today(now)) ? `<i class="wk-nowl" style="left:${P(X(W, today(now)))}">Today</i>` : '') + `</span>`
265
+ + `<button type="button" class="wk-hide" data-wktl="off" aria-label="Hide the timeline" title="Hide the timeline">${SV(I.hide, 13)}</button>`
266
+ + `<span class="wk-spw"><button type="button" class="wk-span" data-wkspan aria-haspopup="menu" aria-expanded="false" aria-label="Span of the timeline: ${esc(spanName)}" title="Span of the timeline">${esc(spanName)}${SV(I.chev, 11)}</button>`
267
+ + `<span class="wk-spm" role="menu" aria-label="Span of the timeline" hidden><span class="h">Span</span>${SPANS.map(([k, n]) => `<button type="button" role="menuitemradio" aria-checked="${k === v.span}" class="o${k === v.span ? ' on' : ''}" data-wkspick="${k}">${esc(n)}</button>`).join('')}</span></span></span>`;
268
+ const showTl = tl ? '' : `<button type="button" class="wk-show" data-wktl="on" aria-label="Show the timeline" title="Show the timeline">${SV(I.show, 13)}</button>`;
269
+ let h = `<div class="wk${tl ? ' has-x' : ''}" role="table" aria-label="Initiatives" style="--wk-cols:${tpl}">`
270
+ + `<div class="wk-r wk-h" role="row">${sortHd('title', 'Initiative')}${keys.map((k) => sortHd(k, byK[k].n)).join('')}${tlHead}${showTl}</div>`;
271
+ const row = (r) => `<div class="wk-r wk-i${o.sel === r.key ? ' sel' : ''}${o.hov === r.key ? ' hov' : ''}" role="row" tabindex="0" data-key="${esc(r.key)}" aria-label="${esc(r.title + (keys.length ? ', ' + words(r, keys, oo) : ''))}">`
272
+ + `<span role="cell" class="n">${esc(r.title)}</span>${keys.map((k) => cellHtml(r, k, oo)).join('')}`
273
+ + (tl ? `<span role="cell" class="wk-x" data-wkbar="${esc(r.key)}"><span class="wk-bw">${grid}${barHtml(r, W, { now, hov: o.hov === r.key })}</span></span>` : '') + '</div>';
274
+ const base = o.order ? o.order(rows) : rows, G = groupsOf(base, v.group, oo);
275
+ if (!G) h += sortRows(base, oo).map(row).join('');
276
+ else for (const g of G) {
277
+ h += `<div class="wk-r wk-g" role="row"><span role="rowheader">${esc(g.name)}<small>${g.rows.length}</small></span>${tl ? `<span class="wk-x" aria-hidden="true"><span class="wk-bw">${grid}</span></span>` : ''}</div>`;
278
+ h += sortRows(g.rows, oo).map(row).join('');
279
+ }
280
+ h += '</div>';
281
+ if (tl) h += `<div class="wk-key"><span><i class="k-bar"></i>Passed and still planned</span><span><i class="k-ms"></i>Next milestone</span><span><i class="k-late"></i>Late</span><span>Point at a bar to see its stages and their dates</span></div>`;
282
+ return h;
283
+ }
284
+
285
+ /** The hover: one row's bar drawn again with its stages, the row before drawn plain. Returns the key now pointed at. */
286
+ export function hover(body, key, was) {
287
+ if (!LAST || key === was) return was;
288
+ const put = (k, on) => {
289
+ if (!k) return;
290
+ const cell = [...body.querySelectorAll('[data-wkbar]')].find((x) => x.dataset.wkbar === k), r = LAST.o.rowOf ? LAST.o.rowOf(k) : null;
291
+ if (!cell || !r) return;
292
+ const bw = cell.querySelector('.wk-bw'); if (bw) bw.innerHTML = LAST.grid + barHtml(r, LAST.W, { now: LAST.o.now, hov: on });
293
+ const rw = cell.closest('.wk-r'); if (rw) rw.classList.toggle('hov', on);
294
+ };
295
+ put(was, false); put(key, true);
296
+ return key;
297
+ }
298
+
299
+ /* ── the view menu (board 5): one narrow panel ───────────────────────────────────────────────────────────────── */
300
+ /** o.more: the menu's last section (what left the toolbar), markup from the page. */
301
+ export function menuHtml(o = {}) {
302
+ const v = read();
303
+ const sw = (on, label, data) => `<button type="button" class="wk-sw${on ? ' on' : ''}" role="switch" aria-checked="${on}" aria-label="${esc(label)}" ${data}></button>`;
304
+ const shown = v.cols.filter((c) => c.on), hid = v.cols.filter((c) => !c.on);
305
+ const rw = (c) => `<div class="wk-mr${c.on ? '' : ' off'}" draggable="true" data-wkcol="${c.k}"><i class="gp" aria-hidden="true"></i><span>${esc(byK[c.k].n)}${c.k === 'product' && c.on && !o.many ? '<small> · hides with one product</small>' : ''}</span>${sw(c.on, byK[c.k].n, `data-wkcolsw="${c.k}"`)}</div>`;
306
+ return `<div class="wk-menu" role="dialog" aria-label="View">`
307
+ + `<h6>Group by</h6><div class="wk-pl" role="radiogroup" aria-label="Group by">${GROUPS.map(([k, n]) => `<button type="button" role="radio" aria-checked="${k === v.group}" class="${k === v.group ? 'on' : ''}" data-wkgroup="${k}">${esc(n)}</button>`).join('')}</div>`
308
+ + `<div class="wk-mr wk-tlr"><span>Timeline</span>${sw(v.tl, 'Timeline', 'data-wktlsw')}</div>`
309
+ + `<h6>Columns · drag to change the order</h6>`
310
+ + `<div class="wk-mr lk"><i></i><span>Initiative</span><small>always</small></div>${shown.map(rw).join('')}${hid.length && shown.length ? '<hr>' : ''}${hid.map(rw).join('')}`
311
+ + (o.more ? `<hr>${o.more}` : '')
312
+ + `<div class="wk-ft"><span>PMOS remembers this</span><button type="button" class="wk-rs" data-wkreset>Reset</button></div></div>`;
313
+ }
314
+
315
+ /** What a press in the list or the menu means, or null when it is not Work's own. → { kind, ... } */
316
+ export function pressOf(t) {
317
+ const q = (s) => t.closest && t.closest(s);
318
+ let b;
319
+ if ((b = q('[data-wksort]'))) return { kind: 'sort', k: b.dataset.wksort };
320
+ if ((b = q('[data-wkspick]'))) return { kind: 'span', span: b.dataset.wkspick };
321
+ if (q('[data-wkspan]')) return { kind: 'spanmenu' };
322
+ if ((b = q('[data-wktl]'))) return { kind: 'timeline', on: b.dataset.wktl === 'on' };
323
+ if ((b = q('[data-wkstage]'))) return { kind: 'stage', key: b.dataset.wkstage, el: b };
324
+ if ((b = q('[data-wkgroup]'))) return { kind: 'group', group: b.dataset.wkgroup };
325
+ if (q('[data-wktlsw]')) return { kind: 'timeline', on: !read().tl };
326
+ if ((b = q('[data-wkcolsw]'))) { const c = read().cols.find((x) => x.k === b.dataset.wkcolsw); return { kind: 'col', k: b.dataset.wkcolsw, on: !(c && c.on) }; }
327
+ if (q('[data-wkreset]')) return { kind: 'reset' };
328
+ return null;
329
+ }
330
+ /** Apply a press that only changes the view. → true when the list must be drawn again. */
331
+ export function apply(p) {
332
+ if (p.kind === 'sort') setSort(p.k);
333
+ else if (p.kind === 'span') setSpan(p.span);
334
+ else if (p.kind === 'timeline') setTimeline(p.on);
335
+ else if (p.kind === 'group') setGroup(p.group);
336
+ else if (p.kind === 'col') setCol(p.k, p.on);
337
+ else if (p.kind === 'reset') { reset(); sortBy = null; }
338
+ else return false;
339
+ return true;
340
+ }
341
+ /** The drag in the menu: a column row dropped on another moves before it. on(): draw again. */
342
+ export function wireDrag(menu, on) {
343
+ let from = null;
344
+ menu.addEventListener('dragstart', (e) => { const r = e.target.closest('[data-wkcol]'); if (!r) return; from = r.dataset.wkcol; r.classList.add('drag'); try { e.dataTransfer.setData('text/plain', from); e.dataTransfer.effectAllowed = 'move'; } catch { /* some browsers refuse */ } });
345
+ menu.addEventListener('dragover', (e) => { const r = from && e.target.closest('[data-wkcol]'); if (!r) return; e.preventDefault(); menu.querySelectorAll('.drop').forEach((x) => x.classList.remove('drop')); if (r.dataset.wkcol !== from) r.classList.add('drop'); });
346
+ menu.addEventListener('dragend', () => { from = null; menu.querySelectorAll('.drag, .drop').forEach((x) => x.classList.remove('drag', 'drop')); });
347
+ menu.addEventListener('drop', (e) => { const r = from && e.target.closest('[data-wkcol]'); if (!r) return; e.preventDefault(); const k = from; from = null; if (r.dataset.wkcol !== k) { moveCol(k, r.dataset.wkcol); on(); } });
348
+ // the keyboard: Alt+↑ and Alt+↓ on a column's switch move it
349
+ menu.addEventListener('keydown', (e) => {
350
+ if (!e.altKey || (e.key !== 'ArrowUp' && e.key !== 'ArrowDown')) return;
351
+ const r = e.target.closest('[data-wkcol]'); if (!r) return;
352
+ e.preventDefault();
353
+ const v = read(), i = v.cols.findIndex((c) => c.k === r.dataset.wkcol), j = e.key === 'ArrowUp' ? i - 1 : i + 2;
354
+ moveCol(r.dataset.wkcol, j >= 0 && j < v.cols.length ? v.cols[j].k : null); on(r.dataset.wkcol);
355
+ });
356
+ }
@@ -436,6 +436,7 @@
436
436
  * job's page like the Claude app's scheduled task: Active, Next run, Repeats in one card, PMOS's ✦ rhythm, History, ▶ Read now */
437
437
  .ev-st .ev-sw-ic { color: var(--cz-ink3); display: inline-flex; flex: none; }
438
438
  .ev-st .ev-sw-entry .ev-sw-ic { margin-left: -16px; }
439
+ .ev-st a.ev-sw-entry { color: inherit; text-decoration: none; }
439
440
  .ev-st .ev-sw-grp { padding: 14px 0 4px; }
440
441
  .ev-st .ev-sw-what { margin: 0 0 10px; }
441
442
  .ev-st .ev-sw-warn { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; }
@@ -490,7 +491,7 @@
490
491
  /* the round Live button and its list, until the popup's chat holds the sessions: at the foot of the rail, above the chat icon */
491
492
  body.cz-railon .cz-fabw .cz-live { position: fixed; left: 26px; bottom: 228px; visibility: visible !important; } /* the rail is never a menu that covers it */
492
493
  body.cz-railon .cz-fabw .lv-tray:not(.lv-r) { position: fixed; left: calc(var(--cz-railx) - 8px); bottom: 16px; }
493
- body.cz-railon.cz-chatpop .cz-fabw .cz-live { display: none; }
494
+ body.cz-railon.cz-chatpop .cz-fabw .cz-live:not(.lv-away) { display: none; } /* a panel put away keeps it: its row is the only way back */
494
495
  /* the pages start after the rail */
495
496
  body.cz-railon .hm-desk { left: var(--cz-railx); }
496
497
  body.cz.cz-railon main.cz-panel.stage { margin-left: var(--cz-railx); }