create-pmos 0.398.0 → 0.400.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +30 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +19 -15
- package/workspace/briefing-premium-board-test.js +82 -50
- package/workspace/briefing-premium-calendar-2-test.js +36 -36
- package/workspace/briefing-premium-calendar-3-test.js +39 -39
- package/workspace/briefing-premium-calendar-test.js +23 -24
- package/workspace/briefing-premium-doc-edit-test.js +8 -10
- package/workspace/briefing-premium-initiative-test.js +38 -16
- package/workspace/briefing-premium-insights-test.js +114 -37
- package/workspace/briefing-premium-metrics-test.js +6 -4
- package/workspace/briefing-premium-products-test.js +10 -7
- package/workspace/briefing-premium-sources-test.js +25 -22
- package/workspace/briefing-premium-test.js +48 -43
- package/workspace/briefing-premium-work-test.js +16 -11
- package/workspace/c3-capture-test.js +0 -17
- package/workspace/changelog.json +29 -0
- package/workspace/ev-everywhere-test.js +210 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +11 -6
- package/workspace/guide/briefing-premium.md +2 -2
- package/workspace/guide/home.md +58 -19
- package/workspace/guide/index.md +1 -1
- package/workspace/guide/layout.md +2 -2
- package/workspace/guide/notes.md +2 -2
- package/workspace/guide/phone-companion.md +1 -1
- package/workspace/lib/board-grill.js +63 -0
- package/workspace/lib/board-premium.js +36 -5
- package/workspace/lib/initiative-layout.js +77 -0
- package/workspace/lib/insights-premium.js +3 -2
- package/workspace/lib/insights-records.js +21 -7
- package/workspace/lib/meeting-points.js +52 -0
- package/workspace/lib/news-for-you.js +88 -0
- package/workspace/lib/notes-series.js +29 -6
- package/workspace/lib/report-confirm.js +48 -0
- package/workspace/lib/route-modules.js +9 -9
- package/workspace/lib/routes-board-docs.js +46 -0
- package/workspace/lib/routes-board-grill.js +90 -0
- package/workspace/lib/routes-home-review.js +108 -0
- package/workspace/lib/routes-initiative-layout.js +57 -0
- package/workspace/lib/routes-insights-premium.js +4 -1
- package/workspace/lib/routes-insights-records.js +8 -4
- package/workspace/lib/routes-meeting-points.js +37 -0
- package/workspace/lib/routes-news.js +57 -0
- package/workspace/lib/routes-notes.js +2 -1
- package/workspace/lib/routes-phone-day.js +18 -9
- package/workspace/lib/routes-report-confirm.js +31 -0
- package/workspace/lib/routes-search.js +38 -0
- package/workspace/lib/routes-slash.js +95 -0
- package/workspace/lib/search-index.js +176 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -2
- package/workspace/premium-board-actions-test.js +86 -50
- package/workspace/premium-briefing-depth-test.js +55 -54
- package/workspace/premium-chat-chart-tab-test.js +4 -2
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-report-tab-test.js +16 -2
- package/workspace/premium-chat-term-test.js +0 -10
- package/workspace/premium-core-doc-issue-test.js +15 -13
- package/workspace/premium-menu-rows-test.js +1 -1
- package/workspace/premium-phone-card-test.js +7 -5
- package/workspace/premium-report-read-test.js +55 -18
- package/workspace/premium-vw-backlog-test.js +2 -2
- package/workspace/premium-vw-cal-test.js +50 -35
- package/workspace/premium-vw-doc-test.js +10 -11
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-vw-jira-test.js +2 -2
- package/workspace/premium-vw-meet-test.js +37 -40
- package/workspace/premium-vw-notes-test.js +21 -19
- package/workspace/premium-vw-rec-test.js +11 -12
- package/workspace/premium-welcome-test.js +3 -3
- package/workspace/premium-work-depth-test.js +5 -6
- package/workspace/public/capture.html +23 -0
- package/workspace/public/pm/bd-acts.js +303 -225
- package/workspace/public/pm/bd-asks.js +261 -0
- package/workspace/public/pm/bd-pop.js +59 -0
- package/workspace/public/pm/bd-span.js +49 -13
- package/workspace/public/pm/bd-views.js +169 -0
- package/workspace/public/pm/c3-base.js +47 -0
- package/workspace/public/pm/c3-capture.js +1 -1
- package/workspace/public/pm/c3-ini-ui.js +1 -1
- package/workspace/public/pm/c3-sheet.js +1 -1
- package/workspace/public/pm/c3-toast.js +1 -1
- package/workspace/public/pm/console3.css +3 -0
- package/workspace/public/pm/cozy-board.css +301 -0
- package/workspace/public/pm/cozy-ev.css +228 -0
- package/workspace/public/pm/cozy-evmodel.js +106 -0
- package/workspace/public/pm/cozy-evui.js +47 -0
- package/workspace/public/pm/cozy-home.css +20 -5
- package/workspace/public/pm/cozy-insights.css +148 -10
- package/workspace/public/pm/cozy-nav.js +103 -39
- package/workspace/public/pm/cozy-news.js +140 -0
- package/workspace/public/pm/cozy-search.js +203 -0
- package/workspace/public/pm/cozy-settings.js +198 -0
- package/workspace/public/pm/cozy-sources.js +89 -0
- package/workspace/public/pm/cozy-today.css +220 -0
- package/workspace/public/pm/cozy-viewer.js +5 -2
- package/workspace/public/pm/cozy-vw-mtg.css +350 -0
- package/workspace/public/pm/cozy-vw-rp.css +152 -0
- package/workspace/public/pm/cozy.css +9 -0
- package/workspace/public/pm/goal-chat.js +5 -1
- package/workspace/public/pm/home-adddoc.js +5 -5
- package/workspace/public/pm/home-app.js +365 -70
- package/workspace/public/pm/home-around.js +24 -126
- package/workspace/public/pm/home-chat.js +77 -18
- package/workspace/public/pm/home-data.js +9 -7
- package/workspace/public/pm/home-dictate.js +57 -0
- package/workspace/public/pm/home-draft.js +6 -6
- package/workspace/public/pm/home-ini-model.js +190 -0
- package/workspace/public/pm/home-ini.css +171 -0
- package/workspace/public/pm/home-ini.js +466 -0
- package/workspace/public/pm/home-list.js +289 -0
- package/workspace/public/pm/home-more.js +18 -135
- package/workspace/public/pm/home-phone-card.js +13 -8
- package/workspace/public/pm/home-review.js +103 -0
- package/workspace/public/pm/home-task.js +67 -0
- package/workspace/public/pm/home-today.js +148 -0
- package/workspace/public/pm/home-work.js +63 -28
- package/workspace/public/pm/note-dock.js +1 -2
- package/workspace/public/pm/notes-links.js +1 -2
- package/workspace/public/pm/notes-task.js +3 -4
- package/workspace/public/pm/premium-board.js +164 -40
- package/workspace/public/pm/premium-chart-tab.js +4 -5
- package/workspace/public/pm/premium-first.js +5 -7
- package/workspace/public/pm/premium-initiative-head.js +3 -3
- package/workspace/public/pm/premium-insights.js +499 -202
- package/workspace/public/pm/premium-mtg-present.js +138 -0
- package/workspace/public/pm/premium-mtg-replay.js +142 -0
- package/workspace/public/pm/premium-report-read.js +216 -52
- package/workspace/public/pm/premium-report-tab.js +44 -19
- package/workspace/public/pm/premium-shell.js +7 -7
- package/workspace/public/pm/premium-vw-cal.js +150 -60
- package/workspace/public/pm/premium-vw-doc.css +20 -2
- package/workspace/public/pm/premium-vw-doc.js +22 -7
- package/workspace/public/pm/premium-vw-mtg.js +488 -261
- package/workspace/public/pm/premium-vw-notes.js +61 -0
- package/workspace/public/pm/rp-parts.js +269 -0
- package/workspace/public/pm/view-notes.js +2 -2
- package/workspace/public/premium-board.html +4 -3
- package/workspace/public/premium-insights.html +10 -10
- package/workspace/public/premium.html +3 -1
- package/workspace/r/m1.png +0 -0
- package/workspace/r/m2.png +0 -0
- package/workspace/r/m3.png +0 -0
- package/workspace/r/nl.png +0 -0
- package/workspace/replaced-tests.json +435 -0
- package/workspace/run-tests.js +323 -28
- package/workspace/server.js +15 -10
- package/workspace/test-files.json +3 -140
- package/workspace/test-lists/base.json +1 -2
- package/workspace/test-lists/c3-desktop-light-load.json +1 -2
- package/workspace/test-lists/c3-initiative-boards.json +1 -2
- package/workspace/test-lists/c3-meeting-focus.json +2 -12
- package/workspace/test-lists/c3-work-agent.json +1 -2
- package/workspace/test-lists/calendar-tidy-up.json +1 -2
- package/workspace/test-lists/console3-reports.json +1 -2
- package/workspace/test-lists/docs-three-way-sync.json +1 -2
- package/workspace/test-lists/extension-capture.json +5 -0
- package/workspace/test-lists/initiative-layout.json +9 -0
- package/workspace/test-lists/jira-wbs.json +1 -2
- package/workspace/test-lists/legacy-cleanup-a.json +9 -0
- package/workspace/test-lists/meeting-material.json +1 -2
- package/workspace/test-lists/meeting-notes.json +2 -36
- package/workspace/test-lists/meeting-replay.json +1 -2
- package/workspace/test-lists/mm-capture.json +2 -12
- package/workspace/test-lists/my-work.json +2 -10
- package/workspace/test-lists/onboarding-firstrun.json +2 -12
- package/workspace/test-lists/people-directory.json +1 -2
- package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
- package/workspace/test-lists/premium-uncovered-reports.json +9 -0
- package/workspace/test-lists/run2-a.json +1 -2
- package/workspace/test-lists/run2-d.json +2 -19
- package/workspace/test-lists/run3-b.json +1 -2
- package/workspace/test-lists/run3-c.json +2 -12
- package/workspace/test-lists/run4-b.json +1 -2
- package/workspace/test-lists/run4-d.json +1 -5
- package/workspace/test-lists/run5-c.json +1 -11
- package/workspace/test-lists/run6.json +1 -5
- package/workspace/test-lists/uf-everywhere.json +15 -0
- package/workspace/test-lists/uf-home.json +9 -0
- package/workspace/test-lists/uncovered-board.json +9 -0
- package/workspace/test-lists/workspace-launch-flags.json +2 -12
- package/workspace/test-lists/workspace-profile-detection.json +2 -10
- package/workspace/test-timings.json +242 -123
- package/workspace/c3-briefing-test.js +0 -136
- package/workspace/c3-core-docs-test.js +0 -170
- package/workspace/c3-driver-fixture.js +0 -64
- package/workspace/c3-driver-test.js +0 -169
- package/workspace/c3-foundation-test.js +0 -163
- package/workspace/c3-ib-items-test.js +0 -114
- package/workspace/c3-ib-more-test.js +0 -146
- package/workspace/c3-ib-triage-backlog-test.js +0 -128
- package/workspace/c3-ini-harness.js +0 -66
- package/workspace/c3-ini-life-test.js +0 -167
- package/workspace/c3-initiatives-test.js +0 -186
- package/workspace/c3-light-load-test.js +0 -112
- package/workspace/c3-one-home-test.js +0 -149
- package/workspace/c3-phone-test.js +0 -289
- package/workspace/c3-quiet-test.js +0 -157
- package/workspace/c3-report-design-real-test.js +0 -264
- package/workspace/c3-report-design-test.js +0 -442
- package/workspace/c3-report-setup-test.js +0 -192
- package/workspace/c3-report-structure-real-test.js +0 -248
- package/workspace/c3-report-structure-test.js +0 -397
- package/workspace/c3-reports-test.js +0 -288
- package/workspace/c3-scan-test.js +0 -517
- package/workspace/c3-sessions-panel-test.js +0 -365
- package/workspace/c3-settings-test.js +0 -204
- package/workspace/c3-updates-test.js +0 -131
- package/workspace/c3-work-test.js +0 -260
- package/workspace/cut-stub.js +0 -40
- package/workspace/first-paint-audit.js +0 -160
- package/workspace/lib/c3-full-console.js +0 -15
- package/workspace/lib/engine/derived/trust.js +0 -3
- package/workspace/lib/engine/plan-forecast.js +0 -342
- package/workspace/lib/engine/report-families.js +0 -175
- package/workspace/lib/engine/truth-table.js +0 -57
- package/workspace/lib/routes-c3-init.js +0 -54
- package/workspace/lib/routes-c3-life.js +0 -120
- package/workspace/lib/routes-c3-timeline.js +0 -192
- package/workspace/lib/routes-forecast.js +0 -86
- package/workspace/lib/routes-releases.js +0 -130
- package/workspace/lib/routes-report-facts.js +0 -85
- package/workspace/lib/routes-report-families.js +0 -33
- package/workspace/lib/routes-signals.js +0 -51
- package/workspace/lib/routes-timeline.js +0 -197
- package/workspace/public/c3.html +0 -35
- package/workspace/public/index.html +0 -156
- package/workspace/public/pm/app.js +0 -831
- package/workspace/public/pm/bd-board.js +0 -159
- package/workspace/public/pm/bd-drag.js +0 -59
- package/workspace/public/pm/bd-model.js +0 -152
- package/workspace/public/pm/bd-timeline.js +0 -233
- package/workspace/public/pm/bd-tree.js +0 -244
- package/workspace/public/pm/board-copy.js +0 -59
- package/workspace/public/pm/board-read.js +0 -38
- package/workspace/public/pm/branches-sheet.js +0 -56
- package/workspace/public/pm/breakdown-api.js +0 -58
- package/workspace/public/pm/breakdown-copy.js +0 -138
- package/workspace/public/pm/briefing-deck.js +0 -441
- package/workspace/public/pm/briefing-model.js +0 -251
- package/workspace/public/pm/c3-ambient.js +0 -100
- package/workspace/public/pm/c3-audience-link.js +0 -21
- package/workspace/public/pm/c3-audience.js +0 -46
- package/workspace/public/pm/c3-boot.js +0 -13
- package/workspace/public/pm/c3-breakdown.js +0 -240
- package/workspace/public/pm/c3-brief-data.js +0 -11
- package/workspace/public/pm/c3-brief-mentions.js +0 -137
- package/workspace/public/pm/c3-brief-needs.js +0 -288
- package/workspace/public/pm/c3-brief-pulse.js +0 -112
- package/workspace/public/pm/c3-brief-summary.js +0 -139
- package/workspace/public/pm/c3-brief-today.js +0 -79
- package/workspace/public/pm/c3-brief.js +0 -279
- package/workspace/public/pm/c3-cal-strategy.js +0 -529
- package/workspace/public/pm/c3-calendar.js +0 -965
- package/workspace/public/pm/c3-calpop.js +0 -111
- package/workspace/public/pm/c3-case.js +0 -196
- package/workspace/public/pm/c3-core-docs.css +0 -18
- package/workspace/public/pm/c3-core-docs.js +0 -236
- package/workspace/public/pm/c3-daypart.js +0 -176
- package/workspace/public/pm/c3-demo-boards.js +0 -764
- package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
- package/workspace/public/pm/c3-demo-brief-page.js +0 -70
- package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
- package/workspace/public/pm/c3-demo-cal2.js +0 -66
- package/workspace/public/pm/c3-demo-cal3.js +0 -173
- package/workspace/public/pm/c3-demo-cal4.js +0 -169
- package/workspace/public/pm/c3-demo-cal5.js +0 -52
- package/workspace/public/pm/c3-demo-coredocs.js +0 -221
- package/workspace/public/pm/c3-demo-data.js +0 -552
- package/workspace/public/pm/c3-demo-focus.js +0 -181
- package/workspace/public/pm/c3-demo-init.js +0 -430
- package/workspace/public/pm/c3-demo-life.js +0 -77
- package/workspace/public/pm/c3-demo-material.js +0 -58
- package/workspace/public/pm/c3-demo-misc2.js +0 -34
- package/workspace/public/pm/c3-demo-phone.js +0 -48
- package/workspace/public/pm/c3-demo-plan2.js +0 -30
- package/workspace/public/pm/c3-demo-rd.js +0 -432
- package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
- package/workspace/public/pm/c3-demo-rep2.js +0 -130
- package/workspace/public/pm/c3-demo-rep3.js +0 -138
- package/workspace/public/pm/c3-demo-rs.js +0 -287
- package/workspace/public/pm/c3-demo-term.js +0 -153
- package/workspace/public/pm/c3-demo-time.js +0 -49
- package/workspace/public/pm/c3-demo-work-ix.js +0 -32
- package/workspace/public/pm/c3-demo.js +0 -131
- package/workspace/public/pm/c3-design-studio.js +0 -369
- package/workspace/public/pm/c3-doc-formats.js +0 -153
- package/workspace/public/pm/c3-doc-sheet.js +0 -1230
- package/workspace/public/pm/c3-dock.js +0 -206
- package/workspace/public/pm/c3-docs.js +0 -291
- package/workspace/public/pm/c3-driver-work.js +0 -110
- package/workspace/public/pm/c3-driver.css +0 -18
- package/workspace/public/pm/c3-driver.js +0 -298
- package/workspace/public/pm/c3-focus.css +0 -304
- package/workspace/public/pm/c3-focus.js +0 -983
- package/workspace/public/pm/c3-ib-docs.js +0 -92
- package/workspace/public/pm/c3-ib-initiatives.js +0 -201
- package/workspace/public/pm/c3-ib-items.js +0 -210
- package/workspace/public/pm/c3-ib-releases.js +0 -48
- package/workspace/public/pm/c3-ib-sprints.js +0 -201
- package/workspace/public/pm/c3-ib-triage.js +0 -177
- package/workspace/public/pm/c3-ii-tabs.js +0 -252
- package/workspace/public/pm/c3-ini-life.css +0 -34
- package/workspace/public/pm/c3-ini-life.js +0 -379
- package/workspace/public/pm/c3-ini-records.js +0 -197
- package/workspace/public/pm/c3-ini-timeline.js +0 -278
- package/workspace/public/pm/c3-ini-work.js +0 -139
- package/workspace/public/pm/c3-init-extras.js +0 -170
- package/workspace/public/pm/c3-initiatives.js +0 -852
- package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
- package/workspace/public/pm/c3-look.js +0 -27
- package/workspace/public/pm/c3-material.css +0 -22
- package/workspace/public/pm/c3-material.js +0 -321
- package/workspace/public/pm/c3-md.js +0 -3
- package/workspace/public/pm/c3-misc-panels.js +0 -89
- package/workspace/public/pm/c3-new-session.js +0 -110
- package/workspace/public/pm/c3-notes.js +0 -751
- package/workspace/public/pm/c3-phone-boot.js +0 -47
- package/workspace/public/pm/c3-phone-detail.js +0 -97
- package/workspace/public/pm/c3-phone-model.js +0 -3
- package/workspace/public/pm/c3-phone.css +0 -66
- package/workspace/public/pm/c3-phone.js +0 -444
- package/workspace/public/pm/c3-plan-panels.js +0 -163
- package/workspace/public/pm/c3-plan.js +0 -193
- package/workspace/public/pm/c3-quiet.css +0 -113
- package/workspace/public/pm/c3-quiet.js +0 -177
- package/workspace/public/pm/c3-replay.css +0 -133
- package/workspace/public/pm/c3-replay.js +0 -429
- package/workspace/public/pm/c3-report-deck.css +0 -163
- package/workspace/public/pm/c3-report-deck.js +0 -598
- package/workspace/public/pm/c3-report-frame.css +0 -20
- package/workspace/public/pm/c3-report-print.css +0 -20
- package/workspace/public/pm/c3-report-setup.css +0 -67
- package/workspace/public/pm/c3-report-setup.js +0 -298
- package/workspace/public/pm/c3-report-store.js +0 -244
- package/workspace/public/pm/c3-report-structure.css +0 -44
- package/workspace/public/pm/c3-report-structure.js +0 -473
- package/workspace/public/pm/c3-reports.css +0 -68
- package/workspace/public/pm/c3-reports.js +0 -377
- package/workspace/public/pm/c3-roadmap.js +0 -249
- package/workspace/public/pm/c3-scan-api.js +0 -167
- package/workspace/public/pm/c3-scan-next.js +0 -248
- package/workspace/public/pm/c3-scan-setup.js +0 -313
- package/workspace/public/pm/c3-scan-words.js +0 -41
- package/workspace/public/pm/c3-scan.css +0 -74
- package/workspace/public/pm/c3-scan.js +0 -93
- package/workspace/public/pm/c3-session-chat.js +0 -103
- package/workspace/public/pm/c3-session-conv.js +0 -165
- package/workspace/public/pm/c3-session-term.js +0 -216
- package/workspace/public/pm/c3-settings.css +0 -85
- package/workspace/public/pm/c3-settings.js +0 -1045
- package/workspace/public/pm/c3-shell.js +0 -628
- package/workspace/public/pm/c3-signals.js +0 -196
- package/workspace/public/pm/c3-strategy-panels.js +0 -45
- package/workspace/public/pm/c3-swipe.js +0 -230
- package/workspace/public/pm/c3-terminal-data.js +0 -48
- package/workspace/public/pm/c3-terminal-edge.js +0 -91
- package/workspace/public/pm/c3-terminal-icons.js +0 -40
- package/workspace/public/pm/c3-terminal-results.js +0 -141
- package/workspace/public/pm/c3-terminal.js +0 -52
- package/workspace/public/pm/c3-tickets.js +0 -163
- package/workspace/public/pm/c3-timeline.js +0 -201
- package/workspace/public/pm/calendar-views.js +0 -1049
- package/workspace/public/pm/console3-lift.md +0 -220
- package/workspace/public/pm/cozy-home.js +0 -172
- package/workspace/public/pm/cozy-initiative.css +0 -138
- package/workspace/public/pm/cycle-review.js +0 -125
- package/workspace/public/pm/data.js +0 -1577
- package/workspace/public/pm/dest-board.js +0 -444
- package/workspace/public/pm/dest-docs.js +0 -530
- package/workspace/public/pm/dest-initiatives.js +0 -162
- package/workspace/public/pm/dest-mywork.js +0 -307
- package/workspace/public/pm/dest-notes.js +0 -537
- package/workspace/public/pm/dest-people.js +0 -449
- package/workspace/public/pm/dest-reports.js +0 -383
- package/workspace/public/pm/dest-settings.js +0 -601
- package/workspace/public/pm/dest-today.js +0 -267
- package/workspace/public/pm/display-word.js +0 -56
- package/workspace/public/pm/doc-editor.js +0 -473
- package/workspace/public/pm/doc-graph.js +0 -272
- package/workspace/public/pm/doc-health-panel.js +0 -110
- package/workspace/public/pm/doc-rail.js +0 -167
- package/workspace/public/pm/doc-remote.js +0 -180
- package/workspace/public/pm/dock-sessions.js +0 -472
- package/workspace/public/pm/dock.js +0 -216
- package/workspace/public/pm/fixture.js +0 -821
- package/workspace/public/pm/flag-picker.js +0 -104
- package/workspace/public/pm/frame-copy.js +0 -278
- package/workspace/public/pm/freshness-line.js +0 -149
- package/workspace/public/pm/handoff-box.js +0 -82
- package/workspace/public/pm/initiative-list.js +0 -235
- package/workspace/public/pm/initiative-sheet.js +0 -331
- package/workspace/public/pm/initiatives-api.js +0 -95
- package/workspace/public/pm/initiatives-copy.js +0 -287
- package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
- package/workspace/public/pm/initiatives-timeline.js +0 -410
- package/workspace/public/pm/initiatives-ui.js +0 -291
- package/workspace/public/pm/item-sheet.js +0 -268
- package/workspace/public/pm/keep-card.js +0 -204
- package/workspace/public/pm/lifecycle-lens-model.js +0 -246
- package/workspace/public/pm/lifecycle-lens.js +0 -276
- package/workspace/public/pm/lifecycle.js +0 -111
- package/workspace/public/pm/mobile.css +0 -366
- package/workspace/public/pm/mobile.js +0 -581
- package/workspace/public/pm/modes-live.js +0 -453
- package/workspace/public/pm/modes.js +0 -147
- package/workspace/public/pm/my-work-card.js +0 -51
- package/workspace/public/pm/my-work-data.js +0 -36
- package/workspace/public/pm/new-initiative-sheet.js +0 -169
- package/workspace/public/pm/next-step-ui.js +0 -190
- package/workspace/public/pm/outbox-panel.js +0 -125
- package/workspace/public/pm/palette-copy.js +0 -55
- package/workspace/public/pm/palette.js +0 -343
- package/workspace/public/pm/panel-breakdown.js +0 -702
- package/workspace/public/pm/panel-cockpit.js +0 -425
- package/workspace/public/pm/panel-detail.js +0 -1513
- package/workspace/public/pm/panel-initiatives.js +0 -929
- package/workspace/public/pm/panel-newsess.js +0 -709
- package/workspace/public/pm/panel-repos.js +0 -741
- package/workspace/public/pm/panel-tabs.js +0 -1506
- package/workspace/public/pm/panel-trees.js +0 -204
- package/workspace/public/pm/people-link.js +0 -106
- package/workspace/public/pm/phone-deck.js +0 -167
- package/workspace/public/pm/pm-work-view.js +0 -1533
- package/workspace/public/pm/portfolio-report.js +0 -61
- package/workspace/public/pm/premium-acts.js +0 -280
- package/workspace/public/pm/premium-brief.js +0 -111
- package/workspace/public/pm/premium-chat.js +0 -22
- package/workspace/public/pm/premium-doc-sheet.js +0 -312
- package/workspace/public/pm/premium-initiative.js +0 -324
- package/workspace/public/pm/premium-insights.css +0 -228
- package/workspace/public/pm/premium-metric-tiles.js +0 -68
- package/workspace/public/pm/premium-report-brief.js +0 -132
- package/workspace/public/pm/premium-vw-rec.js +0 -67
- package/workspace/public/pm/premium-wide.css +0 -30
- package/workspace/public/pm/print.css +0 -44
- package/workspace/public/pm/provider-cards.js +0 -136
- package/workspace/public/pm/registry.js +0 -203
- package/workspace/public/pm/release-card.js +0 -110
- package/workspace/public/pm/releases-view.js +0 -248
- package/workspace/public/pm/report-families-view.js +0 -505
- package/workspace/public/pm/report-slides.js +0 -438
- package/workspace/public/pm/report-tab.js +0 -33
- package/workspace/public/pm/report-view.js +0 -337
- package/workspace/public/pm/reports-copy.js +0 -134
- package/workspace/public/pm/roadmap.js +0 -294
- package/workspace/public/pm/run-card.js +0 -260
- package/workspace/public/pm/sessions-panel.js +0 -219
- package/workspace/public/pm/sheet-jira.js +0 -353
- package/workspace/public/pm/shell-bell.js +0 -163
- package/workspace/public/pm/shell-model.js +0 -83
- package/workspace/public/pm/shell-phone.js +0 -124
- package/workspace/public/pm/shell-readaloud.js +0 -53
- package/workspace/public/pm/shell-recording.js +0 -274
- package/workspace/public/pm/shell-ticker.js +0 -90
- package/workspace/public/pm/sig-watch.js +0 -41
- package/workspace/public/pm/slide-confirm.js +0 -163
- package/workspace/public/pm/slides-copy.js +0 -52
- package/workspace/public/pm/status-banner.js +0 -95
- package/workspace/public/pm/tab-doc.js +0 -859
- package/workspace/public/pm/tab-gone.js +0 -21
- package/workspace/public/pm/tab-term.js +0 -1210
- package/workspace/public/pm/tab-web.js +0 -90
- package/workspace/public/pm/timeline-copy.js +0 -48
- package/workspace/public/pm/timeline-forecast-view.js +0 -164
- package/workspace/public/pm/today-agenda.js +0 -331
- package/workspace/public/pm/today-cards.js +0 -244
- package/workspace/public/pm/today-copy.js +0 -506
- package/workspace/public/pm/today-day.js +0 -1371
- package/workspace/public/pm/today-goals.js +0 -297
- package/workspace/public/pm/today-jobs.js +0 -84
- package/workspace/public/pm/today-mentions.js +0 -50
- package/workspace/public/pm/topbar.js +0 -202
- package/workspace/public/pm/triage-card.js +0 -60
- package/workspace/public/pm/undo-hold.js +0 -103
- package/workspace/public/pm/view-addrepo.js +0 -208
- package/workspace/public/pm/view-files.js +0 -197
- package/workspace/public/pm/view-livenotes.js +0 -399
- package/workspace/public/pm/view-today.js +0 -13
- package/workspace/public/pm/view-validate.js +0 -171
- package/workspace/public/pm/welcome.js +0 -391
- package/workspace/public/pm/work-place.js +0 -68
- package/workspace/public/pm/xlsx-read.js +0 -117
- package/workspace/public/welcome.html +0 -22
- package/workspace/test-lists/browser-suites-green.json +0 -5
- package/workspace/test-lists/c3-core-docs.json +0 -9
- package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
- package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
- package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
- package/workspace/test-lists/c3-ib-items.json +0 -9
- package/workspace/test-lists/c3-ib-more.json +0 -9
- package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
- package/workspace/test-lists/c3-ini-life.json +0 -9
- package/workspace/test-lists/c3-meeting-board.json +0 -5
- package/workspace/test-lists/c3-meeting-card.json +0 -5
- package/workspace/test-lists/c3-notes-place.json +0 -5
- package/workspace/test-lists/c3-notes-series.json +0 -5
- package/workspace/test-lists/calendar-time-page.json +0 -5
- package/workspace/test-lists/calpop.json +0 -4
- package/workspace/test-lists/console3-briefing.json +0 -9
- package/workspace/test-lists/console3-foundation.json +0 -9
- package/workspace/test-lists/console3-work-page.json +0 -9
- package/workspace/test-lists/premium-brief-parity.json +0 -9
- package/workspace/test-lists/report-design-studio-ui.json +0 -5
- package/workspace/test-lists/report-structure-ui.json +0 -11
- package/workspace/test-lists/report-workspace-ui.json +0 -5
- package/workspace/test-lists/run3-a.json +0 -5
- package/workspace/test-lists/run3-d.json +0 -6
- package/workspace/test-lists/run4-c.json +0 -13
- package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
- package/workspace/test-lists/today-mentions-cards.json +0 -5
- package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/* pm/c3-calpop.js — the calendar as a popup over any page of the console (briefing-brief PRD R7, R9).
|
|
2
|
-
*
|
|
3
|
-
* mountCalPopupTrigger(toolsHost) adds the calendar button to the top bar's tools, and binds the key C (once)
|
|
4
|
-
* openCalendarPopup(opener?) opens the Calendar page's own grid (five zooms, chips, detail, Free time, lanes) in a drawer over the page
|
|
5
|
-
* closeCalendarPopup(back?) closes it; `back` (default true) returns the focus to where it was
|
|
6
|
-
* lastZoom() the zoom last used, "day" until the PM changes it
|
|
7
|
-
*
|
|
8
|
-
* The popup mounts calendar-views.js mountCalendarViews on a host of its own, so it never shares state with the Calendar tab
|
|
9
|
-
* (mountCalendarViews keys its state on the host element). Closing calls disposeCalendarViews on that host, which removes
|
|
10
|
-
* the view's own key handler. The dialog is data-shell="calpop", not "sheet", so the view's + and - keys keep working inside it;
|
|
11
|
-
* the Calendar tab's instance steps aside while the popup is open (calendar-views.js onKey).
|
|
12
|
-
* Not open on load. Escape, a press on the scrim and the close button close it. Tab stays inside. On a phone it is full screen.
|
|
13
|
-
* The zoom is kept in module state; localStorage only inside try/catch, as a convenience.
|
|
14
|
-
*/
|
|
15
|
-
import { el } from './dom.js';
|
|
16
|
-
import { ensureC3Css, c3ic, c3ib, c3Phone } from './pm-work-view.js';
|
|
17
|
-
/* The calendar's code (calendar-views.js and the notes it draws) loads on the first opening, not with the page (c3-desktop-light-load). */
|
|
18
|
-
let views = null;
|
|
19
|
-
const loadViews = () => views || (views = import('./calendar-views.js').catch((e) => { views = null; throw e; }));
|
|
20
|
-
|
|
21
|
-
const ZOOMS = ['day', 'week', 'month', 'quarter', 'year'];
|
|
22
|
-
const KEY = 'pmos.c3.calpop.zoom';
|
|
23
|
-
const store = {
|
|
24
|
-
get() { try { return localStorage.getItem(KEY); } catch { return null; } },
|
|
25
|
-
set(v) { try { localStorage.setItem(KEY, v); } catch { /* no storage */ } },
|
|
26
|
-
};
|
|
27
|
-
let zoom = ZOOMS.includes(store.get()) ? store.get() : 'week'; // the overlay opens on the Week (the mockup's mem.zoom)
|
|
28
|
-
let cur = null; // { wrap, host, opener, off, obs, stopPhone }
|
|
29
|
-
let keyBound = false;
|
|
30
|
-
|
|
31
|
-
export const lastZoom = () => zoom;
|
|
32
|
-
export const isCalendarPopupOpen = () => !!cur;
|
|
33
|
-
|
|
34
|
-
/** The zoom the view is on now: its pressed Day/Week/... button. */
|
|
35
|
-
function readZoom(host) {
|
|
36
|
-
const b = host.querySelector('[data-cv-view][aria-pressed="true"],[data-cv-view][aria-selected="true"],[data-cv-view][aria-current="true"]');
|
|
37
|
-
const v = b && b.getAttribute('data-cv-view');
|
|
38
|
-
return ZOOMS.includes(v) ? v : null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
42
|
-
|
|
43
|
-
export function closeCalendarPopup(back = true) {
|
|
44
|
-
if (!cur) return;
|
|
45
|
-
const c = cur; cur = null;
|
|
46
|
-
const z = readZoom(c.host); if (z) { zoom = z; store.set(z); }
|
|
47
|
-
document.removeEventListener('keydown', c.onKey, true);
|
|
48
|
-
if (c.obs) c.obs.disconnect();
|
|
49
|
-
if (c.stopPhone) c.stopPhone();
|
|
50
|
-
if (views) views.then((m) => m.disposeCalendarViews(c.host)).catch(() => { /* already gone */ });
|
|
51
|
-
c.wrap.remove();
|
|
52
|
-
if (back && c.opener && c.opener.isConnected && c.opener.focus) { try { c.opener.focus({ preventScroll: true }); } catch { /* not focusable any more */ } }
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function openCalendarPopup(opener) {
|
|
56
|
-
if (cur) return;
|
|
57
|
-
ensureC3Css();
|
|
58
|
-
const from = opener || (document.activeElement && document.activeElement !== document.body ? document.activeElement : document.querySelector('[data-c3pg="calendar"]'));
|
|
59
|
-
const close = () => closeCalendarPopup(true);
|
|
60
|
-
const host = el('div', { class: 'calpop-host', 'data-c3pg': 'calpop-host' });
|
|
61
|
-
const closeBtn = c3ib('Close', 'x', { title: 'Close (Esc)', 'data-c3pg': 'calpop-close', onclick: close }, 'sm');
|
|
62
|
-
const head = el('div', { class: 'sh2' }, el('span', { class: 'chips2' }, c3ic('cal'), el('b', null, 'Calendar')), el('span', { class: 'chips2' }, el('span', { class: 'dim calpop-esc' }, 'Esc to close'), closeBtn));
|
|
63
|
-
const dlg = el('div', { class: 'sheet bs dw calpop', role: 'dialog', 'aria-modal': 'true', 'aria-label': 'Calendar', tabindex: '-1', 'data-c3pg': 'calpop' },
|
|
64
|
-
el('div', { class: 'grab' }), head, el('div', { class: 'sb' }, host));
|
|
65
|
-
const wrap = el('div', { class: 'c3 c3e c3pop', 'data-shell': 'calpop' }, el('div', { class: 'scrim', onclick: close }), dlg);
|
|
66
|
-
const stopPhone = c3Phone(wrap);
|
|
67
|
-
const onKey = (e) => {
|
|
68
|
-
if (e.key === 'Escape') { e.stopPropagation(); e.preventDefault(); close(); return; }
|
|
69
|
-
if (e.key !== 'Tab') return;
|
|
70
|
-
const items = [...dlg.querySelectorAll(FOCUSABLE)].filter((n) => n.offsetWidth > 0 || n.offsetHeight > 0 || n === document.activeElement);
|
|
71
|
-
if (!items.length) { e.preventDefault(); dlg.focus(); return; }
|
|
72
|
-
const at = items.indexOf(document.activeElement);
|
|
73
|
-
if (at < 0 || (e.shiftKey && at === 0) || (!e.shiftKey && at === items.length - 1)) { e.preventDefault(); items[e.shiftKey ? items.length - 1 : 0].focus(); }
|
|
74
|
-
};
|
|
75
|
-
document.addEventListener('keydown', onKey, true);
|
|
76
|
-
document.body.appendChild(wrap);
|
|
77
|
-
cur = { wrap, host, opener: from, onKey, stopPhone, obs: null };
|
|
78
|
-
host.append(el('p', { class: 'dim mono c3s2', role: 'status', 'data-c3pg': 'calpop-loading' }, 'Opening the calendar'));
|
|
79
|
-
const mine = cur;
|
|
80
|
-
loadViews().then((m) => {
|
|
81
|
-
if (cur !== mine) return; // closed before the code arrived
|
|
82
|
-
host.replaceChildren();
|
|
83
|
-
m.mountCalendarViews(host, { view: zoom, page: true, overlay: true }); // the same page grid as the Calendar tab, 36px an hour, no deck
|
|
84
|
-
}, (e) => { if (cur === mine) host.replaceChildren(el('p', { class: 'dim mono c3s2', role: 'status' }, 'The calendar could not load: ' + String((e && e.message) || e))); });
|
|
85
|
-
/* remember the zoom as it changes, so a reload of the page also keeps it */
|
|
86
|
-
cur.obs = new MutationObserver(() => { const z = readZoom(host); if (z) { zoom = z; store.set(z); } });
|
|
87
|
-
cur.obs.observe(host, { subtree: true, childList: true, attributes: true, attributeFilter: ['aria-pressed'] });
|
|
88
|
-
dlg.focus({ preventScroll: true });
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const typing = (n) => !!(n && n.matches && n.matches('input,textarea,select,[contenteditable],[contenteditable="true"]'));
|
|
92
|
-
const otherSheet = () => !!document.querySelector('[data-shell="sheet"],[data-shell="preview"],[data-shell="palette"]');
|
|
93
|
-
|
|
94
|
-
function onC(e) {
|
|
95
|
-
if (e.key !== 'c' && e.key !== 'C') return;
|
|
96
|
-
if (e.ctrlKey || e.metaKey || e.altKey || e.defaultPrevented || e.repeat) return;
|
|
97
|
-
if (cur) return; // open already: Escape closes it
|
|
98
|
-
if (typing(document.activeElement) || typing(e.target) || otherSheet()) return;
|
|
99
|
-
e.preventDefault();
|
|
100
|
-
openCalendarPopup();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/** The calendar button, last before the search button; and the key C. Call once, with the top bar's tools element. */
|
|
104
|
-
export function mountCalPopupTrigger(toolsHost) {
|
|
105
|
-
if (!keyBound) { keyBound = true; document.addEventListener('keydown', onC, true); }
|
|
106
|
-
if (!toolsHost || toolsHost.querySelector('[data-c3pg="calendar"]')) return null;
|
|
107
|
-
const btn = c3ib('Calendar (C)', 'cal', { 'aria-haspopup': 'dialog', 'data-c3pg': 'calendar', onclick: (e) => openCalendarPopup(e.currentTarget) });
|
|
108
|
-
const search = toolsHost.querySelector('[data-c3pg="search"]');
|
|
109
|
-
if (search) toolsHost.insertBefore(btn, search); else toolsHost.append(btn);
|
|
110
|
-
return btn;
|
|
111
|
-
}
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
/* pm/c3-case.js — the console3 case file, as a primitive (console3.html: caseHtml line 2275, the case builders dcase 2271 and
|
|
2
|
-
* CARDC/NEEDC 2213 on, confirmCase 2297, the claim labels C3.LAB at line 4524).
|
|
3
|
-
*
|
|
4
|
-
* normalizeCase(model) -> the canonical case (pure; accepts the mockup's field names and the descriptive ones)
|
|
5
|
-
* slideFor(caseModel, pickedId) -> { enabled, reason, label } for the slide under the case (pure)
|
|
6
|
-
* renderCase(model, opts) -> the `.case` element; opts: { picked, onPick(id, option), onConfirm({ option, hash, case }),
|
|
7
|
-
* noConf (no confidence figure: the recommended option says "Suggested", the others nothing),
|
|
8
|
-
* renderQuote(text) → nodes (the quote drawn as rich text, for example a markdown draft),
|
|
9
|
-
* outbox: boolean, onGo(go) }
|
|
10
|
-
*
|
|
11
|
-
* What the mockup's case file holds, top to bottom, and what this draws:
|
|
12
|
-
* quote `blockquote.qd` the exact text a draft would send (optional, `quote` / `pre`)
|
|
13
|
-
* situation `p.sit` one or two sentences: what is going on and why it needs a decision
|
|
14
|
-
* move `.c3ag` "Suggested move: ..." (optional, `move`)
|
|
15
|
-
* evidence `ul.chgl` one `li` per fact: icon, the claim, and a tag (the source, or a fact/estimate/assumption/reported
|
|
16
|
-
* label; tone ok / warn / bad colours the icon)
|
|
17
|
-
* options `.opts` buttons `.opt`, the recommended one first with `.rec`, its confidence ("Recommended · 82%") and a
|
|
18
|
-
* `.conf` bar; each carries its effects (`.fx`: icon + text, tone). One is pressed (aria-pressed,
|
|
19
|
-
* role=radio): the recommended one until the person picks another.
|
|
20
|
-
* confirm `.c3hold` R3: where the main pointer is fine, the slide below is replaced by a compact button: press and hold 600 ms
|
|
21
|
-
* (a ring fills) for an act that cannot be undone, one click for one that can, Enter then Confirm from
|
|
22
|
-
* the keyboard (c3-swipe.js mountHold, holdMode). `opts.fine` forces the choice; the default asks matchMedia.
|
|
23
|
-
* slide `.slt` the slide-to-confirm (slide-confirm.js mountSlide). "Slide to choose this instead" and the grey
|
|
24
|
-
* `.alt` look when the pick is not the recommended one. It is bound to the picked option: its
|
|
25
|
-
* confirm hands back `hash` = `<case id>|<option id>`, the content the person saw.
|
|
26
|
-
* footer `.cft` "Unsure: ...", "If you wait: ...", "Why shown: ...", and a link chip to the record
|
|
27
|
-
* Gate: an option or case marked `outward` (it sends something to a person) cannot be confirmed here unless `opts.outbox` is true
|
|
28
|
-
* (an outbox is connected). The slide is then drawn disabled (`.slt.off`) with the reason under it; nothing is sent.
|
|
29
|
-
* Built with el(); every string from data goes in as a text node.
|
|
30
|
-
*/
|
|
31
|
-
import { el } from './dom.js';
|
|
32
|
-
import { c3ic } from './pm-work-view.js';
|
|
33
|
-
import { mountSlide, disposeSlide } from './slide-confirm.js';
|
|
34
|
-
import { mountHold, holdMode, finePointer } from './c3-swipe.js';
|
|
35
|
-
|
|
36
|
-
/** The claim labels of the mockup (C3.LAB): [icon, tag, tone]. */
|
|
37
|
-
export const LABELS = {
|
|
38
|
-
fact: ['check', 'fact', 'ok'], est: ['clock', 'estimate', 'warn'], ass: ['alert', 'assumption', 'warn'],
|
|
39
|
-
rep: ['user', 'reported', ''], unl: ['alert', 'unlabelled', 'bad'],
|
|
40
|
-
};
|
|
41
|
-
const TONES = new Set(['', 'ok', 'warn', 'bad']);
|
|
42
|
-
const tone = (t) => (TONES.has(t) ? t : '');
|
|
43
|
-
const str = (v) => (v === null || v === undefined ? '' : String(v));
|
|
44
|
-
|
|
45
|
-
function pct(v) {
|
|
46
|
-
const n = Number(v);
|
|
47
|
-
if (!Number.isFinite(n) || n <= 0) return 0;
|
|
48
|
-
return Math.max(0, Math.min(100, Math.round(n > 0 && n <= 1 && !Number.isInteger(n) ? n * 100 : n)));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function evidenceOf(item) {
|
|
52
|
-
if (Array.isArray(item)) { // the mockup's [icon, text, tag, tone]
|
|
53
|
-
const [icon, text, tag, tn] = item;
|
|
54
|
-
return { icon: icon || 'info', text: str(text), tag: str(tag), tone: tone(tn), label: '' };
|
|
55
|
-
}
|
|
56
|
-
const o = item || {};
|
|
57
|
-
const L = o.label && LABELS[o.label];
|
|
58
|
-
const parts = [L ? L[1] : str(o.label), str(o.source || o.tag)].filter(Boolean);
|
|
59
|
-
return { icon: o.icon || (L ? L[0] : 'info'), text: str(o.text || o.claim), tag: parts.join(' · '), tone: tone(o.tone !== undefined ? o.tone : (L ? L[2] : '')), label: str(o.label) };
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function effectOf(fx) {
|
|
63
|
-
if (Array.isArray(fx)) return { icon: fx[0] || 'info', text: str(fx[1]), tone: tone(fx[2]) };
|
|
64
|
-
const o = fx || {};
|
|
65
|
-
return { icon: o.icon || 'info', text: str(o.text), tone: tone(o.tone) };
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function optionOf(o, i) {
|
|
69
|
-
const x = o || {};
|
|
70
|
-
return { id: str(x.id !== undefined ? x.id : 'o' + i), label: str(x.l !== undefined ? x.l : x.label), rec: !!(x.rec || x.recommended),
|
|
71
|
-
effects: (x.fx || x.effects || []).map(effectOf), outward: !!x.outward, irreversible: !!x.irreversible, confidence: x.conf !== undefined || x.confidence !== undefined ? pct(x.conf !== undefined ? x.conf : x.confidence) : null };
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/** The canonical case. Exactly one option is the recommended one: the first marked, else the first (the mockup's recId). */
|
|
75
|
-
export function normalizeCase(model) {
|
|
76
|
-
const m = model || {};
|
|
77
|
-
const opts = (m.opts || m.options || []).map(optionOf);
|
|
78
|
-
const rec = opts.find((o) => o.rec) || opts[0] || null;
|
|
79
|
-
opts.forEach((o) => { o.rec = o === rec; });
|
|
80
|
-
const sorted = rec ? [rec, ...opts.filter((o) => o !== rec)] : []; // the recommended one leads, as caseHtml sorts
|
|
81
|
-
const go = m.go ? (Array.isArray(m.go) ? { action: m.go[0], key: m.go[1], label: str(m.go[2]) } : { action: m.go.action || '', key: m.go.key || '', label: str(m.go.label), href: m.go.href }) : null;
|
|
82
|
-
const mv = m.move || m.suggestedMove;
|
|
83
|
-
return {
|
|
84
|
-
id: str(m.id || m.key || ''),
|
|
85
|
-
tc: str(m.tc || m.tone || 'var(--acc)'),
|
|
86
|
-
quote: str(m.quote || m.pre),
|
|
87
|
-
situation: str(m.sit !== undefined ? m.sit : (m.situation !== undefined ? m.situation : '')),
|
|
88
|
-
move: mv ? str(typeof mv === 'object' ? mv.label : mv) : '',
|
|
89
|
-
evidence: (m.chg || m.evidence || []).map(evidenceOf),
|
|
90
|
-
options: sorted,
|
|
91
|
-
recId: rec ? rec.id : '',
|
|
92
|
-
confidence: pct(m.conf !== undefined ? m.conf : m.confidence !== undefined ? m.confidence : (rec && rec.confidence !== null ? rec.confidence : 0)),
|
|
93
|
-
unsure: str(m.unsure),
|
|
94
|
-
ifYouWait: str(m.ign !== undefined ? m.ign : m.ifYouWait),
|
|
95
|
-
why: str(m.why !== undefined ? m.why : m.whyShown),
|
|
96
|
-
cta: str(m.cta || 'Slide to confirm'),
|
|
97
|
-
go,
|
|
98
|
-
outward: !!m.outward,
|
|
99
|
-
outboxReason: str(m.outboxReason),
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/** The slide under the case for the picked option. Disabled when the action goes outside and no outbox is connected. */
|
|
104
|
-
export function slideFor(c, pickedId, { outbox = false } = {}) {
|
|
105
|
-
const opt = c.options.find((o) => o.id === pickedId) || c.options.find((o) => o.id === c.recId) || null;
|
|
106
|
-
if (!opt) return { enabled: false, reason: '', label: '', option: null, none: true };
|
|
107
|
-
const isRec = opt.id === c.recId;
|
|
108
|
-
const out = opt.outward || c.outward;
|
|
109
|
-
const label = isRec ? c.cta : 'Slide to choose this instead';
|
|
110
|
-
if (out && !outbox) return { enabled: false, option: opt, label, reason: c.outboxReason || 'This sends something outside. No outbox is connected, so it stays a draft.' };
|
|
111
|
-
return { enabled: true, option: opt, label, reason: '' };
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const fxList = (a) => el('div', { class: 'fx' }, ...a.map((f) => el('span', { class: f.tone }, c3ic(f.icon, 'sm'), f.text)));
|
|
115
|
-
|
|
116
|
-
export function renderCase(model, opts = {}) {
|
|
117
|
-
const c = normalizeCase(model);
|
|
118
|
-
const outbox = !!opts.outbox;
|
|
119
|
-
const noConf = !!opts.noConf;
|
|
120
|
-
let picked = c.options.some((o) => o.id === opts.picked) ? opts.picked : c.recId;
|
|
121
|
-
const root = el('div', { class: 'case', 'data-case': c.id || null, style: '--tc:' + c.tc });
|
|
122
|
-
const optsHost = c.options.length ? el('div', { class: 'opts', role: 'radiogroup', 'aria-label': 'Options' }) : null;
|
|
123
|
-
const slideHost = c.options.length ? el('div', { class: 'c3slide' }) : null;
|
|
124
|
-
|
|
125
|
-
const drawOptions = () => {
|
|
126
|
-
optsHost.replaceChildren(...c.options.map((o) => {
|
|
127
|
-
const on = o.id === picked;
|
|
128
|
-
return el('button', { type: 'button', class: 'opt' + (o.rec ? ' rec' : ''), role: 'radio', 'aria-checked': String(on), 'aria-pressed': String(on), 'data-opt': o.id,
|
|
129
|
-
onclick: () => pick(o.id) },
|
|
130
|
-
el('span', { class: 'pk' }, c3ic('check', 'sm')),
|
|
131
|
-
// `noConf`: a real item has no confidence figure, so only the recommended option is marked, "Suggested", with no bar
|
|
132
|
-
noConf ? (o.rec ? el('span', { class: 'rk' }, c3ic('spark', 'sm'), 'Suggested') : null)
|
|
133
|
-
: el('span', { class: 'rk', title: 'Confidence from the sources listed above' }, o.rec ? [c3ic('spark', 'sm'), 'Recommended · ' + c.confidence + '%'] : null),
|
|
134
|
-
el('b', null, o.label),
|
|
135
|
-
fxList(o.effects),
|
|
136
|
-
o.rec ? el('div', { class: 'conf' }, el('i', { style: 'width:' + c.confidence + '%' })) : null);
|
|
137
|
-
}));
|
|
138
|
-
if (noConf) optsHost.querySelectorAll('.conf').forEach((n) => n.remove()); // no figure, no bar
|
|
139
|
-
};
|
|
140
|
-
let disposeHold = null;
|
|
141
|
-
const drawSlide = () => {
|
|
142
|
-
disposeSlide(slideHost);
|
|
143
|
-
if (disposeHold) { disposeHold(); disposeHold = null; }
|
|
144
|
-
slideHost.replaceChildren();
|
|
145
|
-
const s = slideFor(c, picked, { outbox });
|
|
146
|
-
if (s.none) return;
|
|
147
|
-
const fine = opts.fine !== undefined ? !!opts.fine : finePointer();
|
|
148
|
-
if (s.enabled && fine) {
|
|
149
|
-
const trk = el('div', { class: 'c3confirm', 'data-case-slt': c.id || null });
|
|
150
|
-
slideHost.append(trk);
|
|
151
|
-
disposeHold = mountHold(trk, { label: s.option.label || s.label, mode: holdMode(s.option, c), hash: c.id + '|' + s.option.id, alt: s.option.id !== c.recId,
|
|
152
|
-
onConfirm: (hash) => { if (opts.onConfirm) opts.onConfirm({ option: s.option, hash, case: c }); } });
|
|
153
|
-
} else if (s.enabled) {
|
|
154
|
-
mountSlide(slideHost, { label: s.label, hash: c.id + '|' + s.option.id, onConfirm: (hash) => { if (opts.onConfirm) opts.onConfirm({ option: s.option, hash, case: c }); } });
|
|
155
|
-
const trk = slideHost.querySelector('.slt');
|
|
156
|
-
if (trk && s.option.id !== c.recId) trk.classList.add('alt');
|
|
157
|
-
if (trk && trk.dataset) trk.dataset.caseSlt = c.id;
|
|
158
|
-
} else {
|
|
159
|
-
slideHost.append(
|
|
160
|
-
el('div', { class: 'slt off', 'aria-disabled': 'true', 'data-case-slt': c.id || null, style: '--tc:var(--muted-foreground)' },
|
|
161
|
-
el('span', { class: 'lb' }, s.label + ' ›››'),
|
|
162
|
-
el('button', { type: 'button', class: 'th', disabled: true, 'aria-label': 'Confirm: ' + s.option.label + '. Not available: ' + s.reason }, c3ic('lock'))),
|
|
163
|
-
el('div', { class: 'slt-why', role: 'note' }, c3ic('lock', 'sm'), s.reason));
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
function pick(id) {
|
|
167
|
-
if (!c.options.some((o) => o.id === id)) return;
|
|
168
|
-
picked = id;
|
|
169
|
-
drawOptions(); drawSlide();
|
|
170
|
-
if (opts.onPick) opts.onPick(id, c.options.find((o) => o.id === id));
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (c.quote) root.append(el('blockquote', { class: 'qd' + (opts.renderQuote ? ' qd-md' : '') }, opts.renderQuote ? opts.renderQuote(c.quote) : c.quote));
|
|
174
|
-
root.append(el('p', { class: 'sit' }, c.situation));
|
|
175
|
-
if (c.move) root.append(el('div', { class: 'c3ag' }, el('div', { class: 'dim mono', style: 'font-size:var(--fs-2)' }, c3ic('spark', 'sm'), ' Suggested move: ' + c.move)));
|
|
176
|
-
if (c.evidence.length) {
|
|
177
|
-
root.append(el('ul', { class: 'chgl', role: 'list' }, ...c.evidence.map((r) => el('li', { class: r.tone }, c3ic(r.icon, 'sm'), el('span', null, r.text), r.tag ? el('span', { class: 'tag' }, r.tag) : null))));
|
|
178
|
-
}
|
|
179
|
-
if (optsHost) { drawOptions(); drawSlide(); root.append(optsHost, slideHost); }
|
|
180
|
-
/* a go with an https href is a link to the record outside PMOS (a Jira ticket, the brief's source): it opens in a new tab, changes nothing,
|
|
181
|
-
* and takes the place of the in-page go button */
|
|
182
|
-
const href = c.go && typeof c.go.href === 'string' && /^https:\/\//.test(c.go.href) ? c.go.href : null;
|
|
183
|
-
const goLink = href ? el('a', { class: 'chip2 lk', href, target: '_blank', rel: 'noopener noreferrer', 'data-case-link': '' }, c3ic('out', 'sm'), c.go.label) : null;
|
|
184
|
-
if (goLink) c.go = null;
|
|
185
|
-
const goBtn = c.go ? el('button', { type: 'button', class: 'chip2 lk', onclick: () => { if (opts.onGo) opts.onGo(c.go); } }, c3ic('next', 'sm'), c.go.label) : null;
|
|
186
|
-
if (c.unsure || c.ifYouWait || c.why || goBtn || goLink) {
|
|
187
|
-
root.append(el('div', { class: 'cft' },
|
|
188
|
-
c.unsure ? el('span', null, c3ic('info', 'sm'), 'Unsure: ' + c.unsure) : null,
|
|
189
|
-
c.ifYouWait ? el('span', null, c3ic('alert', 'sm'), 'If you wait: ' + c.ifYouWait) : null,
|
|
190
|
-
c.why ? el('span', null, c3ic('eye', 'sm'), 'Why shown: ' + c.why) : null,
|
|
191
|
-
goLink || goBtn));
|
|
192
|
-
}
|
|
193
|
-
/* a handle for the caller: read or set the pick, and tear the slide down when the case leaves the page */
|
|
194
|
-
root.c3case = { get picked() { return picked; }, pick, model: c, dispose() { if (slideHost) disposeSlide(slideHost); if (disposeHold) { disposeHold(); disposeHold = null; } } };
|
|
195
|
-
return root;
|
|
196
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* pm/c3-core-docs.css — the core documents of a level (c3-core-docs.js): the agent colour for a draft, the actions under a row, the
|
|
2
|
-
* panel above a draft in the document sheet. Scoped to .cd-host and .cd-panel; tokens only. */
|
|
3
|
-
.c3 .cd-host { display: contents; }
|
|
4
|
-
.c3 .cd-host .nrow > .acts { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; align-items: flex-start; }
|
|
5
|
-
.c3 .cd-host .st.cd-ag, .c3 .cd-panel .st.cd-ag { color: var(--agent); border-color: color-mix(in oklab, var(--agent) 45%, transparent); background: color-mix(in oklab, var(--agent) 8%, transparent); }
|
|
6
|
-
.c3 .cd-host .chip2.cd-agc { color: var(--agent); }
|
|
7
|
-
.c3 .cd-panel { display: grid; gap: var(--sp-2); min-width: 0; }
|
|
8
|
-
.c3 .cd-panel .fold { border-color: color-mix(in oklab, var(--agent) 45%, transparent); }
|
|
9
|
-
.c3 .cd-oh { margin-top: var(--sp-3); }
|
|
10
|
-
/* The quiet pages (c3-quiet.css) hide teaching sentences and every chip after the second. The approved mockup of the Docs views keeps both:
|
|
11
|
-
* a row says what the document is for, who reads it, how often it changes and who writes it. */
|
|
12
|
-
.c3 .cd-host .ini-note, .c3 .cd-panel .ini-note { display: block !important; }
|
|
13
|
-
.c3 .cd-host .nrow .nb > .chips > :nth-child(n+3) { display: inline-flex !important; }
|
|
14
|
-
.c3 [data-ini="pf-docs"] .ini-lhm .dim { display: block !important; }
|
|
15
|
-
.c3 .cd-host .sect .sh2 .ini-meta { display: inline !important; }
|
|
16
|
-
/* the heading above the board's other documents: the look of a section heading, without a card around the search and the groups */
|
|
17
|
-
.c3 .cd-host .cd-oh { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: var(--sp-3) 0 var(--sp-2); border-bottom: 1px solid var(--border); }
|
|
18
|
-
.c3 .cd-host .cd-oh h2 { margin: 0; font: 500 var(--fs-2) var(--mono); color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 8px; align-items: center; }
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
/* pm/c3-core-docs.js — the core documents of a level (initiative core-documents, PRD section 6; the approved mockup 43-doc-levels.js).
|
|
2
|
-
* Each level answers one question for one reader: Portfolio, Board, Initiative. Its Docs view starts with the level's core set, from
|
|
3
|
-
* GET /api/core-docs?ws&level=portfolio|board|initiative&board&id { ok, level, scope, question, reader, rhythm, build, wfTpl, stage, cat,
|
|
4
|
-
* summary, docs: [entry + state] }
|
|
5
|
-
* POST /api/core-docs/draft { ws, scope, key } { ok, run } Draft it, and Redraft ("Ask PMOS to change it")
|
|
6
|
-
* POST /api/core-docs/issue { ws, scope, key, slot } { ok } Issue it
|
|
7
|
-
* The server holds the sets, the states and the drafts; this file draws them and holds nothing.
|
|
8
|
-
*
|
|
9
|
-
* coreDocs(env) -> { left, right, dispose } two hosts to put in the columns of cols(): the sections and the cards. env =
|
|
10
|
-
* { api, level, board?, id?, ws, today, toast, nav: { tab(tab), tool(tool), reports(), scan()? }, boardRow?, iniDocs?: { docs, initiatives } }
|
|
11
|
-
* needsLoc(row) -> the `init=` address of the Docs view a Briefing row (kind core-doc-drafts) opens
|
|
12
|
-
* segBadge(n) the count badge of the Portfolio's Documents segment
|
|
13
|
-
* A press on a row opens `open`: { path } the document sheet, { tab } the board tab, { tool } the initiative's Overview tool, { reports } Reports. A row not started carries `act`: { do: 'draft' } (Draft it, Propose them) or { go: 'scan' | 'reports' } (Run a scan, Set it up).
|
|
14
|
-
* Review the draft opens the draft in the document sheet. The sheet holds the actions: a panel above the draft (docAbove, the sheet's own hook)
|
|
15
|
-
* with Issue it and Ask PMOS to change it, which asks for a new draft. Nothing is sent to anyone; the PM's press issues it. */
|
|
16
|
-
import { el } from './dom.js';
|
|
17
|
-
import { icon, pbtn, lk, chip, tag, st, note, sect, card, list, nrow, plural, day, ago, sw, chgl, mono, put, ensureIniCss } from './c3-ini-ui.js';
|
|
18
|
-
|
|
19
|
-
const BY = { you: 'You write it', proposes: 'PMOS proposes', drafts: 'PMOS drafts it', files: 'PMOS files it', watches: 'PMOS watches it', keeps: 'PMOS keeps it current', live: 'Live view', reviews: 'PMOS reviews, you accept' };
|
|
20
|
-
const AGENT_BY = ['drafts', 'proposes', 'files', 'watches', 'keeps', 'reviews'];
|
|
21
|
-
const CAT_IC = { Discover: 'search', Plan: 'cal', Do: 'bolt', Learn: 'up' };
|
|
22
|
-
const CAT_ORDER = ['Discover', 'Plan', 'Do', 'Learn'];
|
|
23
|
-
const POLL_MS = 4000;
|
|
24
|
-
const PENDING_MS = 1500;
|
|
25
|
-
|
|
26
|
-
function ensureCss() {
|
|
27
|
-
if (typeof document === 'undefined' || document.querySelector('link[data-c3-cd]')) return;
|
|
28
|
-
ensureIniCss();
|
|
29
|
-
const l = document.createElement('link');
|
|
30
|
-
l.rel = 'stylesheet'; l.href = new URL('./c3-core-docs.css', import.meta.url).href; l.setAttribute('data-c3-cd', '');
|
|
31
|
-
document.head.appendChild(l);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** The count badge of the Portfolio's Documents segment (hidden at 0). */
|
|
35
|
-
export function segBadge(n) { return el('span', { class: 'bdg', 'data-cd': 'seg-badge', ...(n ? {} : { hidden: '' }) }, String(n || 0)); }
|
|
36
|
-
|
|
37
|
-
/** The address of the Docs view a Briefing row opens, as the `init=` value (c3-initiatives.js parseLoc). Null when the row names no scope. */
|
|
38
|
-
export function needsLoc(row) {
|
|
39
|
-
const r = row || {};
|
|
40
|
-
const raw = String(r.scope || (/(?:^|:)(portfolio|board:[^:|]+|ini(?:tiative)?:[^:|]+)$/.exec(String(r.run_id || '')) || [])[1] || '');
|
|
41
|
-
if (raw == 'portfolio') return 'docs';
|
|
42
|
-
let m = /^board:(.+)$/.exec(raw);
|
|
43
|
-
if (m) return 'board:' + encodeURIComponent(m[1]) + ':docs';
|
|
44
|
-
m = /^ini(?:tiative)?:(.+)$/.exec(raw);
|
|
45
|
-
const id = m ? m[1] : r.initiative_id;
|
|
46
|
-
if (id) return 'ini:' + encodeURIComponent(r.board || r.ws || '') + ':' + encodeURIComponent(id) + ':docs';
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* ── the sheet's draft panel ── */
|
|
51
|
-
const DRAFTS = new Map(); // path -> { ws, api, scope, key, slot, toast, ui, done }
|
|
52
|
-
const NODES = new WeakMap();
|
|
53
|
-
let hooked = null;
|
|
54
|
-
function hookSheet() {
|
|
55
|
-
if (!hooked) hooked = import('./c3-doc-sheet.js').then((m) => { m.docAbove.push(({ doc, key }) => { const e = DRAFTS.get(doc.path); if (!e) return null; if (!NODES.has(key)) NODES.set(key, draftPanel(e)); return NODES.get(key); }); return m; });
|
|
56
|
-
return hooked;
|
|
57
|
-
}
|
|
58
|
-
function draftPanel(e) {
|
|
59
|
-
const msg = el('div', { class: 'fold w', role: 'alert', hidden: '', 'data-cd': 'panel-error' });
|
|
60
|
-
const fail = (t) => { msg.textContent = t; msg.hidden = false; };
|
|
61
|
-
let busy = false;
|
|
62
|
-
const act = (path, body, done) => async () => {
|
|
63
|
-
if (busy) return; busy = true; msg.hidden = true;
|
|
64
|
-
const r = await e.api.post(path, { scope: e.scope, key: e.key, ...body }).catch(() => null);
|
|
65
|
-
busy = false;
|
|
66
|
-
if (!r || !r.ok) { fail((r && r.error) || 'no answer'); return; }
|
|
67
|
-
done(); if (e.ui && e.ui.close) e.ui.close();
|
|
68
|
-
if (e.done) e.done();
|
|
69
|
-
};
|
|
70
|
-
const issue = act('/api/core-docs/issue', { slot: e.slot }, () => { DRAFTS.delete(e.path); e.toast('Issued. Nothing was sent to anyone.'); });
|
|
71
|
-
const redraft = act('/api/core-docs/draft', {}, () => { e.toast('PMOS is drafting it again. The new draft replaces this one when it is ready.'); });
|
|
72
|
-
return el('div', { class: 'cd-panel', 'data-cd': 'draft-panel' },
|
|
73
|
-
el('div', { class: 'fold' }, icon('spark', 'sm'), el('span', null, ' PMOS drafted this from its sources. Nothing is sent. Read it, change what you like, then issue it.')),
|
|
74
|
-
el('div', { class: 'chips2' }, pbtn('primary', 'Issue it', 'check', { 'data-cd-issue': e.key, onclick: issue }), pbtn('outline', 'Ask PMOS to change it', 'spark', { 'data-cd-redraft': e.key, onclick: redraft })),
|
|
75
|
-
msg);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/* ── rows ── */
|
|
79
|
-
const summaryLine = (docs) => {
|
|
80
|
-
const n = (s) => docs.filter((d) => d.st === s).length;
|
|
81
|
-
return [n('draft') ? plural(n('draft'), 'draft') + ' to review' : '', n('due') ? n('due') + ' due' : '', n('missing') ? n('missing') + ' not started' : ''].filter(Boolean).join(', ') || 'Everything is up to date';
|
|
82
|
-
};
|
|
83
|
-
const isAgent = (d) => d.running || d.st === 'draft';
|
|
84
|
-
|
|
85
|
-
function stChip(d) {
|
|
86
|
-
if (d.running) return el('span', { class: 'st cd-ag', 'data-cd-state': 'running' }, icon('spark', 'sm'), 'Agent drafting');
|
|
87
|
-
const a = { 'data-cd-state': d.st };
|
|
88
|
-
switch (d.st) {
|
|
89
|
-
case 'ok': return st('ok', 'check', 'Up to date', a);
|
|
90
|
-
case 'due': return st('warn', 'clock', d.due ? 'Due ' + day(d.due) : 'Due now', a);
|
|
91
|
-
case 'draft': return el('span', { class: 'st cd-ag', ...a }, icon('spark', 'sm'), 'Draft ready' + (d.due ? ', due ' + day(d.due) : ''));
|
|
92
|
-
case 'missing': return st('bad', 'alert', 'Not started', a);
|
|
93
|
-
case 'stale': return st('warn', 'clock', 'Out of date', a);
|
|
94
|
-
case 'none': return el('span', { class: 'chip2 dim', ...a }, 'None yet');
|
|
95
|
-
default: return el('span', { class: 'chip2 dim', ...a }, 'Comes later');
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
const byChip = (k) => (AGENT_BY.includes(k) ? el('span', { class: 'chip2 cd-agc' }, icon('spark', 'sm'), BY[k]) : chip(icon(k === 'live' ? 'eye' : 'user', 'sm'), BY[k] || k));
|
|
99
|
-
|
|
100
|
-
function pathNameOf(env, d) { return d.title + (env.scopeLabel ? ' · ' + env.scopeLabel : ''); }
|
|
101
|
-
|
|
102
|
-
async function openSheetFor(env, d, path, draft) {
|
|
103
|
-
try {
|
|
104
|
-
const m = await hookSheet();
|
|
105
|
-
const ui = m.openDocSheet({ ws: env.ws, doc: { path, name: pathNameOf(env, d), ty: draft ? 'Draft' : 'Document', v: '', st: draft ? 'draft' : d.st, ini: env.level === 'initiative' ? env.id : '', iniName: '' },
|
|
106
|
-
library: () => env.api.get('/api/docs/library', env.board ? { board: env.board } : {}) });
|
|
107
|
-
if (draft) { const e = DRAFTS.get(path); if (e) e.ui = ui; }
|
|
108
|
-
return ui;
|
|
109
|
-
} catch { env.toast('The document sheet could not open. The file is ' + path + '.'); return null; }
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function press(env, d, redraw) {
|
|
113
|
-
const o = d.open || null;
|
|
114
|
-
if (!o) return null;
|
|
115
|
-
if (o.path) return () => openSheetFor(env, d, o.path, false);
|
|
116
|
-
if (o.tab) return () => env.nav.tab(o.tab);
|
|
117
|
-
if (o.tool) return () => env.nav.tool(o.tool);
|
|
118
|
-
if (o.reports) return () => env.nav.reports();
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function review(env, d, redraw) {
|
|
123
|
-
const p = d.draft && d.draft.path;
|
|
124
|
-
if (!p) return () => env.toast('The draft has no file yet. Try again in a moment.');
|
|
125
|
-
return () => {
|
|
126
|
-
DRAFTS.set(p, { path: p, ws: env.ws, api: env.api, scope: env.scope, key: d.key, slot: d.draft.slot, toast: env.toast, ui: null, done: redraw });
|
|
127
|
-
openSheetFor(env, d, p, true);
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
async function draftIt(env, d, redraw) {
|
|
132
|
-
const r = await env.api.post('/api/core-docs/draft', { scope: env.scope, key: d.key }).catch(() => null);
|
|
133
|
-
if (!r || !r.ok) { env.toast('The draft did not start: ' + ((r && r.error) || 'no answer') + '.'); return; }
|
|
134
|
-
env.toast('PMOS is drafting the ' + d.title.toLowerCase() + '. It lands here as a draft for you to review.');
|
|
135
|
-
redraw();
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function coreRow(env, d, redraw) {
|
|
139
|
-
const open = press(env, d, redraw);
|
|
140
|
-
const meta = [d.when && !['later', 'missing'].includes(d.st) ? chip(icon('clock', 'sm'), (d.st === 'draft' ? 'drafted ' : 'updated ') + ago(d.when, env.today)) : null,
|
|
141
|
-
d.flag ? st('warn', 'alert', d.flag) : null, d.staleWhy && d.st === 'stale' ? chip(d.staleWhy) : null];
|
|
142
|
-
let action = null;
|
|
143
|
-
if (!d.running && d.st === 'draft') action = pbtn('primary', 'Review the draft', 'spark', { 'data-cd-review': d.key, onclick: review(env, d, redraw) });
|
|
144
|
-
else if (!d.running && d.act && d.act.do === 'draft') action = pbtn('outline', d.act.label, 'spark', { 'data-cd-draft': d.key, onclick: () => draftIt(env, d, redraw) });
|
|
145
|
-
else if (!d.running && d.act && d.act.go && env.nav[d.act.go]) action = pbtn('outline', d.act.label, d.act.go === 'scan' ? 'search' : 'report', { 'data-cd-go': d.key, onclick: () => env.nav[d.act.go]() });
|
|
146
|
-
return nrow({ ic: d.ic || 'doc', hot: isAgent(d) || d.st === 'missing', title: [d.title, d.isNew ? [' ', tag('new')] : null], onOpen: open || undefined, openLabel: open ? 'Open ' + d.title : undefined,
|
|
147
|
-
titleAttrs: { 'data-cd-open': d.key }, sub: d['for'] || '',
|
|
148
|
-
chips: [stChip(d), d.cadence ? chip(icon('cal', 'sm'), d.cadence) : null, d.reader ? chip(icon('user', 'sm'), d.reader) : null, byChip(d.by), ...meta],
|
|
149
|
-
right: [action], attrs: { 'data-cd-row': d.key, 'data-cd-st': d.running ? 'running' : d.st } });
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/* ── the sections ── */
|
|
153
|
-
function coreSection(env, data, redraw) {
|
|
154
|
-
return sect({ ic: 'doc', title: 'Core documents', count: data.docs.length, attrs: { 'data-cd': 'core' }, right: mono(summaryLine(data.docs)) },
|
|
155
|
-
list(data.docs.map((d) => coreRow(env, d, redraw)), { 'data-cd': 'core-list' }));
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function iniSections(env, data, redraw) {
|
|
159
|
-
const cur = data.cat || 'Plan';
|
|
160
|
-
return CAT_ORDER.map((c) => {
|
|
161
|
-
const ds = data.docs.filter((d) => d.cat === c);
|
|
162
|
-
if (!ds.length) return null;
|
|
163
|
-
const ic = CAT_IC[c];
|
|
164
|
-
const a = (extra) => ({ 'data-cd-cat': c, ...extra });
|
|
165
|
-
if (ds.every((d) => d.st === 'later')) return sect({ ic, title: c, count: ds.length, attrs: a({ 'data-cd-fold': 'later' }), right: chip('Comes later') },
|
|
166
|
-
el('div', { class: 'chips2' }, ...ds.map((d) => el('span', { class: 'chip2 dim' }, icon(d.ic || 'doc', 'sm'), d.title))));
|
|
167
|
-
if (c !== cur && ds.every((d) => d.st === 'ok' && !d.running)) return sect({ ic, title: c, count: ds.length, attrs: a({ 'data-cd-fold': 'done' }), right: st('ok', 'check', 'All ' + ds.length + ' up to date') },
|
|
168
|
-
el('div', { class: 'chips2' }, ...ds.map((d) => { const o = press(env, d, redraw); return o ? lk({ onclick: o, 'data-cd-chip': d.key }, icon(d.ic || 'doc', 'sm'), d.title) : el('span', { class: 'chip2' }, icon(d.ic || 'doc', 'sm'), d.title); })));
|
|
169
|
-
return sect({ ic, title: c + (c === cur ? ' · now' : ''), count: ds.length, attrs: a({ 'data-cd-fold': 'open' }), right: chip(sw(c), ds.filter((d) => d.st === 'ok').length + ' of ' + ds.length + ' done') },
|
|
170
|
-
list(ds.map((d) => coreRow(env, d, redraw))));
|
|
171
|
-
}).filter(Boolean);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/* ── the cards of the right column ── */
|
|
175
|
-
const levelCard = (data, extra) => card({ ic: 'info', title: 'What this level is for', attrs: { 'data-cd': 'level' } },
|
|
176
|
-
el('p', { class: 'ini-p' }, el('b', null, data.question || '')),
|
|
177
|
-
note('Read by ' + (data.reader || 'the team') + '. Changes ' + (data.rhythm || 'as it changes') + '.' + (data.level == 'portfolio' ? ' Boards and initiatives link up to it through their key result, so nothing here repeats what a board says.' : '')),
|
|
178
|
-
...extra);
|
|
179
|
-
|
|
180
|
-
function draftsCard(env, data, redraw) {
|
|
181
|
-
const ds = data.docs.filter((d) => d.st === 'draft' && !d.running);
|
|
182
|
-
return card({ ic: 'spark', title: 'Drafts waiting for you', attrs: { 'data-cd': 'drafts' } },
|
|
183
|
-
ds.length ? chgl(ds.map((d) => el('li', null, icon('spark', 'sm'), el('span', null, lk({ onclick: review(env, d, redraw), 'data-cd-wait': d.key }, d.title), d.due ? ' due ' + day(d.due) : ''), tag('Briefing'))))
|
|
184
|
-
: note('No draft is waiting.'),
|
|
185
|
-
note('Drafts also show as one Briefing card. Nothing is sent until you issue it.'));
|
|
186
|
-
}
|
|
187
|
-
const connectCard = () => card({ ic: 'init', title: 'How the levels connect', attrs: { 'data-cd': 'connect' } }, chgl([
|
|
188
|
-
el('li', null, icon('alert', 'sm'), el('span', null, 'Risks are written once, on the initiative. Board risks and cross-board risks collect them.')),
|
|
189
|
-
el('li', null, icon('up', 'sm'), el('span', null, 'Each initiative\'s outcome review feeds the board retro and the quarterly review.')),
|
|
190
|
-
el('li', null, icon('report', 'sm'), el('span', null, 'Status reports at every level come from the same dashboard, so they agree.'))]));
|
|
191
|
-
|
|
192
|
-
function rightCards(env, data, redraw) {
|
|
193
|
-
if (data.level == 'portfolio') return [levelCard(data, []), draftsCard(env, data, redraw), connectCard()];
|
|
194
|
-
if (data.level === 'board') {
|
|
195
|
-
const b = env.boardRow || {};
|
|
196
|
-
const ini = env.iniDocs;
|
|
197
|
-
return [levelCard(data, [note(data.build ? 'Build and deliver is on, so the set adds the sprint review and release notes' + (b.jira ? ' from Jira ' + b.jira : '') + '.' : 'Build and deliver is off, so there is no sprint review or release notes. Progress comes from PMOS tasks.')]),
|
|
198
|
-
card({ ic: 'doc', title: 'Initiative documents', attrs: { 'data-cd': 'ini-docs' } },
|
|
199
|
-
note('Each initiative keeps its own PRD, rubric, risks and outcome review on its Docs tab.' + (ini ? ' ' + plural(ini.docs, 'document') + ' across ' + plural(ini.initiatives, 'initiative') + '.' : '')))];
|
|
200
|
-
}
|
|
201
|
-
return [levelCard(data, [note('The set grows with the workflow: each stage adds the documents it needs, and later stages wait.'), data.wfTpl === 'research' ? note('Research only: nothing gets built, so there is no PRD, rubric, design or launch checklist.') : null]),
|
|
202
|
-
card({ ic: 'alert', title: 'Order rules', attrs: { 'data-cd': 'order' } }, note('A missing PRD or rubric before Build shows as a warning on the initiative, never a block. The CI gate still needs a PRD and a rubric before a pull request merges.'))];
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/** The two hosts of a level's core documents. Reads the set, draws it, and reads it again after a press and while an agent drafts. */
|
|
206
|
-
export function coreDocs(env) {
|
|
207
|
-
ensureCss();
|
|
208
|
-
const left = el('div', { class: 'cd-host', 'data-cd-host': 'left' }, note('Reading the core documents'));
|
|
209
|
-
const right = el('div', { class: 'cd-host', 'data-cd-host': 'right' });
|
|
210
|
-
let dead = false; let timer = null; let seq = 0; let last = null;
|
|
211
|
-
const get = () => env.api.get('/api/core-docs', { level: env.level, board: env.level == 'portfolio' ? '' : env.board, id: env.level === 'initiative' ? env.id : '' });
|
|
212
|
-
async function load() {
|
|
213
|
-
const token = ++seq;
|
|
214
|
-
const r = await get().catch(() => null);
|
|
215
|
-
if (dead || token !== seq) return;
|
|
216
|
-
clearTimeout(timer);
|
|
217
|
-
if (r && r.pending) { // the initiative rows are still loading: say so and ask again
|
|
218
|
-
put(left, note('Reading the core documents')); put(right);
|
|
219
|
-
timer = setTimeout(() => { if (!dead && left.isConnected) load(); }, PENDING_MS); return;
|
|
220
|
-
}
|
|
221
|
-
if (!r || !r.ok || !Array.isArray(r.docs)) {
|
|
222
|
-
put(left, el('div', { class: 'fold w', role: 'alert', 'data-cd': 'error' }, icon('alert', 'sm'), 'The core documents could not be read: ' + ((r && r.error) || 'no answer') + '.'));
|
|
223
|
-
put(right); return;
|
|
224
|
-
}
|
|
225
|
-
const redraw = () => { load(); };
|
|
226
|
-
last = { r, redraw };
|
|
227
|
-
put(left, ...(env.level === 'initiative' ? iniSections({ ...env, scope: r.scope }, r, redraw) : [coreSection({ ...env, scope: r.scope }, r, redraw)]));
|
|
228
|
-
put(right, ...rightCards({ ...env, scope: r.scope }, r, redraw));
|
|
229
|
-
if (env.onData) env.onData(r);
|
|
230
|
-
if (r.docs.some((d) => d.running)) timer = setTimeout(() => { if (!dead && left.isConnected) load(); }, POLL_MS);
|
|
231
|
-
}
|
|
232
|
-
load();
|
|
233
|
-
return { left, right, dispose() { dead = true; clearTimeout(timer); }, reload: load,
|
|
234
|
-
/** The counts of the board's other documents, for the Initiative documents card. */
|
|
235
|
-
setIniDocs(v) { env.iniDocs = v; if (last) put(right, ...rightCards({ ...env, scope: last.r.scope }, last.r, last.redraw)); } };
|
|
236
|
-
}
|