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,68 +0,0 @@
|
|
|
1
|
-
/* pm/premium-metric-tiles.js — the tiles of the Board's four measures (initiative briefing-premium-metrics), drawn the same way on the Board's Metrics
|
|
2
|
-
* card and on the Insights page's Board measures card. It draws lib/board-metrics-premium.js's tiles: a number and a chart only where a record counted
|
|
3
|
-
* one, "Not read" where it could not be, and a target's chip, dashed line and outline only where the PM set one on Insights. Nothing here writes.
|
|
4
|
-
*
|
|
5
|
-
* tileHtml(t, i) → one tile's HTML
|
|
6
|
-
* chartAt(el, t, j) → read week j of a chart tile (null: the latest week)
|
|
7
|
-
* wireTiles(body, tiles, open) → pointer and arrow-key reading, Enter and press to open(i) */
|
|
8
|
-
import { $, esc } from './premium-shell.js';
|
|
9
|
-
|
|
10
|
-
const GEO = { W: 220, H: 60, P: 5 };
|
|
11
|
-
export function geo(m) {
|
|
12
|
-
const n = m.ser.length, { W, H, P } = GEO, vs = m.ser.filter((v) => v != null).concat(m.tg != null ? [m.tg] : []);
|
|
13
|
-
const lo = Math.min(...vs), hi = Math.max(...vs), sp = hi - lo || 1;
|
|
14
|
-
return { n, W, H, P, X: (j) => (n > 1 ? P + j * (W - 2 * P) / (n - 1) : W / 2), Y: (v) => P + (1 - (v - lo) / sp) * (H - 2 * P) };
|
|
15
|
-
}
|
|
16
|
-
export const fmt = (m, v) => (+v).toFixed(m.dec) + (m.suf || '');
|
|
17
|
-
const lastJ = (t) => t.ser.reduce((a, v, j) => (v != null ? j : a), 0);
|
|
18
|
-
|
|
19
|
-
export function tileHtml(t, i) {
|
|
20
|
-
if (t.absent) return `<div class="mt1 abs" data-m="${i}" data-op="m:${i}" tabindex="0" role="button" aria-label="${esc(t.label)}: ${esc(t.absent)}. ${esc(t.why)}"><span>${esc(t.label)}</span><b class="mval">${esc(t.absent)}</b><em class="mwk">${esc(t.why)}</em></div>`;
|
|
21
|
-
const chip = t.tg != null ? `<i class="mchip ${t.ok ? 'ok' : 'warn'}">${esc(t.chip)}</i>` : t.look ? '<i class="mchip warn">Needs a look</i>' : '';
|
|
22
|
-
const lab = chip ? `<span class="mlab">${esc(t.label)}${chip}</span>` : `<span>${esc(t.label)}</span>`, off = t.look ? ' off' : '';
|
|
23
|
-
const tgt = t.tg != null ? `<em class="mtg">${esc(t.targetTxt)}</em>` : '';
|
|
24
|
-
const chg = t.change ? `<span class="mchg ${t.change.d === 0 ? '' : t.change.good ? 'good' : 'bad'}">${t.change.d === 0 ? '' : t.change.d > 0 ? '▲ ' : '▼ '}${esc(t.change.txt)}</span>` : '';
|
|
25
|
-
const say = (t.look ? ', needs a look' : '') + (t.tg != null ? ', ' + t.targetTxt + ', ' + t.chip : '');
|
|
26
|
-
if (!t.ser) return `<div class="mt1 ${t.kind}${off}" data-m="${i}" data-op="m:${i}" tabindex="0" role="button" aria-label="${esc(t.label)}, ${esc(t.value)}, ${esc(t.text)}${esc(say)}">${lab}<b class="mval">${esc(t.value)}</b><em class="mwk">${esc(t.text)}</em>${tgt}</div>`;
|
|
27
|
-
const g = geo(t); let ln = '', op = false;
|
|
28
|
-
t.ser.forEach((v, j) => { if (v == null) { op = false; return; } ln += (op ? 'L' : 'M') + g.X(j).toFixed(1) + ',' + g.Y(v).toFixed(1); op = true; });
|
|
29
|
-
const f = Math.max(0, t.ser.findIndex((v) => v != null)), gap = t.ser.slice(f).some((v) => v == null), n1 = g.n - 1, lj = lastJ(t);
|
|
30
|
-
const tgl = t.tg != null ? `<line class="tg" x1="${g.P}" x2="${g.W - g.P}" y1="${g.Y(t.tg).toFixed(1)}" y2="${g.Y(t.tg).toFixed(1)}"/>` : '';
|
|
31
|
-
return `<div class="mt1 mch ${t.kind}${off}" data-m="${i}" data-op="m:${i}" tabindex="0" role="button" aria-label="${esc(t.label)} over ${t.ser.length} weeks, now ${esc(t.value)}${esc(say)}. Use the arrow keys to read each week.">${lab}<b class="mval">${esc(t.value)}</b><em class="mwk">${esc(t.text)}</em>${tgt}${chg}`
|
|
32
|
-
+ `<svg viewBox="0 0 ${g.W} ${g.H}">${f > 0 ? `<line class="gp" x1="${g.X(0)}" x2="${g.X(f)}" y1="${g.H - g.P}" y2="${g.H - g.P}"/>` : ''}${gap || f === n1 ? '' : `<path class="ar" d="${ln}L${g.X(n1)},${g.H}L${g.X(f)},${g.H}Z"/>`}${tgl}<path class="ln2" d="${ln}"/><line class="cx" x1="0" x2="0" y1="0" y2="${g.H}"/><circle class="dt" cx="${g.X(lj)}" cy="${g.Y(t.ser[lj])}" r="3.5"/></svg>`
|
|
33
|
-
+ `<span class="mfoot"><i>${esc(t.wk[0])}</i>${t.tg != null ? '<i class="tgl">dashed line is the target</i>' : ''}<i>${esc(t.wk[t.wk.length - 1])}</i></span></div>`;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** Read one week of a chart tile: the guide line and dot move, the value and caption change. */
|
|
37
|
-
export function chartAt(el, t, j) {
|
|
38
|
-
if (!t || !t.ser) return;
|
|
39
|
-
const g = geo(t), lj = lastJ(t); j = j == null ? lj : Math.max(0, Math.min(g.n - 1, j));
|
|
40
|
-
const v = t.ser[j], has = v != null, x = g.X(j), y = has ? g.Y(v) : 0, now = j === lj;
|
|
41
|
-
const cx = $('.cx', el), dt = $('.dt', el);
|
|
42
|
-
cx.setAttribute('x1', x); cx.setAttribute('x2', x); dt.setAttribute('cx', x); dt.setAttribute('cy', y); dt.style.opacity = has ? '' : '0';
|
|
43
|
-
el.classList.toggle('hv', !now); el.dataset.j = j;
|
|
44
|
-
const none = t.since ? 'Not kept yet' : 'No runs';
|
|
45
|
-
const val = now ? t.value : has ? fmt(t, v) : none, cap = now ? t.text : 'Week to ' + t.wk[j] + (t.nt[j] ? ' · ' + t.nt[j] : '') + (has && t.tg != null ? ' · ' + t.targetTxt : '');
|
|
46
|
-
$('.mval', el).textContent = val; $('.mwk', el).textContent = cap;
|
|
47
|
-
el.setAttribute('aria-label', t.label + ', ' + (now ? 'now ' : '') + val + ', ' + cap + '. Use the arrow keys to read each week.');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** Pointer and arrow-key reading of the chart tiles in `body`, and Enter, Space or a press to open(i). tiles() gives the tiles drawn now. */
|
|
51
|
-
export function wireTiles(body, tiles, open) {
|
|
52
|
-
const at = (e) => e.target.closest('[data-m]');
|
|
53
|
-
body.addEventListener('click', (e) => { const t = at(e); if (t) open(+t.dataset.m); });
|
|
54
|
-
body.addEventListener('keydown', (e) => {
|
|
55
|
-
const t = at(e); if (!t) return;
|
|
56
|
-
if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); open(+t.dataset.m); return; }
|
|
57
|
-
if (!t.classList.contains('mch') || !/^Arrow(Left|Right)$/.test(e.key)) return;
|
|
58
|
-
e.preventDefault(); const m = tiles()[+t.dataset.m], now = t.dataset.j == null ? lastJ(m) : +t.dataset.j; chartAt(t, m, now + (e.key === 'ArrowLeft' ? -1 : 1));
|
|
59
|
-
});
|
|
60
|
-
body.addEventListener('pointermove', (e) => { const t = at(e); if (!t || !t.classList.contains('mch')) return; const s = $('svg', t).getBoundingClientRect(), m = tiles()[+t.dataset.m], g = geo(m); chartAt(t, m, Math.round(((e.clientX - s.left) / s.width * g.W - g.P) / (g.W - 2 * g.P) * (g.n - 1))); });
|
|
61
|
-
body.addEventListener('pointerout', (e) => { const t = at(e); if (t && t.classList.contains('mch') && !t.contains(e.relatedTarget)) chartAt(t, tiles()[+t.dataset.m], null); });
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** The rows of a measure's dialog: what it is now, its target and gap where one is set, how it changed, and where it was counted. */
|
|
65
|
-
export function factRows(t, repo, weeks) {
|
|
66
|
-
return t.absent ? [['Now', t.absent], ['Why', t.why], ['Counted from', repo]]
|
|
67
|
-
: [['Now', t.value], ['Counted', t.text], ['Target', t.tg != null ? fmt(t, t.tg) : 'None set. Set one on Insights'], ['Gap', t.tg != null ? (t.ok ? 'On target' : t.chip + ' the target') : ''], ['Change', t.change ? t.change.txt : ''], ['Better when', t.lowBetter ? 'Lower' : t.lowBetter === false ? 'Higher' : ''], ['Period', 'Week · last ' + (weeks || 8) + ' weeks'], ['Source', repo]].filter((r) => r[1] !== '');
|
|
68
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/* pm/premium-report-brief.js — the Brief of a report: how it is made, in its own viewer tab beside the report (initiative premium-reports-from-chat;
|
|
2
|
-
* PM 2026-10-22: "the Report Design Brief alongside the design, so I know what the report is, how it is structured, how the data is gathered, how
|
|
3
|
-
* it is calculated … not part of the report … so I can validate and make corrections", then "Report brief can be open on Viewer tab").
|
|
4
|
-
*
|
|
5
|
-
* openBrief(ctx) open (or show) the Brief tab of the open report
|
|
6
|
-
* refreshBrief(ctx) draw it again if it is open (after a correction)
|
|
7
|
-
* briefParts(x) the sections as [{ id, t, html }] and the open questions, from the stored records (pure; x = { structure, design, ctx })
|
|
8
|
-
* ctx = { ws, id, name, issued, setup, design, schedWords, format, correct(title), goBack(n) }
|
|
9
|
-
*
|
|
10
|
-
* READS: GET /api/report-structure (the structure plan, its sources, charts and outline, and their checks) and the design the reader holds
|
|
11
|
-
* (GET /api/report-design). Nothing new is stored: the Brief is what PMOS already keeps, said in words. Where a record is silent, the Brief says
|
|
12
|
-
* "not said" and lists it under Please confirm; it never fills a gap with a guess.
|
|
13
|
-
* WRITES: only on a press: Use it on a new structure version (POST /api/report-structure/accept). Correct puts `Correct "<section>": ` in the
|
|
14
|
-
* chat box; the reader sends it as a structure turn. Go back to it (an earlier look) is the reader's revert. */
|
|
15
|
-
import { esc, toast } from './premium-shell.js';
|
|
16
|
-
import { pmGet, pmPost } from './http.js';
|
|
17
|
-
import { vwOpen, vwState } from './premium-viewer.js';
|
|
18
|
-
|
|
19
|
-
const tabId = (ctx) => 'brief:' + ctx.id;
|
|
20
|
-
const day = (s) => { const d = new Date(String(s || '')); return isNaN(d) ? '' : d.toLocaleDateString('en-GB', { day: 'numeric', month: 'short' }); };
|
|
21
|
-
const NS = '<span class="tag as">not said</span>';
|
|
22
|
-
const say = (v) => v ? esc(v) : NS;
|
|
23
|
-
const STATE = { reached: ['reached', 'ok'], 'needs-you': ['needs you', 'no'], 'not-connected': ['not connected', 'no'], later: ['later', ''], off: ['off', ''] };
|
|
24
|
-
const KIND = { deck: 'Slide deck in PMOS', page: 'A page in PMOS', doc: 'A page in PMOS' };
|
|
25
|
-
|
|
26
|
-
/** The Brief's sections from the records. Each open question also counts toward "N to confirm". */
|
|
27
|
-
export function briefParts({ structure, design, ctx }) {
|
|
28
|
-
const S = structure || null, plan = S && S.plan, D = design || null, su = ctx.setup || null, open = [];
|
|
29
|
-
const sec = [];
|
|
30
|
-
const pu = (plan && plan.purpose) || {};
|
|
31
|
-
const ver = S && S.current != null ? 'S' + S.current + (S.saved === S.current ? '' : S.saved ? ' (S' + S.saved + ' is saved)' : ', not saved yet') : '';
|
|
32
|
-
if (!plan) open.push(su ? 'No structure is saved for this report yet. Say in the chat who reads it and what it answers.' : 'This report has no template, so PMOS keeps no structure or design for it. Say in a chat how often it is drafted, and PMOS sets one up.');
|
|
33
|
-
else {
|
|
34
|
-
if (!pu.readers) open.push('Who reads it?');
|
|
35
|
-
if (!pu.decision) open.push('What decision does it help make?');
|
|
36
|
-
if (!pu.scope) open.push('What is in it, and what is left out?');
|
|
37
|
-
if (!(pu.questions || []).length) open.push('Which questions should it answer?');
|
|
38
|
-
}
|
|
39
|
-
const made = !su ? 'By hand: a file with no template' : su.source === 'work' ? 'The schedule, from the saved structure' + (D && D.saved ? ' and design' : '') : su.source ? 'The schedule, from ' + su.source : 'The schedule';
|
|
40
|
-
sec.push({ id: 'glance', t: 'At a glance', html: `<dl class="rbkv"><dt>What it is</dt><dd>${say((su && su.purpose) || pu.decision)}</dd><dt>For</dt><dd>${say(pu.readers || (su && su.audience))}</dd><dt>Decision</dt><dd>${say(pu.decision)}</dd>`
|
|
41
|
-
+ `<dt>Schedule</dt><dd>${su ? esc(ctx.schedWords) : 'None: it has no template'}</dd><dt>Format</dt><dd>${esc(KIND[ctx.format] || KIND.deck)}</dd><dt>Made by</dt><dd>${esc(made)}</dd>${ver ? `<dt>Structure</dt><dd>${esc(ver)}</dd>` : ''}</dl>` });
|
|
42
|
-
if (!plan) return { sections: sec.concat(lookSections(D, ctx, open)).concat(openSection(open)), open };
|
|
43
|
-
sec.push({ id: 'questions', t: 'Questions it answers', html: (pu.questions || []).length ? '<ol>' + pu.questions.map((x) => `<li>${esc(x)}</li>`).join('') + '</ol>' : `<p>${NS}</p>` });
|
|
44
|
-
sec.push({ id: 'scope', t: 'In and out of scope', html: `<p>${say(pu.scope)}</p>${pu.cadence ? `<p><b>Covers:</b> ${esc(pu.cadence)}</p>` : ''}` });
|
|
45
|
-
const chartName = (id) => { const c = (plan.charts || []).find((x) => x.id === id); return c ? c.name : id; };
|
|
46
|
-
sec.push({ id: 'structure', t: 'How it is structured', html: '<ol>' + (plan.outline || []).map((o) => `<li><b>${esc(o.title)}</b>${o.notes ? ': ' + esc(o.notes) : ''}${(o.charts || []).length ? ' <span class="rbsub">Shows ' + esc(o.charts.map(chartName).join(', ')) + '.</span>' : ''}${o.fixed ? ' <span class="rbsub">In every report.</span>' : ''}</li>`).join('') + '</ol>' });
|
|
47
|
-
sec.push({ id: 'data', t: 'Where the data comes from', html: (plan.sources || []).length ? '<ul>' + plan.sources.map((s) => {
|
|
48
|
-
const st = STATE[s.state] || [s.state || '', ''];
|
|
49
|
-
if (!s.use) open.push('What is ' + s.name + ' used for?');
|
|
50
|
-
if (s.state === 'needs-you') open.push(s.name + ' could not be reached. Check its sign-in, or say what to use instead.');
|
|
51
|
-
if (s.state === 'not-connected') open.push(s.name + ' is not connected. Connect it, or say what to use instead.');
|
|
52
|
-
return `<li><b>${esc(s.name)}</b>${s.via ? ', through ' + esc(s.via) : ''}${s.ref ? ', <code>' + esc(s.ref) + '</code>' : ''}. ${s.use ? esc(s.use) : 'Use ' + NS}${st[0] ? ` <span class="tag ${st[1]}">${esc(st[0])}</span>` : ''}</li>`;
|
|
53
|
-
}).join('') + '</ul>' : `<p>No source is named. ${NS}</p>` });
|
|
54
|
-
const srcName = (id) => ((plan.sources || []).find((x) => x.id === id) || { name: id }).name;
|
|
55
|
-
sec.push({ id: 'calc', t: 'How each number is worked out', html: (plan.charts || []).length ? plan.charts.map((c) => {
|
|
56
|
-
if (!c.how) open.push('How is "' + c.name + '" worked out?');
|
|
57
|
-
return `<div class="rbcalc"><b>${esc(c.name)}</b>${c.question ? `<p>Answers: ${esc(c.question)}</p>` : ''}<p><b>From</b> ${esc(srcName(c.source))}${c.from ? ': ' + esc(c.from) : ''}</p><p><b>Worked out</b> ${say(c.how)}</p>${c.compare ? `<p><b>Compared with</b> ${esc(c.compare)}</p>` : ''}${c.flag ? `<p><b>Flagged when</b> ${esc(c.flag)}</p>` : ''}</div>`;
|
|
58
|
-
}).join('') : `<p>No number is worked out: the report is words only.</p>` });
|
|
59
|
-
const checks = Object.entries(S.checks || {}).map(([sid, c]) => `<li>${esc(srcName(sid))}: ${c.ok ? 'checked, it works <span class="tag ok">passed</span>' : esc(c.why || c.error || c.note || 'the last check did not pass') + ' <span class="tag no">needs you</span>'}${c.at ? ' (' + esc(day(c.at)) + ')' : ''}</li>`);
|
|
60
|
-
const errs = (S.errors || []).slice(-2).map((e) => `<li>The last structure run failed: ${esc(e.text)}</li>`);
|
|
61
|
-
sec.push({ id: 'checks', t: 'Checks and caveats', html: checks.length || errs.length ? '<ul>' + checks.concat(errs).join('') + '</ul>' : '<p>No source check has run. A source that PMOS reads itself needs none.</p>' });
|
|
62
|
-
if (S.current != null && S.saved !== S.current) open.push('The brief has a new version (S' + S.current + ') that is not saved. Press Use it at the top to keep it.');
|
|
63
|
-
return { sections: sec.concat(lookSections(D, ctx, open), historySection(S, D), openSection(open)), open };
|
|
64
|
-
}
|
|
65
|
-
function lookSections(D, ctx, open) {
|
|
66
|
-
if (!D) return ctx.issued ? [{ id: 'design', t: 'Why it looks like this', html: '<p>This cycle is issued, so its look is frozen as it was.</p>' }] : [];
|
|
67
|
-
const r = D.rules || { same: [], changes: [], learned: [] }, saved = D.saved ? D.saved.version : null;
|
|
68
|
-
if (!D.description && !(D.samples || []).length && !saved) open.push('How should it look? Say it in the chat, or attach a sample.');
|
|
69
|
-
const L = (h, xs) => (xs || []).length ? `<li><b>${h}</b> ${xs.map(esc).join('; ')}.</li>` : '';
|
|
70
|
-
const smp = (D.samples || []).map((s) => `<li>Follows <i>${esc(s.name)}</i>${s.took ? ': ' + esc(typeof s.took === 'string' ? s.took : s.took.took || '') : ''}.</li>`).join('');
|
|
71
|
-
const earlier = (D.versions || []).filter((v) => v.n !== saved).slice().reverse().slice(0, 5)
|
|
72
|
-
.map((v) => `<li>${esc(day(v.made_at))}: ${esc(v.turn || 'a version without a request')}${ctx.issued ? '' : ` <button type="button" class="rbfix" data-rb="back|${v.n}">Go back to it</button>`}</li>`).join('');
|
|
73
|
-
return [{ id: 'design', t: 'Why it looks like this', html: `<ul>${D.description ? `<li>${esc(D.description)}</li>` : ''}${smp}${L('Stays the same each cycle:', r.same)}${L('Changes each cycle:', r.changes)}${L('Learned from you:', r.learned)}</ul>`
|
|
74
|
-
+ (saved ? '' : '<p>No look is saved yet: each cycle uses the standard PMOS look.</p>') + (earlier ? `<p><b>Earlier looks</b></p><ul>${earlier}</ul>` : '') }];
|
|
75
|
-
}
|
|
76
|
-
function historySection(S, D) {
|
|
77
|
-
const E = [];
|
|
78
|
-
for (const v of (S && S.versions) || []) E.push({ at: v.at, t: 'Structure: ' + (v.turn || 'S' + v.n) });
|
|
79
|
-
for (const v of (D && D.versions) || []) E.push({ at: v.made_at, t: 'Look: ' + (v.turn || 'D' + v.n) });
|
|
80
|
-
E.sort((a, b) => String(b.at).localeCompare(String(a.at)));
|
|
81
|
-
return { id: 'history', t: 'What changed', html: E.length ? '<ul>' + E.slice(0, 8).map((e) => `<li>${esc(day(e.at))}: ${esc(e.t)}</li>`).join('') + '</ul>' : '<p>Nothing has changed since it was set up.</p>' };
|
|
82
|
-
}
|
|
83
|
-
const openSection = (open) => ({ id: 'open', t: 'Please confirm', html: open.length ? '<ol>' + open.map((x) => `<li>${esc(x)}</li>`).join('') + '</ol>' : '<p>Nothing open.</p>' });
|
|
84
|
-
|
|
85
|
-
const B = new Map(); // tab id → { ctx, structure, err }
|
|
86
|
-
function html(id) {
|
|
87
|
-
const b = B.get(id), ctx = b.ctx;
|
|
88
|
-
if (b.loading) return '<div class="rbrief"><p class="note">Reading how this report is made.</p></div>';
|
|
89
|
-
const { sections, open } = briefParts({ structure: b.structure, design: ctx.design, ctx });
|
|
90
|
-
const S = b.structure, use = S && S.plan && S.current != null && S.saved !== S.current && !ctx.issued;
|
|
91
|
-
return `<div class="rbrief"><div class="rbhd"><span><b>How this report is made</b><small>Not part of the report${b.err ? ' · ' + esc(b.err) : ''}</small></span>${open.length ? `<span class="rbto">${open.length} to confirm</span>` : ''}${use ? `<button type="button" class="dmcta dark" data-rb="use|${S.current}">Use it</button>` : ''}</div>`
|
|
92
|
-
+ `<nav class="rbtoc" aria-label="Brief sections">${sections.map((x) => `<button type="button" data-rb="go|${x.id}">${esc(x.t)}</button>`).join('')}</nav>`
|
|
93
|
-
+ sections.map((x) => `<section class="rbs" id="rb-${x.id}"><h4>${esc(x.t)}${x.id === 'glance' || x.id === 'history' ? '' : `<button type="button" class="rbfix" data-rb="fix|${esc(x.t)}" aria-label="Correct ${esc(x.t)}">Correct</button>`}</h4>${x.html}</section>`).join('') + '</div>';
|
|
94
|
-
}
|
|
95
|
-
async function load(id) {
|
|
96
|
-
const b = B.get(id), ctx = b.ctx;
|
|
97
|
-
const j = await Promise.resolve(pmGet('/api/report-structure?ws=' + encodeURIComponent(ctx.ws) + '&id=' + encodeURIComponent(ctx.id))).catch(() => null);
|
|
98
|
-
b.structure = j && j.ok ? j.structure : null;
|
|
99
|
-
b.err = j && !j.ok && j.status !== 404 && j.error ? 'the structure could not be read: ' + j.error : '';
|
|
100
|
-
b.loading = false;
|
|
101
|
-
}
|
|
102
|
-
function show(id) {
|
|
103
|
-
vwOpen({ id, title: 'Brief', icon: 'doc', html: html(id), wire: (el) => { el.onclick = (e) => press(id, e); } });
|
|
104
|
-
}
|
|
105
|
-
async function press(id, e) {
|
|
106
|
-
const t = e.target.closest('[data-rb]'); if (!t || t.disabled) return;
|
|
107
|
-
const [k, v] = t.dataset.rb.split('|'), b = B.get(id);
|
|
108
|
-
if (k === 'go') { const s = document.getElementById('rb-' + v); if (s) s.scrollIntoView({ behavior: 'smooth', block: 'start' }); return; }
|
|
109
|
-
if (k === 'fix') { b.ctx.correct(v); return; }
|
|
110
|
-
if (k === 'back') { t.disabled = true; await b.ctx.goBack(+v); return; }
|
|
111
|
-
if (k === 'use') {
|
|
112
|
-
t.disabled = true;
|
|
113
|
-
const r = await pmPost('/api/report-structure/accept', { ws: b.ctx.ws, id: b.ctx.id, n: +v }).catch(() => null);
|
|
114
|
-
if (!r || r.ok !== true) { t.disabled = false; toast((r && r.error) || 'The brief was not saved.'); return; }
|
|
115
|
-
toast('Saved. The next cycle is drafted from this brief.');
|
|
116
|
-
b.structure = r.structure || b.structure; show(id);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
export async function openBrief(ctx) {
|
|
120
|
-
const id = tabId(ctx);
|
|
121
|
-
B.set(id, { ctx, structure: null, err: '', loading: true });
|
|
122
|
-
show(id);
|
|
123
|
-
await load(id);
|
|
124
|
-
if (B.get(id) && B.get(id).ctx === ctx) show(id);
|
|
125
|
-
}
|
|
126
|
-
export async function refreshBrief(ctx) {
|
|
127
|
-
const id = tabId(ctx);
|
|
128
|
-
if (!vwState().ids.includes(id)) return;
|
|
129
|
-
B.set(id, { ...(B.get(id) || {}), ctx, loading: false });
|
|
130
|
-
await load(id);
|
|
131
|
-
show(id);
|
|
132
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* pm/premium-vw-rec.js — note recording (initiative premium-viewer, S4; rebuilt for the Agreed design, initiative premium-agreed-design, area viewer).
|
|
2
|
-
* The live capture (state, Highlight, Pause or Resume, Stop, the audio source, Pause shots, Private, your notes, the highlights and the
|
|
3
|
-
* transcript) is the Transcript part of the meeting card in the Viewer (premium-vw-mtg.js). This module keeps the pure half the shell's chip and
|
|
4
|
-
* the Record menu read, and opens the card:
|
|
5
|
-
* openLive(id) · openFocus(id) → the note's meeting card in the Viewer (Focus is in its ⋯ menu)
|
|
6
|
-
* The pure half (menuView, duringView, chipActs, focusPath, stageOf) takes the routes' answers, so a test reads it without a DOM. */
|
|
7
|
-
import { recordable, mmss } from './premium-meeting.js';
|
|
8
|
-
|
|
9
|
-
const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).trimEnd() + '…' : t; };
|
|
10
|
-
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
11
|
-
const hhmm = (s) => (typeof s === 'string' && /T\d{2}:\d{2}/.test(s) ? s.slice(11, 16) : '');
|
|
12
|
-
const SPEAKER = { mic: 'You', system: 'Them', tab: 'Them' };
|
|
13
|
-
export const NEW_LINE = 'Starts an untitled note now and listens to your microphone and the meeting’s sound. The audio and the notes stay on this machine.';
|
|
14
|
-
export const PRIVATE_LINE = 'A private note keeps only what you type. Its audio, transcript and screen shots are deleted now and none are kept while it stays private.';
|
|
15
|
-
export const HL_LINE = 'Keeps the last 30 seconds and the next ones as a highlight, written from the transcript when the window closes.';
|
|
16
|
-
|
|
17
|
-
/* ── the pure half ─────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
18
|
-
|
|
19
|
-
/** The Record menu: today's meetings that can still be recorded, each with the mark its note has. `busy` when a note records, so nothing new can start. */
|
|
20
|
-
export function menuView(rows, notes, now = Date.now()) {
|
|
21
|
-
const live = (Array.isArray(notes) ? notes : []).filter((n) => n && (n.state === 'recording' || n.state === 'paused'));
|
|
22
|
-
const items = (Array.isArray(rows) ? rows : []).filter((r) => r && recordable(r, now)).map((r, i) => {
|
|
23
|
-
const n = live.find((x) => x.meeting && x.meeting.kind === 'event' && ((x.meeting.event_id && x.meeting.event_id === r.id) || (Date.parse(x.meeting.start) === Date.parse(r.at) && clip(x.meeting.title, 120).toLowerCase() === clip(r.title, 120).toLowerCase())));
|
|
24
|
-
const at = Date.parse(r.at), end = Date.parse(r.end);
|
|
25
|
-
return { i, title: clip(r.title, 80), time: hhmm(r.at) + (hhmm(r.end) ? '–' + hhmm(r.end) : ''), mark: n ? (n.state === 'recording' ? 'Recording' : 'Paused') : now >= at && (!Number.isFinite(end) || now <= end) ? 'Now' : '' };
|
|
26
|
-
});
|
|
27
|
-
return { items, busy: live.some((n) => n.state === 'recording') };
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** The During capture from GET /api/notes/one (or its error). `held` is true when this page's recorder listens to the note. Nothing is invented: a part the note does not hold is empty. */
|
|
31
|
-
export function duringView(r, { held = false } = {}) {
|
|
32
|
-
if (!r || r.ok !== true || !r.note) return { state: 'error', reason: clip((r && r.error) || 'The note could not be read.', 160) };
|
|
33
|
-
const n = r.note, st = n.state;
|
|
34
|
-
const mode = st === 'recording' ? (held ? 'recording' : 'stale') : st === 'paused' ? 'paused' : st === 'ended' ? 'ended' : 'idle';
|
|
35
|
-
const who = (src) => clip((n.speakers && n.speakers[src]) || SPEAKER[src] || 'You', 40);
|
|
36
|
-
const lines = (Array.isArray(n.transcript) ? n.transcript : []).filter((x) => x && !x.dropped && x.text).slice(-40).map((x) => ({ who: who(x.source), t: Number(x.t) || 0, time: mmss(x.t), text: clip(x.text, 400) }));
|
|
37
|
-
const highlights = (Array.isArray(n.highlights) ? n.highlights : []).filter((h) => h && h.text).map((h) => ({ id: h.id, text: clip(h.text, 300), time: mmss(h.from), cat: h.cat || '' }));
|
|
38
|
-
const shots = r.screen && Array.isArray(r.screen.frames) ? r.screen.frames.length : 0;
|
|
39
|
-
return { state: 'ok', id: n.id, title: clip(n.title || (n.meeting && n.meeting.title) || 'Untitled note', 120), mode, private: !!n.private, body: String(n.body || ''), lines, highlights, shots,
|
|
40
|
-
until: hhmm(n.resume_until), event: !!(n.meeting && n.meeting.kind === 'event' && n.meeting.event_id) };
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** The presses the chip shows. `v` is recChipView's answer; `here` is the page ('brief' holds the recorder). Other pages say what records with Open and Stop. */
|
|
44
|
-
export function chipActs(v, here) {
|
|
45
|
-
if (!v) return [];
|
|
46
|
-
if (here !== 'brief') return ['open', 'stop'];
|
|
47
|
-
if (v.mode === 'recording' && v.held) return ['hl', 'pause', 'fv', 'open', 'stop'];
|
|
48
|
-
return ['open', ...(v.canResume ? ['resume'] : []), 'stop'];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** The Focus read of a note: its calendar event and day. null when the note is not linked to an event, because Focus reads a meeting. */
|
|
52
|
-
export function focusPath(note) {
|
|
53
|
-
const m = note && note.meeting;
|
|
54
|
-
if (!m || m.kind !== 'event' || !m.event_id || !/T\d{2}:\d{2}/.test(String(m.start || ''))) return null;
|
|
55
|
-
return '/api/meeting-focus?event=' + encodeURIComponent(m.event_id) + '&date=' + String(m.start).slice(0, 10);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** The material Focus can put on the stage: a PMOS deck (Present, Audience view) or Google Slides (Present); a link opens in a new tab. */
|
|
59
|
-
export function stageOf(material) {
|
|
60
|
-
return (Array.isArray(material) ? material : []).map((m, i) => ({ i, title: clip(m.title || m.ref || m.url, 100), kind: m.kind || '', topic: clip(m.topic, 60),
|
|
61
|
-
present: m.kind === 'pmos-deck' || m.kind === 'slides', audience: m.kind === 'pmos-deck', url: /^https:\/\//.test(String(m.url || '')) ? m.url : '' })).filter((x) => x.title);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* ── the page half: the Viewer's meeting card ───────────────────────────────────────────────────────────────────────── */
|
|
65
|
-
const card = () => import('./premium-vw-mtg.js');
|
|
66
|
-
export async function openLive(id) { if (!id) return null; return (await card()).openMeeting({ note: id }); }
|
|
67
|
-
export async function openFocus(id) { if (!id) return null; return (await card()).openMeeting({ note: id }); }
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* pm/premium-wide.css — the premium pages on a large screen (initiative premium-wide-screens). Loaded after premium.css on every premium page.
|
|
2
|
-
Wawan, 2026-10-22: "So much empty space on large screen" and "on desktop, font is too small". Nothing here applies below 1440 px, so the
|
|
3
|
-
phone and the 1280 px layout (which the mockup suites measure) stay as they are.
|
|
4
|
-
- the type steps grow at 1440 and again at 1920 (html:root wins over the :root a viewer sheet sets when it loads)
|
|
5
|
-
- the page column grows with the screen instead of stopping at 1360 px
|
|
6
|
-
- the dialogs grow, the conversation text uses the width of its pane and keeps the body size, and the item view takes no more than half */
|
|
7
|
-
@media (min-width:1440px){
|
|
8
|
-
html:root{--fs-1:12px;--fs-2:13px;--fs-3:15px;--fs-4:17px;--fs-5:22px;--fs-6:30px}
|
|
9
|
-
.stage{max-width:1600px}
|
|
10
|
-
.dlg[data-mode="split"]{width:min(1480px,calc(100% - 64px));height:min(90vh,1040px)}
|
|
11
|
-
.dlg[data-mode="detail"]{width:min(1120px,calc(100% - 64px));height:min(90vh,1040px)}
|
|
12
|
-
.dlg #dBody .md,.dlg #dBody .md p,.dlg #dBody .md li,.dlg #dBody .tt{max-width:min(100%,82ch)}
|
|
13
|
-
.dlg.full.srl-on #dBody .tt,.dlg.full.srl-on #dBody .ub,.dlg.full.srl-on #dBody .md,.dlg.full.srl-on #dBody .md p,.dlg.full.srl-on #dBody .md li{font-size:var(--fs-3)}
|
|
14
|
-
.dlg.full.srl-on .stream{gap:16px}
|
|
15
|
-
.dlg.full:not([data-mode="detail"]) .dgrid{grid-template-columns:minmax(420px,1fr) minmax(0,1fr)}
|
|
16
|
-
.dlg.full.srl-on:not([data-mode="detail"]) .dgrid{grid-template-columns:var(--srw,248px) minmax(420px,1fr) minmax(0,1fr)}
|
|
17
|
-
.chatpg .dlg.full.srl-on:not(.vw-shut) .dgrid{grid-template-columns:var(--srw,248px) minmax(420px,1fr) minmax(0,1fr)}
|
|
18
|
-
.dlg.full.vw-min:not([data-mode="detail"]) #dBody,.chatpg .dlg.full.vw-shut #dBody{padding-inline:max(0px,calc((100% - 960px) / 2))}
|
|
19
|
-
}
|
|
20
|
-
@media (min-width:1920px){
|
|
21
|
-
html:root{--fs-1:12px;--fs-2:14px;--fs-3:16px;--fs-4:18px;--fs-5:24px;--fs-6:32px}
|
|
22
|
-
.stage{max-width:1920px}
|
|
23
|
-
.stage{padding-right:64px}
|
|
24
|
-
.dlg[data-mode="split"]{width:min(1720px,calc(100% - 96px))}
|
|
25
|
-
.dlg.full.srl-on:not([data-mode="detail"]) .dgrid,.chatpg .dlg.full.srl-on:not(.vw-shut) .dgrid{grid-template-columns:var(--srw,272px) minmax(480px,1fr) minmax(0,1fr)}
|
|
26
|
-
.dlg.full.vw-min:not([data-mode="detail"]) #dBody,.chatpg .dlg.full.vw-shut #dBody{padding-inline:max(0px,calc((100% - 1080px) / 2))}
|
|
27
|
-
}
|
|
28
|
-
@media (min-width:2400px){
|
|
29
|
-
.stage{max-width:2160px}
|
|
30
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/* pm/print.css — a report on paper (pm-os-absorb Run 5, slice 5C). Linked with media="print" by report-view.js.
|
|
2
|
-
*
|
|
3
|
-
* printReport() draws the report into `body > .rp-print`, in the light theme. On paper every other child of the body goes,
|
|
4
|
-
* and the report takes the page. The report's own rules (.rp-doc …) are in components.css. */
|
|
5
|
-
@page {
|
|
6
|
-
margin: 16mm;
|
|
7
|
-
}
|
|
8
|
-
/* the slides (Run 6): each slide is one 1280 × 720 px page (13.333in × 7.5in), 16:9, with no margin */
|
|
9
|
-
@page slides {
|
|
10
|
-
size: 13.3333in 7.5in;
|
|
11
|
-
margin: 0;
|
|
12
|
-
}
|
|
13
|
-
@media print {
|
|
14
|
-
body > *:not(.rp-print) {
|
|
15
|
-
display: none !important;
|
|
16
|
-
}
|
|
17
|
-
html,
|
|
18
|
-
body {
|
|
19
|
-
height: auto !important;
|
|
20
|
-
overflow: visible !important;
|
|
21
|
-
background: Canvas !important;
|
|
22
|
-
}
|
|
23
|
-
body > .rp-print {
|
|
24
|
-
display: block !important;
|
|
25
|
-
padding: 0;
|
|
26
|
-
background: Canvas;
|
|
27
|
-
color: CanvasText;
|
|
28
|
-
font-family: var(--sans);
|
|
29
|
-
}
|
|
30
|
-
.rp-print .rp-doc__h2,
|
|
31
|
-
.rp-print .rp-doc__h3 {
|
|
32
|
-
break-after: avoid;
|
|
33
|
-
}
|
|
34
|
-
.rp-print .rp-doc__table,
|
|
35
|
-
.rp-print .rp-doc__note {
|
|
36
|
-
break-inside: avoid;
|
|
37
|
-
}
|
|
38
|
-
.rp-print--slides .rp-slide {
|
|
39
|
-
page: slides;
|
|
40
|
-
break-after: page;
|
|
41
|
-
print-color-adjust: exact;
|
|
42
|
-
-webkit-print-color-adjust: exact;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/* pm/provider-cards.js — every needs provider's rows as Today cards (pm-os-absorb seams, Runs 2 to 5).
|
|
2
|
-
*
|
|
3
|
-
* The server folds each run's needs-you rows into /api/needs (lib/needs-providers.js): a day-one Cycle review, an
|
|
4
|
-
* unattested PM line, an item in Review, a report to issue. This module is the ONE Today source for all of them, so the
|
|
5
|
-
* nav's Today count and Today's header count each row once, whichever run made it:
|
|
6
|
-
* - it reads /api/needs of each repository's workspace, once the first sessions poll has answered (as keep-card.js
|
|
7
|
-
* does, so the page's startup makes no extra request), and again when that workspace's ledgers change;
|
|
8
|
-
* - it keeps the provider rows only (derived, with a `provider`), never Run 1's own rows, which keep-card.js draws;
|
|
9
|
-
* - it draws a row with the renderer its run registered for the row's kind (registry.js registerTodayCard), or else
|
|
10
|
-
* a plain card from the row's `today` payload: the cause as the title, the evidence as the meta line.
|
|
11
|
-
*
|
|
12
|
-
* Loaded by registry.js loadExtensions at boot. Run 3 (slice 3B) owns this file after the base: every card carries its R12
|
|
13
|
-
* kind and its id (data-today-kind, data-today-id) so Today ranks them, the plain card has its one button and the ⋯ menu,
|
|
14
|
-
* and a provider's failure is a notice on Today, never a card. Fixture mode never loads it.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { ensureComponentsCss, toast, SEL } from './primitives.js';
|
|
18
|
-
import { pmGet } from './http.js';
|
|
19
|
-
import { wsOf } from './data.js';
|
|
20
|
-
import { state, setState } from './state.js';
|
|
21
|
-
import { registerTodaySource, todayCardFor, openInitiative } from './registry.js';
|
|
22
|
-
import { todayCard, ensureFeed, onFeed } from './today-cards.js';
|
|
23
|
-
import { COPY } from './today-copy.js';
|
|
24
|
-
|
|
25
|
-
const cache = new Map(); // ws -> { rows, loading, stale }
|
|
26
|
-
let hooked = false;
|
|
27
|
-
|
|
28
|
-
/** A row that is a card: derived, from a provider, and not that provider's own failure (a failed source is a notice, not a card). */
|
|
29
|
-
const isCardRow = (r) => !!r && r.derived === true && typeof r.provider === 'string' && r.kind !== 'provider-error' && r.run_id !== 'plan-items:unreadable';
|
|
30
|
-
|
|
31
|
-
function load(ws) {
|
|
32
|
-
const c = cache.get(ws) || { rows: [], loading: false, stale: true };
|
|
33
|
-
cache.set(ws, c);
|
|
34
|
-
if (c.loading) { c.again = true; return; }
|
|
35
|
-
c.loading = true; c.again = false;
|
|
36
|
-
pmGet('/api/needs?ws=' + encodeURIComponent(ws)).then((out) => {
|
|
37
|
-
c.loading = false; c.stale = false;
|
|
38
|
-
const all = out && Array.isArray(out.needs) ? out.needs : [];
|
|
39
|
-
// an item Run 1's `evidence` row already names (keep-card.js draws it) is not drawn again from 4D's item-no-evidence row
|
|
40
|
-
const evidenceOf = new Set(all.filter((r) => r && r.kind === 'evidence').map((r) => String(r.run_id).replace(/^evidence:/, '')));
|
|
41
|
-
const dup = (r) => r.kind === 'item-no-evidence' && evidenceOf.has(String(r.run_id || '').replace(/^work-check-needs:no-evidence:/, ''));
|
|
42
|
-
c.rows = all.filter((r) => isCardRow(r) && !dup(r));
|
|
43
|
-
if (c.again) load(ws);
|
|
44
|
-
setState({});
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function hook() {
|
|
49
|
-
if (hooked || typeof window === 'undefined') return;
|
|
50
|
-
hooked = true;
|
|
51
|
-
// A D86 row changes with a placement, a measurement, an issue: files the sessions poll does not watch. The shared feed
|
|
52
|
-
// (today-cards.js) watches the repository's own /api/today sig, and tells this source when it moved.
|
|
53
|
-
onFeed((ws) => { const c = cache.get(ws); if (c) { c.stale = true; load(ws); } });
|
|
54
|
-
window.addEventListener('pmos:ledgers', (e) => {
|
|
55
|
-
const changed = (e && e.detail && e.detail.changed) || [];
|
|
56
|
-
for (const ws of changed) { const c = cache.get(ws); if (c) { c.stale = true; load(ws); } }
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** The provider rows of the given repositories, each with its repository: [{ repo, ws, row }]. Starts a read if needed. */
|
|
61
|
-
function rowsOf(repos) {
|
|
62
|
-
hook();
|
|
63
|
-
const out = [];
|
|
64
|
-
for (const repo of repos || []) {
|
|
65
|
-
const ws = wsOf(repo);
|
|
66
|
-
if (!ws) continue;
|
|
67
|
-
ensureFeed(ws);
|
|
68
|
-
const c = cache.get(ws);
|
|
69
|
-
if ((!c || (c.stale && !c.loading)) && Array.isArray(state.sessions)) load(ws);
|
|
70
|
-
for (const row of (c && c.rows) || []) out.push({ repo, ws, row });
|
|
71
|
-
}
|
|
72
|
-
return out;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const rowId = (ws, row) => ws + '|' + row.run_id;
|
|
76
|
-
|
|
77
|
-
/** What the one button of a plain provider card does: open the initiative, else the destination that holds the record. */
|
|
78
|
-
function pressOf(repo, row) {
|
|
79
|
-
return () => {
|
|
80
|
-
const t = row.today && typeof row.today === 'object' ? row.today : {};
|
|
81
|
-
if (row.initiative_id) { openInitiative(repo, row.initiative_id); return; }
|
|
82
|
-
const open = typeof window !== 'undefined' && window.pmApp && window.pmApp.open;
|
|
83
|
-
const dest = row.provider === 'report-needs' ? 'reports' : row.provider === 'initiative-needs' ? 'initiatives' : null;
|
|
84
|
-
if (dest && open) { open(dest); return; }
|
|
85
|
-
if (t.act && t.act.cli) toast({ text: COPY.commandShown(t.act.cli), timeout: 12000 }); else toast({ text: COPY.noInitiative });
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function plainCard({ repo, ws, row }) {
|
|
90
|
-
const t = row.today && typeof row.today === 'object' ? row.today : {};
|
|
91
|
-
const slug = row.initiative_id || null;
|
|
92
|
-
const kind = Number.isInteger(t.kind) && t.kind >= 1 && t.kind <= 8 ? t.kind : 8;
|
|
93
|
-
return todayCard({
|
|
94
|
-
kind, id: rowId(ws, row), repo, ws, initiative: slug, cause: t.cause || row.question || row.kind, evidence: t.evidence || slug || '',
|
|
95
|
-
act: t.act || { label: 'Open' }, onAct: pressOf(repo, row),
|
|
96
|
-
attrs: { 'data-today-row': row.kind, 'data-provider': row.provider },
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
registerTodaySource({
|
|
101
|
-
id: 'provider-rows',
|
|
102
|
-
kind: null, // every R12 kind: each row carries its own in row.today.kind
|
|
103
|
-
rank: 50,
|
|
104
|
-
count: (ctx) => rowsOf(ctx.repos).length,
|
|
105
|
-
cards: (ctx) => {
|
|
106
|
-
const out = rowsOf(ctx.repos).map((x) => {
|
|
107
|
-
const render = todayCardFor(x.row.kind);
|
|
108
|
-
if (render) {
|
|
109
|
-
try {
|
|
110
|
-
const node = render(x.row, { ...ctx, repo: x.repo, ws: x.ws });
|
|
111
|
-
if (node) {
|
|
112
|
-
// A run's renderer draws its own face (4D's Release card, 2D's triage and Cycle cards, 5C's report cards). That face
|
|
113
|
-
// is the Today card's body: its title is the one cause and its action the one button, and Today adds only the ⋯
|
|
114
|
-
// menu (R12), so every card ranks, counts and reads alike without a second cause or a second button.
|
|
115
|
-
const t = x.row.today && typeof x.row.today === 'object' ? x.row.today : {};
|
|
116
|
-
const kind = Number.isInteger(t.kind) && t.kind >= 1 && t.kind <= 8 ? t.kind : 8;
|
|
117
|
-
// the renderer's action: its last button that is not the card's own open button, else the open button
|
|
118
|
-
const btns = [...node.querySelectorAll('button')];
|
|
119
|
-
const actBtn = btns.filter((b) => !b.matches(SEL.cardOpen)).pop() || btns[0];
|
|
120
|
-
if (actBtn) actBtn.setAttribute('data-today-act', '');
|
|
121
|
-
const causeEl = node.querySelector('[data-today-cause]') || node.querySelector(SEL.cardTitle);
|
|
122
|
-
if (causeEl) causeEl.setAttribute('data-today-cause', '');
|
|
123
|
-
return todayCard({
|
|
124
|
-
kind, id: rowId(x.ws, x.row), repo: x.repo, ws: x.ws, initiative: x.row.initiative_id || null,
|
|
125
|
-
cause: t.cause || x.row.question || x.row.kind, act: t.act || { label: 'Open' },
|
|
126
|
-
attrs: { 'data-provider': x.row.provider, 'data-today-host': x.row.kind }, face: node,
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
} catch (e) { console.error('[pm] the Today card for ' + x.row.kind + ' failed:', e); }
|
|
130
|
-
}
|
|
131
|
-
return plainCard(x);
|
|
132
|
-
});
|
|
133
|
-
if (out.length) ensureComponentsCss();
|
|
134
|
-
return out;
|
|
135
|
-
},
|
|
136
|
-
});
|