gloomberb 0.19.4 → 0.19.6
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/patches/@opentui%2Fcore@0.3.2.patch +86 -25
- package/src/api-client/equity-screener.ts +23 -0
- package/src/app/pane-runtime/index.tsx +2 -0
- package/src/app/pane-runtime/plugin-bindings.ts +10 -1
- package/src/app.tsx +63 -16
- package/src/cli/commands/command-utils.ts +4 -0
- package/src/cli/commands/market.ts +264 -33
- package/src/cli/commands/search.ts +22 -4
- package/src/cli/commands/ticker.ts +84 -39
- package/src/cli/currency-name-hint.ts +60 -0
- package/src/cli/glossary.ts +3 -3
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +25 -2
- package/src/cli/listing-arg.ts +12 -0
- package/src/cli/not-a-ticker.ts +5 -3
- package/src/cli/pane-functions/capabilities.ts +2 -0
- package/src/cli/pane-functions/catalog.ts +31 -5
- package/src/cli/pane-functions/function-help.ts +8 -5
- package/src/cli/pane-functions/headless.ts +11 -6
- package/src/cli/pane-functions/market-session.ts +6 -7
- package/src/cli/pane-functions/resolver.ts +75 -2
- package/src/cli/quote-answer.ts +9 -0
- package/src/cli/series-search.ts +4 -5
- package/src/cli/symbol-list.ts +54 -2
- package/src/cli/symbol-rows.ts +14 -2
- package/src/cli/ticker-resolution.ts +89 -20
- package/src/components/chart/composite/axis-overlays.tsx +60 -27
- package/src/components/chart/composite/composite-chart.tsx +118 -63
- package/src/components/chart/composite/cursor-source.ts +111 -0
- package/src/components/chart/composite/format.ts +168 -6
- package/src/components/chart/composite/legend.tsx +8 -4
- package/src/components/chart/composite/panel-bitmap.ts +28 -2
- package/src/components/chart/composite/panel-labels.ts +20 -1
- package/src/components/chart/composite/panel-surface.tsx +201 -92
- package/src/components/chart/composite/price-axis-labels.tsx +92 -46
- package/src/components/chart/composite/price-series.ts +31 -8
- package/src/components/chart/composite/scene.ts +154 -59
- package/src/components/chart/composite/series-axis-tags.tsx +4 -2
- package/src/components/chart/composite/time-axis.ts +30 -7
- package/src/components/chart/composite/time-scale.ts +211 -56
- package/src/components/chart/composite/types.ts +11 -1
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +32 -12
- package/src/components/chart/curve/curve-surface.tsx +5 -2
- package/src/components/chart/curve/model.ts +4 -1
- package/src/components/chart/native/use-bitmap-metrics.ts +81 -0
- package/src/components/chart/static/series.ts +3 -0
- package/src/components/command-bar/commands/collection-list.ts +81 -0
- package/src/components/command-bar/commands/direct/index.ts +6 -0
- package/src/components/command-bar/commands/registry.ts +8 -0
- package/src/components/command-bar/layout-items/current-layout.ts +22 -1
- package/src/components/command-bar/layout-items/focused-pane.ts +22 -1
- package/src/components/command-bar/pane-templates/items.ts +19 -3
- package/src/components/command-bar/pane-templates/workflow.ts +5 -0
- package/src/components/command-bar/routes/root/results.ts +23 -3
- package/src/components/command-bar/routes/root/selection.ts +4 -2
- package/src/components/command-bar/routes/root/shortcut-feedback.ts +1 -1
- package/src/components/command-bar/routes/root/shortcut-items.ts +3 -4
- package/src/components/command-bar/routes/root/shortcuts.ts +58 -14
- package/src/components/command-bar/routes/root/ticker-first.ts +32 -0
- package/src/components/command-bar/surface/environment.ts +2 -0
- package/src/components/command-bar/view-model.ts +7 -0
- package/src/components/command-bar/workflow/ops.ts +2 -1
- package/src/components/command-bar/workflow/tickers.ts +20 -0
- package/src/components/layout/shell/active-drag.ts +38 -7
- package/src/components/layout/shell/drag/magnets.ts +106 -0
- package/src/components/layout/shell/menu.ts +15 -1
- package/src/components/layout/shell/pane/actions.ts +4 -0
- package/src/components/layout/shell/ticker-link-menu.ts +12 -3
- package/src/components/layout/status-bar.tsx +20 -0
- package/src/components/layout/window-controls.tsx +96 -35
- package/src/components/layout/window-fullscreen.ts +20 -0
- package/src/components/onboarding/onboarding-keyboard.ts +5 -1
- package/src/components/onboarding/onboarding-wizard.tsx +15 -4
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +8 -5
- package/src/components/onboarding/use-onboarding-progress.ts +20 -1
- package/src/components/price-sparkline/view.tsx +14 -6
- package/src/components/quote-flash.ts +36 -32
- package/src/components/ticker/badge/index.tsx +8 -4
- package/src/components/ticker/badge/list.tsx +23 -7
- package/src/components/ui/column-grid.tsx +8 -2
- package/src/components/ui/data-table/opentui/model.ts +4 -1
- package/src/components/ui/tabs.tsx +5 -2
- package/src/core/state/app/layout.ts +18 -3
- package/src/core/state/app/state.ts +2 -0
- package/src/core/state/app/types.ts +5 -0
- package/src/data/config/layout.ts +3 -0
- package/src/data/config/store/normalize.ts +39 -4
- package/src/i18n/es.ts +10 -0
- package/src/i18n/ja.ts +10 -0
- package/src/i18n/ko.ts +10 -0
- package/src/i18n/zh-cn.ts +10 -0
- package/src/i18n/zh-tw.ts +10 -0
- package/src/layout/pane-manager/floating-placement.ts +7 -4
- package/src/layout/pane-manager/floating.ts +5 -2
- package/src/market-data/bond-funds.ts +19 -0
- package/src/market-data/coordinator/events.ts +17 -1
- package/src/market-data/frame-scheduler.ts +47 -10
- package/src/market-data/frame-wake.ts +74 -0
- package/src/market-data/futures-board.ts +7 -6
- package/src/market-data/futures-contract.ts +14 -3
- package/src/market-data/hooks.tsx +12 -3
- package/src/market-data/market/freshness.ts +18 -0
- package/src/market-data/market/status.ts +15 -2
- package/src/market-data/performance.ts +78 -9
- package/src/market-data/request-types.ts +6 -3
- package/src/plugins/builtin/alerts/cli.ts +2 -1
- package/src/plugins/builtin/analytics/risk-evidence.ts +1 -0
- package/src/plugins/builtin/attention/evidence.ts +1 -1
- package/src/plugins/builtin/awards/client.ts +1 -1
- package/src/plugins/builtin/awards/evidence.ts +1 -1
- package/src/plugins/builtin/awards/pane.tsx +2 -1
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/index.tsx +1 -1
- package/src/plugins/builtin/bond-calculator/math.ts +1 -1
- package/src/plugins/builtin/bond-calculator/model.ts +14 -5
- package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/broker-manager/footer.ts +3 -2
- package/src/plugins/builtin/broker-manager/index.tsx +2 -1
- package/src/plugins/builtin/broker-manager/keyboard.ts +2 -1
- package/src/plugins/builtin/buildout/cells.tsx +25 -45
- package/src/plugins/builtin/buildout/detail/company.tsx +3 -3
- package/src/plugins/builtin/buildout/detail/index.tsx +1 -1
- package/src/plugins/builtin/buildout/detail/intel.tsx +4 -7
- package/src/plugins/builtin/buildout/detail/site.tsx +4 -4
- package/src/plugins/builtin/buildout/detail/ui.tsx +39 -38
- package/src/plugins/builtin/buildout/format.ts +23 -1
- package/src/plugins/builtin/buildout/model/types.ts +1 -0
- package/src/plugins/builtin/buildout/pane/index.tsx +2 -8
- package/src/plugins/builtin/buildout/table-model.ts +12 -4
- package/src/plugins/builtin/catalysts/evidence.ts +1 -1
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +1 -0
- package/src/plugins/builtin/cds/index.tsx +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +40 -1
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +28 -3
- package/src/plugins/builtin/cloud-tweets/table.tsx +3 -2
- package/src/plugins/builtin/comment-letters/client.ts +2 -1
- package/src/plugins/builtin/company-kpis/client.ts +1 -1
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -1
- package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +3 -2
- package/src/plugins/builtin/correlation/headless.ts +3 -2
- package/src/plugins/builtin/cot/headless.ts +9 -3
- package/src/plugins/builtin/cot/model.ts +44 -3
- package/src/plugins/builtin/credit-documents/client.ts +1 -1
- package/src/plugins/builtin/credit-documents/evidence.ts +1 -1
- package/src/plugins/builtin/credit-documents/pane.tsx +2 -1
- package/src/plugins/builtin/crypto-board/pane.tsx +5 -4
- package/src/plugins/builtin/debt-maturities/headless.ts +11 -2
- package/src/plugins/builtin/debt-maturities/model.ts +66 -0
- package/src/plugins/builtin/debt-maturities/pane.tsx +23 -4
- package/src/plugins/builtin/earnings-calls/pane.tsx +1 -1
- package/src/plugins/builtin/earnings-ripple/index.tsx +6 -1
- package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +30 -6
- package/src/plugins/builtin/econ/fred-catalog.ts +5 -5
- package/src/plugins/builtin/econ/print-watch.ts +3 -1
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +4 -16
- package/src/plugins/builtin/equity-screener/headless.ts +4 -2
- package/src/plugins/builtin/equity-screener/ideas.ts +67 -3
- package/src/plugins/builtin/equity-screener/model.ts +180 -12
- package/src/plugins/builtin/equity-screener/pane.tsx +52 -12
- package/src/plugins/builtin/equity-screener/screen-check.ts +7 -4
- package/src/plugins/builtin/equity-screener/watchlist.ts +33 -0
- package/src/plugins/builtin/futures/series.ts +16 -1
- package/src/plugins/builtin/futures-curve/client.ts +19 -0
- package/src/plugins/builtin/futures-curve/headless.ts +52 -13
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +77 -6
- package/src/plugins/builtin/futures-curve/pane.tsx +19 -3
- package/src/plugins/builtin/fx-matrix/headless.ts +4 -2
- package/src/plugins/builtin/fx-matrix/index.tsx +37 -3
- package/src/plugins/builtin/fx-matrix/pairs.ts +15 -0
- package/src/plugins/builtin/gpu/headless.ts +2 -1
- package/src/plugins/builtin/help/function-card.tsx +2 -1
- package/src/plugins/builtin/help/index.tsx +2 -1
- package/src/plugins/builtin/insider/display.ts +45 -6
- package/src/plugins/builtin/ipo-calendar/model.ts +2 -0
- package/src/plugins/builtin/iv-history/client.ts +2 -1
- package/src/plugins/builtin/iv-history/headless.ts +2 -1
- package/src/plugins/builtin/jobs/pages.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/headless.ts +2 -1
- package/src/plugins/builtin/macro-day/client.ts +41 -0
- package/src/plugins/builtin/macro-day/headless.ts +19 -9
- package/src/plugins/builtin/macro-day/model.ts +3 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +2 -1
- package/src/plugins/builtin/market-movers/index.tsx +4 -3
- package/src/plugins/builtin/members/client.ts +1 -1
- package/src/plugins/builtin/mna/distress/client.ts +1 -0
- package/src/plugins/builtin/mna/distress/headless.ts +1 -0
- package/src/plugins/builtin/mna/pane.tsx +4 -1
- package/src/plugins/builtin/options/market-reference.ts +1 -1
- package/src/plugins/builtin/options/open-interest-as-of.ts +3 -1
- package/src/plugins/builtin/options/view.tsx +2 -1
- package/src/plugins/builtin/options-calculator/evidence.ts +1 -1
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/csp-screen.ts +8 -4
- package/src/plugins/builtin/options-scenario/csp.ts +28 -9
- package/src/plugins/builtin/options-scenario/evidence.ts +5 -4
- package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
- package/src/plugins/builtin/perps/client.ts +1 -1
- package/src/plugins/builtin/perps/pane.tsx +3 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +17 -0
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +2 -1
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +7 -3
- package/src/plugins/builtin/portfolio-list/use-throttled-memo.ts +10 -19
- package/src/plugins/builtin/rate-path/headless.ts +24 -10
- package/src/plugins/builtin/research/analyst-model.ts +1 -0
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +2 -1
- package/src/plugins/builtin/research/event-model.ts +10 -3
- package/src/plugins/builtin/research/events-headless.ts +20 -2
- package/src/plugins/builtin/research/index.tsx +1 -0
- package/src/plugins/builtin/research/relative-valuation-currency.ts +1 -1
- package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -1
- package/src/plugins/builtin/research-search/command-bar-search.ts +3 -1
- package/src/plugins/builtin/research-search/snippet.ts +1 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +3 -2
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/sec/command-bar-search.ts +3 -2
- package/src/plugins/builtin/sec/fund-facts.ts +17 -1
- package/src/plugins/builtin/sec/index.tsx +8 -5
- package/src/plugins/builtin/sec/row-summaries.ts +28 -12
- package/src/plugins/builtin/shared/members-menu.tsx +103 -38
- package/src/plugins/builtin/short-interest/publications-model.ts +22 -1
- package/src/plugins/builtin/short-interest/publications-pane.tsx +13 -4
- package/src/plugins/builtin/short-interest/watch-client.ts +2 -1
- package/src/plugins/builtin/short-interest/watch-model.ts +1 -1
- package/src/plugins/builtin/social-mentions/client.ts +2 -1
- package/src/plugins/builtin/supply-chain/client.ts +1 -1
- package/src/plugins/builtin/supply-chain/evidence.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -1
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +1 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +24 -4
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +1 -1
- package/src/plugins/builtin/time-sales/client.ts +1 -0
- package/src/plugins/builtin/time-sales/pane.tsx +3 -2
- package/src/plugins/builtin/trace-bonds/client.ts +7 -4
- package/src/plugins/builtin/trace-bonds/index.tsx +1 -1
- package/src/plugins/builtin/vol-surface/client.ts +2 -1
- package/src/plugins/builtin/volatility/client.ts +6 -1
- package/src/plugins/builtin/volatility/headless.ts +0 -1
- package/src/plugins/builtin/yield-curve/curves.ts +15 -0
- package/src/plugins/builtin/yield-curve/headless.ts +9 -2
- package/src/plugins/builtin/yield-curve/index.tsx +5 -8
- package/src/plugins/host-modules.ts +22 -3
- package/src/plugins/host-smoke.ts +6 -3
- package/src/portfolio/collection-name.ts +19 -0
- package/src/portfolio/column-values.ts +76 -10
- package/src/renderers/browser/http-proxy-transport.ts +78 -8
- package/src/renderers/cloudflare/http-proxy.ts +13 -2
- package/src/renderers/cloudflare/proxy-session.ts +47 -24
- package/src/renderers/cloudflare/worker.ts +15 -2
- package/src/renderers/desktop/geometry.ts +279 -0
- package/src/renderers/desktop/screen-setup.ts +246 -0
- package/src/renderers/desktop/sequential-window-host.ts +179 -0
- package/src/renderers/desktop/test-utils.ts +71 -0
- package/src/renderers/desktop/window-controller.ts +433 -0
- package/src/renderers/desktop/window-host.ts +70 -0
- package/src/renderers/desktop/window-layouts.ts +630 -0
- package/src/renderers/dom/data-frames.ts +15 -4
- package/src/renderers/dom/host/box.tsx +204 -176
- package/src/renderers/dom/host/style.ts +49 -20
- package/src/renderers/dom/host/text.tsx +3 -2
- package/src/renderers/electrobun/bun/application-menu/click.ts +1 -0
- package/src/renderers/electrobun/bun/application-menu/index.ts +4 -1
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +19 -8
- package/src/renderers/electrobun/bun/desktop/backend.ts +322 -19
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +83 -61
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +29 -15
- package/src/renderers/electrobun/bun/desktop/initialization.ts +30 -11
- package/src/renderers/electrobun/bun/desktop/relaunch.ts +9 -1
- package/src/renderers/electrobun/bun/desktop/screen-setup-file.ts +55 -0
- package/src/renderers/electrobun/bun/desktop/state-broadcaster.ts +44 -8
- package/src/renderers/electrobun/bun/desktop/windows-script.ts +9 -6
- package/src/renderers/electrobun/bun/desktop/workspace/index.ts +298 -97
- package/src/renderers/electrobun/bun/desktop/workspace/requests.ts +44 -6
- package/src/renderers/electrobun/bun/index.ts +4 -97
- package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +306 -0
- package/src/renderers/electrobun/bun/window/focus.ts +0 -25
- package/src/renderers/electrobun/bun/window/remembered-frame.ts +4 -82
- package/src/renderers/electrobun/bun/window/windows-native.ts +26 -1
- package/src/renderers/electrobun/shared/protocol.ts +50 -2
- package/src/renderers/electrobun/view/backend-rpc.ts +15 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +63 -3
- package/src/renderers/electrobun/view/main.tsx +13 -7
- package/src/renderers/electrobun/view/ui-host.tsx +7 -0
- package/src/renderers/electrobun/view/window-fullscreen.ts +10 -3
- package/src/series/fred-argument.ts +17 -0
- package/src/sources/provider-router/financial-routes.ts +7 -1
- package/src/sources/provider-router/index.ts +7 -1
- package/src/state/app/context/index.tsx +16 -2
- package/src/state/desktop-windows.ts +63 -0
- package/src/sync/other-window-tabs.ts +62 -0
- package/src/tickers/company-name-listing.ts +23 -3
- package/src/tickers/listing-fate.ts +147 -1
- package/src/tickers/terminal-codes.ts +5 -0
- package/src/time-series/price-units.ts +11 -0
- package/src/time-series/types.ts +6 -0
- package/src/types/config.ts +10 -1
- package/src/types/desktop-window.ts +71 -2
- package/src/types/financials.ts +4 -0
- package/src/types/headless.ts +19 -0
- package/src/types/plugin.ts +6 -0
- package/src/ui/host.tsx +2 -0
- package/src/ui/index.tsx +14 -13
- package/src/ui/same-props.ts +58 -0
- package/src/utils/cli-output.ts +33 -4
- package/src/utils/currency-names.ts +20 -0
- package/src/utils/currency-pair.ts +6 -0
- package/src/utils/exchange-rate-snapshot.ts +20 -2
- package/src/utils/format.ts +7 -2
- package/src/utils/futures-generic.ts +12 -0
- package/src/utils/fx-market-hours.ts +43 -0
- package/src/utils/http-proxy-upstream.ts +6 -2
- package/src/utils/plugin-proxy-hosts.json +0 -4
- package/src/utils/plugin-proxy-hosts.ts +22 -0
- package/src/utils/sec-filings.ts +7 -1
|
@@ -14,22 +14,30 @@ import { MAX_CORRELATION_TICKERS } from "../correlation/settings";
|
|
|
14
14
|
import { ROTATION_LIMIT } from "../relative-rotation/model";
|
|
15
15
|
import { SHORT_WATCH_LIMIT } from "../short-interest/watch-model";
|
|
16
16
|
|
|
17
|
-
/** One
|
|
17
|
+
/** One member of a theme, a fund or a screen's matches, in the order its list shows it. */
|
|
18
18
|
export interface MemberListing {
|
|
19
19
|
symbol: string;
|
|
20
20
|
name?: string | null;
|
|
21
21
|
exchange?: string | null;
|
|
22
|
+
/** The listing's quote currency; theme and fund members are US listings in dollars. */
|
|
23
|
+
currency?: string | null;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
/** The members a pane shows, and what to call them. */
|
|
25
27
|
export interface MemberList {
|
|
26
|
-
/** Names the members in dialog titles: a theme's name or a
|
|
28
|
+
/** Names the members in dialog titles: a theme's name, a fund's ticker or a screen's name. */
|
|
27
29
|
title: string;
|
|
28
30
|
/** The name the save dialog suggests. */
|
|
29
31
|
watchlistName: string;
|
|
30
32
|
members: readonly MemberListing[];
|
|
31
33
|
/** A search narrowing the list: what was typed and how many members the whole list has. */
|
|
32
34
|
search?: { query: string; total: number } | null;
|
|
35
|
+
/** What the dialogs and the report call them, plural: members unless said (a screen's are matches). */
|
|
36
|
+
noun?: string;
|
|
37
|
+
/** How many the whole list holds when `members` is its first part, as a screen's first page of matches is. */
|
|
38
|
+
total?: number;
|
|
39
|
+
/** Whether to offer the functions that take a list of tickers (RRG, CORR, SIW, RIPL); on unless false. */
|
|
40
|
+
openIn?: boolean;
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
interface MemberDestination {
|
|
@@ -98,23 +106,52 @@ export function memberDestinationChoices(symbols: readonly string[], destination
|
|
|
98
106
|
/**
|
|
99
107
|
* The dialog text for `count` distinct members. A search says what it matched
|
|
100
108
|
* and how many members the whole list has, so a saved or opened subset never
|
|
101
|
-
* reads as the whole fund
|
|
109
|
+
* reads as the whole fund; so does a list that is the first part of a larger
|
|
110
|
+
* one (`total`), as a screen's loaded matches are.
|
|
102
111
|
*/
|
|
103
|
-
function memberListText(list: Pick<MemberList, "title" | "search">, count: number) {
|
|
112
|
+
export function memberListText(list: Pick<MemberList, "title" | "search" | "noun" | "total">, count: number) {
|
|
113
|
+
const noun = list.noun ?? "members";
|
|
104
114
|
const query = list.search?.query.trim();
|
|
105
115
|
const search = query ? { query, total: list.search!.total } : null;
|
|
106
116
|
const saved = Math.min(count, MEMBER_WATCHLIST_LIMIT);
|
|
117
|
+
const total = Math.max(count, list.total ?? count);
|
|
107
118
|
return {
|
|
108
|
-
openTitle: search ? tf("Open {title}
|
|
109
|
-
: tf("Open {title}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
: tf("
|
|
119
|
+
openTitle: search ? tf("Open {title} {noun} matching \"{query}\" in", { title: list.title, noun, query: search.query })
|
|
120
|
+
: tf("Open {title} {noun} in", { title: list.title, noun }),
|
|
121
|
+
saveTitle: tf("Save {title} {noun} to", { title: list.title, noun }),
|
|
122
|
+
saveBody: saved < count
|
|
123
|
+
? search ? tf("The first {count} of the {matching} {noun} matching \"{query}\", as listed.", { count: saved, matching: count, noun, query: search.query })
|
|
124
|
+
: tf("The first {count} of {total} {noun}, as listed.", { count: saved, total, noun })
|
|
125
|
+
: search ? tf("{count} of {total} {noun} match \"{query}\".", { count, total: search.total, noun, query: search.query })
|
|
126
|
+
: saved < total ? tf("The first {count} of {total} {noun}, as listed.", { count: saved, total, noun })
|
|
127
|
+
: tf("All {count} {noun}.", { count, noun }),
|
|
115
128
|
};
|
|
116
129
|
}
|
|
117
130
|
|
|
131
|
+
/** The save dialog's choice that names a new watchlist rather than one already there. */
|
|
132
|
+
export const NEW_WATCHLIST_CHOICE = "watchlist:new";
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Where a list can be saved: a new watchlist, then each watchlist there is,
|
|
136
|
+
* in the order the app lists them, with how many tickers it holds.
|
|
137
|
+
*/
|
|
138
|
+
export function watchlistTargetChoices(
|
|
139
|
+
watchlists: readonly { id: string; name: string }[],
|
|
140
|
+
tickers: ReadonlyMap<string, TickerRecord>,
|
|
141
|
+
) {
|
|
142
|
+
const held = new Map<string, number>();
|
|
143
|
+
for (const ticker of tickers.values())
|
|
144
|
+
for (const id of ticker.metadata.watchlists) held.set(id, (held.get(id) ?? 0) + 1);
|
|
145
|
+
return [
|
|
146
|
+
{ id: NEW_WATCHLIST_CHOICE, label: t("New watchlist…") },
|
|
147
|
+
...watchlists.map((watchlist) => ({
|
|
148
|
+
id: watchlist.id,
|
|
149
|
+
label: watchlist.name,
|
|
150
|
+
detail: tf("{count} tickers", { count: held.get(watchlist.id) ?? 0 }),
|
|
151
|
+
})),
|
|
152
|
+
];
|
|
153
|
+
}
|
|
154
|
+
|
|
118
155
|
/** The requested name, numbered when a watchlist already has that name or id. */
|
|
119
156
|
export function uniqueWatchlistName(requested: string, watchlists: readonly { id: string; name: string }[]): string {
|
|
120
157
|
const base = requested.trim();
|
|
@@ -158,18 +195,20 @@ export function planMemberWatchlist(
|
|
|
158
195
|
}
|
|
159
196
|
continue;
|
|
160
197
|
}
|
|
161
|
-
// Theme and fund members are US listings quoted in dollars
|
|
162
|
-
// left to the ticker's profile,
|
|
163
|
-
|
|
198
|
+
// Theme and fund members are US listings quoted in dollars; a screen's
|
|
199
|
+
// matches say their currency. The sector is left to the ticker's profile,
|
|
200
|
+
// so a list never mixes two sector schemes.
|
|
201
|
+
create.push({ ticker: key, name: member.name || symbol, exchange, currency: member.currency?.trim() || "USD",
|
|
164
202
|
portfolios: [], watchlists: [watchlistId], positions: [], custom: {}, tags: [] });
|
|
165
203
|
}
|
|
166
204
|
return { create, update, count: seen.size };
|
|
167
205
|
}
|
|
168
206
|
|
|
169
207
|
/**
|
|
170
|
-
* Pane menu entries for a list of members (a theme's, a fund's
|
|
171
|
-
* RRG, CORR, SIW or RIPL, or save them
|
|
172
|
-
*
|
|
208
|
+
* Pane menu entries for a list of members (a theme's, a fund's, a screen's
|
|
209
|
+
* matches): open them in RRG, CORR, SIW or RIPL, or save them to a new
|
|
210
|
+
* watchlist or one already there. Functions of disabled plugins are left out;
|
|
211
|
+
* each destination gets as many as it takes.
|
|
173
212
|
*/
|
|
174
213
|
export function useMembersMenu(registrationId: string, list: MemberList | null) {
|
|
175
214
|
const dialog = useOptionalDialog();
|
|
@@ -185,8 +224,9 @@ export function useMembersMenu(registrationId: string, list: MemberList | null)
|
|
|
185
224
|
registry.paneTemplates.has(destination.templateId)
|
|
186
225
|
&& !registry.getDisabledPaneTemplateOwner?.(destination.templateId, disabledPlugins)
|
|
187
226
|
));
|
|
188
|
-
const choices = memberDestinationChoices(symbols, destinations);
|
|
227
|
+
const choices = list.openIn === false ? [] : memberDestinationChoices(symbols, destinations);
|
|
189
228
|
const text = memberListText(list, symbols.length);
|
|
229
|
+
const noun = list.noun ?? "members";
|
|
190
230
|
const openIn = () => {
|
|
191
231
|
void dialog.prompt<string>({
|
|
192
232
|
closeOnClickOutside: true,
|
|
@@ -198,16 +238,21 @@ export function useMembersMenu(registrationId: string, list: MemberList | null)
|
|
|
198
238
|
if (choice) createPaneFromTemplate(choice.id, { symbols: choice.symbols, arg: formatTickerListInput(choice.symbols) });
|
|
199
239
|
}).catch(logFailure("shared.members-menu", "Open members in a function failed"));
|
|
200
240
|
};
|
|
201
|
-
const
|
|
241
|
+
const saveToWatchlist = async (target: { name: string } | { id: string }) => {
|
|
202
242
|
// The writes hold the app for about a second with a hundred names; let the dialog close on screen first.
|
|
203
243
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
244
|
+
let watchlist = "id" in target ? getState().config.watchlists.find((entry) => entry.id === target.id) : undefined;
|
|
245
|
+
if ("name" in target) {
|
|
246
|
+
const requested = uniqueWatchlistName(target.name, getState().config.watchlists);
|
|
247
|
+
await createFormCollectionActions({ dataProvider: registry.marketData, dispatch, getState, pluginRegistry: registry,
|
|
248
|
+
tickerRepository: registry.tickerRepository }, (body, options) => {
|
|
249
|
+
if (options?.type === "error") notify({ body, type: "error" });
|
|
250
|
+
}).createWatchlist(requested);
|
|
251
|
+
watchlist = getState().config.watchlists.find((entry) => entry.name === requested);
|
|
252
|
+
if (!watchlist) throw new Error(t("The watchlist was not created."));
|
|
253
|
+
}
|
|
254
|
+
if (!watchlist) throw new Error(t("The watchlist is no longer there."));
|
|
255
|
+
const name = watchlist.name;
|
|
211
256
|
const plan = planMemberWatchlist(getState().tickers, watchlist.id, list.members);
|
|
212
257
|
// One ticker that fails to save leaves the others on the list; the toast says how many made it.
|
|
213
258
|
let failed = 0;
|
|
@@ -238,23 +283,43 @@ export function useMembersMenu(registrationId: string, list: MemberList | null)
|
|
|
238
283
|
}
|
|
239
284
|
for (const ticker of created) registry.events.emit("ticker:added", { symbol: ticker.metadata.ticker, ticker });
|
|
240
285
|
notify(failed
|
|
241
|
-
? { type: "error", body: tf("Saved {saved} of {count}
|
|
242
|
-
: { type: "success", body: tf("Saved {count}
|
|
286
|
+
? { type: "error", body: tf("Saved {saved} of {count} {noun} to {name}. {failed} could not be added.", { saved: plan.count - failed, count: plan.count, noun, name, failed }) }
|
|
287
|
+
: { type: "success", body: tf("Saved {count} {noun} to {name}.", { count: plan.count, noun, name }) });
|
|
288
|
+
};
|
|
289
|
+
const save = (target: { name: string } | { id: string }) => {
|
|
290
|
+
saveToWatchlist(target).catch((error: unknown) => {
|
|
291
|
+
notify({ type: "error", body: error instanceof Error ? error.message : t("The watchlist was not saved.") });
|
|
292
|
+
});
|
|
293
|
+
};
|
|
294
|
+
const nameNewWatchlist = () => {
|
|
295
|
+
// 54 columns fill the dialog; the prompt's default field is wider and runs past its frame.
|
|
296
|
+
void dialog.prompt<string>({
|
|
297
|
+
closeOnClickOutside: true,
|
|
298
|
+
content: (context: PromptContext<string>) => <TextPromptDialog {...context} title={t("New Watchlist")}
|
|
299
|
+
body={[text.saveBody]} label={t("Name")} initialValue={list.watchlistName} confirmLabel={t("Save")} width={54} />,
|
|
300
|
+
}).then((name) => {
|
|
301
|
+
if (name?.trim()) save({ name });
|
|
302
|
+
}).catch(logFailure("shared.members-menu", "Open save members as watchlist prompt failed"));
|
|
243
303
|
};
|
|
244
304
|
return [
|
|
245
305
|
...(choices.length ? [{ id: "members-open-in", label: t("Open Members In…"), onSelect: openIn }] : []),
|
|
246
|
-
{ id: "members-save-watchlist", label: t("Save
|
|
247
|
-
//
|
|
306
|
+
{ id: "members-save-watchlist", label: t("Save to Watchlist…"), onSelect: () => {
|
|
307
|
+
// With no watchlist yet there is nothing to choose: the name comes first.
|
|
308
|
+
const watchlists = getState().config.watchlists;
|
|
309
|
+
if (!watchlists.length) {
|
|
310
|
+
nameNewWatchlist();
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
248
313
|
void dialog.prompt<string>({
|
|
249
314
|
closeOnClickOutside: true,
|
|
250
|
-
content: (context: PromptContext<string>) => <
|
|
251
|
-
|
|
252
|
-
}).then((
|
|
253
|
-
if (!
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
});
|
|
257
|
-
}).catch(logFailure("shared.members-menu", "Open save members
|
|
315
|
+
content: (context: PromptContext<string>) => <ChoiceDialog {...context} title={text.saveTitle}
|
|
316
|
+
choices={watchlistTargetChoices(watchlists, getState().tickers)} footer={text.saveBody} />,
|
|
317
|
+
}).then((id) => {
|
|
318
|
+
if (!id) return;
|
|
319
|
+
// The name prompt opens once the choice has closed and handed focus back, so its field takes the keys.
|
|
320
|
+
if (id === NEW_WATCHLIST_CHOICE) setTimeout(nameNewWatchlist, 0);
|
|
321
|
+
else save({ id });
|
|
322
|
+
}).catch(logFailure("shared.members-menu", "Open save members to watchlist choice failed"));
|
|
258
323
|
} },
|
|
259
324
|
];
|
|
260
325
|
}, [createPaneFromTemplate, dialog, disabledPlugins, dispatch, getState, list, notify]);
|
|
@@ -32,7 +32,28 @@ const ATS_COLUMNS: PublicationColumn[] = [
|
|
|
32
32
|
{ id: "atsTrades", label: "ATS TRADES", detailLabel: "ATS trades", width: 14, align: "right", format: shares },
|
|
33
33
|
{ id: "nonAtsTrades", label: "NON-ATS TRADES", detailLabel: "Non-ATS trades", width: 16, align: "right", format: shares },
|
|
34
34
|
];
|
|
35
|
-
|
|
35
|
+
/**
|
|
36
|
+
* What every fail row names: one CUSIP and one security, as a ticker with a
|
|
37
|
+
* single issue has. A shared value is said once above the table (and in the
|
|
38
|
+
* export's notes), not on every row; a ticker with several CUSIPs, or a
|
|
39
|
+
* security the filings spell differently over time, keeps the column.
|
|
40
|
+
*/
|
|
41
|
+
interface FailIdentity {
|
|
42
|
+
cusip: string | null;
|
|
43
|
+
security: string | null;
|
|
44
|
+
}
|
|
45
|
+
const NO_IDENTITY: FailIdentity = { cusip: null, security: null };
|
|
46
|
+
export function sharedFailIdentity(rows: readonly PublicationRow[]): FailIdentity {
|
|
47
|
+
const shared = (id: "cusip" | "description"): string | null => {
|
|
48
|
+
const values = new Set(rows.map((row) => row[id]));
|
|
49
|
+
const [value] = values;
|
|
50
|
+
return values.size === 1 && typeof value === "string" && value.trim() ? value : null;
|
|
51
|
+
};
|
|
52
|
+
return rows.length ? { cusip: shared("cusip"), security: shared("description") } : NO_IDENTITY;
|
|
53
|
+
}
|
|
54
|
+
export const publicationColumns = (kind: PublicationKind, shared: FailIdentity = NO_IDENTITY) => kind === "ftd"
|
|
55
|
+
? FTD_COLUMNS.filter((column) => !(column.id === "cusip" && shared.cusip) && !(column.id === "description" && shared.security))
|
|
56
|
+
: ATS_COLUMNS;
|
|
36
57
|
export function publicationRows(data: PublicationPayload): PublicationRow[] {
|
|
37
58
|
return data.history.toReversed().map((row) => "cusip" in row
|
|
38
59
|
? { ...row, id: `${row.date}:${row.cusip}` }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useMemo } from "react";
|
|
2
|
-
import { DataTableStackView, EmptyState, PaneStatusBody, usePaneNoticeFooter, usePaneStatusLinkFooter, type DataTableCell } from "../../../components";
|
|
2
|
+
import { DataTableStackView, EmptyState, PaneStatusBody, StatGrid, usePaneNoticeFooter, usePaneStatusLinkFooter, type DataTableCell, type StatItem } from "../../../components";
|
|
3
3
|
import { ageFooterSegment } from "../../../components/layout/pane/footer";
|
|
4
4
|
import { DetailReader } from "../../../components/reader/detail-reader";
|
|
5
5
|
import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
@@ -10,7 +10,7 @@ import type { PaneProps } from "../../../types/plugin";
|
|
|
10
10
|
import { isKnownNonUsEquityTicker } from "../../../utils/sec";
|
|
11
11
|
import { listingIdentity } from "../shared/ticker-request";
|
|
12
12
|
import { cachedPublication, loadPublication, type PublicationKind } from "./publications-client";
|
|
13
|
-
import { publicationCell, publicationColumns, publicationRows, type PublicationColumn, type PublicationRow } from "./publications-model";
|
|
13
|
+
import { publicationCell, publicationColumns, publicationRows, sharedFailIdentity, type PublicationColumn, type PublicationRow } from "./publications-model";
|
|
14
14
|
|
|
15
15
|
function renderCell(row: PublicationRow, column: PublicationColumn, _index: number, state: { selected: boolean }): DataTableCell {
|
|
16
16
|
const value = row[column.id] ?? null;
|
|
@@ -27,7 +27,14 @@ export function ShortSidePublicationPane({ kind, width, height, focused }: Pick<
|
|
|
27
27
|
});
|
|
28
28
|
const data = resource.data?.payload;
|
|
29
29
|
const rows = useMemo(() => data ? publicationRows(data) : [], [data]);
|
|
30
|
-
const
|
|
30
|
+
const shared = useMemo(() => kind === "ftd" ? sharedFailIdentity(rows) : undefined, [kind, rows]);
|
|
31
|
+
// The open detail names every fact of its row; the table drops what every row shares.
|
|
32
|
+
const detailColumns = publicationColumns(kind);
|
|
33
|
+
const columns = publicationColumns(kind, shared);
|
|
34
|
+
const identity = useMemo<StatItem[]>(() => [
|
|
35
|
+
...(shared?.cusip ? [{ id: "cusip", label: "CUSIP", value: shared.cusip }] : []),
|
|
36
|
+
...(shared?.security ? [{ id: "security", label: "Security", value: shared.security }] : []),
|
|
37
|
+
], [shared]);
|
|
31
38
|
const [selectedId, setSelectedId] = usePluginPaneState<string | null>(`${kind}:selected`, null);
|
|
32
39
|
const [openId, setOpenId] = usePluginPaneState<string | null>(`${kind}:open`, null);
|
|
33
40
|
const rowKey = (row: PublicationRow) => `${symbol}:${row.id}`;
|
|
@@ -51,12 +58,14 @@ export function ShortSidePublicationPane({ kind, width, height, focused }: Pick<
|
|
|
51
58
|
{data ? <DataTableStackView<PublicationRow, PublicationColumn>
|
|
52
59
|
focused={focused} rootWidth={width} rootHeight={height} columns={columns} items={rows} freezeFirstColumn
|
|
53
60
|
sortColumnId={null} sortDirection="desc" emptyStateTitle={`No published ${subject} for this stock.`}
|
|
61
|
+
rootBefore={identity.length ? <StatGrid items={identity} width={width} /> : undefined}
|
|
62
|
+
getExportMetadata={() => [...(shared?.cusip ? [["cusip", shared.cusip]] : []), ...(shared?.security ? [["security", shared.security]] : [])]}
|
|
54
63
|
getItemKey={rowKey} renderCell={renderCell} resetScrollKey={`${kind}:${symbol}`}
|
|
55
64
|
selection={{ kind: "index", selectedIndex: rows.length ? selectedIndex : -1, onChange: (index) => setSelectedId(rows[index] ? rowKey(rows[index]!) : null) }}
|
|
56
65
|
onActivate={(row) => setOpenId(rowKey(row))} detailOpen={!!openRow} onBack={() => setOpenId(null)}
|
|
57
66
|
detailTitle={openRow ? kind === "ftd" ? `${openRow.date} · ${openRow.cusip}` : `Week of ${openRow.date}` : undefined}
|
|
58
67
|
detailContent={openRow ? <DetailReader width={width} resetScrollKey={rowKey(openRow)} facts={[
|
|
59
|
-
...
|
|
68
|
+
...detailColumns.filter((column) => column.id !== "date" && column.id !== "cusip").map((column) => ({ label: column.detailLabel,
|
|
60
69
|
value: openRow[column.id] == null ? "Not published" : typeof openRow[column.id] === "number" && column.id !== "atsSharePercent" && column.id !== "price"
|
|
61
70
|
? Number(openRow[column.id]).toLocaleString("en-US", { maximumFractionDigits: 6 }) : publicationCell(column, openRow[column.id] ?? null) })),
|
|
62
71
|
{ label: "Published through", value: data.sourceAsOf ?? "--" },
|
|
@@ -9,6 +9,7 @@ import { loadShortInterest, type ShortInterestResult } from "./client";
|
|
|
9
9
|
import { type CurrentFloat, type SettlementFloatStatistics, withPercentFloat } from "./model";
|
|
10
10
|
import { buildShortWatchRow, type ShortWatchRow } from "./watch-model";
|
|
11
11
|
import type { ShortInterestRecord } from "./types";
|
|
12
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
12
13
|
|
|
13
14
|
const CONCURRENCY = 6;
|
|
14
15
|
|
|
@@ -47,7 +48,7 @@ async function loadFloats(
|
|
|
47
48
|
): Promise<FloatSnapshot[]> {
|
|
48
49
|
const entries = await Promise.resolve()
|
|
49
50
|
.then(() => loadSnapshots(symbols.map((symbol) => ({ symbol, exchange: "" })), options))
|
|
50
|
-
.catch((
|
|
51
|
+
.catch(logFailure("short-interest.watch-client", "Load float snapshots failed", []));
|
|
51
52
|
return symbols.map((_symbol, index) => {
|
|
52
53
|
const entry = entries[index];
|
|
53
54
|
const fundamentals = (entry ? resolveEntryValue(entry) : null)?.fundamentals;
|
|
@@ -26,7 +26,7 @@ const LISTED_TYPES = new Set(["", "STK", "EQUITY", "COMMONSTOCK", "ADR", "ETF",
|
|
|
26
26
|
export type ShortWatchSetup = "crowded-rising" | "crowded";
|
|
27
27
|
|
|
28
28
|
export function setupLabel(setup: ShortWatchSetup | null): string {
|
|
29
|
-
return setup === "crowded-rising" ? "Crowded,
|
|
29
|
+
return setup === "crowded-rising" ? "Crowded, px up" : setup === "crowded" ? "Crowded" : "";
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export interface ShortWatchRow {
|
|
@@ -5,6 +5,7 @@ import type { SocialMentionDayPosts, SocialMentionPost, SocialMentionsPayload, S
|
|
|
5
5
|
import { createPluginCache, savedCopyForTransientFailure } from "../../../data/plugin-cache";
|
|
6
6
|
import { CLOUD_SESSION_REQUIRED } from "../shared/research-cloud-session";
|
|
7
7
|
import { unavailableOnServer } from "../shared/cloud-resource";
|
|
8
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
8
9
|
|
|
9
10
|
export const socialMentionsCache = createPluginCache<SocialMentionsPayload>({
|
|
10
11
|
kind: "social-mentions", source: "gloom-cloud", schemaVersion: 1,
|
|
@@ -71,7 +72,7 @@ export function cachedSocialMentions(symbol: string, range: SocialMentionsRange)
|
|
|
71
72
|
const cached = socialMentionsCache.get(cacheKey(symbol, range), { allowExpired: true });
|
|
72
73
|
if (!cached) return null;
|
|
73
74
|
try { return { payload: validateSocialMentions(cached.data, symbol, range), stale: false, refreshError: null }; }
|
|
74
|
-
catch { return null; }
|
|
75
|
+
catch (error) { return logFailure("social-mentions.client", "Validate cached social mentions failed", null)(error); }
|
|
75
76
|
}
|
|
76
77
|
export async function loadSocialMentions(symbol: string, range: SocialMentionsRange, force = false): Promise<SocialMentionsResource> {
|
|
77
78
|
// A refusal (a signed-out session, any other 4xx but 408 and 429) or a reply that fails validation shows as itself.
|
|
@@ -22,7 +22,7 @@ const date = (value: unknown) => text(value) && /^\d{4}-\d{2}-\d{2}$/.test(value
|
|
|
22
22
|
const timestamp = (value: unknown) => text(value) && Number.isFinite(Date.parse(value));
|
|
23
23
|
const tier = (value: unknown) => Number.isInteger(value) && Number(value) >= 1 && Number(value) <= 6;
|
|
24
24
|
const claim = (value: unknown) => ["disclosed", "company_confirmed", "reported", "rumored"].includes(String(value));
|
|
25
|
-
const url = (value: unknown) => { try { return text(value) && ["http:", "https:"].includes(new URL(value).protocol); } catch { return false; } };
|
|
25
|
+
const url = (value: unknown) => { try { return text(value) && ["http:", "https:"].includes(new URL(value).protocol); } catch { /* Intentional ignore: malformed URLs fail this web link field validator. */ return false; } };
|
|
26
26
|
function evidence(value: SupplyEvidenceItem): boolean {
|
|
27
27
|
return !!value && text(value.id) && tier(value.tier) && claim(value.claimType) && url(value.url)
|
|
28
28
|
&& text(value.title) && text(value.publisher) && timestamp(value.publishedAt) && timestamp(value.fetchedAt)
|
|
@@ -70,7 +70,7 @@ export const supplyScreenshotEvidence: PaneScreenshotEvidenceHook<SupplyEvidence
|
|
|
70
70
|
// Return the validated payload: restricted quotes and glosses have been removed.
|
|
71
71
|
return { ...value, payload } as unknown as SupplyEvidence;
|
|
72
72
|
}
|
|
73
|
-
} catch { return null; }
|
|
73
|
+
} catch { /* Intentional ignore: invalid captured observations are rejected as evidence by returning null. */ return null; }
|
|
74
74
|
},
|
|
75
75
|
mismatches(evidence, { resolved, payload }) {
|
|
76
76
|
const settings = payload.config.layout.instances.find(entry => entry.instanceId === payload.paneId)?.settings;
|
|
@@ -26,6 +26,7 @@ import { isPlainKey } from "../../../utils/keyboard";
|
|
|
26
26
|
import { DATE_FIELD_EXAMPLES } from "../../../utils/calendar-date";
|
|
27
27
|
import { displayWidth } from "../../../utils/format";
|
|
28
28
|
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
29
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
29
30
|
|
|
30
31
|
const PATH_COLUMNS: DataTableColumn[] = [{ id: "route", label: "Route", width: 40, align: "left" }, { id: "relationships", label: "Relationships", width: 22, align: "left" }, { id: "hops", label: "Hops", width: 6, align: "right" }, { id: "score", label: "Score", width: 9, align: "right" }, { id: "confidence", label: "Confidence", width: 12, align: "right" }, { id: "exposure", label: "Estimated exposure", width: 35, align: "left" }];
|
|
31
32
|
const SOURCE_LABELS = { xbrl: "Structured filing", filing_text: "Filing text", press_release: "Company release", call: "Earnings call", news: "News", web: "Website", import: "Imported record" };
|
|
@@ -126,7 +127,7 @@ export function SupplyGraphPane({ symbol, tab, width, height, focused }: { symbo
|
|
|
126
127
|
const [visibleLinks, setVisibleLinks] = useState<string[]>([]);
|
|
127
128
|
const [inputsOpen, setInputsOpen] = useState(false);
|
|
128
129
|
const [snapshotSetting] = usePaneSettingValue<GraphPayload | null>("graphSnapshot", null);
|
|
129
|
-
const snapshot = useMemo(() => { try { return snapshotSetting ? validateGraph(snapshotSetting) : null; } catch { return null; } }, [snapshotSetting]);
|
|
130
|
+
const snapshot = useMemo(() => { try { return snapshotSetting ? validateGraph(snapshotSetting) : null; } catch (error) { return logFailure("supply-chain.graph-pane", "Validate supply chain graph snapshot failed", null)(error); } }, [snapshotSetting]);
|
|
130
131
|
const loader = useCallback((force: boolean) => snapshot ? Promise.resolve({ payload: snapshot, stale: false, refreshError: null }) : loadGraph(focus, target, options, accessKey, force), [focus, target, options, accessKey, snapshot]);
|
|
131
132
|
const resource = useAsyncResource(tab === "path" && !target ? null : loader, { initialData: () => cachedGraph(focus, target, options, accessKey), clearOnError: isAccessDenied });
|
|
132
133
|
const data = resource.data?.payload ?? null;
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
} from "./model";
|
|
37
37
|
import { RowEvidence } from "./row-evidence";
|
|
38
38
|
import { evidenceDate, evidenceLabel, isUnconfirmed, matchesSupplyOptions, supplyOptions, TIER_OPTIONS } from "./trust";
|
|
39
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
39
40
|
|
|
40
41
|
type Item = { kind: "edge"; row: SupplyRow } | { kind: "locked"; id: string };
|
|
41
42
|
const itemId = (item: Item) => item.kind === "edge" ? item.row.id : item.id;
|
|
@@ -183,7 +184,7 @@ function SupplyView({ symbol, width, height, focused }: Pick<PaneProps, "width"
|
|
|
183
184
|
const accessKey = `${session.requestKey}:${access.hasProAccess ? "full" : "preview"}`;
|
|
184
185
|
const openUpgrade = useCloudUpgradeAction("splc");
|
|
185
186
|
const [snapshotSetting] = usePaneSettingValue<SupplyChainPayload | null>("supplySnapshot", null);
|
|
186
|
-
const snapshot = useMemo(() => { try { return snapshotSetting ? validateSupplyChain(snapshotSetting) : null; } catch { return null; } }, [snapshotSetting]);
|
|
187
|
+
const snapshot = useMemo(() => { try { return snapshotSetting ? validateSupplyChain(snapshotSetting) : null; } catch (error) { return logFailure("supply-chain.pane", "Validate supply chain snapshot failed", null)(error); } }, [snapshotSetting]);
|
|
187
188
|
const [openingTab] = usePaneSettingValue("tab", "table");
|
|
188
189
|
const [savedTab, setTab] = usePluginPaneState<string>("supply:tab", openingTab);
|
|
189
190
|
const graphTab = savedTab === "graph" || savedTab === "path";
|
|
@@ -78,7 +78,7 @@ export const adrPairHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
78
78
|
return { sections: [], empty: `No price for ${missing}, so the pair cannot be compared.`, unavailableSymbols: [missing], errors };
|
|
79
79
|
}
|
|
80
80
|
const figures = adrPairFigures(comparison);
|
|
81
|
-
const rows = adrPairInputRows(comparison);
|
|
81
|
+
const rows = adrPairInputRows(comparison, quotes);
|
|
82
82
|
const kind = spotRateKind(homeCurrency);
|
|
83
83
|
return {
|
|
84
84
|
sections: [
|
|
@@ -2,7 +2,8 @@ import type { DepositaryPair, Quote, TickerFinancials } from "../../../../types/
|
|
|
2
2
|
import type { TickerRecord } from "../../../../types/ticker";
|
|
3
3
|
import { canonicalExchange, parsePublicTickerKey, publicTickerKey } from "../../../../utils/exchanges";
|
|
4
4
|
import { listingSuffixCandidate, listingSuffixVenue } from "../../../../sources/listing-symbols";
|
|
5
|
-
import { formatMarketPriceWithCurrency } from "../../../../market-data/market/format";
|
|
5
|
+
import { formatMarketPriceWithCurrency, liveQuoteFormatOptions, type MarketFormatOptions } from "../../../../market-data/market/format";
|
|
6
|
+
import { heldCurrencyUnit } from "../../../../utils/currency-units";
|
|
6
7
|
import { adrRatioText } from "../../../../utils/depositary-receipt";
|
|
7
8
|
import {
|
|
8
9
|
compareDepositaryPair, dollarPairLabel, formatPairRate, isReceiptSide, listingDepositaryPair, pairPriceInput, pairTimeText,
|
|
@@ -108,20 +109,39 @@ function sessionText(input: PairPriceInput): string {
|
|
|
108
109
|
return input.open ? "Open" : "Closed";
|
|
109
110
|
}
|
|
110
111
|
|
|
112
|
+
/**
|
|
113
|
+
* A leg's price written as the quote monitor writes the listing's: its
|
|
114
|
+
* instrument's own decimals (cents on a dollar price, $419.50 and never
|
|
115
|
+
* $419.5). The comparison reads a minor unit (GBp) in its currency, so the
|
|
116
|
+
* session prices the decimals come from are read in it too.
|
|
117
|
+
*/
|
|
118
|
+
function legPriceOptions(input: PairPriceInput, quote: Quote | null | undefined): MarketFormatOptions {
|
|
119
|
+
const divisor = quote?.currency ? heldCurrencyUnit(quote.currency).divisor : 1;
|
|
120
|
+
const inCurrency = (value: number | undefined) => value == null ? value : value / divisor;
|
|
121
|
+
return liveQuoteFormatOptions(
|
|
122
|
+
quote ? { ...quote, previousClose: inCurrency(quote.previousClose), regularClose: inCurrency(quote.regularClose), open: inCurrency(quote.open) } : null,
|
|
123
|
+
input.currency,
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
111
127
|
/** The inputs the figures come from, each with when it was set. */
|
|
112
|
-
export function adrPairInputRows(
|
|
128
|
+
export function adrPairInputRows(
|
|
129
|
+
comparison: DepositaryPairComparison,
|
|
130
|
+
quotes: { receipt: Quote | null | undefined; home: Quote | null | undefined },
|
|
131
|
+
now = Date.now(),
|
|
132
|
+
): AdrPairInputRow[] {
|
|
113
133
|
const { home, receipt, spot, ratio } = comparison;
|
|
114
134
|
const time = (value: number | null) => value == null ? "—" : pairTimeText(value, now).replace(/ UTC$/, "");
|
|
115
135
|
const kind = spotRateKind(home.currency);
|
|
116
136
|
return [
|
|
117
137
|
{
|
|
118
138
|
id: "home", listing: home.symbol, role: `Home, ${ratioCount(ratio)} per ADR`,
|
|
119
|
-
price: formatMarketPriceWithCurrency(home.price, home.currency, { currencyCode: true }),
|
|
139
|
+
price: formatMarketPriceWithCurrency(home.price, home.currency, { ...legPriceOptions(home, quotes.home), currencyCode: true }),
|
|
120
140
|
asOf: time(home.observedAt), session: sessionText(home), opens: home.symbol,
|
|
121
141
|
},
|
|
122
142
|
{
|
|
123
143
|
id: "receipt", listing: receipt.symbol, role: "ADR",
|
|
124
|
-
price: formatMarketPriceWithCurrency(receipt.price, receipt.currency), asOf: time(receipt.observedAt),
|
|
144
|
+
price: formatMarketPriceWithCurrency(receipt.price, receipt.currency, legPriceOptions(receipt, quotes.receipt)), asOf: time(receipt.observedAt),
|
|
125
145
|
session: sessionText(receipt), opens: receipt.symbol,
|
|
126
146
|
},
|
|
127
147
|
...spot ? [{
|
|
@@ -49,7 +49,7 @@ export function AdrPairResearchTab({ width, height, focused }: TickerResearchTab
|
|
|
49
49
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
50
50
|
|
|
51
51
|
const stats: StatItem[] = comparison ? adrPairFigures(comparison) : [];
|
|
52
|
-
const rows = comparison ? adrPairInputRows(comparison) : [];
|
|
52
|
+
const rows = comparison ? adrPairInputRows(comparison, { receipt: receiptQuote, home: homeQuote }) : [];
|
|
53
53
|
|
|
54
54
|
if (!legs) return <EmptyState title="No ADR pair for this listing." />;
|
|
55
55
|
const pending = (entry: typeof receiptEntry) => !entry || entry.phase === "loading" || entry.phase === "idle";
|
|
@@ -79,6 +79,7 @@ export function tapeRejection(body: string): string | null {
|
|
|
79
79
|
const value = JSON.parse(body) as { gaps?: unknown };
|
|
80
80
|
return Array.isArray(value?.gaps) && typeof value.gaps[0] === "string" ? value.gaps[0] : null;
|
|
81
81
|
} catch {
|
|
82
|
+
// Intentional ignore: an error body that is not JSON names no gap, so the request's own error stands.
|
|
82
83
|
return null;
|
|
83
84
|
}
|
|
84
85
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { Box } from "../../../ui";
|
|
3
3
|
import { usePaneSettingValue, useShortcut } from "../../../public/react";
|
|
4
4
|
import { createDataTableCsv } from "../../../components/data-table/export";
|
|
@@ -124,7 +124,8 @@ function TimeSalesView({ width, height, focused, symbol, exchange }: PaneProps &
|
|
|
124
124
|
...(!data.connected || resource.snapshotOnly ? [{ id: "snapshot", parts: [{ text: "snapshot", tone: "warning" as const }] }] : [])] : [] });
|
|
125
125
|
const quoteColumns = useMemo(() => dropColumnsToFit(QUOTES, width - 1, QUOTE_DROP_ORDER), [width]);
|
|
126
126
|
const columns = tab === "quotes" ? quoteColumns : TRADES;
|
|
127
|
-
|
|
127
|
+
// Kept between prints, so the tab strip skips the renders the tape gives the pane.
|
|
128
|
+
const selectTab = useCallback((value: string) => { setTab(value); setDetail(null); setSelected(null); }, [setTab]);
|
|
128
129
|
const { strip: tabStrip, rows: tabRows } = usePaneTabs({ tabs: TABS, activeValue: tab, onSelect: selectTab, focused: focused && !detail, dense: true });
|
|
129
130
|
const renderCell = (row: TapeRow, column: DataTableColumn): DataTableCell => {
|
|
130
131
|
if (row.trade) {
|
|
@@ -257,6 +257,9 @@ function bondId(raw: Record<string, unknown>, index: number): string {
|
|
|
257
257
|
function parseBond(raw: unknown, index: number): CorporateBond | null {
|
|
258
258
|
const record = recordOrNull(raw);
|
|
259
259
|
if (!record) return null;
|
|
260
|
+
// A price of zero is no sale (a cancelled or defaulted print): the bond is listed with no last sale, never one at 0.
|
|
261
|
+
const price = numericOrNull(record.lastSalePrice);
|
|
262
|
+
const sold = price == null || price > 0;
|
|
260
263
|
return {
|
|
261
264
|
id: bondId(record, index),
|
|
262
265
|
issuerName: textOrNull(record.issuerName) ?? "",
|
|
@@ -264,10 +267,10 @@ function parseBond(raw: unknown, index: number): CorporateBond | null {
|
|
|
264
267
|
symbol: textOrNull(record.issueSymbolIdentifier),
|
|
265
268
|
couponRate: numericOrNull(record.couponRate),
|
|
266
269
|
maturityDate: saleDate(record.maturityDate),
|
|
267
|
-
lastSalePrice:
|
|
268
|
-
lastSaleYield: numericOrNull(record.lastSaleYield),
|
|
269
|
-
priceChangeNumber: saleChange(numericOrNull(record.priceChangeNumber),
|
|
270
|
-
lastTradeDate: saleDate(record.lastTradeDate),
|
|
270
|
+
lastSalePrice: sold ? price : null,
|
|
271
|
+
lastSaleYield: sold ? numericOrNull(record.lastSaleYield) : null,
|
|
272
|
+
priceChangeNumber: sold ? saleChange(numericOrNull(record.priceChangeNumber), price) : null,
|
|
273
|
+
lastTradeDate: sold ? saleDate(record.lastTradeDate) : null,
|
|
271
274
|
traceGradeCode: textOrNull(record.traceGradeCode),
|
|
272
275
|
};
|
|
273
276
|
}
|
|
@@ -24,7 +24,7 @@ export const traceBondsModule: PluginModule = {
|
|
|
24
24
|
label: "Corporate Bond Tape",
|
|
25
25
|
description: "Latest corporate and agency bond sales: issuer, coupon, price, yield, and grade.",
|
|
26
26
|
keywords: ["bond", "bonds", "corporate", "agency", "coupon", "yield", "issuer", "cusip", "credit", "fixed income", "trace"],
|
|
27
|
-
shortcut: { prefix: "TRACE", argKind: "text", argOptional: true, argPlaceholder: "issuer, symbol or CUSIP" },
|
|
27
|
+
shortcut: { prefix: "TRACE", argKind: "text", argOptional: true, focusedIssuer: true, argPlaceholder: "issuer, symbol or CUSIP" },
|
|
28
28
|
headless: traceBondsHeadless,
|
|
29
29
|
// Its sales date a capture, never the stock quote of a ticker typed as its argument (`TRACE CMLSQ`).
|
|
30
30
|
reportFreshness: { source: "FINRA", status: "not-a-feed", basis: "last sales" },
|
|
@@ -15,6 +15,7 @@ import { abortable, abortError } from "../../../utils/async-deadline";
|
|
|
15
15
|
import { errorMessage } from "../../../utils/errors";
|
|
16
16
|
import { expiredExpiryText, findListedExpiry, isLiveOptionExpiry, liveOptionExpiries, optionExpiryVenue, unlistedExpiryText } from "../../../utils/option-expiry";
|
|
17
17
|
import { optionModelSpot } from "../options/model-spot";
|
|
18
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
18
19
|
|
|
19
20
|
const DEFAULT_SURFACE_EXPIRY_LIMIT = 18;
|
|
20
21
|
/** Expiries read at a time from a source that takes them one by one. */
|
|
@@ -190,7 +191,7 @@ export async function loadVolatilitySurface(
|
|
|
190
191
|
checkAbort();
|
|
191
192
|
publish();
|
|
192
193
|
// Asked while the catalogue loads, so it costs the expiries no wait.
|
|
193
|
-
const batched = Promise.resolve().then(() => dependencies.batchesExpiries?.()).then((answer) => answer === true, (
|
|
194
|
+
const batched = Promise.resolve().then(() => dependencies.batchesExpiries?.()).then((answer) => answer === true, logFailure("vol-surface.client", "Read expiry batching support failed", false));
|
|
194
195
|
const treasury = Promise.resolve().then(() => dependencies.loadYieldCurve()).then((value) => {
|
|
195
196
|
if (request.signal?.aborted) return;
|
|
196
197
|
curve = value;
|
|
@@ -16,7 +16,12 @@ import { abortable, abortError } from "../../../utils/async-deadline";
|
|
|
16
16
|
import { errorMessage } from "../../../utils/errors";
|
|
17
17
|
import { savedCopyAt } from "../../../data/saved-copies";
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Source reads in flight at once: the board's 23 closes and series in three
|
|
21
|
+
* rounds, not six. Each round is a request's wait, which a shot of the board
|
|
22
|
+
* and `fn VIX` sit through in turn.
|
|
23
|
+
*/
|
|
24
|
+
const VOLATILITY_LOAD_CONCURRENCY = 8;
|
|
20
25
|
const VOLATILITY_HISTORY_LIMIT = 400;
|
|
21
26
|
export interface VolatilityLoadResult {
|
|
22
27
|
data: VolatilityData;
|
|
@@ -56,7 +56,6 @@ export function createVolatilityHeadless(dependencies: VolatilityHeadlessDepende
|
|
|
56
56
|
discovery: { screenshotReadiness: "live-dom", limitations: [
|
|
57
57
|
"Daily histories may contain isolated index observations; sparse coverage has no daily change or annual percentile.",
|
|
58
58
|
"Thin histories do not support daily changes or one-year percentiles.",
|
|
59
|
-
"The existing sources do not supply a VIX futures curve.",
|
|
60
59
|
] },
|
|
61
60
|
async load(args, context) {
|
|
62
61
|
const result = await dependencies.load(args, context);
|
|
@@ -6,6 +6,8 @@ import type { CurveBasis } from "./forward";
|
|
|
6
6
|
import { yieldSpreads, type YieldLookbackCurves } from "./chart";
|
|
7
7
|
import { completeYieldCurve, loadHistoricalYieldCurve, yieldCurveDate } from "./history";
|
|
8
8
|
import { DATE_OPTION_FORMATS, dateOptionHint, readCalendarDate } from "../../../utils/calendar-date";
|
|
9
|
+
import { formatBasisPoints } from "../../../utils/basis-points";
|
|
10
|
+
import { formatPercentileRank } from "../../../utils/format";
|
|
9
11
|
import { isYieldObservationDate, loadYieldCurve, type YieldPoint } from "./treasury-data";
|
|
10
12
|
|
|
11
13
|
export type CurveId = CloudCurveId;
|
|
@@ -166,6 +168,19 @@ export function curveSpreadFigures(data: CurveData | null, lookbacks: YieldLookb
|
|
|
166
168
|
.map(({ id, spread, change1d }) => ({ id, value: spread, change1d, percentile1y: null }));
|
|
167
169
|
}
|
|
168
170
|
|
|
171
|
+
/**
|
|
172
|
+
* A spread as GC reads it, the pane's figure and the report's row alike: its
|
|
173
|
+
* level ("+38bp"), and under it the day's move and where it sits in the last
|
|
174
|
+
* year ("+1bp 1D · 20 pctl 1Y"), the rank left out when the source has none.
|
|
175
|
+
*/
|
|
176
|
+
export function curveSpreadText(figure: CurveSpreadFigure): { value: string; detail: string } {
|
|
177
|
+
return {
|
|
178
|
+
value: figure.value == null ? "--" : formatBasisPoints(figure.value),
|
|
179
|
+
detail: [`${figure.change1d == null ? "--" : formatBasisPoints(figure.change1d)} 1D`,
|
|
180
|
+
...(figure.percentile1y == null ? [] : [formatPercentileRank(figure.percentile1y, "1Y")])].join(" · "),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
169
184
|
/**
|
|
170
185
|
* A curve on the requested date (its last session on or before it) or its
|
|
171
186
|
* latest. Treasuries fall back to FRED when the stored curve cannot be read,
|