@gloom-sh/terminal 0.20.3 → 0.20.5
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 +2 -0
- package/bin/gloom +9 -0
- package/bin/without-bun.cjs +98 -0
- package/package.json +3 -1
- package/src/account/auth-dialog.tsx +17 -0
- package/src/api-client/data.ts +144 -35
- package/src/api-client/fx-interventions.ts +64 -0
- package/src/api-client/index.ts +1 -0
- package/src/api-client/release-summaries.ts +21 -0
- package/src/api-client/types/econ.ts +12 -0
- package/src/api-client/yield-curves.ts +1 -1
- package/src/app/global-shortcuts.ts +4 -1
- package/src/app/keybindings/actions.ts +8 -2
- package/src/app/keybindings/config.ts +2 -1
- package/src/app/keybindings/index.ts +1 -0
- package/src/app/keybindings/labels.ts +6 -1
- package/src/app/keybindings/resolve.ts +23 -4
- package/src/app/keybindings/terminal-keys.ts +35 -0
- package/src/app/pane-runtime/index.tsx +2 -2
- package/src/app/pane-runtime/ticker-open-runtime.ts +274 -67
- package/src/architecture/ui-literals-allowlist.json +1 -1
- package/src/capabilities/chart-series.ts +27 -1
- package/src/cli/commands/keybindings.ts +5 -5
- package/src/cli/commands/market.ts +154 -21
- package/src/cli/commands/news-search.ts +60 -10
- package/src/cli/commands/overview.ts +16 -1
- package/src/cli/commands/plugins.ts +27 -5
- package/src/cli/commands/remote.ts +16 -17
- package/src/cli/commands/system.ts +20 -4
- package/src/cli/commands/ticker.ts +60 -19
- package/src/cli/fx-forward.ts +25 -7
- package/src/cli/glossary.ts +19 -5
- package/src/cli/history-rows.ts +5 -3
- package/src/cli/index.ts +8 -8
- package/src/cli/known-gaps.ts +27 -1
- package/src/cli/listing-arg.ts +11 -1
- package/src/cli/name-entries.ts +5 -1
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/function-help.ts +5 -5
- package/src/cli/report-tables.ts +18 -6
- package/src/cli/result.ts +15 -7
- package/src/cli/types.ts +2 -0
- package/src/components/chart/composite/axis-overlays.tsx +22 -0
- package/src/components/chart/composite/composite-chart.tsx +54 -13
- package/src/components/chart/composite/event-captions.ts +109 -0
- package/src/components/chart/composite/event-guides.ts +74 -0
- package/src/components/chart/composite/rasterizer.ts +2 -0
- package/src/components/chart/composite/text-renderer.ts +2 -0
- package/src/components/chart/composite/types.ts +31 -0
- package/src/components/command-bar/layout-items/focused-pane.ts +5 -5
- package/src/components/command-bar/pane-settings.ts +2 -2
- package/src/components/command-bar/routes/root/provider-search.ts +5 -4
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/routes/ticker-search/results.ts +51 -0
- package/src/components/command-bar/routes/ticker-search/route.ts +3 -2
- package/src/components/input-search-bar.tsx +9 -2
- package/src/components/layout/detached-pane-shell.tsx +1 -1
- package/src/components/layout/floating-pane.tsx +5 -1
- package/src/components/layout/pane/footer/index.tsx +21 -14
- package/src/components/layout/pane/footer/model.ts +6 -0
- package/src/components/layout/pane/header.tsx +2 -0
- package/src/components/layout/shell/action-menu-overlay.tsx +10 -5
- package/src/components/layout/shell/active-drag.ts +149 -105
- package/src/components/layout/shell/drag/drop-zones.ts +162 -0
- package/src/components/layout/shell/drag/index.ts +47 -218
- package/src/components/layout/shell/drag/live.ts +10 -3
- package/src/components/layout/shell/drag/overlays.tsx +182 -5
- package/src/components/layout/shell/drag/runtime.ts +29 -6
- package/src/components/layout/shell/drag/shared-edges.ts +156 -0
- package/src/components/layout/shell/index.tsx +11 -6
- package/src/components/layout/shell/menu.ts +11 -2
- package/src/components/layout/shell/native/pointer-runtime.ts +25 -0
- package/src/components/layout/shell/native/window-state.ts +2 -2
- package/src/components/layout/shell/pane/capture.ts +4 -1
- package/src/components/layout/shell/pane/layers.tsx +71 -7
- package/src/components/layout/shell/terminal-pointer-runtime.ts +18 -9
- package/src/components/layout/shell/window-mode/index.ts +8 -10
- package/src/components/layout/status-bar.tsx +6 -1
- package/src/components/layout/window-edit/mode.ts +39 -7
- package/src/components/layout/window-edit/presentation.ts +1 -1
- package/src/components/onboarding/first-run-workspace.ts +44 -2
- package/src/components/onboarding/onboarding-frame.tsx +11 -2
- package/src/components/onboarding/onboarding-keyboard.ts +20 -0
- package/src/components/onboarding/onboarding-wizard.tsx +16 -11
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
- package/src/components/onboarding/use-onboarding-progress.ts +12 -4
- package/src/components/pane-settings-dialog/desktop.tsx +2 -2
- package/src/components/pane-settings-dialog/tui.tsx +2 -2
- package/src/components/pane-settings-dialog/value.ts +6 -0
- package/src/components/pane-settings-dialog.tsx +3 -3
- package/src/components/reader/detail-reader.tsx +4 -0
- package/src/components/ui/button.tsx +2 -0
- package/src/components/ui/choice-dialog.tsx +1 -0
- package/src/components/ui/data-table/index.tsx +4 -3
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/list-view.tsx +7 -12
- package/src/components/ui/loading.tsx +10 -3
- package/src/components/ui/menu.tsx +6 -2
- package/src/components/ui/page-stack-view.tsx +3 -0
- package/src/components/ui/pane-link-chip.tsx +269 -54
- package/src/components/ui/query-bar.tsx +2 -1
- package/src/components/ui/quote.ts +14 -1
- package/src/components/ui/tabs.tsx +97 -19
- package/src/core/state/app/layout-reducer.ts +7 -0
- package/src/core/state/app/layout.ts +44 -7
- package/src/core/state/app/state.ts +1 -1
- package/src/core/state/app/types.ts +22 -2
- package/src/data/config/layout.ts +5 -2
- package/src/docs/snapshot.json +54 -13
- package/src/i18n/es.ts +9 -8
- package/src/i18n/ja.ts +9 -8
- package/src/i18n/ko.ts +9 -8
- package/src/i18n/zh-cn.ts +9 -8
- package/src/i18n/zh-tw.ts +9 -8
- package/src/layout/pane-manager/floating-actions.ts +17 -0
- package/src/layout/pane-manager/floating-stack.ts +187 -0
- package/src/layout/pane-manager/floating.ts +4 -2
- package/src/layout/pane-manager/gridlock.ts +5 -1
- package/src/layout/pane-manager/index.ts +11 -0
- package/src/layout/pane-manager/layout-state.ts +10 -3
- package/src/market-data/depositary-pair.ts +5 -3
- package/src/market-data/futures-board.ts +46 -1
- package/src/market-data/futures-contract.ts +12 -3
- package/src/market-data/fx-interventions.ts +270 -0
- package/src/market-data/market/dated-previous-close.ts +94 -15
- package/src/market-data/market/status.ts +17 -1
- package/src/news/news-model.ts +44 -2
- package/src/plugins/builtin/alerts/cli.ts +4 -4
- package/src/plugins/builtin/alerts/format.ts +1 -2
- package/src/plugins/builtin/alerts/headless.ts +1 -2
- package/src/plugins/builtin/alerts/move-checks.ts +12 -6
- package/src/plugins/builtin/alerts/move.ts +30 -9
- package/src/plugins/builtin/alerts/pane.tsx +0 -2
- package/src/plugins/builtin/alerts/storage.ts +4 -2
- package/src/plugins/builtin/alerts/types.ts +12 -0
- package/src/plugins/builtin/analytics/risk-client.ts +10 -4
- package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
- package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
- package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
- package/src/plugins/builtin/awards/index.tsx +1 -1
- package/src/plugins/builtin/buildout/index.tsx +1 -0
- package/src/plugins/builtin/catalysts/index.tsx +2 -2
- package/src/plugins/builtin/cds/headless.ts +4 -0
- package/src/plugins/builtin/changelog/index.tsx +292 -101
- package/src/plugins/builtin/changelog/versions.ts +293 -0
- package/src/plugins/builtin/chart-composer/headless.ts +2 -1
- package/src/plugins/builtin/chart-composer/index.tsx +1 -0
- package/src/plugins/builtin/chart-composer/intervention-events.ts +105 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +21 -7
- package/src/plugins/builtin/chat/content/composer.tsx +5 -4
- package/src/plugins/builtin/chat/content/index.tsx +12 -2
- package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
- package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
- package/src/plugins/builtin/chat/layout.ts +5 -2
- package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
- package/src/plugins/builtin/chat/message/render-state.ts +2 -5
- package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
- package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
- package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
- package/src/plugins/builtin/cloud/askg/attached-pane.tsx +10 -5
- package/src/plugins/builtin/cloud/askg/controller.ts +141 -5
- package/src/plugins/builtin/cloud/askg/executor.ts +113 -4
- package/src/plugins/builtin/cloud/askg/manifest.ts +28 -13
- package/src/plugins/builtin/cloud/askg/model.ts +14 -4
- package/src/plugins/builtin/cloud/askg/pane.tsx +70 -46
- package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
- package/src/plugins/builtin/cloud/askg/turn-parts.tsx +70 -0
- package/src/plugins/builtin/cloud/terminal-relay/engine.ts +50 -130
- package/src/plugins/builtin/cloud/terminal-relay/policy.ts +327 -7
- package/src/plugins/builtin/cloud/terminal-relay/prompts.tsx +2 -1
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +52 -9
- package/src/plugins/builtin/commodities-energy/index.tsx +1 -3
- package/src/plugins/builtin/commodities-energy/view-state.ts +3 -0
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
- package/src/plugins/builtin/company-attention/index.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +3 -1
- package/src/plugins/builtin/company-kpis/index.tsx +2 -2
- package/src/plugins/builtin/cot/headless.ts +14 -2
- package/src/plugins/builtin/cot/index.tsx +1 -1
- package/src/plugins/builtin/cpi/index.tsx +1 -1
- package/src/plugins/builtin/crypto-board/index.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
- package/src/plugins/builtin/doe/index.tsx +1 -1
- package/src/plugins/builtin/earnings/index.tsx +2 -2
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/econ/calendar-model.ts +74 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
- package/src/plugins/builtin/econ/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
- package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
- package/src/plugins/builtin/executives/index.tsx +1 -0
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/fixed-income/index.tsx +1 -0
- package/src/plugins/builtin/futures/index.tsx +25 -4
- package/src/plugins/builtin/futures/model.ts +28 -32
- package/src/plugins/builtin/futures/series.ts +4 -3
- package/src/plugins/builtin/futures/table.tsx +16 -9
- package/src/plugins/builtin/futures/use-board-terms.ts +3 -3
- package/src/plugins/builtin/futures-curve/headless.ts +3 -3
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +18 -0
- package/src/plugins/builtin/gpu/index.tsx +1 -1
- package/src/plugins/builtin/help/functions-table.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +14 -4
- package/src/plugins/builtin/help/keybindings-editor.tsx +19 -5
- package/src/plugins/builtin/holders/index.tsx +1 -0
- package/src/plugins/builtin/holders/report-header.ts +2 -2
- package/src/plugins/builtin/insider/index.tsx +1 -0
- package/src/plugins/builtin/iv-history/index.tsx +1 -1
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/layout-manager/index.tsx +8 -8
- package/src/plugins/builtin/macro-day/headless.ts +27 -8
- package/src/plugins/builtin/macro-day/index.tsx +1 -1
- package/src/plugins/builtin/macro-day/model.ts +19 -3
- package/src/plugins/builtin/macro-day/pane.tsx +14 -9
- package/src/plugins/builtin/macro-day/releases.ts +25 -7
- package/src/plugins/builtin/market-valuation/index.tsx +1 -0
- package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
- package/src/plugins/builtin/members/index.tsx +1 -1
- package/src/plugins/builtin/mna/index.tsx +1 -0
- package/src/plugins/builtin/news/headless.ts +2 -2
- package/src/plugins/builtin/news/index.tsx +4 -3
- package/src/plugins/builtin/news/wire/index.tsx +5 -1
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
- package/src/plugins/builtin/options/index.tsx +1 -0
- package/src/plugins/builtin/options-positioning/index.tsx +1 -0
- package/src/plugins/builtin/pe-band/index.tsx +1 -1
- package/src/plugins/builtin/perps/markets-section.tsx +5 -2
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +11 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
- package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +3 -1
- package/src/plugins/builtin/power/index.tsx +1 -1
- package/src/plugins/builtin/realized-vol/index.tsx +1 -1
- package/src/plugins/builtin/research/event-model.ts +9 -1
- package/src/plugins/builtin/research/event-sources.ts +22 -0
- package/src/plugins/builtin/research/headless.ts +11 -5
- package/src/plugins/builtin/research/index.tsx +4 -0
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/research-search/pane.tsx +8 -0
- package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/scanner/headless.ts +52 -13
- package/src/plugins/builtin/seasonality/index.tsx +1 -1
- package/src/plugins/builtin/sec/index.tsx +1 -0
- package/src/plugins/builtin/series-inventory.ts +1 -1
- package/src/plugins/builtin/shared/cloud-upgrade.ts +27 -3
- package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
- package/src/plugins/builtin/short-interest/index.tsx +1 -0
- package/src/plugins/builtin/social-mentions/index.tsx +1 -1
- package/src/plugins/builtin/supply-chain/index.tsx +1 -0
- package/src/plugins/builtin/thirteenf/data.ts +43 -10
- package/src/plugins/builtin/thirteenf/headless.ts +55 -11
- package/src/plugins/builtin/thirteenf/model.ts +25 -9
- package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
- package/src/plugins/builtin/thirteenf/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
- package/src/plugins/builtin/ticker-detail/financials/model.ts +12 -0
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +5 -5
- package/src/plugins/builtin/ticker-detail/headless.ts +18 -13
- package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +54 -5
- package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +34 -17
- package/src/plugins/builtin/ticker-detail/pane.tsx +7 -2
- package/src/plugins/builtin/time-sales/client.ts +9 -11
- package/src/plugins/builtin/time-sales/index.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
- package/src/plugins/builtin/treasury-auctions/cache.ts +18 -3
- package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +109 -19
- package/src/plugins/builtin/treasury-auctions/index.tsx +14 -4
- package/src/plugins/builtin/treasury-auctions/model.ts +256 -28
- package/src/plugins/builtin/treasury-auctions/pane.tsx +139 -28
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
- package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
- package/src/plugins/builtin/vol-surface/index.tsx +1 -1
- package/src/plugins/builtin/world-venue-map/index.ts +1 -0
- package/src/plugins/builtin/yield-curve/curves.ts +10 -4
- package/src/plugins/builtin/yield-curve/headless.ts +6 -2
- package/src/plugins/builtin/yield-curve/index.tsx +3 -3
- package/src/plugins/builtin/yield-curve/series.ts +10 -0
- package/src/plugins/builtin/yield-curve/world.ts +3 -1
- package/src/plugins/installer.ts +45 -0
- package/src/portfolio/column-values.ts +2 -1
- package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
- package/src/public/remote.ts +7 -1
- package/src/remote/client.ts +191 -11
- package/src/remote/controller-utils.ts +13 -1
- package/src/remote/controller.ts +88 -26
- package/src/remote/endpoint.ts +24 -0
- package/src/remote/form.ts +59 -4
- package/src/remote/resources.ts +56 -19
- package/src/remote/schema.ts +22 -9
- package/src/remote/secrets.ts +12 -0
- package/src/remote/semantic-helpers.ts +29 -1
- package/src/remote/semantic-tree.tsx +44 -15
- package/src/remote/server.ts +2 -1
- package/src/remote/surface.tsx +192 -0
- package/src/remote/types.ts +5 -0
- package/src/renderers/cloudflare/worker.ts +16 -1
- package/src/renderers/dom/styles.css +40 -6
- package/src/renderers/opentui/host.tsx +6 -0
- package/src/renderers/share/layout-view.tsx +1 -1
- package/src/series/standalone.ts +2 -2
- package/src/shares/api.ts +21 -4
- package/src/shares/item.ts +73 -0
- package/src/shares/pane-item.ts +205 -0
- package/src/shares/pane.ts +4 -0
- package/src/shares/payload.ts +9 -5
- package/src/sources/gloomberb-cloud/news.ts +37 -12
- package/src/state/opening-ticker-panes.ts +47 -0
- package/src/test-support/cli-context.ts +2 -0
- package/src/test-support/preload.ts +4 -1
- package/src/tickers/instrument-kind.ts +23 -3
- package/src/tickers/renamed-listings.ts +105 -0
- package/src/tickers/search/index.ts +103 -16
- package/src/time-series/resolve.ts +2 -2
- package/src/types/config.ts +5 -0
- package/src/types/context-menu.ts +2 -0
- package/src/types/financials.ts +1 -0
- package/src/types/plugin-commands.ts +140 -0
- package/src/types/plugin-context.ts +125 -0
- package/src/types/plugin-contributions.ts +55 -0
- package/src/types/plugin-definition.ts +234 -0
- package/src/types/plugin-notifications.ts +38 -0
- package/src/types/plugin-pane-settings.ts +116 -0
- package/src/types/plugin-pane-templates.ts +160 -0
- package/src/types/plugin-panes.ts +243 -0
- package/src/types/plugin-reports.ts +35 -0
- package/src/types/plugin-shared.ts +14 -0
- package/src/types/plugin-state.ts +71 -0
- package/src/types/plugin.ts +14 -1169
- package/src/ui/index.tsx +14 -3
- package/src/updater/github-releases.ts +23 -0
- package/src/utils/central-banks.ts +86 -1
- package/src/utils/cli-output.ts +22 -9
- package/src/utils/datetime-format.ts +12 -3
- package/src/utils/depositary-receipt.ts +28 -3
- package/src/utils/fundamentals.ts +14 -0
- package/src/utils/max-drawdown.ts +97 -16
- package/src/utils/untrusted-text.ts +29 -0
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
TickerFinancials,
|
|
6
6
|
} from "../../../types/financials";
|
|
7
7
|
import { formatEventMetric } from "./event-model";
|
|
8
|
+
import { formatPercent, formatPercentRaw } from "../../../utils/format";
|
|
8
9
|
import { loadEarningsCalendar } from "../earnings/data/cache";
|
|
9
10
|
import { calendarEventOf, newYorkDay, withResolvedEarnings } from "../shared/earnings-calendar";
|
|
10
11
|
|
|
@@ -28,6 +29,27 @@ export const EVENT_COLUMNS = [
|
|
|
28
29
|
{ key: "detail", header: "Detail" },
|
|
29
30
|
];
|
|
30
31
|
|
|
32
|
+
/**
|
|
33
|
+
* The columns of the earnings estimates report, as its pane heads them: what corporate actions
|
|
34
|
+
* call Value is a reported quarter's EPS surprise or an estimate's growth over the year-ago
|
|
35
|
+
* figure, each in a column of its own.
|
|
36
|
+
*/
|
|
37
|
+
export const EARNINGS_ESTIMATE_COLUMNS = [
|
|
38
|
+
...EVENT_COLUMNS.filter((column) => column.key !== "value" && column.key !== "detail"),
|
|
39
|
+
{
|
|
40
|
+
key: "surprisePercent", header: "EPS surp", align: "right" as const,
|
|
41
|
+
format: (value: unknown) => value == null ? "-" : formatPercentRaw(Number(value)),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: "estimateGrowth", header: "YoY growth", align: "right" as const,
|
|
45
|
+
format: (value: unknown) => value == null ? "-" : formatPercent(Number(value)),
|
|
46
|
+
// The text says which figure grew, as the pane does; exports keep the percent a number.
|
|
47
|
+
textFormat: (value: unknown, row: Record<string, unknown>) => value == null ? "-"
|
|
48
|
+
: `${formatPercent(Number(value))} ${row.estimateGrowthMetric === "revenue" ? "rev" : "EPS"}`,
|
|
49
|
+
},
|
|
50
|
+
{ key: "detail", header: "Detail" },
|
|
51
|
+
];
|
|
52
|
+
|
|
31
53
|
export interface EventSources {
|
|
32
54
|
actions: CorporateActionsData | null;
|
|
33
55
|
estimates: AnalystResearchData | null;
|
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
HeadlessRowsResult,
|
|
11
11
|
} from "../../../types/plugin";
|
|
12
12
|
import { buildEventRows, eventSourceNotice, type EventRow } from "./event-model";
|
|
13
|
-
import {
|
|
13
|
+
import { EARNINGS_ESTIMATE_COLUMNS, loadEventSources } from "./event-sources";
|
|
14
14
|
import { REPORTED_DATA } from "../shared/report-freshness";
|
|
15
15
|
import { EPS_BASIS_NOTE } from "../shared/earnings-report";
|
|
16
16
|
import { REPORT_FILTER, REPORT_ROWS } from "../shared/headless-options";
|
|
@@ -30,6 +30,8 @@ export interface EarningsEstimatesHeadlessDependencies {
|
|
|
30
30
|
): Promise<EarningsEstimateSources>;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
const ESTIMATE_COLUMNS = [...EARNINGS_ESTIMATE_COLUMNS, { key: "epsBasis", header: "EPS basis" }];
|
|
34
|
+
|
|
33
35
|
const defaultDependencies: EarningsEstimatesHeadlessDependencies = {
|
|
34
36
|
async loadSources(symbol, context) {
|
|
35
37
|
const { actions, estimates, financials, currency, ...failures } = await loadEventSources(context.marketData, symbol);
|
|
@@ -63,7 +65,11 @@ function projectEarningsEstimatesHeadless(
|
|
|
63
65
|
sources.financials,
|
|
64
66
|
sources.currency,
|
|
65
67
|
).filter((row) => matchesKind(row, kind));
|
|
66
|
-
const rows = matching.slice(0, limit).map((row) => ({ ...row
|
|
68
|
+
const rows = matching.slice(0, limit).map((row) => ({ ...row,
|
|
69
|
+
...(row.status === "Q Est" || row.status === "FY Est" ? {
|
|
70
|
+
epsBasis: row.estimateInputs?.eps?.epsBasis === "gaap" ? "GAAP" : row.estimateInputs?.eps?.epsBasis === "adjusted" ? "adjusted" : "unknown",
|
|
71
|
+
} : {}),
|
|
72
|
+
}));
|
|
67
73
|
const notice = eventSourceNotice({ variant: "earnings-estimates", symbol: args.symbols[0] ?? String(args.argument ?? ""),
|
|
68
74
|
actions: sources.actions, estimates: sources.estimates,
|
|
69
75
|
actionsError: sources.actions ? null : "Source unavailable", estimatesError: sources.estimates ? null : "Source unavailable",
|
|
@@ -73,7 +79,7 @@ function projectEarningsEstimatesHeadless(
|
|
|
73
79
|
if (unmatchedReportedPeriods.length) errors.push(`No statement period identified for ${unmatchedReportedPeriods.length} reported earnings row(s); quarterly revenue is unavailable.`);
|
|
74
80
|
|
|
75
81
|
return {
|
|
76
|
-
columns:
|
|
82
|
+
columns: ESTIMATE_COLUMNS,
|
|
77
83
|
rows,
|
|
78
84
|
errors: errors.length ? errors : undefined,
|
|
79
85
|
metadata: {
|
|
@@ -83,7 +89,7 @@ function projectEarningsEstimatesHeadless(
|
|
|
83
89
|
returned: rows.length,
|
|
84
90
|
truncated: rows.length < matching.length,
|
|
85
91
|
coverageNote: notice?.text,
|
|
86
|
-
epsBasis:
|
|
92
|
+
epsBasis: `Estimate basis is unknown unless the estimate source explicitly identifies GAAP or adjusted; never assume it matches a reported quarter. ${EPS_BASIS_NOTE} The TTM row's EPS is the GAAP diluted trailing figure ticker shows as EPS (TTM): the last four filed quarters', or Gloom Cloud's TTM (named so) when they give none, or the four statement quarters' diluted EPS when neither is there; reported quarters of different bases are never summed, and the row adds an adjusted sum only when all four quarters are adjusted.`,
|
|
87
93
|
dateNote: "Fiscal period dates are not announcement dates. Revenue is attached only to an identified statement period.",
|
|
88
94
|
unmatchedReportedPeriods,
|
|
89
95
|
},
|
|
@@ -124,7 +130,7 @@ export function createEarningsEstimatesHeadless(
|
|
|
124
130
|
maximum: 200,
|
|
125
131
|
},
|
|
126
132
|
],
|
|
127
|
-
columns:
|
|
133
|
+
columns: ESTIMATE_COLUMNS,
|
|
128
134
|
describe: (args) => `Earnings Estimates | ${String(args.argument)}`,
|
|
129
135
|
async load(args, context) {
|
|
130
136
|
return projectEarningsEstimatesHeadless(
|
|
@@ -52,6 +52,7 @@ export const researchModule: PluginModule = {
|
|
|
52
52
|
icon: "A",
|
|
53
53
|
get component(): typeof import("./analyst-pane").AnalystResearchView { const { AnalystResearchView } = require("./analyst-pane"); return AnalystResearchView; },
|
|
54
54
|
defaultPosition: "right",
|
|
55
|
+
shareItem: { ticker: true },
|
|
55
56
|
tickerFollower: true,
|
|
56
57
|
instruments: ["equity"],
|
|
57
58
|
defaultMode: "floating",
|
|
@@ -67,6 +68,7 @@ export const researchModule: PluginModule = {
|
|
|
67
68
|
icon: "D",
|
|
68
69
|
get component(): typeof import("./equity-diagnostic-pane").EquityDiagnosticView { const { EquityDiagnosticView } = require("./equity-diagnostic-pane"); return EquityDiagnosticView; },
|
|
69
70
|
defaultPosition: "right",
|
|
71
|
+
shareItem: { ticker: true },
|
|
70
72
|
tickerFollower: true,
|
|
71
73
|
instruments: ["equity"],
|
|
72
74
|
defaultMode: "floating",
|
|
@@ -78,6 +80,7 @@ export const researchModule: PluginModule = {
|
|
|
78
80
|
icon: "E",
|
|
79
81
|
component: CorporateActionsView,
|
|
80
82
|
defaultPosition: "right",
|
|
83
|
+
shareItem: { ticker: true },
|
|
81
84
|
tickerFollower: true,
|
|
82
85
|
defaultMode: "floating",
|
|
83
86
|
defaultFloatingSize: { width: 104, height: 24 },
|
|
@@ -102,6 +105,7 @@ export const researchModule: PluginModule = {
|
|
|
102
105
|
icon: "E",
|
|
103
106
|
component: EarningsEstimatesPane,
|
|
104
107
|
defaultPosition: "right",
|
|
108
|
+
shareItem: { ticker: true },
|
|
105
109
|
tickerFollower: true,
|
|
106
110
|
instruments: ["equity"],
|
|
107
111
|
defaultMode: "floating",
|
|
@@ -39,6 +39,7 @@ export const researchSearchPlugin: GloomPlugin = {
|
|
|
39
39
|
reportFreshness: { status: "not-a-feed", basis: "search results" },
|
|
40
40
|
name: "Research Search",
|
|
41
41
|
icon: "RS",
|
|
42
|
+
shareItem: { open: true },
|
|
42
43
|
get component(): typeof import("./pane").ResearchSearchPane { const { ResearchSearchPane } = require("./pane"); return ResearchSearchPane; },
|
|
43
44
|
defaultPosition: "right",
|
|
44
45
|
defaultMode: "floating",
|
|
@@ -26,6 +26,8 @@ import { useDialog } from "../../../ui/dialog";
|
|
|
26
26
|
import { isPlainArrowUp, stopSearchFocusNavigation } from "../../../utils/search-focus-navigation";
|
|
27
27
|
import { usePaneSettingValue } from "../../../state/app/context";
|
|
28
28
|
import { usePluginPaneState } from "../../runtime";
|
|
29
|
+
import { shareItemExcerpt } from "../../../shares/item";
|
|
30
|
+
import { usePaneShareItem } from "../../../shares/pane-item";
|
|
29
31
|
import type { PaneProps } from "../../../types/plugin";
|
|
30
32
|
import type {
|
|
31
33
|
CloudSavedSearch,
|
|
@@ -149,6 +151,12 @@ export function ResearchSearchPane({ focused, paneId, width, height }: PaneProps
|
|
|
149
151
|
[hits, openHitId],
|
|
150
152
|
);
|
|
151
153
|
const openHit = openHitIndex >= 0 ? hits[openHitIndex]! : null;
|
|
154
|
+
// A link to the pane says what it is on: the result open or picked. Never
|
|
155
|
+
// the words typed in the search, which are the person's own.
|
|
156
|
+
usePaneShareItem(() => {
|
|
157
|
+
const picked = openHit ?? hits.find((hit) => hit.id === selectedHitId);
|
|
158
|
+
return picked ? { title: picked.title, excerpt: shareItemExcerpt(snippetPlainText(picked.snippet)) } : null;
|
|
159
|
+
});
|
|
152
160
|
// The document the cache holds paints at once; another document never
|
|
153
161
|
// shows under this hit's title while its own loads.
|
|
154
162
|
const [seededDocumentKey, setSeededDocumentKey] = useState<string | null>(null);
|
|
@@ -6,7 +6,7 @@ import { DISCOUNT_OPTIONS, MARGIN_OPTIONS, ReverseDcfPane } from "./pane";
|
|
|
6
6
|
export const reverseDcfModule: PluginModule = {
|
|
7
7
|
panes: [{
|
|
8
8
|
id: "reverse-dcf", name: "Reverse DCF", icon: "R", component: ReverseDcfPane,
|
|
9
|
-
defaultPosition: "right", tickerFollower: true, instruments: ["equity"], defaultMode: "floating", defaultFloatingSize: { width: 80, height: 20 },
|
|
9
|
+
defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], defaultMode: "floating", defaultFloatingSize: { width: 80, height: 20 },
|
|
10
10
|
tableExport: true,
|
|
11
11
|
// Dated as `fn RDCF` dates it, by the regular close the enterprise value is measured at, not by the quote's latest print.
|
|
12
12
|
reportFreshness: reverseDcfHeadless.freshness,
|
|
@@ -40,13 +40,32 @@ import { captureScannerEvent, SCANNER_SNAPSHOT_TIMEOUT_MS } from "../shared/scan
|
|
|
40
40
|
import { flowLockNote } from "./lock-note";
|
|
41
41
|
import { buildHiloBarRows, filterHiloRows, formatHiloPrice, type HiloMinPrice, type HiloSort } from "./hilo-model";
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* How long a report waits for a scanner that is starting: an idle one can take
|
|
45
|
+
* most of the 30 s a capture gives it to win its lock and seed (a cold HILO
|
|
46
|
+
* took 30 s on a weekend), past what an Ask Gloom call is given. After this it
|
|
47
|
+
* answers with what the starting scanner holds, said to be stale.
|
|
48
|
+
*/
|
|
49
|
+
const HEADLESS_SCANNER_WAIT_MS = 12_000;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The most a FLOW report waits in all, inside the 20 s a script gives a call:
|
|
53
|
+
* its recorded prints and session sums get what the live feed's wait left,
|
|
54
|
+
* and one not answered by then is said under errors.
|
|
55
|
+
*/
|
|
56
|
+
const FLOW_REPORT_BUDGET_MS = 16_000;
|
|
57
|
+
|
|
58
|
+
/** What a report of a scanner still starting says in place of its empty list. */
|
|
59
|
+
const SCANNER_STARTING_TEXT = "The scanner is still starting and has nothing to list yet. Ask again in a few seconds.";
|
|
60
|
+
|
|
43
61
|
function loadScannerSnapshot<T extends ScannerPayload>(
|
|
44
62
|
client: Pick<HeadlessPaneApiClient, "subscribeScanner">,
|
|
45
63
|
scanner: ScannerKind,
|
|
46
64
|
signal: AbortSignal,
|
|
47
65
|
timeoutMs = SCANNER_SNAPSHOT_TIMEOUT_MS,
|
|
66
|
+
options: { acceptStarting?: boolean } = {},
|
|
48
67
|
): Promise<T> {
|
|
49
|
-
return captureScannerEvent(client, scanner, signal, timeoutMs).then((event) => {
|
|
68
|
+
return captureScannerEvent(client, scanner, signal, timeoutMs, options).then((event) => {
|
|
50
69
|
if (event.type !== "denied") return event.payload as T;
|
|
51
70
|
// The refusal a read gets from the server: 402 for a plan without access, 401 for no session.
|
|
52
71
|
throw event.reason === "pro_required"
|
|
@@ -63,6 +82,15 @@ export function loadHiloSnapshot(
|
|
|
63
82
|
return loadScannerSnapshot<ScannerHiloPayload>(client, "hilo", signal, timeoutMs);
|
|
64
83
|
}
|
|
65
84
|
|
|
85
|
+
/** A report's read of a scanner: HEADLESS_SCANNER_WAIT_MS at most, after which a starting scanner is answered as one. */
|
|
86
|
+
function loadReportSnapshot<T extends ScannerPayload>(
|
|
87
|
+
client: Pick<HeadlessPaneApiClient, "subscribeScanner">,
|
|
88
|
+
scanner: ScannerKind,
|
|
89
|
+
signal: AbortSignal,
|
|
90
|
+
): Promise<T> {
|
|
91
|
+
return loadScannerSnapshot<T>(client, scanner, signal, HEADLESS_SCANNER_WAIT_MS, { acceptStarting: true });
|
|
92
|
+
}
|
|
93
|
+
|
|
66
94
|
/**
|
|
67
95
|
* The scanner says which instance served it, real-time or the delayed one free
|
|
68
96
|
* accounts get, and whether it is running: a closed session's scan is final,
|
|
@@ -70,7 +98,7 @@ export function loadHiloSnapshot(
|
|
|
70
98
|
*/
|
|
71
99
|
function scannerFreshness(payload: Pick<ScannerHiloPayload, "access" | "delayMinutes" | "status">): HeadlessPaneFreshness {
|
|
72
100
|
if (payload.status === "closed") return { status: "not-a-feed", basis: "closed session" };
|
|
73
|
-
if (payload.status === "degraded") return { status: "stale" };
|
|
101
|
+
if (payload.status === "degraded" || payload.status === "starting") return { status: "stale" };
|
|
74
102
|
return payload.access === "realtime" ? { status: "live" } : { status: "delayed", delayMinutes: payload.delayMinutes };
|
|
75
103
|
}
|
|
76
104
|
|
|
@@ -84,6 +112,10 @@ function projectHiloSnapshot(
|
|
|
84
112
|
return {
|
|
85
113
|
asOf: new Date(payload.asOf).toISOString(),
|
|
86
114
|
items: [...lows, ...highs],
|
|
115
|
+
// The lists are the session's: between sessions the scanner holds none, and last session's are not today's.
|
|
116
|
+
empty: payload.status === "closed" ? "The US market is closed. New highs and lows list again from the next session's open."
|
|
117
|
+
: payload.status === "starting" ? SCANNER_STARTING_TEXT
|
|
118
|
+
: "No new highs or lows under these filters this session.",
|
|
87
119
|
...(payload.status === "degraded" ? { errors: ["Scanner feed degraded"] } : {}),
|
|
88
120
|
freshness: scannerFreshness(payload),
|
|
89
121
|
metadata: {
|
|
@@ -107,7 +139,7 @@ export interface HiloHeadlessDependencies {
|
|
|
107
139
|
}
|
|
108
140
|
|
|
109
141
|
const defaultDependencies: HiloHeadlessDependencies = {
|
|
110
|
-
load: (_args, client, signal) =>
|
|
142
|
+
load: (_args, client, signal) => loadReportSnapshot<ScannerHiloPayload>(client, "hilo", signal),
|
|
111
143
|
};
|
|
112
144
|
|
|
113
145
|
export function createHiloHeadless(
|
|
@@ -279,7 +311,8 @@ function projectFlowReport(
|
|
|
279
311
|
title: symbol ? `${symbol} prints` : "Prints",
|
|
280
312
|
columns: PRINT_COLUMNS,
|
|
281
313
|
rows: prints.map((event) => ({ ...event })),
|
|
282
|
-
empty:
|
|
314
|
+
empty: payload.status === "starting" ? SCANNER_STARTING_TEXT
|
|
315
|
+
: symbol ? `No ${symbol} prints under these filters.` : "No prints on the tape under these filters.",
|
|
283
316
|
});
|
|
284
317
|
}
|
|
285
318
|
if (shows("tide")) {
|
|
@@ -331,7 +364,7 @@ interface FlowHeadlessDependencies {
|
|
|
331
364
|
}
|
|
332
365
|
|
|
333
366
|
const flowDependencies: FlowHeadlessDependencies = {
|
|
334
|
-
load: (_args, client, signal) =>
|
|
367
|
+
load: (_args, client, signal) => loadReportSnapshot<ScannerFlowPayload>(client, "flow", signal),
|
|
335
368
|
recorded: (search, client, signal) => client.getScannerFlowHistory(search, signalWithTimeout(signal, 20_000)),
|
|
336
369
|
session: (search, client, signal) => client.getScannerFlowSession(search, signalWithTimeout(signal, 20_000)),
|
|
337
370
|
};
|
|
@@ -375,11 +408,17 @@ export function createFlowHeadless(
|
|
|
375
408
|
const refuse = async (error: unknown): Promise<never> => {
|
|
376
409
|
throw await explainRefusal(error, flowLockNote, { symbol, context: ctx });
|
|
377
410
|
};
|
|
378
|
-
// The live feed answers the entitlement first, as the pane's does.
|
|
411
|
+
// The live feed answers the entitlement first, as the pane's does; it waits HEADLESS_SCANNER_WAIT_MS at most.
|
|
412
|
+
const startedAt = Date.now();
|
|
379
413
|
const payload = await dependencies.load(args, ctx.apiClient, ctx.signal).catch(refuse);
|
|
380
|
-
// The recorded prints and the session's sums add to the tape
|
|
381
|
-
// fails (a timeout, a server
|
|
382
|
-
// the
|
|
414
|
+
// The recorded prints and the session's sums add to the tape in what is
|
|
415
|
+
// left of FLOW_REPORT_BUDGET_MS: one that fails (a timeout, a server
|
|
416
|
+
// without the route) is said under errors and the rest of the report
|
|
417
|
+
// stands. A wall still refuses the whole read.
|
|
418
|
+
const leftMs = Math.max(0, FLOW_REPORT_BUDGET_MS - (Date.now() - startedAt));
|
|
419
|
+
const outOfTime = new AbortController();
|
|
420
|
+
const deadline = setTimeout(() => outOfTime.abort(), leftMs);
|
|
421
|
+
const budget = AbortSignal.any([ctx.signal, outOfTime.signal]);
|
|
383
422
|
const failures: string[] = [];
|
|
384
423
|
const extra = async <T>(load: Promise<T> | null, what: string): Promise<T | null> => {
|
|
385
424
|
if (!load) return null;
|
|
@@ -387,7 +426,7 @@ export function createFlowHeadless(
|
|
|
387
426
|
return await load;
|
|
388
427
|
} catch (error) {
|
|
389
428
|
if (ctx.signal.aborted || refusedLock(error)) return refuse(error);
|
|
390
|
-
failures.push(`${what} unavailable: ${errorMessage(error)}`);
|
|
429
|
+
failures.push(`${what} unavailable: ${outOfTime.signal.aborted ? `no answer within ${Math.round(leftMs / 1000)} s` : errorMessage(error)}`);
|
|
391
430
|
return null;
|
|
392
431
|
}
|
|
393
432
|
};
|
|
@@ -395,10 +434,10 @@ export function createFlowHeadless(
|
|
|
395
434
|
const wantsSession = !tab || tab === "tide" || tab === "strikes";
|
|
396
435
|
const [recorded, session] = await Promise.all([
|
|
397
436
|
extra(symbol && wantsPrints
|
|
398
|
-
? dependencies.recorded(flowHistorySearch(flowHistoryQuery(filters, scope, undefined, FLOW_REPORT_RECORDED)), ctx.apiClient,
|
|
437
|
+
? dependencies.recorded(flowHistorySearch(flowHistoryQuery(filters, scope, undefined, FLOW_REPORT_RECORDED)), ctx.apiClient, budget)
|
|
399
438
|
: null, "Recorded prints"),
|
|
400
|
-
extra(wantsSession ? dependencies.session(flowSessionSearch(filters, scope), ctx.apiClient,
|
|
401
|
-
]);
|
|
439
|
+
extra(wantsSession ? dependencies.session(flowSessionSearch(filters, scope), ctx.apiClient, budget) : null, "Session totals"),
|
|
440
|
+
]).finally(() => clearTimeout(deadline));
|
|
402
441
|
// Asked for the session's sums alone, a failure to read them is the report's.
|
|
403
442
|
if (!wantsPrints && failures.length > 0) throw new Error(failures[0]);
|
|
404
443
|
const report = projectFlowReport({ payload, recorded, session }, filters, scope, wantsSession && !session ? "prints" : tab);
|
|
@@ -6,7 +6,7 @@ import { LOOKBACK_OPTIONS, SeasonalityPane } from "./pane";
|
|
|
6
6
|
export const seasonalityModule: PluginModule = {
|
|
7
7
|
panes: [{
|
|
8
8
|
id: "seasonality", name: "Seasonality", icon: "S", component: SeasonalityPane,
|
|
9
|
-
defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 112, height: 30 },
|
|
9
|
+
defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 112, height: 30 },
|
|
10
10
|
tableExport: true,
|
|
11
11
|
settings: { title: "Seasonality Settings", fields: [
|
|
12
12
|
{ key: "lookbackYears", label: "Lookback", type: "select", options: LOOKBACK_OPTIONS },
|
|
@@ -42,7 +42,7 @@ export const SERIES_INVENTORY: readonly SeriesInventoryEntry[] = [
|
|
|
42
42
|
{ module: "options-scenario", chart: "Option payoff by underlying price", notInCatalog: "not-a-time-series", reason: "A payoff curve over prices." },
|
|
43
43
|
{ module: "kelly-sizer", chart: "Position size against win rate", notInCatalog: "account", reason: "Drawn from the inputs typed into the sizer." },
|
|
44
44
|
{ module: "yield-curve", chart: "Treasury curve and each maturity's history", series: ["ust:*", "fred:T10Y2Y", "fred:T10Y3M", "fred:DFII*"] },
|
|
45
|
-
{ module: "yield-curve", chart: "Government curves for Germany, the UK, Japan, Canada
|
|
45
|
+
{ module: "yield-curve", chart: "Government curves for Germany, the UK, Japan, Canada, euro AAA, Mexico and Brazil", series: ["bond-yield:*"] },
|
|
46
46
|
{ module: "rate-path", chart: "Implied policy path by meeting", notInCatalog: "not-a-time-series", reason: "A path over future meetings; the rates it starts from are FRED series in the catalog." },
|
|
47
47
|
{ module: "money-markets", chart: "Money market rates, bill yields, liquidity and net liquidity", series: ["money-markets:*", "fred:SOFR", "fred:EFFR", "fred:IORB", "fred:OBFR", "fred:DTB*", "fred:RRPONTSYD", "fred:WDTGAL", "fred:WRESBAL", "fred:WALCL"] },
|
|
48
48
|
{ module: "central-bank-rates", chart: "Policy rate history for each central bank", series: ["policy-rate:*"] },
|
|
@@ -15,6 +15,7 @@ import { freeQuotesDelayMinutes, resolvePlanAccess, usePlanAccess, type PlanAcce
|
|
|
15
15
|
import { useViewport } from "../../../react/input";
|
|
16
16
|
import { type DialogApi, useOptionalDialog } from "../../../ui/dialog";
|
|
17
17
|
import { promptCloudUpgrade } from "../../../account/upgrade-dialog";
|
|
18
|
+
import { isAuthDialogOpen, requestAuthDialog } from "../../../account/auth-dialog";
|
|
18
19
|
import { type CheckoutHandoffTarget, promptCheckoutHandoff } from "../../../account/checkout-handoff";
|
|
19
20
|
|
|
20
21
|
const CLOUD_UPGRADE_URL = "https://gloom.sh/cloud?upgrade=pro";
|
|
@@ -195,8 +196,14 @@ function isCloudUpgradeOptions(value: unknown): value is CloudUpgradeOptions {
|
|
|
195
196
|
*
|
|
196
197
|
* A signed-in account without Pro sees the upgrade sheet first (what Pro adds,
|
|
197
198
|
* what today costs), and checkout opens only once they choose to go on, with
|
|
198
|
-
* the checkout hand-off over the app until Pro arrives. Signed
|
|
199
|
-
*
|
|
199
|
+
* the checkout hand-off over the app until Pro arrives. Signed out, the
|
|
200
|
+
* sign-up dialog opens first, as the UPGRADE command's does, and the upgrade
|
|
201
|
+
* goes on once signed in, to the sheet for an account without Pro and to
|
|
202
|
+
* nothing for one that has it: the Cloud page it opened before left a
|
|
203
|
+
* terminal over SSH with no browser looking as if `$` did nothing. A press
|
|
204
|
+
* while the dialog is up does nothing. Only with no dialog host (an isolated
|
|
205
|
+
* render) does it open the public Cloud page. Pro accounts get the billing
|
|
206
|
+
* portal.
|
|
200
207
|
*/
|
|
201
208
|
export function useCloudUpgradeAction(placement: string): (options?: unknown) => Promise<void> {
|
|
202
209
|
const rendererHost = useRendererHost();
|
|
@@ -227,6 +234,20 @@ export function useCloudUpgradeAction(placement: string): (options?: unknown) =>
|
|
|
227
234
|
})
|
|
228
235
|
)).catch(logFailure("shared.cloud-upgrade", "Open Cloud upgrade page failed"));
|
|
229
236
|
};
|
|
237
|
+
if (checkout.sheet !== false && !apiClient.isSignedIn()) {
|
|
238
|
+
// A press while the sign-up dialog is up asks for nothing new, and counts nothing.
|
|
239
|
+
if (isAuthDialogOpen()) return;
|
|
240
|
+
// Counted once, on this press: the upgrade that goes on after sign-up does not count it again. An account that
|
|
241
|
+
// signs in with Pro already has what the press was for, so nothing more opens.
|
|
242
|
+
const continueSignedIn = () => {
|
|
243
|
+
if (resolvePlanAccess(apiClient.getCurrentUser()).hasProAccess) return;
|
|
244
|
+
void openUpgradeRef.current({ ...checkout, recordIntent: false });
|
|
245
|
+
};
|
|
246
|
+
if (requestAuthDialog({ mode: "signup", onSignedIn: continueSignedIn })) {
|
|
247
|
+
if (checkout.recordIntent !== false) recordUpgradeIntent(checkout.placement);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
230
251
|
if (
|
|
231
252
|
checkout.sheet === false ||
|
|
232
253
|
!dialog ||
|
|
@@ -236,7 +257,7 @@ export function useCloudUpgradeAction(placement: string): (options?: unknown) =>
|
|
|
236
257
|
await openCheckout(checkout);
|
|
237
258
|
return;
|
|
238
259
|
}
|
|
239
|
-
recordUpgradeIntent(checkout.placement);
|
|
260
|
+
if (checkout.recordIntent !== false) recordUpgradeIntent(checkout.placement);
|
|
240
261
|
// Checkout is opening or just opened: a second sheet would lead nowhere.
|
|
241
262
|
if (isCloudUpgradeBlocked("checkout")) return;
|
|
242
263
|
const interval = await promptCloudUpgrade(dialog, {
|
|
@@ -245,6 +266,9 @@ export function useCloudUpgradeAction(placement: string): (options?: unknown) =>
|
|
|
245
266
|
});
|
|
246
267
|
if (interval) await openCheckout({ ...checkout, interval, recordIntent: false });
|
|
247
268
|
}, [dialog, placement, rendererHost]);
|
|
269
|
+
// The sign-up dialog's continuation runs the newest action, after the sign-in re-rendered it.
|
|
270
|
+
const openUpgradeRef = useRef(openUpgrade);
|
|
271
|
+
openUpgradeRef.current = openUpgrade;
|
|
248
272
|
useEffect(() => {
|
|
249
273
|
cloudUpgradeOpeners.add(openUpgrade);
|
|
250
274
|
return () => {
|
|
@@ -51,19 +51,23 @@ const SCANNER_LABELS: Record<ScannerKind, string> = {
|
|
|
51
51
|
* Resolves on the first live or closed payload, or on the server's refusal. A
|
|
52
52
|
* degraded payload is kept and returned only if nothing better arrives before
|
|
53
53
|
* the deadline, since a scanner warming up can pass through a stale row on its
|
|
54
|
-
* way to live.
|
|
54
|
+
* way to live. With `acceptStarting`, so is a starting one, for a report that
|
|
55
|
+
* says the scanner is starting rather than failing; a screenshot keeps failing
|
|
56
|
+
* on one, as it would only picture an empty pane.
|
|
55
57
|
*/
|
|
56
58
|
export function captureScannerEvent(
|
|
57
59
|
client: ScannerClient,
|
|
58
60
|
scanner: ScannerKind,
|
|
59
61
|
signal: AbortSignal,
|
|
60
62
|
timeoutMs = SCANNER_SNAPSHOT_TIMEOUT_MS,
|
|
63
|
+
{ acceptStarting = false }: { acceptStarting?: boolean } = {},
|
|
61
64
|
): Promise<ScannerFeedEvent> {
|
|
62
65
|
const label = SCANNER_LABELS[scanner];
|
|
63
66
|
return new Promise((resolve, reject) => {
|
|
64
67
|
let settled = false;
|
|
65
68
|
let unsubscribe: (() => void) | null = null;
|
|
66
69
|
let degraded: ScannerFeedEvent | null = null;
|
|
70
|
+
let starting: ScannerFeedEvent | null = null;
|
|
67
71
|
const finish = (callback: () => void) => {
|
|
68
72
|
if (settled) return;
|
|
69
73
|
settled = true;
|
|
@@ -76,7 +80,8 @@ export function captureScannerEvent(
|
|
|
76
80
|
? signal.reason
|
|
77
81
|
: new Error(`${label} snapshot aborted`)));
|
|
78
82
|
const timer = setTimeout(() => finish(() => {
|
|
79
|
-
|
|
83
|
+
const latest = degraded ?? starting;
|
|
84
|
+
if (latest) resolve(latest);
|
|
80
85
|
else reject(new Error(`${label} snapshot timed out`));
|
|
81
86
|
}), timeoutMs);
|
|
82
87
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
@@ -85,7 +90,10 @@ export function captureScannerEvent(
|
|
|
85
90
|
finish(() => resolve(event));
|
|
86
91
|
return;
|
|
87
92
|
}
|
|
88
|
-
if (event.payload.status === "starting")
|
|
93
|
+
if (event.payload.status === "starting") {
|
|
94
|
+
if (acceptStarting) starting = event;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
89
97
|
if (event.payload.status === "degraded") {
|
|
90
98
|
degraded = event;
|
|
91
99
|
return;
|
|
@@ -15,6 +15,7 @@ import { FILL_REST } from "../../../components/ui/fill";
|
|
|
15
15
|
import { useShortcut } from "../../../react/input";
|
|
16
16
|
import { Box, ScrollBox, useUiCapabilities } from "../../../ui";
|
|
17
17
|
import { isPlainKey } from "../../../utils/keyboard";
|
|
18
|
+
import { usePaneShareItem, type PaneShareItemPart } from "../../../shares/pane-item";
|
|
18
19
|
|
|
19
20
|
/** Below this the detail sits under the table instead of beside it. */
|
|
20
21
|
const SPLIT_MIN_WIDTH = 108;
|
|
@@ -54,6 +55,7 @@ export function useSeriesList<Item, R extends string>({
|
|
|
54
55
|
onSelect,
|
|
55
56
|
reload,
|
|
56
57
|
range,
|
|
58
|
+
shareItem,
|
|
57
59
|
}: {
|
|
58
60
|
focused: boolean;
|
|
59
61
|
/** Every selectable series, in list order. */
|
|
@@ -66,6 +68,8 @@ export function useSeriesList<Item, R extends string>({
|
|
|
66
68
|
onSelect: (id: string) => void;
|
|
67
69
|
reload: () => void;
|
|
68
70
|
range: Pick<QueryBarView<R>, "value" | "options" | "onChange" | "chartRange">;
|
|
71
|
+
/** What a link to the pane says it is on: the series its detail shows. */
|
|
72
|
+
shareItem?: (item: Item) => PaneShareItemPart | null;
|
|
69
73
|
}) {
|
|
70
74
|
const [query, setQuery] = useState("");
|
|
71
75
|
const { active: searchFocused, searchProps } = useQueryBarSearch();
|
|
@@ -93,6 +97,7 @@ export function useSeriesList<Item, R extends string>({
|
|
|
93
97
|
const selected = items.find((item) => getId(item) === selectedId) ?? items[0] ?? null;
|
|
94
98
|
const selectedItemId = selected ? getId(selected) : null;
|
|
95
99
|
const selectionOnScreen = visible.some((item) => getId(item) === selectedItemId);
|
|
100
|
+
usePaneShareItem(selected && shareItem ? () => shareItem(selected) : null);
|
|
96
101
|
|
|
97
102
|
const choose = useCallback((id: string, reason: DataTableSelectionChangeReason) => {
|
|
98
103
|
if (!shouldPersistSelection({
|
|
@@ -58,6 +58,7 @@ export const shortInterestModule: PluginModule = {
|
|
|
58
58
|
icon: "S",
|
|
59
59
|
component: ShortInterestSurface,
|
|
60
60
|
defaultPosition: "right",
|
|
61
|
+
shareItem: { ticker: true },
|
|
61
62
|
tickerFollower: followsWithoutFinraOverride,
|
|
62
63
|
defaultMode: "floating",
|
|
63
64
|
defaultFloatingSize: { width: 90, height: 25 },
|
|
@@ -14,7 +14,7 @@ const socialMentionsSettings = [
|
|
|
14
14
|
export const socialMentionsModule: PluginModule = {
|
|
15
15
|
series: SOCIAL_MENTION_SERIES,
|
|
16
16
|
panes: [{ id: "social-mentions", reportLockNote: socialMentionsLockNote, name: "Social Mentions", icon: "B", get component(): typeof import("./pane").SocialMentionsPane { const { SocialMentionsPane } = require("./pane"); return SocialMentionsPane; },
|
|
17
|
-
defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 96, height: 30 },
|
|
17
|
+
defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 96, height: 30 },
|
|
18
18
|
tableExport: true, headless: socialMentionsHeadless, settings: { title: "Social Mentions", fields: socialMentionsSettings } }],
|
|
19
19
|
paneTemplates: [{ ...createTickerSurfacePaneTemplate({ id: "social-mentions-pane", paneId: "social-mentions", label: "Social Mentions",
|
|
20
20
|
description: "Daily posts on X naming the ticker's cashtag, the day's top posts and their stance; alone, the tickers whose posts jump above their own median.",
|
|
@@ -14,6 +14,7 @@ export const supplyChainModule: PluginModule = {
|
|
|
14
14
|
dispose() { supplyChainCache.reset(); graphCache.reset(); },
|
|
15
15
|
panes: [{ id: "supply-chain", name: "Supply Chain", icon: "S", get component(): typeof import("./pane").SupplyChainPane { const { SupplyChainPane } = require("./pane"); return SupplyChainPane; },
|
|
16
16
|
defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 130, height: 30 },
|
|
17
|
+
shareItem: { ticker: true },
|
|
17
18
|
tickerFollower: true, instruments: ["equity"], tableExport: true, headless: supplyChainHeadless }],
|
|
18
19
|
paneTemplates: [{ ...createTickerSurfacePaneTemplate({ id: "supply-chain-pane", paneId: "supply-chain", label: "Supply Chain",
|
|
19
20
|
description: "Pro global supply chain evidence from filings, company announcements, calls and news, with trust tiers, original quotes, native units, four-hop graphs, ranked paths and a free preview.",
|