@gloom-sh/terminal 0.20.10 → 0.20.12
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 +2 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +16 -0
- package/src/api-client/awards.ts +16 -0
- package/src/api-client/central-bank-rates.ts +5 -0
- package/src/api-client/data.ts +55 -2
- package/src/api-client/index.ts +18 -1
- package/src/api-client/request.ts +86 -3
- package/src/api-client/socket-connection.ts +366 -0
- package/src/api-client/socket-features.ts +75 -0
- package/src/api-client/socket-frames.ts +161 -0
- package/src/api-client/socket-listeners.ts +207 -0
- package/src/api-client/socket-quotes.ts +332 -0
- package/src/api-client/socket.ts +168 -983
- package/src/api-client/supply-chain-graph.ts +4 -2
- package/src/api-client/supply-chain.ts +8 -0
- package/src/api-client/types/econ.ts +10 -7
- package/src/api-client/types/filings-and-calls.ts +8 -0
- package/src/app/global-shortcuts.ts +2 -1
- package/src/app/keybindings/actions.ts +19 -0
- package/src/app/pane-runtime/index.tsx +18 -3
- package/src/app/pane-runtime/layout-placement.ts +63 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +10 -2
- package/src/brokers/signed-in/adapter.ts +19 -5
- package/src/brokers/signed-in/client.ts +13 -1
- package/src/brokers/signed-in/sign-in-dialog.tsx +33 -9
- package/src/capabilities/chart-series.ts +4 -1
- package/src/cli/board-coins.ts +10 -1
- package/src/cli/commands/crypto-hints.ts +3 -2
- package/src/cli/commands/fred-series.ts +0 -54
- package/src/cli/commands/market.ts +209 -31
- package/src/cli/commands/overview.ts +47 -14
- package/src/cli/commands/search.ts +37 -8
- package/src/cli/commands/ticker.ts +15 -4
- package/src/cli/desktop-pane-shot.ts +27 -2
- package/src/cli/fx-quote-rate.ts +1 -1
- package/src/cli/glossary.ts +14 -5
- package/src/cli/history-catalog-series.ts +85 -0
- package/src/cli/index.ts +1 -1
- package/src/cli/list-progress.ts +45 -0
- package/src/cli/listing-arg.ts +71 -7
- package/src/cli/name-entries.ts +8 -4
- package/src/cli/not-a-ticker.ts +2 -2
- package/src/cli/pane-functions/freshness.ts +50 -3
- package/src/cli/pane-functions/index.ts +7 -4
- package/src/cli/pane-functions/market-session.ts +66 -14
- package/src/cli/pane-functions/options.ts +5 -0
- package/src/cli/pane-functions/resolver.ts +9 -2
- package/src/cli/pane-functions/screenshot-assessment.ts +28 -3
- package/src/cli/pane-functions/screenshot-types.ts +6 -0
- package/src/cli/quote-answer.ts +49 -10
- package/src/cli/quote-list-reads.ts +87 -0
- package/src/cli/report-tables.ts +70 -13
- package/src/cli/result.ts +24 -2
- package/src/cli/symbol-list.ts +31 -4
- package/src/cli/terminal-code-hints.ts +83 -0
- package/src/cli/ticker-resolution.ts +2 -1
- package/src/cli/treasury-yields.ts +5 -0
- package/src/components/chart/native/kitty/manager.ts +2 -0
- package/src/components/chart/native/surface/manager.ts +211 -11
- package/src/components/command-bar/action-runtime.ts +2 -0
- package/src/components/command-bar/panel/index.tsx +2 -13
- package/src/components/command-bar/panel/layout.ts +1 -7
- package/src/components/command-bar/panel/runtime.ts +0 -1
- package/src/components/command-bar/panel/types.ts +0 -2
- package/src/components/command-bar/routing/launch-request.ts +2 -1
- package/src/components/command-bar/routing/navigation-state.ts +4 -2
- package/src/components/command-bar/workflow/types.ts +6 -0
- package/src/components/data-table/column-menu.tsx +89 -0
- package/src/components/data-table/sort-menu.tsx +9 -2
- package/src/components/data-table/view.tsx +33 -6
- package/src/components/form-modal/content.tsx +10 -0
- package/src/components/index.ts +1 -1
- package/src/components/layout/detached-pane-shell.tsx +3 -0
- package/src/components/layout/double-escape-close.ts +34 -3
- package/src/components/layout/floating-pane.tsx +10 -4
- package/src/components/layout/pane/cycle-order.ts +66 -2
- package/src/components/layout/pane/footer/index.tsx +25 -11
- package/src/components/layout/pane/footer/model.ts +62 -20
- package/src/components/layout/pane/header.tsx +140 -31
- package/src/components/layout/pane/sidebar.tsx +138 -20
- package/src/components/layout/pane/status-footer.ts +3 -1
- package/src/components/layout/shell/active-drag.ts +18 -13
- package/src/components/layout/shell/drag/magnets.ts +34 -18
- package/src/components/layout/shell/drag/runtime.ts +5 -0
- package/src/components/layout/shell/index.tsx +25 -0
- package/src/components/layout/shell/menu.ts +9 -0
- package/src/components/layout/shell/pane/actions.ts +36 -0
- package/src/components/layout/shell/pane/management-shortcuts.ts +27 -3
- package/src/components/layout/shell/pane-occlusion.ts +40 -0
- package/src/components/layout/shell/shortcuts.ts +17 -1
- package/src/components/layout/shell/terminal-pointer-runtime.ts +39 -6
- package/src/components/layout/shell/window-mode/index.ts +5 -16
- package/src/components/layout/shell/window-mode/overlays.tsx +3 -1
- package/src/components/market-board/index.tsx +14 -5
- package/src/components/metric-treemap/index.tsx +3 -1
- package/src/components/ticker/list-table-view.tsx +5 -0
- package/src/components/ui/button.tsx +48 -4
- package/src/components/ui/data-table/column-order.ts +180 -0
- package/src/components/ui/data-table/index.tsx +12 -1
- package/src/components/ui/data-table/opentui/index.tsx +291 -32
- package/src/components/ui/data-table/opentui/model.ts +43 -4
- package/src/components/ui/data-table/types.ts +56 -0
- package/src/components/ui/data-table/use-column-order.ts +135 -0
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/inline-quick-add.tsx +19 -3
- package/src/components/ui/list-view.tsx +11 -5
- package/src/components/ui/query-bar.tsx +16 -1
- package/src/components/ui/selection-fill.ts +39 -0
- package/src/components/ui/table-layout.ts +120 -0
- package/src/core/state/app/layout-reducer.ts +2 -1
- package/src/core/state/app/pane-choices.ts +68 -0
- package/src/core/state/app/state.ts +14 -6
- package/src/core/state/app/types.ts +8 -0
- package/src/docs/snapshot.json +3 -2
- package/src/i18n/es.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/zh-cn.ts +2 -0
- package/src/i18n/zh-tw.ts +2 -0
- package/src/layout/pane-manager/dock-tree.ts +19 -0
- package/src/layout/pane-manager/index.ts +3 -0
- package/src/market-data/coordinator/index.ts +4 -3
- package/src/market-data/coordinator/quotes.ts +12 -4
- package/src/market-data/market/freshness.ts +33 -0
- package/src/market-data/market/status.ts +5 -1
- package/src/market-data/quotes/contributions.ts +10 -0
- package/src/market-data/quotes/freshness.ts +31 -0
- package/src/market-data/quotes/live-valuation.ts +32 -5
- package/src/market-data/quotes/regular-session-valuation.ts +1 -1
- package/src/market-data/quotes/resolution.ts +4 -0
- package/src/market-data/quotes/time.ts +0 -14
- package/src/plugins/builtin/account-management/index.tsx +1 -0
- package/src/plugins/builtin/awards/detail.tsx +12 -4
- package/src/plugins/builtin/awards/headless.ts +29 -8
- package/src/plugins/builtin/awards/model.ts +36 -2
- package/src/plugins/builtin/awards/pane.tsx +7 -4
- package/src/plugins/builtin/broker-manager/detail.tsx +5 -3
- package/src/plugins/builtin/broker-manager/index.tsx +7 -6
- package/src/plugins/builtin/broker-manager/model.ts +15 -6
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +11 -4
- package/src/plugins/builtin/broker-manager/sign-in-end.ts +50 -19
- package/src/plugins/builtin/broker-manager/table.ts +10 -4
- package/src/plugins/builtin/broker-trading/index.tsx +1 -1
- package/src/plugins/builtin/central-bank-rates/headless.ts +6 -6
- package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +21 -3
- package/src/plugins/builtin/central-bank-rates/pane.tsx +15 -5
- package/src/plugins/builtin/chart-composer/headless.ts +5 -1
- package/src/plugins/builtin/chart-composer/pane.tsx +1 -0
- package/src/plugins/builtin/chat/content/handle-prompt.tsx +4 -0
- package/src/plugins/builtin/chat/controller/realtime.ts +17 -1
- package/src/plugins/builtin/chat/message/terminal.tsx +4 -1
- package/src/plugins/builtin/chat/sidebar.tsx +35 -19
- package/src/plugins/builtin/cloud/askg/pane.tsx +4 -0
- package/src/plugins/builtin/cloud/askg/tool-timeline.tsx +2 -0
- package/src/plugins/builtin/cloud/plugin.tsx +1 -0
- package/src/plugins/builtin/cloud/team/module.tsx +1 -0
- package/src/plugins/builtin/cloud/thesis/detail.tsx +9 -4
- package/src/plugins/builtin/commodity-balances/pane.tsx +13 -5
- package/src/plugins/builtin/company-kpis/model.ts +3 -3
- package/src/plugins/builtin/connections/index.ts +1 -0
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +9 -5
- package/src/plugins/builtin/credit-boards/client.ts +5 -0
- package/src/plugins/builtin/credit-boards/headless.ts +1 -6
- package/src/plugins/builtin/credit-boards/model.ts +0 -6
- package/src/plugins/builtin/credit-boards/series.ts +19 -8
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +9 -5
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +23 -13
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +8 -3
- package/src/plugins/builtin/debt-maturities/headless.ts +16 -7
- package/src/plugins/builtin/debt-maturities/model.ts +9 -15
- package/src/plugins/builtin/debt-maturities/pane.tsx +9 -10
- package/src/plugins/builtin/earnings/board-model.ts +33 -4
- package/src/plugins/builtin/earnings/board.tsx +15 -3
- package/src/plugins/builtin/earnings/calendar.tsx +10 -6
- package/src/plugins/builtin/earnings/client.ts +0 -9
- package/src/plugins/builtin/earnings/headless.ts +10 -7
- package/src/plugins/builtin/earnings/history.tsx +21 -14
- package/src/plugins/builtin/earnings-calls/data.ts +24 -4
- package/src/plugins/builtin/earnings-calls/format.ts +23 -5
- package/src/plugins/builtin/earnings-calls/headless.ts +23 -3
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/earnings-calls/model.ts +11 -1
- package/src/plugins/builtin/earnings-calls/pane.tsx +2 -5
- package/src/plugins/builtin/econ/calendar-model.ts +27 -0
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -0
- package/src/plugins/builtin/econ/index.tsx +9 -2
- package/src/plugins/builtin/econ-statistics/headless.ts +3 -1
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
- package/src/plugins/builtin/equity-screener/live.ts +74 -18
- package/src/plugins/builtin/equity-screener/model.ts +19 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +19 -14
- package/src/plugins/builtin/equity-screener/refresh-anchor.ts +45 -0
- package/src/plugins/builtin/equity-screener/results.ts +22 -2
- package/src/plugins/builtin/equity-screener/screen-check.ts +9 -3
- package/src/plugins/builtin/fear-greed/headless.ts +16 -13
- package/src/plugins/builtin/fear-greed/pane.tsx +12 -4
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/futures/index.tsx +15 -1
- package/src/plugins/builtin/futures/table.tsx +1 -1
- package/src/plugins/builtin/fx-matrix/index.tsx +32 -19
- package/src/plugins/builtin/holders/pane.tsx +30 -20
- package/src/plugins/builtin/insider/table.tsx +10 -7
- package/src/plugins/builtin/insider/tickers.tsx +1 -1
- package/src/plugins/builtin/iv-history/events.ts +5 -0
- package/src/plugins/builtin/iv-history/headless.ts +15 -9
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -0
- package/src/plugins/builtin/macro-day/headless.ts +15 -6
- package/src/plugins/builtin/macro-day/model.ts +1 -1
- package/src/plugins/builtin/macro-day/releases.ts +25 -16
- package/src/plugins/builtin/market-movers/index.tsx +20 -8
- package/src/plugins/builtin/market-movers/model.ts +5 -0
- package/src/plugins/builtin/market-movers/session-body.tsx +2 -1
- package/src/plugins/builtin/money-markets/headless.ts +12 -2
- package/src/plugins/builtin/money-markets/pane.tsx +10 -1
- package/src/plugins/builtin/options/view.tsx +3 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -31
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +19 -1
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +22 -8
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +6 -8
- package/src/plugins/builtin/portfolio-list/table.tsx +15 -1
- package/src/plugins/builtin/rate-path/pane.tsx +2 -0
- package/src/plugins/builtin/realized-vol/headless.ts +28 -2
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +2 -0
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -1
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/seasonality/pane.tsx +2 -1
- package/src/plugins/builtin/shared/source-footer.ts +70 -0
- package/src/plugins/builtin/short-interest/publications-pane.tsx +5 -1
- package/src/plugins/builtin/short-volume/pane.tsx +5 -1
- package/src/plugins/builtin/social-mentions/outliers.tsx +10 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +7 -0
- package/src/plugins/builtin/supply-chain/client.ts +3 -1
- package/src/plugins/builtin/supply-chain/flow.tsx +25 -8
- package/src/plugins/builtin/supply-chain/graph-client.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-evidence.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-model.ts +12 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +9 -8
- package/src/plugins/builtin/supply-chain/graph.tsx +12 -6
- package/src/plugins/builtin/supply-chain/headless.ts +13 -7
- package/src/plugins/builtin/supply-chain/model.ts +68 -11
- package/src/plugins/builtin/supply-chain/pane.tsx +9 -6
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +5 -5
- package/src/plugins/builtin/thirteenf/pane.tsx +2 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +28 -6
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +26 -9
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +58 -35
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +14 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +2 -0
- package/src/plugins/builtin/ticker-detail/pane.tsx +48 -24
- package/src/plugins/builtin/ticker-detail/quote-footer.ts +5 -0
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +6 -3
- package/src/plugins/builtin/treasury-auctions/after.ts +50 -23
- package/src/plugins/builtin/treasury-auctions/cache.ts +23 -5
- package/src/plugins/builtin/treasury-auctions/headless.ts +226 -37
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +11 -5
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +27 -25
- package/src/plugins/builtin/treasury-auctions/hk.ts +60 -8
- package/src/plugins/builtin/treasury-auctions/index.tsx +3 -0
- package/src/plugins/builtin/treasury-auctions/keys.ts +27 -0
- package/src/plugins/builtin/treasury-auctions/like.ts +137 -0
- package/src/plugins/builtin/treasury-auctions/model.ts +100 -22
- package/src/plugins/builtin/treasury-auctions/pane.tsx +39 -11
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +6 -3
- package/src/plugins/builtin/vol-surface/pane.tsx +7 -3
- package/src/plugins/builtin/world-indices/index.tsx +5 -1
- package/src/plugins/builtin/yield-curve/index.tsx +2 -1
- package/src/plugins/runtime/index.tsx +1 -0
- package/src/plugins/runtime/state.ts +20 -0
- package/src/portfolio/column-values.ts +8 -2
- package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
- package/src/public/react.ts +7 -0
- package/src/react/auto-refresh.ts +29 -0
- package/src/renderers/browser/deeplink-bridge.ts +24 -3
- package/src/renderers/dom/data-table/column-drag.ts +147 -0
- package/src/renderers/dom/data-table/index.tsx +22 -0
- package/src/renderers/dom/data-table/row.tsx +27 -5
- package/src/renderers/dom/desktop/query-bar.tsx +229 -60
- package/src/renderers/dom/host/overflow-fade-px.ts +2 -0
- package/src/renderers/dom/host/overflow-fade.ts +1 -2
- package/src/renderers/dom/styles.css +47 -5
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -1
- package/src/renderers/opentui/chart-surface.tsx +1 -0
- package/src/renderers/opentui/frame-hits.ts +33 -0
- package/src/renderers/opentui/host.tsx +2 -0
- package/src/renderers/opentui/native-surface.ts +14 -21
- package/src/renderers/opentui/test-utils.tsx +3 -0
- package/src/series/types.ts +2 -0
- package/src/sources/gloomberb-cloud/fred-attribution.ts +86 -0
- package/src/sources/gloomberb-cloud/index.ts +25 -1
- package/src/sources/gloomberb-cloud/normalizers.ts +22 -3
- package/src/sources/provider-errors.ts +64 -1
- package/src/sources/provider-router/batches.ts +19 -0
- package/src/sources/provider-router/index.ts +7 -1
- package/src/state/app/context/index.tsx +46 -1
- package/src/state/pane-unsent-work.ts +47 -0
- package/src/test-support/app-store.ts +24 -1
- package/src/test-support/shell-pane-keys.tsx +5 -0
- package/src/test-support/telemetry-guard.ts +83 -0
- package/src/test-support/test-env.ts +12 -0
- package/src/theme/colors.ts +17 -1
- package/src/theme/ui-tokens.ts +50 -1
- package/src/tickers/listing-venues.ts +11 -1
- package/src/tickers/search/japanese-names.json +1 -0
- package/src/tickers/search/japanese-names.ts +152 -0
- package/src/tickers/terminal-codes.ts +55 -6
- package/src/time-series/base-series.ts +3 -0
- package/src/time-series/live-quotes.ts +3 -9
- package/src/types/data-provider.ts +6 -0
- package/src/types/financials.ts +11 -0
- package/src/types/plugin-contributions.ts +7 -0
- package/src/types/plugin-panes.ts +7 -0
- package/src/ui/host.tsx +24 -0
- package/src/ui/pointer-drag.ts +11 -2
- package/src/utils/double-escape-close.ts +42 -0
- package/src/utils/fundamentals.ts +14 -3
- package/src/utils/fx-status.ts +30 -7
- package/src/utils/network-failure.ts +23 -0
- package/src/utils/share-multiples.cases.json +780 -2
- package/src/utils/share-multiples.ts +154 -24
|
@@ -2,7 +2,7 @@ import type { CdxBoardIndex, CreditBoardPoint } from "../../../api-client/credit
|
|
|
2
2
|
import type { SeriesDefinition, SeriesLoadRequest, SeriesLoadResult, SeriesPoint } from "../../../series/types";
|
|
3
3
|
import { logFailure } from "../../../utils/log-failure";
|
|
4
4
|
import { cachedSeriesNote } from "../shared/series-warning";
|
|
5
|
-
import { loadCdxBoard, loadFullCdxHistory, loadSovrBoard } from "./client";
|
|
5
|
+
import { boardPublisher, loadCdxBoard, loadFullCdxHistory, loadSovrBoard } from "./client";
|
|
6
6
|
|
|
7
7
|
/** The five on-the-run 5Y index contracts the CDX tab lists; IG and iTraxx quote spread, HY and EM price. */
|
|
8
8
|
const INDEXES = [
|
|
@@ -24,6 +24,14 @@ const SOVEREIGNS: ReadonlyArray<readonly [code: string, name: string]> = [
|
|
|
24
24
|
["DO", "Dominican Republic"], ["CI", "Ivory Coast"],
|
|
25
25
|
];
|
|
26
26
|
|
|
27
|
+
/** Every board's levels are DTCC's public trades, as the CDX and SOVR tabs cite them. */
|
|
28
|
+
const BOARD_SOURCE = "DTCC";
|
|
29
|
+
|
|
30
|
+
/** What a chart of a board's series cites: DTCC, and the publisher the board names (`DTCC Public Price Dissemination`). */
|
|
31
|
+
function boardAttribution(source: string | null | undefined): Pick<SeriesLoadResult, "attribution"> {
|
|
32
|
+
return { attribution: { source: BOARD_SOURCE, publisher: boardPublisher(source) ?? BOARD_SOURCE } };
|
|
33
|
+
}
|
|
34
|
+
|
|
27
35
|
function boardPoints(
|
|
28
36
|
rows: ReadonlyArray<{ id: string; points: readonly CreditBoardPoint[] }>,
|
|
29
37
|
id: string,
|
|
@@ -51,15 +59,15 @@ const BOARD_YEAR_ONLY = "The full history did not load; showing the last year.";
|
|
|
51
59
|
* every day the server keeps when the chart starts before it (ALL, 5Y).
|
|
52
60
|
* When that read fails the board's year stands in, said with `warning`.
|
|
53
61
|
*/
|
|
54
|
-
async function cdxIndexes(request: SeriesLoadRequest): Promise<{ indexes: readonly CdxBoardIndex[]; resource: CdxSeriesResource; warning?: string }> {
|
|
62
|
+
async function cdxIndexes(request: SeriesLoadRequest): Promise<{ indexes: readonly CdxBoardIndex[]; source: string; resource: CdxSeriesResource; warning?: string }> {
|
|
55
63
|
const resource = await loadCdxBoard();
|
|
56
64
|
const first = Math.min(...resource.payload.indexes.flatMap((index) => index.points.slice(0, 1).map((point) => Date.parse(`${point.date}T00:00:00Z`))));
|
|
57
65
|
if (!request.start || request.start.getTime() < first - BOARD_SLACK_MS) {
|
|
58
66
|
const full = await loadFullCdxHistory().catch(logFailure("credit-boards", "Read the full index CDS history failed", null));
|
|
59
|
-
if (full) return { indexes: full.indexes, resource: {} };
|
|
60
|
-
return { indexes: resource.payload.indexes, resource, warning: BOARD_YEAR_ONLY };
|
|
67
|
+
if (full) return { indexes: full.indexes, source: full.source, resource: {} };
|
|
68
|
+
return { indexes: resource.payload.indexes, source: resource.payload.source, resource, warning: BOARD_YEAR_ONLY };
|
|
61
69
|
}
|
|
62
|
-
return { indexes: resource.payload.indexes, resource };
|
|
70
|
+
return { indexes: resource.payload.indexes, source: resource.payload.source, resource };
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
/** A CDX series' note: the board's own, or, when it stood in for the full history, that. */
|
|
@@ -88,10 +96,11 @@ export const CREDIT_BOARD_SERIES: readonly SeriesDefinition[] = [
|
|
|
88
96
|
unit: index.quote === "spread" ? "bp" : "points",
|
|
89
97
|
frequency: "daily",
|
|
90
98
|
group: "Credit",
|
|
99
|
+
publisher: BOARD_SOURCE,
|
|
91
100
|
tags: ["CDS", "index CDS", index.quote, "credit default swap"],
|
|
92
101
|
load: async (request) => {
|
|
93
102
|
const read = await cdxIndexes(request);
|
|
94
|
-
return { ...boardPoints(read.indexes, index.code, index.name, read.resource), ...cdxSeriesNote(read) };
|
|
103
|
+
return { ...boardPoints(read.indexes, index.code, index.name, read.resource), ...cdxSeriesNote(read), ...boardAttribution(read.source) };
|
|
95
104
|
},
|
|
96
105
|
})),
|
|
97
106
|
...INDEXES.filter((index) => index.quote === "price").map((index): SeriesDefinition => ({
|
|
@@ -100,11 +109,12 @@ export const CREDIT_BOARD_SERIES: readonly SeriesDefinition[] = [
|
|
|
100
109
|
unit: "bp",
|
|
101
110
|
frequency: "daily",
|
|
102
111
|
group: "Credit",
|
|
112
|
+
publisher: BOARD_SOURCE,
|
|
103
113
|
tags: ["CDS", "index CDS", "spread", "spread equivalent", index.code, "credit default swap"],
|
|
104
114
|
description: `${index.name}'s daily price as a conventional spread: a model figure from the ISDA standard model at the index's coupon and standard recovery, on each day's on-the-run contract, not a traded spread.`,
|
|
105
115
|
load: async (request) => {
|
|
106
116
|
const read = await cdxIndexes(request);
|
|
107
|
-
return { points: spreadEquivalentPoints(read.indexes, index.code, `${index.name} spread eq`), ...cdxSeriesNote(read) };
|
|
117
|
+
return { points: spreadEquivalentPoints(read.indexes, index.code, `${index.name} spread eq`), ...cdxSeriesNote(read), ...boardAttribution(read.source) };
|
|
108
118
|
},
|
|
109
119
|
})),
|
|
110
120
|
...SOVEREIGNS.map(([code, name]): SeriesDefinition => ({
|
|
@@ -113,10 +123,11 @@ export const CREDIT_BOARD_SERIES: readonly SeriesDefinition[] = [
|
|
|
113
123
|
unit: "bp",
|
|
114
124
|
frequency: "daily",
|
|
115
125
|
group: "Credit",
|
|
126
|
+
publisher: BOARD_SOURCE,
|
|
116
127
|
tags: ["CDS", "sovereign", code, "credit default swap"],
|
|
117
128
|
load: async () => {
|
|
118
129
|
const resource = await loadSovrBoard();
|
|
119
|
-
return boardPoints(resource.payload.sovereigns, code, name, resource);
|
|
130
|
+
return { ...boardPoints(resource.payload.sovereigns, code, name, resource), ...boardAttribution(resource.payload.source) };
|
|
120
131
|
},
|
|
121
132
|
})),
|
|
122
133
|
];
|
|
@@ -23,7 +23,9 @@ import { formatPercentileRank } from "../../../utils/format";
|
|
|
23
23
|
import { useAssetData, usePluginPaneState } from "../../runtime";
|
|
24
24
|
import { FIXED_INCOME_PANE_ID } from "../fixed-income/model";
|
|
25
25
|
import { useCommandValue } from "../shared/command-tab";
|
|
26
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
26
27
|
import { getCachedSovrBoard, loadCurrencyMoves, loadSovrBoard } from "./client";
|
|
28
|
+
import { sovrHeadless } from "./headless";
|
|
27
29
|
import { readsInBatches } from "../../../market-data/batched-reads";
|
|
28
30
|
import {
|
|
29
31
|
findSovereign,
|
|
@@ -31,7 +33,6 @@ import {
|
|
|
31
33
|
formatCurrencyMove,
|
|
32
34
|
formatLevel,
|
|
33
35
|
formatMove,
|
|
34
|
-
newestRowDate,
|
|
35
36
|
SETTLEMENT_TEXT,
|
|
36
37
|
sovrRows,
|
|
37
38
|
type SovrRow,
|
|
@@ -115,13 +116,16 @@ export function SovrPane({ focused, width, height }: PaneProps) {
|
|
|
115
116
|
moves.reload();
|
|
116
117
|
}, { focused, enabled: !loading });
|
|
117
118
|
|
|
118
|
-
//
|
|
119
|
-
|
|
119
|
+
// Its source and the newest day the rows carry, not when the response was put together, as `fn SOVR` ends.
|
|
120
|
+
// The clock says the prints are delayed, so the line does not again.
|
|
121
|
+
const sourceLine = useMemo(() => payload
|
|
122
|
+
? reportFooterSegment(sovrHeadless, { rows: payload.sovereigns.map((sovereign) => ({ date: sovereign.date })) }, { feed: false })
|
|
123
|
+
: null, [payload]);
|
|
120
124
|
const info = useMemo<PaneFooterSegment[]>(() => [
|
|
121
|
-
...(
|
|
125
|
+
...(sourceLine ? [sourceLine] : []),
|
|
122
126
|
...(payload ? [DELAYED_SEGMENT] : []),
|
|
123
127
|
...(resource.data?.stale ? [{ id: "stale", parts: [{ text: "STALE", tone: "warning" as const }] }] : []),
|
|
124
|
-
], [
|
|
128
|
+
], [payload, sourceLine, resource.data?.stale]);
|
|
125
129
|
usePaneStatusFooter({
|
|
126
130
|
registrationId: "sovr",
|
|
127
131
|
loading: loading || moves.loading,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CryptoEtfFlowsPayload } from "../../../api-client/crypto-etf-flows";
|
|
2
|
-
import type { HeadlessPaneColumn } from "../../../types/headless";
|
|
2
|
+
import type { HeadlessPaneColumn, HeadlessPaneFreshness } from "../../../types/headless";
|
|
3
3
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
4
4
|
import { REPORT_ROWS } from "../shared/headless-options";
|
|
5
5
|
import { readPriceWindow, type PriceWindow } from "../../../utils/price-window";
|
|
@@ -67,6 +67,27 @@ function fundsLine(payload: CryptoEtfFlowsPayload): string | null {
|
|
|
67
67
|
return named.length ? `Funds: ${named.join(", ")}.` : null;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* What dates the flows, as `fn ETFF` ends and the pane's footer says it: the
|
|
72
|
+
* publisher, the day (`asOf`, the newest unless a window ends before it) and
|
|
73
|
+
* when the server last read the publisher's table. `daily` says a missing
|
|
74
|
+
* trading day makes them stale.
|
|
75
|
+
*/
|
|
76
|
+
export function cryptoEtfFlowFreshness(payload: CryptoEtfFlowsPayload, asOf: string | null, daily = true): HeadlessPaneFreshness {
|
|
77
|
+
return {
|
|
78
|
+
source: payload.source.publisher,
|
|
79
|
+
publisher: payload.source.publisher,
|
|
80
|
+
status: "not-a-feed",
|
|
81
|
+
basis: "daily fund flows",
|
|
82
|
+
...(daily ? { cadence: "daily" as const } : {}),
|
|
83
|
+
tradingDayMarket: "US",
|
|
84
|
+
...(asOf ? { asOf } : {}),
|
|
85
|
+
oldest: null,
|
|
86
|
+
// When the server last read the publisher's table, which is what this report retrieved.
|
|
87
|
+
retrievedAt: payload.fetchedAt,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
70
91
|
export const cryptoEtfFlowsHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
71
92
|
shape: "rows",
|
|
72
93
|
argument: { kind: "none" },
|
|
@@ -153,18 +174,7 @@ export const cryptoEtfFlowsHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
153
174
|
notes: [window ? windowSummaryLine(payload, window, days) : summaryLine(payload), ...funds ? [funds] : [], `Source: ${payload.source.publisher}, ${payload.source.url}`],
|
|
154
175
|
complete: !payload.stale,
|
|
155
176
|
...(payload.stale ? { warnings: [`The flows were last read ${payload.fetchedAt.slice(0, 10)}; newer days may be missing.`] } : {}),
|
|
156
|
-
freshness:
|
|
157
|
-
source: payload.source.publisher,
|
|
158
|
-
publisher: payload.source.publisher,
|
|
159
|
-
status: "not-a-feed",
|
|
160
|
-
basis: "daily fund flows",
|
|
161
|
-
...(window && asOf !== payload.asOf ? {} : { cadence: "daily" as const }),
|
|
162
|
-
tradingDayMarket: "US",
|
|
163
|
-
...(asOf ? { asOf } : {}),
|
|
164
|
-
oldest: null,
|
|
165
|
-
// When the server last read the publisher's table, which is what this report retrieved.
|
|
166
|
-
retrievedAt: payload.fetchedAt,
|
|
167
|
-
},
|
|
177
|
+
freshness: cryptoEtfFlowFreshness(payload, asOf, !(window && asOf !== payload.asOf)),
|
|
168
178
|
metadata: {
|
|
169
179
|
asset,
|
|
170
180
|
unit: payload.unit,
|
|
@@ -18,11 +18,14 @@ import { useChartViewReset } from "../../../components/chart/core/view-reset";
|
|
|
18
18
|
import { scalarPoint, staticSeries } from "../../../components/chart/static/series";
|
|
19
19
|
import { handleRefreshKey, usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
20
20
|
import { useAsyncResource, useAutoRefresh, usePaneSettingValue, usePluginPaneState, useUpdatedAgo } from "../../../public/react";
|
|
21
|
+
import { useUtcDay } from "../../../react/auto-refresh";
|
|
21
22
|
import { colors } from "../../../theme/colors";
|
|
22
23
|
import type { PaneProps } from "../../../types/plugin";
|
|
23
24
|
import { Box } from "../../../ui";
|
|
24
25
|
import { isPlainKeyboardEvent } from "../../../utils/keyboard";
|
|
25
26
|
import { cachedCryptoEtfFlows, loadCryptoEtfFlows } from "./client";
|
|
27
|
+
import { cryptoEtfFlowFreshness, cryptoEtfFlowsHeadless } from "./headless";
|
|
28
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
26
29
|
import {
|
|
27
30
|
CRYPTO_ETF_FLOW_ASSETS,
|
|
28
31
|
CRYPTO_ETF_FLOW_RANGES,
|
|
@@ -103,16 +106,18 @@ export function CryptoEtfFlowsPane({ focused, width, height }: PaneProps) {
|
|
|
103
106
|
] : [];
|
|
104
107
|
|
|
105
108
|
const updatedAgo = useUpdatedAgo(resource.updatedAt);
|
|
109
|
+
const utcDay = useUtcDay();
|
|
110
|
+
// The publisher and the flows' day, as `fn ETFF` ends; how long ago it loaded goes first on a narrow row.
|
|
106
111
|
const footerInfo = useMemo(() => data ? [
|
|
107
|
-
{
|
|
112
|
+
reportFooterSegment(cryptoEtfFlowsHeadless, { rows: [], freshness: cryptoEtfFlowFreshness(data, data.asOf) }),
|
|
108
113
|
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
|
|
109
|
-
] : [], [data, updatedAgo]);
|
|
114
|
+
] : [], [data, updatedAgo, utcDay]);
|
|
110
115
|
useAutoRefresh(resource.updatedAt, resource.load);
|
|
111
116
|
const refresh = useCallback(() => resource.reload(), [resource.reload]);
|
|
112
117
|
usePaneRefreshKey(refresh, { focused });
|
|
113
118
|
usePaneStatusLinkFooter({
|
|
114
119
|
registrationId: CRYPTO_ETF_FLOWS_PANE_ID, focused, loading: resource.loading, error: data ? null : resource.error,
|
|
115
|
-
url: data?.source.url ?? null,
|
|
120
|
+
url: data?.source.url ?? null, showOpenHint: true,
|
|
116
121
|
info: footerInfo, stale: !!data && (data.stale || !!current?.stale),
|
|
117
122
|
});
|
|
118
123
|
usePaneNoticeFooter({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DebtMaturitiesPayload } from "../../../api-client/debt-maturities";
|
|
2
|
-
import type { HeadlessBundleSection } from "../../../types/headless";
|
|
2
|
+
import type { HeadlessBundleSection, HeadlessPaneFreshness } from "../../../types/headless";
|
|
3
3
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
4
4
|
import { fetchDebtMaturities } from "./client";
|
|
5
5
|
import {
|
|
@@ -79,6 +79,19 @@ function bandSections(data: DebtMaturitiesPayload, latest: DebtLatest): Headless
|
|
|
79
79
|
];
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
/** What dates a DDIS report, as `fn DDIS` ends and the pane's footer says it. */
|
|
83
|
+
export function debtReportFreshness(data: DebtMaturitiesPayload): HeadlessPaneFreshness {
|
|
84
|
+
const latest = data.latest;
|
|
85
|
+
if (latest && debtBands(latest)) {
|
|
86
|
+
// Dated by the report's balance sheet: an SEC filing named by its form, a report outside SEC cited
|
|
87
|
+
// as the server names it (its form, HKEX or CNINFO, would repeat that name).
|
|
88
|
+
return data.cik ? { asOf: latest.asOf, asOfLabel: latest.form } : { asOf: latest.asOf, source: data.source.name };
|
|
89
|
+
}
|
|
90
|
+
// The latest filing dates the report (a newer 10-Q's balance date), named by its form so the date is
|
|
91
|
+
// not read as the schedule's; the history rows are past years, not stale data.
|
|
92
|
+
return { asOf: debtNewestAsOf(data), asOfLabel: debtNewestForm(data) ?? undefined };
|
|
93
|
+
}
|
|
94
|
+
|
|
82
95
|
export const debtMaturitiesHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
83
96
|
shape: "bundle",
|
|
84
97
|
freshness: SEC_FILINGS,
|
|
@@ -125,9 +138,7 @@ export const debtMaturitiesHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
125
138
|
...(data.notes?.length ? { notes: data.notes } : {}),
|
|
126
139
|
sections: bandSections(data, latest),
|
|
127
140
|
metadata: { ...data },
|
|
128
|
-
|
|
129
|
-
// as the server names it (its form, HKEX or CNINFO, would repeat that name).
|
|
130
|
-
freshness: data.cik ? { asOf: latest.asOf, asOfLabel: latest.form } : { asOf: latest.asOf, source: data.source.name },
|
|
141
|
+
freshness: debtReportFreshness(data),
|
|
131
142
|
};
|
|
132
143
|
}
|
|
133
144
|
const quarter = newerQuarter(data);
|
|
@@ -212,9 +223,7 @@ export const debtMaturitiesHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
212
223
|
],
|
|
213
224
|
...(costNote || data.notes?.length ? { notes: [...(data.notes ?? []), ...(costNote ? [costNote] : [])] } : {}),
|
|
214
225
|
metadata: { ...data },
|
|
215
|
-
|
|
216
|
-
// not read as the schedule's; the history rows are past years, not stale data.
|
|
217
|
-
freshness: { asOf: debtNewestAsOf(data), asOfLabel: debtNewestForm(data) ?? undefined },
|
|
226
|
+
freshness: debtReportFreshness(data),
|
|
218
227
|
};
|
|
219
228
|
},
|
|
220
229
|
};
|
|
@@ -107,15 +107,17 @@ export function maturityRows(latest: DebtLatest): MaturityRow[] {
|
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* The wall's scale: the largest dated bucket. Thereafter is open ended and
|
|
110
|
-
* usually dwarfs every dated year, so scaling to it would flatten them.
|
|
110
|
+
* usually dwarfs every dated year, so scaling to it would flatten them. A
|
|
111
|
+
* ladder of exactly two bands in its filing's own terms (a balance sheet's
|
|
112
|
+
* within one year and after it) has no years to flatten: both share the
|
|
113
|
+
* larger, so 528M within the year never reads as long as 1.76B after it. A
|
|
114
|
+
* schedule by year keeps its dated scale however few of its years have a
|
|
115
|
+
* value, and its Thereafter stays capped.
|
|
111
116
|
*/
|
|
112
117
|
export function datedBucketScale(latest: DebtLatest): number {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
row.dated && row.value !== null ? [row.value] : [],
|
|
117
|
-
),
|
|
118
|
-
);
|
|
118
|
+
const rows = maturityRows(latest);
|
|
119
|
+
const scaled = debtBands(latest)?.length === 2 ? rows : rows.filter((row) => row.dated);
|
|
120
|
+
return Math.max(0, ...scaled.flatMap((row) => row.value === null ? [] : [row.value]));
|
|
119
121
|
}
|
|
120
122
|
export interface BucketBar {
|
|
121
123
|
/** Share of the bar column, 0 to 1. */
|
|
@@ -381,14 +383,6 @@ export function debtNewestAsOf(data: DebtMaturitiesPayload): string | null {
|
|
|
381
383
|
export function debtNewestForm(data: DebtMaturitiesPayload): string | null {
|
|
382
384
|
return newestDebtFiling(data)?.form ?? null;
|
|
383
385
|
}
|
|
384
|
-
/**
|
|
385
|
-
* Which filing the pane's date is, as its footer says it, longest first:
|
|
386
|
-
* `10-Q 2026-09-30, filed 2026-10-27`, then `10-Q 2026-09-30`.
|
|
387
|
-
*/
|
|
388
|
-
export function debtNewestFilingText(data: DebtMaturitiesPayload): string[] {
|
|
389
|
-
const filing = newestDebtFiling(data);
|
|
390
|
-
return filing ? [`${filing.form} ${filing.asOf}, filed ${filing.filed}`, `${filing.form} ${filing.asOf}`] : [];
|
|
391
|
-
}
|
|
392
386
|
/** The 10-Q's debt in one line, `Current 212.00M · Non-current 6.84B USD`. */
|
|
393
387
|
export function quarterDebtText(quarter: DebtQuarter): string {
|
|
394
388
|
return `Current ${debtAmount(quarter.current?.value ?? null)} · Non-current ${debtAmount(quarter.noncurrent?.value ?? null)} ${quarter.currency}`;
|
|
@@ -45,6 +45,9 @@ import {
|
|
|
45
45
|
useResearchCloudSession,
|
|
46
46
|
} from "../shared/research-cloud-session";
|
|
47
47
|
import { cachedDebtMaturities, loadDebtMaturities } from "./client";
|
|
48
|
+
import { debtMaturitiesHeadless, debtReportFreshness } from "./headless";
|
|
49
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
50
|
+
import { useUtcDay } from "../../../react/auto-refresh";
|
|
48
51
|
import {
|
|
49
52
|
HISTORY_COLUMNS,
|
|
50
53
|
bandScaleText,
|
|
@@ -61,7 +64,6 @@ import {
|
|
|
61
64
|
debtFilingUrl,
|
|
62
65
|
debtMetricCaption,
|
|
63
66
|
debtMetricValue,
|
|
64
|
-
debtNewestFilingText,
|
|
65
67
|
debtNotices,
|
|
66
68
|
debtPercent,
|
|
67
69
|
historyAxis,
|
|
@@ -607,15 +609,12 @@ export function DebtMaturitiesPane({ width, height, focused }: PaneProps) {
|
|
|
607
609
|
label: "Principal total", values, value: debtAmount(last), color: colors.warning,
|
|
608
610
|
};
|
|
609
611
|
}, [bars]);
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
...(data && updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
|
|
617
|
-
];
|
|
618
|
-
}, [data, updatedAgo]);
|
|
612
|
+
const utcDay = useUtcDay();
|
|
613
|
+
// Its source and which filing dates it, as `fn DDIS` ends, then how long ago it loaded: the age goes first in a narrow footer.
|
|
614
|
+
const filingFooter = useMemo(() => data ? [
|
|
615
|
+
reportFooterSegment(debtMaturitiesHeadless, { sections: [], freshness: debtReportFreshness(data) }),
|
|
616
|
+
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
|
|
617
|
+
] : [], [data, updatedAgo, utcDay]);
|
|
619
618
|
useAutoRefresh(resource.updatedAt, resource.load);
|
|
620
619
|
usePaneRefreshKey(() => resource.reload(), { focused });
|
|
621
620
|
usePaneNoticeFooter({
|
|
@@ -7,7 +7,8 @@ import type { TickerRecord } from "../../../types/ticker";
|
|
|
7
7
|
import { earningsDateStatus, earningsEpsBasis, isProvisionalActual } from "../shared/earnings-report";
|
|
8
8
|
import { calendarReport } from "../shared/earnings-calendar";
|
|
9
9
|
import { listingSuffixCandidate } from "../../../sources/listing-symbols";
|
|
10
|
-
import { isUsListingExchange } from "../../../utils/exchanges";
|
|
10
|
+
import { isUsListingExchange, parsePublicTickerKey } from "../../../utils/exchanges";
|
|
11
|
+
import { listingAbroadVenue } from "../../../utils/sec";
|
|
11
12
|
import { sameHistoryListing } from "./client";
|
|
12
13
|
import { shortDate, surprise, weekday } from "./format";
|
|
13
14
|
|
|
@@ -162,10 +163,38 @@ export function boardReport(report: EarningsCalendarReport, owned: ReadonlyMap<s
|
|
|
162
163
|
};
|
|
163
164
|
}
|
|
164
165
|
|
|
165
|
-
/**
|
|
166
|
+
/**
|
|
167
|
+
* A listing as the board and Gloom Cloud's earnings history key it, however it
|
|
168
|
+
* was typed: a vendor's suffix as the venue it names (0700.HK, 700.HK and
|
|
169
|
+
* 00700.HK are 0700:HKEX, VOD.L is VOD:LSE), a venue by its own code
|
|
170
|
+
* (0700:XHKG is 0700:HKEX), a Hong Kong code by its four digits, and a US
|
|
171
|
+
* listing by its ticker (AAPL:NASDAQ is AAPL). Any other key stays as typed.
|
|
172
|
+
*/
|
|
166
173
|
export function boardKey(symbol: string): string {
|
|
167
|
-
const
|
|
168
|
-
|
|
174
|
+
const typed = symbol.trim().toUpperCase();
|
|
175
|
+
const suffixed = listingSuffixCandidate(typed);
|
|
176
|
+
const key = suffixed ? `${suffixed.symbol}:${suffixed.exchange}` : typed;
|
|
177
|
+
const parsed = parsePublicTickerKey(key);
|
|
178
|
+
if (parsed.exchange && isUsListingExchange(parsed.exchange)) return parsed.symbol;
|
|
179
|
+
const venue = listingAbroadVenue(key);
|
|
180
|
+
if (!venue) return key;
|
|
181
|
+
const code = venue === "HKEX" && /^\d{1,5}$/.test(parsed.symbol) && Number(parsed.symbol) > 0
|
|
182
|
+
? String(Number(parsed.symbol)).padStart(4, "0") : parsed.symbol;
|
|
183
|
+
return `${code}:${venue}`;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* How ERN reads a symbol's past reports: by its listing's key, however it was
|
|
188
|
+
* typed (`boardKey`: 0700.HK is 0700:HKEX). A US listing's are the US
|
|
189
|
+
* board's, where SAN is not SAN:EPA's company; a Hong Kong listing has its
|
|
190
|
+
* own (`ownAbroad`), which Gloom Cloud reads from its results announcements,
|
|
191
|
+
* in their currency. Any other listing abroad has none (`abroad`) and shows
|
|
192
|
+
* its next report.
|
|
193
|
+
*/
|
|
194
|
+
export function historyListing(symbol: string): { listing: string; abroad: boolean; ownAbroad: boolean } {
|
|
195
|
+
const listing = boardKey(symbol);
|
|
196
|
+
const venue = listingAbroadVenue(listing);
|
|
197
|
+
return { listing, abroad: venue != null && venue !== "HKEX", ownAbroad: venue === "HKEX" };
|
|
169
198
|
}
|
|
170
199
|
|
|
171
200
|
/**
|
|
@@ -18,6 +18,9 @@ import type { EarningsCalendarQuery } from "../../../api-client/earnings";
|
|
|
18
18
|
import { useAppSelector, usePaneAppConfig, usePaneSettingValue } from "../../../state/app/context";
|
|
19
19
|
import { useLiveStreamingSetting } from "../../../state/hooks/live-streaming";
|
|
20
20
|
import { useAsyncResource, useAutoRefresh, usePluginPaneState, useUpdatedAgo } from "../../../public/react";
|
|
21
|
+
import { useUtcDay } from "../../../react/auto-refresh";
|
|
22
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
23
|
+
import { earningsBoardHeadless } from "./headless";
|
|
21
24
|
import type { EarningsEvent } from "../../../types/data-provider";
|
|
22
25
|
import { getSharedRegistry } from "../../registry/shared";
|
|
23
26
|
import { Box, useUiCapabilities } from "../../../ui";
|
|
@@ -94,6 +97,8 @@ interface BoardData {
|
|
|
94
97
|
/** The query read, by `earningsCalendarKey`: kept data from another week is not this week's. */
|
|
95
98
|
queryKey: string;
|
|
96
99
|
reports: BoardReport[];
|
|
100
|
+
/** When the service built the calendar read, which dates the board; null without one. */
|
|
101
|
+
asOf: string | null;
|
|
97
102
|
stale: boolean;
|
|
98
103
|
refreshError: string | null;
|
|
99
104
|
}
|
|
@@ -208,7 +213,7 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
208
213
|
const loader = useCallback(async (force: boolean): Promise<BoardData> => {
|
|
209
214
|
const holdings = fund ? await loadMembers(fund.etf, force) : null;
|
|
210
215
|
const names = holdings ? fundNames(holdings.payload.members) : named;
|
|
211
|
-
if (!market && names.length === 0) return { queryKey, reports: [], stale: !!holdings && (holdings.stale || holdings.payload.stale), refreshError: holdings?.refreshError ?? null };
|
|
216
|
+
if (!market && names.length === 0) return { queryKey, reports: [], asOf: null, stale: !!holdings && (holdings.stale || holdings.payload.stale), refreshError: holdings?.refreshError ?? null };
|
|
212
217
|
const read = fund ? { ...query, symbols: names } : query;
|
|
213
218
|
const [cloud, fallback] = await Promise.allSettled([
|
|
214
219
|
loadEarningsBoard(read, force),
|
|
@@ -226,6 +231,7 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
226
231
|
return {
|
|
227
232
|
queryKey,
|
|
228
233
|
reports: [...reports, ...extra],
|
|
234
|
+
asOf: cloud.status === "fulfilled" ? cloud.value.payload.asOf : null,
|
|
229
235
|
stale: (!!holdings && (holdings.stale || holdings.payload.stale)) || (cloud.status === "fulfilled" && cloud.value.stale),
|
|
230
236
|
refreshError: cloud.status === "rejected"
|
|
231
237
|
? (cloud.reason instanceof Error ? cloud.reason.message : String(cloud.reason))
|
|
@@ -238,7 +244,7 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
238
244
|
const holdings = fund ? cachedMembers(fund.etf) : null;
|
|
239
245
|
if (fund && !holdings) return null;
|
|
240
246
|
const cached = cachedEarningsCalendar(holdings ? { ...query, symbols: fundNames(holdings.payload.members) } : query);
|
|
241
|
-
return cached ? { queryKey, reports: cached.payload.reports.map((report) => boardReport(report, owned)), stale: !!holdings?.payload.stale, refreshError: null } : null;
|
|
247
|
+
return cached ? { queryKey, reports: cached.payload.reports.map((report) => boardReport(report, owned)), asOf: cached.payload.asOf, stale: !!holdings?.payload.stale, refreshError: null } : null;
|
|
242
248
|
},
|
|
243
249
|
});
|
|
244
250
|
// A new fund or range never shows the previous scope while its holdings load or fail.
|
|
@@ -316,13 +322,19 @@ export function EarningsBoard({ focused, width, height, scopedSymbols, highlight
|
|
|
316
322
|
|
|
317
323
|
useAutoRefresh(resource.updatedAt, resource.load);
|
|
318
324
|
const updatedAgo = useUpdatedAgo(resource.updatedAt);
|
|
325
|
+
const utcDay = useUtcDay();
|
|
326
|
+
// Its source and when the calendar was read, as `fn EVTS` ends; how long ago it loaded goes first on a narrow row.
|
|
327
|
+
const footerInfo = useMemo(() => data ? [
|
|
328
|
+
reportFooterSegment(earningsBoardHeadless, { rows: [], metadata: { asOf: data.asOf } }),
|
|
329
|
+
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
|
|
330
|
+
] : [], [data, updatedAgo, utcDay]);
|
|
319
331
|
usePaneStatusFooter({
|
|
320
332
|
registrationId: "earnings-board",
|
|
321
333
|
enabled: !open,
|
|
322
334
|
loading: resource.loading,
|
|
323
335
|
error: resource.error ?? data?.refreshError ?? null,
|
|
324
336
|
stale: !!data?.stale,
|
|
325
|
-
info:
|
|
337
|
+
info: footerInfo,
|
|
326
338
|
});
|
|
327
339
|
const symbol = open?.symbol ?? selectedReport?.symbol ?? null;
|
|
328
340
|
// The desktop and the web only: the terminal's footer stays as it was.
|
|
@@ -3,6 +3,7 @@ import { CompanyLogoMark } from "../../../components/company-logo";
|
|
|
3
3
|
import { PaneStatusBody } from "../../../components";
|
|
4
4
|
import { ClippedText } from "../../../components/ui/display";
|
|
5
5
|
import { FILL_REST } from "../../../components/ui/fill";
|
|
6
|
+
import { useSelectionFill } from "../../../components/ui/selection-fill";
|
|
6
7
|
import { afterLayout, revealInScrollBox } from "../../../components/ui/reveal-in-scroll-box";
|
|
7
8
|
import { useDoubleClickActivation } from "../../../components/use-double-click-activation";
|
|
8
9
|
import { useShortcut } from "../../../react/input";
|
|
@@ -285,9 +286,10 @@ function ReportTile({ report, selected, onPress, tileRef }: {
|
|
|
285
286
|
tileRef: (node: BoxRenderable | null) => void;
|
|
286
287
|
}) {
|
|
287
288
|
const colors = useThemeColors();
|
|
289
|
+
const selectionFill = useSelectionFill();
|
|
288
290
|
const surprise = report.epsSurprise;
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
+
const tone = surprise == null || surprise === 0 ? colors.text : surprise > 0 ? colors.positive : colors.negative;
|
|
292
|
+
const ink = !selected ? tone : selectionFill.lit ? colors.selectedText : selectionFill.ink(tone);
|
|
291
293
|
return (
|
|
292
294
|
<Box
|
|
293
295
|
ref={tileRef}
|
|
@@ -296,7 +298,7 @@ function ReportTile({ report, selected, onPress, tileRef }: {
|
|
|
296
298
|
minWidth={0}
|
|
297
299
|
flexDirection="column"
|
|
298
300
|
alignItems="center"
|
|
299
|
-
backgroundColor={selected ?
|
|
301
|
+
backgroundColor={selected ? selectionFill.bg : undefined}
|
|
300
302
|
hoverBackgroundColor={selected ? undefined : "var(--gloom-hover-fill)"}
|
|
301
303
|
onMouseDown={onPress}
|
|
302
304
|
title={reportTitle(report)}
|
|
@@ -323,6 +325,8 @@ function MoreTile({ count, selected, onPress, tileRef }: {
|
|
|
323
325
|
tileRef: (node: BoxRenderable | null) => void;
|
|
324
326
|
}) {
|
|
325
327
|
const colors = useThemeColors();
|
|
328
|
+
const selectionFill = useSelectionFill();
|
|
329
|
+
const lit = selected && selectionFill.lit;
|
|
326
330
|
return (
|
|
327
331
|
<Box
|
|
328
332
|
ref={tileRef}
|
|
@@ -332,7 +336,7 @@ function MoreTile({ count, selected, onPress, tileRef }: {
|
|
|
332
336
|
flexDirection="column"
|
|
333
337
|
alignItems="center"
|
|
334
338
|
justifyContent="center"
|
|
335
|
-
backgroundColor={selected ?
|
|
339
|
+
backgroundColor={selected ? selectionFill.bg : undefined}
|
|
336
340
|
hoverBackgroundColor={selected ? undefined : "var(--gloom-hover-fill)"}
|
|
337
341
|
onMouseDown={onPress}
|
|
338
342
|
title={`Show the other ${count}`}
|
|
@@ -342,9 +346,9 @@ function MoreTile({ count, selected, onPress, tileRef }: {
|
|
|
342
346
|
style={TILE_STYLE}
|
|
343
347
|
>
|
|
344
348
|
<Box style={LOGO_STYLE} alignItems="center" justifyContent="center">
|
|
345
|
-
<Text fg={
|
|
349
|
+
<Text fg={lit ? colors.selectedText : selected ? selectionFill.ink(colors.textDim) : colors.textDim} attributes={TextAttributes.BOLD}>{`+${count}`}</Text>
|
|
346
350
|
</Box>
|
|
347
|
-
<Text fg={
|
|
351
|
+
<Text fg={lit ? colors.selectedText : colors.textMuted}>more</Text>
|
|
348
352
|
</Box>
|
|
349
353
|
);
|
|
350
354
|
}
|
|
@@ -114,15 +114,6 @@ export function cachedEarningsHistory(symbol: string, accessKey?: string) {
|
|
|
114
114
|
return cachedCloudResource(historyCache, historyKey(symbol, undefined, accessKey), (payload) => validateEarningsHistory(payload, symbol));
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
/**
|
|
118
|
-
* Whether ERN reads a listing's own past reports: every US listing, and of
|
|
119
|
-
* the listings abroad Hong Kong's, which Gloom Cloud reads from their
|
|
120
|
-
* results announcements. Any other listing abroad shows its next report.
|
|
121
|
-
*/
|
|
122
|
-
export function hasEarningsHistory(venueAbroad: string | null): boolean {
|
|
123
|
-
return venueAbroad == null || venueAbroad === "HKEX";
|
|
124
|
-
}
|
|
125
|
-
|
|
126
117
|
/** A server that does not read a listing abroad's history yet refuses it (400): the next report stands alone, as before. */
|
|
127
118
|
export function noHistoryAbroad(error: unknown): null {
|
|
128
119
|
if (error instanceof ApiRequestError && error.status === 400) return null;
|
|
@@ -9,9 +9,9 @@ import type {
|
|
|
9
9
|
HeadlessRowsResult,
|
|
10
10
|
} from "../../../types/plugin";
|
|
11
11
|
import type { EarningsEvent } from "../../../types/data-provider";
|
|
12
|
-
import { addDays, boardKey, boardReport, boardRowOf, fallbackReport, MIN_AVERAGE_REPORTS, newYorkToday, type BoardReport } from "./board-model";
|
|
12
|
+
import { addDays, boardKey, boardReport, boardRowOf, fallbackReport, historyListing, MIN_AVERAGE_REPORTS, newYorkToday, type BoardReport } from "./board-model";
|
|
13
13
|
import { BOARD_WEEKS, boardRangeDays, boardRangeLabel, isBoardWeek, requestedBoardRange, type BoardRange } from "./calendar-model";
|
|
14
|
-
import { fetchEarningsCalendar, fetchEarningsHistory,
|
|
14
|
+
import { fetchEarningsCalendar, fetchEarningsHistory, noHistoryAbroad, sameHistoryListing } from "./client";
|
|
15
15
|
import { loadEarningsCalendar } from "./data/cache";
|
|
16
16
|
import { epsText, impliedText, moneyText, moveSize, signedPercent, TIMING_LABEL } from "./format";
|
|
17
17
|
import { historyRows, periodText } from "./history-model";
|
|
@@ -254,11 +254,9 @@ async function abroadHistoryNotice(symbol: string, company: string | null, conte
|
|
|
254
254
|
async function historyReport(symbol: string, context: HeadlessPaneContext, deps: EarningsHeadlessDependencies): Promise<HeadlessRowsResult> {
|
|
255
255
|
// The board is US listings'; SAN:EPA's past reports are not on it, and bare SAN there is another company.
|
|
256
256
|
// A Hong Kong listing has its own, from its results announcements.
|
|
257
|
-
const
|
|
258
|
-
const abroad = !hasEarningsHistory(venueAbroad);
|
|
259
|
-
const ownAbroad = venueAbroad != null && !abroad;
|
|
257
|
+
const { listing, abroad, ownAbroad } = historyListing(symbol);
|
|
260
258
|
const [history, upcoming] = await Promise.allSettled([
|
|
261
|
-
abroad ? Promise.resolve(null) : ownAbroad ? deps.history(
|
|
259
|
+
abroad ? Promise.resolve(null) : ownAbroad ? deps.history(listing, context).catch(noHistoryAbroad) : deps.history(listing, context),
|
|
262
260
|
deps.upcoming([symbol], context),
|
|
263
261
|
]);
|
|
264
262
|
if (history.status === "rejected" && upcoming.status === "rejected") throw history.reason;
|
|
@@ -299,10 +297,15 @@ async function historyReport(symbol: string, context: HeadlessPaneContext, deps:
|
|
|
299
297
|
// An ETF, an index, a currency pair, a coin or a future has no earnings: that is the answer, not a gap in the data,
|
|
300
298
|
// and a history that failed for one (a coin is no US ticker) is no error.
|
|
301
299
|
const noEarnings = rows.length === 0 && !abroad ? await loadNoEarningsText(context.marketData, symbol, "cli") : null;
|
|
300
|
+
// A company ERN covers whose history answered with nothing (AIA's, 1299:HKEX) has no reports on record yet: no
|
|
301
|
+
// complete answer, and not one ERN does not cover.
|
|
302
|
+
// A listing abroad shows only its next report: none on the calendar is what it has, not a listing ERN does not cover.
|
|
303
|
+
const empty = noEarnings ?? (rows.length === 0 && payload ? `No earnings reports on record for ${symbol}.`
|
|
304
|
+
: rows.length === 0 && abroad && upcoming.status === "fulfilled" ? `${symbol} has no report on the calendar yet.` : null);
|
|
302
305
|
return {
|
|
303
306
|
columns: ownAbroad ? LISTING_HISTORY_COLUMNS : HISTORY_COLUMNS,
|
|
304
307
|
rows,
|
|
305
|
-
...(noEarnings ? { empty: noEarnings, complete: true, unavailableSymbols: [] } : {}),
|
|
308
|
+
...(noEarnings ? { empty: noEarnings, complete: true, unavailableSymbols: [] } : empty ? { empty } : {}),
|
|
306
309
|
errors: history.status === "rejected" && !noEarnings ? [String(history.reason instanceof Error ? history.reason.message : history.reason)] : undefined,
|
|
307
310
|
metadata: {
|
|
308
311
|
symbol, name: payload?.name ?? next?.name ?? null, asOf: payload?.asOf ?? null,
|