@gloom-sh/terminal 0.20.4 → 0.20.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/README.md +3 -1
- package/README.zh-CN.md +1 -1
- package/bin/gloom +9 -0
- package/bin/without-bun.cjs +98 -0
- package/package.json +4 -1
- package/src/api-client/data.ts +148 -37
- package/src/api-client/hk-tenders.ts +59 -0
- package/src/api-client/index.ts +1 -0
- package/src/api-client/types/econ.ts +30 -0
- package/src/api-client/yield-curves.ts +1 -1
- package/src/app/global-shortcuts.ts +4 -1
- package/src/app/keybindings/actions.ts +6 -0
- package/src/app/keybindings/config.ts +2 -1
- package/src/app/keybindings/index.ts +1 -0
- package/src/app/keybindings/labels.ts +6 -1
- package/src/app/keybindings/resolve.ts +23 -4
- package/src/app/keybindings/terminal-keys.ts +35 -0
- package/src/app/pane-runtime/index.tsx +2 -2
- package/src/app/pane-runtime/ticker-open-runtime.ts +68 -40
- package/src/app.tsx +18 -13
- package/src/architecture/floating-promise-allowlist.json +313 -0
- package/src/architecture/ui-literals-allowlist.json +1 -1
- package/src/capabilities/chart-series.ts +27 -1
- package/src/cli/commands/keybindings.ts +5 -5
- package/src/cli/commands/market.ts +238 -57
- package/src/cli/commands/news-search.ts +81 -14
- package/src/cli/commands/overview.ts +27 -6
- package/src/cli/commands/remote.ts +16 -17
- package/src/cli/commands/system.ts +1 -1
- package/src/cli/commands/ticker.ts +3 -1
- package/src/cli/early-command.ts +2 -0
- package/src/cli/errors.ts +10 -1
- package/src/cli/fx-forward.ts +89 -7
- package/src/cli/fx-pair.ts +1 -1
- package/src/cli/fx-quote-rate.ts +23 -0
- package/src/cli/glossary.ts +19 -5
- package/src/cli/help.ts +1 -0
- package/src/cli/history-rows.ts +5 -3
- package/src/cli/index-roots.ts +5 -4
- package/src/cli/index.ts +40 -3
- package/src/cli/known-gaps.ts +38 -9
- package/src/cli/listing-arg.ts +17 -5
- package/src/cli/name-entries.ts +5 -1
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/options.ts +52 -3
- package/src/cli/output-file.ts +5 -3
- package/src/cli/pane-functions/catalog.ts +15 -0
- package/src/cli/pane-functions/function-help.ts +4 -4
- package/src/cli/pane-functions/headless.ts +9 -4
- package/src/cli/pane-functions/index.ts +6 -4
- package/src/cli/pane-functions/resolver.ts +2 -2
- package/src/cli/result.ts +21 -2
- package/src/cli/spreadsheet-hint.ts +7 -3
- package/src/cli/treasury-yields.ts +5 -3
- package/src/components/chart/composite/legend.tsx +40 -2
- package/src/components/command-bar/pane-settings.ts +2 -2
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/workflow/tickers.ts +2 -2
- package/src/components/data-table/view.tsx +9 -2
- package/src/components/input-search-bar.tsx +9 -2
- package/src/components/layout/pane/header.tsx +2 -0
- package/src/components/layout/shell/pane/capture.ts +4 -1
- package/src/components/layout/status-bar.tsx +6 -1
- package/src/components/onboarding/first-run-workspace.ts +44 -2
- package/src/components/onboarding/onboarding-frame.tsx +11 -2
- package/src/components/onboarding/onboarding-keyboard.ts +16 -0
- package/src/components/onboarding/onboarding-wizard.tsx +8 -8
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
- package/src/components/onboarding/use-onboarding-progress.ts +12 -4
- package/src/components/pane-settings-dialog/desktop.tsx +2 -2
- package/src/components/pane-settings-dialog/tui.tsx +2 -2
- package/src/components/pane-settings-dialog/value.ts +6 -0
- package/src/components/pane-settings-dialog.tsx +3 -3
- package/src/components/reader/detail-reader.tsx +4 -0
- package/src/components/ui/data-table/opentui/index.tsx +11 -4
- package/src/components/ui/data-table/opentui/model.ts +8 -6
- package/src/components/ui/data-table/types.ts +6 -1
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/page-stack-view.tsx +3 -0
- package/src/components/ui/pane-link-chip.tsx +269 -54
- package/src/components/ui/query-bar.tsx +2 -1
- package/src/components/ui/table-layout.ts +38 -1
- package/src/components/ui/tabs.tsx +97 -19
- package/src/core/state/app/layout-reducer.ts +7 -0
- package/src/core/state/app/layout.ts +44 -7
- package/src/core/state/app/state.ts +1 -1
- package/src/core/state/app/types.ts +22 -2
- package/src/docs/snapshot.json +30 -13
- package/src/market-data/depositary-pair.ts +5 -3
- package/src/market-data/market/change-basis.ts +9 -5
- package/src/market-data/market/dated-previous-close.ts +147 -17
- package/src/market-data/market/status.ts +17 -1
- package/src/market-data/quotes/contributions.ts +2 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +50 -0
- package/src/plugins/builtin/alerts/metric-data.ts +15 -2
- package/src/plugins/builtin/analytics/risk-client.ts +10 -4
- package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
- package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
- package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
- package/src/plugins/builtin/awards/index.tsx +1 -1
- package/src/plugins/builtin/backtest/headless.ts +1 -1
- package/src/plugins/builtin/buildout/index.tsx +1 -0
- package/src/plugins/builtin/catalysts/index.tsx +2 -2
- package/src/plugins/builtin/cds/headless.ts +4 -0
- package/src/plugins/builtin/cds/model.ts +0 -6
- package/src/plugins/builtin/chart-composer/formula.ts +16 -3
- package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -0
- package/src/plugins/builtin/chart-composer/headless.ts +4 -2
- package/src/plugins/builtin/chart-composer/index.tsx +1 -0
- package/src/plugins/builtin/chart-composer/presets.ts +1 -0
- package/src/plugins/builtin/chat/content/composer.tsx +5 -4
- package/src/plugins/builtin/chat/content/index.tsx +12 -2
- package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
- package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
- package/src/plugins/builtin/chat/layout.ts +5 -2
- package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
- package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
- package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
- package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
- package/src/plugins/builtin/cloud/askg/pane.tsx +55 -13
- package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +5 -3
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
- package/src/plugins/builtin/company-attention/index.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +3 -1
- package/src/plugins/builtin/company-kpis/index.tsx +2 -2
- package/src/plugins/builtin/cot/index.tsx +1 -1
- package/src/plugins/builtin/cpi/index.tsx +1 -1
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +20 -7
- package/src/plugins/builtin/credit-boards/client.ts +8 -0
- package/src/plugins/builtin/credit-boards/headless.ts +4 -1
- package/src/plugins/builtin/credit-boards/model.ts +58 -4
- package/src/plugins/builtin/credit-boards/series.ts +63 -6
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +3 -2
- package/src/plugins/builtin/credit-conditions/headless.ts +24 -6
- package/src/plugins/builtin/credit-conditions/index.tsx +1 -1
- package/src/plugins/builtin/credit-conditions/model.ts +12 -6
- package/src/plugins/builtin/credit-conditions/series.ts +2 -1
- package/src/plugins/builtin/crypto-board/index.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
- package/src/plugins/builtin/doe/index.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/econ/calendar-model.ts +115 -8
- package/src/plugins/builtin/econ/calendar-source.ts +7 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
- package/src/plugins/builtin/econ/index.tsx +42 -8
- package/src/plugins/builtin/econ/types.ts +3 -0
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
- package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
- package/src/plugins/builtin/executives/index.tsx +1 -0
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/fixed-income/index.tsx +3 -0
- package/src/plugins/builtin/futures-curve/headless.ts +3 -3
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +18 -0
- package/src/plugins/builtin/fx-matrix/index.tsx +44 -14
- package/src/plugins/builtin/gpu/index.tsx +1 -1
- package/src/plugins/builtin/help/functions-table.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +11 -1
- package/src/plugins/builtin/help/keybindings-editor.tsx +7 -3
- package/src/plugins/builtin/holders/index.tsx +1 -0
- package/src/plugins/builtin/holders/report-header.ts +2 -2
- package/src/plugins/builtin/insider/index.tsx +1 -0
- package/src/plugins/builtin/iv-history/index.tsx +1 -1
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/macro-day/headless.ts +27 -8
- package/src/plugins/builtin/macro-day/index.tsx +1 -1
- package/src/plugins/builtin/macro-day/model.ts +19 -3
- package/src/plugins/builtin/macro-day/pane.tsx +14 -9
- package/src/plugins/builtin/macro-day/releases.ts +25 -7
- package/src/plugins/builtin/market-valuation/index.tsx +1 -0
- package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
- package/src/plugins/builtin/members/index.tsx +1 -1
- package/src/plugins/builtin/mna/index.tsx +1 -0
- package/src/plugins/builtin/news/index.tsx +1 -0
- package/src/plugins/builtin/news/wire/index.tsx +5 -1
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
- package/src/plugins/builtin/options/index.tsx +1 -0
- package/src/plugins/builtin/options-positioning/index.tsx +1 -0
- package/src/plugins/builtin/pe-band/index.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
- package/src/plugins/builtin/portfolio-list/cli/render.ts +20 -3
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +5 -1
- package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
- package/src/plugins/builtin/power/index.tsx +1 -1
- package/src/plugins/builtin/realized-vol/index.tsx +1 -1
- package/src/plugins/builtin/research/headless-schema.ts +4 -3
- package/src/plugins/builtin/research/headless.ts +10 -4
- package/src/plugins/builtin/research/index.tsx +4 -0
- package/src/plugins/builtin/research/relative-valuation-columns.ts +145 -47
- package/src/plugins/builtin/research/relative-valuation-currency.ts +31 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +25 -8
- package/src/plugins/builtin/research/relative-valuation-model.ts +40 -9
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +3 -2
- package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -2
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/research-search/pane.tsx +8 -0
- package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/scanner/headless.ts +52 -13
- package/src/plugins/builtin/seasonality/index.tsx +1 -1
- package/src/plugins/builtin/sec/index.tsx +1 -0
- package/src/plugins/builtin/series-inventory.ts +1 -1
- package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
- package/src/plugins/builtin/short-interest/index.tsx +1 -0
- package/src/plugins/builtin/social-mentions/index.tsx +1 -1
- package/src/plugins/builtin/supply-chain/index.tsx +1 -0
- package/src/plugins/builtin/thirteenf/api.ts +47 -4
- package/src/plugins/builtin/thirteenf/data.ts +43 -10
- package/src/plugins/builtin/thirteenf/headless.ts +55 -11
- package/src/plugins/builtin/thirteenf/model.ts +25 -9
- package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
- package/src/plugins/builtin/thirteenf/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +8 -7
- package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +8 -5
- package/src/plugins/builtin/ticker-detail/financials/model.ts +18 -2
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +6 -6
- package/src/plugins/builtin/ticker-detail/headless.ts +24 -17
- package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +6 -4
- package/src/plugins/builtin/time-sales/client.ts +9 -11
- package/src/plugins/builtin/time-sales/index.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
- package/src/plugins/builtin/treasury-auctions/cache.ts +54 -5
- package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +150 -22
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +126 -0
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +347 -0
- package/src/plugins/builtin/treasury-auctions/hk.ts +363 -0
- package/src/plugins/builtin/treasury-auctions/index.tsx +27 -4
- package/src/plugins/builtin/treasury-auctions/model.ts +264 -28
- package/src/plugins/builtin/treasury-auctions/pane.tsx +176 -41
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
- package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
- package/src/plugins/builtin/vol-surface/index.tsx +1 -1
- package/src/plugins/builtin/world-venue-map/index.ts +1 -0
- package/src/plugins/builtin/yield-curve/curves.ts +10 -4
- package/src/plugins/builtin/yield-curve/headless.ts +6 -2
- package/src/plugins/builtin/yield-curve/index.tsx +3 -3
- package/src/plugins/builtin/yield-curve/series.ts +10 -0
- package/src/plugins/builtin/yield-curve/world.ts +3 -1
- package/src/portfolio/collection-name.ts +22 -0
- package/src/portfolio/column-values.ts +2 -1
- package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
- package/src/public/remote.ts +7 -1
- package/src/remote/client.ts +191 -11
- package/src/remote/controller-utils.ts +13 -1
- package/src/remote/controller.ts +88 -26
- package/src/remote/endpoint.ts +24 -0
- package/src/remote/form.ts +59 -4
- package/src/remote/resources.ts +44 -18
- package/src/remote/schema.ts +21 -9
- package/src/remote/secrets.ts +12 -0
- package/src/remote/semantic-tree.tsx +14 -2
- package/src/remote/server.ts +2 -1
- package/src/remote/surface.tsx +192 -0
- package/src/remote/types.ts +5 -0
- package/src/renderers/dom/data-table/frozen-column.ts +3 -1
- package/src/renderers/dom/data-table/index.tsx +27 -9
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +27 -24
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +3 -3
- package/src/renderers/electrobun/bun/desktop/snapshot-commit.ts +77 -0
- package/src/renderers/electrobun/shared/protocol.ts +4 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +3 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +3 -0
- package/src/renderers/opentui/host.tsx +6 -0
- package/src/series/standalone.ts +2 -2
- package/src/shares/api.ts +21 -4
- package/src/shares/item.ts +73 -0
- package/src/shares/pane-item.ts +205 -0
- package/src/shares/pane.ts +4 -0
- package/src/shares/payload.ts +9 -5
- package/src/sources/gloomberb-cloud/news.ts +2 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +9 -5
- package/src/sources/provider-router/cache.ts +3 -1
- package/src/sync/controller.ts +17 -2
- package/src/sync/other-window-tabs.ts +32 -1
- package/src/sync/react.ts +4 -4
- package/src/tickers/renamed-listings.ts +105 -0
- package/src/tickers/search/index.ts +103 -16
- package/src/time-series/bar-spacing.ts +33 -0
- package/src/time-series/base-series.ts +21 -3
- package/src/time-series/chart-bounds.ts +31 -0
- package/src/time-series/field-catalog.ts +17 -0
- package/src/time-series/fundamentals.ts +143 -11
- package/src/time-series/ice-credit.ts +32 -6
- package/src/time-series/resolve.ts +11 -7
- package/src/time-series/session-bar.ts +78 -9
- package/src/time-series/studies/formula.ts +53 -10
- package/src/time-series/studies/pair.ts +18 -7
- package/src/time-series/studies/units.ts +49 -2
- package/src/time-series/types.ts +12 -0
- package/src/types/desktop-window.ts +2 -0
- package/src/types/financials.ts +7 -0
- package/src/types/headless.ts +8 -0
- package/src/types/plugin-pane-settings.ts +2 -0
- package/src/types/plugin-panes.ts +22 -0
- package/src/utils/central-banks.ts +86 -1
- package/src/utils/cli-output.ts +6 -3
- package/src/utils/datetime-format.ts +12 -3
- package/src/utils/depositary-receipt.ts +28 -3
- package/src/utils/ebitda.ts +128 -0
- package/src/utils/format.ts +1 -1
- package/src/utils/fundamentals.ts +14 -0
- package/src/utils/max-drawdown.ts +97 -16
- package/src/utils/shell-word.ts +13 -0
- package/src/utils/untrusted-text.ts +29 -0
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type PaneFooterSegment,
|
|
12
12
|
} from "../../../components";
|
|
13
13
|
import { handleRefreshKey } from "../../../components/data-table/table-pane";
|
|
14
|
+
import { getTableWidth } from "../../../components/ui/table-layout";
|
|
14
15
|
import { createDataTableCsv } from "../../../components/data-table/export";
|
|
15
16
|
import { ageFooterSegment, savedCopyFooterSegment } from "../../../components/layout/pane/footer";
|
|
16
17
|
import { CountryFlag } from "../../../components/ui/country-flag";
|
|
@@ -19,7 +20,8 @@ import { useFxRatesMap } from "../../../market-data/hooks";
|
|
|
19
20
|
import { resolveEntryData } from "../../../market-data/selectors";
|
|
20
21
|
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
21
22
|
import { usePaneSettingValue, useUpdatePaneSettings } from "../../../state/app/context";
|
|
22
|
-
import { colors } from "../../../theme/colors";
|
|
23
|
+
import { colors, shownPriceColor } from "../../../theme/colors";
|
|
24
|
+
import { formatPercentRaw, MISSING_VALUE } from "../../../utils/format";
|
|
23
25
|
import type {
|
|
24
26
|
CommandBarResultDef, CommandBarSearchProvider, GloomPluginContext, PaneProps, PaneTemplateContext, PaneTemplateCreateOptions,
|
|
25
27
|
PaneTemplateInstanceConfig,
|
|
@@ -55,6 +57,10 @@ const CURRENCY_FLAGS = new Map<string, ReactNode>(
|
|
|
55
57
|
FX_CURRENCIES.map((currency) => [currency, <CountryFlag region={CURRENCY_FLAG_REGIONS[currency]} />]),
|
|
56
58
|
);
|
|
57
59
|
const RATE_COLUMN_WIDTH = 10;
|
|
60
|
+
/** Room for `-12.34%`; the header takes what it needs. */
|
|
61
|
+
const MOVE_COLUMN_WIDTH = 9;
|
|
62
|
+
/** The currencies the day's move must fit beside: the eight majors the board opens with. */
|
|
63
|
+
const MOVE_FITS_BESIDE = 8;
|
|
58
64
|
/** Snapshot rates reload at this pace while the feed is not carrying every leg. */
|
|
59
65
|
const FX_FALLBACK_REFRESH_MS = 60_000;
|
|
60
66
|
|
|
@@ -252,17 +258,34 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
252
258
|
const value = convertedAmount(currency);
|
|
253
259
|
return value == null ? 1 : formatAmountFigure(value, currency).length;
|
|
254
260
|
})) : 0;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
261
|
+
// Each currency's value in dollars, its move on the day: the row currency against the dollar, so JPY -0.51% is the
|
|
262
|
+
// yen 0.51% weaker (USD/JPY up), read from its dollar pair against that pair's previous daily close (the references
|
|
263
|
+
// the cells' tints read). The dollar is the reference, so it has none.
|
|
264
|
+
const moveVsUsd = useCallback((row: string): number | null => {
|
|
265
|
+
if (row === "USD") return null;
|
|
266
|
+
const rate = rates.get(row);
|
|
267
|
+
const reference = directionReferences.get(row);
|
|
268
|
+
return rate == null || reference == null || !Number.isFinite(rate) || rate <= 0 ? null : crossMovePercent(rate, reference, 1, 1);
|
|
269
|
+
}, [directionReferences, rates]);
|
|
270
|
+
// The move is shown where it fits beside the first eight currencies; a pane with no room for both (a board saved
|
|
271
|
+
// at its old width) shows the currencies as it did, and one too narrow for them scrolls to the rest.
|
|
272
|
+
const allColumns = useMemo<DataTableColumn[]>(() => {
|
|
273
|
+
const columns: DataTableColumn[] = [
|
|
274
|
+
{ id: "base", label: "", width: flagged ? FLAGGED_BASE_COLUMN_WIDTH : BASE_COLUMN_WIDTH, align: "left" },
|
|
275
|
+
...amount ? [{ id: "amount", label: "Amount", width: amountWidth, align: "right" as const }] : [],
|
|
276
|
+
{ id: "move", label: "1D in USD", width: MOVE_COLUMN_WIDTH, align: "right",
|
|
277
|
+
title: "Each currency's value in US dollars, its move since its dollar pair's previous daily close: JPY -0.51% is the yen 0.51% weaker against the dollar" },
|
|
278
|
+
...currencies.map((currency) => ({
|
|
279
|
+
id: currency,
|
|
280
|
+
label: currency,
|
|
281
|
+
width: RATE_COLUMN_WIDTH,
|
|
282
|
+
align: "right" as const,
|
|
283
|
+
headerLeading: flagged ? CURRENCY_FLAGS.get(currency) : undefined,
|
|
284
|
+
})),
|
|
285
|
+
];
|
|
286
|
+
const throughEighth = columns.slice(0, columns.length - Math.max(0, currencies.length - MOVE_FITS_BESIDE));
|
|
287
|
+
return getTableWidth(throughEighth) <= width - 1 ? columns : columns.filter((column) => column.id !== "move");
|
|
288
|
+
}, [amount != null, amountWidth, currencies, flagged, width]);
|
|
266
289
|
|
|
267
290
|
const renderCell = useCallback((
|
|
268
291
|
row: FxCurrency,
|
|
@@ -279,6 +302,12 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
279
302
|
};
|
|
280
303
|
}
|
|
281
304
|
|
|
305
|
+
if (column.id === "move") {
|
|
306
|
+
const move = moveVsUsd(row);
|
|
307
|
+
if (move == null) return { text: row !== "USD" && status.loading > 0 ? "…" : MISSING_VALUE, color: colors.textDim };
|
|
308
|
+
return { text: formatPercentRaw(move), value: move, color: shownPriceColor(move, 2) };
|
|
309
|
+
}
|
|
310
|
+
|
|
282
311
|
if (column.id === "amount") {
|
|
283
312
|
const value = convertedAmount(row);
|
|
284
313
|
if (value == null) return { text: status.loading > 0 ? "…" : "—", color: colors.textDim };
|
|
@@ -311,7 +340,7 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
311
340
|
? directionTint(level, { background: colors.selected, text: colors.selectedText })
|
|
312
341
|
: directionTint(level, { background: colors.bg, text: colors.text });
|
|
313
342
|
return { text: formatRate(base / quote, quoteCurrency, reference), color: colors.text, backgroundColor };
|
|
314
|
-
}, [amount?.currency, convertedAmount, directionReferences, flagged, rates, referenceRates, status.loading]);
|
|
343
|
+
}, [amount?.currency, convertedAmount, directionReferences, flagged, moveVsUsd, rates, referenceRates, status.loading]);
|
|
315
344
|
|
|
316
345
|
const handleKeyDown = useCallback((event: DataTableKeyEvent) => handleRefreshKey(event, refresh), [refresh]);
|
|
317
346
|
|
|
@@ -469,7 +498,8 @@ export const fxMatrixModule: PluginModule = {
|
|
|
469
498
|
component: FxMatrixPane,
|
|
470
499
|
defaultPosition: "right",
|
|
471
500
|
defaultMode: "floating",
|
|
472
|
-
|
|
501
|
+
// Room for the eight majors after the codes and the day's move in dollars; narrower, the move gives way.
|
|
502
|
+
defaultFloatingSize: { width: 115, height: 14 },
|
|
473
503
|
tableExport: true,
|
|
474
504
|
settings: fxMatrixSettings,
|
|
475
505
|
},
|
|
@@ -5,7 +5,7 @@ import { GPU_MODELS, gpuArgument } from "./model";
|
|
|
5
5
|
import { GPU_SERIES } from "./series";
|
|
6
6
|
|
|
7
7
|
export const gpuModule: PluginModule = {
|
|
8
|
-
panes: [{ id: "gpu", name: "GPU Rental Prices", icon: "G", get component(): typeof import("./pane").GpuPane { const { GpuPane } = require("./pane"); return GpuPane; }, defaultPosition: "right", defaultMode: "floating",
|
|
8
|
+
panes: [{ id: "gpu", name: "GPU Rental Prices", icon: "G", shareItem: { argument: true }, get component(): typeof import("./pane").GpuPane { const { GpuPane } = require("./pane"); return GpuPane; }, defaultPosition: "right", defaultMode: "floating",
|
|
9
9
|
defaultFloatingSize: { width: 120, height: 34 }, tableExport: true, headless: gpuHeadless }],
|
|
10
10
|
paneTemplates: [{ id: "gpu-pane", paneId: "gpu", label: "GPU Rental Prices",
|
|
11
11
|
description: "Pro GPU rental list prices, provider-declared spot and marketplace asks, with sourced price history and related equities. Free preview available.",
|
|
@@ -154,7 +154,7 @@ export function FunctionsTable({
|
|
|
154
154
|
search={{
|
|
155
155
|
value: query,
|
|
156
156
|
onChange: setQuery,
|
|
157
|
-
placeholder: "function or description",
|
|
157
|
+
placeholder: ["function or description", "search functions"],
|
|
158
158
|
focused,
|
|
159
159
|
active: searching,
|
|
160
160
|
onActiveChange: onSearchingChange,
|
|
@@ -23,6 +23,8 @@ import { logFailure } from "../../../utils/log-failure";
|
|
|
23
23
|
import { VERSION } from "../../../version";
|
|
24
24
|
import { getCurrentPluginTarget } from "../../current-target";
|
|
25
25
|
import { openUrl } from "../../../components/ui/external-link";
|
|
26
|
+
import { useShortcut } from "../../../react/input";
|
|
27
|
+
import { isPlainKey } from "../../../utils/keyboard";
|
|
26
28
|
|
|
27
29
|
const HELP_TABS = [
|
|
28
30
|
{ label: "Basics", value: "basics" },
|
|
@@ -68,7 +70,15 @@ const KEY_COLUMN_MAX_SHARE = 0.4;
|
|
|
68
70
|
|
|
69
71
|
function HelpPane({ focused, width, height }: PaneProps) {
|
|
70
72
|
const registry = getSharedRegistry();
|
|
71
|
-
const { openCommandBar, showPane, createPaneFromTemplate } = usePluginAppActions();
|
|
73
|
+
const { openCommandBar, showPane, hidePane, createPaneFromTemplate } = usePluginAppActions();
|
|
74
|
+
// Esc closes Help, once nothing in it took the key: a search, a key
|
|
75
|
+
// capture or a form backs out first.
|
|
76
|
+
useShortcut((event) => {
|
|
77
|
+
if (!isPlainKey(event, "escape", "esc")) return;
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
event.stopPropagation();
|
|
80
|
+
hidePane("help");
|
|
81
|
+
}, { phase: "idle", enabled: focused });
|
|
72
82
|
// A key capture requested from the command bar belongs to the Shortcuts
|
|
73
83
|
// tab, whether the pane is already open or is being opened for it.
|
|
74
84
|
const [activeTabId, setActiveTabId] = usePluginPaneState<HelpTabId>("activeTab", "basics");
|
|
@@ -53,6 +53,7 @@ import type { KeybindingsConfig } from "../../../types/config";
|
|
|
53
53
|
import type { KeyboardShortcut } from "../../../types/plugin";
|
|
54
54
|
import { useUiHost } from "../../../ui";
|
|
55
55
|
import { isPlainKey } from "../../../utils/keyboard";
|
|
56
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
56
57
|
import { detectShortcutPlatform, getShortcutDisplayMode } from "../../../utils/shortcut-labels";
|
|
57
58
|
import { getSharedRegistry } from "../../registry";
|
|
58
59
|
import { usePluginAppActions } from "../../runtime";
|
|
@@ -218,8 +219,11 @@ export function KeybindingsEditor({
|
|
|
218
219
|
|
|
219
220
|
const writeKeybindings = useCallback((next: KeybindingsConfig | undefined) => {
|
|
220
221
|
dispatch({ type: "SET_KEYBINDINGS", keybindings: next });
|
|
221
|
-
|
|
222
|
-
|
|
222
|
+
saveConfigImmediately(updateKeybindingsConfig(stateRef.current.config, next)).catch((error: unknown) => {
|
|
223
|
+
logFailure("help.keybindings", "Saving keybindings failed")(error);
|
|
224
|
+
notify({ type: "error", body: t("Could not save your keybindings.") });
|
|
225
|
+
});
|
|
226
|
+
}, [dispatch, notify, stateRef]);
|
|
223
227
|
|
|
224
228
|
const startCapture = useCallback((target: CaptureTarget) => {
|
|
225
229
|
setFeedback(null);
|
|
@@ -256,7 +260,7 @@ export function KeybindingsEditor({
|
|
|
256
260
|
return;
|
|
257
261
|
}
|
|
258
262
|
// A built-in action's key is refused, so a binding never leaves the command bar or close pane dead.
|
|
259
|
-
const core = coreActionOnChord(resolved, chord, capture.kind === "row" ? capture.row.action?.id : undefined);
|
|
263
|
+
const core = coreActionOnChord(resolved, chord, capture.kind === "row" ? capture.row.action?.id : undefined, { command: isCommand });
|
|
260
264
|
if (core) {
|
|
261
265
|
setFeedback({ tone: "warning", text: takenChordMessage(formatChord(chord), core) });
|
|
262
266
|
return;
|
|
@@ -25,6 +25,7 @@ export const holdersModule: PluginModule = {
|
|
|
25
25
|
icon: "H",
|
|
26
26
|
get component(): typeof import("./pane").HoldersView { const { HoldersView } = require("./pane"); return HoldersView; },
|
|
27
27
|
defaultPosition: "right",
|
|
28
|
+
shareItem: { ticker: true },
|
|
28
29
|
tickerFollower: true,
|
|
29
30
|
defaultMode: "floating",
|
|
30
31
|
defaultFloatingSize: { width: 105, height: 34 },
|
|
@@ -139,10 +139,10 @@ export function holderShareBasisMarker(row: { shareBasis?: unknown }): string {
|
|
|
139
139
|
* line are positions in the receipts, or that a receipt line's rows all are.
|
|
140
140
|
*/
|
|
141
141
|
export function holderShareBasisNote(
|
|
142
|
-
data: Pick<HolderData, "shareBasis" | "adrRatio">,
|
|
142
|
+
data: Pick<HolderData, "shareBasis" | "adrRatio" | "depositaryPair">,
|
|
143
143
|
rows: ReadonlyArray<{ shareBasis?: unknown }>,
|
|
144
144
|
): string | null {
|
|
145
|
-
const ratio = adrRatioText(data.adrRatio);
|
|
145
|
+
const ratio = adrRatioText(data.adrRatio, data.depositaryPair?.ordinary[0]);
|
|
146
146
|
const each = ratio ? ` (${ratio})` : "";
|
|
147
147
|
if (rows.some((row) => holderShareBasisMarker(row))) return `ADR: shares held as depositary receipts${each}.`;
|
|
148
148
|
if (rows.length > 0 && data.shareBasis === "depositary_receipt") return `Shares are depositary receipts${each}.`;
|
|
@@ -10,7 +10,7 @@ export const ivHistoryModule: PluginModule = {
|
|
|
10
10
|
series: IV_SERIES,
|
|
11
11
|
panes: [{
|
|
12
12
|
id: "iv-history", name: "Implied Volatility History", icon: "V", get component(): typeof import("./pane").IvHistoryPane { const { IvHistoryPane } = require("./pane"); return IvHistoryPane; },
|
|
13
|
-
defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 118, height: 36 },
|
|
13
|
+
defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 118, height: 36 },
|
|
14
14
|
tableExport: true,
|
|
15
15
|
settings: { title: "Implied Volatility History", fields: [
|
|
16
16
|
{ key: "lookback", label: "Lookback", type: "select", options: [{ value: "1Y", label: "1 year" }, { value: "2Y", label: "2 years" }, { value: "ALL", label: "All stored" }] },
|
|
@@ -2,9 +2,10 @@ import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
|
2
2
|
import { resolveHeadlessInstrument } from "../shared/headless-market-data";
|
|
3
3
|
import { loadMacroDayEarnings, loadMacroDayHistory, loadMacroDaySeriesHistory, loadMacroReleases, macroDayEarningsNotice, type MacroDayEarnings } from "./client";
|
|
4
4
|
import { fredSeriesArgument } from "../../../series/fred-argument";
|
|
5
|
-
import { formatMacroDayMove, macroDayEventLabel, macroDayStats, matchesSurprise, projectMacroDays, type
|
|
5
|
+
import { formatMacroDayMove, macroDayEventLabel, macroDayReleaseName, macroDayStats, macroFigureGapNotices, matchesSurprise, projectMacroDays, type MacroDayEvent,
|
|
6
|
+
type MacroDayStats } from "./model";
|
|
6
7
|
import { MACRO_EVENT_KINDS, MACRO_EVENT_LABELS, MACRO_RELEASE_SOURCES, MACRO_SURPRISE_LABELS, MACRO_SURPRISES, staleMacroReleasesNotice,
|
|
7
|
-
type MacroEventKind, type MacroSurprise } from "./releases";
|
|
8
|
+
type MacroEventKind, type MacroReleaseFigures, type MacroSurprise } from "./releases";
|
|
8
9
|
|
|
9
10
|
// A mean that rounds to zero reads 0.00%, never -0.00%.
|
|
10
11
|
const percent = (value: unknown) => typeof value !== "number" ? "--" : /[1-9]/.test((value * 100).toFixed(2)) ? `${(value * 100).toFixed(2)}%` : "0.00%";
|
|
@@ -22,7 +23,8 @@ export const macroDayHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
22
23
|
discovery: { screenshotReadiness: "live-dom", limitations: [
|
|
23
24
|
"US listings, or a FRED series (FRED:T10Y2Y, whose moves in a rate or spread read in bp); close-to-close on the release day.",
|
|
24
25
|
"Published CPI, jobs and FOMC days, and Brazil's IPCA days from Gloom Cloud; sessions after the list's last covered day (releasesThrough) are left out.",
|
|
25
|
-
"Actual, forecast and prior for the days Gloom Cloud has them (the US headlines from its kept economic calendar, IPCA from the central bank's SGS series); --surprise keeps the days that came in hot, cool or in line with the forecast.",
|
|
26
|
+
"Actual, forecast and prior for the days Gloom Cloud has them (the US headlines from its kept economic calendar, under either feed's title; an FOMC day's are the federal funds target range and whether it held or moved; IPCA from the central bank's SGS series); --surprise keeps the days that came in hot, cool or in line with the forecast.",
|
|
27
|
+
"A release day without figures says why: before the kept calendar starts, or listed without them.",
|
|
26
28
|
"A release day that is also the reaction session of the company's own earnings report is marked earnings and left out of the release averages and the normal day.",
|
|
27
29
|
] },
|
|
28
30
|
options: [
|
|
@@ -61,6 +63,15 @@ export const macroDayHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
61
63
|
// The days the filter keeps get a row of their own: how the name moved on hot CPI days.
|
|
62
64
|
const selected = surprise === "all" ? [] : [row(`${MACRO_SURPRISE_LABELS[surprise]} ${release === "all" ? "release"
|
|
63
65
|
: MACRO_EVENT_LABELS[release as MacroEventKind]}`, macroDayStats(events, model.normal.meanAbs))];
|
|
66
|
+
// A day without figures says why: before the kept calendar (one note for them all), or the calendar's own gap.
|
|
67
|
+
const figuresFrom = releases.figuresFrom;
|
|
68
|
+
const beforeCalendar = (event: MacroDayEvent) => !!figuresFrom && event.kind !== "ipca" && !event.figures && event.date < figuresFrom;
|
|
69
|
+
const missing = (event: MacroDayEvent) => event.figures ? null : event.figuresMissing
|
|
70
|
+
?? (beforeCalendar(event) ? `before ${figuresFrom}, when Gloom Cloud's economic calendar starts` : null);
|
|
71
|
+
const figureNotes = [
|
|
72
|
+
...(events.some(beforeCalendar) ? [`Release days before ${figuresFrom} have no actual, forecast or prior: Gloom Cloud's economic calendar starts then.`] : []),
|
|
73
|
+
...macroFigureGapNotices(events),
|
|
74
|
+
];
|
|
64
75
|
return {
|
|
65
76
|
sections: [
|
|
66
77
|
{ title: "By release", columns: [{ key: "label", header: "Day" }, { key: "count", header: "Days" },
|
|
@@ -68,18 +79,26 @@ export const macroDayHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
68
79
|
{ key: "mean", header: header("Avg move"), format: move }, { key: "hitRate", header: "Up", format: share }],
|
|
69
80
|
rows: [...model.kinds.map((kind) => row(MACRO_EVENT_LABELS[kind], model.byKind[kind])), ...selected,
|
|
70
81
|
row(model.kinds.includes("ipca") ? "Any US release" : "Any release", model.allEvents), ...(model.earnings.count ? [row("Earnings", model.earnings)] : []), row("Normal day", model.normal)] },
|
|
71
|
-
{ title: "Release days", columns: [{ key: "date", header: "Date" },
|
|
82
|
+
{ title: "Release days", columns: [{ key: "date", header: "Date" },
|
|
83
|
+
// The text table reads the decision beside its release (FOMC held), as the pane does; exports keep the two apart.
|
|
84
|
+
{ key: "event", header: "Release", textFormat: (_value, row) => macroDayEventLabel({ kind: row.kind as MacroEventKind,
|
|
85
|
+
earnings: row.earnings === true, figures: typeof row.decision === "string" ? { decision: row.decision } as MacroReleaseFigures : null }) },
|
|
72
86
|
{ key: "actual", header: "Actual" }, { key: "forecast", header: "Forecast" }, { key: "prior", header: "Prior" },
|
|
73
87
|
{ key: "surprise", header: "Surprise" },
|
|
74
88
|
{ key: "session", header: "Session" }, { key: "move", header: header("Move"), format: move }, { key: "multiple", header: "vs normal", format: multiple }],
|
|
75
|
-
rows: events.map((
|
|
76
|
-
|
|
77
|
-
|
|
89
|
+
rows: events.map((day) => {
|
|
90
|
+
const { figures, figuresMissing: _gap, ...event } = day;
|
|
91
|
+
const why = missing(day);
|
|
92
|
+
return { ...event, event: macroDayReleaseName(day), actual: figures?.actual ?? null,
|
|
93
|
+
forecast: figures?.forecast ?? null, prior: figures?.prior ?? null, surprise: figures?.surprise ?? null,
|
|
94
|
+
...(figures ? { headline: figures.event } : {}), ...(figures?.decision ? { decision: figures.decision } : {}),
|
|
95
|
+
...(why ? { figuresMissing: why } : {}) };
|
|
96
|
+
}) },
|
|
78
97
|
],
|
|
79
98
|
complete: !history.stale && !earnings.stale && !history.error && !notes.length && model.events.length > 0,
|
|
80
99
|
unavailableSymbols: model.events.length ? [] : [symbol],
|
|
81
100
|
errors: history.error ? [history.error] : [],
|
|
82
|
-
...(notes.length ? { notes } : {}),
|
|
101
|
+
...(notes.length || figureNotes.length ? { notes: [...notes, ...figureNotes] } : {}),
|
|
83
102
|
metadata: { unit: yieldMoves ? `change in the ${seriesId ? "rate" : "yield"} in percentage points, close to close on the release day`
|
|
84
103
|
: "decimal return, close to close on the release day", start: model.start, asOf: model.asOf,
|
|
85
104
|
releasesThrough: releases.coveredThrough, releaseSources: Object.values(MACRO_RELEASE_SOURCES),
|
|
@@ -7,7 +7,7 @@ import { LOOKBACK_OPTIONS, MacroDayPane } from "./pane";
|
|
|
7
7
|
export const macroDayModule: PluginModule = {
|
|
8
8
|
panes: [{
|
|
9
9
|
id: "macro-day", name: "Macro-Day Reaction", icon: "M", component: MacroDayPane,
|
|
10
|
-
defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 76, height: 26 },
|
|
10
|
+
defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 76, height: 26 },
|
|
11
11
|
tableExport: true,
|
|
12
12
|
settings: { title: "Macro-Day Reaction Settings", fields: [
|
|
13
13
|
{ key: "lookbackYears", label: "Lookback", type: "select", options: LOOKBACK_OPTIONS },
|
|
@@ -62,6 +62,8 @@ export interface MacroDayEvent {
|
|
|
62
62
|
multiple: number | null;
|
|
63
63
|
/** What the release came out with, when the list has it. */
|
|
64
64
|
figures: MacroReleaseFigures | null;
|
|
65
|
+
/** Why it has none, when the list says. */
|
|
66
|
+
figuresMissing?: string;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
export interface MacroDayStats {
|
|
@@ -97,10 +99,23 @@ export interface MacroDayModel {
|
|
|
97
99
|
asOf: string | null;
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
/** The release's name
|
|
101
|
-
export const macroDayEventLabel = (event: Pick<MacroDayEvent, "kind" | "earnings">) =>
|
|
102
|
+
/** The release's name as it reads in the table: a policy decision's move after it (FOMC held), and the earnings marker. */
|
|
103
|
+
export const macroDayEventLabel = (event: Pick<MacroDayEvent, "kind" | "earnings" | "figures">) =>
|
|
104
|
+
[MACRO_EVENT_LABELS[event.kind], macroDayEventNote(event)].filter(Boolean).join(" ");
|
|
105
|
+
|
|
106
|
+
/** The release's name alone, with the earnings marker, as exports name it: the decision is a field of its own. */
|
|
107
|
+
export const macroDayReleaseName = (event: Pick<MacroDayEvent, "kind" | "earnings">) =>
|
|
102
108
|
event.earnings ? `${MACRO_EVENT_LABELS[event.kind]} (earnings)` : MACRO_EVENT_LABELS[event.kind];
|
|
103
109
|
|
|
110
|
+
/** One line for each release day the economic calendar covers that has no figures, saying why. */
|
|
111
|
+
export const macroFigureGapNotices = (events: readonly Pick<MacroDayEvent, "kind" | "date" | "figures" | "figuresMissing">[]) =>
|
|
112
|
+
events.filter((event) => !event.figures && event.figuresMissing)
|
|
113
|
+
.map((event) => `${event.date} ${MACRO_EVENT_LABELS[event.kind]} has no figures: ${event.figuresMissing}.`);
|
|
114
|
+
|
|
115
|
+
/** What a row adds to its release's name: a policy decision's move, and the earnings marker. */
|
|
116
|
+
export const macroDayEventNote = (event: Pick<MacroDayEvent, "earnings" | "figures">) =>
|
|
117
|
+
[event.figures?.decision, event.earnings ? "(earnings)" : null].filter(Boolean).join(" ");
|
|
118
|
+
|
|
104
119
|
/** Daily labels at UTC midnight name that date; any other stamp reads in New York. */
|
|
105
120
|
function sessionDate(time: number): string {
|
|
106
121
|
if (time % DAY_MS === 0) return new Date(time).toISOString().slice(0, 10);
|
|
@@ -215,7 +230,8 @@ export function projectMacroDays(history: readonly PricePoint[], options: {
|
|
|
215
230
|
const move = moves.get(session);
|
|
216
231
|
if (move == null || (session !== release.date && skipsAnotherWeekday(release.date, sessions[at - 1]!, session))) continue;
|
|
217
232
|
if (US_KINDS.has(release.kind)) reactionSessions.add(session);
|
|
218
|
-
found.push({ kind: release.kind, date: release.date, session, move, figures: release.figures ?? null
|
|
233
|
+
found.push({ kind: release.kind, date: release.date, session, move, figures: release.figures ?? null,
|
|
234
|
+
...(release.figuresMissing ? { figuresMissing: release.figuresMissing } : {}) });
|
|
219
235
|
}
|
|
220
236
|
|
|
221
237
|
const normalMoves = [...moves].filter(([date]) => !reactionSessions.has(date)).map(([, move]) => move);
|
|
@@ -14,7 +14,8 @@ import type { PaneProps } from "../../../types/plugin";
|
|
|
14
14
|
import { Box } from "../../../ui";
|
|
15
15
|
import { loadMacroDayEarnings, loadMacroDayHistory, loadMacroReleases, macroDayEarningsNotice } from "./client";
|
|
16
16
|
import {
|
|
17
|
-
formatMacroDayMove, macroDayEventLabel, macroDayMoveDecimals, macroDayStats, matchesSurprise,
|
|
17
|
+
formatMacroDayMove, macroDayEventLabel, macroDayEventNote, macroDayMoveDecimals, macroDayStats, matchesSurprise, macroFigureGapNotices,
|
|
18
|
+
projectMacroDays, type MacroDayEvent,
|
|
18
19
|
type MacroDayModel, type MacroDayMoveBasis,
|
|
19
20
|
} from "./model";
|
|
20
21
|
import { MACRO_EVENT_KINDS, MACRO_EVENT_LABELS, MACRO_SURPRISE_LABELS, MACRO_SURPRISES, staleMacroReleasesNotice, type MacroEventKind,
|
|
@@ -26,7 +27,6 @@ const SURPRISE_OPTIONS = [{ value: "all", label: "All" }, ...MACRO_SURPRISES.map
|
|
|
26
27
|
|
|
27
28
|
const times = (value: number | null | undefined) => value == null ? "--" : `${value.toFixed(1)}x`;
|
|
28
29
|
|
|
29
|
-
const EARNINGS_MARK = "earnings";
|
|
30
30
|
const DATE: DataTableColumn = { id: "date", label: "Date", width: 19, align: "left" };
|
|
31
31
|
/** The move and its multiple of a normal day's; a yield's move is in basis points, and its header says so. */
|
|
32
32
|
const moveColumns = (basis: MacroDayMoveBasis): DataTableColumn[] => [
|
|
@@ -44,14 +44,16 @@ function figureColumns(rows: readonly MacroDayEvent[]): DataTableColumn[] {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* With every release listed, the release's name, widened to take the earnings marker where a row
|
|
48
|
-
* selected, a column only for
|
|
47
|
+
* With every release listed, the release's name, widened to take a policy decision and the earnings marker where a row
|
|
48
|
+
* has them. With one selected, a column only for those: every row would repeat the name.
|
|
49
49
|
*/
|
|
50
50
|
export function columnsFor(release: string, rows: readonly MacroDayEvent[], basis: MacroDayMoveBasis = "return"): DataTableColumn[] {
|
|
51
|
-
const marked = rows.some((event) => event.earnings);
|
|
52
51
|
const values = [...figureColumns(rows), ...moveColumns(basis)];
|
|
53
|
-
if (release === "all") return [DATE, { id: "release", label: "Release",
|
|
54
|
-
|
|
52
|
+
if (release === "all") return [DATE, { id: "release", label: "Release", align: "left",
|
|
53
|
+
width: tableColumnWidth({ label: "Release", width: Math.max(6, ...rows.map((event) => displayWidth(macroDayEventLabel(event)))) }) }, ...values];
|
|
54
|
+
const notes = rows.map((event) => displayWidth(macroDayEventNote(event)));
|
|
55
|
+
return notes.some(Boolean) ? [DATE, { id: "release", label: "Note", align: "left", width: tableColumnWidth({ label: "Note", width: Math.max(...notes) }) },
|
|
56
|
+
...values] : [DATE, ...values];
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/** By the sign the text shows: an average that rounds to 0.00% (or 0.0bp) is neither up nor down. */
|
|
@@ -127,8 +129,11 @@ export function MacroDayPane({ width, height, focused }: PaneProps) {
|
|
|
127
129
|
[model, release, surprise, rows]);
|
|
128
130
|
const columns = useMemo(() => columnsFor(release, rows, model?.basis), [model?.basis, release, rows]);
|
|
129
131
|
|
|
132
|
+
// A covered release day the calendar left without figures says why; days before the calendar are the docs' to explain.
|
|
133
|
+
const figureGaps = useMemo(() => macroFigureGapNotices(rows), [rows]);
|
|
130
134
|
usePaneNoticeFooter({ registrationId: "macro-day-notices", focused,
|
|
131
|
-
notices: [...new Set([identityError, history.error, history.data?.error, releasesNotice, earningsNotice
|
|
135
|
+
notices: [...new Set([identityError, history.error, history.data?.error, releasesNotice, earningsNotice, ...figureGaps]
|
|
136
|
+
.filter((value): value is string => !!value))] });
|
|
132
137
|
usePaneFooter("macro-day", () => ({ info: [
|
|
133
138
|
...(history.loading ? [{ id: "loading", parts: [{ text: "loading history", tone: "muted" as const }] }] : []),
|
|
134
139
|
...(history.data?.stale || history.data?.earnings.stale ? [{ id: "stale", parts: [{ text: "stale history", tone: "warning" as const }] }] : []),
|
|
@@ -137,7 +142,7 @@ export function MacroDayPane({ width, height, focused }: PaneProps) {
|
|
|
137
142
|
|
|
138
143
|
const renderCell = useCallback((event: MacroDayEvent, column: DataTableColumn): DataTableCell => {
|
|
139
144
|
if (column.id === "date") return { text: event.session === event.date ? event.date : `${event.date} → ${event.session.slice(5)}`, value: event.date };
|
|
140
|
-
if (column.id === "release") return { text: release === "all" ? macroDayEventLabel(event) : event
|
|
145
|
+
if (column.id === "release") return { text: release === "all" ? macroDayEventLabel(event) : macroDayEventNote(event) };
|
|
141
146
|
// The print colored against the consensus, as the economic calendar colors it.
|
|
142
147
|
if (column.id === "actual") return { text: event.figures?.actual ?? "", color: event.figures?.surprise === "hot" ? colors.positive
|
|
143
148
|
: event.figures?.surprise === "cool" ? colors.negative : undefined };
|
|
@@ -39,15 +39,25 @@ export interface MacroReleaseFigures {
|
|
|
39
39
|
forecast: string | null;
|
|
40
40
|
prior: string | null;
|
|
41
41
|
surprise: MacroSurprise | null;
|
|
42
|
+
/** A policy decision's move: "held", "cut 25bp", "raised 50bp". */
|
|
43
|
+
decision?: string;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
export interface MacroRelease {
|
|
46
|
+
export interface MacroRelease {
|
|
47
|
+
kind: MacroEventKind;
|
|
48
|
+
date: string;
|
|
49
|
+
figures?: MacroReleaseFigures;
|
|
50
|
+
/** Why a day Gloom Cloud's economic calendar covers has no figures: it lists the release without them, or not at all. */
|
|
51
|
+
figuresMissing?: string;
|
|
52
|
+
}
|
|
45
53
|
|
|
46
54
|
export interface MacroReleaseList {
|
|
47
55
|
/** Oldest first. */
|
|
48
56
|
releases: MacroRelease[];
|
|
49
57
|
/** The last day the list is complete for: later sessions are left out, release day or not. */
|
|
50
58
|
coveredThrough: string;
|
|
59
|
+
/** The first day Gloom Cloud's economic calendar covers: US days before it have no figures. */
|
|
60
|
+
figuresFrom?: string;
|
|
51
61
|
}
|
|
52
62
|
|
|
53
63
|
const DAY_MS = 86_400_000;
|
|
@@ -70,19 +80,24 @@ function servedFigures(value: unknown): MacroReleaseFigures | undefined {
|
|
|
70
80
|
const event = text(figures?.event);
|
|
71
81
|
if (!event) return undefined;
|
|
72
82
|
const surprise = MACRO_SURPRISES.find((candidate) => candidate === figures?.surprise) ?? null;
|
|
73
|
-
|
|
83
|
+
const decision = text(figures?.decision);
|
|
84
|
+
return { event, actual: text(figures?.actual), forecast: text(figures?.forecast), prior: text(figures?.prior), surprise,
|
|
85
|
+
...(decision ? { decision } : {}) };
|
|
74
86
|
}
|
|
75
87
|
|
|
76
88
|
/**
|
|
77
89
|
* The served list extends the floor past its end; the floor keeps its own
|
|
78
90
|
* days up to there. IPCA, which the floor does not carry, is the served list's
|
|
79
91
|
* through its end, and left out when the server lists none. Every day takes
|
|
80
|
-
* the figures the server has for it
|
|
81
|
-
*
|
|
92
|
+
* the figures the server has for it, or the reason it gives for having none;
|
|
93
|
+
* US days before its economic calendar (`figuresFrom`) have none. A served
|
|
94
|
+
* list that breaks the contract, or ends no later than the floor, adds
|
|
95
|
+
* nothing.
|
|
82
96
|
*/
|
|
83
97
|
export function mergeMacroReleases(floor: MacroReleaseList, served: unknown): MacroReleaseList {
|
|
84
98
|
const payload = served as { coveredThrough?: unknown; releases?: Partial<Record<MacroEventKind, unknown>>;
|
|
85
|
-
figures?: Partial<Record<MacroEventKind, Record<string, unknown
|
|
99
|
+
figures?: Partial<Record<MacroEventKind, Record<string, unknown>>>; figuresFrom?: unknown;
|
|
100
|
+
figureGaps?: Partial<Record<MacroEventKind, Record<string, unknown>>> } | null;
|
|
86
101
|
const coveredThrough = payload?.coveredThrough;
|
|
87
102
|
if (!isDate(coveredThrough) || coveredThrough <= floor.coveredThrough) return floor;
|
|
88
103
|
const later: MacroRelease[] = [];
|
|
@@ -97,11 +112,14 @@ export function mergeMacroReleases(floor: MacroReleaseList, served: unknown): Ma
|
|
|
97
112
|
if (Array.isArray(ipca) && ipca.every(isDate)) {
|
|
98
113
|
for (const date of new Set(ipca)) if (date <= coveredThrough) later.push({ kind: "ipca", date });
|
|
99
114
|
}
|
|
115
|
+
const figuresFrom = isDate(payload?.figuresFrom) ? payload.figuresFrom : null;
|
|
100
116
|
const figuresOf = (release: MacroRelease): MacroRelease => {
|
|
101
117
|
const figures = servedFigures(payload?.figures?.[release.kind]?.[release.date]);
|
|
102
|
-
|
|
118
|
+
if (figures) return { ...release, figures };
|
|
119
|
+
const missing = text(payload?.figureGaps?.[release.kind]?.[release.date]);
|
|
120
|
+
return missing ? { ...release, figuresMissing: missing } : release;
|
|
103
121
|
};
|
|
104
|
-
return { releases: [...floor.releases, ...later].map(figuresOf).sort(byDate), coveredThrough };
|
|
122
|
+
return { releases: [...floor.releases, ...later].map(figuresOf).sort(byDate), coveredThrough, ...(figuresFrom ? { figuresFrom } : {}) };
|
|
105
123
|
}
|
|
106
124
|
|
|
107
125
|
/** Whole days from the list's last covered day to today in New York. */
|
|
@@ -40,6 +40,7 @@ export const marketValuationModule: PluginModule = {
|
|
|
40
40
|
id: MARKET_VALUATION_PANE_ID,
|
|
41
41
|
name: "Market Valuation",
|
|
42
42
|
icon: "V",
|
|
43
|
+
shareItem: { open: true, argument: true },
|
|
43
44
|
get component(): typeof import("./pane").MarketValuationPane { const { MarketValuationPane } = require("./pane"); return MarketValuationPane; },
|
|
44
45
|
defaultPosition: "right",
|
|
45
46
|
defaultMode: "floating",
|
|
@@ -66,6 +66,13 @@ function buildColumns(width: number, stacked: boolean): Column[] {
|
|
|
66
66
|
];
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
/** A link to the pane names the indicator its chart shows, with its reading. */
|
|
70
|
+
function indicatorShareItem(row: IndicatorRow) {
|
|
71
|
+
const cells = cellsFor(row);
|
|
72
|
+
const reading = row.view?.zone ? [cells.value.text, row.view.zone.label].filter(Boolean).join(" · ") : null;
|
|
73
|
+
return { title: row.indicator.label, excerpt: reading };
|
|
74
|
+
}
|
|
75
|
+
|
|
69
76
|
// Stable table adapters so memoized rows survive pane re-renders.
|
|
70
77
|
const indicatorKey = (row: IndicatorRow) => row.indicator.id;
|
|
71
78
|
const renderIndicatorCell = (row: IndicatorRow, column: Column) => cellsFor(row)[column.id];
|
|
@@ -124,6 +131,7 @@ export function MarketValuationPane({ focused, width, height }: PaneProps) {
|
|
|
124
131
|
onSelect: setIndicatorId,
|
|
125
132
|
reload: refresh,
|
|
126
133
|
range: { value: range, options: RANGE_VIEW_OPTIONS, onChange: setRange, chartRange: true },
|
|
134
|
+
shareItem: indicatorShareItem,
|
|
127
135
|
});
|
|
128
136
|
const { selected } = list;
|
|
129
137
|
const selectedView = selected?.view;
|
|
@@ -6,7 +6,7 @@ export const membersPlugin: GloomPlugin = {
|
|
|
6
6
|
id: "members", name: "Index and ETF members", version: "1.0.0", description: "ETF holdings, member returns, contributions, breadth and index changes", toggleable: true,
|
|
7
7
|
setup(ctx) { fundBreadthCache.attach(ctx.persistence); fundListCache.attach(ctx.persistence); fundMembersCache.attach(ctx.persistence); fundChangesCache.attach(ctx.persistence); },
|
|
8
8
|
dispose() { fundBreadthCache.reset(); fundListCache.reset(); fundMembersCache.reset(); fundChangesCache.reset(); },
|
|
9
|
-
panes: [{ id: "members", name: "Index and ETF members", icon: "M", get component(): typeof import("./pane").MembersPane { const { MembersPane } = require("./pane"); return MembersPane; }, tickerFollower: true,
|
|
9
|
+
panes: [{ id: "members", name: "Index and ETF members", icon: "M", get component(): typeof import("./pane").MembersPane { const { MembersPane } = require("./pane"); return MembersPane; }, shareItem: { ticker: true }, tickerFollower: true,
|
|
10
10
|
defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 132, height: 32 }, tableExport: true,
|
|
11
11
|
settings: { fields: [{ key: "tab", label: "View", type: "select", options: TABS }] } }],
|
|
12
12
|
paneTemplates: [{ id: "members-pane", paneId: "members", label: "Index and ETF members", description: "ETF holdings, member returns, daily contributions, breadth and index changes.",
|
|
@@ -35,6 +35,7 @@ export const mnaModule: PluginModule = {
|
|
|
35
35
|
// MA and DIST open this pane: DIST sets the tab param, MA a ticker.
|
|
36
36
|
identitySettings: ["ticker"],
|
|
37
37
|
defaultPosition: "right",
|
|
38
|
+
shareItem: { ticker: true },
|
|
38
39
|
tickerFollower: true,
|
|
39
40
|
instruments: ["equity"],
|
|
40
41
|
defaultMode: "floating",
|
|
@@ -193,6 +193,7 @@ export const tickerNewsModule: PluginModule = {
|
|
|
193
193
|
icon: "C",
|
|
194
194
|
component: TickerNewsView,
|
|
195
195
|
defaultPosition: "right",
|
|
196
|
+
shareItem: { open: true, ticker: true },
|
|
196
197
|
tickerFollower: true,
|
|
197
198
|
defaultMode: "floating",
|
|
198
199
|
defaultFloatingSize: { width: 100, height: 32 },
|
|
@@ -67,11 +67,12 @@ let disposeBreakingNewsNotifications: (() => void) | null = null;
|
|
|
67
67
|
const NEWS_REPORT_FRESHNESS: PaneDef["reportFreshness"] = { status: "not-a-feed", basis: "published stories" };
|
|
68
68
|
|
|
69
69
|
const newsWirePanes: PluginModule["panes"] = [
|
|
70
|
-
{ id: "news-top", reportFreshness: NEWS_REPORT_FRESHNESS, name: "Top News", icon: "T", component: TopPane, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 90, height: 30 } },
|
|
70
|
+
{ id: "news-top", reportFreshness: NEWS_REPORT_FRESHNESS, name: "Top News", icon: "T", shareItem: { open: true }, component: TopPane, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 90, height: 30 } },
|
|
71
71
|
{
|
|
72
72
|
id: "news-feed",
|
|
73
73
|
name: "News Feed",
|
|
74
74
|
icon: "N",
|
|
75
|
+
shareItem: { open: true },
|
|
75
76
|
component: FeedPane,
|
|
76
77
|
defaultPosition: "right",
|
|
77
78
|
defaultMode: "floating",
|
|
@@ -83,6 +84,7 @@ const newsWirePanes: PluginModule["panes"] = [
|
|
|
83
84
|
reportFreshness: NEWS_REPORT_FRESHNESS,
|
|
84
85
|
name: TOPIC_NEWS_TITLE,
|
|
85
86
|
icon: "S",
|
|
87
|
+
shareItem: { open: true, argument: true },
|
|
86
88
|
component: IndustryPane,
|
|
87
89
|
defaultPosition: "right",
|
|
88
90
|
defaultMode: "floating",
|
|
@@ -95,6 +97,7 @@ const newsWirePanes: PluginModule["panes"] = [
|
|
|
95
97
|
reportArgument: { kind: "free-text", placeholder: "story id", description: "The id of the story to open.", identifier: true },
|
|
96
98
|
name: "Story",
|
|
97
99
|
icon: "A",
|
|
100
|
+
shareItem: { open: true },
|
|
98
101
|
component: NewsStoryPane,
|
|
99
102
|
defaultPosition: "right",
|
|
100
103
|
defaultMode: "floating",
|
|
@@ -105,6 +108,7 @@ const newsWirePanes: PluginModule["panes"] = [
|
|
|
105
108
|
reportFreshness: NEWS_REPORT_FRESHNESS,
|
|
106
109
|
name: "Breaking News",
|
|
107
110
|
icon: "!",
|
|
111
|
+
shareItem: { open: true },
|
|
108
112
|
component: BreakingPane,
|
|
109
113
|
defaultPosition: "right",
|
|
110
114
|
defaultMode: "floating",
|
|
@@ -18,6 +18,8 @@ import { logFailure } from "../../../../../utils/log-failure";
|
|
|
18
18
|
import { mergeNewsArticle } from "../../../../../news/news-model";
|
|
19
19
|
import { usePluginPaneState } from "../../../../runtime";
|
|
20
20
|
import { formatNewsCategory } from "../categories";
|
|
21
|
+
import { shareItemExcerpt } from "../../../../../shares/item";
|
|
22
|
+
import { usePaneShareItem } from "../../../../../shares/pane-item";
|
|
21
23
|
|
|
22
24
|
function hasStoryItems(article: MarketNewsItem | null): boolean {
|
|
23
25
|
return (article?.items?.length ?? 0) > 0;
|
|
@@ -233,6 +235,8 @@ export function NewsDetailView({ item, focused, width, showTitle = true }: {
|
|
|
233
235
|
showTitle?: boolean;
|
|
234
236
|
}) {
|
|
235
237
|
const { nativePaneChrome } = useUiCapabilities();
|
|
238
|
+
// The story is what a link to the pane is about: its headline and summary.
|
|
239
|
+
usePaneShareItem(() => ({ title: item.title, excerpt: shareItemExcerpt(item.summary) }));
|
|
236
240
|
const tickers = useMemo(
|
|
237
241
|
() => collectNewsDisplayTickers(item.tickers),
|
|
238
242
|
[item.tickers],
|