create-pmos 0.399.0 → 0.401.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 +2 -2
- package/workspace/briefing-premium-board-test.js +3 -3
- package/workspace/briefing-premium-doc-edit-test.js +2 -8
- package/workspace/briefing-premium-sources-test.js +2 -0
- package/workspace/briefing-premium-test.js +6 -2
- package/workspace/briefing-premium-work-test.js +9 -4
- package/workspace/c3-capture-test.js +0 -17
- package/workspace/changelog.json +29 -0
- package/workspace/guide/briefing-premium.md +2 -2
- package/workspace/guide/home.md +24 -3
- 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/core-docs.js +2 -2
- 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 +8 -3
- package/workspace/premium-vw-cal-test.js +4 -1
- 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 +21 -6
- package/workspace/public/pm/cozy-today.css +4 -3
- 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 +65 -33
- package/workspace/public/pm/home-chat.js +34 -29
- package/workspace/public/pm/home-data.js +10 -2
- package/workspace/public/pm/home-dictate.js +7 -4
- package/workspace/public/pm/home-ini.js +13 -3
- package/workspace/public/pm/home-list.js +18 -10
- 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 +11 -8
- package/workspace/public/pm/home-work.js +13 -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/premium-vw-item.css +6 -0
- 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 +4 -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,983 +0,0 @@
|
|
|
1
|
-
/* pm/c3-focus.js — the Meeting focus page of console3 (initiative c3-meeting-focus; the mockup the PM approved on 2026-10-12, version 7).
|
|
2
|
-
* openFocus({ event, date, pop, back, phone, note, meet, mtitle }) closeFocus()
|
|
3
|
-
* One calm full-screen page over console3, inside #c3-root: it covers the header, the tabs and the dock (they stay in the DOM, set inert) and Leave
|
|
4
|
-
* focus gives them back. Recording is not touched by leaving. It reads GET /api/meeting-focus every 3 seconds while it is open:
|
|
5
|
-
* header title, time, people, initiative; the clock (starts in, or elapsed and left); REC with Start recording or End meeting (the note dock);
|
|
6
|
-
* a thin bar of the stretches of talk, numbered by topic
|
|
7
|
-
* now line the topic the room is on, how long, change; buttons Topics, Captured and Note (side sheets)
|
|
8
|
-
* being said one sentence on the talk and up to four context chips
|
|
9
|
-
* stage the meeting's material as a card with Open (and Present for Slides); a Google Slides or Docs preview loads only on a press; before the start, what is prepared
|
|
10
|
-
* conversation the room's last two lines as a faint ticker; PMOS notes below it (only the newest is open); the ones PMOS holds; Ask PMOS quietly
|
|
11
|
-
* Nothing is invented: with the companion off, or before it has answered, the panel shows the ticker and a quiet line. Nothing is sent anywhere.
|
|
12
|
-
* In demo mode (?demo=1) c3-demo-focus.js answers the reads with the mockup's Partner API review.
|
|
13
|
-
* Compact mode (?pop=1, initiative c3-meet-extension): the page the Chrome extension frames over a Google Meet call. Only a head (PMOS, the topic or "Starts in",
|
|
14
|
-
* the time left, a fold button), What's being said, the conversation and a foot (Open focus in PMOS, only you see this). The stage, the bar of the talk, the now line and
|
|
15
|
-
* the captured items are not drawn, and there is no Leave focus. With back (the phone companion opens it so) the head and the foot have
|
|
16
|
-
* "Back to your day" in place of Open focus in PMOS, which closes the page as Leave focus does. ?focus=now first asks GET /api/meeting-focus/now (meet = the Meet code, mtitle = the tab's title) which
|
|
17
|
-
* meeting the call is; when none fits, the page says so and lists today's meetings to pick from. Fold shows the head only and tells the frame's parent with one
|
|
18
|
-
* message, { pmosFocus: 'fold' | 'open' }, that carries no data.
|
|
19
|
-
* Phone mode (phone, initiative c3-phone-companion, mockup version 5): the phone companion opens this page when a recording starts. It is the full
|
|
20
|
-
* page in one column: a head with "Back to your day" (recording goes on), the title, the clock and the bar of the talk; the now line; chips that open
|
|
21
|
-
* sheets (Topics, Captured, Note, and Your slides or Material for the stage); What's being said; the conversation; and a foot with Ask PMOS quietly
|
|
22
|
-
* and Stop. Nothing on it leads to the desktop pages. A recording that is not on the calendar (a talk in the corridor) opens with note and no
|
|
23
|
-
* event: GET /api/meeting-focus?note= answers it with no topics, no brief and no stage. The address is not changed. */
|
|
24
|
-
import { el } from './dom.js';
|
|
25
|
-
import { pmGet, pmPost } from './http.js';
|
|
26
|
-
import { ensureC3Css } from './pm-work-view.js';
|
|
27
|
-
import { ensureComponentsCss, button } from './primitives.js';
|
|
28
|
-
import { icon, sect, pbtn, lk, ib, put } from './c3-ini-ui.js';
|
|
29
|
-
import { openSheet, closeSheet } from './c3-sheet.js';
|
|
30
|
-
import { toast } from './c3-toast.js';
|
|
31
|
-
import * as Shots from './notes-shots.js';
|
|
32
|
-
import { openAddMaterial, openItem, presentItem, audienceItem, pmosUrl } from './c3-material.js'; // the PM's own material (initiative meeting-material-replay)
|
|
33
|
-
|
|
34
|
-
const POLL_MS = 3000;
|
|
35
|
-
const LAST_MINUTES = 5; // the last minutes of the meeting: the captured items show under the stage
|
|
36
|
-
const pad = (n) => String(n).padStart(2, '0');
|
|
37
|
-
/** The local day of a start: a note keeps its meeting's start in UTC, and its first ten characters can be the day before. */
|
|
38
|
-
const localDayOf = (t) => { const ms = Date.parse(t); if (!Number.isFinite(ms)) return ''; const d = new Date(ms); return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`; };
|
|
39
|
-
const hhmm = (ms) => { const d = new Date(ms); return pad(d.getHours()) + ':' + pad(d.getMinutes()); };
|
|
40
|
-
export const baseId = (id) => String(id || '').split('@')[0];
|
|
41
|
-
/** 3:07, or 1:03:07 from an hour on; a minus sign before a negative time. Pure. */
|
|
42
|
-
export function clockText(sec) {
|
|
43
|
-
const neg = sec < 0; const s = Math.abs(Math.round(sec));
|
|
44
|
-
const h = Math.floor(s / 3600); const m = Math.floor((s % 3600) / 60); const x = s % 60;
|
|
45
|
-
return (neg ? '-' : '') + (h ? h + ':' + pad(m) : String(m)) + ':' + pad(x);
|
|
46
|
-
}
|
|
47
|
-
/** What a link is, and how the page shows it: every link is a card; a Google Slides or Docs link also has a /preview address that the page loads only when the PM presses Show the preview here (no-network: the page reaches nothing by itself). Pure. */
|
|
48
|
-
const PMOS_APP = { 'pmos-deck': 'PMOS deck', 'pmos-doc': 'PMOS document', report: 'PMOS report' };
|
|
49
|
-
export function classify(url) {
|
|
50
|
-
const raw = String(url || '').trim();
|
|
51
|
-
// an item PMOS itself holds (a deck, a document, a report cycle): pmos:<kind>:<workspace>:<path>. It opens in PMOS, not in a tab.
|
|
52
|
-
const pm = /^pmos:(pmos-deck|pmos-doc|report):([^:]*):(.+)$/.exec(raw);
|
|
53
|
-
if (pm) return { kind: 'pmos', pk: pm[1], app: PMOS_APP[pm[1]], url: raw, host: 'PMOS', ref: pm[3] };
|
|
54
|
-
// A link pasted without its scheme (docs.google.com/…) is a web link.
|
|
55
|
-
let u; try { u = new URL(/^[a-z][a-z0-9+.-]*:/i.test(raw) ? raw : 'https://' + raw); } catch { return { kind: 'link', app: 'Link', url: String(url), host: '' }; }
|
|
56
|
-
const m = /^\/(presentation|document)\/d\/([A-Za-z0-9_-]+)/.exec(u.pathname);
|
|
57
|
-
if (u.protocol === 'https:' && u.hostname === 'docs.google.com' && m) {
|
|
58
|
-
const base = u.origin + '/' + m[1] + '/d/' + m[2];
|
|
59
|
-
return m[1] === 'presentation' ? { kind: 'slides', app: 'Google Slides', url: u.href, host: u.hostname, preview: base + '/preview', present: base + '/present' }
|
|
60
|
-
: { kind: 'docs', app: 'Google Docs', url: u.href, host: u.hostname, preview: base + '/preview' };
|
|
61
|
-
}
|
|
62
|
-
if (/\.atlassian\.net$/.test(u.hostname) && u.pathname.startsWith('/wiki')) return { kind: 'confluence', app: 'Confluence', url: u.href, host: u.hostname };
|
|
63
|
-
return { kind: 'link', app: u.hostname || 'Link', url: u.href, host: u.hostname };
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let F = null; // the open page: { id, date, root, r (regions), sig, data, offset, ui, timers, sheet, ... }
|
|
67
|
-
|
|
68
|
-
function ensureCss() {
|
|
69
|
-
ensureC3Css(); ensureComponentsCss(); Shots.ensureListenCss();
|
|
70
|
-
if (document.querySelector('link[data-c3-focus]')) return;
|
|
71
|
-
const l = document.createElement('link');
|
|
72
|
-
l.rel = 'stylesheet'; l.href = new URL('./c3-focus.css', import.meta.url).href; l.setAttribute('data-c3-focus', '');
|
|
73
|
-
document.head.appendChild(l);
|
|
74
|
-
}
|
|
75
|
-
const isDemo = () => !!document.querySelector('[data-c3-demo]');
|
|
76
|
-
const wsParam = () => { try { return new URLSearchParams(location.search).get('ws') || ''; } catch { return ''; } };
|
|
77
|
-
const nowMs = () => Date.now() + (F ? F.offset : 0);
|
|
78
|
-
const startMs = () => (F && F.data ? Date.parse(F.data.event.at) : NaN);
|
|
79
|
-
const endMs = () => (F && F.data && F.data.event.end ? Date.parse(F.data.event.end) : NaN);
|
|
80
|
-
|
|
81
|
-
/* ── open and close ───────────────────────────────────────────────────────────────────────────────────────────── */
|
|
82
|
-
|
|
83
|
-
export function closeFocus() {
|
|
84
|
-
if (!F) return;
|
|
85
|
-
const f = F; F = null;
|
|
86
|
-
for (const t of Object.values(f.timers)) { clearTimeout(t); clearInterval(t); }
|
|
87
|
-
for (const t of f.askTimers.values()) clearInterval(t);
|
|
88
|
-
if (f.sheetOpen) closeSheet();
|
|
89
|
-
f.root.remove();
|
|
90
|
-
const host = document.getElementById('c3-root');
|
|
91
|
-
if (host) host.classList.remove('fc-open');
|
|
92
|
-
const grid = host && host.querySelector('.c3grid'); if (grid) grid.inert = false;
|
|
93
|
-
const comp = host && host.querySelector('[data-c3ph]'); if (comp) comp.inert = false;
|
|
94
|
-
if (f.phone) { const st = f.phone && document.querySelector('[data-c3ph-focus-bar]'); if (st) st.focus({ preventScroll: true }); return; }
|
|
95
|
-
try { const u = new URL(location.href); if (u.searchParams.has('focus')) { u.searchParams.delete('focus'); u.searchParams.delete('fdate'); u.searchParams.delete('fat'); u.searchParams.delete('ftitle'); history.replaceState(history.state, '', u); } } catch { /* no history */ }
|
|
96
|
-
if (f.opener && document.contains(f.opener) && typeof f.opener.focus === 'function') { try { f.opener.focus({ preventScroll: true }); } catch { /* not focusable any more */ } }
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export function openFocus({ event, date, pop, back, phone, note, meet, mtitle } = {}) {
|
|
100
|
-
closeFocus();
|
|
101
|
-
const ev = event || {};
|
|
102
|
-
const want = String(ev.id || '');
|
|
103
|
-
if (phone) pop = false; // the phone has the whole page, in one column
|
|
104
|
-
const resolve = !!pop && want === 'now'; // the extension names no meeting: which one this call is comes first
|
|
105
|
-
const id = resolve ? '' : want;
|
|
106
|
-
const day = String(date || localDayOf(ev.at || ev.start) || '');
|
|
107
|
-
ensureCss();
|
|
108
|
-
const host = document.getElementById('c3-root') || document.body;
|
|
109
|
-
const root = el('div', { class: 'c3focus' + (pop ? ' fc-pop' : '') + (phone ? ' fc-phone' : ''), role: 'region', 'aria-label': pop ? 'PMOS meeting helper' : 'Meeting focus', 'data-c3focus': '', ...(pop ? { 'data-fc-pop': '' } : {}), ...(phone ? { 'data-fc-phone': '' } : {}) });
|
|
110
|
-
const r = {};
|
|
111
|
-
r.form = askForm();
|
|
112
|
-
const convo = el('section', { class: 'fc-cv', 'aria-label': 'The conversation, with PMOS' },
|
|
113
|
-
pop || phone ? null : el('div', { class: 'fc-cv-h' }, el('b', null, 'Conversation'), el('span', { class: 'dim' }, 'PMOS replies only to you')),
|
|
114
|
-
r.tick = el('div', { class: 'fc-tk', 'aria-label': 'Last lines in the room', 'data-fc': 'ticker' }),
|
|
115
|
-
r.stream = el('ol', { class: 'fc-s2', role: 'list', 'data-fc': 'stream' }),
|
|
116
|
-
phone ? null : r.form);
|
|
117
|
-
const page = phone
|
|
118
|
-
? el('div', { class: 'fc-page' },
|
|
119
|
-
r.top = el('header', { class: 'fc-phd', 'data-fc': 'phone-head' }),
|
|
120
|
-
r.now = el('div', { class: 'fc-phnow', 'data-fc': 'now-line' }),
|
|
121
|
-
el('section', { class: 'fc-room', 'data-fc': 'room', 'aria-label': 'The room' },
|
|
122
|
-
el('span', { class: 'fc-side mono' }, el('span', { class: 'fc-dot' }), 'The room'),
|
|
123
|
-
r.tick = el('div', { class: 'fc-said', 'aria-live': 'polite', 'data-fc': 'ticker' }),
|
|
124
|
-
r.band = el('div', { class: 'fc-bandwrap' })),
|
|
125
|
-
r.me = el('section', { class: 'fc-me', 'data-fc': 'pmos', 'aria-label': 'PMOS to you. Only you see it.' },
|
|
126
|
-
r.stream = el('div', { class: 'fc-one', 'data-fc': 'stream' })),
|
|
127
|
-
el('div', { class: 'fc-phft', 'data-fc': 'phone-foot' }, r.form, r.act = el('span', { class: 'fc-phact' })))
|
|
128
|
-
: pop
|
|
129
|
-
? el('div', { class: 'fc-page' },
|
|
130
|
-
r.top = el('header', { class: 'fc-ph', 'data-fc': 'pop-head' }),
|
|
131
|
-
el('div', { class: 'fc-popbody', 'data-fc': 'pop-body' },
|
|
132
|
-
r.band = el('div', { class: 'fc-bandwrap' }), convo,
|
|
133
|
-
r.foot = el('div', { class: 'fc-foot', 'data-fc': 'pop-foot' },
|
|
134
|
-
back ? pbtn('ghost', 'Back to your day', 'prev', { 'data-fc': 'leave', title: 'Back to the companion. The meeting keeps recording.' })
|
|
135
|
-
: lk({ 'data-fc': 'pop-open', title: 'Opens the full focus page in a new tab' }, icon('out', 'sm'), 'Open focus in PMOS'), el('span', { class: 'dim mono' }, 'only you see this'))))
|
|
136
|
-
: el('div', { class: 'fc-page' },
|
|
137
|
-
r.top = el('header', { class: 'card fc-top', 'aria-label': 'Meeting' }),
|
|
138
|
-
r.now = el('div', { class: 'fc-nowl', 'data-fc': 'now-line' }),
|
|
139
|
-
r.band = el('div', { class: 'fc-bandwrap' }),
|
|
140
|
-
el('div', { class: 'fc-main' },
|
|
141
|
-
el('div', { class: 'fc-s' }, r.stage = el('div', { class: 'fc-stagewrap' }), r.cap = el('div', { class: 'fc-capwrap' })),
|
|
142
|
-
el('aside', { class: 'fc-w', 'aria-label': 'Conversation' }, convo)));
|
|
143
|
-
root.append(page);
|
|
144
|
-
F = { id, date: day, ev0: ev, root, r, sig: {}, data: null, offset: 0, ui: { ni: null, open: new Set(), folded: new Set(), pulled: [], stage: 0, picker: false, newTopic: false, addTopic: false, heldOpen: false, pending: new Map(), failed: new Map(), pill: false },
|
|
145
|
-
pop: !!pop, back: !!back, phone: !!phone, noteId: id ? '' : String(note || ''), meet: String(meet || ''), mtitle: String(mtitle || ''), choices: null,
|
|
146
|
-
timers: {}, askTimers: new Map(), sheet: null, sheetOpen: false, status: 'reading', error: '',
|
|
147
|
-
opener: document.activeElement && document.activeElement !== document.body ? document.activeElement : null, seenNotes: 0 };
|
|
148
|
-
// a fixed box inside an element with container-type is placed against that element, not the screen: lift it while the page is open
|
|
149
|
-
host.classList.add('fc-open');
|
|
150
|
-
host.append(root);
|
|
151
|
-
const grid = host.querySelector && host.querySelector('.c3grid'); if (grid) grid.inert = true;
|
|
152
|
-
const comp = host.querySelector && host.querySelector('[data-c3ph]'); if (comp) comp.inert = true; // the phone companion under the page
|
|
153
|
-
if (!pop && !phone) { try { const u = new URL(location.href); u.searchParams.set('focus', id); if (day) u.searchParams.set('fdate', day); if (!id && ev.at) { u.searchParams.set('fat', ev.at); if (ev.title) u.searchParams.set('ftitle', ev.title); } history.replaceState(history.state, '', u); } catch { /* no history */ } } // the compact page keeps its address: a reload asks again which meeting it is
|
|
154
|
-
draw();
|
|
155
|
-
F.timers.clock = setInterval(tick, 1000);
|
|
156
|
-
if (resolve) resolveNow(); else load();
|
|
157
|
-
const lv = root.querySelector('[data-fc="leave"]'); if (lv) lv.focus({ preventScroll: true });
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/* ── which meeting is this call (compact mode) ──────────────────────────────────────────────────────────────────── */
|
|
161
|
-
|
|
162
|
-
const NOW_RETRY_MS = 30000;
|
|
163
|
-
async function resolveNow() {
|
|
164
|
-
const f = F; if (!f) return;
|
|
165
|
-
clearTimeout(f.timers.poll);
|
|
166
|
-
const p = new URLSearchParams();
|
|
167
|
-
if (f.meet) p.set('meet', f.meet);
|
|
168
|
-
if (f.mtitle) p.set('title', f.mtitle);
|
|
169
|
-
const j = await pmGet('/api/meeting-focus/now?' + p.toString());
|
|
170
|
-
if (F !== f) return;
|
|
171
|
-
if (j && j.ok && j.event && j.event.id) { chooseMeeting(j.event, j.date); return; }
|
|
172
|
-
if (j && Array.isArray(j.choices)) { f.status = 'nomeeting'; f.choices = j.choices; f.error = ''; }
|
|
173
|
-
else { f.status = 'error'; f.error = (j && j.error) || 'PMOS could not look for the meeting.'; f.choices = null; }
|
|
174
|
-
draw();
|
|
175
|
-
f.timers.poll = setTimeout(resolveNow, NOW_RETRY_MS); // a meeting that starts soon is found without a press
|
|
176
|
-
}
|
|
177
|
-
/** The meeting this page shows from now on: read it, and keep reading it. */
|
|
178
|
-
function chooseMeeting(ev, date) {
|
|
179
|
-
const f = F; if (!f) return;
|
|
180
|
-
clearTimeout(f.timers.poll);
|
|
181
|
-
f.id = String(ev.id); f.ev0 = ev; f.date = String(date || String(ev.at || '').slice(0, 10)); f.choices = null; f.status = 'reading'; f.error = ''; f.data = null;
|
|
182
|
-
draw();
|
|
183
|
-
load();
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/* ── reading ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
187
|
-
|
|
188
|
-
async function load() {
|
|
189
|
-
const f = F; if (!f) return;
|
|
190
|
-
clearTimeout(f.timers.poll);
|
|
191
|
-
const e = f.ev0;
|
|
192
|
-
const p = new URLSearchParams();
|
|
193
|
-
if (f.id) p.set('event', f.id);
|
|
194
|
-
else if (f.noteId) p.set('note', f.noteId); // a recording with no meeting
|
|
195
|
-
if (f.date && !f.noteId) p.set('date', f.date);
|
|
196
|
-
if (!f.noteId && (e.at || e.start)) { p.set('at', e.at || e.start); if (e.title) p.set('title', e.title); } // the start and title still find the meeting when the id or the day does not
|
|
197
|
-
const j = await pmGet('/api/meeting-focus?' + p.toString());
|
|
198
|
-
if (F !== f) return;
|
|
199
|
-
if (j && j.ok) {
|
|
200
|
-
f.data = j; f.status = 'ok'; f.error = '';
|
|
201
|
-
f.offset = Number.isFinite(j.now_ms) ? j.now_ms - Date.now() : 0;
|
|
202
|
-
refreshSheet();
|
|
203
|
-
} else if (j && j.status === 404) { f.status = 'missing'; f.error = (j && j.error) || 'no such meeting'; }
|
|
204
|
-
else { f.status = f.data ? 'ok' : 'error'; f.error = (j && j.error) || 'The meeting could not be read.'; f.stale = true; }
|
|
205
|
-
draw();
|
|
206
|
-
f.timers.poll = setTimeout(load, POLL_MS);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/* ── drawing ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
210
|
-
|
|
211
|
-
/** Replace a region's children when its signature changed. */
|
|
212
|
-
function region(name, sig, build) {
|
|
213
|
-
const s = typeof sig === 'string' ? sig : JSON.stringify(sig);
|
|
214
|
-
if (F.sig[name] === s) return false;
|
|
215
|
-
F.sig[name] = s;
|
|
216
|
-
put(F.r[name], ...[].concat(build()));
|
|
217
|
-
return true;
|
|
218
|
-
}
|
|
219
|
-
const phaseOf = () => { const n = nowMs(); const s = startMs(); const e = endMs(); return Number.isFinite(s) && n < s ? 'before' : Number.isFinite(e) && n >= e ? 'after' : 'during'; };
|
|
220
|
-
/** The meeting's material: the links of the invite and the brief, then the PM's own (d.material, with topic and present). A PMOS deck is presented in PMOS. */
|
|
221
|
-
function linksOf(d) {
|
|
222
|
-
const mine = ((d && d.material) || []).map((m) => {
|
|
223
|
-
const c = classify(['pmos-deck', 'pmos-doc', 'report'].includes(m.kind) ? pmosUrl(m) : m.url);
|
|
224
|
-
return { label: m.title || c.url, ...c, mat: m, topic: m.topic || null, you: m.present === true, ...(c.kind === 'pmos' ? { present: m.kind === 'pmos-deck' } : {}) };
|
|
225
|
-
});
|
|
226
|
-
const own = new Set(mine.map((l) => l.url));
|
|
227
|
-
const given = ((d && d.event && d.event.links) || []).map((l) => ({ label: l.label, ...classify(l.url) })).filter((l) => !own.has(l.url));
|
|
228
|
-
return [...given, ...mine].map((l, i) => ({ ...l, i }));
|
|
229
|
-
}
|
|
230
|
-
const normTopic = (t) => String(t || '').toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim();
|
|
231
|
-
/** The material tied to the topic the room is on (by its text or its id), or null. */
|
|
232
|
-
const forTopic = (links, cur) => (cur ? links.find((l) => l.topic && (normTopic(l.topic) === normTopic(cur.text) || normTopic(l.topic) === normTopic(cur.id))) || null : null);
|
|
233
|
-
/** The item on the stage: the one you pressed, else the material for the topic the room is on, else the first. */
|
|
234
|
-
function stagePick(d) {
|
|
235
|
-
const links = linksOf(d);
|
|
236
|
-
return (F.ui.stagePin ? links[F.ui.stage] : forTopic(links, currentOf(d))) || links[F.ui.stage] || links.find((l) => l.preview) || links[0] || null;
|
|
237
|
-
}
|
|
238
|
-
const topicNo = (d, id) => d.topics.findIndex((t) => t.id === id) + 1;
|
|
239
|
-
const currentOf = (d) => d.topics.find((t) => t.id === d.current) || null;
|
|
240
|
-
const openRunOf = (d) => (d.runs || []).filter((x) => x.to_min == null).pop() || null;
|
|
241
|
-
const capCount = (d) => (d.captured ? d.captured.decisions.length + d.captured.actions.length + d.captured.questions.length : 0);
|
|
242
|
-
const recState = (d) => (d.note ? d.note.state : 'none');
|
|
243
|
-
|
|
244
|
-
function draw() {
|
|
245
|
-
if (!F) return;
|
|
246
|
-
const d = F.data;
|
|
247
|
-
F.root.dataset.fcState = d ? 'ok' : F.status;
|
|
248
|
-
if (F.pop) { drawPop(d); return; }
|
|
249
|
-
if (F.phone) { drawPhone(d); return; }
|
|
250
|
-
if (!d) {
|
|
251
|
-
const title = F.ev0.title || 'Meeting';
|
|
252
|
-
region('top', ['wait', F.status, F.error], () => [el('div', { class: 'fc-id' }, leaveBtn(), el('div', { class: 'fc-tt' }, el('h1', null, title),
|
|
253
|
-
el('div', { class: 'dim mono fc-sub', role: 'status' }, F.status === 'missing' ? 'PMOS has no record of this meeting on the calendar, so there is nothing to show.' : F.status === 'error' ? F.error : 'Reading the meeting.')))]);
|
|
254
|
-
for (const k of ['now', 'band', 'stage', 'cap', 'tick', 'stream']) region(k, 'wait', () => []);
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
const ph = phaseOf();
|
|
258
|
-
drawTop(d, ph); drawNow(d, ph); drawBand(d); drawStage(d, ph); drawCap(d, ph); drawConversation(d);
|
|
259
|
-
tick();
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/* ── compact mode: a head, what is being said, the conversation and a foot ──────────────────────────────────────── */
|
|
263
|
-
|
|
264
|
-
function drawPop(d) {
|
|
265
|
-
const ph = d ? phaseOf() : 'before';
|
|
266
|
-
drawPopHead(d, ph);
|
|
267
|
-
if (!d) {
|
|
268
|
-
region('band', ['msg', F.status, F.error, F.choices], popMessage);
|
|
269
|
-
for (const k of ['tick', 'stream']) region(k, 'wait', () => []);
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
drawBand(d); drawConversation(d);
|
|
273
|
-
tick();
|
|
274
|
-
}
|
|
275
|
-
function drawPopHead(d, ph) {
|
|
276
|
-
const e = d ? d.event : F.ev0 || {}; const cur = d ? currentOf(d) : null;
|
|
277
|
-
const sig = [F.status, e.title, e.at, e.end, ph, cur && cur.text, F.ui.pill];
|
|
278
|
-
region('top', sig, () => {
|
|
279
|
-
const s = startMs(); const f = endMs();
|
|
280
|
-
const label = !d ? (F.status === 'nomeeting' ? 'No meeting right now' : F.status === 'reading' ? 'Reading the meeting' : 'No meeting to show')
|
|
281
|
-
: ph === 'before' ? ['Starts in ', el('span', { class: 'mono', 'data-fc': 'big' }, clockText((s - nowMs()) / 1000))]
|
|
282
|
-
: ph === 'after' ? (e.title || 'Meeting') + ' has ended' : cur ? cur.text : e.title;
|
|
283
|
-
const left = d && ph === 'during' && Number.isFinite(f) ? el('span', { class: 'mono dim', 'data-fc': 'left', title: 'Time left' }, clockText((f - nowMs()) / 1000)) : null;
|
|
284
|
-
const lbl = F.ui.pill ? 'Open' : 'Fold to a pill';
|
|
285
|
-
return [F.back ? ib('Back to your day', 'prev', { 'data-fc': 'leave' }) : null, el('b', { class: 'mono' }, 'PMOS'), el('span', { class: 'fc-ph-topic', 'data-fc': 'pop-topic', title: typeof label === 'string' ? label : '' }, label), left,
|
|
286
|
-
ib(lbl, F.ui.pill ? 'next' : 'fold', { 'data-fc': 'pill', 'aria-pressed': String(F.ui.pill) })];
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
function popMessage() {
|
|
290
|
-
if (F.status === 'nomeeting') {
|
|
291
|
-
const cs = F.choices || [];
|
|
292
|
-
return [el('div', { class: 'fc-popmsg', role: 'status', 'data-fc': 'pop-msg' },
|
|
293
|
-
el('p', null, el('b', null, 'No meeting right now.'), ' PMOS could not tell which meeting this call is.'),
|
|
294
|
-
cs.length ? el('p', { class: 'dim mono fc-gl' }, 'Today\'s meetings. Pick this call\'s.') : el('p', { class: 'dim' }, 'Nothing else is on today\'s calendar.'),
|
|
295
|
-
cs.length ? el('div', { class: 'fc-choices', role: 'list', 'data-fc': 'choices' }, ...cs.map((c, i) => pbtn('outline', [el('span', { class: 'mono' }, hhmm(Date.parse(c.at))), ' ' + c.title], null, { 'data-fc': 'choice', 'data-i': String(i), role: 'listitem' }))) : null)];
|
|
296
|
-
}
|
|
297
|
-
if (F.status === 'reading') return [el('p', { class: 'dim mono fc-popmsg', role: 'status', 'data-fc': 'pop-msg' }, 'Reading the meeting.')];
|
|
298
|
-
return [el('p', { class: 'dim mono fc-popmsg', role: 'status', 'data-fc': 'pop-msg' }, F.status === 'missing' ? 'PMOS has no record of this meeting on the calendar, so there is nothing to show.' : F.error || 'The meeting could not be read.')];
|
|
299
|
-
}
|
|
300
|
-
/* ── phone mode: the full page in one column ────────────────────────────────────────────────────────────────── */
|
|
301
|
-
|
|
302
|
-
function drawPhone(d) {
|
|
303
|
-
if (!d) {
|
|
304
|
-
const title = F.ev0.title || (F.noteId ? 'Conversation' : 'Meeting');
|
|
305
|
-
region('top', ['wait', F.status, F.error], () => [el('div', { class: 'fc-phid' }, backBtn(), el('div', { class: 'fc-tt' }, el('h1', null, title),
|
|
306
|
-
el('div', { class: 'dim mono fc-sub', role: 'status' }, F.status === 'missing' ? (F.noteId ? 'PMOS could not find the notes of this recording.' : 'PMOS has no record of this meeting on the calendar, so there is nothing to show.') : F.status === 'error' ? F.error : 'Reading the meeting.')))]);
|
|
307
|
-
for (const k of ['now', 'band', 'tick', 'stream', 'act']) region(k, 'wait', () => []);
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
const ph = phaseOf();
|
|
311
|
-
drawPhTop(d, ph); drawPhNow(d, ph); drawBand(d); drawConversation(d); drawPhAct(d, ph);
|
|
312
|
-
tick();
|
|
313
|
-
}
|
|
314
|
-
const backBtn = () => ib('Back to your day', 'prev', { 'data-fc': 'leave', title: 'Back to your day. It keeps recording.' });
|
|
315
|
-
function drawPhTop(d, ph) {
|
|
316
|
-
const e = d.event; const rec = recState(d); const ini = (d.brief && d.brief.initiative) || null;
|
|
317
|
-
const sig = [e.title, e.at, e.end, e.attendees, ini, e.initiative, ph, rec, !!d.talk, d.topics.map((t) => t.id), d.runs, F.status === 'ok' && F.stale ? 1 : 0];
|
|
318
|
-
region('top', sig, () => {
|
|
319
|
-
const s = startMs(); const f = endMs();
|
|
320
|
-
const people = e.attendees || [];
|
|
321
|
-
const sub = d.talk ? [Number.isFinite(s) ? 'Started ' + hhmm(s) : null, 'not on the calendar']
|
|
322
|
-
: [Number.isFinite(s) ? hhmm(s) + (Number.isFinite(f) ? ' to ' + hhmm(f) : '') : null, ini ? ini.title : e.initiative, people.length ? people.length + (people.length === 1 ? ' person' : ' people') : null];
|
|
323
|
-
const clock = ph === 'before'
|
|
324
|
-
? [el('b', { class: 'mono', 'data-fc': 'big' }, clockText((s - nowMs()) / 1000)), el('span', { class: 'dim mono' }, 'starts in')]
|
|
325
|
-
: [el('span', { class: 'fc-recd', 'data-fc': 'rec', 'data-rec': rec, title: rec === 'recording' ? 'Recording' : rec === 'paused' ? 'Paused' : '' }, rec === 'recording' ? el('span', { class: 'fc-dot' }) : null,
|
|
326
|
-
el('b', { class: 'mono', 'data-fc': 'big' }, clockText((nowMs() - s) / 1000))),
|
|
327
|
-
Number.isFinite(f) ? el('span', { class: 'dim mono' }, el('span', { 'data-fc': 'left' }, clockText((f - nowMs()) / 1000)), ' left') : rec === 'paused' ? el('span', { class: 'dim mono' }, 'paused') : null];
|
|
328
|
-
return [el('div', { class: 'fc-phid' }, backBtn(),
|
|
329
|
-
el('div', { class: 'fc-tt' }, el('h1', null, e.title), el('div', { class: 'dim mono fc-sub' }, sub.filter(Boolean).join(' · '))),
|
|
330
|
-
el('div', { class: 'fc-phclk', role: 'timer', 'aria-live': 'off' }, ...clock)),
|
|
331
|
-
d.talk || !d.runs.length ? null : trackEl(d),
|
|
332
|
-
F.stale ? el('p', { class: 'dim mono fc-stale', role: 'status' }, 'The last read failed. Showing what PMOS had.') : null];
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
function drawPhNow(d, ph) {
|
|
336
|
-
const cur = currentOf(d); const nc = d.topics.filter((t) => t.state === 'notyet').length; const cap = capCount(d);
|
|
337
|
-
const links = linksOf(d); const slides = links.some((l) => l.kind === 'slides');
|
|
338
|
-
region('now', [cur && cur.id, cur && cur.text, d.topics.length, nc, cap, d.note && d.note.id, ph, d.topics[0] && d.topics[0].text, !!d.talk, links.length, slides], () => [
|
|
339
|
-
d.talk ? null : cur
|
|
340
|
-
? el('div', { class: 'fc-nowt' }, el('span', { class: 'ki hot' }, icon('play', 'sm')), el('b', { 'data-fc': 'topic' }, cur.text), el('span', { class: 'mono dim', 'data-fc': 'onfor' }, ''))
|
|
341
|
-
: el('div', { class: 'fc-nowt dim', 'data-fc': 'first' }, d.topics.length ? [ph === 'before' ? 'First up: ' : 'No topic yet. First up: ', el('b', null, d.topics[0].text)] : 'No topics yet. PMOS adds topics as they come up.'),
|
|
342
|
-
el('div', { class: 'fc-phchips', role: 'group', 'aria-label': 'Open beside the talk' },
|
|
343
|
-
d.talk ? null : lk({ 'data-fc': 'topics' }, icon('todo', 'sm'), d.topics.length + ' topic' + (d.topics.length === 1 ? '' : 's') + (cur && nc ? ' · ' + nc + ' not yet' : '')),
|
|
344
|
-
lk({ 'data-fc': 'captured' }, icon('check', 'sm'), 'Captured ' + cap),
|
|
345
|
-
d.note ? lk({ 'data-fc': 'note' }, icon('notes', 'sm'), 'Note') : null,
|
|
346
|
-
links.length ? lk({ 'data-fc': 'material' }, icon('doc', 'sm'), slides ? 'Your slides' : 'Material') : null)]);
|
|
347
|
-
}
|
|
348
|
-
function drawPhAct(d, ph) {
|
|
349
|
-
const rec = recState(d);
|
|
350
|
-
region('act', [rec, ph], () => (rec === 'recording' || rec === 'paused' ? [pbtn('outline', 'Stop', 'stop', { 'data-fc': 'stop', title: 'Stop recording' })]
|
|
351
|
-
: rec !== 'ended' && ph !== 'after' && !d.talk ? [pbtn('primary', 'Record', 'play', { 'data-fc': 'start', title: 'Records this meeting in a note' })] : []));
|
|
352
|
-
}
|
|
353
|
-
function stopBuild() {
|
|
354
|
-
const d = F.data; const f = endMs(); const left = Number.isFinite(f) ? Math.round((f - nowMs()) / 60000) : 0;
|
|
355
|
-
return [el('div', { class: 'fc-stopsheet', 'data-fc': 'stop-sheet' },
|
|
356
|
-
el('p', { class: 'fc-p' }, d && d.talk ? 'PMOS keeps the notes and shows you what it caught.'
|
|
357
|
-
: left > 0 ? left + ' min of the meeting is left. If you stop now, the notes use what was recorded so far.' : 'PMOS keeps the notes and writes them up from the recording.'),
|
|
358
|
-
el('div', { class: 'iacts' }, pbtn('primary', 'Stop recording', 'stop', { 'data-fc': 'stop-ok' }), d && d.note && !isDemo() && !(F && F.phone) ? pbtn('outline', 'Stop and open the replay', 'play', { 'data-fc': 'stop-replay' }) : null, pbtn('ghost', 'Keep recording', null, { 'data-fc': 'stop-keep' })))];
|
|
359
|
-
}
|
|
360
|
-
function materialBuild() { return stageBody(F.data, phaseOf()); }
|
|
361
|
-
|
|
362
|
-
/* the live note, in a sheet: what PMOS picked out so far, or the last lines of the transcript (GET /api/notes/one) */
|
|
363
|
-
const NOTE_MS = 6000;
|
|
364
|
-
async function readNote() {
|
|
365
|
-
const f = F; if (!f || !f.data || !f.data.note) return;
|
|
366
|
-
const id = f.data.note.id;
|
|
367
|
-
if (f.noteBusy || (f.noteDoc && f.noteDoc.id === id && Date.now() - f.noteDoc.at < NOTE_MS)) return;
|
|
368
|
-
f.noteBusy = true;
|
|
369
|
-
try {
|
|
370
|
-
const [dn, vn, demo] = await Promise.all([import('./dest-notes.js'), import('./view-notes.js'), isDemo() ? import('./c3-demo-focus.js') : null]);
|
|
371
|
-
const j = demo ? demo.focusNote(id, f.data) : await pmGet('/api/notes/one?id=' + encodeURIComponent(id));
|
|
372
|
-
const n = j && j.ok !== false ? j.note : null;
|
|
373
|
-
f.noteDoc = { id, at: Date.now(), n, parts: n ? dn.partsOf(n) : null, speakerOf: vn.speakerOf };
|
|
374
|
-
} catch { f.noteDoc = { id, at: Date.now(), n: null, parts: null }; }
|
|
375
|
-
f.noteBusy = false;
|
|
376
|
-
if (F === f) refreshSheet();
|
|
377
|
-
}
|
|
378
|
-
function noteBuild() {
|
|
379
|
-
const doc = F.noteDoc; const tab = F.ui.noteTab || 'note';
|
|
380
|
-
const seg = el('div', { class: 'seg', role: 'group', 'aria-label': 'Show' },
|
|
381
|
-
...[['note', 'Note'], ['said', 'Transcript']].map(([k, l]) => button({ variant: 'ghost', label: l, attrs: { 'aria-pressed': String(tab === k), 'data-fc': 'note-tab', 'data-tab': k } })));
|
|
382
|
-
if (!doc) return [el('div', { class: 'fc-notesheet', 'data-fc': 'note-sheet' }, seg, el('p', { class: 'dim fc-note', role: 'status' }, 'Opening the note.'))];
|
|
383
|
-
if (!doc.n) return [el('div', { class: 'fc-notesheet', 'data-fc': 'note-sheet' }, seg, el('p', { class: 'dim fc-note', role: 'status' }, 'The note could not be read. It is kept on your computer.'))];
|
|
384
|
-
const body = [];
|
|
385
|
-
if (tab === 'said') {
|
|
386
|
-
const lines = (doc.n.transcript || []).filter((x) => x && x.text && !x.dropped).slice(-12);
|
|
387
|
-
body.push(lines.length ? el('ul', { class: 'fc-said', role: 'list', 'data-fc': 'note-said' }, ...lines.map((x) => el('li', null, el('b', null, (doc.speakerOf ? doc.speakerOf(doc.n, x.source) : x.source) + ' '), x.text)))
|
|
388
|
-
: el('p', { class: 'dim fc-note' }, 'Nothing is heard yet.'));
|
|
389
|
-
body.push(el('p', { class: 'dim fc-note' }, 'Fast lines are provisional and corrected at each pause.'));
|
|
390
|
-
} else {
|
|
391
|
-
const p = doc.parts || { overview: '', decisions: [], actions: [], questions: [] };
|
|
392
|
-
const list = (h, rows, fmt) => (rows.length ? el('div', { 'data-fc-part': h.toLowerCase() }, el('div', { class: 'dim mono fc-lbl' }, h + ' · ' + rows.length), el('ul', { class: 'fc-said', role: 'list' }, ...rows.map((x) => el('li', null, fmt(x))))) : null);
|
|
393
|
-
if (p.overview) body.push(el('p', { class: 'fc-p' }, p.overview));
|
|
394
|
-
body.push(list('Decisions', p.decisions || [], (x) => x.text), list('Actions', p.actions || [], (x) => [x.text, x.owner ? ' · ' + x.owner : '', x.due ? ' · due ' + x.due : ''].join('')), list('Open questions', p.questions || [], (x) => x.text));
|
|
395
|
-
if (!p.overview && !(p.decisions || []).length && !(p.actions || []).length && !(p.questions || []).length) body.push(el('p', { class: 'dim fc-note' }, 'PMOS writes the note as the talk goes. Nothing is picked out yet.'));
|
|
396
|
-
}
|
|
397
|
-
return [el('div', { class: 'fc-notesheet', 'data-fc': 'note-sheet' }, seg, ...body.filter(Boolean), el('p', { class: 'dim fc-note' }, 'The whole note opens on your computer.'))];
|
|
398
|
-
}
|
|
399
|
-
function openNoteSheet() { F.ui.noteTab = F.ui.noteTab || 'note'; showSheet('note', 'Live note', 'notes', noteBuild); readNote(); }
|
|
400
|
-
|
|
401
|
-
/** The full focus page, in a new tab: the compact page's way to everything it leaves out. */
|
|
402
|
-
function fullUrl() {
|
|
403
|
-
const u = new URL('/console.html', location.origin);
|
|
404
|
-
u.searchParams.set('focus', F.data ? F.data.event.id : F.id);
|
|
405
|
-
if (F.date) u.searchParams.set('fdate', F.date);
|
|
406
|
-
if (wsParam()) u.searchParams.set('ws', wsParam());
|
|
407
|
-
if (isDemo()) u.searchParams.set('demo', '1');
|
|
408
|
-
return u.href;
|
|
409
|
-
}
|
|
410
|
-
function openFull() { try { window.open(fullUrl(), '_blank', 'noopener'); } catch { /* a blocked pop-up */ } }
|
|
411
|
-
function setPill(on) {
|
|
412
|
-
F.ui.pill = on; F.root.classList.toggle('fc-pill', on);
|
|
413
|
-
draw();
|
|
414
|
-
try { if (window.parent && window.parent !== window) window.parent.postMessage({ pmosFocus: on ? 'fold' : 'open' }, '*'); } catch { /* no parent */ } // one word, no data: the extension resizes its frame
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
const leaveBtn = () => pbtn('ghost', 'Leave focus', 'prev', { 'data-fc': 'leave', title: 'Back to where you were. The meeting keeps recording.' });
|
|
418
|
-
|
|
419
|
-
function leftText(d, ph) {
|
|
420
|
-
if (ph !== 'during') return { txt: '', warn: false };
|
|
421
|
-
const left = Math.max(0, Math.round((endMs() - nowMs()) / 60000));
|
|
422
|
-
const nc = d.topics.filter((t) => t.state === 'notyet').length;
|
|
423
|
-
if (!d.current || !nc) return { txt: '', warn: false };
|
|
424
|
-
const warn = left < nc * 6;
|
|
425
|
-
return { txt: warn ? nc + ' topic' + (nc > 1 ? 's' : '') + ' left for ' + left + ' min' : '', warn };
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
/** The thin bar of the stretches of talk, numbered by topic, with a mark for now. */
|
|
429
|
-
function trackEl(d) {
|
|
430
|
-
const s = startMs(); const f = endMs();
|
|
431
|
-
const total = Number.isFinite(s) && Number.isFinite(f) ? (f - s) / 60000 : 60;
|
|
432
|
-
const track = d.runs.map((r) => {
|
|
433
|
-
const open = r.to_min == null;
|
|
434
|
-
const to = open ? Math.max(r.from_min, (nowMs() - s) / 60000) : r.to_min;
|
|
435
|
-
const w = Math.max(0, (to - r.from_min) / total * 100);
|
|
436
|
-
const t = d.topics.find((x) => x.id === r.topic);
|
|
437
|
-
const seg = el('i', { class: open ? 'c' : 'd', ...(open ? { 'data-fc': 'currun' } : {}), title: (t ? t.text : '') + ' · ' + Math.round(to - r.from_min) + ' min' }, w >= 6 ? String(topicNo(d, r.topic)) : '');
|
|
438
|
-
seg.style.setProperty('--fc-left', Math.min(100, r.from_min / total * 100) + '%');
|
|
439
|
-
seg.style.setProperty('--fc-width', Math.min(100, w) + '%');
|
|
440
|
-
return seg;
|
|
441
|
-
});
|
|
442
|
-
return el('div', { class: 'fc-track', role: 'img', 'aria-label': 'What the room talked about, in order. Numbers match the topic list.' }, el('div', { class: 'fc-runs' }, ...track), el('span', { class: 'fc-nowm', 'data-fc': 'nowm' }));
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/* Pause shots: the chip beside REC stops the pictures and keeps the sound (notes-shots.js; the same switch is on the recording chip) */
|
|
446
|
-
const shotsSig = () => (Shots.active() ? Shots.chipText() : '');
|
|
447
|
-
function shotsChip() {
|
|
448
|
-
const off = Shots.paused();
|
|
449
|
-
return lk({ class: 'lsn-chip' + (off ? ' off' : ''), 'data-fc': 'shots', 'aria-pressed': String(off), title: Shots.chipTitle(),
|
|
450
|
-
onclick: () => { const now = Shots.setPaused(!Shots.paused()); toast(now ? 'Shots paused. The sound is still recorded.' : 'Shots back on.'); draw(); } }, icon(off ? 'play' : 'eye', 'sm'), Shots.chipText());
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
function drawTop(d, ph) {
|
|
454
|
-
const e = d.event; const rec = recState(d); const ini = (d.brief && d.brief.initiative) || null; const lt = leftText(d, ph);
|
|
455
|
-
const sig = [e.title, e.at, e.end, e.attendees, ini, e.initiative, ph, rec, shotsSig(), lt.txt, d.topics.map((t) => t.id), d.runs, F.status === 'ok' && F.stale ? 1 : 0];
|
|
456
|
-
region('top', sig, () => {
|
|
457
|
-
const s = startMs(); const f = endMs();
|
|
458
|
-
const people = (e.attendees || []);
|
|
459
|
-
const iniText = ini ? ini.title : e.initiative;
|
|
460
|
-
const when = Number.isFinite(s) ? hhmm(s) + (Number.isFinite(f) ? ' to ' + hhmm(f) : '') : '';
|
|
461
|
-
const clock = ph === 'before'
|
|
462
|
-
? [el('div', null, el('b', { class: 'mono', 'data-fc': 'big' }, clockText((s - nowMs()) / 1000)), el('span', { class: 'dim mono' }, 'starts in'))]
|
|
463
|
-
: [el('div', null, el('b', { class: 'mono', 'data-fc': 'big' }, clockText((nowMs() - s) / 1000)), el('span', { class: 'dim mono' }, 'elapsed')),
|
|
464
|
-
Number.isFinite(f) ? el('div', null, el('b', { class: 'mono', 'data-fc': 'left' }, clockText((f - nowMs()) / 1000)), el('span', { class: 'dim mono' }, 'left')) : null];
|
|
465
|
-
const recLabel = rec === 'recording' ? 'REC' : rec === 'paused' ? 'Paused' : rec === 'ended' ? 'Ended' : '';
|
|
466
|
-
return [
|
|
467
|
-
el('div', { class: 'fc-id' }, leaveBtn(),
|
|
468
|
-
el('div', { class: 'fc-tt' }, el('h1', null, e.title),
|
|
469
|
-
el('div', { class: 'chips2 dim mono' }, when ? el('span', null, when) : null, iniText ? el('span', { class: 'chip2' }, icon('init', 'sm'), iniText) : null,
|
|
470
|
-
people.length ? el('span', { title: people.join(', '), 'data-fc': 'people' }, people.length + (people.length === 1 ? ' person' : ' people')) : null))),
|
|
471
|
-
el('div', { class: 'fc-clock', role: 'timer', 'aria-live': 'off' }, ...clock, el('div', { class: 'fc-end' }, el('span', { class: 'tag' + (lt.warn ? ' fc-warn' : ''), 'data-fc': 'proj', hidden: !lt.txt }, lt.txt))),
|
|
472
|
-
el('div', { class: 'fc-acts' },
|
|
473
|
-
recLabel ? el('span', { class: 'dim mono fc-recd', 'data-fc': 'rec', 'data-rec': rec, title: rec === 'recording' ? 'Recording this meeting' : '' }, rec === 'recording' ? el('span', { class: 'fc-dot' }) : null, recLabel) : null,
|
|
474
|
-
rec === 'recording' && Shots.active() ? shotsChip() : null,
|
|
475
|
-
rec === 'recording' || rec === 'paused' ? pbtn('outline', 'End meeting', 'stop', { 'data-fc': 'end', title: 'Stops the recording and saves the note' })
|
|
476
|
-
: rec !== 'ended' && ph !== 'after' ? pbtn('primary', 'Start recording', 'play', { 'data-fc': 'start', title: 'Records this meeting in a note' }) : null),
|
|
477
|
-
trackEl(d),
|
|
478
|
-
F.stale ? el('p', { class: 'dim mono fc-stale', role: 'status' }, 'The last read failed. Showing what PMOS had.') : null,
|
|
479
|
-
];
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
function drawNow(d, ph) {
|
|
484
|
-
const cur = currentOf(d); const nc = d.topics.filter((t) => t.state === 'notyet').length; const cap = capCount(d);
|
|
485
|
-
region('now', [cur && cur.id, cur && cur.text, d.topics.length, nc, cap, d.note && d.note.id, ph, d.topics[0] && d.topics[0].text], () => {
|
|
486
|
-
const left = cur
|
|
487
|
-
? el('span', { class: 'fc-nowt' }, el('span', { class: 'ki hot' }, icon('play', 'sm')), el('b', { 'data-fc': 'topic' }, cur.text), el('span', { class: 'mono dim', 'data-fc': 'onfor' }, ''),
|
|
488
|
-
lk({ 'data-fc': 'topics', title: 'Not this topic? Change it here' }, 'change'))
|
|
489
|
-
: el('span', { class: 'fc-nowt dim', 'data-fc': 'first' }, d.topics.length ? [ph === 'before' ? 'First up: ' : 'No topic yet. First up: ', el('b', null, d.topics[0].text)] : 'No topics yet. PMOS adds topics as they come up.');
|
|
490
|
-
return [left, el('span', { class: 'fc-grow' }),
|
|
491
|
-
lk({ 'data-fc': 'topics' }, icon('todo', 'sm'), d.topics.length + ' topic' + (d.topics.length === 1 ? '' : 's') + (cur && nc ? ' · ' + nc + ' not covered' : '')),
|
|
492
|
-
ph !== 'before' || d.note ? lk({ 'data-fc': 'captured' }, icon('check', 'sm'), 'Captured ' + cap) : null,
|
|
493
|
-
d.note ? lk({ 'data-fc': 'note' }, icon('notes', 'sm'), 'Note') : null];
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
function ctxChip(c) {
|
|
498
|
-
return button({ variant: 'ghost', label: [el('b', null, c.label), c.sub ? el('span', null, c.sub) : null], attrs: { class: 'fc-cx', 'data-fc': 'chip', title: c.sub || c.label } });
|
|
499
|
-
}
|
|
500
|
-
function drawBand(d) {
|
|
501
|
-
region('band', [d.gist, d.chips], () => {
|
|
502
|
-
if (!d.gist && !(d.chips || []).length) return [];
|
|
503
|
-
F.chips = d.chips || [];
|
|
504
|
-
return [el('div', { class: 'fc-gist', 'aria-live': 'polite', 'data-fc': 'gist' },
|
|
505
|
-
d.gist ? el('p', null, icon('spark', 'sm'), el('span', null, el('span', { class: 'dim mono fc-gl' }, "What's being said"), ' ', d.gist)) : null,
|
|
506
|
-
(d.chips || []).length ? el('div', { class: 'fc-cxs', role: 'list', 'aria-label': 'Talked about, with context' }, ...d.chips.map((c, i) => { const b = ctxChip(c); b.dataset.i = String(i); return b; })) : null)];
|
|
507
|
-
});
|
|
508
|
-
F.chips = d.chips || [];
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
/* ── the stage ────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
512
|
-
|
|
513
|
-
function linkRow(l) {
|
|
514
|
-
return el('li', { class: 'nrow', 'data-fc-link': l.kind },
|
|
515
|
-
el('span', { class: 'ki' }, icon(l.kind === 'confluence' || l.kind === 'link' ? 'out' : 'doc')),
|
|
516
|
-
el('div', { class: 'nb' }, el('span', { class: 'tt' }, l.label), el('div', { class: 'chips' }, el('span', { class: 'chip2' }, icon('out', 'sm'), l.app))),
|
|
517
|
-
el('div', { class: 'acts' }, openBtn(l), l.present ? presentBtn(l) : null));
|
|
518
|
-
}
|
|
519
|
-
const openBtn = (l) => (l.kind === 'pmos' ? pbtn('outline', 'Open', null, { 'data-fc': 'pm-open', 'data-i': String(l.i), title: 'Opens it in PMOS' })
|
|
520
|
-
: pbtn('outline', l.kind === 'link' ? 'Open' : 'Open in ' + l.app, null, { 'data-fc': 'open-link', 'data-url': l.url, title: 'Opens it in a new tab' }));
|
|
521
|
-
const presentBtn = (l) => (l.kind === 'pmos'
|
|
522
|
-
? [pbtn('ghost', 'Audience view', 'eye', { 'data-fc': 'pm-audience', 'data-i': String(l.i), title: 'Opens the slides only, full screen, with no notes. Share the screen in the call.' }),
|
|
523
|
-
pbtn('primary', 'Present', 'play', { 'data-fc': 'pm-present', 'data-i': String(l.i), title: 'Opens the presenter view in PMOS with your speaker notes. Press Audience view before you share the screen.' })]
|
|
524
|
-
: pbtn('ghost', 'Present in ' + l.app, 'play', { 'data-fc': 'present', 'data-url': l.present, title: 'Opens the deck in present mode in a new tab. Share that tab in the call.' }));
|
|
525
|
-
const addMaterialBtn = () => pbtn('outline', 'Add material', 'plus', { 'data-fc': 'mat-add', title: 'Link a PMOS document, a report or deck, or a web page to this meeting' });
|
|
526
|
-
|
|
527
|
-
function beforeList(d, links) {
|
|
528
|
-
const b = d.brief || {};
|
|
529
|
-
const rows = [];
|
|
530
|
-
for (const l of links) rows.push(linkRow(l));
|
|
531
|
-
if (b.prep) rows.push(el('li', { class: 'nrow' }, el('span', { class: 'ki' }, icon('alert')), el('div', { class: 'nb' }, el('span', { class: 'tt' }, b.prep), el('div', { class: 'chips' }, el('span', { class: 'tag' }, 'To be ready'))), el('span')));
|
|
532
|
-
for (const m of (b.matters || []).slice(0, 3)) rows.push(el('li', { class: 'nrow' }, el('span', { class: 'ki' }, icon('scale')), el('div', { class: 'nb' }, el('span', { class: 'tt' }, m.text),
|
|
533
|
-
el('div', { class: 'chips' }, el('span', { class: 'tag' + (m.tone === 'bad' ? ' fc-bad' : m.tone === 'warn' ? ' fc-warn' : '') }, m.tag), m.meta ? el('span', { class: 'tag' }, m.meta) : null)), el('span')));
|
|
534
|
-
if (b.last && b.last.actions && b.last.actions.length) for (const a of b.last.actions.slice(0, 3)) rows.push(el('li', { class: 'nrow' }, el('span', { class: 'ki' }, icon('notes')), el('div', { class: 'nb' }, el('span', { class: 'tt' }, a.text),
|
|
535
|
-
el('div', { class: 'chips' }, el('span', { class: 'tag' }, 'From last time'), a.owner ? el('span', { class: 'tag' }, a.owner) : null, a.due ? el('span', { class: 'tag' }, 'due ' + a.due) : null)), el('span')));
|
|
536
|
-
return rows;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
function drawStage(d, ph) {
|
|
540
|
-
const links = linksOf(d);
|
|
541
|
-
const cur = currentOf(d);
|
|
542
|
-
const sig = [ph, links, F.ui.stage, F.ui.stagePin, F.ui.preview, cur && cur.text, d.brief && [d.brief.prep, d.brief.matters, d.brief.last]];
|
|
543
|
-
region('stage', sig, () => stageBody(d, ph));
|
|
544
|
-
}
|
|
545
|
-
/** The stage: the material the meeting links, as a card, or the loaded preview; before the start, what is prepared. The phone shows it in a sheet. */
|
|
546
|
-
function stageBody(d, ph) {
|
|
547
|
-
const links = linksOf(d);
|
|
548
|
-
const cur = currentOf(d);
|
|
549
|
-
const pick = stagePick(d);
|
|
550
|
-
if (ph === 'before') {
|
|
551
|
-
const rows = beforeList(d, links);
|
|
552
|
-
return [sect({ ic: 'doc', title: 'Before it starts', attrs: { class: 'fc-stage', 'data-fc': 'stage', 'data-fc-stage': 'before' } },
|
|
553
|
-
rows.length ? el('ul', { class: 'list', role: 'list' }, ...rows) : [el('div', { class: 'fold' }, icon('moon', 'sm'), 'Nothing is prepared for this meeting yet. Nothing is linked in the invite.'), el('div', { class: 'iacts' }, addMaterialBtn())])];
|
|
554
|
-
}
|
|
555
|
-
if (!pick) return [sect({ ic: 'doc', title: 'Material', attrs: { class: 'fc-stage', 'data-fc': 'stage', 'data-fc-stage': 'none' } }, el('div', { class: 'fold' }, icon('moon', 'sm'), 'No material is linked to this meeting.'), el('div', { class: 'iacts' }, addMaterialBtn()))];
|
|
556
|
-
const right = links.length > 1 ? el('div', { class: 'seg', role: 'group', 'aria-label': 'Material', 'data-fc': 'material' },
|
|
557
|
-
...links.map((l, i) => button({ variant: 'ghost', label: [icon(l.preview ? 'doc' : 'out', 'sm'), l.app], attrs: { 'aria-pressed': String(l === pick), 'data-fc': 'material-pick', 'data-i': String(i), title: l.label } }))) : null;
|
|
558
|
-
const body = pick.preview && F.ui.preview === pick.url
|
|
559
|
-
? [el('div', { class: 'fc-frame', 'data-fc': 'preview-wrap' }, el('iframe', { src: pick.preview, title: 'Preview of ' + pick.label + ' in ' + pick.app, loading: 'lazy', referrerpolicy: 'no-referrer', allow: 'fullscreen',
|
|
560
|
-
sandbox: 'allow-scripts allow-same-origin allow-popups allow-forms', 'data-fc': 'preview', 'data-app': pick.kind })),
|
|
561
|
-
el('div', { class: 'fc-strip' }, el('span', { class: 'dim mono fc-src' }, icon('lock', 'sm'), 'Shown by ' + pick.app + ' itself. PMOS shows nothing to the room.'), el('span', { class: 'fc-grow' }), openBtn(pick), pick.present ? presentBtn(pick) : null)]
|
|
562
|
-
: [el('div', { class: 'fc-card', 'data-fc': 'link-card', 'data-fc-kind': pick.kind }, el('span', { class: 'ki' }, icon(pick.kind === 'pmos' ? (pick.pk === 'pmos-doc' ? 'doc' : 'report') : pick.preview ? 'doc' : 'out')),
|
|
563
|
-
el('div', { class: 'nb' }, el('b', null, pick.label), el('span', { class: 'dim mono' }, pick.app + (pick.host && pick.host !== pick.app ? ' · ' + pick.host : '') + (pick.topic ? ' · for ' + pick.topic : '') + (pick.you ? ' · you present it' : ''))), openBtn(pick), pick.present ? presentBtn(pick) : null),
|
|
564
|
-
pick.preview ? el('div', { class: 'fc-strip' }, el('span', { class: 'dim mono fc-src' }, icon('lock', 'sm'), 'PMOS loads nothing from ' + pick.app + ' until you ask.'), el('span', { class: 'fc-grow' }),
|
|
565
|
-
button({ variant: 'outline', label: [icon('eye', 'sm'), 'Show the preview here'], attrs: { 'data-fc': 'preview-on', title: 'Load the ' + pick.app + ' preview into this page' } })) : null];
|
|
566
|
-
return [sect({ ic: 'doc', title: cur ? 'Material · ' + cur.text : 'Material', right, attrs: { class: 'fc-stage', 'data-fc': 'stage', 'data-fc-stage': pick.preview && F.ui.preview === pick.url ? pick.kind : 'card' } }, ...body)];
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
/* ── captured, under the stage in the last minutes ─────────────────────────────────────────────────────────────── */
|
|
570
|
-
|
|
571
|
-
function capturedBody(d) {
|
|
572
|
-
const c = d.captured || { decisions: [], actions: [], questions: [] };
|
|
573
|
-
const col = (h, ic, items, render) => el('div', { class: 'fc-col' }, el('div', { class: 'dim mono fc-lbl' }, icon(ic, 'sm'), ' ' + h + ' ', el('span', { class: 'bdg g' }, String(items.length))),
|
|
574
|
-
items.length ? el('ul', { class: 'list', role: 'list' }, ...items.map(render)) : el('div', { class: 'fold' }, 'None yet'));
|
|
575
|
-
const row = (ic, text, chips) => el('li', { class: 'nrow' }, el('span', { class: 'ki' }, icon(ic)), el('div', { class: 'nb' }, el('span', { class: 'tt' }, text), el('div', { class: 'chips' }, ...chips)), el('span'));
|
|
576
|
-
return [el('div', { class: 'fc-capg', 'data-fc': 'captured-list' },
|
|
577
|
-
col('Decisions', 'scale', c.decisions, (x) => row('scale', x.text, [el('span', { class: 'tag' }, 'draft')])),
|
|
578
|
-
col('Actions', 'todo', c.actions, (x) => row('todo', x.text, [x.owner ? el('span', { class: 'tag' }, x.owner) : el('span', { class: 'tag fc-bad' }, 'no owner yet'), x.due ? el('span', { class: 'tag' }, 'due ' + x.due) : null, el('span', { class: 'tag' }, 'draft')])),
|
|
579
|
-
col('Open questions', 'reply', c.questions, (x) => row('reply', x.text, []))),
|
|
580
|
-
el('p', { class: 'dim fc-note' }, 'Drafts from the live note. After the meeting you confirm them once. Nothing is sent to anyone.')];
|
|
581
|
-
}
|
|
582
|
-
function drawCap(d, ph) {
|
|
583
|
-
const left = (endMs() - nowMs()) / 60000;
|
|
584
|
-
const show = (ph === 'during' && left <= LAST_MINUTES) || ph === 'after';
|
|
585
|
-
region('cap', [show, d.captured], () => (show ? [sect({ ic: 'check', title: 'Captured so far', attrs: { class: 'fc-captured', 'data-fc': 'captured-inline' } }, ...capturedBody(d))] : []));
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
/* ── the conversation ─────────────────────────────────────────────────────────────────────────────────────────── */
|
|
589
|
-
|
|
590
|
-
function actBtn(a) {
|
|
591
|
-
return pbtn('outline', a.label, a.url ? 'out' : null, { 'data-fc': 'act', 'data-i': 'x', onclick: () => (a.url ? openUrl(a.url) : openRef(a.ref)) });
|
|
592
|
-
}
|
|
593
|
-
function noteOpen(n, d, i, newest) {
|
|
594
|
-
const heard = n.heard ? el('span', { class: 'fc-re' }, n.heard) : null;
|
|
595
|
-
const why = n.pulledWhy || n.why;
|
|
596
|
-
return el('li', { class: 'fc-a' + (newest ? ' new' : ''), 'data-fc': 'note-card', 'data-cat': n.cat, 'data-open': 'true', 'aria-live': 'polite' },
|
|
597
|
-
el('span', { class: 'fc-who' }, el('span', { class: 'fc-avdot', 'aria-hidden': 'true' }, icon('spark', 'sm')), el('b', { class: 'mono' }, 'PMOS'), el('span', { class: 'fc-cat' }, n.cat), el('span', { class: 'dim mono fc-t' }, hhmm(n.at))),
|
|
598
|
-
heard, el('p', { class: 'fc-b' }, n.body),
|
|
599
|
-
(n.acts || []).length ? el('div', { class: 'fc-acts2' }, ...n.acts.map(actBtn)) : null,
|
|
600
|
-
el('span', { class: 'fc-meta dim' }, why ? el('span', null, el('b', null, 'Why now'), ' ' + why) : null, n.src ? el('span', null, 'from ' + n.src) : null),
|
|
601
|
-
newest ? button({ variant: 'ghost', label: icon('x', 'sm'), attrs: { class: 'fc-x', 'data-fc': 'fold', 'data-id': n.id, 'aria-label': 'Fold it', title: 'Fold it' } }) : null);
|
|
602
|
-
}
|
|
603
|
-
function noteShut(n) {
|
|
604
|
-
return el('li', { class: 'fc-a shut', 'data-fc': 'note-card', 'data-cat': n.cat, 'data-open': 'false' },
|
|
605
|
-
button({ variant: 'ghost', label: el('span', { class: 'fc-1' }, el('span', { class: 'fc-avdot', 'aria-hidden': 'true' }, icon('spark', 'sm')), el('span', { class: 'tag' }, n.cat), el('span', { class: 'fc-1t' }, n.body)), attrs: { class: 'fc-sb', 'data-fc': 'unfold', 'data-id': n.id, title: 'Open' } }));
|
|
606
|
-
}
|
|
607
|
-
function askBubble(a, err) {
|
|
608
|
-
return el('li', { class: 'fc-r me priv', 'data-fc': 'ask-q' }, el('span', { class: 'fc-who mono' }, 'You, to PMOS only'), el('p', null, a.question),
|
|
609
|
-
a.state === 'working' ? el('span', { class: 'dim mono fc-wait', role: 'status' }, 'PMOS is reading the record.') : null,
|
|
610
|
-
err ? el('span', { class: 'fc-err', role: 'status' }, 'PMOS could not answer: ' + err) : null);
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
function drawConversation(d) {
|
|
614
|
-
if (F.phone) { drawPhRoom(d); drawPhMe(d); return; }
|
|
615
|
-
const tail = (d.tail || []).slice(F.pop ? -1 : -2);
|
|
616
|
-
region('tick', tail, () => tail.map((x) => el('p', null, el('span', { class: 'mono' }, x.who), ' ' + x.text)));
|
|
617
|
-
const notes = d.notes || [];
|
|
618
|
-
const pulled = F.ui.pulled.map((id) => notes.find((n) => n.id === id)).filter(Boolean);
|
|
619
|
-
const held = notes.filter((n) => n.show === 'hold' && !F.ui.pulled.includes(n.id));
|
|
620
|
-
const shown = notes.filter((n) => n.show !== 'hold').concat(pulled.map((n) => ({ ...n, at: F.pulledAt && F.pulledAt[n.id] || n.at, pulledWhy: 'You asked for it early. PMOS was holding it ' + (n.when || 'for later') + '.' })));
|
|
621
|
-
const asks = (d.asks || []).slice();
|
|
622
|
-
for (const [id, p] of F.ui.pending) if (!asks.some((a) => a.id === id)) asks.push({ id, at: p.at, question: p.question, state: 'working' });
|
|
623
|
-
const items = [...shown.map((n) => ({ kind: 'note', at: n.at, n })), ...asks.map((a) => ({ kind: 'ask', at: a.at, a }))]
|
|
624
|
-
.map((x, i) => ({ ...x, i })).sort((a, b) => a.at - b.at || (a.kind === 'ask' ? -1 : 1) - (b.kind === 'ask' ? -1 : 1) || a.i - b.i);
|
|
625
|
-
let newestAt = -1; items.forEach((x, k) => { if (x.kind === 'note') newestAt = k; });
|
|
626
|
-
const comp = d.companion || {};
|
|
627
|
-
const recording = recState(d) === 'recording';
|
|
628
|
-
const listen = !recording ? 'PMOS listens when the meeting records.'
|
|
629
|
-
: comp.on ? 'PMOS is listening.' : 'PMOS is listening to the transcript only. The companion is off, so it adds no notes.';
|
|
630
|
-
const sig = [items.map((x) => x.kind === 'note' ? [x.n.id, x.n.show, x.n.pulledWhy ? 1 : 0] : [x.a.id, x.a.state]), newestAt, [...F.ui.open], [...F.ui.folded], held.map((n) => n.id), F.ui.heldOpen, listen, comp.error || '', [...F.ui.failed], recording];
|
|
631
|
-
const changed = region('stream', sig, () => {
|
|
632
|
-
const rows = items.map((x, k) => {
|
|
633
|
-
if (x.kind === 'ask') return askBubble(x.a, F.ui.failed.get(x.a.id));
|
|
634
|
-
const isNew = k === newestAt;
|
|
635
|
-
const open = isNew ? !F.ui.folded.has(x.n.id) : F.ui.open.has(x.n.id);
|
|
636
|
-
return open ? noteOpen(x.n, d, k, isNew) : noteShut(x.n);
|
|
637
|
-
});
|
|
638
|
-
if (held.length) {
|
|
639
|
-
const det = el('details', { class: 'fc-held', 'data-fc': 'held', ...(F.ui.heldOpen ? { open: true } : {}) },
|
|
640
|
-
el('summary', null, el('span', { class: 'fc-avdot', 'aria-hidden': 'true' }, icon('spark', 'sm')), 'PMOS is holding ' + held.length + ' for the right moment'),
|
|
641
|
-
el('ul', { role: 'list' }, ...held.map((n) => el('li', null, button({ variant: 'ghost', label: [el('span', { class: 'tag' }, n.cat), el('span', { class: 'fc-hw dim' }, n.when || '')], attrs: { class: 'fc-pl', 'data-fc': 'pull', 'data-id': n.id, title: 'Show it now' } })))));
|
|
642
|
-
det.addEventListener('toggle', () => { if (F) F.ui.heldOpen = det.open; });
|
|
643
|
-
rows.push(el('li', { class: 'fc-heldli' }, det));
|
|
644
|
-
}
|
|
645
|
-
rows.push(el('li', { class: 'fc-listen dim', 'data-fc': 'listening' }, el('span', { class: recording ? 'fc-dot' : 'fc-dot off' }), listen));
|
|
646
|
-
if (comp.error) rows.push(el('li', { class: 'fc-listen dim', role: 'status' }, comp.error));
|
|
647
|
-
return rows;
|
|
648
|
-
});
|
|
649
|
-
const nNotes = shown.length + asks.length;
|
|
650
|
-
if (changed && nNotes > F.seenNotes) { F.r.stream.scrollTop = F.r.stream.scrollHeight; }
|
|
651
|
-
F.seenNotes = nNotes;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
/* ── phone mode: two sides, like a translator app in conversation mode (v6) ─────────────────────────────────────────
|
|
655
|
-
The scrolling conversation was hard to follow live, so nothing scrolls. The room gets the top: its latest line, large,
|
|
656
|
-
and the one before it, faint. PMOS gets the bottom: only its newest note, large. ‹ › steps back through earlier notes;
|
|
657
|
-
a note that arrives while you look back shows as "1 newer". Held notes wait behind one chip. */
|
|
658
|
-
|
|
659
|
-
function drawPhRoom(d) {
|
|
660
|
-
const tail = (d.tail || []).slice(-2);
|
|
661
|
-
region('tick', tail, () => {
|
|
662
|
-
if (!tail.length) return [el('p', { class: 'fc-said-now dim', 'data-fc': 'said-now' }, recState(d) === 'recording' ? 'Listening to the room.' : 'PMOS hears the room when it records.')];
|
|
663
|
-
const line = (x, cls, fc) => el('p', { class: cls + (x.who === 'You' ? ' you' : ''), 'data-fc': fc }, el('span', { class: 'fc-sp mono' }, x.who), el('span', { class: 'fc-st' }, x.text));
|
|
664
|
-
const cur = tail[tail.length - 1]; const prev = tail.length > 1 ? tail[0] : null;
|
|
665
|
-
return [prev ? line(prev, 'fc-said-prev', 'said-prev') : null, line(cur, 'fc-said-now', 'said-now')];
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
/** What PMOS has shown you, oldest first: notes, notes you pulled in early, and questions not answered yet (an answer carries its question). */
|
|
669
|
-
function phItems(d) {
|
|
670
|
-
const notes = d.notes || [];
|
|
671
|
-
const pulled = F.ui.pulled.map((id) => notes.find((n) => n.id === id)).filter(Boolean);
|
|
672
|
-
const shown = notes.filter((n) => n.show !== 'hold').concat(pulled.map((n) => ({ ...n, at: F.pulledAt && F.pulledAt[n.id] || n.at, pulledWhy: 'You asked for it early. PMOS was holding it ' + (n.when || 'for later') + '.' })));
|
|
673
|
-
const asks = (d.asks || []).slice();
|
|
674
|
-
for (const [id, p] of F.ui.pending) if (!asks.some((a) => a.id === id)) asks.push({ id, at: p.at, question: p.question, state: 'working' });
|
|
675
|
-
const answered = new Set(shown.map((n) => n.ask).filter(Boolean));
|
|
676
|
-
const qOf = new Map(asks.map((a) => [a.id, a.question]));
|
|
677
|
-
return [...shown.map((n) => ({ kind: 'note', at: n.at, n, q: n.ask ? qOf.get(n.ask) || '' : '' })), ...asks.filter((a) => !answered.has(a.id) && a.state !== 'answered').map((a) => ({ kind: 'ask', at: a.at, a }))]
|
|
678
|
-
.map((x, i) => ({ ...x, i })).sort((a, b) => a.at - b.at || a.i - b.i);
|
|
679
|
-
}
|
|
680
|
-
function drawPhMe(d) {
|
|
681
|
-
const items = phItems(d); const N = items.length; const last = N - 1;
|
|
682
|
-
const i = F.ui.ni == null ? last : Math.max(0, Math.min(F.ui.ni, last));
|
|
683
|
-
const newer = F.ui.ni == null ? 0 : last - i;
|
|
684
|
-
const held = (d.notes || []).filter((n) => n.show === 'hold' && !F.ui.pulled.includes(n.id));
|
|
685
|
-
const comp = d.companion || {}; const recording = recState(d) === 'recording';
|
|
686
|
-
const x = items[i];
|
|
687
|
-
const sig = [items.map((y) => y.kind === 'note' ? [y.n.id, y.n.pulledWhy ? 1 : 0, y.q] : [y.a.id, y.a.state]), i, newer, held.map((n) => n.id), recording, !!comp.on, comp.error || '', [...F.ui.failed]];
|
|
688
|
-
region('stream', sig, () => {
|
|
689
|
-
const head = el('div', { class: 'fc-mh' }, el('span', { class: 'fc-side mono' }, icon('spark', 'sm'), 'PMOS, to you'),
|
|
690
|
-
N > 1 ? el('span', { class: 'fc-pg' }, ib('Earlier note', 'prev', { 'data-fc': 'pg-prev', ...(i === 0 ? { disabled: '' } : {}) }), el('span', { class: 'mono', 'data-fc': 'pg-at' }, (i + 1) + ' of ' + N), ib('Later note', 'next', { 'data-fc': 'pg-next', ...(i === last ? { disabled: '' } : {}) })) : null);
|
|
691
|
-
let body;
|
|
692
|
-
if (!x) body = el('p', { class: 'fc-b dim', 'data-fc': 'listening' }, !recording ? 'PMOS listens when the meeting records.' : comp.on === false ? 'PMOS is listening to the transcript only. The companion is off, so it adds no notes.' : 'Listening. A note shows here when it helps.');
|
|
693
|
-
else if (x.kind === 'ask') {
|
|
694
|
-
const err = F.ui.failed.get(x.a.id);
|
|
695
|
-
body = el('div', { class: 'fc-onote', 'data-fc': 'ask-q' }, el('span', { class: 'fc-re' }, 'You asked: ' + x.a.question),
|
|
696
|
-
el('p', { class: 'fc-b dim', role: 'status' }, err ? 'PMOS could not answer: ' + err : 'PMOS is reading the record.'));
|
|
697
|
-
} else {
|
|
698
|
-
const n = x.n; const why = n.pulledWhy || n.why;
|
|
699
|
-
body = el('div', { class: 'fc-onote', 'data-fc': 'note-card', 'data-cat': n.cat },
|
|
700
|
-
el('span', { class: 'fc-cath' }, el('b', null, n.cat), el('span', { class: 'dim mono' }, hhmm(n.at)),
|
|
701
|
-
newer ? button({ variant: 'ghost', label: [newer + ' newer', icon('next', 'sm')], attrs: { class: 'fc-newer', 'data-fc': 'pg-newest', title: 'Show the newest note' } }) : null),
|
|
702
|
-
x.q ? el('span', { class: 'fc-re' }, 'You asked: ' + x.q) : n.heard ? el('span', { class: 'fc-re' }, n.heard) : null,
|
|
703
|
-
el('p', { class: 'fc-b' }, n.body),
|
|
704
|
-
(n.acts || []).length ? el('div', { class: 'fc-acts2' }, ...n.acts.map(actBtn)) : null,
|
|
705
|
-
el('span', { class: 'fc-meta dim' }, why ? el('span', null, el('b', null, 'Why now'), ' ' + why) : null, n.src ? el('span', null, 'from ' + n.src) : null));
|
|
706
|
-
}
|
|
707
|
-
return [head, body,
|
|
708
|
-
N > 1 ? el('div', { class: 'fc-dots', 'aria-hidden': 'true' }, ...items.map((_, k) => el('i', { class: 'fc-pdot' + (k === i ? ' fc-on' : '') }))) : null,
|
|
709
|
-
held.length ? button({ variant: 'ghost', label: [icon('clock', 'sm'), 'Holding ' + held.length + ' for later'], attrs: { class: 'fc-heldc', 'data-fc': 'held', title: 'What PMOS is holding for the right moment' } }) : null,
|
|
710
|
-
comp.error ? el('p', { class: 'dim fc-note', role: 'status' }, comp.error) : null];
|
|
711
|
-
});
|
|
712
|
-
if (N > F.seenNotes && F.ui.ni == null && F.seenNotes) { const m = F.r.me; m.classList.remove('fc-arr'); void m.offsetWidth; m.classList.add('fc-arr'); }
|
|
713
|
-
F.seenNotes = N;
|
|
714
|
-
}
|
|
715
|
-
function heldBuild() {
|
|
716
|
-
const held = (F.data.notes || []).filter((n) => n.show === 'hold' && !F.ui.pulled.includes(n.id));
|
|
717
|
-
return [el('div', { class: 'fc-heldsheet', 'data-fc': 'held-sheet' },
|
|
718
|
-
el('p', { class: 'dim fc-note' }, 'Each one waits for the moment it fits. Pull one in now if you want it early.'),
|
|
719
|
-
held.length ? el('ul', { class: 'list', role: 'list' }, ...held.map((n) => el('li', { class: 'nrow' }, el('span', { class: 'ki' }, icon('clock')),
|
|
720
|
-
el('div', { class: 'nb' }, el('span', { class: 'tt' }, n.cat), n.when ? el('div', { class: 'dim fc-note' }, 'Shows ' + n.when) : null),
|
|
721
|
-
pbtn('outline', 'Now', null, { 'data-fc': 'pull', 'data-id': n.id, title: 'Show it now' })))) : el('p', { class: 'dim fc-note' }, 'Nothing is held.'))];
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
function askForm() {
|
|
725
|
-
const input = el('input', { type: 'text', 'aria-label': 'Ask PMOS, only you see it', placeholder: 'Ask PMOS quietly', maxlength: '500', autocomplete: 'off', 'data-fc': 'ask-input' });
|
|
726
|
-
const form = el('form', { class: 'fc-in', 'data-fc': 'ask-form' }, input, ib('Ask', 'next', { type: 'submit', 'data-fc': 'ask' }));
|
|
727
|
-
form.addEventListener('submit', (e) => { e.preventDefault(); const q = input.value.trim(); if (!q) return; input.value = ''; ask(q); });
|
|
728
|
-
return form;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
async function ask(question) {
|
|
732
|
-
const f = F; if (!f || !f.data) return;
|
|
733
|
-
const body = { event: f.data.event.id, date: f.date, question };
|
|
734
|
-
if (f.data.note) body.note = f.data.note.id;
|
|
735
|
-
if (wsParam()) body.ws = wsParam();
|
|
736
|
-
const at = nowMs();
|
|
737
|
-
const r = await pmPost('/api/meeting-focus/ask', body);
|
|
738
|
-
if (F !== f) return;
|
|
739
|
-
if (!r || !r.ok) { toast({ text: (r && r.error) || 'The question was not sent.', tone: 'error' }); return; }
|
|
740
|
-
f.ui.pending.set(r.id, { question, at }); f.ui.ni = null;
|
|
741
|
-
draw();
|
|
742
|
-
const t = setInterval(async () => {
|
|
743
|
-
const s = await pmGet('/api/meeting-focus/ask?id=' + encodeURIComponent(r.id));
|
|
744
|
-
if (F !== f) { clearInterval(t); return; }
|
|
745
|
-
if (s && s.ok && s.state === 'working') return;
|
|
746
|
-
clearInterval(t); f.askTimers.delete(r.id);
|
|
747
|
-
if (s && s.ok && s.state === 'answered') f.ui.pending.delete(r.id);
|
|
748
|
-
else f.ui.failed.set(r.id, (s && s.error) || 'The agent did not answer.');
|
|
749
|
-
await load();
|
|
750
|
-
}, 1500);
|
|
751
|
-
f.askTimers.set(r.id, t);
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
/* ── the clock ────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
755
|
-
|
|
756
|
-
function tick() {
|
|
757
|
-
if (!F || !F.data) return;
|
|
758
|
-
const d = F.data; const n = nowMs(); const s = startMs(); const f = endMs();
|
|
759
|
-
if (F.shotsSeen !== shotsSig()) { const first = F.shotsSeen === undefined; F.shotsSeen = shotsSig(); if (!first) { draw(); return; } } // Pause shots was pressed elsewhere
|
|
760
|
-
if (phaseOf() !== F.sig.phase) { F.sig.phase = phaseOf(); if (F.sig.phaseSet) { draw(); return; } F.sig.phaseSet = true; }
|
|
761
|
-
const set = (k, v) => { for (const x of document.querySelectorAll('[data-fc="' + k + '"]')) if (x.textContent !== v) x.textContent = v; };
|
|
762
|
-
const ph = phaseOf();
|
|
763
|
-
if (ph === 'before') set('big', clockText((s - n) / 1000));
|
|
764
|
-
else { set('big', clockText((n - s) / 1000)); if (Number.isFinite(f)) set('left', clockText((f - n) / 1000)); }
|
|
765
|
-
const total = Number.isFinite(f) ? (f - s) / 60000 : 60;
|
|
766
|
-
const nm = F.root.querySelector('[data-fc="nowm"]'); if (nm) nm.style.setProperty('--fc-left', Math.max(0, Math.min(100, (n - s) / 60000 / total * 100)) + '%');
|
|
767
|
-
const run = openRunOf(d);
|
|
768
|
-
if (run) {
|
|
769
|
-
set('onfor', clockText((n - (s + run.from_min * 60000)) / 1000));
|
|
770
|
-
const cr = F.root.querySelector('[data-fc="currun"]'); if (cr) cr.style.setProperty('--fc-width', Math.min(100, Math.max(0, ((n - s) / 60000 - run.from_min) / total * 100)) + '%');
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
/* ── side sheets: Topics and Captured ─────────────────────────────────────────────────────────────────────────── */
|
|
775
|
-
|
|
776
|
-
function refreshSheet(force) {
|
|
777
|
-
if (!F || !F.sheetOpen || !F.sheet) return;
|
|
778
|
-
if (!force && (F.sheet.kind === 'material' || F.sheet.kind === 'stop' || F.sheet.kind === 'chip')) return; // a loaded preview is not loaded again on each read
|
|
779
|
-
if (!force && F.sheet.kind === 'note') readNote();
|
|
780
|
-
const b = F.sheet.body;
|
|
781
|
-
if (!b.isConnected) return;
|
|
782
|
-
const a = document.activeElement;
|
|
783
|
-
if (a && b.contains(a) && a.matches('input, textarea')) return; // not under the cursor
|
|
784
|
-
put(b, ...F.sheet.build());
|
|
785
|
-
}
|
|
786
|
-
function showSheet(kind, title, ic, build) {
|
|
787
|
-
const s = openSheet({ title, icon: ic, onClose: () => { if (F) { F.sheetOpen = false; F.sheet = null; F.ui.picker = false; F.ui.newTopic = false; F.ui.addTopic = false; } } });
|
|
788
|
-
F.sheet = { kind, body: s.body, build }; F.sheetOpen = true;
|
|
789
|
-
put(s.body, ...build());
|
|
790
|
-
return s;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
async function postTopic(action, topic) {
|
|
794
|
-
const f = F; if (!f || !f.data) return false;
|
|
795
|
-
const body = { event: f.data.event.id, date: f.date, action, topic };
|
|
796
|
-
if (f.data.note) body.note = f.data.note.id;
|
|
797
|
-
if (wsParam()) body.ws = wsParam();
|
|
798
|
-
const r = await pmPost('/api/meeting-focus/topic', body);
|
|
799
|
-
if (F !== f) return false;
|
|
800
|
-
if (!r || !r.ok) { toast({ text: (r && r.error) || 'The correction was not saved.', tone: 'error' }); return false; }
|
|
801
|
-
f.ui.picker = false; f.ui.newTopic = false; f.ui.addTopic = false;
|
|
802
|
-
await load();
|
|
803
|
-
return true;
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
function inlineForm(label, placeholder, onSubmit, attr) {
|
|
807
|
-
const input = el('input', { type: 'text', 'aria-label': label, placeholder, maxlength: '120', 'data-fc': attr, autocomplete: 'off' });
|
|
808
|
-
const form = el('form', { class: 'fc-addf' }, input, pbtn('primary', 'Add', null, { type: 'submit', 'data-fc': attr + '-go' }));
|
|
809
|
-
form.addEventListener('submit', (e) => { e.preventDefault(); const v = input.value.trim(); if (v) onSubmit(v); });
|
|
810
|
-
queueMicrotask(() => { if (input.isConnected) input.focus(); });
|
|
811
|
-
return form;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
function topicsBuild() {
|
|
815
|
-
const d = F.data; const ph = phaseOf();
|
|
816
|
-
const cur = currentOf(d);
|
|
817
|
-
const rows = d.topics.map((t, i) => {
|
|
818
|
-
const now = t.state === 'now';
|
|
819
|
-
const ki = t.state === 'discussed' ? icon('check') : now ? icon('play') : t.state === 'parked' ? icon('clock') : el('span', { class: 'mono' }, String(i + 1));
|
|
820
|
-
const chips = [
|
|
821
|
-
t.src === 'added' ? el('span', { class: 'tag fc-acc' }, icon('plus', 'sm'), 'came up ' + (t.at ? hhmm(t.at) : '') + (t.by && t.by !== 'PMOS' ? ' · ' + t.by : '')) : t.src === 'pm' ? el('span', { class: 'tag fc-acc' }, icon('plus', 'sm'), 'added by you') : el('span', { class: 'tag' }, t.src === 'last' ? 'from the last note' : 'from the invite'),
|
|
822
|
-
t.state === 'discussed' ? el('span', { class: 'tag' }, t.minutes + ' min') : null,
|
|
823
|
-
t.state === 'parked' ? el('span', { class: 'tag fc-warn' }, 'parked') : null,
|
|
824
|
-
t.state === 'notyet' && cur ? el('span', { class: 'tag' }, 'not yet') : null,
|
|
825
|
-
];
|
|
826
|
-
const run = now ? openRunOf(d) : null;
|
|
827
|
-
return el('li', { class: 'nrow fc-ai' + (now ? ' cur' : '') + (t.state === 'discussed' || t.state === 'parked' ? ' done' : ''), 'data-fc-topic': t.id, 'data-state': t.state, ...(now ? { 'aria-current': 'true' } : {}) },
|
|
828
|
-
el('span', { class: 'ki' + (now ? ' hot' : '') }, ki),
|
|
829
|
-
el('div', { class: 'nb' }, el('span', { class: 'tt' }, t.text), el('div', { class: 'chips' }, ...chips),
|
|
830
|
-
now ? [el('div', { class: 'fc-cd' }, el('b', { class: 'mono', 'data-fc': 'onfor' }, run ? clockText((nowMs() - (startMs() + run.from_min * 60000)) / 1000) : ''), el('span', { class: 'dim mono' }, 'on this' + (t.minutes > 0 && run ? '' : ''))),
|
|
831
|
-
t.by === 'PMOS' || t.src === 'added' ? el('p', { class: 'dim fc-src' }, icon('spark', 'sm'), ' PMOS picked this up from the talk.') : null,
|
|
832
|
-
el('div', { class: 'iacts' }, pbtn('outline', 'Not this topic', null, { 'data-fc': 'picker', 'aria-expanded': String(F.ui.picker) }), pbtn('ghost', 'Park it', 'clock', { 'data-fc': 'park' })),
|
|
833
|
-
F.ui.picker ? el('div', { class: 'fc-pick', role: 'group', 'aria-label': 'The room is on' }, ...d.topics.filter((x) => x.id !== t.id).map((x) => lk({ 'data-fc': 'pick', 'data-text': x.text }, topicNo(d, x.id) + '. ' + x.text)),
|
|
834
|
-
lk({ 'data-fc': 'new-topic' }, icon('plus', 'sm'), 'Something new')) : null,
|
|
835
|
-
F.ui.newTopic ? inlineForm('The topic the room is on', 'Name the topic', (v) => postTopic('set', v), 'new-input') : null] : null),
|
|
836
|
-
el('span'));
|
|
837
|
-
});
|
|
838
|
-
const added = d.topics.filter((t) => t.src === 'added').length;
|
|
839
|
-
const from = d.topics.some((t) => t.src === 'steps') ? "the meeting's steps" : d.topics.some((t) => t.src === 'purpose') ? "the meeting's purpose" : 'the meeting card';
|
|
840
|
-
return [sect({ ic: 'todo', title: 'Topics', count: d.topics.length, right: pbtn('ghost', 'Add topic', 'plus', { 'data-fc': 'add-topic' }), attrs: { 'data-fc': 'topics-sheet' } },
|
|
841
|
-
F.ui.addTopic ? inlineForm('A new topic', 'Name the topic', (v) => postTopic('add', v), 'add-input') : null,
|
|
842
|
-
rows.length ? el('ul', { class: 'list', role: 'list' }, ...rows) : el('div', { class: 'fold' }, 'No topics yet. Add one, or PMOS adds topics as they come up.'),
|
|
843
|
-
el('p', { class: 'dim fc-src' }, 'Starts from ' + from + (added ? '; ' + added + ' added from the talk' : '') + '. PMOS marks the topic the room is on and adds topics that come up. Topics have no time limits; the minutes show how long each one took.'))];
|
|
844
|
-
}
|
|
845
|
-
function capturedBuild() { return [sect({ ic: 'check', title: 'Captured so far', attrs: { 'data-fc': 'captured-sheet' } }, ...capturedBody(F.data))]; }
|
|
846
|
-
|
|
847
|
-
/* ── opening what a chip or an action names ───────────────────────────────────────────────────────────────────── */
|
|
848
|
-
|
|
849
|
-
function openUrl(url) { try { window.open(classify(url).url, '_blank', 'noopener,noreferrer'); } catch { /* a blocked pop-up */ } }
|
|
850
|
-
const goTab = (id) => { const b = document.querySelector('[data-c3-tab="' + id + '"]'); if (b) b.click(); };
|
|
851
|
-
function openRef(ref) {
|
|
852
|
-
if (!ref) return;
|
|
853
|
-
const t = ref.type;
|
|
854
|
-
if (F && F.pop) { openFull(); return; } // the compact page is a small frame: what a note names opens in the full page
|
|
855
|
-
if (F && F.phone) { // the phone has no desktop pages to go to
|
|
856
|
-
if (t === 'note' && F.data && F.data.note && ref.id === F.data.note.id) openNoteSheet(); else toast('That opens on your computer.');
|
|
857
|
-
return;
|
|
858
|
-
}
|
|
859
|
-
closeFocus();
|
|
860
|
-
if (t === 'initiative') { import('./c3-init-extras.js').then((m) => { if (!m.goInitiative(ref.id)) goTab('init'); }).catch(() => goTab('init')); return; }
|
|
861
|
-
if (t === 'note') { window.dispatchEvent(new CustomEvent('c3-open-note', { detail: { id: ref.id } })); return; }
|
|
862
|
-
if (t === 'item') { goTab('work'); return; }
|
|
863
|
-
if (t === 'plan-item' || t === 'release' || t === 'jira' || t === 'ask') {
|
|
864
|
-
if (ref.initiative) import('./c3-init-extras.js').then((m) => { if (!m.goInitiative(ref.initiative)) goTab('init'); }).catch(() => goTab('init')); else goTab('init');
|
|
865
|
-
return;
|
|
866
|
-
}
|
|
867
|
-
if (t === 'report') { goTab('rep'); return; }
|
|
868
|
-
if (t === 'event') { goTab('cal'); return; }
|
|
869
|
-
goTab(t === 'decision' ? 'brief' : 'init');
|
|
870
|
-
}
|
|
871
|
-
function openChip(c) {
|
|
872
|
-
if (!c) return;
|
|
873
|
-
if (c.ref && !(F && F.phone && (c.detail || c.sub))) { openRef(c.ref); return; }
|
|
874
|
-
if (c.url) { openUrl(c.url); return; }
|
|
875
|
-
showSheet('chip', c.label, 'doc', () => [el('div', { class: 'fc-chipsheet', 'data-fc': 'chip-sheet' }, el('p', { class: 'fc-p' }, c.detail || c.sub || c.label), c.from ? el('p', { class: 'dim fc-note' }, 'From ' + c.from + '.') : null)]);
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
/* ── recording ────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
879
|
-
|
|
880
|
-
async function startRecording() {
|
|
881
|
-
const f = F; if (!f || !f.data) return;
|
|
882
|
-
const e = f.data.event;
|
|
883
|
-
if (isDemo()) { const m = await import('./shell-recording.js'); m.simStart(e.title); return; }
|
|
884
|
-
const dock = await import('./note-dock.js');
|
|
885
|
-
const asEvent = { ...(f.ev0 || {}), id: baseId(e.id), start: e.at, end: e.end || null, title: e.title, attendees: e.attendees || [], initiative: (f.ev0 && f.ev0.initiative) || e.initiative || null };
|
|
886
|
-
await dock.recordEvent(asEvent);
|
|
887
|
-
setTimeout(() => { if (F === f) load(); }, 600);
|
|
888
|
-
}
|
|
889
|
-
async function endMeeting() {
|
|
890
|
-
const f = F; if (!f) return;
|
|
891
|
-
if (isDemo()) { const m = await import('./shell-recording.js'); m.simDock.stopNow(); return; }
|
|
892
|
-
const dock = await import('./note-dock.js');
|
|
893
|
-
await dock.stopNow();
|
|
894
|
-
setTimeout(() => { if (F === f) load(); }, 600);
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
/* ── presses ──────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
898
|
-
|
|
899
|
-
/** Add material, and Open, Present and Audience view of the PM's PMOS material. True when the press was one of these. */
|
|
900
|
-
function materialPress(k, t) {
|
|
901
|
-
const d = F && F.data; if (!d) return false;
|
|
902
|
-
if (k === 'mat-add') {
|
|
903
|
-
const e = d.event || {};
|
|
904
|
-
openAddMaterial({ event: { id: e.id, title: e.title, at: e.at, series: e.series, initiative: e.initiative, links: e.links }, date: d.date, brief: d.brief });
|
|
905
|
-
return true;
|
|
906
|
-
}
|
|
907
|
-
if (k !== 'pm-open' && k !== 'pm-present' && k !== 'pm-audience') return false;
|
|
908
|
-
const l = linksOf(d)[Number(t.dataset.i)];
|
|
909
|
-
if (l && l.mat) (k === 'pm-present' ? presentItem : k === 'pm-audience' ? audienceItem : openItem)(l.mat);
|
|
910
|
-
return true;
|
|
911
|
-
}
|
|
912
|
-
// the material was added or removed on the Calendar card or in the sheet: read the meeting again, so it shows at once
|
|
913
|
-
window.addEventListener('c3-material-changed', () => { if (F && !F.noteId) load(); });
|
|
914
|
-
|
|
915
|
-
function onClick(ev) {
|
|
916
|
-
const t = ev.target.closest('[data-fc]'); if (!t || !F || !F.root.contains(t)) return;
|
|
917
|
-
const k = t.dataset.fc; const d = F.data;
|
|
918
|
-
if (k === 'leave') { closeFocus(); return; }
|
|
919
|
-
if (k === 'pill') { setPill(!F.ui.pill); return; }
|
|
920
|
-
if (k === 'pop-open') { openFull(); return; }
|
|
921
|
-
if (k === 'choice') { const c = (F.choices || [])[Number(t.dataset.i)]; if (c) chooseMeeting(c, String(c.at || '').slice(0, 10)); return; }
|
|
922
|
-
if (!d) return;
|
|
923
|
-
if (materialPress(k, t)) return;
|
|
924
|
-
if (k === 'topics') { showSheet('topics', 'Topics', 'todo', topicsBuild); return; }
|
|
925
|
-
if (k === 'captured') { showSheet('captured', 'Captured so far', 'check', capturedBuild); return; }
|
|
926
|
-
if (k === 'note' && F.phone) { openNoteSheet(); return; }
|
|
927
|
-
if (k === 'material') { showSheet('material', linksOf(d).some((l) => l.kind === 'slides') ? 'Your slides' : 'Material', 'doc', materialBuild); return; }
|
|
928
|
-
if (k === 'stop') { showSheet('stop', d.talk ? 'Stop recording?' : 'Stop recording ' + d.event.title + '?', 'stop', stopBuild); return; }
|
|
929
|
-
if (k === 'note') { const id = d.note && d.note.id; closeFocus(); if (id) window.dispatchEvent(new CustomEvent('c3-open-note', { detail: { id } })); return; }
|
|
930
|
-
if (k === 'chip') { openChip(F.chips[Number(t.dataset.i)]); return; }
|
|
931
|
-
if (k === 'preview-on') { const pk = stagePick(d); F.ui.preview = pk && pk.url; drawStage(d, phaseOf()); return; }
|
|
932
|
-
if (k === 'material-pick') { F.ui.stage = Number(t.dataset.i) || 0; F.ui.stagePin = true; drawStage(d, phaseOf()); return; }
|
|
933
|
-
if (k === 'open-link' || k === 'present') { openUrl(t.dataset.url); return; }
|
|
934
|
-
if (k === 'start') { startRecording(); return; }
|
|
935
|
-
if (k === 'end') { endMeeting(); return; }
|
|
936
|
-
if (k === 'pg-prev' || k === 'pg-next') { const N = phItems(d).length; const i = F.ui.ni == null ? N - 1 : F.ui.ni; const j = k === 'pg-prev' ? Math.max(0, i - 1) : i + 1; F.ui.ni = j >= N - 1 ? null : j; drawConversation(d); return; }
|
|
937
|
-
if (k === 'pg-newest') { F.ui.ni = null; drawConversation(d); return; }
|
|
938
|
-
if (k === 'held' && F.phone) { showSheet('held', 'PMOS is holding', 'clock', heldBuild); return; }
|
|
939
|
-
if (k === 'fold') { F.ui.folded.add(t.dataset.id); drawConversation(d); return; }
|
|
940
|
-
if (k === 'unfold') { const id = t.dataset.id; if (F.ui.open.has(id)) F.ui.open.delete(id); else F.ui.open.add(id); F.ui.folded.delete(id); drawConversation(d); return; }
|
|
941
|
-
if (k === 'pull') {
|
|
942
|
-
const id = t.dataset.id; F.ui.pulled.push(id); (F.pulledAt ||= {})[id] = nowMs(); F.ui.folded.clear();
|
|
943
|
-
for (const x of document.querySelectorAll('[data-fc="held"]')) x.open = false; F.ui.heldOpen = false;
|
|
944
|
-
drawConversation(d); return;
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
// the side sheets live outside the page's root, so their presses are caught on the document
|
|
949
|
-
document.addEventListener('click', (ev) => {
|
|
950
|
-
if (F && ev.target.closest && F.root.contains(ev.target)) { onClick(ev); return; }
|
|
951
|
-
if (!F || !F.sheetOpen || !F.sheet) return;
|
|
952
|
-
const t = ev.target.closest && ev.target.closest('[data-shell="sheet"] [data-fc]'); if (!t) return;
|
|
953
|
-
const k = t.dataset.fc;
|
|
954
|
-
if (materialPress(k, t)) return;
|
|
955
|
-
if (k === 'picker') { F.ui.picker = !F.ui.picker; F.ui.newTopic = false; refreshSheet(); return; }
|
|
956
|
-
if (k === 'new-topic') { F.ui.newTopic = true; refreshSheet(); return; }
|
|
957
|
-
if (k === 'pick') { const text = t.dataset.text; postTopic('set', text).then((ok) => { if (ok) { closeSheet(); toast('Now on: ' + text + '.'); } }); return; }
|
|
958
|
-
if (k === 'park') {
|
|
959
|
-
const cur = currentOf(F.data); if (!cur) return;
|
|
960
|
-
const others = F.data.topics.some((x) => x.id !== cur.id && x.state === 'notyet');
|
|
961
|
-
postTopic('park', cur.text).then((ok) => { if (ok) closeSheet(); return ok; }).then((ok) => { if (ok) toast(others ? 'Parked. It stays in the note as an open topic.' : 'Parked. Every other topic is covered.'); });
|
|
962
|
-
return;
|
|
963
|
-
}
|
|
964
|
-
if (k === 'add-topic') { F.ui.addTopic = !F.ui.addTopic; refreshSheet(); return; }
|
|
965
|
-
if (k === 'open-link' || k === 'present') { openUrl(t.dataset.url); return; }
|
|
966
|
-
if (k === 'preview-on') { const pk = stagePick(F.data); F.ui.preview = pk && pk.url; refreshSheet(true); return; }
|
|
967
|
-
if (k === 'material-pick') { F.ui.stage = Number(t.dataset.i) || 0; F.ui.stagePin = true; refreshSheet(true); return; }
|
|
968
|
-
if (k === 'note-tab') { F.ui.noteTab = t.dataset.tab === 'said' ? 'said' : 'note'; refreshSheet(true); return; }
|
|
969
|
-
if (k === 'stop-keep') { closeSheet(); return; }
|
|
970
|
-
if (k === 'pull') { const id = t.dataset.id; F.ui.pulled.push(id); (F.pulledAt ||= {})[id] = nowMs(); F.ui.ni = null; closeSheet(); drawConversation(F.data); return; }
|
|
971
|
-
if (k === 'stop-ok') { closeSheet(); endMeeting().then(() => { if (F && F.phone) closeFocus(); }); return; }
|
|
972
|
-
if (k === 'stop-replay') { endAndReplay(); return; } // End and open the replay
|
|
973
|
-
});
|
|
974
|
-
|
|
975
|
-
/** Stop the recording, leave Focus and open the meeting replay on the note (c3-replay.js). */
|
|
976
|
-
async function endAndReplay() {
|
|
977
|
-
const f = F; const note = f && f.data && f.data.note && f.data.note.id; if (!f || !note) return;
|
|
978
|
-
closeSheet();
|
|
979
|
-
await endMeeting();
|
|
980
|
-
if (F !== f) return;
|
|
981
|
-
closeFocus();
|
|
982
|
-
import('./c3-replay.js').then((m) => m.openReplay({ note })).catch(() => toast('The replay could not load.'));
|
|
983
|
-
}
|