create-pmos 0.399.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 +18 -13
- 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 +2 -2
- package/workspace/briefing-premium-board-test.js +2 -2
- package/workspace/briefing-premium-doc-edit-test.js +2 -8
- package/workspace/briefing-premium-test.js +3 -2
- package/workspace/briefing-premium-work-test.js +9 -4
- package/workspace/c3-capture-test.js +0 -17
- package/workspace/changelog.json +17 -0
- package/workspace/guide/briefing-premium.md +2 -2
- package/workspace/guide/home.md +20 -2
- 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/route-modules.js +1 -9
- package/workspace/lib/routes-phone-day.js +18 -9
- package/workspace/lib/routes-slash.js +95 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -2
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-term-test.js +0 -10
- package/workspace/premium-menu-rows-test.js +1 -1
- package/workspace/premium-phone-card-test.js +2 -2
- package/workspace/premium-vw-doc-test.js +1 -8
- package/workspace/premium-work-depth-test.js +2 -3
- package/workspace/public/capture.html +23 -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-home.css +20 -5
- package/workspace/public/pm/cozy-today.css +5 -2
- package/workspace/public/pm/cozy-viewer.js +4 -2
- package/workspace/public/pm/cozy.css +9 -0
- package/workspace/public/pm/goal-chat.js +5 -1
- package/workspace/public/pm/home-app.js +47 -26
- package/workspace/public/pm/home-chat.js +10 -4
- package/workspace/public/pm/home-data.js +3 -1
- package/workspace/public/pm/home-dictate.js +7 -4
- package/workspace/public/pm/home-ini.js +12 -2
- package/workspace/public/pm/home-list.js +20 -7
- package/workspace/public/pm/home-more.js +2 -2
- package/workspace/public/pm/home-phone-card.js +9 -4
- package/workspace/public/pm/home-review.js +2 -3
- package/workspace/public/pm/home-today.js +10 -6
- package/workspace/public/pm/home-work.js +15 -8
- 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 +1 -1
- package/workspace/public/pm/premium-initiative-head.js +3 -3
- package/workspace/public/pm/premium-vw-doc.css +20 -2
- package/workspace/public/pm/premium-vw-doc.js +22 -7
- package/workspace/public/pm/view-notes.js +2 -2
- 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/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/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/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,391 +0,0 @@
|
|
|
1
|
-
/* pm/welcome.js — the first-run page (/welcome). One primary button per screen.
|
|
2
|
-
*
|
|
3
|
-
* About you → Your sources → First look → Your portfolio → Questions (only when the scan left any) → First Briefing
|
|
4
|
-
*
|
|
5
|
-
* Routes (lib/routes-onboarding.js): GET /api/onboarding/status|structure|briefing, POST /api/onboarding/scan|apply|undo.
|
|
6
|
-
* About you saves the name, role, work and job description to the proactive settings (POST /api/proactive/settings
|
|
7
|
-
* {name, about}); the brief and the day check read them from `pmos proactive settings`.
|
|
8
|
-
* Your sources lists the folders and the tools. A ticked tool starts when the PM presses Scan: Calendar and Jira through
|
|
9
|
-
* POST /api/sources/refresh (lib/routes-sources.js), which starts the source's read-only skill as a session with the PM's
|
|
10
|
-
* own connection; Inbox and Slack are sources of the daily brief, so they are turned on (briefSources) and the day is
|
|
11
|
-
* prepared once (POST /api/proactive/goals/plan). Nothing is read before the press; the server calls nothing outside.
|
|
12
|
-
* Presses carry the launch nonce through pm/http.js. The page writes nothing itself; text taken from the scanned folder is
|
|
13
|
-
* untrusted, so every value goes through esc() and no quoted text from a file is shown.
|
|
14
|
-
* data-testid attributes are the browser suite's handles.
|
|
15
|
-
*/
|
|
16
|
-
import { pmGet, pmPost } from './http.js';
|
|
17
|
-
import { el } from './dom.js';
|
|
18
|
-
import { button, field, SEL } from './primitives.js';
|
|
19
|
-
import { ensureC3Css } from './pm-work-view.js';
|
|
20
|
-
import { applyDayPart } from './c3-daypart.js';
|
|
21
|
-
|
|
22
|
-
const root = document.getElementById('wl-root');
|
|
23
|
-
const params = new URLSearchParams(location.search);
|
|
24
|
-
const S = {
|
|
25
|
-
ws: params.get('ws') || '', folder: null, added: [], step: 'welcome', busy: '', error: '', note: '',
|
|
26
|
-
about: { name: '', role: '', work: '', duties: '' }, pick: {},
|
|
27
|
-
look: null, structure: null, checked: {}, titles: {}, boardOf: {}, open: {}, edit: {}, answers: {}, skipped: {}, importId: '', briefing: [], sources: {},
|
|
28
|
-
};
|
|
29
|
-
const STEPS = [['welcome', 'About you'], ['sources', 'Your sources'], ['look', 'First look'], ['portfolio', 'Your portfolio'], ['questions', 'Questions'], ['briefing', 'First Briefing']];
|
|
30
|
-
/* The tools a first run can read besides the folders. `source` is a lib/freshness.js SOURCES id with a read-only skill; `brief` is a
|
|
31
|
-
* lib/proactive.js BRIEF_SOURCES key that the morning brief reads when it is on. */
|
|
32
|
-
const TOOLS = [
|
|
33
|
-
{ source: 'calendar', name: 'Calendar', adds: 'Your meetings today and for the next 14 days, so the Briefing can get you ready for them.' },
|
|
34
|
-
{ source: 'my-work', name: 'Jira', adds: 'The Jira issues assigned to you, so My work starts with them.' },
|
|
35
|
-
{ source: 'inbox', brief: 'mail', name: 'Inbox', adds: 'The threads waiting on you, by subject and sender only, in your daily Briefing. No message text is kept.' },
|
|
36
|
-
{ source: 'slack', brief: 'slack', name: 'Slack', adds: 'Messages that mention you and your direct messages, as short summaries in your daily Briefing.' },
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
40
|
-
const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
41
|
-
const ref = (e) => (e ? (e.line ? `${e.file}:${e.line}` : e.file) : '');
|
|
42
|
-
|
|
43
|
-
/* ── model ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
44
|
-
const rowsOf = () => (S.structure ? S.structure.boards.flatMap((b) => b.initiatives.map((r) => ({ ...r, board: b.key }))) : []);
|
|
45
|
-
const boardOfRow = (r) => S.boardOf[r.proposal_id] || r.board;
|
|
46
|
-
function counts() {
|
|
47
|
-
const on = rowsOf().filter((r) => S.checked[r.proposal_id]);
|
|
48
|
-
return { n: on.length, m: new Set(on.map(boardOfRow)).size };
|
|
49
|
-
}
|
|
50
|
-
function adopt(structure) {
|
|
51
|
-
S.structure = structure; S.checked = {}; S.titles = {}; S.boardOf = {}; S.open = {}; S.edit = {}; S.answers = {}; S.skipped = {};
|
|
52
|
-
for (const r of rowsOf()) { S.checked[r.proposal_id] = !!r.checked; S.titles[r.proposal_id] = r.title; }
|
|
53
|
-
}
|
|
54
|
-
function revisions() {
|
|
55
|
-
const out = {};
|
|
56
|
-
for (const r of rowsOf()) {
|
|
57
|
-
const rev = {};
|
|
58
|
-
if (S.titles[r.proposal_id] !== r.title && String(S.titles[r.proposal_id]).trim()) rev.title = String(S.titles[r.proposal_id]).trim();
|
|
59
|
-
if (S.boardOf[r.proposal_id] && S.boardOf[r.proposal_id] !== r.board) rev.board = S.boardOf[r.proposal_id];
|
|
60
|
-
if (Object.keys(rev).length) out[r.proposal_id] = rev;
|
|
61
|
-
}
|
|
62
|
-
return out;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/* ── actions ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
66
|
-
const fail = (r, what) => { S.error = (r && r.error) || `${what} did not work.`; };
|
|
67
|
-
async function run(label, fn) {
|
|
68
|
-
S.busy = label; S.error = ''; render();
|
|
69
|
-
try { await fn(); } catch (e) { S.error = String((e && e.message) || e); }
|
|
70
|
-
S.busy = ''; render();
|
|
71
|
-
}
|
|
72
|
-
async function loadStructure() {
|
|
73
|
-
const r = await pmGet(`/api/onboarding/structure?ws=${encodeURIComponent(S.ws)}`);
|
|
74
|
-
if (!r || !r.ok) { fail(r, 'Reading the portfolio'); return false; }
|
|
75
|
-
adopt(r); return true;
|
|
76
|
-
}
|
|
77
|
-
async function loadBriefing() {
|
|
78
|
-
const r = await pmGet(`/api/onboarding/briefing?ws=${encodeURIComponent(S.ws)}`);
|
|
79
|
-
if (!r || !r.ok) { fail(r, 'Reading the Briefing'); return false; }
|
|
80
|
-
S.briefing = r.items || []; return true;
|
|
81
|
-
}
|
|
82
|
-
const addFolder = () => run('add', async () => {
|
|
83
|
-
const p = await pmPost('/api/pick-folder', {});
|
|
84
|
-
if (!p || !p.ok) { if (p && p.cancelled) return; S.note = (p && p.unsupported) ? 'This system has no folder chooser. Start pmos in the folder instead.' : ''; if (!S.note) fail(p, 'Choosing a folder'); return; }
|
|
85
|
-
const w = await pmPost('/api/workspaces', { root: p.root, name: p.root.split(/[\\/]/).filter(Boolean).pop(), focus: false });
|
|
86
|
-
if (!w || !w.workspace) { fail(w, 'Adding the folder'); return; }
|
|
87
|
-
if (!S.added.some((a) => a.id === w.workspace.id) && w.workspace.id !== S.ws) S.added.push({ id: w.workspace.id, name: w.workspace.name, root: w.workspace.root });
|
|
88
|
-
});
|
|
89
|
-
const saveAbout = () => run('about', async () => {
|
|
90
|
-
const a = S.about;
|
|
91
|
-
const r = await pmPost('/api/proactive/settings', { name: a.name.trim().slice(0, 40), about: { role: a.role.trim(), work: a.work.trim(), duties: a.duties.trim() } });
|
|
92
|
-
if (!r || !r.ok) { fail(r, 'Saving what you told PMOS'); return; }
|
|
93
|
-
S.step = 'sources';
|
|
94
|
-
});
|
|
95
|
-
/* Start the ticked tools: each one is its own read-only agent session. A tool that cannot start says why on its row and
|
|
96
|
-
* does not stop the folder scan. */
|
|
97
|
-
async function startTools() {
|
|
98
|
-
const picked = TOOLS.filter((x) => S.pick[x.source]);
|
|
99
|
-
const brief = picked.filter((x) => x.brief);
|
|
100
|
-
if (brief.length) {
|
|
101
|
-
const on = await pmPost('/api/proactive/settings', { briefSources: Object.fromEntries(brief.map((x) => [x.brief, true])) });
|
|
102
|
-
const r = on && on.ok ? await pmPost('/api/proactive/goals/plan', { ws: S.ws }) : on;
|
|
103
|
-
for (const x of brief) S.sources[x.source] = r && r.ok ? { started: true } : { error: (r && r.error) || 'Starting the read did not work.' };
|
|
104
|
-
}
|
|
105
|
-
for (const x of picked.filter((t) => !t.brief)) {
|
|
106
|
-
const r = await pmPost('/api/sources/refresh', { ws: S.ws, source: x.source });
|
|
107
|
-
S.sources[x.source] = r && r.ok ? { started: true } : { error: (r && r.error) || 'Starting the read did not work.' };
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
const scan = () => run('scan', async () => {
|
|
111
|
-
await startTools();
|
|
112
|
-
const r = await pmPost('/api/onboarding/scan', { ws: S.ws, extra_roots: S.added.map((a) => a.root) });
|
|
113
|
-
if (!r || !r.ok) { fail(r, 'The scan'); return; }
|
|
114
|
-
S.look = r.first_look; S.step = 'look';
|
|
115
|
-
});
|
|
116
|
-
const toPortfolio = () => run('structure', async () => { if (await loadStructure()) S.step = 'portfolio'; });
|
|
117
|
-
async function applyNow() {
|
|
118
|
-
const include = rowsOf().filter((r) => S.checked[r.proposal_id]).map((r) => r.proposal_id);
|
|
119
|
-
const answers = {};
|
|
120
|
-
// an untouched question sends its default (the PM saw it and pressed Import); a skipped one sends nothing
|
|
121
|
-
for (const q of (S.structure.questions || [])) {
|
|
122
|
-
if (S.skipped[q.id]) continue;
|
|
123
|
-
const v = S.answers[q.id] != null ? S.answers[q.id] : q.default;
|
|
124
|
-
if (q.id === 'template') answers.template = Object.assign(answers.template || {}, { [q.board]: v });
|
|
125
|
-
else answers[q.id] = v;
|
|
126
|
-
}
|
|
127
|
-
const r = await pmPost('/api/onboarding/apply', { ws: S.ws, include, revisions: revisions(), answers });
|
|
128
|
-
if (!r || !r.ok) { fail(r, 'The import'); return; }
|
|
129
|
-
S.importId = r.import_id;
|
|
130
|
-
if (await loadBriefing()) S.step = 'briefing';
|
|
131
|
-
}
|
|
132
|
-
const importNow = () => {
|
|
133
|
-
if (!counts().n) return;
|
|
134
|
-
if ((S.structure.questions || []).length && S.step !== 'questions') { S.step = 'questions'; render(); return; }
|
|
135
|
-
run('apply', applyNow);
|
|
136
|
-
};
|
|
137
|
-
// "Not now" and "Skip setup": Welcome stops opening on its own for this folder (`pmos welcome` still opens it), then the console opens
|
|
138
|
-
const notNow = () => run('dismiss', async () => {
|
|
139
|
-
const r = await pmPost('/api/onboarding/dismiss', { ws: S.ws });
|
|
140
|
-
if (!r || !r.ok) { fail(r, 'Not now'); return; }
|
|
141
|
-
location.href = '/?ws=' + encodeURIComponent(S.ws);
|
|
142
|
-
});
|
|
143
|
-
const undo = () => run('undo', async () => {
|
|
144
|
-
const r = await pmPost('/api/onboarding/undo', { ws: S.ws, import_id: S.importId });
|
|
145
|
-
if (!r || !r.ok) { fail(r, 'Undo'); return; }
|
|
146
|
-
S.importId = '';
|
|
147
|
-
if (await loadStructure()) S.step = 'portfolio';
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
/* ── views ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
151
|
-
/* Drawn with console3 parts (console3.css): .card.sect > .sh2, ul.list > li.nrow (.ki, .nb, .tt, .chips, .acts), .chip2, .tag,
|
|
152
|
-
* .bdg, .fold, .pbar, .xp. Buttons and checkboxes are the primitives (primitives.js button() and field()): a view writes a
|
|
153
|
-
* placeholder through ctl() and render() puts the primitive in its place. The .wl- rules in components.css add only the
|
|
154
|
-
* frame, the progress labels, the footer bar and the field blocks (the approved console3 mockup's Welcome page). Each step
|
|
155
|
-
* view returns [body, footer]. */
|
|
156
|
-
const ICONS = { folder: 'repo', board: 'cols', tools: 'org' };
|
|
157
|
-
const ic = (n, cls) => `<svg class="ic${cls ? ' ' + cls : ''}" aria-hidden="true"><use href="#c3i-${ICONS[n] || n}"></use></svg>`;
|
|
158
|
-
const spin = (txt) => `<span class="wl-spindot" data-testid="loading" aria-hidden="true"></span>${esc(txt)}`;
|
|
159
|
-
const dis = (on) => (on ? 'disabled' : '');
|
|
160
|
-
/* Controls drawn this render: ctl(spec) returns a placeholder, mountControls() swaps each for its primitive.
|
|
161
|
-
* spec: { variant, size, html (the label, already escaped), attrs, href, lead (a console3 icon) } or { check, text, value, attrs }. */
|
|
162
|
-
let CTL = [];
|
|
163
|
-
const ctl = (spec) => { CTL.push(spec); return `<span data-wl-ctl="${CTL.length - 1}"></span>`; };
|
|
164
|
-
function mountControls() {
|
|
165
|
-
for (const ph of root.querySelectorAll('[data-wl-ctl]')) {
|
|
166
|
-
const c = CTL[Number(ph.getAttribute('data-wl-ctl'))];
|
|
167
|
-
let node;
|
|
168
|
-
if (c.check) node = field({ label: c.text, kind: 'check', value: !!c.value, attrs: c.attrs });
|
|
169
|
-
else {
|
|
170
|
-
const { disabled, ...attrs } = c.attrs; // button() takes disabled on its own; a key in attrs would override it
|
|
171
|
-
const b = button({ label: '', variant: c.variant, size: c.size, disabled: !!disabled, attrs });
|
|
172
|
-
b.querySelector(SEL.btnLabel).innerHTML = c.html;
|
|
173
|
-
if (c.lead) b.insertAdjacentHTML('afterbegin', ic(c.lead, 'sm'));
|
|
174
|
-
if (c.href) { node = el('a', { ...attrs, class: b.className, href: c.href }); node.append(...b.childNodes); } else node = b;
|
|
175
|
-
}
|
|
176
|
-
ph.replaceWith(node);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
const busyAttrs = (key) => (S.busy === key ? { 'aria-busy': 'true' } : {});
|
|
180
|
-
const primary = (id, text, busyKey, busyText, off) => ctl({ variant: 'primary', html: S.busy === busyKey ? spin(busyText) : esc(text), attrs: { class: 'wl-primary', 'data-testid': id, disabled: !!(S.busy || off), ...busyAttrs(busyKey) } });
|
|
181
|
-
const ghost = (id, text, more) => ctl({ variant: 'ghost', html: esc(text), attrs: { 'data-testid': id, disabled: !!S.busy, ...(more || {}) } });
|
|
182
|
-
const head = (h, lead, leadId) => `<header class="wl-head"><h1>${esc(h)}</h1>${lead ? `<p class="wl-lead"${leadId ? ` data-testid="${leadId}"` : ''}>${esc(lead)}</p>` : ''}</header>`;
|
|
183
|
-
const sub = (title, icon, right, count) => `<div class="sh2"><h2>${icon ? ic(icon, 'sm') : ''}${title}${count != null ? ` <span class="bdg g">${count}</span>` : ''}</h2>${right || ''}</div>`;
|
|
184
|
-
const pathChip = (t, attrs) => `<span class="chip2"${attrs ? ' ' + attrs : ''}>${ic('doc', 'sm')}${esc(t)}</span>`;
|
|
185
|
-
const foot = (left, right) => `<footer class="wl-foot"><div>${left || ''}</div><div>${right}</div></footer>`;
|
|
186
|
-
const backBtn = () => ghost('back-button', 'Back');
|
|
187
|
-
|
|
188
|
-
function viewWelcome() {
|
|
189
|
-
const a = S.about;
|
|
190
|
-
const field = (k, text, hint, max) => `<div class="wl-fld"><label class="wl-flabel" for="about-${k}">${text}</label><input type="text" id="about-${k}" data-testid="about-${k}" maxlength="${max}" value="${esc(a[k])}" placeholder="${esc(hint)}" autocomplete="off"></div>`;
|
|
191
|
-
return [head('Welcome to PMOS', 'Tell PMOS who you are, so your Briefing knows what matters to you. Every field is optional, and you can change them later in Settings.')
|
|
192
|
-
+ field('name', 'Your name', 'For example: Dana', 40)
|
|
193
|
-
+ field('role', 'Your role', 'For example: Senior PM, Payments', 80)
|
|
194
|
-
+ field('work', 'What you do', 'In one line, for example: I run checkout and the payment methods', 200)
|
|
195
|
-
+ `<div class="wl-fld"><label class="wl-flabel" for="about-duties">Your job description</label><textarea id="about-duties" data-testid="about-duties" maxlength="1000" rows="5" placeholder="What you own, decide and deliver. Paste it from your job description if you like.">${esc(a.duties)}</textarea></div>`,
|
|
196
|
-
foot('', primary('about-continue', 'Continue', 'about', 'Saving'))];
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function toolRow(x) {
|
|
200
|
-
const st = S.sources[x.source] || {};
|
|
201
|
-
return `<div class="wl-tool" data-testid="source-row" data-id="${esc(x.source)}">${ctl({ check: true, text: x.name, value: S.pick[x.source], attrs: { 'data-testid': 'source-check', 'data-id': x.source, disabled: !!S.busy } })}
|
|
202
|
-
<span class="dim">${esc(x.adds)}</span>${st.error ? `<span class="wl-err" role="alert">${esc(st.error)}</span>` : ''}</div>`;
|
|
203
|
-
}
|
|
204
|
-
function viewSources() {
|
|
205
|
-
const f = S.folder || { name: '', root: '' };
|
|
206
|
-
const n = TOOLS.filter((x) => S.pick[x.source]).length;
|
|
207
|
-
const added = S.added.map((a) => `<li class="nrow" data-testid="added-folder"><span class="ki">${ic('folder')}</span><div class="nb"><span class="tt">${esc(a.name)}</span><div class="chips"><span class="chip2">${esc(a.root)}</span></div></div><span></span></li>`).join('');
|
|
208
|
-
const folders = `<ul class="list" data-testid="added-folders"><li class="nrow"><span class="ki">${ic('folder')}</span><div class="nb"><span class="tt" data-testid="folder-name">${esc(f.name || 'This folder')}</span><div class="chips"><span class="chip2" data-testid="folder-path">${esc(f.root)}</span></div></div><div class="acts"><span class="tag">this folder</span></div></li>${added}</ul>`;
|
|
209
|
-
const addBtn = `<div>${ctl({ variant: 'outline', size: 'sm', lead: S.busy === 'add' ? '' : 'plus', html: S.busy === 'add' ? spin('Waiting for the chooser') : 'Add another folder', attrs: { 'data-testid': 'add-folder', disabled: !!S.busy, ...busyAttrs('add') } })}</div>`;
|
|
210
|
-
return [head('Where does your work live?', 'PMOS reads your folders and the tools you tick, then shows you your initiatives, your documents and what needs you first.')
|
|
211
|
-
+ sub('Folders', 'folder', '', 1 + S.added.length) + folders + addBtn
|
|
212
|
-
+ (S.note ? `<div class="fold" data-testid="note">${esc(S.note)}</div>` : '')
|
|
213
|
-
+ sub('Tools', 'tools') + TOOLS.map(toolRow).join('')
|
|
214
|
-
+ `<p class="dim wl-small" data-testid="promise">${ic('lock', 'sm')} Reads only. Writes nothing in your folders or your tools. PMOS sends nothing out: your agent reads the tools you tick with your own connection.</p>`
|
|
215
|
-
+ (S.busy === 'scan' ? '<p class="dim wl-small" data-testid="scan-wait">A large folder can take a minute or two. The rest of PMOS keeps working.</p>' : ''),
|
|
216
|
-
foot(backBtn(), primary('scan-button', n ? `Scan the folder and read ${plural(n, 'tool', 'tools')}` : 'Scan', 'scan', 'Scanning your folder'))];
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/* A numbered list (the number is drawn in the .ki by a CSS counter), one row per finding or Briefing item. */
|
|
220
|
-
const numbered = (rows) => `<ol class="list wl-num" role="list">${rows}</ol>`;
|
|
221
|
-
function viewLook() {
|
|
222
|
-
const L = S.look || {};
|
|
223
|
-
const found = (L.findings || []).slice(0, 10);
|
|
224
|
-
const rows = found.map((f) => `<li class="nrow" data-testid="finding"><span class="ki"></span><div class="nb"><span class="tt"><b>${esc(f.title)}</b></span>${f.why ? `<div class="dim wl-small">${esc(f.why)}</div>` : ''}<div class="chips">${pathChip(ref((f.evidence || [])[0]), 'data-testid="finding-ref"')}</div></div><span></span></li>`).join('');
|
|
225
|
-
return [head('First look', L.sentence, 'first-look-sentence')
|
|
226
|
-
+ sub('What matters most', 'spark', '', found.length)
|
|
227
|
-
+ (rows ? numbered(rows) : '<div class="fold" data-testid="no-findings">Nothing in this folder needs you urgently.</div>'),
|
|
228
|
-
foot(backBtn(), primary('continue-button', 'Continue', 'structure', 'Building your portfolio'))];
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function rowView(r) {
|
|
232
|
-
const id = r.proposal_id; const docs = r.docs || []; const open = !!S.open[id]; const ed = !!S.edit[id]; const on = !!S.checked[id];
|
|
233
|
-
const t = S.titles[id];
|
|
234
|
-
const opts = S.structure.boards.map((b) => `<option value="${esc(b.key)}" ${b.key === boardOfRow(r) ? 'selected' : ''}>${esc(b.name)}</option>`).join('');
|
|
235
|
-
return `<li class="nrow${on ? '' : ' wl-off'}" data-testid="row" data-id="${esc(id)}"><span class="wl-cb">${ctl({ check: true, text: '', value: on, attrs: { 'data-testid': 'row-check', 'data-id': id, 'aria-label': 'Import ' + t } })}</span>
|
|
236
|
-
<div class="nb"><span class="tt">${esc(t)}</span>
|
|
237
|
-
<div class="chips"><span class="chip2" data-testid="row-lane">${ic('init', 'sm')}${esc(r.lane)}</span><span class="chip2" data-testid="row-anchor">${ic('target', 'sm')}${esc(r.anchor || 'no anchor')}</span><span class="tag" data-testid="row-stage">${esc(r.stage)}</span><button type="button" class="chip2 lk" data-testid="row-docs-toggle" data-id="${esc(id)}" aria-expanded="${open}">${ic('doc', 'sm')}${plural(docs.length, 'document', 'documents')}</button></div>
|
|
238
|
-
${open ? `<ul class="wl-docs" data-testid="row-docs">${docs.map((d) => `<li>${pathChip((d.title && d.title !== d.file ? d.title + ' · ' : '') + d.file)}</li>`).join('')}</ul>` : ''}
|
|
239
|
-
<div class="xp${ed ? ' open' : ''}"><div class="xi"><div class="wl-edit"><div class="wl-fld"><label class="wl-flabel" for="wt-${esc(id)}">Title</label><input type="text" id="wt-${esc(id)}" data-testid="row-title" data-id="${esc(id)}" value="${esc(t)}"></div>
|
|
240
|
-
<div class="wl-fld"><label class="wl-flabel" for="wb-${esc(id)}">Board</label><select id="wb-${esc(id)}" data-testid="row-board" data-id="${esc(id)}">${opts}</select></div></div></div></div></div>
|
|
241
|
-
<div class="acts">${ctl({ variant: 'ghost', size: 'sm', html: ed ? 'Done' : 'Edit', attrs: { 'data-testid': 'row-edit', 'data-id': id, 'aria-expanded': String(ed), disabled: !on } })}</div></li>`;
|
|
242
|
-
}
|
|
243
|
-
const importText = () => { const c = counts(); return `Import ${plural(c.n, 'initiative', 'initiatives')} into ${plural(c.m, 'board', 'boards')}`; };
|
|
244
|
-
const hasQuestions = () => !!(S.structure && (S.structure.questions || []).length);
|
|
245
|
-
function viewPortfolio() {
|
|
246
|
-
const all = rowsOf(); const c = counts();
|
|
247
|
-
const boards = S.structure.boards.map((b) => {
|
|
248
|
-
const mine = all.filter((r) => boardOfRow(r) === b.key);
|
|
249
|
-
return `<div class="wl-board" data-testid="board" data-board="${esc(b.key)}">${sub(`<span data-testid="board-name">${esc(b.name)}</span>`, 'board', `<span class="chip2" data-testid="unsorted-count">${plural((b.unsorted || []).length, 'document', 'documents')} unsorted</span>`)}
|
|
250
|
-
${mine.length ? `<ul class="list">${mine.map(rowView).join('')}</ul>` : '<div class="fold">No initiatives here.</div>'}</div>`;
|
|
251
|
-
}).join('');
|
|
252
|
-
const q = hasQuestions();
|
|
253
|
-
return [head('Your portfolio', 'This is how PMOS would set up your work. Untick what you do not want, rename it, or move it to another board.') + boards
|
|
254
|
-
+ (q && c.n ? `<p class="dim wl-small" data-testid="import-summary">${importText()} after a few questions.</p>` : ''),
|
|
255
|
-
foot(backBtn(), primary('import-button', q ? 'Continue' : importText(), 'apply', 'Importing', !c.n))];
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
function viewQuestions() {
|
|
259
|
-
const qs = (S.structure.questions || []).map((q, n) => {
|
|
260
|
-
const skipped = !!S.skipped[q.id];
|
|
261
|
-
const cur = S.answers[q.id] != null ? S.answers[q.id] : q.default;
|
|
262
|
-
const off = skipped ? 'disabled' : '';
|
|
263
|
-
const val = (o) => (typeof o === 'object' ? o.value : o); const txt = (o) => (typeof o === 'object' ? (o.label || o.value) : o);
|
|
264
|
-
let input;
|
|
265
|
-
if (q.options && q.options.length > 4 && !q.free) input = `<select aria-label="${esc(q.text)}" data-testid="question-select" data-id="${esc(q.id)}" ${off}>${q.options.map((o) => `<option value="${esc(val(o))}" ${String(cur) === String(val(o)) ? 'selected' : ''}>${esc(txt(o))}</option>`).join('')}</select>`;
|
|
266
|
-
else if (q.options && q.options.length) {
|
|
267
|
-
const other = q.options.some((o) => String(val(o)) === String(cur)) ? '' : cur;
|
|
268
|
-
input = `<div role="radiogroup" aria-label="${esc(q.text)}">${q.options.map((o) => `<label class="wl-opt"><input type="radio" name="q-${esc(q.id)}" data-testid="question-option" data-id="${esc(q.id)}" value="${esc(val(o))}" ${String(cur) === String(val(o)) ? 'checked' : ''} ${off}>${esc(txt(o))}</label>`).join('')}
|
|
269
|
-
${q.free ? `<label class="wl-opt">${esc(q.free)} <input type="text" data-testid="question-input" data-id="${esc(q.id)}" placeholder="KR-A1 or health:upkeep" value="${esc(other)}" ${off}></label>` : ''}</div>`;
|
|
270
|
-
} else input = `<input type="text" aria-label="${esc(q.text)}" data-testid="question-input" data-id="${esc(q.id)}" value="${esc(cur)}" ${off}><p class="dim wl-small">Default: ${esc(q.default)}</p>`;
|
|
271
|
-
return `<div class="wl-q" data-testid="question" data-id="${esc(q.id)}">${sub(`Question ${n + 1}`, 'info', ctl({ variant: 'ghost', size: 'sm', html: skipped ? 'Skipped. Use the default' : 'Skip', attrs: { 'data-testid': 'question-skip', 'data-id': q.id, 'aria-pressed': String(skipped), disabled: !!S.busy } }))}
|
|
272
|
-
<b class="wl-qt">${esc(q.text)}</b>${input}</div>`;
|
|
273
|
-
}).join('');
|
|
274
|
-
return [head('A few questions', 'The scan could not decide these. Each has a default, and you can skip any of them.') + qs,
|
|
275
|
-
foot(backBtn(), primary('questions-continue', importText(), 'apply', 'Importing'))];
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
function viewBriefing() {
|
|
279
|
-
const items = S.briefing.map((b) => `<li class="nrow" data-testid="briefing-item"><span class="ki"></span><div class="nb"><span class="tt"><b>${esc(b.title)}</b></span>${b.why ? `<div class="dim wl-small">${esc(b.why)}</div>` : ''}<div class="chips">${b.initiative ? `<span class="chip2" data-testid="briefing-initiative">${esc(b.initiative.title)} · board ${esc(b.initiative.board)}</span>` : ''}${pathChip(ref((b.evidence || [])[0]))}</div></div><span></span></li>`).join('');
|
|
280
|
-
const tools = TOOLS.filter((x) => S.sources[x.source]).map((x) => { const st = S.sources[x.source]; const bad = !st.started;
|
|
281
|
-
return `<li class="nrow" data-testid="source-status" data-id="${esc(x.source)}"><span class="ki${bad ? ' hot' : ''}">${ic(bad ? 'alert' : 'clock')}</span><div class="nb"><span class="tt">${esc(x.name)}</span><div class="dim wl-small${bad ? ' wl-bad' : ''}">${bad ? esc(st.error || '') : `${esc(x.name)} is being read in an agent session. Its items join your Briefing in PMOS when it finishes.`}</div></div><span></span></li>`; });
|
|
282
|
-
return [head('Your first Briefing', S.briefing.length ? 'These need you first.' : 'Nothing needs you right now.')
|
|
283
|
-
+ sub('Briefing', 'sun', '', S.briefing.length)
|
|
284
|
-
+ (items ? numbered(items) : '<div class="fold" data-testid="no-briefing">Your portfolio is in. Open PMOS to see it.</div>')
|
|
285
|
-
+ (tools.length ? sub('Your tools', 'tools', '', tools.length) + `<ul class="list">${tools.join('')}</ul>` : ''),
|
|
286
|
-
foot(ctl({ variant: 'ghost', html: S.busy === 'undo' ? spin('Undoing') : 'Undo this import', attrs: { 'data-testid': 'undo-link', disabled: !!S.busy, ...busyAttrs('undo') } }),
|
|
287
|
-
ctl({ variant: 'primary', html: 'Open PMOS', href: '/?ws=' + encodeURIComponent(S.ws), attrs: { class: 'wl-primary', 'data-testid': 'open-pmos' } }))];
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
const VIEWS = { welcome: viewWelcome, look: viewLook, portfolio: viewPortfolio, questions: viewQuestions, briefing: viewBriefing, sources: viewSources };
|
|
291
|
-
const shownSteps = () => STEPS.filter(([k]) => k !== 'questions' || S.step === 'questions' || hasQuestions());
|
|
292
|
-
|
|
293
|
-
/* The frame: PMOS, the step count and Not now (About you) or Skip setup (until the import); a progress bar and the step names
|
|
294
|
-
* (a done step goes back to that step, except once the import is made: Undo is the way back then); one step card. */
|
|
295
|
-
function frame(body, footer) {
|
|
296
|
-
const l = shownSteps(); const at = Math.max(0, l.findIndex(([k]) => k === S.step));
|
|
297
|
-
const back = S.step !== 'briefing';
|
|
298
|
-
const steps = l.map(([k, t], n) => `<li><button type="button" class="wl-stepbtn${n < at ? ' wl-done' : ''}" data-testid="step" data-step="${k}" ${n === at ? 'aria-current="step"' : ''} ${n < at && back && !S.busy ? '' : 'disabled'}>${n < at ? ic('check', 'sm') : ''}${esc(t)}</button></li>`).join('');
|
|
299
|
-
const skip = S.step === 'briefing' ? '' : S.step === 'welcome' ? ghost('not-now', 'Not now') : ghost('skip-setup', 'Skip setup');
|
|
300
|
-
return `<div class="wl-top"><div><h1>PMOS</h1><div class="wl-sub" data-testid="step-count">Set up · step ${at + 1} of ${l.length}</div></div><div class="wl-tools">${skip}</div></div>
|
|
301
|
-
<div class="wl-col"><nav class="wl-prog" aria-label="Setup steps"><div class="pbar" aria-hidden="true"><i class="wl-fill"></i></div><ol class="wl-steps" data-testid="steps">${steps}</ol></nav>
|
|
302
|
-
${S.error ? `<div class="fold wl-e" role="alert" data-testid="error">${ic('alert', 'sm')}${esc(S.error)}</div>` : ''}
|
|
303
|
-
<section class="card sect wl-card">${body}${footer}</section></div>`;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
function render() {
|
|
307
|
-
const keepScroll = window.scrollY;
|
|
308
|
-
const a = document.activeElement;
|
|
309
|
-
const was = a && root.contains(a) ? [a.getAttribute('data-testid'), a.getAttribute('data-id')] : null;
|
|
310
|
-
root.setAttribute('data-step', S.step);
|
|
311
|
-
CTL = [];
|
|
312
|
-
const [body, footer] = VIEWS[S.step]();
|
|
313
|
-
root.innerHTML = frame(body, footer);
|
|
314
|
-
mountControls();
|
|
315
|
-
const l = shownSteps(); const at = Math.max(0, l.findIndex(([k]) => k === S.step));
|
|
316
|
-
const fill = root.querySelector('.wl-fill'); if (fill) fill.style.setProperty('--wl-prog', Math.round(((at + 1) / l.length) * 100) + '%');
|
|
317
|
-
window.scrollTo(0, keepScroll);
|
|
318
|
-
if (was && was[0]) { // keep the keyboard where it was after a re-render
|
|
319
|
-
const again = [...root.querySelectorAll('[data-testid="' + was[0] + '"]')].find((el) => (el.getAttribute('data-id') || null) === (was[1] || null));
|
|
320
|
-
if (again && !again.disabled) again.focus();
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/* ── events (one delegate; the markup is rebuilt on each render) ─────────────────────────────────────────────────── */
|
|
325
|
-
const idOf = (el) => el.getAttribute('data-id');
|
|
326
|
-
document.addEventListener('click', (e) => {
|
|
327
|
-
if (!root.contains(e.target)) return;
|
|
328
|
-
const t = e.target.closest('[data-testid]'); if (!t) return;
|
|
329
|
-
const k = t.getAttribute('data-testid');
|
|
330
|
-
if (k === 'add-folder') addFolder();
|
|
331
|
-
else if (k === 'scan-button') scan();
|
|
332
|
-
else if (k === 'continue-button') toPortfolio();
|
|
333
|
-
else if (k === 'import-button' || k === 'questions-continue') { if (k === 'questions-continue') run('apply', applyNow); else importNow(); }
|
|
334
|
-
else if (k === 'undo-link') undo();
|
|
335
|
-
else if (k === 'about-continue') saveAbout();
|
|
336
|
-
else if (k === 'back-button') { const l = shownSteps().map(([s]) => s); S.step = l[l.indexOf(S.step) - 1] || 'welcome'; S.error = ''; render(); }
|
|
337
|
-
else if (k === 'step') { if (!t.disabled) { S.step = t.getAttribute('data-step'); S.error = ''; render(); } }
|
|
338
|
-
else if (k === 'not-now' || k === 'skip-setup') notNow();
|
|
339
|
-
else if (k === 'row-edit') { S.edit[idOf(t)] = !S.edit[idOf(t)]; render(); }
|
|
340
|
-
else if (k === 'row-docs-toggle') { S.open[idOf(t)] = !S.open[idOf(t)]; render(); }
|
|
341
|
-
else if (k === 'question-skip') { const id = idOf(t); S.skipped[id] = !S.skipped[id]; render(); }
|
|
342
|
-
});
|
|
343
|
-
root.addEventListener('change', (e) => {
|
|
344
|
-
const t = e.target; const k = t.getAttribute && t.getAttribute('data-testid');
|
|
345
|
-
if (k === 'row-check') { S.checked[idOf(t)] = t.checked; if (!t.checked) S.edit[idOf(t)] = false; render(); }
|
|
346
|
-
else if (k === 'row-title') render();
|
|
347
|
-
else if (k === 'source-check') { S.pick[idOf(t)] = t.checked; render(); }
|
|
348
|
-
else if (k === 'row-board') { S.boardOf[idOf(t)] = t.value; render(); }
|
|
349
|
-
else if (k === 'question-option' || k === 'question-select') S.answers[idOf(t)] = t.value;
|
|
350
|
-
});
|
|
351
|
-
root.addEventListener('input', (e) => {
|
|
352
|
-
const t = e.target; const k = t.getAttribute && t.getAttribute('data-testid');
|
|
353
|
-
if (k === 'row-title') S.titles[idOf(t)] = t.value;
|
|
354
|
-
else if (k && k.startsWith('about-')) S.about[k.slice(6)] = t.value;
|
|
355
|
-
else if (k === 'question-input') {
|
|
356
|
-
const id = idOf(t); const q = ((S.structure && S.structure.questions) || []).find((x) => x.id === id);
|
|
357
|
-
S.answers[id] = t.value.trim() ? t.value : (q ? q.default : t.value); // an emptied free answer goes back to the default
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
/* ── start ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
362
|
-
/* The console3 look: its stylesheet and icon sprite, the PM's console theme, and the time-of-day tint on the page root. */
|
|
363
|
-
function look() {
|
|
364
|
-
ensureC3Css();
|
|
365
|
-
const page = document.getElementById('wl-c3');
|
|
366
|
-
let theme = params.get('theme');
|
|
367
|
-
try { theme = theme || localStorage.getItem('pmos.c3.theme'); } catch { /* no storage */ }
|
|
368
|
-
theme = theme === 'dark' ? 'dark' : 'light';
|
|
369
|
-
document.documentElement.setAttribute('data-pm-page-theme', theme);
|
|
370
|
-
if (page) { page.setAttribute('data-pm-theme', theme); applyDayPart(page); setInterval(() => applyDayPart(page), 5 * 60 * 1000); }
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
async function start() {
|
|
374
|
-
look();
|
|
375
|
-
render();
|
|
376
|
-
const list = await pmGet('/api/workspaces');
|
|
377
|
-
const all = (list && list.workspaces) || [];
|
|
378
|
-
const mine = all.find((w) => w.id === S.ws) || (!S.ws ? all[0] : null);
|
|
379
|
-
if (!mine) { S.error = 'This folder is not open in PMOS. Start pmos in the folder, then reload.'; render(); return; }
|
|
380
|
-
S.ws = mine.id; S.folder = { name: mine.name, root: mine.root };
|
|
381
|
-
const ps = await pmGet('/api/proactive/settings');
|
|
382
|
-
if (ps && ps.ok && ps.settings) { const ab = ps.settings.about || {}; S.about = { name: ps.settings.name || '', role: ab.role || '', work: ab.work || '', duties: ab.duties || '' }; }
|
|
383
|
-
const st = await pmGet(`/api/onboarding/status?ws=${encodeURIComponent(S.ws)}`);
|
|
384
|
-
if (st && st.ok && st.state === 'imported') {
|
|
385
|
-
const live = (st.imports || []).filter((i) => !i.retracted).pop();
|
|
386
|
-
S.importId = live ? live.import_id : '';
|
|
387
|
-
if (S.importId && await loadBriefing() && await loadStructure()) S.step = 'briefing';
|
|
388
|
-
}
|
|
389
|
-
render();
|
|
390
|
-
}
|
|
391
|
-
start();
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/* pm/work-place.js — the Work page's placement rule, as the client needs it (initiative console3-work-page, PRD R2, R5, R7).
|
|
2
|
-
*
|
|
3
|
-
* The SERVER places every item (lib/pm-items.js workPlacement) and answers GET /api/pm-items with `work`, `review` and `counts`.
|
|
4
|
-
* The client never copies an item from one view to another. It uses this copy of the rule for two things only:
|
|
5
|
-
* 1. the capture line's preview chip, which says where a new line lands before it is saved;
|
|
6
|
-
* 2. demo mode (/c3.html?demo=1), where nothing reaches the server, so the fixture and the in-memory overlay are placed here.
|
|
7
|
-
* The rule, in order: parked is Someday; waiting on someone is Waiting; a "not before" (defer) date after today is Upcoming;
|
|
8
|
-
* flagged is Today; due today or earlier is Today; a later due date is Upcoming; no date is Inbox. Dates are YYYY-MM-DD strings.
|
|
9
|
-
* Pure: no DOM, no fetch. */
|
|
10
|
-
import { rank } from './priority-model.js';
|
|
11
|
-
|
|
12
|
-
export const VIEWS = Object.freeze(['inbox', 'today', 'upcoming', 'waiting', 'someday']);
|
|
13
|
-
export const REVIEW_DAYS = 7;
|
|
14
|
-
|
|
15
|
-
const day = (s) => (s ? String(s).slice(0, 10) : '');
|
|
16
|
-
export function addIso(s, n) { const d = new Date(day(s) + 'T00:00:00Z'); d.setUTCDate(d.getUTCDate() + n); return d.toISOString().slice(0, 10); }
|
|
17
|
-
export function daysBetween(a, b) { return Math.round((Date.parse(day(b) + 'T00:00:00Z') - Date.parse(day(a) + 'T00:00:00Z')) / 86400000); }
|
|
18
|
-
|
|
19
|
-
/** The view an open item belongs in. */
|
|
20
|
-
export function workPlace(item, today) {
|
|
21
|
-
const i = item || {};
|
|
22
|
-
if (i.parked) return 'someday';
|
|
23
|
-
if (i.waiting_on) return 'waiting';
|
|
24
|
-
if (i.defer && day(i.defer) > today) return 'upcoming';
|
|
25
|
-
if (i.flagged) return 'today';
|
|
26
|
-
if (i.due && day(i.due) <= today) return 'today';
|
|
27
|
-
if (i.due) return 'upcoming';
|
|
28
|
-
return 'inbox';
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** The day an Upcoming item arrives: its "not before" date when that is still ahead, else its due date. */
|
|
32
|
-
export function arrives(item, today) { return item.defer && day(item.defer) > today ? day(item.defer) : day(item.due); }
|
|
33
|
-
|
|
34
|
-
/** The days since the item was last touched (any event), from touched_at, else created_at. */
|
|
35
|
-
export function untouchedDays(item, today) { const t = day(item.touched_at || item.created_at); return t ? daysBetween(t, today) : 0; }
|
|
36
|
-
|
|
37
|
-
const byStr = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
38
|
-
/** Each view in the order the PRD's contract gives: Today overdue first, then flagged, then by due; Upcoming by arrival; Inbox newest first. */
|
|
39
|
-
export function sortView(view, list, today) {
|
|
40
|
-
const l = list.slice();
|
|
41
|
-
if (view === 'today') {
|
|
42
|
-
/* the one ranking (priority-model.js), the same as Needs you: an item the PM can act on today, by its lateness, priority, flag and kind.
|
|
43
|
-
* Ties keep the old order: due date, then time. */
|
|
44
|
-
const old = l.slice().sort((a, b) => byStr(day(a.due) || '9999', day(b.due) || '9999') || byStr(String(a.time || ''), String(b.time || '')));
|
|
45
|
-
const rows = old.map((i, n) => {
|
|
46
|
-
const late = i.due && day(i.due) <= today ? daysBetween(day(i.due), today) : null;
|
|
47
|
-
const offline = i.kind === 'offline';
|
|
48
|
-
return { key: String(n), title: i.title || '', source: 'work', kind: i.kind || '', person: i.person || null, days_late: late, age_days: late, priority: /^P[1-3]$/.test(String(i.priority || '')) ? i.priority : null,
|
|
49
|
-
flagged: !!i.flagged, promise: offline && !!i.person, effort_hint: offline ? 'offline' : 'plain' };
|
|
50
|
-
});
|
|
51
|
-
const r = rank(rows);
|
|
52
|
-
return [...r.first, ...r.rest].map((x) => old[Number(x.key)]);
|
|
53
|
-
} else if (view === 'upcoming') l.sort((a, b) => byStr(arrives(a, today), arrives(b, today)));
|
|
54
|
-
else if (view === 'inbox') l.sort((a, b) => byStr(String(b.created_at || ''), String(a.created_at || '')));
|
|
55
|
-
return l;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** { work, review, counts } for a set of items (done ones are left out), as the server's answer has them. */
|
|
59
|
-
export function buildWork(items, today, reviewDays = REVIEW_DAYS) {
|
|
60
|
-
const work = Object.fromEntries(VIEWS.map((v) => [v, []]));
|
|
61
|
-
const open = (items || []).filter((i) => i && !i.done);
|
|
62
|
-
open.forEach((i) => work[workPlace(i, today)].push(i));
|
|
63
|
-
VIEWS.forEach((v) => { work[v] = sortView(v, work[v], today); });
|
|
64
|
-
const review = open.filter((i) => ['inbox', 'someday', 'waiting'].includes(workPlace(i, today)) && untouchedDays(i, today) >= reviewDays)
|
|
65
|
-
.sort((a, b) => untouchedDays(b, today) - untouchedDays(a, today));
|
|
66
|
-
const counts = { ...Object.fromEntries(VIEWS.map((v) => [v, work[v].length])), review: review.length };
|
|
67
|
-
return { work, review, counts };
|
|
68
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/* xlsx-read.js — a minimal, READ-ONLY .xlsx reader for the doc tab (overhaul-r3 P10).
|
|
2
|
-
*
|
|
3
|
-
* An .xlsx is a zip of XML parts. The browser already has both halves of a reader: the zip's
|
|
4
|
-
* entries are raw-deflate streams, which `DecompressionStream('deflate-raw')` inflates, and the
|
|
5
|
-
* parts are XML, which `DOMParser` parses. So this file adds no dependency (the npm `xlsx` build
|
|
6
|
-
* carries open advisories and the fixed builds are not published to npm), fetches nothing, and
|
|
7
|
-
* executes nothing from the file: cell values are read as text and rendered as text.
|
|
8
|
-
*
|
|
9
|
-
* Scope, stated: values only — shared strings, inline strings, numbers, booleans and error codes.
|
|
10
|
-
* Formulas show their cached value. Dates are serial numbers (formatting is not interpreted). A
|
|
11
|
-
* part that is missing or malformed throws with the part's name, and the tab says so.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
const td = new TextDecoder();
|
|
15
|
-
|
|
16
|
-
async function inflateRaw(bytes) {
|
|
17
|
-
const ds = new DecompressionStream('deflate-raw');
|
|
18
|
-
const out = new Response(new Blob([bytes]).stream().pipeThrough(ds));
|
|
19
|
-
return new Uint8Array(await out.arrayBuffer());
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** name → Uint8Array, for the entries we ask for, from the zip's central directory. */
|
|
23
|
-
async function unzip(buf, want) {
|
|
24
|
-
const u8 = new Uint8Array(buf);
|
|
25
|
-
const dv = new DataView(buf);
|
|
26
|
-
let eocd = -1;
|
|
27
|
-
for (let i = u8.length - 22; i >= Math.max(0, u8.length - 65557); i--) {
|
|
28
|
-
if (dv.getUint32(i, true) === 0x06054b50) { eocd = i; break; }
|
|
29
|
-
}
|
|
30
|
-
if (eocd < 0) throw new Error('not a zip file (no end-of-central-directory record)');
|
|
31
|
-
const count = dv.getUint16(eocd + 10, true);
|
|
32
|
-
let p = dv.getUint32(eocd + 16, true);
|
|
33
|
-
const out = {};
|
|
34
|
-
for (let n = 0; n < count; n++) {
|
|
35
|
-
if (dv.getUint32(p, true) !== 0x02014b50) throw new Error('corrupt zip central directory');
|
|
36
|
-
const method = dv.getUint16(p + 10, true);
|
|
37
|
-
const csize = dv.getUint32(p + 20, true);
|
|
38
|
-
const nlen = dv.getUint16(p + 28, true);
|
|
39
|
-
const xlen = dv.getUint16(p + 30, true);
|
|
40
|
-
const clen = dv.getUint16(p + 32, true);
|
|
41
|
-
const local = dv.getUint32(p + 42, true);
|
|
42
|
-
const name = td.decode(u8.subarray(p + 46, p + 46 + nlen));
|
|
43
|
-
p += 46 + nlen + xlen + clen;
|
|
44
|
-
if (!want(name)) continue;
|
|
45
|
-
const lnlen = dv.getUint16(local + 26, true);
|
|
46
|
-
const lxlen = dv.getUint16(local + 28, true);
|
|
47
|
-
const start = local + 30 + lnlen + lxlen;
|
|
48
|
-
const data = u8.subarray(start, start + csize);
|
|
49
|
-
if (method === 0) out[name] = data;
|
|
50
|
-
else if (method === 8) out[name] = await inflateRaw(data);
|
|
51
|
-
else throw new Error(`${name}: unsupported zip compression method ${method}`);
|
|
52
|
-
}
|
|
53
|
-
return out;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const xml = (bytes, part) => {
|
|
57
|
-
const doc = new DOMParser().parseFromString(td.decode(bytes), 'application/xml');
|
|
58
|
-
if (doc.getElementsByTagName('parsererror').length) throw new Error(`${part}: malformed XML`);
|
|
59
|
-
return doc;
|
|
60
|
-
};
|
|
61
|
-
const byTag = (node, tag) => Array.from(node.getElementsByTagNameNS('*', tag));
|
|
62
|
-
const colIndex = (ref) => {
|
|
63
|
-
let n = 0;
|
|
64
|
-
for (const ch of String(ref).replace(/\d+$/, '')) n = n * 26 + (ch.charCodeAt(0) - 64);
|
|
65
|
-
return n - 1;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Read a workbook. Returns `{ sheets: [{ name, rows: string[][], truncated }] }`, at most `cap` rows
|
|
70
|
-
* per sheet (the cap is reported, never applied silently).
|
|
71
|
-
*/
|
|
72
|
-
export async function readXlsx(buf, cap = 2000) {
|
|
73
|
-
const parts = await unzip(buf, (n) => n === 'xl/workbook.xml' || n === 'xl/sharedStrings.xml'
|
|
74
|
-
|| n === 'xl/_rels/workbook.xml.rels' || /^xl\/worksheets\/[^/]+\.xml$/.test(n));
|
|
75
|
-
if (!parts['xl/workbook.xml']) throw new Error('xl/workbook.xml missing — not a spreadsheet');
|
|
76
|
-
const shared = parts['xl/sharedStrings.xml']
|
|
77
|
-
? byTag(xml(parts['xl/sharedStrings.xml'], 'sharedStrings.xml'), 'si').map((si) => byTag(si, 't').map((t) => t.textContent).join(''))
|
|
78
|
-
: [];
|
|
79
|
-
const rels = {};
|
|
80
|
-
if (parts['xl/_rels/workbook.xml.rels']) {
|
|
81
|
-
for (const r of byTag(xml(parts['xl/_rels/workbook.xml.rels'], 'workbook.xml.rels'), 'Relationship')) {
|
|
82
|
-
rels[r.getAttribute('Id')] = r.getAttribute('Target');
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
const sheets = [];
|
|
86
|
-
const wb = xml(parts['xl/workbook.xml'], 'workbook.xml');
|
|
87
|
-
byTag(wb, 'sheet').forEach((s, i) => {
|
|
88
|
-
// the relationship id is `r:id`; matched by local name so no namespace URI is needed here
|
|
89
|
-
const rid = s.getAttribute('r:id') || (Array.from(s.attributes).find((at) => at.localName === 'id' && at.prefix) || {}).value;
|
|
90
|
-
let target = rels[rid] || `worksheets/sheet${i + 1}.xml`;
|
|
91
|
-
target = 'xl/' + target.replace(/^\/?xl\//, '').replace(/^\//, '');
|
|
92
|
-
const bytes = parts[target];
|
|
93
|
-
if (!bytes) { sheets.push({ name: s.getAttribute('name') || `Sheet${i + 1}`, rows: [], truncated: false, error: `${target} missing` }); return; }
|
|
94
|
-
const doc = xml(bytes, target);
|
|
95
|
-
const rows = [];
|
|
96
|
-
let truncated = false;
|
|
97
|
-
for (const row of byTag(doc, 'row')) {
|
|
98
|
-
if (rows.length >= cap) { truncated = true; break; }
|
|
99
|
-
const cells = [];
|
|
100
|
-
for (const c of byTag(row, 'c')) {
|
|
101
|
-
const idx = c.getAttribute('r') ? colIndex(c.getAttribute('r')) : cells.length;
|
|
102
|
-
const t = c.getAttribute('t');
|
|
103
|
-
const v = byTag(c, 'v')[0];
|
|
104
|
-
let val = '';
|
|
105
|
-
if (t === 's') val = shared[parseInt(v && v.textContent, 10)] ?? '';
|
|
106
|
-
else if (t === 'inlineStr') val = byTag(c, 't').map((x) => x.textContent).join('');
|
|
107
|
-
else if (t === 'b') val = v && v.textContent === '1' ? 'TRUE' : 'FALSE';
|
|
108
|
-
else val = v ? v.textContent : '';
|
|
109
|
-
while (cells.length < idx) cells.push('');
|
|
110
|
-
cells[idx] = val;
|
|
111
|
-
}
|
|
112
|
-
rows.push(cells);
|
|
113
|
-
}
|
|
114
|
-
sheets.push({ name: s.getAttribute('name') || `Sheet${i + 1}`, rows, truncated });
|
|
115
|
-
});
|
|
116
|
-
return { sheets };
|
|
117
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en" class="wl-html" data-pm-page-theme="light">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
6
|
-
<meta name="pmos-nonce" content="" />
|
|
7
|
-
<title>Welcome to PMOS</title>
|
|
8
|
-
<!-- The first-run page. The server fills the nonce meta the way it does for /c3.html, so a press (Scan, Import, Undo)
|
|
9
|
-
carries it. Tokens and fonts are the console's, so light and dark both resolve. The page does not load the console:
|
|
10
|
-
pm/welcome.js links console3.css and its icon sprite and draws inside the same .c3 .c3pg root as /c3.html. -->
|
|
11
|
-
<link rel="preload" href="/vendor/ibm-plex-mono-400.woff2" as="font" type="font/woff2" crossorigin />
|
|
12
|
-
<link rel="preload" href="/vendor/ibm-plex-mono-500.woff2" as="font" type="font/woff2" crossorigin />
|
|
13
|
-
<link rel="stylesheet" href="/pm/tokens.css" />
|
|
14
|
-
<link rel="stylesheet" href="/pm/components.css" />
|
|
15
|
-
|
|
16
|
-
</head>
|
|
17
|
-
<body class="wl-body">
|
|
18
|
-
<div id="wl-c3" class="wl-page c3 c3pg" data-pm-theme="light"><main id="wl-root" class="wl-welcome" data-testid="welcome-root"></main></div>
|
|
19
|
-
<noscript><p class="wl-noscript">This page needs JavaScript.</p></noscript>
|
|
20
|
-
<script type="module" src="/pm/welcome.js"></script>
|
|
21
|
-
</body>
|
|
22
|
-
</html>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_comment": "Initiative browser-suites-green: the one-home check of the console3 feedback plan (section 2). Known duplicates are listed in fixtures/one-home-baseline.json until the Phase 2 restructure.",
|
|
3
|
-
"panels": ["c3-one-home-test.js"],
|
|
4
|
-
"seconds": { "c3-one-home-test.js": 30 }
|
|
5
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_comment": "c3-core-docs: the core documents of each level (Portfolio Documents, a board's Docs tab, an initiative's Docs tab), Draft it, Review the draft, Issue it, the Briefing row and 400 px, in demo mode (browser).",
|
|
3
|
-
"panels": [
|
|
4
|
-
"c3-core-docs-test.js"
|
|
5
|
-
],
|
|
6
|
-
"seconds": {
|
|
7
|
-
"c3-core-docs-test.js": 40
|
|
8
|
-
}
|
|
9
|
-
}
|