gloomberb 0.20.13 → 0.20.16
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 +22 -4
- package/src/account/auth-dialog.tsx +22 -4
- package/src/account/auth-form.tsx +6 -1
- package/src/account/checkout-handoff.tsx +7 -14
- package/src/account/device-signin-dialog.tsx +35 -24
- package/src/api-client/crypto-markets.ts +10 -0
- package/src/api-client/errors.ts +3 -1
- package/src/api-client/index.ts +54 -0
- package/src/api-client/install-experiments.ts +8 -7
- package/src/api-client/money-markets.ts +7 -0
- package/src/api-client/paths.ts +2 -1
- package/src/api-client/product-waitlist.ts +63 -0
- package/src/api-client/request.ts +16 -4
- package/src/api-client/types/billing.ts +45 -0
- package/src/api-client/yearly-plan.ts +132 -0
- package/src/app/global-shortcuts.ts +5 -3
- package/src/app/pane-runtime/index.tsx +2 -2
- package/src/app/pane-runtime/plugin-bindings.ts +3 -1
- package/src/app/pane-runtime/ticker-open-runtime.ts +6 -1
- package/src/app/since-last-visit/keys.ts +26 -0
- package/src/app/since-last-visit/model.ts +266 -0
- package/src/app/since-last-visit/strip.tsx +193 -0
- package/src/app/since-last-visit/use-since-last-visit.ts +289 -0
- package/src/app/since-last-visit/visit-tracker.ts +191 -0
- package/src/app.tsx +15 -0
- package/src/architecture/floating-promise-allowlist.json +0 -1
- package/src/brokers/signed-in/sign-in-dialog.tsx +38 -38
- package/src/cli/commands/market.ts +103 -27
- package/src/cli/commands/overview.ts +18 -4
- package/src/cli/commands/system.ts +29 -1
- package/src/cli/commands/ticker.ts +12 -5
- package/src/cli/desktop-pane-shot-api-policy.ts +4 -1
- package/src/cli/desktop-pane-shot-browser.ts +2 -1
- package/src/cli/desktop-pane-shot-view.ts +3 -7
- package/src/cli/desktop-pane-shot.ts +26 -28
- package/src/cli/errors.ts +3 -1
- package/src/cli/freshness.ts +7 -2
- package/src/cli/glossary.ts +10 -5
- package/src/cli/help.ts +1 -0
- package/src/cli/helpers.ts +8 -16
- package/src/cli/history-export.ts +4 -0
- package/src/cli/history-rows.ts +24 -0
- package/src/cli/index.ts +4 -0
- package/src/cli/known-gaps.ts +2 -2
- package/src/cli/listing-arg.ts +79 -11
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/options.ts +29 -1
- package/src/cli/pane-functions/catalog.ts +70 -12
- package/src/cli/pane-functions/function-help.ts +1 -1
- package/src/cli/pane-functions/headless.ts +68 -3
- package/src/cli/pane-functions/index.ts +2 -2
- package/src/cli/pane-functions/options.ts +7 -0
- package/src/cli/pane-functions/resolver.ts +104 -15
- package/src/cli/pane-functions/screenshot-payload.ts +3 -0
- package/src/cli/report-tables.ts +20 -5
- package/src/cli/result.ts +22 -4
- package/src/cli/shot-temp-dir.ts +30 -0
- package/src/cli/suffixed-listing-rows.ts +11 -0
- package/src/cli/symbol-args.ts +5 -3
- package/src/cli/symbol-list.ts +23 -10
- package/src/cli/symbol-rows.ts +135 -3
- package/src/cli/treasury-yields.ts +15 -1
- package/src/components/chart/composite/composite-chart.tsx +3 -3
- package/src/components/chart/composite/format.ts +2 -1
- package/src/components/chart/composite/panel-surface/axis-markers.ts +133 -0
- package/src/components/chart/composite/panel-surface/level-labels.tsx +78 -0
- package/src/components/chart/composite/panel-surface/overlays.ts +108 -0
- package/src/components/chart/composite/panel-surface/pan-coast.ts +54 -0
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +138 -0
- package/src/components/chart/composite/panel-surface/panel-levels.ts +47 -0
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +403 -0
- package/src/components/chart/composite/panel-surface/plot-pointer.ts +65 -0
- package/src/components/chart/composite/panel-surface/plot-wheel.ts +102 -0
- package/src/components/chart/composite/panel-surface/pointer.ts +12 -0
- package/src/components/chart/composite/panel-surface/props.ts +79 -0
- package/src/components/chart/composite/panel-surface/tool-readout.ts +151 -0
- package/src/components/chart/composite/panel-surface/value-axis-gestures.ts +152 -0
- package/src/components/chart/composite/panel-surface.tsx +81 -1177
- package/src/components/command-bar/commands/collection-list.ts +1 -0
- package/src/components/command-bar/commands/direct/index.ts +31 -8
- package/src/components/command-bar/commands/registry.ts +7 -0
- package/src/components/command-bar/routes/root/command-items.ts +8 -0
- package/src/components/command-bar/routes/root/results.ts +19 -2
- package/src/components/command-bar/routes/root/runtime.ts +3 -2
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/root/shortcuts.ts +15 -0
- package/src/components/company-logo.tsx +10 -3
- package/src/components/data-table/sections.ts +6 -1
- package/src/components/layout/pane/title.ts +16 -6
- package/src/components/layout/shell/index.tsx +5 -1
- package/src/components/layout/shell/ticker-link-menu.ts +12 -9
- package/src/components/pane-settings-dialog/tui.tsx +6 -3
- package/src/components/pane-settings-dialog.tsx +2 -1
- package/src/components/pane-template-wizard.tsx +2 -0
- package/src/components/ticker/badge/format.ts +12 -3
- package/src/components/ticker/badge/index.tsx +9 -3
- package/src/components/ticker/list-table-view.tsx +119 -17
- package/src/components/ui/choice-dialog.tsx +1 -1
- package/src/components/ui/confirm-dialog.tsx +3 -2
- package/src/components/ui/data-table/display-columns.ts +16 -0
- package/src/components/ui/data-table/index.tsx +40 -9
- package/src/components/ui/data-table/types.ts +14 -0
- package/src/components/ui/frame.tsx +7 -3
- package/src/components/ui/icon.tsx +4 -2
- package/src/components/ui/list-view.tsx +8 -0
- package/src/components/ui/number-prompt-dialog.tsx +2 -1
- package/src/components/use-pane-notice-footer.tsx +3 -1
- package/src/core/state/app/layout-reducer.ts +3 -1
- package/src/core/state/app/layout.ts +2 -2
- package/src/data/config/layout.ts +14 -0
- package/src/data/config/store/normalize.ts +11 -1
- package/src/docs/snapshot.json +2 -2
- package/src/i18n/es.ts +39 -0
- package/src/i18n/ja.ts +39 -0
- package/src/i18n/ko.ts +39 -0
- package/src/i18n/zh-cn.ts +39 -0
- package/src/i18n/zh-tw.ts +39 -0
- package/src/layout/pane-follow.ts +141 -4
- package/src/layout/pane-layout-move.ts +10 -7
- package/src/layout/ticker-navigation.ts +13 -19
- package/src/layout/ticker-retarget.ts +3 -2
- package/src/market-data/market/format.ts +35 -1
- package/src/market-data/market/index-level.ts +19 -0
- package/src/market-data/quotes/contributions.ts +13 -0
- package/src/market-data/quotes/export-identity.ts +36 -1
- package/src/market-data/quotes/resolution.ts +16 -0
- package/src/plugins/builtin/account-management/keyboard.ts +14 -0
- package/src/plugins/builtin/account-management/model.ts +2 -0
- package/src/plugins/builtin/account-management/pane.tsx +79 -7
- package/src/plugins/builtin/account-management/password-dialog.tsx +2 -2
- package/src/plugins/builtin/account-management/payment-recovery-row.tsx +97 -0
- package/src/plugins/builtin/account-management/yearly-plan-row.tsx +359 -0
- package/src/plugins/builtin/analytics/risk-client.ts +12 -2
- package/src/plugins/builtin/analytics/risk-headless.ts +66 -6
- package/src/plugins/builtin/analytics/risk-math.ts +23 -6
- package/src/plugins/builtin/analytics/risk-model.ts +20 -9
- package/src/plugins/builtin/analytics/risk-pane.tsx +2 -2
- package/src/plugins/builtin/awards/pane.tsx +6 -8
- package/src/plugins/builtin/changelog/index.tsx +6 -44
- package/src/plugins/builtin/changelog/versions.ts +17 -68
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +5 -2
- package/src/plugins/builtin/chart-composer/editor.tsx +1 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +1 -1
- package/src/plugins/builtin/chart-composer/quick-add.tsx +4 -1
- package/src/plugins/builtin/chart-composer/series-catalog.ts +17 -1
- package/src/plugins/builtin/cloud/askg/executor.ts +2 -1
- package/src/plugins/builtin/cloud/askg/sources.ts +2 -1
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/thesis/module.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +6 -2
- package/src/plugins/builtin/cpi/headless.ts +6 -1
- package/src/plugins/builtin/cpi/model.ts +17 -0
- package/src/plugins/builtin/cpi/pane.tsx +4 -2
- package/src/plugins/builtin/crypto-board/client.ts +6 -1
- package/src/plugins/builtin/crypto-board/headless.ts +10 -2
- package/src/plugins/builtin/crypto-board/model.ts +89 -11
- package/src/plugins/builtin/crypto-board/pane.tsx +20 -5
- package/src/plugins/builtin/debt-maturities/model.ts +1 -1
- package/src/plugins/builtin/dividend-yield/client.ts +24 -2
- package/src/plugins/builtin/dividend-yield/headless.ts +4 -2
- package/src/plugins/builtin/dividend-yield/ranking.ts +2 -1
- package/src/plugins/builtin/dividend-yield/view.ts +5 -1
- package/src/plugins/builtin/earnings/board-table.ts +1 -1
- package/src/plugins/builtin/earnings/board.tsx +36 -16
- package/src/plugins/builtin/earnings/highlight.ts +47 -0
- package/src/plugins/builtin/earnings/history-table.ts +9 -1
- package/src/plugins/builtin/earnings/index.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/pane.tsx +2 -2
- package/src/plugins/builtin/earnings-ripple/index.tsx +2 -0
- package/src/plugins/builtin/econ/calendar-model.ts +17 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +33 -4
- package/src/plugins/builtin/econ-statistics/headless.ts +21 -0
- package/src/plugins/builtin/estimate-revisions/model.ts +1 -1
- package/src/plugins/builtin/exposure/index.tsx +1 -1
- package/src/plugins/builtin/macro-day/headless.ts +21 -10
- package/src/plugins/builtin/macro-day/model.ts +42 -3
- package/src/plugins/builtin/macro-day/pane.tsx +26 -8
- package/src/plugins/builtin/macro-day/releases.ts +24 -1
- package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
- package/src/plugins/builtin/market-valuation/headless.ts +11 -4
- package/src/plugins/builtin/market-valuation/pane.tsx +3 -1
- package/src/plugins/builtin/market-valuation/view.ts +14 -0
- package/src/plugins/builtin/money-markets/client.ts +4 -1
- package/src/plugins/builtin/money-markets/headless.ts +15 -4
- package/src/plugins/builtin/money-markets/index.tsx +1 -1
- package/src/plugins/builtin/money-markets/pane.tsx +7 -1
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +20 -8
- package/src/plugins/builtin/pe-band/pane.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -2
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +61 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +11 -3
- package/src/plugins/builtin/portfolio-list/cli/render.ts +8 -1
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +178 -17
- package/src/plugins/builtin/portfolio-list/headless.ts +33 -6
- package/src/plugins/builtin/portfolio-list/pane/groups.tsx +220 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +95 -18
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +24 -6
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +16 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +4 -1
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +6 -4
- package/src/plugins/builtin/portfolio-list/table.tsx +38 -16
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +4 -2
- package/src/plugins/builtin/research/relative-valuation-headless.ts +15 -5
- package/src/plugins/builtin/research/relative-valuation-model.ts +7 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +7 -4
- package/src/plugins/builtin/shared/cloud-upgrade.ts +4 -2
- package/src/plugins/builtin/shared/cpi-year-gap.ts +67 -0
- package/src/plugins/builtin/shared/headless-options.ts +1 -1
- package/src/plugins/builtin/social-mentions/model.ts +2 -2
- package/src/plugins/builtin/thirteenf/pane.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +45 -2
- package/src/plugins/builtin/ticker-detail/financials/model.ts +51 -16
- package/src/plugins/builtin/ticker-detail/financials/nopat.ts +16 -0
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +44 -13
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +33 -2
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +4 -2
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +30 -4
- package/src/plugins/builtin/ticker-detail/headless.ts +280 -35
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +4 -5
- package/src/plugins/builtin/ticker-detail/overview/model.ts +9 -2
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +10 -2
- package/src/plugins/builtin/ticker-detail/pharma-signals/eligibility.ts +32 -0
- package/src/plugins/builtin/ticker-detail/pharma-signals/tab.tsx +162 -0
- package/src/plugins/builtin/ticker-detail/pharma-signals/waitlist.ts +126 -0
- package/src/plugins/builtin/ticker-detail/research-groups.ts +6 -4
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +11 -0
- package/src/portfolio/collection-name.ts +2 -1
- package/src/portfolio/column-values.ts +34 -12
- package/src/portfolio/listed-symbol.ts +4 -2
- package/src/portfolio/period-pnl.ts +51 -1
- package/src/portfolio/suffixed-listings.ts +3 -1
- package/src/portfolio/watchlist-groups.ts +212 -0
- package/src/react/ticker-source.ts +3 -1
- package/src/renderers/dom/dialog-host.tsx +5 -5
- package/src/renderers/dom/styles.css +7 -0
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +1 -1
- package/src/renderers/opentui/dialog-host.tsx +3 -4
- package/src/sources/gloomberb-cloud/normalizers.ts +5 -0
- package/src/sources/provider-router/history.ts +5 -2
- package/src/state/app/bootstrap.ts +11 -0
- package/src/state/app/context/index.tsx +6 -0
- package/src/sync/collections-contributor.ts +5 -2
- package/src/sync/config-merge.ts +10 -2
- package/src/sync/sanitize.ts +28 -0
- package/src/telemetry/usage-counts.ts +17 -0
- package/src/test-support/plugin-persistence.ts +12 -0
- package/src/tickers/company-name-listing.ts +4 -3
- package/src/tickers/company-name.ts +19 -1
- package/src/tickers/instrument-coverage.ts +27 -0
- package/src/tickers/search/home-listing.ts +38 -1
- package/src/tickers/search/index.ts +3 -2
- package/src/tickers/search/ranking.ts +21 -2
- package/src/time-series/base-series.ts +4 -0
- package/src/time-series/chart-seed.ts +1 -1
- package/src/time-series/financial-period-coverage.ts +4 -12
- package/src/time-series/parsed-history-cache.ts +1 -1
- package/src/time-series/resolve.ts +1 -1
- package/src/time-series/types.ts +5 -2
- package/src/time-series/use-chart-resolution.ts +6 -1
- package/src/types/config.ts +32 -0
- package/src/types/financials.ts +13 -0
- package/src/types/headless.ts +7 -0
- package/src/types/plugin-context.ts +5 -0
- package/src/types/ticker.ts +14 -0
- package/src/ui/ascii-font.ts +1 -4
- package/src/ui/dialog-stack.ts +17 -0
- package/src/ui/dialog.tsx +6 -2
- package/src/utils/async-deadline.ts +2 -2
- package/src/utils/crypto-pair.ts +9 -0
- package/src/utils/csv.ts +44 -5
- package/src/utils/exchanges.ts +13 -0
- package/src/utils/financial-statements.ts +60 -3
- package/src/utils/futures-generic.ts +17 -0
- package/src/utils/trailing-dividend.ts +13 -3
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
buyAndHoldReturns,
|
|
21
21
|
concentration,
|
|
22
|
+
matchedReturnCount,
|
|
22
23
|
pairedReturns,
|
|
23
24
|
regressReturns,
|
|
24
25
|
RISK_TAIL_CONFIDENCE,
|
|
@@ -46,6 +47,7 @@ import {
|
|
|
46
47
|
import {
|
|
47
48
|
RISK_FACTOR_INSTRUMENTS,
|
|
48
49
|
riskInstrumentId,
|
|
50
|
+
riskInstrumentOf,
|
|
49
51
|
type RiskHoldingRequest,
|
|
50
52
|
type RiskMarketSnapshot,
|
|
51
53
|
} from "./risk-client";
|
|
@@ -92,6 +94,8 @@ interface PortfolioRiskHolding {
|
|
|
92
94
|
error: string | null;
|
|
93
95
|
/** Why the holding is outside the basket; null when it qualifies. */
|
|
94
96
|
leftOut: string | null;
|
|
97
|
+
/** Set when that is its daily closes not loading, which asked again they may. */
|
|
98
|
+
historyFailed?: true;
|
|
95
99
|
}
|
|
96
100
|
/** A holding or a currency's cash outside the basket, with its share of the book when one is known. */
|
|
97
101
|
interface RiskLeftOut {
|
|
@@ -102,6 +106,8 @@ interface RiskLeftOut {
|
|
|
102
106
|
share: number | null;
|
|
103
107
|
/** Set on a currency's cash, which is never in the basket and does not make a report incomplete. */
|
|
104
108
|
cash?: true;
|
|
109
|
+
/** Set when its daily closes did not load, which asked again they may. */
|
|
110
|
+
historyFailed?: true;
|
|
105
111
|
}
|
|
106
112
|
/** One currency of the book's cash, valued in the account currency. */
|
|
107
113
|
interface RiskCashHolding extends RiskCashLine {
|
|
@@ -412,8 +418,7 @@ export function portfolioRiskRequests(
|
|
|
412
418
|
? lots.reduce((sum, row) => sum + Math.abs(row.marketValue!), 0)
|
|
413
419
|
: null;
|
|
414
420
|
return {
|
|
415
|
-
|
|
416
|
-
exchange: ticker.metadata.exchange,
|
|
421
|
+
...riskInstrumentOf(ticker),
|
|
417
422
|
quantity: signedQuantity(lots),
|
|
418
423
|
currency,
|
|
419
424
|
snapshotValue: snapshot,
|
|
@@ -717,10 +722,7 @@ export function buildPortfolioRisk(
|
|
|
717
722
|
tickers,
|
|
718
723
|
portfolio.id,
|
|
719
724
|
).map((ticker) => {
|
|
720
|
-
const instrument =
|
|
721
|
-
symbol: ticker.metadata.ticker,
|
|
722
|
-
exchange: ticker.metadata.exchange,
|
|
723
|
-
},
|
|
725
|
+
const instrument = riskInstrumentOf(ticker),
|
|
724
726
|
id = riskInstrumentId(instrument);
|
|
725
727
|
const history = byId.get(id),
|
|
726
728
|
quote = history?.quote,
|
|
@@ -808,6 +810,7 @@ export function buildPortfolioRisk(
|
|
|
808
810
|
fxBridged: holdingFxBridges(convertedFrom, history?.converted?.fxBridged, account, inAccount?.bridged),
|
|
809
811
|
error,
|
|
810
812
|
leftOut,
|
|
813
|
+
...(history?.loadFailed && leftOut === history.error ? { historyFailed: true as const } : {}),
|
|
811
814
|
};
|
|
812
815
|
});
|
|
813
816
|
// Each currency's cash once, valued in the portfolio currency.
|
|
@@ -858,6 +861,7 @@ export function buildPortfolioRisk(
|
|
|
858
861
|
reason: row.leftOut!,
|
|
859
862
|
value: row.marketValue,
|
|
860
863
|
share: bookShare(row.marketValue),
|
|
864
|
+
...(row.historyFailed ? { historyFailed: true as const } : {}),
|
|
861
865
|
})),
|
|
862
866
|
...cashHoldings.map((row): RiskLeftOut => {
|
|
863
867
|
const value = row.value == null ? null : Math.abs(row.value);
|
|
@@ -1019,17 +1023,24 @@ export function buildPortfolioRisk(
|
|
|
1019
1023
|
: []),
|
|
1020
1024
|
].map((factor) => ({
|
|
1021
1025
|
...rollingBeta(basket, factor.series, factor.label, factor.id),
|
|
1022
|
-
regression: regressReturns(basket
|
|
1026
|
+
regression: regressReturns(basket, factor.series, { window: 60 }),
|
|
1023
1027
|
}));
|
|
1028
|
+
// The latest 60 returns both holdings have: a US close today and a Singapore close yesterday still pair their common days.
|
|
1024
1029
|
const correlation = members.flatMap((left, index) =>
|
|
1025
1030
|
members.slice(index + 1).map((right) => {
|
|
1026
|
-
const regression = regressReturns(left.returns
|
|
1031
|
+
const regression = regressReturns(left.returns, right.returns, { window: 60 });
|
|
1032
|
+
const matched = regression?.samples ?? matchedReturnCount(left.returns, right.returns);
|
|
1027
1033
|
return {
|
|
1028
1034
|
left: left.id,
|
|
1029
1035
|
right: right.id,
|
|
1030
1036
|
label: `${left.symbol} / ${right.symbol}`,
|
|
1031
1037
|
...regression,
|
|
1032
1038
|
value: regression?.correlation ?? null,
|
|
1039
|
+
// Why a pair has no correlation, in words.
|
|
1040
|
+
evidence: regression?.correlation != null ? `${matched} matched daily returns`
|
|
1041
|
+
: matched === 0 ? "no daily returns on the same dates"
|
|
1042
|
+
: matched < 60 ? `only ${matched} daily returns on the same dates; 60 needed`
|
|
1043
|
+
: `a price that did not move over ${matched} matched daily returns`,
|
|
1033
1044
|
};
|
|
1034
1045
|
}),
|
|
1035
1046
|
);
|
|
@@ -1212,7 +1223,7 @@ export function buildPortfolioRisk(
|
|
|
1212
1223
|
unit: "correlation",
|
|
1213
1224
|
percentile: null,
|
|
1214
1225
|
asOf: row.asOf ?? null,
|
|
1215
|
-
detail:
|
|
1226
|
+
detail: row.evidence,
|
|
1216
1227
|
}))
|
|
1217
1228
|
.sort((left, right) => (right.value == null ? -1 : Math.abs(right.value)) - (left.value == null ? -1 : Math.abs(left.value))),
|
|
1218
1229
|
stress: [
|
|
@@ -45,7 +45,7 @@ import { useThemeColors } from "../../../theme/theme-context";
|
|
|
45
45
|
import type { PaneProps } from "../../../types/plugin";
|
|
46
46
|
import { isAccessDenied } from "../../../api-client/errors";
|
|
47
47
|
import { useResearchCloudSession } from "../shared/research-cloud-session";
|
|
48
|
-
import { loadPortfolioRiskMarket } from "./risk-client";
|
|
48
|
+
import { loadPortfolioRiskMarket, riskInstrumentOf } from "./risk-client";
|
|
49
49
|
import { loadRiskEpisodeHistory, riskEpisodeTargets, type RiskEpisodeState, type RiskEpisodeTarget } from "./risk-episodes";
|
|
50
50
|
import { brokerPerformanceEvidence, parsePortfolioRiskEvidence } from "./risk-evidence";
|
|
51
51
|
import { useBrokerPortfolioPerformance } from "./broker-performance";
|
|
@@ -443,7 +443,7 @@ export function PortfolioRiskPane({ focused, width, height }: PaneProps) {
|
|
|
443
443
|
// load only there, once the market load says which holdings the basket takes.
|
|
444
444
|
const episodeTargetsKey = useMemo(() => {
|
|
445
445
|
if (frozen || view !== "stress" || !resource.data) return null;
|
|
446
|
-
const held = localTickers.map(
|
|
446
|
+
const held = localTickers.map(riskInstrumentOf);
|
|
447
447
|
const targets = riskEpisodeTargets(resource.data, held);
|
|
448
448
|
return targets.length ? JSON.stringify(targets) : null;
|
|
449
449
|
}, [frozen, localTickers, resource.data, view]);
|
|
@@ -6,7 +6,7 @@ import { Badge, ChartTableHeader, DataTableView, Notice, PageStackView, PaneStat
|
|
|
6
6
|
usePaneNoticeFooter, usePaneStatusFooter, usePaneTabs, useQueryBarSearch, useTableLoadMore, type DataTableColumn, type PaneHint, type QueryBarFilter } from "../../../components";
|
|
7
7
|
import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
8
8
|
import { formatCompactAxis } from "../../../components/chart-table";
|
|
9
|
-
import { missingCell, shareCell
|
|
9
|
+
import { missingCell, shareCell } from "../shared/research-cells";
|
|
10
10
|
import { useAsyncResource, useAutoRefresh, usePaneSettingValue, usePluginAppActions, usePluginPaneState } from "../../../public/react";
|
|
11
11
|
import { usePaneTickerIdentity } from "../../../state/hooks/pane-ticker";
|
|
12
12
|
import { useThemeColors } from "../../../theme/theme-context";
|
|
@@ -49,8 +49,8 @@ const rowDate = (row: AwardRow) => new Date(`${row.awardDate}T00:00:00Z`);
|
|
|
49
49
|
const COLUMN = {
|
|
50
50
|
date: { id: "date", label: "Date", width: 11, align: "left" }, recipient: { id: "recipient", label: "Awardee", width: 26, flexGrow: 1, align: "left" },
|
|
51
51
|
ticker: { id: "ticker", label: "Ticker", width: 10, align: "left" }, currency: { id: "currency", label: "CCY", width: 5, align: "left" },
|
|
52
|
-
value: { id: "value", label: "Value", width: 11, align: "right" }, obligated: { id: "obligated", label: "Obligated", width: 11, align: "right" },
|
|
53
|
-
ceiling: { id: "ceiling", label: "Ceiling", width: 11, align: "right" }, agency: { id: "agency", label: "Agency", width: 24, align: "left" },
|
|
52
|
+
value: { id: "value", label: "Value", width: 11, align: "right", omitWhenEmpty: true }, obligated: { id: "obligated", label: "Obligated", width: 11, align: "right", omitWhenEmpty: true },
|
|
53
|
+
ceiling: { id: "ceiling", label: "Ceiling", width: 11, align: "right", omitWhenEmpty: true }, agency: { id: "agency", label: "Agency", width: 24, align: "left" },
|
|
54
54
|
country: { id: "country", label: "Country", width: 8, align: "left" }, period: { id: "period", label: "Performance period", width: 24, align: "left" },
|
|
55
55
|
title: { id: "title", label: "Contract", width: 36, flexGrow: 1, align: "left" },
|
|
56
56
|
dateBasis: { id: "dateBasis", label: "Date basis", width: 14, align: "left" },
|
|
@@ -59,8 +59,6 @@ const COLUMN = {
|
|
|
59
59
|
// shows the contract; the period and date basis follow.
|
|
60
60
|
const FEED_COLUMNS: DataTableColumn[] = [COLUMN.date, COLUMN.recipient, COLUMN.ticker, COLUMN.title, COLUMN.agency, COLUMN.currency,
|
|
61
61
|
COLUMN.value, COLUMN.obligated, COLUMN.ceiling, COLUMN.country, COLUMN.period, COLUMN.dateBasis];
|
|
62
|
-
/** Amounts a source never reports (UK and EU notices have no obligation or ceiling) leave a column of dashes. */
|
|
63
|
-
const QUIET_AMOUNTS = { obligated: [MISSING_VALUE], ceiling: [MISSING_VALUE] } as const;
|
|
64
62
|
const EVENT_COLUMNS: DataTableColumn[] = [COLUMN.date, COLUMN.recipient, COLUMN.ticker,
|
|
65
63
|
{ id: "ratio", label: "% revenue", width: 11, align: "right" }, COLUMN.currency, { ...COLUMN.value, label: "Compared value" },
|
|
66
64
|
{ id: "revenue", label: "Annual revenue", width: 14, align: "right" }, { id: "basis", label: "Value basis", width: 13, align: "left" },
|
|
@@ -68,8 +66,8 @@ const EVENT_COLUMNS: DataTableColumn[] = [COLUMN.date, COLUMN.recipient, COLUMN.
|
|
|
68
66
|
// The share leads the figures: concentration is what these views are for.
|
|
69
67
|
const AGG_COLUMNS: DataTableColumn[] = [
|
|
70
68
|
{ id: "label", label: "Agency", width: 30, flexGrow: 1, align: "left" }, { id: "currency", label: "CCY", width: 5, align: "left" },
|
|
71
|
-
{ id: "share", label: "Share %", width: 24, align: "right" }, {
|
|
72
|
-
{
|
|
69
|
+
{ id: "share", label: "Share %", width: 24, align: "right" }, { ...COLUMN.obligated, width: 12 }, { ...COLUMN.value, width: 12 },
|
|
70
|
+
{ ...COLUMN.ceiling, width: 12 },
|
|
73
71
|
{ id: "contracts", label: "Awards", width: 8, align: "right" },
|
|
74
72
|
{ id: "scope", label: "Scope", width: 27, align: "left" },
|
|
75
73
|
];
|
|
@@ -220,7 +218,7 @@ function AwardsView({ width, height, focused, symbol }: PaneProps & { symbol: st
|
|
|
220
218
|
view={tab === "sectors" ? { value: leaderView, options: [{ value: "companies", label: "Companies" }, { value: "sectors", label: "Sectors" }], onChange: setLeaderView } : undefined} />;
|
|
221
219
|
const columns = showLeaders ? LEADER_COLUMNS.filter((column) => column.id !== "scope" && column.id !== "currency")
|
|
222
220
|
: aggregated ? AGG_COLUMNS.filter((column) => column.id !== "scope" && column.id !== "currency").map((column) => column.id === "label" ? { ...column, label: tab === "agencies" ? "Agency" : "Sector" } : column)
|
|
223
|
-
: tab === "events" ? EVENT_COLUMNS :
|
|
221
|
+
: tab === "events" ? EVENT_COLUMNS : FEED_COLUMNS;
|
|
224
222
|
const maxShare = Math.max(0, ...items.map((item) => item.kind === "aggregate" || item.kind === "leader" ? item.row.sharePercent ?? 0 : 0));
|
|
225
223
|
// A preview's cohorts are the latest of any company, so they never chart as the ticker's.
|
|
226
224
|
const charted = data?.locked ? [] : series;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState, type RefObject } from "react";
|
|
2
|
-
import { Box, TextAttributes,
|
|
2
|
+
import { Box, TextAttributes, type ScrollBoxRenderable } from "../../../ui";
|
|
3
3
|
import { usePaneInstance } from "../../../state/app/context";
|
|
4
4
|
import {
|
|
5
5
|
DataTableStackView,
|
|
6
6
|
DataTableView,
|
|
7
|
-
MarkdownText,
|
|
8
7
|
PaneLinkMenu,
|
|
9
8
|
PaneStatusBody,
|
|
10
9
|
useExternalLinkFooter,
|
|
@@ -12,7 +11,6 @@ import {
|
|
|
12
11
|
type DataTableColumn,
|
|
13
12
|
} from "../../../components";
|
|
14
13
|
import { DetailReader } from "../../../components/reader/detail-reader";
|
|
15
|
-
import { DESKTOP_LINE_HEIGHT, READER_COLUMN_FONT, READER_MEASURE } from "../../../components/reader/reader-text";
|
|
16
14
|
import { loadingErrorFooterInfo, usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
17
15
|
import { getReleaseSummaries } from "../../../api-client/release-summaries";
|
|
18
16
|
import { createTtlCache } from "../../../data/ttl-cache";
|
|
@@ -38,7 +36,6 @@ import {
|
|
|
38
36
|
import {
|
|
39
37
|
DEFAULT_CHANGELOG_VERSION_SORT,
|
|
40
38
|
groupChangelogVersions,
|
|
41
|
-
highlightsMarkdown,
|
|
42
39
|
nextChangelogVersionSort,
|
|
43
40
|
parseVersionSummaries,
|
|
44
41
|
sortChangelogVersions,
|
|
@@ -76,7 +73,7 @@ export function resetChangelogCacheForTests(): void {
|
|
|
76
73
|
/**
|
|
77
74
|
* CHANGELOG.md from Gloom Cloud, which reads GitHub with its own credentials,
|
|
78
75
|
* else from GitHub itself; null when neither has it, and then each version
|
|
79
|
-
*
|
|
76
|
+
* takes its first update's title.
|
|
80
77
|
*/
|
|
81
78
|
async function readSummaries(signal: AbortSignal): Promise<string | null> {
|
|
82
79
|
try {
|
|
@@ -164,42 +161,9 @@ function ReleaseNotes({
|
|
|
164
161
|
);
|
|
165
162
|
}
|
|
166
163
|
|
|
167
|
-
/** The pane's inset around the highlights, as a detail reader has: 12px above, 16px below. */
|
|
168
|
-
const HIGHLIGHTS_BOX_STYLE = { padding: "var(--gloom-space-md) var(--gloom-inset) var(--gloom-space-lg)" } as const;
|
|
169
|
-
/** The reader's type and measure; markdown lines take the reader's line height (the host sets Text line height from --cell-h). */
|
|
170
|
-
const HIGHLIGHTS_COLUMN_STYLE = {
|
|
171
|
-
fontSize: READER_COLUMN_FONT,
|
|
172
|
-
lineHeight: DESKTOP_LINE_HEIGHT,
|
|
173
|
-
maxWidth: READER_MEASURE,
|
|
174
|
-
"--cell-h": `${DESKTOP_LINE_HEIGHT}em`,
|
|
175
|
-
} as const;
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* A version's highlights above its updates. The desktop and the web set them
|
|
179
|
-
* in the reader's type at the reading measure, as the notes an update opens
|
|
180
|
-
* are, lined up with the table's left edge; the terminal wraps them at `width`.
|
|
181
|
-
*/
|
|
182
|
-
function VersionHighlights({ markdown, width }: { markdown: string; width: number }) {
|
|
183
|
-
const { nativePaneChrome } = useUiCapabilities();
|
|
184
|
-
if (nativePaneChrome) {
|
|
185
|
-
return (
|
|
186
|
-
<Box flexDirection="column" width="100%" flexShrink={0} style={HIGHLIGHTS_BOX_STYLE} data-gloom-ui="changelog-highlights">
|
|
187
|
-
<Box flexDirection="column" width="100%" style={HIGHLIGHTS_COLUMN_STYLE}>
|
|
188
|
-
<MarkdownText text={markdown} />
|
|
189
|
-
</Box>
|
|
190
|
-
</Box>
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
return (
|
|
194
|
-
<Box flexDirection="column" paddingX={1} paddingY={1} flexShrink={0}>
|
|
195
|
-
<MarkdownText text={markdown} lineWidth={Math.max(12, width - 2)} />
|
|
196
|
-
</Box>
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
164
|
/**
|
|
201
|
-
* An open version: its
|
|
202
|
-
*
|
|
165
|
+
* An open version: the table of its updates, under the title the stack
|
|
166
|
+
* header already gives it. Enter opens an update's notes.
|
|
203
167
|
*/
|
|
204
168
|
function VersionDetail({
|
|
205
169
|
version,
|
|
@@ -227,12 +191,10 @@ function VersionDetail({
|
|
|
227
191
|
);
|
|
228
192
|
const selectedIndex = resolveSelectedReleaseIndex(releases, selectedReleaseId);
|
|
229
193
|
const columns = useMemo(() => buildReleaseColumns(version.releases), [version.releases]);
|
|
230
|
-
const highlights = useMemo(() => highlightsMarkdown(version), [version]);
|
|
231
194
|
|
|
232
195
|
return (
|
|
233
196
|
<DataTableView<ChangelogRelease, ReleaseColumn>
|
|
234
197
|
focused={focused}
|
|
235
|
-
rootBefore={highlights ? <VersionHighlights markdown={highlights} width={width} /> : undefined}
|
|
236
198
|
selection={{
|
|
237
199
|
kind: "id",
|
|
238
200
|
selectedId: releases[selectedIndex]?.id ?? null,
|
|
@@ -258,8 +220,8 @@ function VersionDetail({
|
|
|
258
220
|
|
|
259
221
|
/**
|
|
260
222
|
* The Changelog, as its own pane (CHG) and as ROADMAP's Changelog view: one
|
|
261
|
-
* row per minor version, then a version's
|
|
262
|
-
*
|
|
223
|
+
* row per minor version, then a version's updates, then an update's notes,
|
|
224
|
+
* one Back at a time.
|
|
263
225
|
*/
|
|
264
226
|
export function ChangelogPane({ focused, width, height }: PaneProps) {
|
|
265
227
|
const paneInstance = usePaneInstance();
|
|
@@ -4,9 +4,10 @@ import { nextHeaderSort, type SortDirection } from "../../../utils/sort-values";
|
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* The Changelog by minor version: every update of 0.20 under one row, with
|
|
7
|
-
* the version's title
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* the version's title from the repository's CHANGELOG.md, or, for a version
|
|
8
|
+
* it does not cover yet, its first update's title. The website's changelog
|
|
9
|
+
* reads the same file the same way and shows its highlights too; they are
|
|
10
|
+
* read here so the file's own test holds them to that format.
|
|
10
11
|
*
|
|
11
12
|
* CHANGELOG.md has one section per minor version:
|
|
12
13
|
*
|
|
@@ -21,10 +22,7 @@ import { nextHeaderSort, type SortDirection } from "../../../utils/sort-values";
|
|
|
21
22
|
* skipped here.
|
|
22
23
|
*/
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
export const HIGHLIGHTS_MAX = 5;
|
|
26
|
-
|
|
27
|
-
export interface ChangelogHighlight {
|
|
25
|
+
interface ChangelogHighlight {
|
|
28
26
|
/** The bold claim, as written: "A faster, lighter desktop app." */
|
|
29
27
|
lead: string;
|
|
30
28
|
/** The line after the claim (inline markdown), or "". */
|
|
@@ -46,7 +44,6 @@ export interface ChangelogVersion {
|
|
|
46
44
|
/** "0.20" */
|
|
47
45
|
minor: string;
|
|
48
46
|
title: string;
|
|
49
|
-
highlights: ChangelogHighlight[];
|
|
50
47
|
/** Newest first, as GitHub lists them. */
|
|
51
48
|
releases: ChangelogRelease[];
|
|
52
49
|
firstPublishedAt: string;
|
|
@@ -57,7 +54,6 @@ const SECTION = /^##\s+v?(\d+\.\d+)(?:\s*:\s*(.*))?$/;
|
|
|
57
54
|
const VERSIONS = /\s*\(\s*(v?\d+\.\d+\.\d+(?:\s*,\s*v?\d+\.\d+\.\d+)*)\s*\)\s*$/;
|
|
58
55
|
const BULLET = /^[-*]\s+(.+)$/;
|
|
59
56
|
const BOLD_LEAD = /^\*\*(.+?)\*\*\s*(.*)$/;
|
|
60
|
-
const PULL_REFS = /\s*\(\s*#\d+(?:\s*,\s*#\d+)*\s*\)\s*$/;
|
|
61
57
|
const IMAGE = /^!\[[^\]]*\]\([^)\s]+\)$/;
|
|
62
58
|
|
|
63
59
|
/** "**Claim.** Line" as its claim and its line; text without a claim is all claim. */
|
|
@@ -143,35 +139,6 @@ function minorOf(tagName: string): string {
|
|
|
143
139
|
return tagName.match(/^v?(\d+\.\d+)\.\d+$/i)?.[1] ?? tagName;
|
|
144
140
|
}
|
|
145
141
|
|
|
146
|
-
/**
|
|
147
|
-
* A plain bullet's claim: its first sentence, up to a colon that brings in
|
|
148
|
-
* the details. Never inside inline code.
|
|
149
|
-
*/
|
|
150
|
-
function firstClaim(text: string): string {
|
|
151
|
-
let code = false;
|
|
152
|
-
for (let index = 0; index < text.length; index += 1) {
|
|
153
|
-
const char = text[index];
|
|
154
|
-
if (char === "`") code = !code;
|
|
155
|
-
if (code) continue;
|
|
156
|
-
const next = text[index + 1];
|
|
157
|
-
if ((char === "." || char === "!" || char === "?") && (next === undefined || next === " ")) return text.slice(0, index + 1);
|
|
158
|
-
if (char === ":" && next === " ") return `${text.slice(0, index)}.`;
|
|
159
|
-
}
|
|
160
|
-
return text;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* An update's top highlight: the claim of the first bullet of its notes, a
|
|
165
|
-
* plain bullet's first sentence, or its title when the notes have no bullet.
|
|
166
|
-
*/
|
|
167
|
-
export function topHighlight(release: ChangelogRelease): ChangelogHighlight {
|
|
168
|
-
const versions = [release.version.replace(/^v/i, "")];
|
|
169
|
-
const bullet = release.body.split(/\r?\n/).map((line) => line.trim().match(BULLET)?.[1]).find(Boolean);
|
|
170
|
-
if (!bullet) return { lead: release.title, detail: "", versions };
|
|
171
|
-
const lead = bullet.startsWith("**") ? splitLead(bullet).lead : firstClaim(bullet.replace(PULL_REFS, ""));
|
|
172
|
-
return { lead, detail: "", versions };
|
|
173
|
-
}
|
|
174
|
-
|
|
175
142
|
function fallbackTitle(releases: ChangelogRelease[], minor: string): string {
|
|
176
143
|
const first = releases.find((release) => release.version.replace(/^v/i, "") === `${minor}.0`) ?? releases.at(-1);
|
|
177
144
|
return first?.title ?? `Version ${minor}`;
|
|
@@ -190,10 +157,10 @@ function compareMinors(left: string, right: string): number {
|
|
|
190
157
|
|
|
191
158
|
/**
|
|
192
159
|
* The releases (newest first) as one version per minor, the highest first. A
|
|
193
|
-
* version's title
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
160
|
+
* version's title comes from its summary, else from its first update, so a
|
|
161
|
+
* missing or half-written summary never empties a row. With `cut`, the list
|
|
162
|
+
* stopped at its limit, so its oldest version may be missing updates and is
|
|
163
|
+
* left out.
|
|
197
164
|
*/
|
|
198
165
|
export function groupChangelogVersions(
|
|
199
166
|
releases: ChangelogRelease[],
|
|
@@ -210,22 +177,14 @@ export function groupChangelogVersions(
|
|
|
210
177
|
|
|
211
178
|
const versions = [...byMinor]
|
|
212
179
|
.sort(([left], [right]) => compareMinors(left, right))
|
|
213
|
-
.map(([minor, group]): ChangelogVersion => {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
minor,
|
|
222
|
-
title: summary?.title ?? fallbackTitle(group, minor),
|
|
223
|
-
highlights,
|
|
224
|
-
releases: group,
|
|
225
|
-
firstPublishedAt: group.at(-1)?.publishedAt ?? "",
|
|
226
|
-
lastPublishedAt: group[0]?.publishedAt ?? "",
|
|
227
|
-
};
|
|
228
|
-
});
|
|
180
|
+
.map(([minor, group]): ChangelogVersion => ({
|
|
181
|
+
id: /^\d+\.\d+$/.test(minor) ? `v${minor}` : minor,
|
|
182
|
+
minor,
|
|
183
|
+
title: summaries.get(minor)?.title ?? fallbackTitle(group, minor),
|
|
184
|
+
releases: group,
|
|
185
|
+
firstPublishedAt: group.at(-1)?.publishedAt ?? "",
|
|
186
|
+
lastPublishedAt: group[0]?.publishedAt ?? "",
|
|
187
|
+
}));
|
|
229
188
|
return cut && versions.length > 1 ? versions.slice(0, -1) : versions;
|
|
230
189
|
}
|
|
231
190
|
|
|
@@ -235,16 +194,6 @@ export function versionOfRelease(versions: ChangelogVersion[], releaseId: string
|
|
|
235
194
|
return versions.find((version) => version.releases.some((release) => release.id === releaseId)) ?? null;
|
|
236
195
|
}
|
|
237
196
|
|
|
238
|
-
/** A version's highlights as the markdown list its detail shows, each naming its updates. */
|
|
239
|
-
export function highlightsMarkdown(version: ChangelogVersion): string {
|
|
240
|
-
return version.highlights.map((highlight) => {
|
|
241
|
-
const claim = `**${highlight.lead}**`;
|
|
242
|
-
const detail = highlight.detail ? ` ${highlight.detail}` : "";
|
|
243
|
-
const shipped = highlight.versions.length ? ` (${highlight.versions.join(", ")})` : "";
|
|
244
|
-
return `- ${claim}${detail}${shipped}`;
|
|
245
|
-
}).join("\n");
|
|
246
|
-
}
|
|
247
|
-
|
|
248
197
|
export type ChangelogVersionColumnId = "date" | "version" | "title" | "updates";
|
|
249
198
|
|
|
250
199
|
export interface ChangelogVersionSort {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "../../../time-series/field-catalog";
|
|
6
6
|
import type { SeriesCatalogEntry, SeriesFrequency, SeriesInput, SeriesPlacement } from "../../../series/types";
|
|
7
7
|
import { parseOptionSymbol } from "../../../utils/options";
|
|
8
|
-
import type
|
|
8
|
+
import { hasCompanyFields, type SeriesCatalogInstrument } from "./series-catalog";
|
|
9
9
|
import { macroReleaseTopic } from "../shared/macro-releases";
|
|
10
10
|
|
|
11
11
|
export const CHART_COMPOSER_TEMPLATE_ID = "chart-composer-pane";
|
|
@@ -262,7 +262,10 @@ export function catalogRowsForResolvedInstruments(
|
|
|
262
262
|
const symbol = catalogTickerFromInput(instrument.symbol);
|
|
263
263
|
if (!symbol) return [];
|
|
264
264
|
const input = instrumentInput(instrument);
|
|
265
|
-
|
|
265
|
+
// An index or a currency pair has prices, not a company's revenue or EPS.
|
|
266
|
+
const companyFields = hasCompanyFields(instrument);
|
|
267
|
+
return templates.filter((row) => row.input === input
|
|
268
|
+
&& (companyFields || !row.id.startsWith("field:") || row.id.startsWith("field:market."))).map((row): CatalogSeriesRow => {
|
|
266
269
|
const expression = fillTemplate(row.template, symbol);
|
|
267
270
|
return {
|
|
268
271
|
...row,
|
|
@@ -84,6 +84,7 @@ export function SeriesEditorDialog({ dialogId, resolve, initialSpec }: SeriesEdi
|
|
|
84
84
|
return (
|
|
85
85
|
<DialogFrame
|
|
86
86
|
title="Chart Series"
|
|
87
|
+
onClose={() => resolve(null)}
|
|
87
88
|
footer={[...navigationKeys, ...seriesKeys].join(" · ")}
|
|
88
89
|
// The desktop's fields take the pointer and arrows like any form.
|
|
89
90
|
desktopFooter={selected
|
|
@@ -1394,7 +1394,7 @@ function ChartComposerSurface({
|
|
|
1394
1394
|
spec={spec}
|
|
1395
1395
|
setSpec={setSpec}
|
|
1396
1396
|
focused={focused}
|
|
1397
|
-
width={Math.max(8,
|
|
1397
|
+
width={Math.max(8, width - 1)}
|
|
1398
1398
|
height={height}
|
|
1399
1399
|
shortcutEnabled={surfaceInteractive}
|
|
1400
1400
|
shortcutBlocked={dialogOpen}
|
|
@@ -29,7 +29,8 @@ const CHART_TOOLBAR_HEIGHT = 1;
|
|
|
29
29
|
const MINIMUM_CHART_HEIGHT = 4;
|
|
30
30
|
const QUICK_ADD_ROW_HEIGHT = 1;
|
|
31
31
|
const IDLE_QUICK_ADD_WIDTH = 14;
|
|
32
|
-
|
|
32
|
+
/** A pair's price row (`USDC-USD · Price (OHLCV)`) and its `Chart bars` fit whole. */
|
|
33
|
+
const ACTIVE_QUICK_ADD_WIDTH = 40;
|
|
33
34
|
|
|
34
35
|
interface ClosestElementLike {
|
|
35
36
|
closest(selector: string): {
|
|
@@ -474,6 +475,8 @@ export function ChartSeriesQuickAdd({
|
|
|
474
475
|
surface="plain"
|
|
475
476
|
bgColor={colors.panel}
|
|
476
477
|
scrollable={items.length > drawerHeight}
|
|
478
|
+
// A scrollbar would take the rows' last column, where a press must add the row like the rest of it.
|
|
479
|
+
scrollbar={false}
|
|
477
480
|
rowGap={0}
|
|
478
481
|
selectOnHover
|
|
479
482
|
onSelect={(index) => setSelectedIndex(index - (searchError ? 1 : 0))}
|
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
import { parseSeriesExpression, type ParsedSeriesExpression } from "./series-expression";
|
|
18
18
|
import { parseFormulaExpression } from "./formula";
|
|
19
19
|
import { currencyCodeLabel } from "../../../utils/currency-units";
|
|
20
|
+
import { classifyInstrumentType, kindFromListingSyntax } from "../../../tickers/instrument-kind";
|
|
21
|
+
import { isCryptoPairSymbol } from "../../../utils/crypto-pair";
|
|
20
22
|
|
|
21
23
|
export interface SeriesCatalogInstrument {
|
|
22
24
|
symbol: string;
|
|
@@ -204,7 +206,9 @@ export function fieldCategory(field: TimeSeriesFieldDefinition): string {
|
|
|
204
206
|
return "Fundamentals";
|
|
205
207
|
}
|
|
206
208
|
|
|
209
|
+
/** A market field is drawn at the chart's own bar size (1m on a day's chart), never fixed at its daily default. */
|
|
207
210
|
function fieldFrequency(field: TimeSeriesFieldDefinition): string {
|
|
211
|
+
if (field.id.startsWith("market.")) return "Chart bars";
|
|
208
212
|
return field.nativeFrequency === "auto"
|
|
209
213
|
? "Automatic"
|
|
210
214
|
: `${field.nativeFrequency[0]!.toUpperCase()}${field.nativeFrequency.slice(1)}`;
|
|
@@ -425,6 +429,17 @@ export function buildCapabilitySeriesSuggestions(
|
|
|
425
429
|
}));
|
|
426
430
|
}
|
|
427
431
|
|
|
432
|
+
/**
|
|
433
|
+
* Whether a listing can have company fields (revenue, EPS, valuation): not a coin, a currency pair, an index or a
|
|
434
|
+
* future, which have prices alone. A coin's add-series list offered Revenue, Net Income and EPS.
|
|
435
|
+
*/
|
|
436
|
+
export function hasCompanyFields(instrument: SeriesCatalogInstrument): boolean {
|
|
437
|
+
const kind = classifyInstrumentType(instrument.assetCategory)
|
|
438
|
+
?? kindFromListingSyntax(instrument.symbol, instrument.exchange)
|
|
439
|
+
?? (isCryptoPairSymbol(instrument.symbol.trim().toUpperCase()) ? "crypto" : null);
|
|
440
|
+
return kind == null || kind === "equity" || kind === "fund" || kind === "other";
|
|
441
|
+
}
|
|
442
|
+
|
|
428
443
|
export function buildSeriesCatalogSuggestions(
|
|
429
444
|
query: string,
|
|
430
445
|
defaultInstrument: SeriesCatalogInstrument,
|
|
@@ -455,7 +470,8 @@ export function buildSeriesCatalogSuggestions(
|
|
|
455
470
|
for (const instrument of instruments) {
|
|
456
471
|
const instrumentKey = publicTickerKey(instrument.symbol, instrument.exchange);
|
|
457
472
|
const instrumentLabel = canonicalTickerKey(instrument.symbol, instrument.exchange);
|
|
458
|
-
|
|
473
|
+
const fields = hasCompanyFields(instrument) ? rankedFields : rankedFields.filter(({ field }) => field.id.startsWith("market."));
|
|
474
|
+
for (const { field } of fields.slice(0, fieldLimit)) {
|
|
459
475
|
const expression: ParsedSeriesExpression = {
|
|
460
476
|
kind: "security",
|
|
461
477
|
symbol: instrument.symbol,
|
|
@@ -215,7 +215,8 @@ function rawArgumentFor(manifest: ClientToolManifest, args: Record<string, JsonV
|
|
|
215
215
|
}
|
|
216
216
|
case "tickers":
|
|
217
217
|
case "symbol-list": {
|
|
218
|
-
|
|
218
|
+
// One ticker as `symbol`, as a call to a function that took one (FA before it read several) names it.
|
|
219
|
+
const symbols = args.symbols ?? (typeof args.symbol === "string" ? [args.symbol] : undefined);
|
|
219
220
|
if (symbols == null && manifest.argument.optional) return "";
|
|
220
221
|
if (!Array.isArray(symbols) || !symbols.every((symbol) => typeof symbol === "string")) {
|
|
221
222
|
throw new Error(`${manifest.name} requires a symbols array.`);
|
|
@@ -216,8 +216,9 @@ function clientToolCommand(catalog: PaneFunctionCatalog, found: CatalogFunction,
|
|
|
216
216
|
if (!headless) return null;
|
|
217
217
|
const arg = headless.argument.kind === "ticker"
|
|
218
218
|
? text(args.symbol)
|
|
219
|
+
// A call made while the function took one ticker (FA before it read several) named it as `symbol`.
|
|
219
220
|
: headless.argument.kind === "tickers" || headless.argument.kind === "symbol-list"
|
|
220
|
-
? symbols(args.symbols).join(",")
|
|
221
|
+
? symbols(args.symbols ?? args.symbol).join(",")
|
|
221
222
|
: headless.argument.kind === "free-text"
|
|
222
223
|
? text(args.text)
|
|
223
224
|
: "";
|
|
@@ -119,6 +119,8 @@ const askgModule: PluginModule = {
|
|
|
119
119
|
description: "Ask a question about your panes and watch the tools Gloom runs",
|
|
120
120
|
keywords: ["ask", "gloom", "assistant", "ai", "question", "askg"],
|
|
121
121
|
shortcut: { prefix: "ASKG", argPlaceholder: "question", argKind: "text" },
|
|
122
|
+
// createInstance asks the open pane a question, so catalog discovery must not run it with a sample one.
|
|
123
|
+
catalogSettings: {},
|
|
122
124
|
createInstance: (_context, options) => {
|
|
123
125
|
// The question is handed to the pane directly, so it is never persisted
|
|
124
126
|
// with the layout and never replayed on the next launch.
|
|
@@ -31,6 +31,8 @@ export const thesisModule: PluginModule = {
|
|
|
31
31
|
description: "Every thesis you and your teams hold, sorted by what needs a ruling",
|
|
32
32
|
keywords: ["thesis", "theses", "conviction", "invalidation", "kill", "pillars", "journal"],
|
|
33
33
|
shortcut: { prefix: "THESIS", argPlaceholder: "tickers (optional)", argKind: "text" },
|
|
34
|
+
// createInstance starts a thesis in the open board, so catalog discovery must not run it with a sample ticker.
|
|
35
|
+
catalogSettings: {},
|
|
34
36
|
createInstance: (_context, options) => {
|
|
35
37
|
// `THESIS NVDA` opens that thesis or starts one; `THESIS NVDA AMD` starts a pair. The params name the
|
|
36
38
|
// ticker to a board that is drawn without the request (a capture), which shows it without starting one.
|
|
@@ -11,6 +11,7 @@ import { chatController, type ChatController } from "../chat/controller";
|
|
|
11
11
|
import { useCloudPlanAction, useCloudUpgradeAction } from "../shared/cloud-upgrade";
|
|
12
12
|
import { CLOUD_QUOTE_DELAY_MINUTES, resolvePlanAccess } from "../../../api-client/plan-access";
|
|
13
13
|
import { useTrialOfferShowing } from "./trial-offer-status-widget";
|
|
14
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
14
15
|
import {
|
|
15
16
|
NARROW_STATUS_BAR_COLUMNS,
|
|
16
17
|
STATUS_WIDGET_COLUMNS,
|
|
@@ -86,16 +87,19 @@ export function CloudUpgradeStatusWidget({ controller = chatController }: CloudU
|
|
|
86
87
|
|
|
87
88
|
const mark = <DelayedMark minutes={CLOUD_QUOTE_DELAY_MINUTES} />;
|
|
88
89
|
const detail = tf("{delay} delayed", { delay: `${CLOUD_QUOTE_DELAY_MINUTES}m` });
|
|
90
|
+
// What is late, and by how much: stock quotes. A crypto exchange's own prices are not held back.
|
|
91
|
+
const reason = tf("Stock quotes are {minutes} min delayed without Pro.", { minutes: CLOUD_QUOTE_DELAY_MINUTES });
|
|
92
|
+
const upgrade = () => { openUpgrade({ reason }).catch(logFailure("cloud.upgrade-status-widget", "Open upgrade from the delayed mark failed")); };
|
|
89
93
|
return (
|
|
90
94
|
<Box flexDirection="row" alignItems="center" flexShrink={0} paddingRight={1} data-gloom-role="delayed-status">
|
|
91
95
|
{spelled ? (
|
|
92
96
|
<Button
|
|
93
97
|
label={detail}
|
|
94
|
-
title={`${
|
|
98
|
+
title={`${reason} ${tf("Upgrade to Pro ({key}, then {command})", { key: commandBarKey, command: "UPGRADE" })}`}
|
|
95
99
|
variant="plain"
|
|
96
100
|
compact
|
|
97
101
|
stopPropagation
|
|
98
|
-
onPress={
|
|
102
|
+
onPress={upgrade}
|
|
99
103
|
>
|
|
100
104
|
<Box flexDirection="row" alignItems="center" gap={1}>
|
|
101
105
|
{mark}
|
|
@@ -2,7 +2,7 @@ import { MISSING_VALUE } from "../../../utils/format";
|
|
|
2
2
|
import type { CpiRow } from "../../../api-client/cpi";
|
|
3
3
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
4
4
|
import { fetchCpiBoard } from "./client";
|
|
5
|
-
import { cpiHeaderLine, cpiMonth, cpiRowOption, cpiRows } from "./model";
|
|
5
|
+
import { cpiHeaderLine, cpiHeadlineYearGapLine, cpiMonth, cpiRowOption, cpiRows, cpiYearGapLine } from "./model";
|
|
6
6
|
|
|
7
7
|
/** Two decimals; a value that rounds to zero reads 0.00, never -0.00. */
|
|
8
8
|
const percent = (value: unknown) => typeof value === "number" ? (Number(value.toFixed(2)) === 0 ? "0.00" : value.toFixed(2)) : MISSING_VALUE;
|
|
@@ -29,6 +29,8 @@ const SUMMARY_COLUMNS = [
|
|
|
29
29
|
{ key: "contributionYear", header: "Y/Y pts", align: "right" as const, format: percent },
|
|
30
30
|
];
|
|
31
31
|
|
|
32
|
+
const notesOf = (note: string | null) => note ? { notes: [note] } : {};
|
|
33
|
+
|
|
32
34
|
/** The selected row's months against the headline's year over year: the chart as a table. */
|
|
33
35
|
function historyRows(row: CpiRow, headline: CpiRow | null) {
|
|
34
36
|
const headlineYear = new Map((headline?.history ?? []).map(([month, , yoy]) => [month, yoy]));
|
|
@@ -73,6 +75,8 @@ export const cpiHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
73
75
|
rows: historyRows(row, headline) },
|
|
74
76
|
],
|
|
75
77
|
errors: data.gaps,
|
|
78
|
+
// Why the month's y/y is empty (no October 2025 index), and the latest the row has.
|
|
79
|
+
...notesOf(cpiYearGapLine(data, row)),
|
|
76
80
|
freshness,
|
|
77
81
|
metadata: { ...metadata, rows: [row] },
|
|
78
82
|
};
|
|
@@ -80,6 +84,7 @@ export const cpiHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
80
84
|
return {
|
|
81
85
|
sections: [{ title: header, columns: SUMMARY_COLUMNS, rows: cpiRows(data).map((row) => reportRow(row)) }],
|
|
82
86
|
errors: data.gaps,
|
|
87
|
+
...notesOf(cpiHeadlineYearGapLine(data)),
|
|
83
88
|
freshness,
|
|
84
89
|
metadata,
|
|
85
90
|
};
|