@gloom-sh/terminal 0.20.17 → 0.20.19
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 +3 -1
- package/src/account/auth-dialog.tsx +19 -1
- package/src/account/billing.ts +2 -1
- package/src/account/heard-from-question.tsx +235 -0
- package/src/account/heard-from.ts +97 -0
- package/src/api-client/cot.ts +5 -6
- package/src/api-client/data.ts +14 -3
- package/src/api-client/heard-from.ts +72 -0
- package/src/api-client/index.ts +64 -6
- package/src/api-client/mna.ts +18 -0
- package/src/api-client/request.ts +162 -40
- package/src/api-client/supply-chain.ts +9 -0
- package/src/api-client/types/billing.ts +35 -1
- package/src/api-client/types/news.ts +45 -0
- package/src/api-client/types/world-venues.ts +9 -0
- package/src/app/global-shortcuts.ts +5 -3
- package/src/app/pro-welcome/keys.ts +27 -0
- package/src/app/pro-welcome/model.ts +158 -0
- package/src/app/pro-welcome/row.tsx +176 -0
- package/src/app/pro-welcome/use-pro-welcome.ts +156 -0
- package/src/app/runtime/external-profile-changes.ts +135 -0
- package/src/app.tsx +37 -4
- package/src/architecture/core-builtin-allowlist.json +1 -1
- package/src/architecture/floating-promise-allowlist.json +1 -2
- package/src/architecture/shortcut-labels-allowlist.json +1 -0
- package/src/cli/alert-listing.ts +98 -0
- package/src/cli/commands/market.ts +191 -39
- package/src/cli/commands/overview.ts +7 -1
- package/src/cli/commands/plugins.ts +3 -2
- package/src/cli/commands/search.ts +30 -6
- package/src/cli/commands/ticker.ts +13 -6
- package/src/cli/context.ts +24 -5
- package/src/cli/csv-export.ts +2 -1
- package/src/cli/desktop-pane-shot-browser.ts +3 -1
- package/src/cli/desktop-pane-shot-view.ts +0 -1
- package/src/cli/desktop-pane-shot.ts +276 -52
- package/src/cli/errors.ts +3 -9
- package/src/cli/exit-codes.ts +1 -1
- package/src/cli/glossary.ts +65 -11
- package/src/cli/help.ts +1 -1
- package/src/cli/history-demergers.ts +117 -0
- package/src/cli/history-rows.ts +8 -4
- package/src/cli/index.ts +2 -1
- package/src/cli/known-gaps.ts +16 -0
- package/src/cli/known-us-stocks.ts +18 -0
- package/src/cli/listing-arg.ts +192 -38
- package/src/cli/pane-functions/catalog-snapshot-build.ts +83 -0
- package/src/cli/pane-functions/catalog-snapshot.json +877 -0
- package/src/cli/pane-functions/catalog-snapshot.ts +62 -0
- package/src/cli/pane-functions/catalog.ts +50 -16
- package/src/cli/pane-functions/data.ts +16 -4
- package/src/cli/pane-functions/dom.ts +54 -8
- package/src/cli/pane-functions/freshness.ts +39 -4
- package/src/cli/pane-functions/function-help.ts +3 -3
- package/src/cli/pane-functions/headless.ts +9 -1
- package/src/cli/pane-functions/index.ts +175 -50
- package/src/cli/pane-functions/report-notices.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +11 -7
- package/src/cli/pane-functions/screenshot-assessment.ts +38 -10
- package/src/cli/pane-functions/screenshot-data-evidence.ts +7 -15
- package/src/cli/pane-functions/screenshot-payload.ts +36 -1
- package/src/cli/pane-functions/screenshot-render.ts +24 -9
- package/src/cli/pane-functions/screenshot-types.ts +9 -0
- package/src/cli/quote-answer.ts +33 -17
- package/src/cli/registry.ts +22 -2
- package/src/cli/result.ts +22 -4
- package/src/cli/scroll-truncation.ts +7 -2
- package/src/cli/series-search.ts +45 -6
- package/src/cli/shot-temp-dir.ts +4 -9
- package/src/cli/ticker-resolution.ts +1 -1
- package/src/cli/unreachable.ts +21 -0
- package/src/components/chart/composite/drawing-store.ts +11 -7
- package/src/components/chart/composite/format.ts +1 -0
- package/src/components/chart/composite/legend.tsx +48 -20
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +3 -3
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +9 -2
- package/src/components/chart/composite/panel-surface.tsx +1 -1
- package/src/components/chart/composite/price-axis-labels.tsx +7 -5
- package/src/components/chart/composite/tools.ts +164 -39
- package/src/components/chart-table/header.tsx +11 -2
- package/src/components/chart-table/layout.ts +16 -17
- package/src/components/command-bar/pane-templates/items.ts +17 -1
- package/src/components/command-bar/routes/root/provider-search.ts +10 -1
- package/src/components/command-bar/routes/root/results.ts +34 -2
- package/src/components/command-bar/routes/root/runtime.ts +19 -4
- package/src/components/command-bar/routes/ticker-search/results.ts +5 -0
- package/src/components/command-bar/routes/ticker-search/route.ts +5 -0
- package/src/components/command-bar/selection-runtime.ts +29 -5
- package/src/components/command-bar/surface/index.tsx +4 -1
- package/src/components/command-bar/workflow/alert.ts +32 -13
- package/src/components/data-table/view.tsx +15 -2
- package/src/components/form-modal/content.tsx +9 -4
- package/src/components/index.ts +1 -1
- package/src/components/layout/header.tsx +9 -5
- package/src/components/layout/pane/capture-status.ts +6 -0
- package/src/components/layout/pane/footer/index.tsx +2 -0
- package/src/components/layout/pane/footer/model.ts +123 -17
- package/src/components/layout/pane/header.tsx +16 -2
- package/src/components/layout/pane/status-footer.ts +24 -0
- package/src/components/market-board/index.tsx +4 -2
- package/src/components/onboarding/onboarding-frame.tsx +6 -2
- package/src/components/onboarding/onboarding-keyboard.ts +7 -1
- package/src/components/onboarding/onboarding-wizard.tsx +3 -1
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +24 -15
- package/src/components/onboarding/setup-cards.ts +36 -0
- package/src/components/onboarding/use-onboarding-progress.ts +22 -1
- package/src/components/onboarding/wizard-account.ts +6 -1
- package/src/components/onboarding/wizard-model.ts +32 -6
- package/src/components/onboarding/wizard-positions.ts +1 -1
- package/src/components/price-performance.tsx +26 -8
- package/src/components/reader/article-reader.tsx +12 -5
- package/src/components/sign-in-gate.tsx +3 -1
- package/src/components/toggle-list.tsx +6 -8
- package/src/components/ui/confirm-dialog.tsx +47 -7
- package/src/components/ui/data-table/opentui/index.tsx +7 -0
- package/src/components/ui/data-table/types.ts +8 -0
- package/src/components/ui/display.tsx +17 -2
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/stat-grid.tsx +4 -0
- package/src/components/ui/status.tsx +13 -1
- package/src/components/ui/table-layout.ts +34 -2
- package/src/components/use-pane-notice-footer.tsx +16 -3
- package/src/data/config/store/index.ts +31 -0
- package/src/data/config/store/node.ts +61 -11
- package/src/data/config/store/normalize.ts +4 -6
- package/src/data/config/store/shared-file.ts +309 -0
- package/src/data/profile-merge.ts +299 -0
- package/src/data/sqlite/checkpointer.ts +11 -1
- package/src/data/sqlite/database.ts +1 -1
- package/src/data/ticker-repository.ts +134 -10
- package/src/data/ticker-store.ts +67 -0
- package/src/data/ticker-writes.ts +5 -0
- package/src/i18n/es.ts +27 -0
- package/src/i18n/ja.ts +27 -0
- package/src/i18n/ko.ts +27 -0
- package/src/i18n/zh-cn.ts +27 -0
- package/src/i18n/zh-tw.ts +27 -0
- package/src/layout-marketplace/gallery-desktop.tsx +2 -2
- package/src/market-data/ah-pair.ts +122 -0
- package/src/market-data/coordinator/entries.ts +6 -4
- package/src/market-data/coordinator/index.ts +14 -3
- package/src/market-data/depositary-pair.ts +6 -2
- package/src/market-data/futures-board.ts +36 -29
- package/src/market-data/futures-contract.ts +37 -1
- package/src/market-data/hooks.tsx +33 -2
- package/src/market-data/market/change-basis.ts +11 -1
- package/src/market-data/market/header-market.ts +11 -0
- package/src/market-data/market/status.ts +40 -4
- package/src/market-data/performance.ts +127 -32
- package/src/market-data/quotes/time.ts +5 -2
- package/src/market-data/split-terms.ts +28 -0
- package/src/news/types.ts +28 -0
- package/src/notifications/app-badge.ts +2 -3
- package/src/notifications/app-notifier.ts +5 -0
- package/src/plugins/builtin/account-management/footer.ts +1 -1
- package/src/plugins/builtin/account-management/keyboard.ts +4 -0
- package/src/plugins/builtin/account-management/model.ts +1 -0
- package/src/plugins/builtin/account-management/pane.tsx +75 -7
- package/src/plugins/builtin/account-management/payment-recovery-row.tsx +12 -5
- package/src/plugins/builtin/account-management/pro-cancel.tsx +197 -0
- package/src/plugins/builtin/account-management/trial-cancel.ts +1 -1
- package/src/plugins/builtin/alerts/cli-move.ts +2 -2
- package/src/plugins/builtin/alerts/cli.ts +101 -48
- package/src/plugins/builtin/alerts/command.ts +39 -9
- package/src/plugins/builtin/alerts/constants.ts +10 -0
- package/src/plugins/builtin/alerts/earnings-listing.ts +20 -0
- package/src/plugins/builtin/alerts/event-rows.ts +9 -3
- package/src/plugins/builtin/alerts/events-pane.tsx +16 -10
- package/src/plugins/builtin/alerts/format.ts +24 -8
- package/src/plugins/builtin/alerts/headless.ts +12 -6
- package/src/plugins/builtin/alerts/index.tsx +97 -16
- package/src/plugins/builtin/alerts/move-checks.ts +7 -0
- package/src/plugins/builtin/alerts/option-contract.ts +197 -0
- package/src/plugins/builtin/alerts/pane.tsx +1 -1
- package/src/plugins/builtin/alerts/price.ts +30 -5
- package/src/plugins/builtin/alerts/pro-rules.ts +62 -0
- package/src/plugins/builtin/alerts/quotes.ts +26 -2
- package/src/plugins/builtin/alerts/research-builder.ts +5 -10
- package/src/plugins/builtin/alerts/scheduled.ts +6 -1
- package/src/plugins/builtin/alerts/types.ts +7 -0
- package/src/plugins/builtin/analytics/account-returns.ts +1 -1
- package/src/plugins/builtin/analytics/manual-value.ts +61 -0
- package/src/plugins/builtin/analytics/pane-model.ts +2 -2
- package/src/plugins/builtin/analytics/risk-book.ts +7 -7
- package/src/plugins/builtin/analytics/risk-client.ts +27 -14
- package/src/plugins/builtin/analytics/risk-headless.ts +13 -8
- package/src/plugins/builtin/analytics/risk-model.ts +92 -4
- package/src/plugins/builtin/analytics/risk-pane.tsx +85 -38
- package/src/plugins/builtin/awards/pane.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -14
- package/src/plugins/builtin/catalysts/model.ts +2 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +8 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -3
- package/src/plugins/builtin/chart-composer/chart-spec.ts +5 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +9 -5
- package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +2 -6
- package/src/plugins/builtin/chart-composer/headless-schema.ts +14 -10
- package/src/plugins/builtin/chart-composer/headless.ts +2 -0
- package/src/plugins/builtin/chart-composer/index.tsx +17 -5
- package/src/plugins/builtin/chart-composer/pane.tsx +19 -6
- package/src/plugins/builtin/chart-composer/viewport-labels.ts +2 -17
- package/src/plugins/builtin/chat/controller/notifications.ts +1 -0
- package/src/plugins/builtin/chat/index.tsx +0 -1
- package/src/plugins/builtin/cloud/auth-actions.tsx +11 -6
- package/src/plugins/builtin/cloud/company-picker.tsx +5 -3
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/commodities-energy/index.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +10 -5
- package/src/plugins/builtin/company-kpis/latest.ts +45 -0
- package/src/plugins/builtin/company-kpis/model.ts +57 -15
- package/src/plugins/builtin/company-kpis/pane.tsx +22 -8
- package/src/plugins/builtin/composite/alt-data.ts +20 -0
- package/src/plugins/builtin/composite/application.ts +14 -0
- package/src/plugins/builtin/composite/broker.ts +12 -0
- package/src/plugins/builtin/composite/credit.ts +33 -0
- package/src/plugins/builtin/composite/crypto.ts +10 -0
- package/src/plugins/builtin/composite/earnings.ts +12 -0
- package/src/plugins/builtin/composite/filings.ts +13 -0
- package/src/plugins/builtin/composite/futures-commodities.ts +23 -0
- package/src/plugins/builtin/composite/global-markets.ts +12 -0
- package/src/plugins/builtin/composite/options-volatility.ts +23 -0
- package/src/plugins/builtin/composite/ownership.ts +23 -0
- package/src/plugins/builtin/composite/portfolio.ts +10 -0
- package/src/plugins/builtin/composite/quant.ts +15 -0
- package/src/plugins/builtin/composite/rates-macro.ts +30 -0
- package/src/plugins/builtin/composite/screeners.ts +11 -0
- package/src/plugins/builtin/composite/shared.ts +11 -0
- package/src/plugins/builtin/composite/ticker-core.ts +36 -0
- package/src/plugins/builtin/congress-trades/headless.ts +31 -3
- package/src/plugins/builtin/congress-trades/model.ts +9 -5
- package/src/plugins/builtin/correlation/index.tsx +13 -17
- package/src/plugins/builtin/correlation/matrix/model.ts +18 -0
- package/src/plugins/builtin/cot/client.ts +2 -3
- package/src/plugins/builtin/cot/headless.ts +16 -16
- package/src/plugins/builtin/cot/index.tsx +6 -6
- package/src/plugins/builtin/cot/model.ts +25 -5
- package/src/plugins/builtin/cot/pane.tsx +11 -6
- package/src/plugins/builtin/cot/series.ts +11 -8
- package/src/plugins/builtin/cpi/model.ts +15 -4
- package/src/plugins/builtin/cpi/pane.tsx +29 -7
- package/src/plugins/builtin/dividend-yield/client.ts +57 -16
- package/src/plugins/builtin/dividend-yield/headless.ts +17 -11
- package/src/plugins/builtin/dividend-yield/model.ts +4 -3
- package/src/plugins/builtin/dividend-yield/pane.tsx +22 -18
- package/src/plugins/builtin/dividend-yield/ranking.ts +1 -1
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +23 -12
- package/src/plugins/builtin/doe/model.ts +30 -0
- package/src/plugins/builtin/doe/pane.tsx +8 -2
- package/src/plugins/builtin/earnings/board-table.ts +9 -4
- package/src/plugins/builtin/earnings/fiscal-quarter.ts +39 -0
- package/src/plugins/builtin/earnings/headless.ts +16 -6
- package/src/plugins/builtin/earnings/history-model.ts +6 -4
- package/src/plugins/builtin/earnings/history-table.ts +7 -4
- package/src/plugins/builtin/earnings-calls/calendar.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/pane.tsx +8 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +2 -2
- package/src/plugins/builtin/econ/calendar-model.ts +16 -0
- package/src/plugins/builtin/econ/index.tsx +7 -2
- package/src/plugins/builtin/equity-screener/headless.ts +4 -1
- package/src/plugins/builtin/equity-screener/model.ts +7 -6
- package/src/plugins/builtin/estimate-revisions/headless.ts +1 -1
- package/src/plugins/builtin/exposure/model.ts +10 -0
- package/src/plugins/builtin/exposure/pane.tsx +10 -3
- package/src/plugins/builtin/futures/model.ts +14 -1
- package/src/plugins/builtin/futures/series.ts +1 -8
- package/src/plugins/builtin/fx-matrix/amount.ts +15 -1
- package/src/plugins/builtin/fx-matrix/headless.ts +12 -6
- package/src/plugins/builtin/fx-matrix/index.tsx +25 -7
- package/src/plugins/builtin/fx-matrix/settings.ts +9 -4
- package/src/plugins/builtin/insider/detail.tsx +36 -7
- package/src/plugins/builtin/insider/filing-stories.ts +110 -0
- package/src/plugins/builtin/insider/headless.ts +37 -2
- package/src/plugins/builtin/insider/index.tsx +79 -10
- package/src/plugins/builtin/insider/model.ts +43 -5
- package/src/plugins/builtin/ipo-calendar/client.ts +11 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +3 -7
- package/src/plugins/builtin/jobs/headless.ts +2 -1
- package/src/plugins/builtin/jobs/model.ts +6 -0
- package/src/plugins/builtin/jobs/pane.tsx +8 -3
- package/src/plugins/builtin/kelly-sizer/pane.tsx +9 -4
- package/src/plugins/builtin/market-valuation/pane.tsx +22 -10
- package/src/plugins/builtin/mna/detail.tsx +67 -6
- package/src/plugins/builtin/mna/headless.ts +128 -13
- package/src/plugins/builtin/mna/model.ts +219 -16
- package/src/plugins/builtin/mna/pane.tsx +34 -6
- package/src/plugins/builtin/money-markets/model.ts +14 -5
- package/src/plugins/builtin/money-markets/pane.tsx +4 -3
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +118 -10
- package/src/plugins/builtin/news/wire/news/footer.ts +3 -8
- package/src/plugins/builtin/news/wire/news/story-evidence.ts +178 -0
- package/src/plugins/builtin/options/analytics.ts +1 -1
- package/src/plugins/builtin/options/view.tsx +18 -11
- package/src/plugins/builtin/options-positioning/model.ts +11 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +22 -1
- package/src/plugins/builtin/options-scenario/client.ts +49 -8
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +22 -6
- package/src/plugins/builtin/options-scenario/csp-screen.ts +39 -12
- package/src/plugins/builtin/options-scenario/headless.ts +7 -3
- package/src/plugins/builtin/options-scenario/model.ts +33 -2
- package/src/plugins/builtin/options-scenario/pane.tsx +3 -4
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +7 -5
- package/src/plugins/builtin/pe-band/client.ts +13 -1
- package/src/plugins/builtin/pe-band/headless.ts +2 -2
- package/src/plugins/builtin/pe-band/model.ts +63 -10
- package/src/plugins/builtin/pe-band/pane.tsx +5 -5
- package/src/plugins/builtin/perps/cascade.ts +4 -3
- package/src/plugins/builtin/perps/markets-section.tsx +5 -2
- package/src/plugins/builtin/perps/model.ts +4 -3
- package/src/plugins/builtin/portfolio-list/allocation-rows.ts +26 -7
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +66 -13
- package/src/plugins/builtin/portfolio-list/cli/render.ts +76 -33
- package/src/plugins/builtin/portfolio-list/headless.ts +69 -22
- package/src/plugins/builtin/portfolio-list/pane/data.ts +3 -3
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +29 -14
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/table.tsx +3 -2
- package/src/plugins/builtin/relative-rotation/pane.tsx +2 -3
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +33 -14
- package/src/plugins/builtin/research/event-model.ts +43 -19
- package/src/plugins/builtin/research/headless.ts +8 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +19 -17
- package/src/plugins/builtin/research-search/index.tsx +3 -1
- package/src/plugins/builtin/scanner/denied.tsx +16 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
- package/src/plugins/builtin/sec/filing-display.tsx +14 -2
- package/src/plugins/builtin/sec/headless.ts +42 -4
- package/src/plugins/builtin/sec/index.tsx +21 -1
- package/src/plugins/builtin/sectors/index.tsx +6 -9
- package/src/plugins/builtin/sectors/sector-model.ts +1 -1
- package/src/plugins/builtin/shared/cloud-upgrade.ts +1 -1
- package/src/plugins/builtin/shared/earnings-report.ts +49 -5
- package/src/plugins/builtin/shared/options-pro-copy.ts +34 -0
- package/src/plugins/builtin/shared/report-freshness.ts +2 -3
- package/src/plugins/builtin/shared/statement-currency.ts +23 -0
- package/src/plugins/builtin/shared/ticker-surface.ts +1 -1
- package/src/plugins/builtin/supply-chain/client.ts +34 -9
- package/src/plugins/builtin/supply-chain/evidence.ts +3 -2
- package/src/plugins/builtin/supply-chain/flow.tsx +4 -3
- package/src/plugins/builtin/supply-chain/graph-model.ts +14 -7
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +3 -1
- package/src/plugins/builtin/supply-chain/graph.tsx +6 -3
- package/src/plugins/builtin/supply-chain/headless.ts +19 -4
- package/src/plugins/builtin/supply-chain/model.ts +50 -6
- package/src/plugins/builtin/supply-chain/pane.tsx +79 -18
- package/src/plugins/builtin/themes/headless.ts +4 -4
- package/src/plugins/builtin/themes/model.ts +11 -8
- package/src/plugins/builtin/themes/pane.tsx +2 -2
- package/src/plugins/builtin/ticker-detail/adr-pair/ah.ts +62 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +119 -20
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +51 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +25 -14
- package/src/plugins/builtin/ticker-detail/financials/model.ts +22 -32
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +7 -9
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +2 -0
- package/src/plugins/builtin/ticker-detail/headless.ts +28 -12
- package/src/plugins/builtin/ticker-detail/overview/board-lot.ts +21 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -2
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +8 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +68 -13
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +9 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +5 -2
- package/src/plugins/builtin/volatility/model.ts +17 -0
- package/src/plugins/builtin/volatility/pane.tsx +16 -7
- package/src/plugins/builtin/world-indices/index.tsx +2 -0
- package/src/plugins/builtin/world-indices/table.tsx +15 -0
- package/src/plugins/builtin/world-venue-map/evidence.ts +3 -2
- package/src/plugins/builtin/world-venue-map/headless.ts +32 -18
- package/src/plugins/builtin/world-venue-map/index.ts +19 -6
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +9 -5
- package/src/plugins/builtin/world-venue-map/layers.ts +33 -11
- package/src/plugins/builtin/world-venue-map/map.tsx +12 -0
- package/src/plugins/builtin/world-venue-map/model.ts +6 -1
- package/src/plugins/builtin/world-venue-map/pane.tsx +35 -6
- package/src/plugins/builtin/world-venue-map/place.ts +119 -0
- package/src/plugins/builtin/world-venue-map/venue-header.tsx +5 -3
- package/src/plugins/catalog-browser.ts +10 -1
- package/src/plugins/catalog-data.ts +20 -0
- package/src/plugins/catalog-lazy.ts +51 -0
- package/src/plugins/catalog-ui.ts +16 -18
- package/src/plugins/host-smoke.ts +5 -2
- package/src/portfolio/allocation.ts +79 -19
- package/src/portfolio/cash-balances.ts +76 -0
- package/src/portfolio/mutations.ts +43 -8
- package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
- package/src/renderers/browser/activity.ts +16 -0
- package/src/renderers/browser/app-badge-host.ts +14 -0
- package/src/renderers/browser/main.tsx +5 -0
- package/src/renderers/browser/notifications.ts +103 -0
- package/src/renderers/browser/ui-host.tsx +4 -0
- package/src/renderers/desktop/window-layouts.ts +14 -0
- package/src/renderers/dom/data-table/index.tsx +27 -4
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/host/tabs.tsx +57 -8
- package/src/renderers/dom/styles.css +13 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +4 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +22 -1
- package/src/renderers/electrobun/bun/window/native-min-size.ts +6 -1
- package/src/renderers/electrobun/shared/protocol.ts +4 -0
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +50 -12
- package/src/renderers/electrobun/view/http-fetch.ts +3 -2
- package/src/renderers/electrobun/view/remote/ticker-repository.ts +10 -0
- package/src/series/standalone-catalog.ts +5 -4
- package/src/series/standalone.ts +13 -7
- package/src/sources/gloomberb-cloud/index.ts +22 -9
- package/src/sources/gloomberb-cloud/news.ts +35 -0
- package/src/sources/gloomberb-cloud/perpetuals.ts +60 -3
- package/src/sources/provider-errors.ts +34 -7
- package/src/sources/provider-router/financials.ts +20 -13
- package/src/sources/provider-router/history.ts +32 -6
- package/src/sources/provider-router/index.ts +4 -0
- package/src/sources/provider-router/search.ts +1 -0
- package/src/sync/collections-contributor.ts +3 -1
- package/src/sync/config-merge.ts +10 -1
- package/src/sync/sanitize.ts +26 -2
- package/src/tickers/company-name-listing.ts +16 -2
- package/src/tickers/listing-fate.ts +12 -8
- package/src/tickers/renamed-listings.ts +43 -10
- package/src/tickers/search/home-listing.ts +28 -0
- package/src/tickers/search/index.ts +19 -7
- package/src/tickers/terminal-codes.ts +11 -1
- package/src/time-series/base-series.ts +39 -6
- package/src/time-series/chart-seed.ts +2 -2
- package/src/time-series/history-quality.ts +4 -1
- package/src/time-series/hooks.ts +2 -0
- package/src/time-series/price-comparison.ts +17 -23
- package/src/time-series/reporting.ts +1 -1
- package/src/time-series/resolution.ts +13 -0
- package/src/time-series/resolve-context.ts +6 -0
- package/src/time-series/resolve.ts +42 -3
- package/src/time-series/spec.ts +2 -2
- package/src/time-series/types.ts +3 -2
- package/src/types/data-provider.ts +11 -0
- package/src/types/financials.ts +48 -4
- package/src/types/headless.ts +1 -0
- package/src/types/issuer-listings.ts +2 -0
- package/src/types/plugin-notifications.ts +3 -0
- package/src/types/price-history.ts +6 -4
- package/src/types/ticker.ts +10 -2
- package/src/ui/host.tsx +2 -0
- package/src/utils/cli-output.ts +1 -1
- package/src/utils/declared-dividends.ts +13 -1
- package/src/utils/dividend-cash.ts +5 -1
- package/src/utils/exchange-announcements.ts +7 -2
- package/src/utils/forward-dividend.ts +4 -3
- package/src/utils/fundamentals.ts +40 -0
- package/src/utils/network-failure.ts +2 -0
- package/src/utils/price-history-integrity.ts +9 -1
- package/src/utils/remove-folder.ts +37 -0
- package/src/utils/trailing-dividend.ts +1 -1
- package/src/plugins/builtin/composite-plugins.ts +0 -285
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseFxArgs, parseFxRequest } from "../../../cli/fx-pair";
|
|
2
2
|
import { currencyMinorDigits } from "../../../market-data/market/format";
|
|
3
3
|
import { parseTypedNumber } from "../../../utils/decimal-comma";
|
|
4
|
-
import { isFxCurrency, type FxCurrency } from "./pairs";
|
|
4
|
+
import { CURRENCY_SETS, isFxCurrency, type FxCurrency } from "./pairs";
|
|
5
5
|
|
|
6
6
|
/** An amount of one of the board's currencies, shown in every currency it lists. */
|
|
7
7
|
export interface FxBoardAmount {
|
|
@@ -63,6 +63,20 @@ export function parseFxBoardAmount(text: string): FxBoardAmountRequest | { error
|
|
|
63
63
|
return { amount, currency, to: target === currency ? null : target };
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Currencies typed for the board with no amount, to add to it: `TRY`,
|
|
68
|
+
* `USD,TRY`, `usd try`, a set's name (`emea`), separated by commas or spaces,
|
|
69
|
+
* in order without repeats. Null for anything else: an amount, a pair written
|
|
70
|
+
* as one (`EUR/USD`, `eur to usd`, one unit of it), a word that is neither.
|
|
71
|
+
*/
|
|
72
|
+
export function parseFxBoardCurrencies(text: string): FxCurrency[] | null {
|
|
73
|
+
const tokens = text.trim().split(/[\s,;]+/).filter(Boolean);
|
|
74
|
+
if (tokens.length === 0 || /[\d/]/.test(text)) return null;
|
|
75
|
+
const codes = tokens.map((token) => CURRENCY_SETS.find((set) => set.id === token.toLowerCase())?.currencies
|
|
76
|
+
?? (isFxCurrency(token.toUpperCase()) ? [token.toUpperCase() as FxCurrency] : null));
|
|
77
|
+
return codes.every((code) => code !== null) ? [...new Set(codes.flat())] : null;
|
|
78
|
+
}
|
|
79
|
+
|
|
66
80
|
/** An amount as its currency writes it, grouped: 2,500,000 and 2,500,000.50 in EUR, 445,000,000 in JPY. */
|
|
67
81
|
export function formatAmountFigure(amount: number, currency: string): string {
|
|
68
82
|
const digits = currencyMinorDigits(currency);
|
|
@@ -7,7 +7,7 @@ import { servedFromSavedCopy } from "../../../data/saved-copies";
|
|
|
7
7
|
import { fxPairObservation, fxRateObservations } from "../shared/fx-rate-freshness";
|
|
8
8
|
import { loadFxBoard, type FxLegReading } from "./client";
|
|
9
9
|
import { crossMovePercent } from "./direction";
|
|
10
|
-
import { formatAmountFigure, formatFxBoardAmount, parseFxBoardAmount, withAmountCurrencies, type FxBoardAmount } from "./amount";
|
|
10
|
+
import { formatAmountFigure, formatFxBoardAmount, parseFxBoardAmount, parseFxBoardCurrencies, withAmountCurrencies, type FxBoardAmount } from "./amount";
|
|
11
11
|
import { FX_CURRENCY_KEYWORDS, formatRate, resolveCurrencies, type FxCurrency } from "./pairs";
|
|
12
12
|
import { FX_MATRIX_REPORT_OPTIONS, fxMatrixReportNotices } from "./settings";
|
|
13
13
|
|
|
@@ -42,16 +42,22 @@ function crossColumns(basis: string | null, amount: boolean): HeadlessPaneColumn
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/** `fn FXC 2500000 EUR`: the amount typed after the function, as the pane's Amount field reads it; null for none. */
|
|
45
|
+
const typedArgument = (argument: string | string[] | null | undefined) => Array.isArray(argument) ? argument.join(" ") : argument ?? "";
|
|
46
|
+
|
|
45
47
|
function reportAmount(argument: string | string[] | null | undefined): FxBoardAmount & { to: FxCurrency | null } | null {
|
|
46
|
-
const typed =
|
|
48
|
+
const typed = typedArgument(argument);
|
|
49
|
+
// Currencies alone (`fn FXC TRY`) are added to the board, as `FXC TRY` adds them in the app: no amount.
|
|
50
|
+
if (parseFxBoardCurrencies(typed)) return null;
|
|
47
51
|
const request = parseFxBoardAmount(typed);
|
|
48
52
|
if (request && "error" in request) throw new Error(request.error);
|
|
49
53
|
return request;
|
|
50
54
|
}
|
|
51
55
|
|
|
52
|
-
/** The board a report reads: its currencies, with the ones its
|
|
56
|
+
/** The board a report reads: its currencies, with the ones its argument names added at the end as the pane adds them. */
|
|
53
57
|
function reportCurrencies(args: { argument?: string | string[] | null; options: Record<string, unknown> }): FxCurrency[] {
|
|
54
58
|
const currencies = resolveCurrencies(args.options.currencies);
|
|
59
|
+
const added = parseFxBoardCurrencies(typedArgument(args.argument));
|
|
60
|
+
if (added) return [...currencies, ...added.filter((code) => !currencies.includes(code))];
|
|
55
61
|
const amount = reportAmount(args.argument);
|
|
56
62
|
return amount ? withAmountCurrencies(currencies, amount) : currencies;
|
|
57
63
|
}
|
|
@@ -171,8 +177,8 @@ export function projectFxCrosses(
|
|
|
171
177
|
export const fxMatrixHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
172
178
|
shape: "rows",
|
|
173
179
|
argument: {
|
|
174
|
-
kind: "free-text", optional: true, placeholder: "amount",
|
|
175
|
-
description: "An amount to convert into each currency, as the pane's Amount field takes it
|
|
180
|
+
kind: "free-text", optional: true, placeholder: "amount or currencies",
|
|
181
|
+
description: "An amount to convert into each currency, as the pane's Amount field takes it (2500000 EUR, 2,500,000 EUR/USD), or currencies to add to the board (TRY, USD,TRY).",
|
|
176
182
|
},
|
|
177
183
|
description: "Cross rates between currencies, one row per ordered pair, each with its move since the previous close, observation time and stale flag.",
|
|
178
184
|
freshness: { source: "Gloom Cloud" },
|
|
@@ -212,6 +218,6 @@ export const fxMatrixHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
212
218
|
if (legs.length > 0 && legs.every((reading) => reading.entry == null)) {
|
|
213
219
|
throw new Error(`Exchange rates unavailable for ${legs.map(({ leg }) => leg.currency).join(", ")}: ${legs[0]!.error}`);
|
|
214
220
|
}
|
|
215
|
-
return projectFxCrosses(currencies, readings, { notices: fxMatrixReportNotices(args.options), amount });
|
|
221
|
+
return projectFxCrosses(currencies, readings, { notices: fxMatrixReportNotices(args.options, currencies), amount });
|
|
216
222
|
},
|
|
217
223
|
};
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type PaneFooterSegment,
|
|
12
12
|
} from "../../../components";
|
|
13
13
|
import { handleRefreshKey } from "../../../components/data-table/table-pane";
|
|
14
|
-
import { getTableWidth } from "../../../components/ui/table-layout";
|
|
14
|
+
import { getTableWidth, markHiddenTableColumns } from "../../../components/ui/table-layout";
|
|
15
15
|
import { createDataTableCsv } from "../../../components/data-table/export";
|
|
16
16
|
import { ageFooterSegment, savedCopyFooterSegment } from "../../../components/layout/pane/footer";
|
|
17
17
|
import { CountryFlag } from "../../../components/ui/country-flag";
|
|
@@ -43,7 +43,8 @@ import { fxMatrixSettings } from "./settings";
|
|
|
43
43
|
import { createFxExportMetadata } from "./export";
|
|
44
44
|
import { fxMatrixHeadless } from "./headless";
|
|
45
45
|
import {
|
|
46
|
-
formatAmountFigure, formatFxBoardAmount, parseFxBoardAmount, parseFxBoardAmountEdit, readFxBoardAmount, storedFxBoardAmount,
|
|
46
|
+
formatAmountFigure, formatFxBoardAmount, parseFxBoardAmount, parseFxBoardAmountEdit, parseFxBoardCurrencies, readFxBoardAmount, storedFxBoardAmount,
|
|
47
|
+
withAmountCurrencies,
|
|
47
48
|
type FxBoardAmount,
|
|
48
49
|
} from "./amount";
|
|
49
50
|
|
|
@@ -293,7 +294,7 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
293
294
|
})),
|
|
294
295
|
];
|
|
295
296
|
const throughEighth = columns.slice(0, columns.length - Math.max(0, currencies.length - MOVE_FITS_BESIDE));
|
|
296
|
-
return getTableWidth(throughEighth) <= width - 1 ? columns : columns.filter((column) => column.id !== "move");
|
|
297
|
+
return getTableWidth(throughEighth) <= width - 1 ? columns : markHiddenTableColumns(columns, columns.filter((column) => column.id !== "move"));
|
|
297
298
|
}, [amount != null, amountWidth, currencies, flagged, width]);
|
|
298
299
|
|
|
299
300
|
const renderCell = useCallback((
|
|
@@ -454,9 +455,20 @@ function openFxBoard(context: PaneTemplateContext) {
|
|
|
454
455
|
* `FXC 2,500,000 EUR`, `fx 2500000 EUR/USD`, `convert 100 eur to usd`: the
|
|
455
456
|
* board open already takes the amount (one board, switched in place), with
|
|
456
457
|
* the currencies it names added when it does not list them; with none open a
|
|
457
|
-
* board opens on it.
|
|
458
|
+
* board opens on it. `FXC TRY` and `FXC USD,TRY` add those currencies to the
|
|
459
|
+
* board the same way, its amount kept. Without either the board opens as it is.
|
|
458
460
|
*/
|
|
459
461
|
function createFxBoardInstance(context: PaneTemplateContext, options?: PaneTemplateCreateOptions): PaneTemplateInstanceConfig {
|
|
462
|
+
const added = parseFxBoardCurrencies(options?.arg ?? "");
|
|
463
|
+
if (added) {
|
|
464
|
+
const open = openFxBoard(context);
|
|
465
|
+
const listed = resolveCurrencies(open?.settings?.currencies);
|
|
466
|
+
const amount = open?.settings?.amount;
|
|
467
|
+
return {
|
|
468
|
+
...(open ? { instanceId: open.instanceId } : {}),
|
|
469
|
+
settings: { ...(typeof amount === "string" && amount ? { amount } : {}), currencies: [...listed, ...added.filter((code) => !listed.includes(code))] },
|
|
470
|
+
};
|
|
471
|
+
}
|
|
460
472
|
const request = parseFxBoardAmount(options?.arg ?? "");
|
|
461
473
|
if (!request || "error" in request) return {};
|
|
462
474
|
const open = openFxBoard(context);
|
|
@@ -534,16 +546,22 @@ export const fxMatrixModule: PluginModule = {
|
|
|
534
546
|
label: "FX Cross Rates",
|
|
535
547
|
description: "Currency cross-rate matrix for major FX pairs, and an amount converted into each currency.",
|
|
536
548
|
keywords: ["fx", "forex", "currency", "exchange", "rates", "cross", "matrix", "convert", "converter", "conversion", "calculator"],
|
|
537
|
-
// `FXC 2,500,000 EUR` opens the board on the amount, as `fx 2500000 EUR/USD` converts it (fxConvertRows)
|
|
549
|
+
// `FXC 2,500,000 EUR` opens the board on the amount, as `fx 2500000 EUR/USD` converts it (fxConvertRows);
|
|
550
|
+
// `FXC TRY` and `FXC USD,TRY` add those currencies to it.
|
|
538
551
|
shortcut: {
|
|
539
552
|
prefix: "FXC",
|
|
540
553
|
argKind: "text",
|
|
541
|
-
argPlaceholder: "amount",
|
|
554
|
+
argPlaceholder: "amount or currencies",
|
|
542
555
|
argOptional: true,
|
|
543
556
|
openWithoutArg: true,
|
|
544
557
|
argError: (arg) => {
|
|
558
|
+
if (parseFxBoardCurrencies(arg)) return null;
|
|
545
559
|
const request = parseFxBoardAmount(arg);
|
|
546
|
-
|
|
560
|
+
if (!request || !("error" in request)) return null;
|
|
561
|
+
// Words with no figure were currencies to add: say which is not on the board.
|
|
562
|
+
return /\d/.test(arg)
|
|
563
|
+
? { message: `${arg.trim()} is no amount to convert`, detail: request.error.replace(/\.$/, "") }
|
|
564
|
+
: { message: `${arg.trim()} is no currency on the board`, detail: "Type codes such as USD,TRY, or an amount such as 2,500,000 EUR" };
|
|
547
565
|
},
|
|
548
566
|
},
|
|
549
567
|
createInstance: createFxBoardInstance,
|
|
@@ -117,8 +117,13 @@ export const FX_MATRIX_REPORT_OPTIONS: readonly PaneReportOptionDef[] = [{
|
|
|
117
117
|
normalize: parseCurrenciesOption,
|
|
118
118
|
}];
|
|
119
119
|
|
|
120
|
-
/**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
/**
|
|
121
|
+
* A report of the default board says it is only the majors, and how to add
|
|
122
|
+
* others: by code after FXC, as the app's command bar takes them too, or a
|
|
123
|
+
* whole list with --currencies.
|
|
124
|
+
*/
|
|
125
|
+
export function fxMatrixReportNotices(settings: Readonly<Record<string, unknown>>, currencies: readonly string[] = MAJOR_CURRENCIES): string[] {
|
|
126
|
+
if (settings.currencies != null || currencies.length !== MAJOR_CURRENCIES.length || currencies.some((code, index) => code !== MAJOR_CURRENCIES[index])) return [];
|
|
127
|
+
return [`Showing the ${MAJOR_CURRENCIES.length} majors. Add others with fn FXC TRY (FXC TRY in the app), or choose them with --currencies USD,ZAR,NGN; `
|
|
128
|
+
+ `gloom catalog FXC lists all ${FX_CURRENCIES.length}.`];
|
|
124
129
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RefObject } from "react";
|
|
2
2
|
import { Box, Text, useUiCapabilities, type ScrollBoxRenderable } from "../../../ui";
|
|
3
|
-
import { DetailScrollBody, KeyValueRow, Prose } from "../../../components";
|
|
3
|
+
import { ActionRow, DetailScrollBody, KeyValueRow, Prose } from "../../../components";
|
|
4
4
|
import { colors } from "../../../theme/colors";
|
|
5
5
|
import { wrapTextLines } from "../../../utils/text-wrap";
|
|
6
6
|
import {
|
|
@@ -10,9 +10,13 @@ import {
|
|
|
10
10
|
} from "../sec/filing-display";
|
|
11
11
|
import { isAmendedInsiderFiling } from "./amendments";
|
|
12
12
|
import type { InsiderReportingOwner } from "./insider-data";
|
|
13
|
-
import { buildInsiderDisclosureText, insiderDisplayName, isInsiderDisclosureOnly } from "./model";
|
|
13
|
+
import { OTHER_FILING_NOTES_LABEL, buildInsiderDisclosureText, insiderDisplayName, isInsiderDisclosureOnly } from "./model";
|
|
14
14
|
import type { InsiderTableRow } from "./table-model";
|
|
15
15
|
import { insiderToneColor } from "./table";
|
|
16
|
+
import { filingStorySource, type FilingStory } from "./filing-stories";
|
|
17
|
+
|
|
18
|
+
/** Heads the stories that report the transaction's filing, under its notes. */
|
|
19
|
+
const STORIES_LABEL = "Stories reporting this filing";
|
|
16
20
|
|
|
17
21
|
/** Every role an owner filed: the officer title, plus Director and 10% owner when the boxes add them. */
|
|
18
22
|
function ownerRoles(owner: InsiderReportingOwner): string {
|
|
@@ -81,8 +85,20 @@ function detailText(row: InsiderTableRow): string {
|
|
|
81
85
|
|
|
82
86
|
const FIELD_LABEL_WIDTH = 20;
|
|
83
87
|
|
|
84
|
-
/**
|
|
85
|
-
|
|
88
|
+
/** The heading over another line's notes reads muted, as the filing's own lines above the fields do. */
|
|
89
|
+
const textColor = (line: string) => (line === OTHER_FILING_NOTES_LABEL ? colors.textMuted : colors.text);
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* One Form 4 line read in full: who, the filing, every field, then remarks and
|
|
93
|
+
* footnotes, and the stories that report the filing, each opening in a pane.
|
|
94
|
+
*/
|
|
95
|
+
export function InsiderDetail({ row, width, scrollRef, stories = [], onOpenStory }: {
|
|
96
|
+
row: InsiderTableRow;
|
|
97
|
+
width: number;
|
|
98
|
+
scrollRef: RefObject<ScrollBoxRenderable | null>;
|
|
99
|
+
stories?: readonly FilingStory[];
|
|
100
|
+
onOpenStory?: (story: FilingStory) => void;
|
|
101
|
+
}) {
|
|
86
102
|
const textWidth = Math.max(width - 2, 12);
|
|
87
103
|
const fields = detailFields(row);
|
|
88
104
|
const text = detailText(row);
|
|
@@ -114,13 +130,26 @@ export function InsiderDetail({ row, width, scrollRef }: { row: InsiderTableRow;
|
|
|
114
130
|
{text && <Box height={1} />}
|
|
115
131
|
{nativePaneChrome
|
|
116
132
|
? text.split("\n").map((line, index) => (line.trim()
|
|
117
|
-
? <Prose key={`text-${index}`} text={line} width={textWidth} color={
|
|
133
|
+
? <Prose key={`text-${index}`} text={line} width={textWidth} color={textColor(line)} figures={false} />
|
|
118
134
|
: <Text key={`text-${index}`}>{" "}</Text>))
|
|
119
|
-
: text.split("\n").flatMap((line) => wrapTextLines(line, textWidth)).map((
|
|
135
|
+
: text.split("\n").flatMap((line) => wrapTextLines(line, textWidth).map((wrapped) => ({ wrapped, color: textColor(line) }))).map(({ wrapped, color }, index) => (
|
|
120
136
|
<Box key={`text-${index}`} height={1}>
|
|
121
|
-
<Text fg={
|
|
137
|
+
<Text fg={color}>{wrapped}</Text>
|
|
122
138
|
</Box>
|
|
123
139
|
))}
|
|
140
|
+
{stories.length > 0 && (
|
|
141
|
+
<>
|
|
142
|
+
<Box height={1} />
|
|
143
|
+
<Box height={nativePaneChrome ? undefined : 1}>
|
|
144
|
+
<Text fg={colors.textMuted}>{STORIES_LABEL}</Text>
|
|
145
|
+
</Box>
|
|
146
|
+
{stories.map((story) => (
|
|
147
|
+
<ActionRow key={story.id} label={story.headline} onPress={() => onOpenStory?.(story)}>
|
|
148
|
+
<Text fg={colors.textDim}>{filingStorySource(story)}</Text>
|
|
149
|
+
</ActionRow>
|
|
150
|
+
))}
|
|
151
|
+
</>
|
|
152
|
+
)}
|
|
124
153
|
</Box>
|
|
125
154
|
</DetailScrollBody>
|
|
126
155
|
);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { apiClient } from "../../../api-client";
|
|
3
|
+
import type { CloudInsiderFilingStoriesResponse } from "../../../api-client";
|
|
4
|
+
import { shortStoryId } from "../../../news/story-id";
|
|
5
|
+
import { formatShortDate } from "../../../utils/datetime-format";
|
|
6
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
7
|
+
import { createTtlCache } from "../../../data/ttl-cache";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* The stories that report a Form 4, as Gloom Cloud matches them: the filing's
|
|
11
|
+
* owner named in a story about its company's insiders trading, in the months
|
|
12
|
+
* after its trades, the filing among the ones the story's own page lists. What
|
|
13
|
+
* an INS or SEC row names to go from the filing to the news and back.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export interface FilingStory {
|
|
17
|
+
id: string;
|
|
18
|
+
headline: string;
|
|
19
|
+
/** When the story was first published, ISO. */
|
|
20
|
+
publishedAt: string;
|
|
21
|
+
publisher: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type StoriesClient = Pick<typeof apiClient, "getCloudInsiderFilingStories">;
|
|
25
|
+
|
|
26
|
+
const ACCESSION = /^\d{10}-\d{2}-\d{6}$/;
|
|
27
|
+
/** As many filings as Gloom Cloud reads in one request; a longer list is asked in several. */
|
|
28
|
+
const BATCH = 20;
|
|
29
|
+
/** A filing's stories, by accession, for a few minutes: an INS or SEC pane asks again as its rows redraw. */
|
|
30
|
+
const cache = createTtlCache<FilingStory[]>({ ttlMs: 5 * 60_000, maxEntries: 500 });
|
|
31
|
+
|
|
32
|
+
function storiesOf(item: CloudInsiderFilingStoriesResponse["items"][number]): FilingStory[] {
|
|
33
|
+
return (item.stories ?? []).flatMap((story) => (
|
|
34
|
+
story?.id && story.headline
|
|
35
|
+
? [{ id: story.id, headline: story.headline, publishedAt: story.firstPublishedAt, publisher: story.primaryPublisher ?? "" }]
|
|
36
|
+
: []
|
|
37
|
+
));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The stories reporting each filing, by accession number, from a short-lived
|
|
42
|
+
* cache where it has them. A filing Gloom Cloud could not be asked about is
|
|
43
|
+
* left out of the map: no stories said is not "none". A batch that fails (a
|
|
44
|
+
* server without the lookup, a session it refuses, a rate or capacity limit)
|
|
45
|
+
* ends the asking without an error: the batches answered before it are kept,
|
|
46
|
+
* and the rows that would have named stories name none.
|
|
47
|
+
*/
|
|
48
|
+
export async function loadFilingStories(
|
|
49
|
+
accessions: readonly string[],
|
|
50
|
+
client: StoriesClient = apiClient,
|
|
51
|
+
): Promise<Map<string, FilingStory[]>> {
|
|
52
|
+
const result = new Map<string, FilingStory[]>();
|
|
53
|
+
const wanted: string[] = [];
|
|
54
|
+
// Asked in batches, one request for a page of rows, so each accession is kept as its answer arrives.
|
|
55
|
+
for (const accession of new Set(accessions)) {
|
|
56
|
+
if (!ACCESSION.test(accession)) continue;
|
|
57
|
+
const hit = cache.peek(accession);
|
|
58
|
+
if (hit) result.set(accession, hit);
|
|
59
|
+
else wanted.push(accession);
|
|
60
|
+
}
|
|
61
|
+
for (let start = 0; start < wanted.length; start += BATCH) {
|
|
62
|
+
const batch = wanted.slice(start, start + BATCH);
|
|
63
|
+
let response: CloudInsiderFilingStoriesResponse;
|
|
64
|
+
try {
|
|
65
|
+
response = await client.getCloudInsiderFilingStories(batch);
|
|
66
|
+
} catch (error) {
|
|
67
|
+
// The next batch would meet the same refusal: stop, keeping what was answered.
|
|
68
|
+
logFailure("insider.filing-stories", "Read the stories reporting filings failed")(error);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
for (const item of response.items ?? []) {
|
|
72
|
+
if (!batch.includes(item.accession)) continue;
|
|
73
|
+
const stories = storiesOf(item);
|
|
74
|
+
cache.set(item.accession, stories);
|
|
75
|
+
result.set(item.accession, stories);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The stories reporting one filing, read once it is open; none while they load or when they cannot be read. */
|
|
82
|
+
export function useFilingStories(accession: string | null | undefined): FilingStory[] {
|
|
83
|
+
const [state, setState] = useState<{ accession: string; stories: FilingStory[] } | null>(null);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!accession || !ACCESSION.test(accession)) return;
|
|
86
|
+
let active = true;
|
|
87
|
+
void loadFilingStories([accession])
|
|
88
|
+
.then((found) => {
|
|
89
|
+
if (active) setState({ accession, stories: found.get(accession) ?? [] });
|
|
90
|
+
})
|
|
91
|
+
.catch(logFailure("insider.filing-stories", "Read the stories reporting a filing failed"));
|
|
92
|
+
return () => { active = false; };
|
|
93
|
+
}, [accession]);
|
|
94
|
+
return state && state.accession === accession ? state.stories : [];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** `7 Oct 2026 · Quartz`: when and where a story was first published. */
|
|
98
|
+
export function filingStorySource(story: FilingStory): string {
|
|
99
|
+
const day = story.publishedAt ? formatShortDate(story.publishedAt, { utc: true, fallback: "" }) : "";
|
|
100
|
+
return [day, story.publisher].filter(Boolean).join(" · ");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* A story as a report's note names it, with the id `fn story` opens it by:
|
|
105
|
+
* `Story 3224efb6 (7 Oct 2026 · Quartz): Q3 2026 insider stock sales: ...`.
|
|
106
|
+
*/
|
|
107
|
+
export function filingStoryNote(story: FilingStory): string {
|
|
108
|
+
const source = filingStorySource(story);
|
|
109
|
+
return `Story ${shortStoryId(story.id)}${source ? ` (${source})` : ""}: ${story.headline}`;
|
|
110
|
+
}
|
|
@@ -63,6 +63,8 @@ import { REPORT_ROWS } from "../shared/headless-options";
|
|
|
63
63
|
import { mapWithConcurrency } from "../../../utils/concurrency";
|
|
64
64
|
import { describeCollections, findNamedCollection, readWatchlistArgument, watchlistMemberSymbol } from "../../../portfolio/collection-name";
|
|
65
65
|
import type { FxHistoryClient } from "../../../market-data/fx-closes";
|
|
66
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
67
|
+
import { filingStoryNote, loadFilingStories, type FilingStory } from "./filing-stories";
|
|
66
68
|
|
|
67
69
|
const INSIDER_COLUMNS: HeadlessPaneColumn[] = [
|
|
68
70
|
{ key: "form", header: "Form" },
|
|
@@ -319,7 +321,7 @@ function signalQuery(options: HeadlessPaneLoadArgs["options"]): InsiderSignalsQu
|
|
|
319
321
|
/** What a Form 4/A says about itself, for its last row in the report. */
|
|
320
322
|
function amendmentNote(entry: ParsedInsiderFiling): string {
|
|
321
323
|
const original = entry.disclosure?.originalFilingDate;
|
|
322
|
-
return [original ? `Original filed ${original}` : "", ...buildInsiderDisclosureText(entry).split("\n")].filter(Boolean).join("\n");
|
|
324
|
+
return [original ? `Original filed ${original}` : "", ...buildInsiderDisclosureText(entry, { byLine: false }).split("\n")].filter(Boolean).join("\n");
|
|
323
325
|
}
|
|
324
326
|
|
|
325
327
|
export interface InsiderHeadlessDependencies {
|
|
@@ -333,6 +335,8 @@ export interface InsiderHeadlessDependencies {
|
|
|
333
335
|
args: HeadlessPaneLoadArgs,
|
|
334
336
|
ctx: HeadlessPaneContext,
|
|
335
337
|
): Promise<InsiderFilingsLoad>;
|
|
338
|
+
/** The stories reporting each filing, by accession number (Gloom Cloud's match); the report's API client unless a test stands in. */
|
|
339
|
+
loadFilingStories?(accessions: readonly string[], ctx: HeadlessPaneContext): Promise<Map<string, FilingStory[]>>;
|
|
336
340
|
}
|
|
337
341
|
|
|
338
342
|
const defaultDependencies: InsiderHeadlessDependencies = {
|
|
@@ -351,8 +355,38 @@ const defaultDependencies: InsiderHeadlessDependencies = {
|
|
|
351
355
|
limit,
|
|
352
356
|
signal: ctx.signal,
|
|
353
357
|
}),
|
|
358
|
+
loadFilingStories: (accessions, ctx) => loadFilingStories(accessions, ctx.apiClient),
|
|
354
359
|
};
|
|
355
360
|
|
|
361
|
+
/**
|
|
362
|
+
* Each filing's rows with the stories that report it (`stories`, on every row
|
|
363
|
+
* of the filing), and their notes under the filing's last row after any
|
|
364
|
+
* amendment's: back from the Form 4 to the news, `fn story <id>` opening one.
|
|
365
|
+
* A filing Gloom Cloud could not be asked about keeps its rows as they were,
|
|
366
|
+
* and the report says nothing of it: the stories are a lead, not its data.
|
|
367
|
+
*/
|
|
368
|
+
async function withFilingStories(
|
|
369
|
+
rows: HeadlessPaneRow[],
|
|
370
|
+
ctx: HeadlessPaneContext,
|
|
371
|
+
dependencies: InsiderHeadlessDependencies,
|
|
372
|
+
): Promise<HeadlessPaneRow[]> {
|
|
373
|
+
const accessions = [...new Set(rows.map((row) => row.accessionNumber).filter((value): value is string => typeof value === "string"))];
|
|
374
|
+
const load = dependencies.loadFilingStories;
|
|
375
|
+
if (!load || accessions.length === 0) return rows;
|
|
376
|
+
const found = await load(accessions, ctx).catch(logFailure("insider.headless", "Read the stories reporting filings failed", new Map<string, FilingStory[]>()));
|
|
377
|
+
return rows.map((row, index) => {
|
|
378
|
+
const stories = typeof row.accessionNumber === "string" ? found.get(row.accessionNumber) : undefined;
|
|
379
|
+
if (!stories) return row;
|
|
380
|
+
const last = rows[index + 1]?.accessionNumber !== row.accessionNumber;
|
|
381
|
+
const notes = last ? [typeof row.note === "string" ? row.note : "", ...stories.map(filingStoryNote)].filter(Boolean) : [];
|
|
382
|
+
return {
|
|
383
|
+
...row,
|
|
384
|
+
stories: stories.map((story) => ({ ...story })),
|
|
385
|
+
...(last && notes.length ? { note: notes.join("\n") } : {}),
|
|
386
|
+
};
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
|
|
356
390
|
/**
|
|
357
391
|
* "CAR Group (ASX) files no SEC reports." for a listing abroad the SEC lists
|
|
358
392
|
* nothing for, as `filings` says it; null for a US listing or a symbol with no
|
|
@@ -417,11 +451,12 @@ async function readTickerTrades(
|
|
|
417
451
|
.filter((row) => row.status !== "parsed" && row.status !== "disclosure")
|
|
418
452
|
.map((row) => row.accessionNumber))];
|
|
419
453
|
// A filing's lines sit together, so its note goes once, under the last of them.
|
|
420
|
-
const
|
|
454
|
+
const built: HeadlessPaneRow[] = buildInsiderRows(filtered, parsed).map((row, index) => {
|
|
421
455
|
const entry = filtered[index]!;
|
|
422
456
|
const last = filtered[index + 1]?.filing.accessionNumber !== entry.filing.accessionNumber;
|
|
423
457
|
return isAmendedInsiderFiling(entry) && last ? { ...row, note: amendmentNote(entry) || null } : row;
|
|
424
458
|
});
|
|
459
|
+
const rows = await withFilingStories(built, ctx, dependencies);
|
|
425
460
|
return {
|
|
426
461
|
rows,
|
|
427
462
|
empty,
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import { instrumentFromTicker } from "../../../market-data/request-types";
|
|
15
15
|
import { Box, useUiCapabilities, type ScrollBoxRenderable } from "../../../ui";
|
|
16
16
|
import {
|
|
17
|
+
ChoiceDialog,
|
|
17
18
|
DataTableStackView,
|
|
18
19
|
EmptyState,
|
|
19
20
|
PaneLinkMenu,
|
|
@@ -29,7 +30,7 @@ import {
|
|
|
29
30
|
type StackSortPreference,
|
|
30
31
|
type StatItem,
|
|
31
32
|
} from "../../../components";
|
|
32
|
-
import { useDebouncedPluginPaneState, usePluginPaneState } from "../../runtime";
|
|
33
|
+
import { useDebouncedPluginPaneState, usePluginAppActions, usePluginPaneState } from "../../runtime";
|
|
33
34
|
import { homeInsiderReportsNote, mayBeSecEquityListing, mayBeUsEquityTicker, noSecReportsNotice, nonUsSecListingVenue } from "../../../utils/sec";
|
|
34
35
|
import { parsePublicTickerKey } from "../../../utils/exchanges";
|
|
35
36
|
import { formatCompact } from "../../../utils/format";
|
|
@@ -71,6 +72,9 @@ import {
|
|
|
71
72
|
} from "./table-model";
|
|
72
73
|
import { renderInsiderCell } from "./table";
|
|
73
74
|
import { InsiderDetail, insiderDetailTitle } from "./detail";
|
|
75
|
+
import { useFilingStories, type FilingStory } from "./filing-stories";
|
|
76
|
+
import { useOptionalDialog, type PromptContext } from "../../../ui/dialog";
|
|
77
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
74
78
|
import { InsiderActivityView, type InsiderViewControl } from "./insiders";
|
|
75
79
|
import { InsiderSignalsView, type InsiderOpenedCompany } from "./signals";
|
|
76
80
|
import { InsiderTickersView } from "./tickers";
|
|
@@ -114,17 +118,27 @@ const TYPE_FILTER_LABELS: Record<InsiderTypeFilter, string> = {
|
|
|
114
118
|
other: "Other",
|
|
115
119
|
};
|
|
116
120
|
|
|
121
|
+
/** `21 Aug`, with the year when it is not this one's. */
|
|
122
|
+
function windowDay(day: string, now = Date.now()): string {
|
|
123
|
+
const sameYear = day.slice(0, 4) === new Date(now).toISOString().slice(0, 4);
|
|
124
|
+
return formatShortDate(`${day}T00:00:00Z`, { utc: true, year: sameYear ? false : "numeric" });
|
|
125
|
+
}
|
|
126
|
+
|
|
117
127
|
/**
|
|
118
128
|
* The 90-day buy and sale totals as figures: one cell per side, and per
|
|
119
|
-
* security when there are several.
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* the
|
|
129
|
+
* security when there are several. The last cell says once, for the band,
|
|
130
|
+
* what they count: trades dated since the window's first day (by trade date,
|
|
131
|
+
* not filing date) in the filings loaded, which a narrow pane gives up before
|
|
132
|
+
* the figures, the 90 days staying in the labels. A side with no trades shows
|
|
133
|
+
* 0 shares, muted. Buys read in the gain colour and sales in the loss colour,
|
|
134
|
+
* as in the table; when the Type filter hides open-market trades the figures
|
|
135
|
+
* dim and say so. With `currency` the dollars read with its code (1.2M USD),
|
|
136
|
+
* as the table's CCY column names them.
|
|
124
137
|
*/
|
|
125
138
|
function summaryItems(figures: InsiderSummaryFigures, typeFilter: InsiderTypeFilter, currency?: string): StatItem[] {
|
|
126
139
|
const securities = new Set(figures.totals.map((total) => total.security));
|
|
127
140
|
const hidden = typeFilter === "other";
|
|
141
|
+
const since = windowDay(figures.window.from);
|
|
128
142
|
const items: StatItem[] = [];
|
|
129
143
|
for (const side of ["P", "S"] as const) {
|
|
130
144
|
const label = side === "P" ? "90d buys" : "90d sales";
|
|
@@ -145,6 +159,16 @@ function summaryItems(figures: InsiderSummaryFigures, typeFilter: InsiderTypeFil
|
|
|
145
159
|
});
|
|
146
160
|
}
|
|
147
161
|
}
|
|
162
|
+
// Once, after the last figure: the trade dates counted, and that they are the loaded filings' trades.
|
|
163
|
+
const last = items.at(-1);
|
|
164
|
+
if (last) {
|
|
165
|
+
const detail = last.detail ?? "";
|
|
166
|
+
const window = `trades since ${since}`;
|
|
167
|
+
const coverage = `${window}, ${figures.filings} ${figures.filings === 1 ? "filing" : "filings"} loaded`;
|
|
168
|
+
const join = (...parts: string[]) => parts.filter(Boolean).join(" \u00b7 ");
|
|
169
|
+
// Narrower, the window keeps its first day longest: what "90d" is from.
|
|
170
|
+
items[items.length - 1] = { ...last, detail: join(detail, coverage), detailVariants: [join(detail, window), join(detail, `since ${since}`), detail] };
|
|
171
|
+
}
|
|
148
172
|
return items;
|
|
149
173
|
}
|
|
150
174
|
|
|
@@ -183,7 +207,8 @@ const freshTradesState = (tickerKey: string, insider: string | null = null): Sta
|
|
|
183
207
|
*/
|
|
184
208
|
function useInsiderTradesState(tickerKey: string, stacked: boolean, insider: string | null = null): InsiderTradesState {
|
|
185
209
|
const [paneSelectedId, setPaneSelectedId] = usePluginPaneState<string | null>(`insider:selectedId:${tickerKey}`, null);
|
|
186
|
-
|
|
210
|
+
// A pane opened on an insider (a story's filings) starts filtered to them, as one opened from the ranking does.
|
|
211
|
+
const [paneNameFilter, setPaneNameFilter] = usePluginPaneState<string | null>(`insider:nameFilter:${tickerKey}`, insider);
|
|
187
212
|
const [paneTypeFilter, setPaneTypeFilter] = usePluginPaneState<InsiderTypeFilter>("insider:typeFilter", DEFAULT_INSIDER_TYPE_FILTER);
|
|
188
213
|
const [paneOpenItemId, setPaneOpenItemIdState] = useDebouncedPluginPaneState<string | null>(`insider:openItemId:${tickerKey}`, null);
|
|
189
214
|
const setPaneOpenItemId = useCallback(
|
|
@@ -425,6 +450,34 @@ function InsiderTradesView({ ticker, viewBar, state, width, height, focused, sta
|
|
|
425
450
|
};
|
|
426
451
|
const handleFilterPress = useCallback(() => filterActionRef.current(), []);
|
|
427
452
|
|
|
453
|
+
// The stories that report the open transaction's filing: back from the Form 4 to the news about it.
|
|
454
|
+
const openStories = useFilingStories(openRow && !openRow.entry.isLoading ? openRow.entry.filing.accessionNumber : null);
|
|
455
|
+
const { createPaneFromTemplate } = usePluginAppActions();
|
|
456
|
+
const dialog = useOptionalDialog();
|
|
457
|
+
const openStory = useCallback((story: FilingStory) => {
|
|
458
|
+
createPaneFromTemplate("news-story-pane", { arg: story.id, values: { title: story.headline } });
|
|
459
|
+
}, [createPaneFromTemplate]);
|
|
460
|
+
const chooseStory = useCallback(() => {
|
|
461
|
+
if (openStories.length === 1) {
|
|
462
|
+
openStory(openStories[0]!);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
if (!dialog || openStories.length === 0) return;
|
|
466
|
+
void dialog.prompt<string>({
|
|
467
|
+
closeOnClickOutside: true,
|
|
468
|
+
content: (ctx: PromptContext<string>) => (
|
|
469
|
+
<ChoiceDialog
|
|
470
|
+
{...ctx}
|
|
471
|
+
title="Stories"
|
|
472
|
+
choices={openStories.map((story, index) => ({ id: String(index), label: story.headline, detail: story.publisher }))}
|
|
473
|
+
/>
|
|
474
|
+
),
|
|
475
|
+
}).then((choice) => {
|
|
476
|
+
const story = choice ? openStories[Number(choice)] : undefined;
|
|
477
|
+
if (story) openStory(story);
|
|
478
|
+
}).catch(logFailure("insider.detail", "Choose a story reporting the filing failed"));
|
|
479
|
+
}, [dialog, openStories, openStory]);
|
|
480
|
+
|
|
428
481
|
// Reading on: the next or previous row opens in place, and the cursor
|
|
429
482
|
// follows it so Back lands on the last one read.
|
|
430
483
|
const openIndex = openRow ? sortedRows.findIndex((row) => row.id === openRow.id) : -1;
|
|
@@ -440,8 +493,9 @@ function InsiderTradesView({ ticker, viewBar, state, width, height, focused, sta
|
|
|
440
493
|
hints: [
|
|
441
494
|
{ id: "insider-next", key: "n", label: "ext", title: "Next Transaction", disabled: openIndex >= sortedRows.length - 1, onPress: () => openAdjacent(1) },
|
|
442
495
|
{ id: "insider-previous", key: "p", label: "rev", title: "Previous Transaction", disabled: openIndex <= 0, onPress: () => openAdjacent(-1) },
|
|
496
|
+
...(openStories.length > 0 ? [{ id: "insider-story", key: "s", label: "tory", title: "Open Story", onPress: chooseStory }] : []),
|
|
443
497
|
],
|
|
444
|
-
} : null), [focused, openAdjacent, openIndex, sortedRows.length]);
|
|
498
|
+
} : null), [chooseStory, focused, openAdjacent, openIndex, openStories.length, sortedRows.length]);
|
|
445
499
|
|
|
446
500
|
const pendingLabel = pendingCount > 0 ? `loading ${pendingCount}...` : "";
|
|
447
501
|
const footerInfo = useMemo(() => [
|
|
@@ -519,7 +573,9 @@ function InsiderTradesView({ ticker, viewBar, state, width, height, focused, sta
|
|
|
519
573
|
onBack={() => setOpenItemId(null)}
|
|
520
574
|
detailTitle={openRow ? insiderDetailTitle(openRow) : undefined}
|
|
521
575
|
detailScrollRef={detailScrollRef}
|
|
522
|
-
detailContent={openRow
|
|
576
|
+
detailContent={openRow
|
|
577
|
+
? <PaneLinkMenu><InsiderDetail row={openRow} width={width} scrollRef={detailScrollRef} stories={openStories} onOpenStory={openStory} /></PaneLinkMenu>
|
|
578
|
+
: <Box flexGrow={1} />}
|
|
523
579
|
selection={{
|
|
524
580
|
kind: "index",
|
|
525
581
|
selectedIndex: sortedRows.length > 0 ? selectedRowIndex : null,
|
|
@@ -720,9 +776,16 @@ function insiderPaneSymbols(settings: Record<string, unknown> | undefined): stri
|
|
|
720
776
|
* selling. A ranked company opens here as INS on its ticker, and Back
|
|
721
777
|
* returns to the ranking.
|
|
722
778
|
*/
|
|
779
|
+
/** The insider a pane was opened on (`settings.insider`, as filed), whose trades it starts filtered to. */
|
|
780
|
+
function insiderPaneInsider(settings: Record<string, unknown> | undefined): string | undefined {
|
|
781
|
+
const insider = settings?.insider;
|
|
782
|
+
return typeof insider === "string" && insider.trim() ? insider.trim() : undefined;
|
|
783
|
+
}
|
|
784
|
+
|
|
723
785
|
function InsiderPane({ width, height, focused }: PaneProps) {
|
|
724
786
|
const { symbol: paneSymbol } = usePaneTickerIdentity();
|
|
725
787
|
const instance = usePaneInstance();
|
|
788
|
+
const openedInsider = insiderPaneInsider(instance?.settings);
|
|
726
789
|
// One list per set of tickers, so the views' loads do not start again on every render.
|
|
727
790
|
const symbolsKey = insiderPaneSymbols(instance?.settings).join(",");
|
|
728
791
|
const symbols = useMemo(() => (symbolsKey ? symbolsKey.split(",") : []), [symbolsKey]);
|
|
@@ -737,7 +800,7 @@ function InsiderPane({ width, height, focused }: PaneProps) {
|
|
|
737
800
|
if (!paneSymbol && instance?.binding?.kind !== "follow") {
|
|
738
801
|
return <InsiderSignalsView width={width} height={height} focused={focused} renderCompany={renderRankedCompany} />;
|
|
739
802
|
}
|
|
740
|
-
return <InsiderView width={width} height={height} focused={focused} />;
|
|
803
|
+
return <InsiderView width={width} height={height} focused={focused} {...(openedInsider ? { insider: openedInsider } : {})} />;
|
|
741
804
|
}
|
|
742
805
|
|
|
743
806
|
const tickerTemplate = createTickerSurfacePaneTemplate({
|
|
@@ -750,6 +813,12 @@ const tickerTemplate = createTickerSurfacePaneTemplate({
|
|
|
750
813
|
canCreate: (_context, options) => !options?.ticker || mayBeSecEquityListing(options.ticker),
|
|
751
814
|
// Typed alone with no active ticker it ranks the market's insider buying or selling.
|
|
752
815
|
withoutTickerTitle: INSIDER_SIGNALS_TITLE,
|
|
816
|
+
// Opened on one insider (a story's filings, `values.insider` as filed): a window of its own, filtered to them.
|
|
817
|
+
settings: (_symbol, _context, options) => {
|
|
818
|
+
const insider = options?.values?.insider?.trim();
|
|
819
|
+
return insider ? { insider } : undefined;
|
|
820
|
+
},
|
|
821
|
+
viewKey: (_symbol, _context, options) => options?.values?.insider?.trim() || undefined,
|
|
753
822
|
});
|
|
754
823
|
|
|
755
824
|
/**
|