gloomberb 0.15.7 → 0.16.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/README.md +11 -2
- package/package.json +1 -1
- package/src/api-client/app-attention.ts +147 -0
- package/src/api-client/attention.ts +26 -0
- package/src/api-client/awards.ts +215 -0
- package/src/api-client/catalysts.ts +160 -0
- package/src/api-client/chat.ts +137 -14
- package/src/api-client/company-kpis.ts +153 -0
- package/src/api-client/cpi.ts +52 -0
- package/src/api-client/credit-documents.ts +107 -0
- package/src/api-client/data.ts +192 -3
- package/src/api-client/distress.ts +164 -0
- package/src/api-client/doe.ts +75 -0
- package/src/api-client/equity-screener.ts +11 -0
- package/src/api-client/exposure.ts +202 -0
- package/src/api-client/gpu.ts +93 -0
- package/src/api-client/hiring.ts +110 -0
- package/src/api-client/index.ts +78 -3
- package/src/api-client/normalizers.ts +31 -1
- package/src/api-client/paths.ts +3 -0
- package/src/api-client/perps.ts +127 -0
- package/src/api-client/power.ts +148 -0
- package/src/api-client/request.ts +58 -1
- package/src/api-client/research-activity.ts +172 -13
- package/src/api-client/socket.ts +75 -27
- package/src/api-client/supply-chain-graph.ts +40 -0
- package/src/api-client/supply-chain.ts +98 -0
- package/src/api-client/telemetry.ts +29 -0
- package/src/api-client/themes.ts +28 -0
- package/src/api-client/types.ts +33 -1
- package/src/api-client/wall-experiments.ts +100 -0
- package/src/api-client/wall-summary.ts +49 -0
- package/src/api-client/web-experiments.ts +136 -0
- package/src/app/pane-runtime/plugin-bindings.ts +5 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +8 -2
- package/src/app/runtime/update.ts +13 -1
- package/src/cli/commands/system.ts +2 -0
- package/src/cli/desktop-pane-shot.ts +3 -4
- package/src/cli/pane-functions/data.ts +78 -0
- package/src/cli/pane-functions/financial-ratio-shot.ts +160 -0
- package/src/cli/pane-functions/function-help.ts +220 -8
- package/src/cli/pane-functions/headless.ts +4 -0
- package/src/cli/pane-functions/screenshot-evidence.ts +21 -0
- package/src/cli/pane-functions/screenshot.ts +49 -5
- package/src/components/chart/composite/composite-chart.tsx +15 -2
- package/src/components/chart/composite/format.ts +24 -11
- package/src/components/chart/composite/rasterizer.ts +67 -16
- package/src/components/chart/composite/scene.ts +53 -2
- package/src/components/chart/composite/session-shading.ts +3 -2
- package/src/components/chart/composite/text-renderer.ts +52 -1
- package/src/components/chart/composite/time-axis.ts +100 -30
- package/src/components/chart/composite/tools.ts +2 -1
- package/src/components/chart/composite/types.ts +4 -0
- package/src/components/chart-table/index.ts +1 -0
- package/src/components/chart-table/layout.ts +15 -0
- package/src/components/command-bar/action-runtime.ts +1 -0
- package/src/components/command-bar/commands/direct/index.ts +32 -0
- package/src/components/command-bar/commands/registry.ts +7 -0
- package/src/components/command-bar/pane-templates/items.ts +11 -0
- package/src/components/command-bar/pane-templates/workflow.ts +19 -4
- package/src/components/command-bar/routes/root/command-items.ts +6 -0
- package/src/components/command-bar/routes/root/provider-search.ts +2 -0
- package/src/components/command-bar/routes/root/results.ts +64 -0
- package/src/components/command-bar/routes/root/runtime.ts +8 -0
- package/src/components/command-bar/routes/ticker-search/results.ts +89 -24
- package/src/components/command-bar/routes/ticker-search/route.ts +2 -0
- package/src/components/command-bar/surface/index.tsx +15 -0
- package/src/components/command-bar/view-model.ts +3 -0
- package/src/components/command-bar/workflow/collection-actions.ts +9 -7
- package/src/components/command-bar/workflow/ops.ts +19 -0
- package/src/components/command-bar/workflow/tickers.ts +5 -0
- package/src/components/company-logo.tsx +15 -2
- package/src/components/data-table/table-pane.ts +2 -1
- package/src/components/index.ts +1 -0
- package/src/components/layout/detached-pane-shell.tsx +12 -1
- package/src/components/layout/missing-pane.tsx +87 -23
- package/src/components/layout/pane/footer/index.tsx +64 -18
- package/src/components/layout/pane/footer/model.ts +85 -0
- package/src/components/layout/pane/sidebar.tsx +19 -1
- package/src/components/layout/shell/index.tsx +38 -28
- package/src/components/layout/shell/pane/management-shortcuts.ts +13 -1
- package/src/components/layout/status-bar.tsx +93 -28
- package/src/components/layout/status-widget-space.ts +72 -0
- package/src/components/onboarding/first-run-workspace.ts +8 -2
- package/src/components/onboarding/onboarding-wizard.tsx +35 -16
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +14 -5
- package/src/components/onboarding/wizard-model.ts +13 -5
- package/src/components/onboarding/wizard-positions.ts +56 -7
- package/src/components/price-performance.tsx +31 -34
- package/src/components/ui/data-table/index.tsx +11 -8
- package/src/components/ui/display.tsx +15 -6
- package/src/components/ui/fields.tsx +5 -0
- package/src/components/ui/figure.tsx +94 -0
- package/src/components/ui/header-case.ts +25 -3
- package/src/components/ui/icon.tsx +3 -1
- package/src/components/ui/message-composer.tsx +8 -1
- package/src/components/ui/query-bar.tsx +8 -1
- package/src/components/ui/ratio-bar.tsx +84 -0
- package/src/components/ui/toggle.tsx +3 -1
- package/src/components/use-scrollbox-layout.ts +17 -0
- package/src/core/state/app/layout.ts +35 -1
- package/src/core/state/app/state.ts +15 -0
- package/src/core/state/app/types.ts +1 -0
- package/src/data/config/store/normalize.ts +24 -0
- package/src/i18n/es.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/zh-cn.ts +2 -0
- package/src/i18n/zh-tw.ts +2 -0
- package/src/layout-marketplace/pane-imagery.ts +1 -0
- package/src/market-data/coordinator/entries.ts +13 -0
- package/src/market-data/coordinator/financials.ts +33 -8
- package/src/market-data/market/freshness.ts +16 -5
- package/src/market-data/market/trading-sessions.ts +65 -1
- package/src/market-data/published-cn-sessions.ts +25 -0
- package/src/market-data/published-nse-sessions.ts +20 -0
- package/src/news/aggregator.ts +4 -0
- package/src/plugins/builtin/account-management/model.ts +6 -1
- package/src/plugins/builtin/account-management/pane.tsx +36 -25
- package/src/plugins/builtin/alerts/catalysts.ts +77 -0
- package/src/plugins/builtin/alerts/events-pane.tsx +3 -0
- package/src/plugins/builtin/alerts/events.ts +10 -4
- package/src/plugins/builtin/alerts/history-pane.tsx +1 -1
- package/src/plugins/builtin/alerts/history.ts +1 -0
- package/src/plugins/builtin/alerts/index.tsx +6 -0
- package/src/plugins/builtin/alerts/research-builder.ts +10 -3
- package/src/plugins/builtin/alerts/research-rules.ts +15 -1
- package/src/plugins/builtin/analytics/risk-client.ts +15 -3
- package/src/plugins/builtin/analytics/risk-headless.ts +123 -18
- package/src/plugins/builtin/attention/client.ts +80 -0
- package/src/plugins/builtin/attention/evidence.ts +30 -0
- package/src/plugins/builtin/attention/headless.ts +33 -0
- package/src/plugins/builtin/attention/index.tsx +18 -0
- package/src/plugins/builtin/attention/model.ts +59 -0
- package/src/plugins/builtin/attention/pane.tsx +211 -0
- package/src/plugins/builtin/attention/trending.tsx +59 -0
- package/src/plugins/builtin/awards/alerts.ts +32 -0
- package/src/plugins/builtin/awards/client.ts +82 -0
- package/src/plugins/builtin/awards/detail.tsx +107 -0
- package/src/plugins/builtin/awards/evidence.ts +36 -0
- package/src/plugins/builtin/awards/headless.ts +55 -0
- package/src/plugins/builtin/awards/index.tsx +20 -0
- package/src/plugins/builtin/awards/model.ts +42 -0
- package/src/plugins/builtin/awards/pane.tsx +263 -0
- package/src/plugins/builtin/catalysts/client.ts +28 -0
- package/src/plugins/builtin/catalysts/detail.tsx +88 -0
- package/src/plugins/builtin/catalysts/evidence.ts +47 -0
- package/src/plugins/builtin/catalysts/headless.ts +42 -0
- package/src/plugins/builtin/catalysts/history.ts +26 -0
- package/src/plugins/builtin/catalysts/index.tsx +29 -0
- package/src/plugins/builtin/catalysts/model.ts +135 -0
- package/src/plugins/builtin/catalysts/pane.tsx +159 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +4 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +6 -0
- package/src/plugins/builtin/chart-composer/index.tsx +8 -1
- package/src/plugins/builtin/chart-composer/pane.tsx +28 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +610 -0
- package/src/plugins/builtin/chat/attachments/files.ts +45 -0
- package/src/plugins/builtin/chat/attachments/model.ts +164 -0
- package/src/plugins/builtin/chat/attachments/terminal.tsx +72 -0
- package/src/plugins/builtin/chat/attachments/transfer.ts +165 -0
- package/src/plugins/builtin/chat/content/channel-navigation.ts +13 -12
- package/src/plugins/builtin/chat/content/composer-runtime.ts +25 -4
- package/src/plugins/builtin/chat/content/composer.tsx +46 -4
- package/src/plugins/builtin/chat/content/footer.tsx +46 -8
- package/src/plugins/builtin/chat/content/index.tsx +263 -62
- package/src/plugins/builtin/chat/content/layout-metrics.ts +10 -2
- package/src/plugins/builtin/chat/content/open-targets.ts +17 -3
- package/src/plugins/builtin/chat/content/scroll.ts +7 -1
- package/src/plugins/builtin/chat/content/shortcuts.ts +36 -11
- package/src/plugins/builtin/chat/content/snapshot.ts +3 -0
- package/src/plugins/builtin/chat/content/transcript.tsx +17 -1
- package/src/plugins/builtin/chat/content/types.ts +7 -0
- package/src/plugins/builtin/chat/controller/attachments.ts +213 -0
- package/src/plugins/builtin/chat/controller/connections.ts +3 -1
- package/src/plugins/builtin/chat/controller/index.ts +114 -2
- package/src/plugins/builtin/chat/controller/lifecycle.ts +9 -0
- package/src/plugins/builtin/chat/controller/messages.ts +35 -2
- package/src/plugins/builtin/chat/controller/send.ts +128 -25
- package/src/plugins/builtin/chat/controller/state.ts +12 -1
- package/src/plugins/builtin/chat/controller/utils.ts +7 -5
- package/src/plugins/builtin/chat/controller/view.ts +2 -0
- package/src/plugins/builtin/chat/index.tsx +21 -0
- package/src/plugins/builtin/chat/layout.ts +9 -4
- package/src/plugins/builtin/chat/message/desktop.tsx +55 -20
- package/src/plugins/builtin/chat/message/header.tsx +30 -5
- package/src/plugins/builtin/chat/message/inline-tokens.tsx +9 -0
- package/src/plugins/builtin/chat/message/pending-send.ts +35 -0
- package/src/plugins/builtin/chat/message/profile-popover.tsx +5 -1
- package/src/plugins/builtin/chat/message/render-state.ts +12 -2
- package/src/plugins/builtin/chat/message/terminal.tsx +51 -4
- package/src/plugins/builtin/chat/message/types.ts +6 -1
- package/src/plugins/builtin/chat/pane-state.ts +59 -1
- package/src/plugins/builtin/chat/profile-popover.ts +50 -1
- package/src/plugins/builtin/chat/sidebar.tsx +8 -3
- package/src/plugins/builtin/chat/status-widget.tsx +29 -12
- package/src/plugins/builtin/chat/unread-inbox-pane.tsx +143 -0
- package/src/plugins/builtin/chat/unread-inbox.ts +91 -0
- package/src/plugins/builtin/clinical-trials/client.ts +237 -0
- package/src/plugins/builtin/clinical-trials/index.tsx +74 -0
- package/src/plugins/builtin/clinical-trials/pane.tsx +225 -0
- package/src/plugins/builtin/clinical-trials/types.ts +2 -0
- package/src/plugins/builtin/cloud/askg/controller.ts +37 -6
- package/src/plugins/builtin/cloud/askg/executor.ts +59 -44
- package/src/plugins/builtin/cloud/askg/host.ts +8 -1
- package/src/plugins/builtin/cloud/askg/manifest.ts +29 -2
- package/src/plugins/builtin/cloud/askg/model.ts +47 -13
- package/src/plugins/builtin/cloud/askg/notes.ts +100 -0
- package/src/plugins/builtin/cloud/askg/pane.tsx +50 -14
- package/src/plugins/builtin/cloud/askg/protocol.ts +39 -1
- package/src/plugins/builtin/cloud/askg/result-budget.ts +156 -0
- package/src/plugins/builtin/cloud/askg/user-data.ts +89 -0
- package/src/plugins/builtin/cloud/auth-actions.tsx +55 -31
- package/src/plugins/builtin/cloud/plugin.tsx +4 -1
- package/src/plugins/builtin/cloud/team/pane-sections.tsx +10 -1
- package/src/plugins/builtin/cloud/team/pane.tsx +3 -2
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +2 -2
- package/src/plugins/builtin/cloud/thesis/detail.tsx +1 -1
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -2
- package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +202 -0
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/cloud/upgrade-dialog.tsx +29 -3
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +1 -1
- package/src/plugins/builtin/cloud-tweets/table.tsx +1 -1
- package/src/plugins/builtin/comment-letters/client.ts +342 -0
- package/src/plugins/builtin/comment-letters/index.tsx +74 -0
- package/src/plugins/builtin/comment-letters/pane.tsx +295 -0
- package/src/plugins/builtin/comment-letters/types.ts +43 -0
- package/src/plugins/builtin/company-attention/app-rank.tsx +79 -0
- package/src/plugins/builtin/company-attention/client.ts +69 -0
- package/src/plugins/builtin/company-attention/evidence.ts +45 -0
- package/src/plugins/builtin/company-attention/headless.ts +47 -0
- package/src/plugins/builtin/company-attention/index.tsx +30 -0
- package/src/plugins/builtin/company-attention/model.ts +129 -0
- package/src/plugins/builtin/company-attention/pane.tsx +183 -0
- package/src/plugins/builtin/company-kpis/client.ts +92 -0
- package/src/plugins/builtin/company-kpis/headless.ts +32 -0
- package/src/plugins/builtin/company-kpis/index.tsx +26 -0
- package/src/plugins/builtin/company-kpis/model.ts +124 -0
- package/src/plugins/builtin/company-kpis/pane.tsx +226 -0
- package/src/plugins/builtin/company-kpis/related.ts +11 -0
- package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +44 -0
- package/src/plugins/builtin/composite-plugins.ts +34 -0
- package/src/plugins/builtin/correlation/history.ts +4 -1
- package/src/plugins/builtin/correlation/index.tsx +139 -80
- package/src/plugins/builtin/correlation/matrix/pair-chart.tsx +48 -0
- package/src/plugins/builtin/correlation/matrix/selection.ts +77 -0
- package/src/plugins/builtin/correlation/relationship/model.ts +2 -2
- package/src/plugins/builtin/cpi/client.ts +66 -0
- package/src/plugins/builtin/cpi/headless.ts +78 -0
- package/src/plugins/builtin/cpi/index.tsx +31 -0
- package/src/plugins/builtin/cpi/model.ts +198 -0
- package/src/plugins/builtin/cpi/pane.tsx +157 -0
- package/src/plugins/builtin/credit-documents/client.ts +99 -0
- package/src/plugins/builtin/credit-documents/detail.tsx +109 -0
- package/src/plugins/builtin/credit-documents/evidence.ts +64 -0
- package/src/plugins/builtin/credit-documents/gauge.tsx +55 -0
- package/src/plugins/builtin/credit-documents/headless.ts +40 -0
- package/src/plugins/builtin/credit-documents/index.tsx +19 -0
- package/src/plugins/builtin/credit-documents/model.ts +336 -0
- package/src/plugins/builtin/credit-documents/pane.tsx +185 -0
- package/src/plugins/builtin/custom-view/view-spec.ts +14 -2
- package/src/plugins/builtin/debt-maturities/pane.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
- package/src/plugins/builtin/doe/client.ts +73 -0
- package/src/plugins/builtin/doe/headless.ts +93 -0
- package/src/plugins/builtin/doe/index.tsx +41 -0
- package/src/plugins/builtin/doe/model.ts +215 -0
- package/src/plugins/builtin/doe/pane.tsx +148 -0
- package/src/plugins/builtin/doe/range-bar.tsx +45 -0
- package/src/plugins/builtin/earnings/board.tsx +3 -0
- package/src/plugins/builtin/earnings/index.tsx +2 -0
- package/src/plugins/builtin/earnings-calls/pane.tsx +7 -1
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +7 -7
- package/src/plugins/builtin/earnings-ripple/client.ts +60 -0
- package/src/plugins/builtin/earnings-ripple/headless.ts +35 -0
- package/src/plugins/builtin/earnings-ripple/index.tsx +35 -0
- package/src/plugins/builtin/earnings-ripple/model.ts +98 -0
- package/src/plugins/builtin/earnings-ripple/pane.tsx +103 -0
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +1 -1
- package/src/plugins/builtin/equity-screener/model.ts +74 -9
- package/src/plugins/builtin/equity-screener/pane.tsx +2 -0
- package/src/plugins/builtin/estimate-revisions/pane.tsx +3 -0
- package/src/plugins/builtin/executives/pane.tsx +7 -5
- package/src/plugins/builtin/exposure/charts.tsx +66 -0
- package/src/plugins/builtin/exposure/client.ts +53 -0
- package/src/plugins/builtin/exposure/drivers.ts +29 -0
- package/src/plugins/builtin/exposure/editor.tsx +61 -0
- package/src/plugins/builtin/exposure/evidence.ts +39 -0
- package/src/plugins/builtin/exposure/headless.ts +51 -0
- package/src/plugins/builtin/exposure/holdings.ts +56 -0
- package/src/plugins/builtin/exposure/index.tsx +13 -0
- package/src/plugins/builtin/exposure/model.ts +104 -0
- package/src/plugins/builtin/exposure/pane.tsx +247 -0
- package/src/plugins/builtin/fear-greed/charts.tsx +1 -1
- package/src/plugins/builtin/fear-greed/pane.tsx +2 -9
- package/src/plugins/builtin/filing-events/pane.tsx +2 -1
- package/src/plugins/builtin/gpu/board.tsx +163 -0
- package/src/plugins/builtin/gpu/changes.tsx +94 -0
- package/src/plugins/builtin/gpu/client.ts +130 -0
- package/src/plugins/builtin/gpu/equities.tsx +112 -0
- package/src/plugins/builtin/gpu/headless.ts +67 -0
- package/src/plugins/builtin/gpu/history.tsx +140 -0
- package/src/plugins/builtin/gpu/index.tsx +18 -0
- package/src/plugins/builtin/gpu/ladder.tsx +127 -0
- package/src/plugins/builtin/gpu/model.ts +317 -0
- package/src/plugins/builtin/gpu/pane.tsx +63 -0
- package/src/plugins/builtin/help/index.tsx +19 -2
- package/src/plugins/builtin/holders/pane.tsx +5 -9
- package/src/plugins/builtin/insider/detail.tsx +119 -0
- package/src/plugins/builtin/insider/display.ts +221 -0
- package/src/plugins/builtin/insider/headless.ts +24 -3
- package/src/plugins/builtin/insider/index.tsx +206 -108
- package/src/plugins/builtin/insider/insider-data.ts +31 -3
- package/src/plugins/builtin/insider/model.ts +53 -4
- package/src/plugins/builtin/insider/table-model.ts +226 -0
- package/src/plugins/builtin/insider/table.tsx +79 -0
- package/src/plugins/builtin/iv-history/screen-pane.tsx +1 -1
- package/src/plugins/builtin/jobs/pane.tsx +14 -7
- package/src/plugins/builtin/kelly-sizer/pane.tsx +1 -1
- package/src/plugins/builtin/macro-day/client.ts +50 -0
- package/src/plugins/builtin/macro-day/headless.ts +51 -0
- package/src/plugins/builtin/macro-day/index.tsx +21 -0
- package/src/plugins/builtin/macro-day/model.ts +137 -0
- package/src/plugins/builtin/macro-day/pane.tsx +118 -0
- package/src/plugins/builtin/macro-day/releases.ts +58 -0
- package/src/plugins/builtin/market-halts/model.ts +30 -17
- package/src/plugins/builtin/market-halts/pane.tsx +15 -21
- package/src/plugins/builtin/market-heatmap/data.ts +1 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +198 -50
- package/src/plugins/builtin/market-heatmap/portfolio.ts +220 -0
- package/src/plugins/builtin/market-movers/index.tsx +1 -0
- package/src/plugins/builtin/market-movers/session-body.tsx +5 -2
- package/src/plugins/builtin/mna/distress/client.ts +326 -0
- package/src/plugins/builtin/mna/distress/detail.tsx +247 -0
- package/src/plugins/builtin/mna/distress/headless.ts +257 -0
- package/src/plugins/builtin/mna/distress/model.ts +427 -0
- package/src/plugins/builtin/mna/distress/pane.tsx +606 -0
- package/src/plugins/builtin/mna/index.tsx +15 -0
- package/src/plugins/builtin/mna/pane.tsx +42 -1
- package/src/plugins/builtin/news/index.tsx +62 -16
- package/src/plugins/builtin/news/wire/filter-articles.ts +54 -0
- package/src/plugins/builtin/news/wire/index.tsx +37 -3
- package/src/plugins/builtin/news/wire/industry-pane.tsx +29 -13
- package/src/plugins/builtin/news/wire/mutes.ts +253 -0
- package/src/plugins/builtin/news/wire/news/command-bar-search.ts +117 -0
- package/src/plugins/builtin/news/wire/news/footer.ts +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +34 -0
- package/src/plugins/builtin/news/wire/news/pop-out.tsx +158 -0
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +64 -19
- package/src/plugins/builtin/openfda/client.ts +300 -0
- package/src/plugins/builtin/openfda/index.tsx +71 -0
- package/src/plugins/builtin/openfda/pane.tsx +382 -0
- package/src/plugins/builtin/openfda/types.ts +76 -0
- package/src/plugins/builtin/options/footer.ts +1 -0
- package/src/plugins/builtin/options/view.tsx +1 -1
- package/src/plugins/builtin/options-calculator/pane.tsx +0 -1
- package/src/plugins/builtin/options-positioning/index.tsx +4 -2
- package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
- package/src/plugins/builtin/pe-band/client.ts +61 -0
- package/src/plugins/builtin/pe-band/headless.ts +51 -0
- package/src/plugins/builtin/pe-band/index.tsx +20 -0
- package/src/plugins/builtin/pe-band/model.ts +267 -0
- package/src/plugins/builtin/pe-band/pane.tsx +159 -0
- package/src/plugins/builtin/perps/client.ts +66 -0
- package/src/plugins/builtin/perps/equity-row.tsx +28 -0
- package/src/plugins/builtin/perps/headless.ts +34 -0
- package/src/plugins/builtin/perps/index.tsx +14 -0
- package/src/plugins/builtin/perps/model.ts +58 -0
- package/src/plugins/builtin/perps/pane.tsx +185 -0
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +0 -1
- package/src/plugins/builtin/portfolio-list/cli/render.ts +177 -87
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +6 -20
- package/src/plugins/builtin/portfolio-list/command-bar.ts +6 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +237 -0
- package/src/plugins/builtin/portfolio-list/index.tsx +2 -0
- package/src/plugins/builtin/portfolio-list/mutations.ts +70 -1
- package/src/plugins/builtin/portfolio-list/pane/data.ts +17 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +88 -5
- package/src/plugins/builtin/portfolio-list/pane/remove-ticker.ts +85 -0
- package/src/plugins/builtin/portfolio-list/pane/streaming.ts +18 -12
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +6 -0
- package/src/plugins/builtin/power/client.ts +100 -0
- package/src/plugins/builtin/power/detail.tsx +82 -0
- package/src/plugins/builtin/power/evidence.ts +56 -0
- package/src/plugins/builtin/power/generation.tsx +37 -0
- package/src/plugins/builtin/power/headless.ts +43 -0
- package/src/plugins/builtin/power/index.tsx +16 -0
- package/src/plugins/builtin/power/model.ts +89 -0
- package/src/plugins/builtin/power/pane.tsx +209 -0
- package/src/plugins/builtin/power/query.ts +25 -0
- package/src/plugins/builtin/relative-rotation/pane.tsx +3 -3
- package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +13 -4
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +11 -9
- package/src/plugins/builtin/research-search/pane.tsx +21 -7
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
- package/src/plugins/builtin/reverse-dcf/client.ts +35 -0
- package/src/plugins/builtin/reverse-dcf/headless.ts +44 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +20 -0
- package/src/plugins/builtin/reverse-dcf/model.ts +87 -0
- package/src/plugins/builtin/reverse-dcf/pane.tsx +107 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +6 -5
- package/src/plugins/builtin/scanner/denied.tsx +4 -2
- package/src/plugins/builtin/scanner/feed.ts +1 -0
- package/src/plugins/builtin/scanner/flow-pane.tsx +3 -2
- package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
- package/src/plugins/builtin/seasonality/client.ts +4 -1
- package/src/plugins/builtin/sec/command-bar-search.ts +217 -0
- package/src/plugins/builtin/sec/forms.ts +54 -0
- package/src/plugins/builtin/sec/headless.ts +31 -5
- package/src/plugins/builtin/sec/index.tsx +67 -11
- package/src/plugins/builtin/sec/model.ts +35 -5
- package/src/plugins/builtin/sectors/headless.ts +1 -0
- package/src/plugins/builtin/sectors/index.tsx +72 -26
- package/src/plugins/builtin/shared/cloud-upgrade.ts +143 -39
- package/src/plugins/builtin/shared/pro-feature-wall.tsx +8 -4
- package/src/plugins/builtin/shared/research-cells.tsx +107 -0
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -1
- package/src/plugins/builtin/shared/ticker-request.ts +1 -1
- package/src/plugins/builtin/shared/wall-teaser-catalog.ts +80 -0
- package/src/plugins/builtin/shared/wall-teaser.tsx +192 -0
- package/src/plugins/builtin/shared/wall-view-lifecycle.ts +43 -0
- package/src/plugins/builtin/short-interest/index.tsx +31 -0
- package/src/plugins/builtin/short-interest/watch-client.ts +70 -0
- package/src/plugins/builtin/short-interest/watch-headless.ts +49 -0
- package/src/plugins/builtin/short-interest/watch-model.ts +185 -0
- package/src/plugins/builtin/short-interest/watch-pane.tsx +169 -0
- package/src/plugins/builtin/short-volume/pane.tsx +1 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +1 -1
- package/src/plugins/builtin/supply-chain/client.ts +104 -0
- package/src/plugins/builtin/supply-chain/disclosure-quote.tsx +17 -0
- package/src/plugins/builtin/supply-chain/evidence.ts +88 -0
- package/src/plugins/builtin/supply-chain/flow-layout.ts +133 -0
- package/src/plugins/builtin/supply-chain/flow.tsx +323 -0
- package/src/plugins/builtin/supply-chain/graph-client.ts +83 -0
- package/src/plugins/builtin/supply-chain/graph-evidence.ts +25 -0
- package/src/plugins/builtin/supply-chain/graph-model.ts +45 -0
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +218 -0
- package/src/plugins/builtin/supply-chain/graph.tsx +163 -0
- package/src/plugins/builtin/supply-chain/headless.ts +105 -0
- package/src/plugins/builtin/supply-chain/index.tsx +17 -0
- package/src/plugins/builtin/supply-chain/model.ts +145 -0
- package/src/plugins/builtin/supply-chain/pane.tsx +276 -0
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +96 -0
- package/src/plugins/builtin/supply-chain/trust.ts +34 -0
- package/src/plugins/builtin/themes/client.ts +39 -0
- package/src/plugins/builtin/themes/headless.ts +38 -0
- package/src/plugins/builtin/themes/model.ts +92 -0
- package/src/plugins/builtin/themes/pane.tsx +125 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +6 -15
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +5 -6
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +201 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +327 -0
- package/src/plugins/builtin/ticker-detail/financials/period-end-history.ts +5 -2
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +60 -12
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -2
- package/src/plugins/builtin/ticker-detail/index.tsx +22 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +53 -30
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +2 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +112 -47
- package/src/plugins/builtin/ticker-detail/pane.tsx +50 -6
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +21 -42
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +3 -0
- package/src/plugins/builtin/time-sales/pane.tsx +1 -1
- package/src/plugins/builtin/world-indices/indices.ts +1 -0
- package/src/plugins/catalog-browser.ts +40 -0
- package/src/plugins/catalog-manifest.ts +3 -0
- package/src/plugins/catalog-ui.ts +6 -0
- package/src/plugins/current-target.ts +0 -9
- package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
- package/src/renderers/browser/cloud-transport.ts +66 -1
- package/src/renderers/browser/main.tsx +2 -0
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/desktop/controls.tsx +38 -25
- package/src/renderers/dom/desktop/icons.tsx +8 -0
- package/src/renderers/dom/host/chart-surface.tsx +36 -2
- package/src/renderers/dom/host/focus-scope.ts +11 -1
- package/src/renderers/dom/styles.css +28 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +3 -2
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +1 -1
- package/src/renderers/electrobun/view/http-fetch.ts +2 -0
- package/src/renderers/electrobun/view/main.tsx +3 -1
- package/src/renderers/electrobun/view/rpc-timeout.ts +59 -0
- package/src/renderers/opentui/start.tsx +3 -0
- package/src/shares/api.ts +3 -1
- package/src/sources/gloomberb-cloud/index.ts +47 -13
- package/src/sources/history-result.ts +1 -0
- package/src/sources/history-retention.ts +16 -0
- package/src/sources/provider-router/history.ts +4 -2
- package/src/sources/sec-edgar/identity.ts +36 -0
- package/src/sources/sec-edgar.ts +1 -34
- package/src/state/app/context/index.tsx +8 -0
- package/src/sync/core-contributors.ts +20 -2
- package/src/telemetry/attention-counts.ts +164 -0
- package/src/telemetry/live-config.ts +7 -0
- package/src/test-support/rpc-loopback.ts +7 -3
- package/src/test-support/shell-pane-keys.tsx +34 -0
- package/src/tickers/instrument-kind.ts +12 -6
- package/src/tickers/open-target.ts +1 -1
- package/src/tickers/search/asset-classes.ts +91 -0
- package/src/tickers/search/index.ts +62 -15
- package/src/tickers/search/ranking.ts +22 -3
- package/src/tickers/search/upsert.ts +4 -1
- package/src/time-series/live-bars.ts +8 -3
- package/src/time-series/resolve.ts +224 -17
- package/src/time-series/spec.ts +1 -0
- package/src/time-series/types.ts +9 -1
- package/src/types/config.ts +23 -1
- package/src/types/data-provider.ts +2 -0
- package/src/types/headless.ts +17 -0
- package/src/types/price-history.ts +2 -0
- package/src/ui/host.tsx +6 -0
- package/src/utils/double-escape-close.ts +20 -0
- package/src/utils/exchanges.ts +1 -0
- package/src/utils/html-entities.ts +15 -0
- package/src/utils/http-proxy-response.ts +44 -7
- package/src/utils/plugin-proxy-hosts.json +3 -0
- package/src/utils/price-history.ts +35 -1
- package/src/utils/sec.ts +21 -2
- package/src/utils/text-wrap.ts +13 -8
- package/src/utils/zoned-date-time.ts +67 -0
|
@@ -4,10 +4,11 @@ import { usePaneFooter, type PaneHint } from "../../../../components";
|
|
|
4
4
|
import { ChoiceDialog } from "../../../../components/ui/choice-dialog";
|
|
5
5
|
import type { InlineTickerCatalogEntry } from "../../../../state/hooks/inline-tickers";
|
|
6
6
|
import type { ContextMenuItem } from "../../../../types/context-menu";
|
|
7
|
-
import { useRendererHost } from "../../../../ui";
|
|
7
|
+
import { useRendererHost, useUiCapabilities } from "../../../../ui";
|
|
8
8
|
import { useOptionalDialog, type PromptContext } from "../../../../ui/dialog";
|
|
9
9
|
import { hasPublicChatProfileInfo } from "../message/profile-popover";
|
|
10
10
|
import { chatMessageOpenTargets, type ChatOpenTarget } from "./open-targets";
|
|
11
|
+
import { openChatImageViewer } from "../attachments/desktop";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* The chat pane's keys, shown in its footer and listed in its pane menu. The
|
|
@@ -22,9 +23,11 @@ export function useChatFooter({
|
|
|
22
23
|
latestEditableMessageId,
|
|
23
24
|
beginEditMessage,
|
|
24
25
|
beginReplyTo,
|
|
26
|
+
retryMessage,
|
|
25
27
|
focusComposer,
|
|
26
28
|
catalog,
|
|
27
29
|
openTicker,
|
|
30
|
+
openAttachPicker,
|
|
28
31
|
currentUserId,
|
|
29
32
|
profilePopoverUser,
|
|
30
33
|
showProfilePopover,
|
|
@@ -55,9 +58,12 @@ export function useChatFooter({
|
|
|
55
58
|
latestEditableMessageId: string | null;
|
|
56
59
|
beginEditMessage: (index: number, options?: { deferFocus?: boolean }) => boolean;
|
|
57
60
|
beginReplyTo: (index: number, options?: { deferFocus?: boolean }) => void;
|
|
61
|
+
retryMessage: (index: number) => void;
|
|
58
62
|
focusComposer: () => void;
|
|
59
63
|
catalog: Record<string, InlineTickerCatalogEntry>;
|
|
60
64
|
openTicker: (symbol: string) => void;
|
|
65
|
+
/** Opens the composer's file picker; null where images cannot be attached. */
|
|
66
|
+
openAttachPicker: (() => void) | null;
|
|
61
67
|
currentUserId: string | undefined;
|
|
62
68
|
profilePopoverUser: ChatUserSummary | null;
|
|
63
69
|
showProfilePopover: (user: ChatUserSummary) => void;
|
|
@@ -81,12 +87,30 @@ export function useChatFooter({
|
|
|
81
87
|
const dialog = useOptionalDialog();
|
|
82
88
|
const rendererHost = useRendererHost();
|
|
83
89
|
const content = selectedMessage?.content ?? "";
|
|
84
|
-
const
|
|
90
|
+
const attachments = selectedMessage?.attachments;
|
|
91
|
+
const openTargets = useMemo(
|
|
92
|
+
() => chatMessageOpenTargets(content, catalog, attachments),
|
|
93
|
+
[attachments, catalog, content],
|
|
94
|
+
);
|
|
95
|
+
const { nativePaneChrome } = useUiCapabilities();
|
|
85
96
|
|
|
86
97
|
const openTarget = useCallback((target: ChatOpenTarget) => {
|
|
87
|
-
if (target.kind === "ticker")
|
|
88
|
-
|
|
89
|
-
|
|
98
|
+
if (target.kind === "ticker") {
|
|
99
|
+
openTicker(target.symbol);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
// The desktop shows an image in its viewer; the terminal hands it to the browser.
|
|
103
|
+
if (target.kind === "image" && nativePaneChrome && dialog && selectedMessage?.attachments) {
|
|
104
|
+
openChatImageViewer(dialog, {
|
|
105
|
+
attachments: selectedMessage.attachments,
|
|
106
|
+
index: target.index,
|
|
107
|
+
caption: selectedMessage.content,
|
|
108
|
+
author: selectedMessage.user.username ?? "anon",
|
|
109
|
+
});
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
void rendererHost.openExternal(target.url);
|
|
113
|
+
}, [dialog, nativePaneChrome, openTicker, rendererHost, selectedMessage]);
|
|
90
114
|
|
|
91
115
|
// One target opens at once; several ask which, in the order the message reads.
|
|
92
116
|
const openSelectedTargets = useCallback(async () => {
|
|
@@ -134,17 +158,23 @@ export function useChatFooter({
|
|
|
134
158
|
const canEdit = canSend && !!selectedMessage && selectedMessage.id === latestEditableMessageId;
|
|
135
159
|
const replyToId = selectedMessage?.replyToId ?? null;
|
|
136
160
|
const onlyTarget = openTargets.length === 1 ? openTargets[0]! : null;
|
|
161
|
+
const failedSend = selectedMessage?.clientStatus === "failed";
|
|
162
|
+
const canAttachImages = !!openAttachPicker;
|
|
137
163
|
const openTargetTitle = onlyTarget
|
|
138
|
-
? onlyTarget.kind === "ticker" ? `Open $${onlyTarget.symbol}` : "Open Link"
|
|
164
|
+
? onlyTarget.kind === "ticker" ? `Open $${onlyTarget.symbol}` : onlyTarget.kind === "image" ? "Open Image" : "Open Link"
|
|
139
165
|
: openTargets.every((target) => target.kind === "ticker")
|
|
140
166
|
? "Open Ticker…"
|
|
141
|
-
: openTargets.every((target) => target.kind === "link")
|
|
167
|
+
: openTargets.every((target) => target.kind === "link")
|
|
168
|
+
? "Open Link…"
|
|
169
|
+
: openTargets.every((target) => target.kind === "image") ? "Open Image…" : "Open…";
|
|
142
170
|
|
|
143
171
|
// Actions run whatever the latest render holds, so a footer entry that did
|
|
144
172
|
// not need redrawing never acts on a stale message list.
|
|
145
173
|
const latest = useRef({
|
|
146
174
|
beginEditMessage,
|
|
147
175
|
beginReplyTo,
|
|
176
|
+
retryMessage,
|
|
177
|
+
openAttachPicker,
|
|
148
178
|
cycleChannel,
|
|
149
179
|
focusChannelSidebar,
|
|
150
180
|
focusComposer,
|
|
@@ -160,6 +190,8 @@ export function useChatFooter({
|
|
|
160
190
|
latest.current = {
|
|
161
191
|
beginEditMessage,
|
|
162
192
|
beginReplyTo,
|
|
193
|
+
retryMessage,
|
|
194
|
+
openAttachPicker,
|
|
163
195
|
cycleChannel,
|
|
164
196
|
focusChannelSidebar,
|
|
165
197
|
focusComposer,
|
|
@@ -177,7 +209,8 @@ export function useChatFooter({
|
|
|
177
209
|
const hints: PaneHint[] = [];
|
|
178
210
|
// Nothing about the selection applies while typing.
|
|
179
211
|
if (!composing && selectedMessage) {
|
|
180
|
-
if (canSend) hints.push({ id: "
|
|
212
|
+
if (canSend && failedSend) hints.push({ id: "retry", key: "Enter", label: "retry", title: "Send Again", onPress: () => latest.current.retryMessage(latest.current.selectedIdx) });
|
|
213
|
+
else if (canSend) hints.push({ id: "reply", key: "Enter", label: "reply", title: "Reply", onPress: () => latest.current.beginReplyTo(latest.current.selectedIdx, { deferFocus: true }) });
|
|
181
214
|
if (canEdit) hints.push({ id: "edit", key: "e", label: "dit", title: "Edit Message", onPress: () => { latest.current.beginEditMessage(latest.current.selectedIdx, { deferFocus: true }); } });
|
|
182
215
|
if (openTargets.length > 0) hints.push({ id: "open", key: "o", label: "pen", title: openTargetTitle, onPress: () => { void latest.current.openSelectedTargets(); } });
|
|
183
216
|
if (authorHasProfile) hints.push({ id: "profile", key: "p", label: "rofile", title: "Show Profile", onPress: () => latest.current.toggleAuthorProfile() });
|
|
@@ -217,9 +250,14 @@ export function useChatFooter({
|
|
|
217
250
|
if (needsProfileSetup) {
|
|
218
251
|
menu.push({ id: "profile-setup", label: "Set Up Profile", onSelect: () => latest.current.openProfileSetup() });
|
|
219
252
|
}
|
|
253
|
+
if (canAttachImages) {
|
|
254
|
+
menu.push({ id: "attach-image", label: "Attach Image…", onSelect: () => latest.current.openAttachPicker?.() });
|
|
255
|
+
}
|
|
220
256
|
return { hints, menu };
|
|
221
257
|
}, [
|
|
222
258
|
authorHasProfile,
|
|
259
|
+
canAttachImages,
|
|
260
|
+
failedSend,
|
|
223
261
|
canCycleChannels,
|
|
224
262
|
canEdit,
|
|
225
263
|
canFocusSidebar,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Box, Text, useUiCapabilities } from "../../../../ui";
|
|
2
2
|
import { useState, useEffect, useRef, useCallback, useMemo, useSyncExternalStore } from "react";
|
|
3
|
+
import { PageStackView } from "../../../../components/ui";
|
|
3
4
|
import { type ScrollBoxRenderable, type TextareaRenderable } from "../../../../ui";
|
|
4
5
|
import { useAppDispatch, useAppSelector } from "../../../../state/app/context";
|
|
5
6
|
import { useInlineTickers } from "../../../../state/hooks/inline-tickers";
|
|
@@ -33,7 +34,10 @@ import {
|
|
|
33
34
|
import { buildChatUserByUsername } from "./user-map";
|
|
34
35
|
import { useChatComposerRuntime } from "./composer-runtime";
|
|
35
36
|
import { useChatMessageSelection } from "./selection-runtime";
|
|
36
|
-
import type { ChatMessage } from "../../../../api-client";
|
|
37
|
+
import type { ChatAttachment, ChatMessage } from "../../../../api-client";
|
|
38
|
+
import { DesktopChatDropOverlay, DesktopChatDropTarget } from "../attachments/desktop";
|
|
39
|
+
import { uploadFromTransferFile, type TransferFile } from "../attachments/transfer";
|
|
40
|
+
import { readChatImageFiles } from "../attachments/files";
|
|
37
41
|
import { NewDmDialog } from "./new-dm-dialog";
|
|
38
42
|
import { usePluginAppActions } from "../../../runtime";
|
|
39
43
|
import { openTeamPane } from "../../cloud/team/pane-request";
|
|
@@ -75,7 +79,7 @@ export function ChatContent({
|
|
|
75
79
|
onTargetMessageHandled,
|
|
76
80
|
}: ChatContentProps) {
|
|
77
81
|
const dispatch = useAppDispatch();
|
|
78
|
-
const { showPane, createPaneFromTemplate } = usePluginAppActions();
|
|
82
|
+
const { showPane, createPaneFromTemplate, notify } = usePluginAppActions();
|
|
79
83
|
const commandBarOpen = useAppSelector((state) => state.commandBarOpen);
|
|
80
84
|
const channelId = normalizeChannelId(rawChannelId);
|
|
81
85
|
const channelIdRef = useRef(channelId);
|
|
@@ -88,6 +92,9 @@ export function ChatContent({
|
|
|
88
92
|
const [editingMessage, setEditingMessage] = useState<ChatMessage | null>(null);
|
|
89
93
|
const [followMessages, setFollowMessages] = useState(true);
|
|
90
94
|
const [newDmOpen, setNewDmOpen] = useState(false);
|
|
95
|
+
// Only while the pane is too small for the sidebar: the channel list stands
|
|
96
|
+
// in for the open channel until one is picked.
|
|
97
|
+
const [channelListOpen, setChannelListOpen] = useState(false);
|
|
91
98
|
const inputRef = useRef<TextareaRenderable>(null);
|
|
92
99
|
const scrollRef = useRef<ScrollBoxRenderable>(null);
|
|
93
100
|
const messageElementsRef = useRef(new Map<string, unknown>());
|
|
@@ -128,10 +135,18 @@ export function ChatContent({
|
|
|
128
135
|
const retryMessages = useCallback(() => {
|
|
129
136
|
void controller.refreshChannelMessages(channelId).catch(() => {});
|
|
130
137
|
}, [channelId, controller]);
|
|
138
|
+
const attachmentsSupported = useSyncExternalStore(
|
|
139
|
+
useCallback((onChange: () => void) => controller.subscribeAttachmentSupport(onChange), [controller]),
|
|
140
|
+
() => controller.attachmentsSupported(),
|
|
141
|
+
);
|
|
142
|
+
const [dropActive, setDropActive] = useState(false);
|
|
143
|
+
const attachPickerRef = useRef<(() => void) | null>(null);
|
|
144
|
+
const replaceComposerDraftRef = useRef<((draft: string, cursorOffset?: number) => void) | null>(null);
|
|
131
145
|
const {
|
|
132
146
|
channels,
|
|
133
147
|
channelsLoading,
|
|
134
148
|
channelStates,
|
|
149
|
+
draftAttachments,
|
|
135
150
|
hasOlderMessages,
|
|
136
151
|
hasSavedSession,
|
|
137
152
|
loading,
|
|
@@ -145,7 +160,8 @@ export function ChatContent({
|
|
|
145
160
|
applyingExternalDraftRef,
|
|
146
161
|
channelId,
|
|
147
162
|
controller,
|
|
148
|
-
|
|
163
|
+
// A channel hidden behind the list is not being read.
|
|
164
|
+
focused: focused && !channelListOpen,
|
|
149
165
|
initialSnapshot,
|
|
150
166
|
inputRef,
|
|
151
167
|
inputValueRef,
|
|
@@ -171,8 +187,19 @@ export function ChatContent({
|
|
|
171
187
|
nativePaneChrome,
|
|
172
188
|
sidebarWidth,
|
|
173
189
|
});
|
|
190
|
+
// Too small for the sidebar, the list and the open channel take turns as a
|
|
191
|
+
// stack. A single channel has no list to go back to.
|
|
192
|
+
const stackedNav = !showChannelSidebar && channels.length >= 2 && !!onChannelChange;
|
|
193
|
+
const showingChannelList = stackedNav && channelListOpen;
|
|
194
|
+
const channelListVisible = showChannelSidebar || showingChannelList;
|
|
195
|
+
useEffect(() => {
|
|
196
|
+
if (!stackedNav) setChannelListOpen(false);
|
|
197
|
+
}, [stackedNav]);
|
|
174
198
|
composerTextWidthRef.current = composerTextWidth;
|
|
175
199
|
const canSend = !!user?.emailVerified;
|
|
200
|
+
// Images go only to a server that said it takes them, and never into an edit.
|
|
201
|
+
const imagesAvailable = canSend && attachmentsSupported;
|
|
202
|
+
const canAttach = imagesAvailable && !editingMessage;
|
|
176
203
|
const selectionActive = selectedIdx >= 0 && selectedIdx < messages.length;
|
|
177
204
|
const stickyTranscript = followMessages && !selectionActive;
|
|
178
205
|
const latestMessageId = messages[messages.length - 1]?.id ?? null;
|
|
@@ -245,20 +272,33 @@ export function ChatContent({
|
|
|
245
272
|
mentionSuggestionCount: mentionSuggestions.length,
|
|
246
273
|
nativePaneChrome,
|
|
247
274
|
replyTo,
|
|
275
|
+
stackHeader: stackedNav && !channelListOpen,
|
|
276
|
+
draftAttachmentCount: draftAttachments.length,
|
|
248
277
|
});
|
|
249
278
|
const {
|
|
250
279
|
cancelProfilePopoverClose,
|
|
251
280
|
closeProfilePopover,
|
|
281
|
+
dismissProfilePopover,
|
|
282
|
+
hoverProfilePopover,
|
|
252
283
|
ownProfileConfigured,
|
|
253
284
|
profilePopoverUser,
|
|
254
285
|
scheduleProfilePopoverClose,
|
|
255
286
|
showProfilePopover,
|
|
287
|
+
toggleProfilePopover,
|
|
256
288
|
} = useChatProfilePopover(focused ? user?.id : undefined);
|
|
257
289
|
|
|
258
290
|
const showUserProfilePopover = useCallback((targetUser: Parameters<typeof showProfilePopover>[0]) => {
|
|
259
291
|
showProfilePopover(targetUser, { ownProfile: targetUser.id === user?.id });
|
|
260
292
|
}, [showProfilePopover, user?.id]);
|
|
261
293
|
|
|
294
|
+
const hoverUserProfile = useCallback((targetUser: Parameters<typeof showProfilePopover>[0]) => {
|
|
295
|
+
hoverProfilePopover(targetUser, { ownProfile: targetUser.id === user?.id });
|
|
296
|
+
}, [hoverProfilePopover, user?.id]);
|
|
297
|
+
|
|
298
|
+
const toggleUserProfile = useCallback((targetUser: Parameters<typeof showProfilePopover>[0]) => {
|
|
299
|
+
toggleProfilePopover(targetUser, { ownProfile: targetUser.id === user?.id });
|
|
300
|
+
}, [toggleProfilePopover, user?.id]);
|
|
301
|
+
|
|
262
302
|
const openProfileSetup = useCallback(() => {
|
|
263
303
|
closeProfilePopover();
|
|
264
304
|
requestAccountManagementTab("profile");
|
|
@@ -278,7 +318,9 @@ export function ChatContent({
|
|
|
278
318
|
if (previousEditingChannelIdRef.current === channelId) return;
|
|
279
319
|
previousEditingChannelIdRef.current = channelId;
|
|
280
320
|
setEditingMessage(null);
|
|
281
|
-
|
|
321
|
+
// A card pinned in one channel does not follow into the next.
|
|
322
|
+
closeProfilePopover();
|
|
323
|
+
}, [channelId, closeProfilePopover]);
|
|
282
324
|
|
|
283
325
|
const {
|
|
284
326
|
moveMessageSelection,
|
|
@@ -292,6 +334,21 @@ export function ChatContent({
|
|
|
292
334
|
setSelectedIdx,
|
|
293
335
|
});
|
|
294
336
|
|
|
337
|
+
// The list's cursor switches channels as it moves. Any other switch (a
|
|
338
|
+
// notification, the unread list, a command) shows the channel it opened.
|
|
339
|
+
const listChannelRef = useRef<string | null>(null);
|
|
340
|
+
const onListChannelChange = useMemo(() => (
|
|
341
|
+
onChannelChange
|
|
342
|
+
? (nextChannelId: string) => {
|
|
343
|
+
listChannelRef.current = nextChannelId;
|
|
344
|
+
onChannelChange(nextChannelId);
|
|
345
|
+
}
|
|
346
|
+
: undefined
|
|
347
|
+
), [onChannelChange]);
|
|
348
|
+
useEffect(() => {
|
|
349
|
+
if (listChannelRef.current !== channelId) setChannelListOpen(false);
|
|
350
|
+
}, [channelId]);
|
|
351
|
+
|
|
295
352
|
const {
|
|
296
353
|
cycleChannel,
|
|
297
354
|
expandDirectSection,
|
|
@@ -316,9 +373,9 @@ export function ChatContent({
|
|
|
316
373
|
channelsLoading,
|
|
317
374
|
focused,
|
|
318
375
|
inputFocused,
|
|
319
|
-
onChannelChange,
|
|
376
|
+
onChannelChange: onListChannelChange,
|
|
320
377
|
resetTranscriptSelection,
|
|
321
|
-
|
|
378
|
+
channelListVisible,
|
|
322
379
|
});
|
|
323
380
|
|
|
324
381
|
const focusInput = useCallback(() => {
|
|
@@ -342,12 +399,47 @@ export function ChatContent({
|
|
|
342
399
|
dispatch({ type: "SET_INPUT_CAPTURED", captured: true });
|
|
343
400
|
}, [blurInput, closeProfilePopover, dispatch, setSidebarFocused]);
|
|
344
401
|
|
|
402
|
+
const openChannelList = useCallback(() => {
|
|
403
|
+
blurInput();
|
|
404
|
+
closeNewDmDialog();
|
|
405
|
+
closeProfilePopover();
|
|
406
|
+
setChannelListOpen(true);
|
|
407
|
+
}, [blurInput, closeNewDmDialog, closeProfilePopover]);
|
|
408
|
+
|
|
409
|
+
// The list owns the keys while it is shown, with its cursor on the open channel.
|
|
410
|
+
useEffect(() => {
|
|
411
|
+
if (!showingChannelList || !focused || newDmOpen || sidebarFocused) return;
|
|
412
|
+
focusChannelSidebar();
|
|
413
|
+
}, [focusChannelSidebar, focused, newDmOpen, showingChannelList, sidebarFocused]);
|
|
414
|
+
|
|
415
|
+
const selectChannelFromList = useCallback((nextChannelId: string) => {
|
|
416
|
+
selectSidebarChannel(nextChannelId);
|
|
417
|
+
setChannelListOpen(false);
|
|
418
|
+
setSidebarFocused(false);
|
|
419
|
+
}, [selectSidebarChannel, setSidebarFocused]);
|
|
420
|
+
|
|
421
|
+
// Enter or Right on a channel opens it, which in the stack also leaves the list.
|
|
422
|
+
const openChannelFromList = useCallback(() => {
|
|
423
|
+
if (!focusChatContent()) return false;
|
|
424
|
+
setChannelListOpen(false);
|
|
425
|
+
return true;
|
|
426
|
+
}, [focusChatContent]);
|
|
427
|
+
|
|
428
|
+
// Left and the pane menu's Channel List reach the list in either layout.
|
|
429
|
+
const canReachChannelList = channelListVisible || stackedNav;
|
|
430
|
+
const reachChannelList = useCallback(() => {
|
|
431
|
+
if (!stackedNav || channelListOpen) return focusChannelSidebar();
|
|
432
|
+
openChannelList();
|
|
433
|
+
return true;
|
|
434
|
+
}, [channelListOpen, focusChannelSidebar, openChannelList, stackedNav]);
|
|
435
|
+
|
|
345
436
|
const openConversationFromDialog = useCallback(async (usernames: string[]) => {
|
|
346
437
|
const channel = usernames.length === 1
|
|
347
438
|
? await controller.openDirectChannel({ username: usernames[0] })
|
|
348
439
|
: await controller.openGroupChannel({ usernames });
|
|
349
440
|
expandDirectSection();
|
|
350
441
|
selectSidebarChannel(channel.id);
|
|
442
|
+
setChannelListOpen(false);
|
|
351
443
|
setSidebarFocused(false);
|
|
352
444
|
closeNewDmDialog();
|
|
353
445
|
}, [closeNewDmDialog, controller, expandDirectSection, selectSidebarChannel, setSidebarFocused]);
|
|
@@ -358,6 +450,49 @@ export function ChatContent({
|
|
|
358
450
|
}
|
|
359
451
|
}, [closeNewDmDialog, focused, newDmOpen]);
|
|
360
452
|
|
|
453
|
+
const attachFiles = useCallback((files: TransferFile[]) => {
|
|
454
|
+
if (!canAttach) {
|
|
455
|
+
if (imagesAvailable) notify({ body: "Images can't be added to an edit.", type: "info" });
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
if (controller.attachToChannel(channelIdRef.current, files.map(uploadFromTransferFile)) > 0) focusInput();
|
|
459
|
+
}, [canAttach, controller, focusInput, imagesAvailable, notify]);
|
|
460
|
+
|
|
461
|
+
// The terminal: a pasted or dropped path to an image file attaches the file
|
|
462
|
+
// and leaves the composer. A path that is no file stays as typed.
|
|
463
|
+
const handlePastedImagePaths = useCallback((paths: string[], pasted: string) => {
|
|
464
|
+
const targetChannelId = channelIdRef.current;
|
|
465
|
+
void readChatImageFiles(paths).then((uploads) => {
|
|
466
|
+
if (uploads.length === 0 || channelIdRef.current !== targetChannelId) return;
|
|
467
|
+
const draft = inputValueRef.current;
|
|
468
|
+
const at = draft.indexOf(pasted);
|
|
469
|
+
if (at >= 0) replaceComposerDraftRef.current?.(`${draft.slice(0, at)}${draft.slice(at + pasted.length)}`, at);
|
|
470
|
+
controller.attachToChannel(targetChannelId, uploads);
|
|
471
|
+
}).catch(() => {});
|
|
472
|
+
}, [controller]);
|
|
473
|
+
|
|
474
|
+
const removeDraftAttachment = useCallback((localId: string) => {
|
|
475
|
+
controller.removeChannelAttachment(channelIdRef.current, localId);
|
|
476
|
+
}, [controller]);
|
|
477
|
+
const retryDraftAttachment = useCallback((localId: string) => {
|
|
478
|
+
controller.retryChannelAttachment(channelIdRef.current, localId);
|
|
479
|
+
}, [controller]);
|
|
480
|
+
const removeLastDraftAttachment = useCallback(() => {
|
|
481
|
+
const last = draftAttachments[draftAttachments.length - 1];
|
|
482
|
+
if (!last) return false;
|
|
483
|
+
removeDraftAttachment(last.localId);
|
|
484
|
+
return true;
|
|
485
|
+
}, [draftAttachments, removeDraftAttachment]);
|
|
486
|
+
const retryMessage = useCallback((index: number) => {
|
|
487
|
+
const message = messages[index];
|
|
488
|
+
if (message?.clientStatus === "failed") controller.retryChannelMessage(channelIdRef.current, message.id);
|
|
489
|
+
}, [controller, messages]);
|
|
490
|
+
const refreshImageLinks = useCallback((attachment: ChatAttachment) => {
|
|
491
|
+
// Only a signed link expires; a stable one that fails is gone for good.
|
|
492
|
+
if (!/[?&]sig=/.test(attachment.url)) return;
|
|
493
|
+
controller.refreshChannelImageLinks(channelIdRef.current);
|
|
494
|
+
}, [controller]);
|
|
495
|
+
|
|
361
496
|
const {
|
|
362
497
|
beginEditLatestMessage,
|
|
363
498
|
beginEditMessage,
|
|
@@ -398,7 +533,10 @@ export function ChatContent({
|
|
|
398
533
|
setSelectedIdx,
|
|
399
534
|
updateComposerRows,
|
|
400
535
|
useDefaultControllerChannel,
|
|
536
|
+
draftAttachmentCount: draftAttachments.length,
|
|
537
|
+
onPastedImagePaths: !nativePaneChrome && canAttach ? handlePastedImagePaths : undefined,
|
|
401
538
|
});
|
|
539
|
+
replaceComposerDraftRef.current = replaceComposerDraft;
|
|
402
540
|
|
|
403
541
|
const moveMentionSelection = useCallback((direction: "up" | "down") => {
|
|
404
542
|
if (mentionSuggestions.length === 0) return false;
|
|
@@ -466,8 +604,14 @@ export function ChatContent({
|
|
|
466
604
|
setSelectedIdx,
|
|
467
605
|
stickyTranscript,
|
|
468
606
|
useDefaultControllerChannel,
|
|
607
|
+
composerLayoutKey: editingMessage ? "" : draftAttachments.map((attachment) => attachment.status).join(","),
|
|
469
608
|
});
|
|
470
609
|
|
|
610
|
+
// A jump to a message (a notification, the unread list) shows the channel.
|
|
611
|
+
useEffect(() => {
|
|
612
|
+
if (targetMessageId) setChannelListOpen(false);
|
|
613
|
+
}, [targetMessageId]);
|
|
614
|
+
|
|
471
615
|
const handledTargetMessageRef = useRef<string | null>(null);
|
|
472
616
|
useEffect(() => {
|
|
473
617
|
if (!targetMessageId || loading || messages.length === 0) return;
|
|
@@ -495,8 +639,8 @@ export function ChatContent({
|
|
|
495
639
|
clearReplyTarget,
|
|
496
640
|
closeProfilePopover,
|
|
497
641
|
cycleChannel,
|
|
498
|
-
focusChannelSidebar,
|
|
499
|
-
focusChatContent,
|
|
642
|
+
focusChannelSidebar: reachChannelList,
|
|
643
|
+
focusChatContent: openChannelFromList,
|
|
500
644
|
focusComposer,
|
|
501
645
|
focused: focused && !newDmOpen,
|
|
502
646
|
hasOlderMessages,
|
|
@@ -518,13 +662,15 @@ export function ChatContent({
|
|
|
518
662
|
requestOlderMessages,
|
|
519
663
|
requestOlderMessagesIfNeeded,
|
|
520
664
|
returnToComposer,
|
|
665
|
+
retryMessage,
|
|
666
|
+
removeLastDraftAttachment,
|
|
521
667
|
scrollRef,
|
|
522
668
|
selectedIdx,
|
|
523
669
|
setFollowMessages,
|
|
524
670
|
setSelectedIdx,
|
|
525
671
|
setSidebarSectionExpanded,
|
|
526
672
|
shouldLeaveComposerForSelection,
|
|
527
|
-
|
|
673
|
+
channelListReachable: canReachChannelList,
|
|
528
674
|
sidebarCursorRow,
|
|
529
675
|
sidebarFocusedRef,
|
|
530
676
|
});
|
|
@@ -553,9 +699,11 @@ export function ChatContent({
|
|
|
553
699
|
latestEditableMessageId,
|
|
554
700
|
beginEditMessage,
|
|
555
701
|
beginReplyTo,
|
|
702
|
+
retryMessage,
|
|
556
703
|
focusComposer,
|
|
557
704
|
catalog,
|
|
558
705
|
openTicker,
|
|
706
|
+
openAttachPicker: canAttach && nativePaneChrome ? () => attachPickerRef.current?.() : null,
|
|
559
707
|
currentUserId: user?.id,
|
|
560
708
|
profilePopoverUser,
|
|
561
709
|
showProfilePopover: showUserProfilePopover,
|
|
@@ -568,8 +716,8 @@ export function ChatContent({
|
|
|
568
716
|
openTeamChannel,
|
|
569
717
|
canCycleChannels: channels.length > 1 && !!onChannelChange,
|
|
570
718
|
cycleChannel,
|
|
571
|
-
canFocusSidebar:
|
|
572
|
-
focusChannelSidebar,
|
|
719
|
+
canFocusSidebar: canReachChannelList && !sidebarFocused && !!onChannelChange,
|
|
720
|
+
focusChannelSidebar: reachChannelList,
|
|
573
721
|
jumpToMessage,
|
|
574
722
|
needsProfileSetup: !!user?.id && ownProfileConfigured === false,
|
|
575
723
|
openProfileSetup,
|
|
@@ -581,51 +729,57 @@ export function ChatContent({
|
|
|
581
729
|
const chatLayoutHeight = nativePaneChrome ? "100%" : height;
|
|
582
730
|
const nativeFillStyle = nativePaneChrome ? { minHeight: 0 } : undefined;
|
|
583
731
|
|
|
584
|
-
|
|
732
|
+
const channelSidebar = (
|
|
733
|
+
<ChannelSidebar
|
|
734
|
+
channels={channels}
|
|
735
|
+
channelStates={channelStates}
|
|
736
|
+
activeChannelId={sidebarFocused ? (sidebarHeaderCursor ? "" : sidebarCursorChannelId) : channelId}
|
|
737
|
+
cursorHeaderKey={sidebarFocused ? sidebarHeaderCursor : null}
|
|
738
|
+
width={stackedNav ? width : channelSidebarWidth}
|
|
739
|
+
paneWidth={width}
|
|
740
|
+
resizable={!stackedNav}
|
|
741
|
+
height={height}
|
|
742
|
+
focused={focused}
|
|
743
|
+
keyboardFocused={sidebarFocused}
|
|
744
|
+
loading={channelsLoading}
|
|
745
|
+
canManageNotifications={!!user?.emailVerified}
|
|
746
|
+
canCreateConversation={!!user?.emailVerified}
|
|
747
|
+
needsProfileSetup={!!user?.id && ownProfileConfigured === false}
|
|
748
|
+
onOpenProfile={openProfileSetup}
|
|
749
|
+
onSelect={stackedNav ? selectChannelFromList : selectSidebarChannel}
|
|
750
|
+
onFocusRequest={() => setSidebarFocused(true)}
|
|
751
|
+
onCreateConversation={openNewDmDialog}
|
|
752
|
+
onToggleNotifications={(nextChannelId, enabled) => {
|
|
753
|
+
controller.setChannelNotificationsEnabled(nextChannelId, enabled);
|
|
754
|
+
}}
|
|
755
|
+
onCreateTeamChannel={openTeamChannel}
|
|
756
|
+
/>
|
|
757
|
+
);
|
|
758
|
+
|
|
759
|
+
const newDmDialog = newDmOpen ? (
|
|
760
|
+
<NewDmDialog
|
|
761
|
+
width={stackedNav ? width : chatWidth}
|
|
762
|
+
height={height}
|
|
763
|
+
userByUsername={userByUsername}
|
|
764
|
+
currentUserId={user?.id}
|
|
765
|
+
onCancel={closeNewDmDialog}
|
|
766
|
+
onSubmit={openConversationFromDialog}
|
|
767
|
+
/>
|
|
768
|
+
) : null;
|
|
769
|
+
|
|
770
|
+
const threadPane = (
|
|
585
771
|
<Box
|
|
586
|
-
flexDirection="
|
|
587
|
-
width={
|
|
772
|
+
flexDirection="column"
|
|
773
|
+
width={chatWidth}
|
|
588
774
|
height={chatLayoutHeight}
|
|
589
775
|
flexGrow={nativePaneChrome ? 1 : undefined}
|
|
776
|
+
backgroundColor={chatContentBg}
|
|
777
|
+
position="relative"
|
|
778
|
+
onMouseDown={() => focusChatContent()}
|
|
590
779
|
style={nativeFillStyle}
|
|
591
780
|
>
|
|
592
|
-
{
|
|
593
|
-
|
|
594
|
-
channels={channels}
|
|
595
|
-
channelStates={channelStates}
|
|
596
|
-
activeChannelId={sidebarFocused ? (sidebarHeaderCursor ? "" : sidebarCursorChannelId) : channelId}
|
|
597
|
-
cursorHeaderKey={sidebarFocused ? sidebarHeaderCursor : null}
|
|
598
|
-
width={channelSidebarWidth}
|
|
599
|
-
paneWidth={width}
|
|
600
|
-
height={height}
|
|
601
|
-
focused={focused}
|
|
602
|
-
keyboardFocused={sidebarFocused}
|
|
603
|
-
loading={channelsLoading}
|
|
604
|
-
canManageNotifications={!!user?.emailVerified}
|
|
605
|
-
canCreateConversation={!!user?.emailVerified}
|
|
606
|
-
needsProfileSetup={!!user?.id && ownProfileConfigured === false}
|
|
607
|
-
onOpenProfile={openProfileSetup}
|
|
608
|
-
onSelect={selectSidebarChannel}
|
|
609
|
-
onFocusRequest={() => setSidebarFocused(true)}
|
|
610
|
-
onCreateConversation={openNewDmDialog}
|
|
611
|
-
onToggleNotifications={(nextChannelId, enabled) => {
|
|
612
|
-
controller.setChannelNotificationsEnabled(nextChannelId, enabled);
|
|
613
|
-
}}
|
|
614
|
-
onCreateTeamChannel={openTeamChannel}
|
|
615
|
-
/>
|
|
616
|
-
)}
|
|
617
|
-
|
|
618
|
-
<Box
|
|
619
|
-
flexDirection="column"
|
|
620
|
-
width={chatWidth}
|
|
621
|
-
height={chatLayoutHeight}
|
|
622
|
-
flexGrow={nativePaneChrome ? 1 : undefined}
|
|
623
|
-
backgroundColor={chatContentBg}
|
|
624
|
-
position="relative"
|
|
625
|
-
onMouseDown={() => focusChatContent()}
|
|
626
|
-
style={nativeFillStyle}
|
|
627
|
-
>
|
|
628
|
-
{!nativePaneChrome && (
|
|
781
|
+
{/* In the stack, the Back row above takes the place of the top rule. */}
|
|
782
|
+
{!nativePaneChrome && !stackedNav && (
|
|
629
783
|
<Box height={1} width={contentWidth}>
|
|
630
784
|
<Text fg={colors.border}>{"-".repeat(contentWidth)}</Text>
|
|
631
785
|
</Box>
|
|
@@ -646,6 +800,8 @@ export function ChatContent({
|
|
|
646
800
|
loadingOlderMessages={loadingOlderMessages}
|
|
647
801
|
messagesError={messagesError}
|
|
648
802
|
onRetryMessages={retryMessages}
|
|
803
|
+
retryMessage={retryMessage}
|
|
804
|
+
onImageLoadError={refreshImageLinks}
|
|
649
805
|
messageAreaHeight={messageAreaHeight}
|
|
650
806
|
messageBodyWidth={messageBodyWidth}
|
|
651
807
|
messages={messages}
|
|
@@ -658,23 +814,16 @@ export function ChatContent({
|
|
|
658
814
|
scrollRef={scrollRef}
|
|
659
815
|
selectedIdx={selectedIdx}
|
|
660
816
|
setHoveredIdx={setHoveredIdx}
|
|
661
|
-
showProfilePopover={
|
|
817
|
+
showProfilePopover={hoverUserProfile}
|
|
818
|
+
toggleProfilePopover={toggleUserProfile}
|
|
819
|
+
dismissProfilePopover={dismissProfilePopover}
|
|
662
820
|
stickyTranscript={stickyTranscript}
|
|
663
821
|
user={user}
|
|
664
822
|
userByUsername={userByUsername}
|
|
665
823
|
onSetUpProfile={openProfileSetup}
|
|
666
824
|
/>
|
|
667
825
|
|
|
668
|
-
{
|
|
669
|
-
<NewDmDialog
|
|
670
|
-
width={chatWidth}
|
|
671
|
-
height={height}
|
|
672
|
-
userByUsername={userByUsername}
|
|
673
|
-
currentUserId={user?.id}
|
|
674
|
-
onCancel={closeNewDmDialog}
|
|
675
|
-
onSubmit={openConversationFromDialog}
|
|
676
|
-
/>
|
|
677
|
-
) : null}
|
|
826
|
+
{stackedNav ? null : newDmDialog}
|
|
678
827
|
|
|
679
828
|
{!nativePaneChrome && !canSend && (
|
|
680
829
|
<Box height={1} width={contentWidth}>
|
|
@@ -708,8 +857,60 @@ export function ChatContent({
|
|
|
708
857
|
onMentionCursorChange={syncComposerCursor}
|
|
709
858
|
onMentionSelect={commitMentionSelection}
|
|
710
859
|
user={user}
|
|
860
|
+
draftAttachments={draftAttachments}
|
|
861
|
+
canAttach={canAttach}
|
|
862
|
+
onAttachFiles={attachFiles}
|
|
863
|
+
onRemoveAttachment={removeDraftAttachment}
|
|
864
|
+
onRetryAttachment={retryDraftAttachment}
|
|
865
|
+
attachPickerRef={attachPickerRef}
|
|
711
866
|
/>
|
|
867
|
+
{nativePaneChrome && dropActive && <DesktopChatDropOverlay />}
|
|
868
|
+
</Box>
|
|
869
|
+
);
|
|
870
|
+
// Files dropped anywhere on the thread, or pasted into its composer, attach.
|
|
871
|
+
const thread = nativePaneChrome ? (
|
|
872
|
+
<DesktopChatDropTarget
|
|
873
|
+
enabled={imagesAvailable}
|
|
874
|
+
onFiles={attachFiles}
|
|
875
|
+
onDragActiveChange={setDropActive}
|
|
876
|
+
>
|
|
877
|
+
{threadPane}
|
|
878
|
+
</DesktopChatDropTarget>
|
|
879
|
+
) : threadPane;
|
|
880
|
+
|
|
881
|
+
if (stackedNav) {
|
|
882
|
+
return (
|
|
883
|
+
<Box
|
|
884
|
+
flexDirection="column"
|
|
885
|
+
width={width}
|
|
886
|
+
height={chatLayoutHeight}
|
|
887
|
+
flexGrow={nativePaneChrome ? 1 : undefined}
|
|
888
|
+
position="relative"
|
|
889
|
+
style={nativeFillStyle}
|
|
890
|
+
>
|
|
891
|
+
<PageStackView
|
|
892
|
+
// Esc first drops a selection or the profile card, then leaves the channel.
|
|
893
|
+
focused={focused && !newDmOpen && !inputFocused && !selectionActive && !profilePopoverUser}
|
|
894
|
+
detailOpen={!channelListOpen}
|
|
895
|
+
onBack={openChannelList}
|
|
896
|
+
rootContent={channelSidebar}
|
|
897
|
+
detailContent={thread}
|
|
898
|
+
/>
|
|
899
|
+
{newDmDialog}
|
|
712
900
|
</Box>
|
|
901
|
+
);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
return (
|
|
905
|
+
<Box
|
|
906
|
+
flexDirection="row"
|
|
907
|
+
width={width}
|
|
908
|
+
height={chatLayoutHeight}
|
|
909
|
+
flexGrow={nativePaneChrome ? 1 : undefined}
|
|
910
|
+
style={nativeFillStyle}
|
|
911
|
+
>
|
|
912
|
+
{showChannelSidebar && channelSidebar}
|
|
913
|
+
{thread}
|
|
713
914
|
</Box>
|
|
714
915
|
);
|
|
715
916
|
}
|